html_url
stringlengths 51
51
| title
stringlengths 6
280
| comments
stringlengths 67
24.7k
| body
stringlengths 51
36.2k
| __index_level_0__
int64 1
1.17k
| comment_length
int64 16
1.45k
| text
stringlengths 190
38.3k
| embeddings
sequence |
---|---|---|---|---|---|---|---|
https://github.com/huggingface/datasets/issues/5156 | Unable to download dataset using Azure Data Lake Gen 2 | Thank you @lhoestq . Great call.
Using the default class from `known_implementations` dict solved my problem
```
known_implementations[‘abfs’] = {‘class’: ‘adlfs.AzureBlobFileSystem’}
```
I'm closing this issue. | ### Describe the bug
When using the DatasetBuilder method with the credentials for the cloud storage Azure Data Lake (adl) Gen2, the following error is showed:
```
Traceback (most recent call last):
File "download_hf_dataset.py", line 143, in <module>
main()
File "download_hf_dataset.py", line 102, in main
builder.download_and_prepare(save_dir, storage_options=storage_options, max_shard_size="250MB", file_format="parquet")
File "/home/clarisses/miniconda3/envs/hf_datasets_env/lib/python3.8/site-packages/datasets/builder.py", line 671, in download_and_prepare
fs_token_paths = fsspec.get_fs_token_paths(output_dir, storage_options=storage_options)
File "/home/clarisses/miniconda3/envs/hf_datasets_env/lib/python3.8/site-packages/fsspec/core.py", line 639, in get_fs_token_paths
fs = cls(**options)
File "/home/clarisses/miniconda3/envs/hf_datasets_env/lib/python3.8/site-packages/fsspec/spec.py", line 76, in __call__
obj = super().__call__(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'account_name'
```
If I don't pass the storage_options argument (leave it as None), it requires the credentials used in ADL Gen 1:
`TypeError: __init__() missing 3 required positional arguments: 'tenant_id', 'client_id', and 'client_secret'`
Thus, it is not possible to download a dataset from the cloud using Azure Data Lake (adl) Gen2.
### Steps to reproduce the bug
Assuming that you have an account on Azure and at Storage Account that can be used for reproduce:
1. Create a dict with the format to connect to Azure Data Lake Gen 2
```
storage_options = {"account_name": ACCOUNT_NAME, "account_key": ACCOUNT_KEY) # gen 2 filesystem
```
2. Create a dataset builder for any HF hosted dataset
```
builder = load_dataset_builder(dataset_name)
```
3. Try to download the dataset passing the storage_options as an argument
```
save_dir = 'adl://my_save_dir'
builder.download_and_prepare(save_dir, storage_options=storage_options, max_shard_size="250MB", file_format="parquet")
```
### Expected behavior
Not seeing the error mentioned above and being able to download the dataset to the provided path on ADL
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-46-generic-x86_64-with-glibc2.17
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1 | 458 | 26 | Unable to download dataset using Azure Data Lake Gen 2
### Describe the bug
When using the DatasetBuilder method with the credentials for the cloud storage Azure Data Lake (adl) Gen2, the following error is showed:
```
Traceback (most recent call last):
File "download_hf_dataset.py", line 143, in <module>
main()
File "download_hf_dataset.py", line 102, in main
builder.download_and_prepare(save_dir, storage_options=storage_options, max_shard_size="250MB", file_format="parquet")
File "/home/clarisses/miniconda3/envs/hf_datasets_env/lib/python3.8/site-packages/datasets/builder.py", line 671, in download_and_prepare
fs_token_paths = fsspec.get_fs_token_paths(output_dir, storage_options=storage_options)
File "/home/clarisses/miniconda3/envs/hf_datasets_env/lib/python3.8/site-packages/fsspec/core.py", line 639, in get_fs_token_paths
fs = cls(**options)
File "/home/clarisses/miniconda3/envs/hf_datasets_env/lib/python3.8/site-packages/fsspec/spec.py", line 76, in __call__
obj = super().__call__(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'account_name'
```
If I don't pass the storage_options argument (leave it as None), it requires the credentials used in ADL Gen 1:
`TypeError: __init__() missing 3 required positional arguments: 'tenant_id', 'client_id', and 'client_secret'`
Thus, it is not possible to download a dataset from the cloud using Azure Data Lake (adl) Gen2.
### Steps to reproduce the bug
Assuming that you have an account on Azure and at Storage Account that can be used for reproduce:
1. Create a dict with the format to connect to Azure Data Lake Gen 2
```
storage_options = {"account_name": ACCOUNT_NAME, "account_key": ACCOUNT_KEY) # gen 2 filesystem
```
2. Create a dataset builder for any HF hosted dataset
```
builder = load_dataset_builder(dataset_name)
```
3. Try to download the dataset passing the storage_options as an argument
```
save_dir = 'adl://my_save_dir'
builder.download_and_prepare(save_dir, storage_options=storage_options, max_shard_size="250MB", file_format="parquet")
```
### Expected behavior
Not seeing the error mentioned above and being able to download the dataset to the provided path on ADL
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-46-generic-x86_64-with-glibc2.17
- Python version: 3.8.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
Thank you @lhoestq . Great call.
Using the default class from `known_implementations` dict solved my problem
```
known_implementations[‘abfs’] = {‘class’: ‘adlfs.AzureBlobFileSystem’}
```
I'm closing this issue. | [
-1.3055663108825684,
-0.9339799880981445,
-0.6370927691459656,
1.518212080001831,
-0.18271560966968536,
-1.2515560388565063,
0.1553952544927597,
-1.088602900505066,
1.5381349325180054,
-0.7773529887199402,
0.23737233877182007,
-1.582140326499939,
-0.06893029808998108,
-0.5187291502952576,
-0.7120531797409058,
-0.8178710341453552,
-0.37972280383110046,
-0.8908596038818359,
1.1374229192733765,
2.4453346729278564,
1.3546334505081177,
-1.3606544733047485,
2.7831997871398926,
0.6893303990364075,
-0.2600065767765045,
-1.024649739265442,
0.47560057044029236,
-0.028523126617074013,
-1.1273400783538818,
-0.5334514379501343,
-0.9156175851821899,
-0.04372023418545723,
-0.5897505879402161,
-0.3379102647304535,
0.02436034008860588,
0.525507926940918,
-0.3222771883010864,
-0.33023038506507874,
-0.5958847999572754,
-0.7895135879516602,
0.5308963656425476,
-0.3170122802257538,
0.9138679504394531,
-0.33258795738220215,
1.7404882907867432,
-0.5951719880104065,
0.4480222761631012,
0.734560489654541,
1.3398548364639282,
0.15684975683689117,
0.028021149337291718,
0.2875770628452301,
0.2886990010738373,
-0.042193640023469925,
0.6192758679389954,
1.199276328086853,
0.6381300687789917,
0.5184189677238464,
0.6754369735717773,
-2.209116220474243,
1.3369914293289185,
-1.0141371488571167,
0.23490211367607117,
1.3490468263626099,
-0.8202788829803467,
0.3563518822193146,
-1.737609624862671,
-0.07326121628284454,
0.6674972772598267,
-2.2979156970977783,
0.35628369450569153,
-1.2531764507293701,
-0.48573821783065796,
0.9665502309799194,
0.35382628440856934,
-1.2191654443740845,
0.183322936296463,
-0.5439212322235107,
1.1601760387420654,
0.41412588953971863,
1.0125453472137451,
-1.6835640668869019,
-0.03978275507688522,
-0.1321871429681778,
0.08395642042160034,
-1.3313318490982056,
-1.6704565286636353,
0.5832203030586243,
0.4758339524269104,
0.6945651173591614,
-0.06711091846227646,
1.1178911924362183,
-1.1197141408920288,
0.8385964632034302,
-1.0340757369995117,
-1.5420277118682861,
-1.4350134134292603,
-2.4677844047546387,
-2.269376039505005,
0.7376488447189331,
-0.5565704703330994,
-0.5570863485336304,
2.0598864555358887,
-0.9703062176704407,
-1.6908224821090698,
1.0878558158874512,
0.2530708611011505,
0.1406380534172058,
2.4099209308624268,
0.19371958076953888,
-0.7395274043083191,
0.5144197344779968,
-0.7582974433898926,
0.876574695110321,
-0.26058122515678406,
1.3007997274398804,
0.47873157262802124,
-1.0228501558303833,
1.52268385887146,
-0.38893112540245056,
0.615577757358551,
-0.6124723553657532,
-0.6102359890937805,
-0.8219630122184753,
0.25973987579345703,
1.8273624181747437,
-0.23310163617134094,
1.5578303337097168,
-0.38022512197494507,
-1.4986121654510498,
-1.6015772819519043,
0.8804619312286377,
0.3703829348087311,
-0.9287350177764893,
0.10204675793647766,
-0.5168535113334656,
0.2230471521615982,
-0.023903075605630875,
1.1521435976028442,
1.2772480249404907,
0.6434146761894226,
-0.4152875542640686,
-0.7982641458511353,
0.17581090331077576,
-0.16604700684547424,
-0.6645585298538208,
-1.8283789157867432,
-0.29277610778808594,
0.1033572107553482,
0.6202200651168823,
-1.178902268409729,
1.7894365787506104,
0.8751453757286072,
1.9683794975280762,
0.9620503187179565,
-0.39699140191078186,
1.4102836847305298,
-0.03474970906972885,
1.848149299621582,
-0.5087153911590576,
0.5708974599838257,
-0.3465714454650879,
-1.1692123413085938,
0.9515199065208435,
-0.3586892783641815,
-2.06184720993042,
-0.8329069018363953,
-0.6675763130187988,
-0.2716193199157715,
-0.7246535420417786,
0.8357195854187012,
-0.3537084460258484,
-1.462433934211731,
0.15777459740638733,
-0.6479330062866211,
0.2714078724384308,
-1.1633309125900269,
0.29097217321395874,
0.7107000350952148,
-0.708408534526825,
-0.055086661130189896,
-0.2500140368938446,
-1.2350618839263916,
-0.5541123151779175,
0.4131917357444763,
1.9425370693206787,
-0.5888658761978149,
0.8876703381538391,
1.050605297088623,
-0.743401050567627,
0.14169231057167053,
0.09436006844043732,
-0.3029230535030365,
0.7556501626968384,
-1.0646212100982666,
-0.5301432013511658,
1.2159395217895508,
-0.39921796321868896,
-0.7018043398857117,
1.4014372825622559,
0.6790946125984192,
-1.1383440494537354,
-0.2535807490348816,
-0.22667370736598969,
-0.9422149062156677,
0.05755462870001793,
-1.4535683393478394,
-0.2552393078804016,
0.4785776138305664,
-1.533705711364746,
-0.32536572217941284,
-0.1297817826271057,
1.3982534408569336,
-0.2535143494606018,
1.486185908317566,
-0.38034364581108093,
-0.10045543313026428,
-0.21833501756191254,
-0.4836762845516205,
0.2444370836019516,
-0.1332167685031891,
-0.5330819487571716,
0.10767783224582672,
-0.8577722311019897,
0.3070138990879059,
1.4099678993225098,
0.31732863187789917,
0.0665956437587738,
0.3678574860095978,
1.140134334564209,
0.4499151408672333,
-0.06577567756175995,
-0.7888510227203369,
-1.5377123355865479,
1.9575212001800537,
-1.4357752799987793,
1.9625731706619263,
0.7882670760154724,
-0.017608020454645157,
-1.7547770738601685,
-1.817702054977417,
1.225144386291504,
1.1396567821502686,
2.277315616607666,
0.48482897877693176,
0.35267332196235657,
-0.7873963713645935,
-0.7477030754089355,
0.35194480419158936,
-1.0319405794143677,
-0.6248438358306885,
0.09099972248077393,
2.3643980026245117,
1.7676644325256348,
-0.48493337631225586,
-0.20431643724441528,
-0.8096779584884644,
1.3342416286468506,
-0.2608674466609955,
0.34075433015823364,
2.037243604660034,
-0.25195398926734924,
-1.000491976737976,
1.3361127376556396,
-2.4671835899353027,
0.3278373181819916,
2.1250667572021484,
0.2679760158061981,
0.23660896718502045,
-1.3548436164855957,
-0.5651460289955139,
-0.32335224747657776,
-0.39221858978271484,
-1.2208142280578613,
0.5400169491767883,
-0.25240010023117065,
-0.7621573209762573,
-1.4108818769454956,
0.1192992776632309,
-1.2075475454330444,
-1.6944421529769897,
0.3060058653354645,
2.031778573989868,
2.141371011734009,
-0.7292448282241821,
1.464737892150879,
-0.3248143792152405,
-0.0051330700516700745,
1.2383378744125366,
1.3718562126159668,
3.012822151184082,
1.776247501373291,
-1.267378807067871,
0.6026439666748047,
-0.18778784573078156,
-0.5100262761116028,
1.1534450054168701,
-1.134832501411438,
1.2251085042953491,
-0.13087202608585358,
-1.1728178262710571,
-1.3211110830307007,
1.0322822332382202,
0.5190269947052002,
0.01112845167517662,
-0.4867505133152008,
1.2696659564971924,
0.11226920783519745,
1.3484405279159546,
0.5792814493179321,
-0.40263429284095764,
0.44269153475761414,
-0.3922944664955139,
-0.5786531567573547,
1.5705844163894653,
0.18330836296081543,
-1.568583369255066,
-2.2703449726104736,
-0.22631941735744476,
-0.840167224407196,
0.07167704403400421,
-0.6489734649658203,
-0.9969691038131714,
1.6089116334915161,
0.31609806418418884,
-1.1449782848358154,
-0.28699466586112976,
-0.30358532071113586,
-0.4736955761909485,
2.6790409088134766,
-1.2262135744094849,
-0.12960834801197052,
-0.9172775149345398,
-0.6093711853027344,
1.60001802444458,
-1.2837283611297607,
-0.30733171105384827,
-1.0178223848342896,
-0.6919467449188232,
-1.2020355463027954,
-0.4063784182071686,
0.07365015149116516,
-1.0842294692993164,
0.7538976669311523,
0.21353532373905182,
-1.1757714748382568,
-0.32510194182395935,
-0.8711580634117126,
1.092350959777832,
-0.15453311800956726,
0.18918077647686005,
1.8015528917312622,
0.24377702176570892,
-0.4345385432243347,
0.8852428793907166,
1.2229042053222656,
0.6324158310890198,
-0.5833877325057983,
0.015265077352523804,
-0.6641902327537537,
0.45885971188545227,
-1.3113985061645508,
0.3057350218296051,
-3.0223283767700195,
0.6958982348442078,
-0.1184551864862442,
-0.1414049118757248,
-0.08110637962818146,
-1.3801543712615967,
1.086761236190796,
2.5769710540771484,
-1.221452236175537,
0.515534520149231,
0.4541272222995758,
1.1182972192764282,
-1.6614898443222046,
0.32248446345329285,
-0.4707965850830078,
2.0939481258392334,
0.18045327067375183,
1.279165506362915,
-0.5312393307685852,
-2.302466869354248,
0.6694516539573669,
-1.1907068490982056,
-1.133863925933838,
0.7701993584632874,
-0.9651479721069336,
0.29544416069984436,
-1.49066162109375,
-0.21846355497837067,
-0.9255252480506897,
-1.2403645515441895,
0.6251598000526428,
0.12539690732955933,
0.32752469182014465,
-0.4817420542240143,
0.29562944173812866,
-2.187777519226074,
-1.4485979080200195,
-0.20134058594703674,
-1.0553076267242432,
0.6271263957023621,
-0.5566990375518799,
0.5757216811180115,
-0.0677320808172226,
0.08666135370731354,
0.29299503564834595,
1.5532293319702148,
3.441197156906128,
0.18536512553691864,
0.15392404794692993,
-0.20293405652046204,
-0.9528741836547852,
1.4968903064727783,
0.8309082984924316,
-0.15351097285747528,
-0.5863400101661682,
-1.020678162574768,
1.3787578344345093,
2.0367894172668457,
0.9867345094680786,
0.04964270070195198,
-0.7859752178192139,
-0.664581298828125,
-0.055850762873888016,
0.17321117222309113,
0.5565319061279297,
0.9672759771347046,
0.026471462100744247,
0.030555669218301773,
1.3612210750579834,
1.1823610067367554,
-0.38645532727241516,
0.2889902889728546,
-0.9081436991691589,
-0.436259388923645,
0.40735751390457153,
0.14767813682556152,
-0.02072654291987419,
0.5422225594520569,
-0.8888353705406189,
-0.2852743864059448,
-0.34964805841445923,
-0.8167322278022766,
-0.7389818429946899,
-0.3834780752658844,
-0.485384464263916,
1.5477025508880615,
0.18716423213481903,
-0.543795645236969,
0.03385099396109581,
-0.6411123871803284,
-0.19016803801059723,
-1.102841854095459,
0.1623845398426056,
-0.057316869497299194,
-0.19634731113910675,
-0.22880586981773376,
1.5419927835464478,
-0.9056923389434814,
-2.1520566940307617,
0.12349267303943634,
0.29765376448631287,
-0.20242421329021454,
0.1445303112268448,
1.7713658809661865,
0.41600415110588074,
1.4149303436279297,
1.2968385219573975,
0.9244110584259033,
-0.6017489433288574,
-1.2238285541534424,
0.8050541281700134,
0.9498023986816406,
-1.4190181493759155,
0.8732976913452148,
-0.18086685240268707,
-0.4929240942001343,
0.6648204922676086,
1.3241310119628906,
0.4954136610031128,
-1.9865026473999023,
1.0052366256713867,
-1.1207847595214844,
0.897157609462738,
0.7571284770965576,
0.6913658976554871,
0.25363317131996155,
0.9601348638534546,
-1.1339521408081055,
-1.1454664468765259,
-0.6602795720100403,
-0.7586822509765625,
1.9350372552871704,
-0.392011433839798,
0.6361229419708252,
-0.16010956466197968,
-1.2184982299804688,
-0.16917918622493744,
0.7802086472511292,
0.334751158952713,
-0.4040471017360687,
0.922117292881012,
-0.7115762233734131,
-0.9015064835548401,
-1.2698025703430176,
-0.3975406289100647,
-1.0815931558609009,
-0.8985148668289185,
0.9785727858543396,
0.7736682295799255,
0.3783482611179352,
1.8949507474899292,
0.5847364664077759,
0.39044952392578125,
-2.5628297328948975,
0.9183182120323181,
0.29388704895973206,
-0.10437275469303131,
0.8799058794975281,
0.30729490518569946,
1.122544288635254,
0.05618869885802269,
0.5819403529167175,
-2.3808043003082275,
2.249598979949951,
-0.13080057501792908,
0.6309564113616943,
0.02695823833346367,
-0.19967995584011078,
1.179633617401123,
0.6097840070724487,
0.4945497512817383,
-1.1029417514801025,
0.7557241320610046,
-0.5172338485717773,
1.1341134309768677,
0.9315266013145447,
-0.8454145789146423,
-0.006663105450570583,
1.4550113677978516,
0.4020458459854126,
-0.6151149868965149,
-0.9711251854896545,
-0.8218057751655579,
0.9617633819580078,
1.6354851722717285,
-0.05620989948511124,
-0.03320057690143585,
0.7546395063400269,
0.6448947787284851,
-1.130113124847412,
0.0763830691576004,
-0.571221113204956,
-0.7766161561012268,
1.6711963415145874,
2.048521041870117,
-0.20241296291351318,
-0.2080690562725067,
-0.6548928022384644,
-1.292806625366211,
0.8131005167961121,
-0.1602482944726944,
0.043234262615442276,
0.5007603764533997,
-0.6558998227119446,
0.960068941116333,
0.6644365191459656,
1.0174071788787842,
-0.004286462906748056,
0.26228615641593933,
0.45141172409057617,
-0.3897402882575989,
-1.0700907707214355,
-0.3349473476409912,
-1.0960129499435425,
-2.623753547668457,
0.3267627954483032,
-0.23216521739959717,
-1.4406553506851196,
0.06633169949054718,
-1.0021378993988037,
0.9634718894958496,
-0.5944745540618896,
-1.1971182823181152,
-1.5152186155319214,
0.273663192987442,
-0.09915244579315186,
0.890484631061554,
-1.6920771598815918,
-0.26388487219810486,
1.2639169692993164,
0.7663350701332092,
-0.6689749360084534,
0.9940871596336365,
0.2203364372253418,
1.0058330297470093,
0.7127232551574707,
-0.40298327803611755,
0.6517935395240784,
0.0017228079959750175,
-1.3859564065933228,
0.45628052949905396,
1.2828680276870728,
0.10366210341453552,
1.4376426935195923,
-0.3765840232372284,
0.05574101582169533,
0.4028450548648834,
-0.789033055305481,
-0.5771169662475586,
-0.32140275835990906,
0.7172562479972839,
0.001476941630244255,
-0.9746690392494202,
-0.1768297255039215,
-0.16960595548152924,
-0.3940170109272003,
0.11154608428478241,
-1.5204482078552246,
-0.2762988209724426,
-0.4443203806877136,
-0.4110819697380066,
-1.3589575290679932,
-0.02762611210346222,
1.3845824003219604,
-0.6566575169563293,
-0.27639517188072205,
0.4339933395385742,
0.4578774571418762,
0.5374231934547424,
0.5967727303504944,
-0.7667273283004761,
-0.20273041725158691,
-0.3372591733932495,
-0.21760691702365875,
0.3020455539226532,
1.249624490737915,
-0.004238463006913662,
-0.9276512861251831,
0.6827415227890015,
-0.2968018352985382,
0.16403740644454956,
1.945902705192566,
0.06588247418403625,
-0.6790469288825989,
0.3243478238582611,
-0.795301079750061,
1.782699465751648,
1.6905494928359985,
1.3089269399642944,
-0.15410061180591583,
-0.8677940964698792,
0.6150907278060913,
-0.3481121063232422,
-0.3185221254825592,
0.8363555073738098,
0.4033014178276062,
-0.3200402557849884,
-1.4238946437835693,
0.786585807800293,
1.1259928941726685,
-0.7546641230583191,
-0.7423706650733948,
0.09621404111385345,
-0.8080216646194458,
1.25498366355896,
0.4944864511489868,
0.3093697130680084,
0.2763042449951172,
1.649906039237976,
0.7746667861938477,
-0.4639735519886017,
0.5343502759933472,
0.5916609764099121,
-0.24458158016204834,
-2.0810084342956543,
-1.1357479095458984,
0.3683163821697235,
-0.5120136737823486,
-1.5941447019577026,
1.406769871711731,
-1.051913857460022,
-1.0328516960144043,
0.5710890889167786,
0.03648202121257782,
1.3026098012924194,
0.3987589180469513,
1.661470890045166,
2.105210781097412,
0.835150420665741,
0.5246036052703857,
1.2333953380584717,
-0.17885655164718628,
-0.5100353956222534,
1.8635910749435425,
-0.35266241431236267,
0.45968085527420044,
1.105272650718689,
-0.3847094476222992,
-1.0993565320968628,
-0.782035231590271,
-1.158333420753479,
-0.6691204905509949,
1.176340937614441,
0.14081931114196777,
-1.0103569030761719,
0.21745522320270538,
1.6119005680084229,
0.20816302299499512,
-0.2213551253080368,
0.6347681283950806,
0.45343565940856934,
-0.7991868853569031,
-0.11815838515758514,
-0.8704797029495239,
0.5336028337478638,
-0.24493083357810974,
-0.3618488907814026,
0.3328644931316376,
0.5267820954322815,
1.3158609867095947,
-0.09488050639629364,
0.15255482494831085,
0.990464985370636,
-1.504515528678894,
1.4645881652832031,
-0.6339458227157593,
0.34064075350761414,
-2.316685438156128,
1.354168176651001,
-0.6804733872413635,
2.119030475616455,
-2.5399372577667236,
0.44207775592803955,
-0.6429773569107056,
-0.5178480744361877,
0.2836735248565674,
-0.38088834285736084,
0.10068047046661377,
-0.11579714715480804,
-0.993903398513794,
0.005427313037216663,
-0.6419969201087952,
0.6861757636070251,
1.1992231607437134,
1.4099823236465454,
-1.0871012210845947,
-0.24839471280574799,
-1.6587400436401367,
-0.2300851196050644,
-0.7740179896354675,
0.28634026646614075,
-1.9893170595169067,
-0.20552147924900055,
-2.066730260848999,
-2.294687509536743,
-1.1961337327957153,
-0.7872253656387329,
1.097739338874817,
0.17361831665039062,
-0.8822996616363525,
1.385205864906311,
-0.34364181756973267,
-1.7868750095367432,
1.1738622188568115,
-2.1113181114196777
] |
https://github.com/huggingface/datasets/issues/5153 | default Image/AudioFolder infers labels when there is no metadata files even if there is only one dir | Makes sense! For the last structure, we could count the path segments (delimited by "/" for URLs and `os.sep` for local paths) to ensure all inferred labels are on the same level. Otherwise, I think it's safe to assume they are meaningless and ignore them.
| ### Describe the bug
By default FolderBasedBuilder infers labels if there is not metadata files, even if it's meaningless (for example, they are in a single directory or in the root folder, see this repo as an example: https://huggingface.co/datasets/patrickvonplaten/audios
As this is a corner case for quick exploration of images or audios on the Hub.
### Steps to reproduce the bug
If you have directory like this:
```
repo
image1.jpg
image2.jpg
image3.jpg
```
or
```
repo
data
image1.jpg
image2.jpg
image3.jpg
```
doing `ds = load_dataset(repo)` would create `label` feature:
```python
print(ds["train"][0])
>> {'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=500x375 at 0x7FB5326468E0>, 'label': 0}
```
Also, if you have the following structure:
```
repo
data
image1.jpg
image2.jpg
image3.jpg
image4.jpg
image5.jpg
image6.jpg
```
it will infer two labels:
```python
print(ds["train"][0])
print(ds["train"][-1])
>> {'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=500x375 at 0x7FB5326468E0>, 'label': 1}
>> {'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=500x415 at 0x7FB5326555B0>, 'label': 0}
```
### Expected behavior
We should have only one base feature (Image/Audio) in such cases.
### Environment info
all versions of `datasets` | 459 | 45 | default Image/AudioFolder infers labels when there is no metadata files even if there is only one dir
### Describe the bug
By default FolderBasedBuilder infers labels if there is not metadata files, even if it's meaningless (for example, they are in a single directory or in the root folder, see this repo as an example: https://huggingface.co/datasets/patrickvonplaten/audios
As this is a corner case for quick exploration of images or audios on the Hub.
### Steps to reproduce the bug
If you have directory like this:
```
repo
image1.jpg
image2.jpg
image3.jpg
```
or
```
repo
data
image1.jpg
image2.jpg
image3.jpg
```
doing `ds = load_dataset(repo)` would create `label` feature:
```python
print(ds["train"][0])
>> {'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=500x375 at 0x7FB5326468E0>, 'label': 0}
```
Also, if you have the following structure:
```
repo
data
image1.jpg
image2.jpg
image3.jpg
image4.jpg
image5.jpg
image6.jpg
```
it will infer two labels:
```python
print(ds["train"][0])
print(ds["train"][-1])
>> {'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=500x375 at 0x7FB5326468E0>, 'label': 1}
>> {'image': <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=500x415 at 0x7FB5326555B0>, 'label': 0}
```
### Expected behavior
We should have only one base feature (Image/Audio) in such cases.
### Environment info
all versions of `datasets`
Makes sense! For the last structure, we could count the path segments (delimited by "/" for URLs and `os.sep` for local paths) to ensure all inferred labels are on the same level. Otherwise, I think it's safe to assume they are meaningless and ignore them.
| [
-1.122805118560791,
-0.9434869289398193,
-0.8069074153900146,
1.553827166557312,
-0.22055213153362274,
-1.1951932907104492,
0.13067808747291565,
-1.0353291034698486,
1.7676198482513428,
-0.7912471890449524,
0.3830137252807617,
-1.67913019657135,
-0.006825561635196209,
-0.6513044238090515,
-0.7794568538665771,
-0.8145704865455627,
-0.4428892433643341,
-0.7634752988815308,
1.0601660013198853,
2.548191785812378,
1.2778788805007935,
-1.3619792461395264,
2.6608493328094482,
0.6812750101089478,
-0.27422618865966797,
-1.0139724016189575,
0.5200492143630981,
-0.03268560767173767,
-1.36815345287323,
-0.3962782025337219,
-0.8945072293281555,
0.09370245784521103,
-0.623648464679718,
-0.6294755339622498,
-0.03690710663795471,
0.3911117613315582,
-0.3502870202064514,
-0.5643870234489441,
-0.5243061184883118,
-0.7621055841445923,
0.41350120306015015,
-0.5346210598945618,
0.9759598970413208,
-0.30153870582580566,
1.7512832880020142,
-0.5551316738128662,
0.4061557948589325,
0.718359112739563,
1.29693603515625,
0.21108007431030273,
-0.04819442331790924,
0.3544503152370453,
0.4323488473892212,
-0.0646524429321289,
0.4479834735393524,
1.1888384819030762,
0.656063973903656,
0.4349755644798279,
0.8611722588539124,
-2.2736380100250244,
1.247160792350769,
-1.0330663919448853,
0.21693384647369385,
1.259577989578247,
-0.9329487085342407,
0.26940682530403137,
-1.7877997159957886,
0.05469123274087906,
0.6138776540756226,
-2.127302646636963,
0.38749298453330994,
-1.303601861000061,
-0.45651108026504517,
1.0725754499435425,
0.34185948967933655,
-1.2400805950164795,
0.12887869775295258,
-0.3801271617412567,
0.9234049916267395,
0.36089208722114563,
1.0889588594436646,
-1.801504373550415,
-0.05662655457854271,
-0.3334842324256897,
0.16804194450378418,
-1.1671128273010254,
-1.5426832437515259,
0.5328389406204224,
0.6517761945724487,
0.5787292122840881,
-0.16826073825359344,
1.048669457435608,
-0.9135240316390991,
0.7425029873847961,
-1.0357015132904053,
-1.8320749998092651,
-1.4246045351028442,
-2.1453630924224854,
-2.185084819793701,
0.5954121947288513,
-0.4783763885498047,
-0.5606055855751038,
2.061103105545044,
-1.016040563583374,
-1.7888380289077759,
1.2366480827331543,
0.27920079231262207,
-0.05459681898355484,
2.2830491065979004,
0.2325838953256607,
-0.8335587978363037,
0.4661094844341278,
-0.8505812883377075,
0.7529038190841675,
-0.38869965076446533,
1.4054316282272339,
0.3888351321220398,
-1.0353798866271973,
1.630290150642395,
-0.4877111315727234,
0.6100630164146423,
-0.6361724138259888,
-0.4940069615840912,
-0.7216814756393433,
0.28649622201919556,
1.9819910526275635,
-0.29496899247169495,
1.5071691274642944,
-0.4009157121181488,
-1.6578524112701416,
-1.5650213956832886,
0.8679950833320618,
0.5220929384231567,
-0.663170576095581,
0.1661667823791504,
-0.21555185317993164,
0.13692177832126617,
-0.03033439815044403,
1.1256053447723389,
1.3326473236083984,
0.851565957069397,
-0.3589937388896942,
-0.9184277057647705,
0.17394232749938965,
0.0026392079889774323,
-0.818028450012207,
-1.7047736644744873,
-0.3906574845314026,
0.13099902868270874,
0.6551339030265808,
-1.272503137588501,
1.7953214645385742,
0.8172183632850647,
1.990197777748108,
0.9586018919944763,
-0.3872244358062744,
1.5056060552597046,
0.20226575434207916,
1.8459852933883667,
-0.5029428601264954,
0.7109349966049194,
-0.44417187571525574,
-1.1720139980316162,
0.8872045874595642,
-0.2597026228904724,
-2.0331668853759766,
-0.7267504334449768,
-0.7950918674468994,
-0.18727751076221466,
-0.7401165962219238,
0.9241040945053101,
-0.23786145448684692,
-1.4634885787963867,
0.32341623306274414,
-0.7539792060852051,
0.06346320360898972,
-1.2733954191207886,
0.20616236329078674,
0.7209010720252991,
-0.5654748678207397,
0.17694760859012604,
-0.25110650062561035,
-1.2319822311401367,
-0.43091467022895813,
0.22923338413238525,
1.8291935920715332,
-0.7984849214553833,
1.0241703987121582,
1.1249301433563232,
-0.5986677408218384,
-0.041997868567705154,
0.37019243836402893,
-0.2389509379863739,
0.8679947257041931,
-1.014697551727295,
-0.4250015616416931,
1.1872977018356323,
-0.12348917871713638,
-0.5822138786315918,
1.4542903900146484,
0.7200825214385986,
-1.0309489965438843,
-0.20478913187980652,
-0.16297394037246704,
-0.8489488959312439,
0.018208719789981842,
-1.6343867778778076,
-0.03576913848519325,
0.4928574562072754,
-1.5181443691253662,
-0.5294499397277832,
-0.26907092332839966,
1.2605149745941162,
-0.16816021502017975,
1.3090471029281616,
-0.33079278469085693,
-0.2099604308605194,
-0.32746556401252747,
-0.2848656177520752,
0.1375288963317871,
-0.21964332461357117,
-0.6201357245445251,
0.18562105298042297,
-0.7574261426925659,
0.37989288568496704,
1.4718751907348633,
0.31234169006347656,
0.09875157475471497,
0.39477476477622986,
1.0660147666931152,
0.36210453510284424,
-0.028724711388349533,
-0.8807275891304016,
-1.4916712045669556,
2.007190704345703,
-1.4133645296096802,
1.9657546281814575,
0.8669025301933289,
0.026178181171417236,
-1.7079758644104004,
-1.912553310394287,
1.4527007341384888,
1.1536431312561035,
2.3331336975097656,
0.7096596956253052,
0.4541144073009491,
-0.7884337306022644,
-0.6991748809814453,
0.22902068495750427,
-1.0536352396011353,
-0.7918322086334229,
0.16571591794490814,
2.354578733444214,
1.761793851852417,
-0.3539157211780548,
-0.1845453381538391,
-1.1061911582946777,
1.5080779790878296,
-0.07954082638025284,
0.1926402598619461,
1.8823150396347046,
-0.26547229290008545,
-1.093440055847168,
1.2250628471374512,
-2.197887659072876,
0.14495083689689636,
1.9201172590255737,
0.15630488097667694,
0.12737217545509338,
-1.3982363939285278,
-0.7718091607093811,
-0.27137210965156555,
-0.4366917014122009,
-1.1625232696533203,
0.5106499791145325,
-0.30083373188972473,
-0.6869872212409973,
-1.4413132667541504,
0.2494494467973709,
-0.9941114783287048,
-1.6929705142974854,
0.13121119141578674,
1.9009840488433838,
1.9627821445465088,
-0.8737407922744751,
1.6559107303619385,
-0.31110861897468567,
0.1462516486644745,
1.2952017784118652,
1.2557103633880615,
3.0756192207336426,
1.8626946210861206,
-1.3351738452911377,
0.6497935652732849,
-0.11036717891693115,
-0.41783058643341064,
1.211008906364441,
-1.2176440954208374,
1.241473913192749,
-0.11471782624721527,
-1.092529296875,
-1.1842844486236572,
0.8974043726921082,
0.5276533365249634,
0.040801580995321274,
-0.4975414276123047,
1.0908515453338623,
0.08072352409362793,
1.2760545015335083,
0.5286480784416199,
-0.28100183606147766,
0.7442267537117004,
-0.4040541648864746,
-0.5032713413238525,
1.5004675388336182,
0.19174103438854218,
-1.2558846473693848,
-2.331726312637329,
-0.1873036026954651,
-0.8757593035697937,
0.13177089393138885,
-0.6319025158882141,
-1.0888553857803345,
1.7289421558380127,
0.37443026900291443,
-1.252400517463684,
-0.26225611567497253,
-0.3998018205165863,
-0.567613959312439,
2.6750266551971436,
-1.4083466529846191,
-0.15629276633262634,
-1.0412988662719727,
-0.6402102112770081,
1.612390160560608,
-1.1587960720062256,
-0.13903982937335968,
-1.0002931356430054,
-0.49934473633766174,
-1.3564709424972534,
-0.7489625215530396,
-0.03719310462474823,
-0.7876111268997192,
0.8417468070983887,
0.2908600866794586,
-1.2892590761184692,
-0.39517974853515625,
-0.8327645063400269,
0.8650095462799072,
-0.2073758989572525,
0.2940647602081299,
1.9061299562454224,
0.46988996863365173,
-0.3292602598667145,
0.7204788327217102,
1.1274635791778564,
0.6385139226913452,
-0.5860271453857422,
0.2568499743938446,
-0.7398160696029663,
0.22465410828590393,
-1.3298176527023315,
0.21701140701770782,
-2.745452404022217,
0.6669133901596069,
-0.00018703192472457886,
0.005595585331320763,
0.07196012139320374,
-1.3212701082229614,
1.114344596862793,
2.6211702823638916,
-1.1211658716201782,
0.4358264207839966,
0.31549009680747986,
1.1554104089736938,
-1.5659875869750977,
0.20662957429885864,
-0.3721882998943329,
2.203404426574707,
0.12387867271900177,
1.247188925743103,
-0.453702837228775,
-2.277085304260254,
0.5944414138793945,
-1.2446813583374023,
-1.1340121030807495,
0.7920427918434143,
-0.7889882326126099,
-0.026153892278671265,
-1.4568967819213867,
-0.36030223965644836,
-0.8784605860710144,
-1.1392478942871094,
0.8037278056144714,
0.06482673436403275,
0.47430482506752014,
-0.6950275897979736,
0.36007827520370483,
-2.1295015811920166,
-1.4410147666931152,
-0.20918530225753784,
-0.9058358073234558,
0.45714959502220154,
-0.2521740198135376,
0.6565070748329163,
-0.2049337476491928,
-0.026226647198200226,
0.42646658420562744,
1.4209837913513184,
3.5237889289855957,
0.1942659169435501,
0.33581307530403137,
-0.13068810105323792,
-0.9363881349563599,
1.332453966140747,
0.9731415510177612,
-0.15457503497600555,
-0.5263525247573853,
-1.1740506887435913,
1.2287710905075073,
1.9543483257293701,
0.8805235624313354,
0.06457720696926117,
-0.8063201308250427,
-0.8103156089782715,
-0.024960484355688095,
0.10990935564041138,
0.4335840940475464,
0.7741947770118713,
0.19960835576057434,
0.029986143112182617,
1.3996565341949463,
1.185807228088379,
-0.46667709946632385,
0.5696040391921997,
-0.8538269400596619,
-0.5278511643409729,
0.4894740581512451,
0.36710605025291443,
0.055524252355098724,
0.22482378780841827,
-1.069061279296875,
-0.2527024447917938,
-0.3371318280696869,
-0.8417768478393555,
-0.7701758146286011,
-0.39218318462371826,
-0.23247085511684418,
1.604788899421692,
0.058649398386478424,
-0.5129780173301697,
-0.040272582322359085,
-0.7093656659126282,
-0.07841348648071289,
-0.9850934743881226,
0.13991779088974,
-0.3192165195941925,
-0.08893810212612152,
-0.17163415253162384,
1.7896957397460938,
-0.9289603233337402,
-1.9939028024673462,
0.3001292049884796,
0.2593003809452057,
-0.3728434145450592,
0.29367345571517944,
1.6732726097106934,
0.6805763840675354,
1.496092438697815,
1.3167387247085571,
0.9452818632125854,
-0.7458643913269043,
-1.2362130880355835,
0.611893892288208,
0.9336180090904236,
-1.395816683769226,
0.7270570397377014,
0.03640630841255188,
-0.47987473011016846,
0.6166621446609497,
1.2560616731643677,
0.514082133769989,
-2.049830675125122,
0.7229401469230652,
-0.7838509678840637,
0.7541590929031372,
0.7930558919906616,
0.687110960483551,
0.2015235722064972,
0.7104858160018921,
-1.161726951599121,
-1.0671998262405396,
-0.7800816297531128,
-0.675012469291687,
1.8737668991088867,
-0.3112518787384033,
0.5098657608032227,
-0.23661281168460846,
-1.3115203380584717,
-0.17966818809509277,
0.6581078767776489,
0.40462803840637207,
-0.5421413779258728,
0.7154318690299988,
-0.5737281441688538,
-1.1342474222183228,
-1.2923915386199951,
-0.49250736832618713,
-0.9774156212806702,
-0.9217343330383301,
0.9820729494094849,
0.8233999609947205,
0.3558921217918396,
1.916375994682312,
0.6439529061317444,
0.10788969695568085,
-2.5985586643218994,
0.9379071593284607,
0.28025585412979126,
-0.04975695535540581,
0.9015728831291199,
0.3915052115917206,
0.956769585609436,
-0.10314392298460007,
0.5084621906280518,
-2.3889400959014893,
2.2772252559661865,
-0.30485013127326965,
0.6937640309333801,
-0.03530815616250038,
-0.22303777933120728,
1.0847907066345215,
0.4978140592575073,
0.5382955074310303,
-1.0304888486862183,
0.5641900300979614,
-0.6861405968666077,
1.3736785650253296,
0.7825958132743835,
-0.9066714644432068,
-0.044451698660850525,
1.3877148628234863,
0.35470524430274963,
-0.5355122089385986,
-0.9045054912567139,
-0.9481690526008606,
0.8985851407051086,
1.7180938720703125,
-0.08776107430458069,
-0.040372494608163834,
0.8549768328666687,
0.6967991590499878,
-1.368427038192749,
0.09862913191318512,
-0.733849287033081,
-0.7529248595237732,
1.7768328189849854,
2.1145901679992676,
-0.20285636186599731,
-0.3040386438369751,
-0.8786779642105103,
-1.248317003250122,
0.8631852269172668,
0.07626710832118988,
-0.0010646027512848377,
0.6976659297943115,
-0.7180389761924744,
1.1925840377807617,
0.9859671592712402,
0.924538791179657,
0.23745763301849365,
0.32074758410453796,
0.35804468393325806,
-0.3592708706855774,
-1.2034797668457031,
-0.19311130046844482,
-1.1897855997085571,
-2.446409225463867,
0.48448213934898376,
-0.05976399779319763,
-1.3761506080627441,
-0.042383793741464615,
-1.0544681549072266,
0.9236004948616028,
-0.4717423915863037,
-1.0706664323806763,
-1.5130975246429443,
0.17299942672252655,
0.003255994990468025,
0.9416621327400208,
-1.541821837425232,
-0.052698567509651184,
1.2391644716262817,
0.98568195104599,
-0.7822979092597961,
1.010347604751587,
0.17094051837921143,
1.0000383853912354,
1.0612692832946777,
-0.2825472056865692,
0.5353935956954956,
-0.01958763413131237,
-1.2930750846862793,
0.355732262134552,
1.1448700428009033,
0.25376656651496887,
1.5677599906921387,
-0.5996376276016235,
0.013808333314955235,
0.3662991225719452,
-0.3244650065898895,
-0.5150449872016907,
-0.6360257863998413,
0.5928128361701965,
0.15511921048164368,
-0.8312702178955078,
0.10408573597669601,
0.06014464795589447,
-0.1424718201160431,
0.22206905484199524,
-1.5322128534317017,
-0.07515305280685425,
-0.23501239717006683,
-0.6114474534988403,
-1.1310093402862549,
-0.1228557825088501,
1.4407031536102295,
-0.7138428688049316,
-0.2790215313434601,
0.6052699089050293,
0.1958337277173996,
0.5129075050354004,
0.6300676465034485,
-0.667876124382019,
-0.479873925447464,
-0.2577727735042572,
-0.392626017332077,
0.39919015765190125,
1.3397351503372192,
-0.054352276027202606,
-0.9303102493286133,
0.6877753734588623,
-0.4176119565963745,
-0.005562286823987961,
1.906773567199707,
0.050212301313877106,
-0.891394317150116,
0.2896713614463806,
-0.7427272200584412,
1.9537667036056519,
1.7995578050613403,
1.2721656560897827,
-0.08952579647302628,
-1.0788118839263916,
0.70034259557724,
-0.3191033899784088,
-0.5574639439582825,
0.9498993158340454,
0.32809126377105713,
-0.2064702808856964,
-1.3898500204086304,
0.6429402232170105,
1.33128821849823,
-0.9555197358131409,
-0.8749875426292419,
0.20631127059459686,
-0.7243430018424988,
0.9699133634567261,
0.7925366163253784,
0.4101123809814453,
0.24636845290660858,
1.6509158611297607,
0.9377138614654541,
-0.4345998764038086,
0.6005550622940063,
0.48998233675956726,
-0.1557060033082962,
-2.072901725769043,
-1.2248215675354004,
0.2943803071975708,
-0.42128998041152954,
-1.667831301689148,
1.367203950881958,
-1.172041416168213,
-0.9689458608627319,
0.6348363161087036,
0.03273974731564522,
1.4199637174606323,
0.25961220264434814,
1.5683828592300415,
2.037911891937256,
0.9787744283676147,
0.31719353795051575,
1.2533457279205322,
-0.22478759288787842,
-0.5029664039611816,
1.7877506017684937,
-0.5890017747879028,
0.4828822910785675,
1.0880448818206787,
-0.3173387348651886,
-1.092995285987854,
-0.8073165416717529,
-1.3970911502838135,
-0.8414515852928162,
1.2216730117797852,
0.04066537693142891,
-1.095078468322754,
0.3442652225494385,
1.5633143186569214,
-0.026880547404289246,
-0.4123411774635315,
0.6905573606491089,
0.42933326959609985,
-0.9657076597213745,
-0.04969635233283043,
-0.9058510065078735,
0.48445019125938416,
-0.01345127820968628,
-0.35898104310035706,
0.2991904318332672,
0.4082178771495819,
1.3812397718429565,
-0.02467641606926918,
0.13063032925128937,
1.0686701536178589,
-1.3414064645767212,
1.489113688468933,
-0.7708229422569275,
0.34996476769447327,
-2.3877768516540527,
1.3432081937789917,
-0.8387893438339233,
1.9539803266525269,
-2.664119005203247,
0.3954535722732544,
-0.619794487953186,
-0.4062780439853668,
0.29150956869125366,
-0.37652602791786194,
0.18321876227855682,
-0.11424953490495682,
-1.1156665086746216,
-0.1522858589887619,
-0.7080283761024475,
0.5891604423522949,
1.0987521409988403,
1.4127519130706787,
-1.151511549949646,
-0.12089655548334122,
-1.7623223066329956,
-0.06056784838438034,
-0.6739261150360107,
0.3564755618572235,
-1.9781988859176636,
-0.14230212569236755,
-1.8583920001983643,
-2.365452527999878,
-1.3818861246109009,
-0.7399891018867493,
0.9238202571868896,
0.030052371323108673,
-0.8158929944038391,
1.139846682548523,
-0.3493088185787201,
-1.8554130792617798,
1.0641987323760986,
-2.1476078033447266
] |
https://github.com/huggingface/datasets/issues/5150 | Problems after upgrading to 2.6.1 | Hi! I can't reproduce the error following these steps. Can you please provide a reproducible example? | ### Describe the bug
Loading a dataset_dict from disk with `load_from_disk` is now creating a `KeyError "length"` that was not occurring in v2.5.2.
Context:
- Each individual dataset in the dict is created with `Dataset.from_pandas`
- The dataset_dict is create from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- The pandas dataframe, besides text columns, has a column with a dictionary inside and potentially different keys in each row. Correctly the `Dataset.from_pandas` function adds `key: None` to all dictionaries in each row so that the schema can be correctly inferred.
### Steps to reproduce the bug
Steps to reproduce:
- Upgrade to datasets==2.6.1
- Create a dataset from pandas dataframe with `Dataset.from_pandas`
- Create a dataset_dict from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- Save to disk with the `save` function
### Expected behavior
Same as in v2.5.2, that is load from disk without errors
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.4.209-129.367.amzn2int.x86_64-x86_64-with-glibc2.26
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1 | 461 | 16 | Problems after upgrading to 2.6.1
### Describe the bug
Loading a dataset_dict from disk with `load_from_disk` is now creating a `KeyError "length"` that was not occurring in v2.5.2.
Context:
- Each individual dataset in the dict is created with `Dataset.from_pandas`
- The dataset_dict is create from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- The pandas dataframe, besides text columns, has a column with a dictionary inside and potentially different keys in each row. Correctly the `Dataset.from_pandas` function adds `key: None` to all dictionaries in each row so that the schema can be correctly inferred.
### Steps to reproduce the bug
Steps to reproduce:
- Upgrade to datasets==2.6.1
- Create a dataset from pandas dataframe with `Dataset.from_pandas`
- Create a dataset_dict from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- Save to disk with the `save` function
### Expected behavior
Same as in v2.5.2, that is load from disk without errors
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.4.209-129.367.amzn2int.x86_64-x86_64-with-glibc2.26
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
Hi! I can't reproduce the error following these steps. Can you please provide a reproducible example? | [
-1.0852904319763184,
-0.8362962603569031,
-0.7362626791000366,
1.4058796167373657,
-0.1680574268102646,
-1.2754629850387573,
0.21764767169952393,
-1.1224678754806519,
1.7301846742630005,
-0.8169031739234924,
0.32381677627563477,
-1.6662352085113525,
0.027120543643832207,
-0.6201762557029724,
-0.7091599702835083,
-0.8462072014808655,
-0.42869511246681213,
-0.6677979826927185,
0.9503536820411682,
2.4480044841766357,
1.1838475465774536,
-1.3478132486343384,
2.6130220890045166,
0.7486469745635986,
-0.18417829275131226,
-0.9369094371795654,
0.5168137550354004,
0.06154588609933853,
-1.408574104309082,
-0.31985530257225037,
-0.9345057010650635,
-0.10066289454698563,
-0.5271516442298889,
-0.5659553408622742,
-0.036782167851924896,
0.42930445075035095,
-0.39520037174224854,
-0.5267803072929382,
-0.515444815158844,
-0.8637787699699402,
0.3658463656902313,
-0.3438360393047333,
0.9821653366088867,
-0.38055989146232605,
1.7984025478363037,
-0.5529531836509705,
0.49474239349365234,
0.7973129153251648,
1.245482325553894,
0.1495475023984909,
-0.02301155775785446,
0.37658923864364624,
0.4035651385784149,
-0.009965125471353531,
0.490477979183197,
1.0708365440368652,
0.6314442753791809,
0.474211186170578,
0.765117347240448,
-2.2236855030059814,
1.3332340717315674,
-0.988000750541687,
0.3219188153743744,
1.3924469947814941,
-0.9790642261505127,
0.33033302426338196,
-1.7359410524368286,
-0.1185077652335167,
0.5288907885551453,
-2.2462046146392822,
0.26954084634780884,
-1.3666855096817017,
-0.5742563605308533,
1.0432476997375488,
0.4302605986595154,
-1.0727894306182861,
0.0915149599313736,
-0.3668918013572693,
0.8693196177482605,
0.44382208585739136,
1.1486035585403442,
-1.6497143507003784,
-0.06287097185850143,
-0.3126104176044464,
0.10690084844827652,
-1.2944612503051758,
-1.544468879699707,
0.6123814582824707,
0.6732718348503113,
0.5478136539459229,
-0.14329232275485992,
0.9730193018913269,
-0.9820401072502136,
0.7321930527687073,
-0.9993044137954712,
-1.8051650524139404,
-1.4001797437667847,
-2.312685489654541,
-2.345440626144409,
0.7495699524879456,
-0.44943374395370483,
-0.5077831745147705,
2.0903611183166504,
-1.0269789695739746,
-1.7016693353652954,
1.0834951400756836,
0.24029847979545593,
-0.11146867275238037,
2.370955228805542,
0.2280527651309967,
-0.7097688317298889,
0.46236953139305115,
-0.7745071649551392,
0.6884084939956665,
-0.3428437113761902,
1.2962720394134521,
0.4594342112541199,
-1.0954113006591797,
1.572250247001648,
-0.4114454388618469,
0.5384505391120911,
-0.6408092379570007,
-0.4507005214691162,
-0.6514466404914856,
0.2619754374027252,
1.807846188545227,
-0.24694772064685822,
1.479533314704895,
-0.31598731875419617,
-1.5625009536743164,
-1.6052196025848389,
0.7998261451721191,
0.5227513313293457,
-0.6934348344802856,
0.09090802818536758,
-0.3548969328403473,
0.12202273309230804,
-0.04717593640089035,
1.183138132095337,
1.2965972423553467,
0.7943400144577026,
-0.3713393807411194,
-0.893135666847229,
0.16770868003368378,
-0.03671682998538017,
-0.8462573289871216,
-1.7286251783370972,
-0.2847388982772827,
0.14693377912044525,
0.6000161170959473,
-1.196178674697876,
1.8045265674591064,
0.8704197406768799,
1.927391529083252,
0.9995156526565552,
-0.4044177830219269,
1.4829505681991577,
0.09042894095182419,
1.864791750907898,
-0.46749451756477356,
0.6098182201385498,
-0.3602314889431,
-1.1374648809432983,
0.8290412425994873,
-0.24795380234718323,
-2.131650924682617,
-0.6483854055404663,
-0.8518912196159363,
-0.12604239583015442,
-0.719134509563446,
0.9927293062210083,
-0.14821486175060272,
-1.3452554941177368,
0.2230396568775177,
-0.7650672197341919,
0.1068880558013916,
-1.2455374002456665,
0.29686644673347473,
0.7434169054031372,
-0.5984545350074768,
0.10751289874315262,
-0.2270347774028778,
-1.3202462196350098,
-0.40922811627388,
0.35709691047668457,
1.7839056253433228,
-0.7925581336021423,
0.9449083805084229,
1.0416314601898193,
-0.7137328386306763,
-0.007784049957990646,
0.34952250123023987,
-0.36082759499549866,
0.851124107837677,
-1.0347328186035156,
-0.439825177192688,
1.114758014678955,
-0.2129615694284439,
-0.5755819082260132,
1.5019896030426025,
0.6792516708374023,
-0.9595886468887329,
-0.1674828678369522,
-0.17189864814281464,
-0.8079397678375244,
0.03552188724279404,
-1.6435308456420898,
-0.03569137677550316,
0.3760131001472473,
-1.4954960346221924,
-0.47269079089164734,
-0.17594526708126068,
1.3332700729370117,
-0.12526389956474304,
1.3693583011627197,
-0.30392777919769287,
-0.208417147397995,
-0.49621573090553284,
-0.32528841495513916,
0.10295651108026505,
-0.17770127952098846,
-0.5578413009643555,
0.25685685873031616,
-0.7457890510559082,
0.3278054893016815,
1.4118701219558716,
0.3202703893184662,
0.08831804245710373,
0.5540475845336914,
1.110932469367981,
0.36036205291748047,
-0.08561991900205612,
-0.7970333099365234,
-1.5638837814331055,
2.02128267288208,
-1.4140645265579224,
1.9641413688659668,
0.6984809041023254,
0.014470413327217102,
-1.9142743349075317,
-1.9474639892578125,
1.372676968574524,
1.1336493492126465,
2.3227698802948,
0.5433894395828247,
0.4309594929218292,
-0.7948126196861267,
-0.686481237411499,
0.363127738237381,
-0.9193575978279114,
-0.7120311260223389,
0.2372799664735794,
2.34861421585083,
1.7019858360290527,
-0.40439802408218384,
-0.15600784122943878,
-1.1215368509292603,
1.5134093761444092,
-0.16137607395648956,
0.11840450763702393,
2.051332950592041,
-0.2774334251880646,
-1.1085964441299438,
1.370385766029358,
-2.35212779045105,
0.207957923412323,
1.9611977338790894,
0.22113990783691406,
0.004652051255106926,
-1.2872077226638794,
-0.6924564838409424,
-0.3440232276916504,
-0.42791634798049927,
-1.148114800453186,
0.5203840136528015,
-0.2441924661397934,
-0.7830093502998352,
-1.4679527282714844,
0.2086421698331833,
-1.0972113609313965,
-1.7326898574829102,
0.16525395214557648,
1.7814120054244995,
1.9798082113265991,
-0.7576221823692322,
1.4581722021102905,
-0.26252835988998413,
0.08874761313199997,
1.2618752717971802,
1.2013906240463257,
3.117260217666626,
1.9505269527435303,
-1.3471211194992065,
0.7135612964630127,
-0.0058844806626439095,
-0.4936565160751343,
1.1551485061645508,
-1.268067717552185,
1.2979656457901,
-0.1466539055109024,
-1.2017050981521606,
-1.1625072956085205,
0.9126284122467041,
0.4742160737514496,
0.0958309918642044,
-0.46456149220466614,
1.1798845529556274,
0.12007875740528107,
1.3913594484329224,
0.5921788811683655,
-0.28466132283210754,
0.6674333810806274,
-0.3721849024295807,
-0.5268868803977966,
1.52749502658844,
0.24810054898262024,
-1.3584463596343994,
-2.3227791786193848,
-0.3241575360298157,
-0.8487698435783386,
-0.029444271698594093,
-0.6614345908164978,
-0.9906332492828369,
1.6607105731964111,
0.43270590901374817,
-1.2075974941253662,
-0.2383979707956314,
-0.3096420466899872,
-0.5302588939666748,
2.7562572956085205,
-1.4002628326416016,
-0.14857697486877441,
-1.0528422594070435,
-0.640440046787262,
1.645807147026062,
-1.1806933879852295,
-0.26484349370002747,
-1.144527792930603,
-0.5180872678756714,
-1.2901479005813599,
-0.6061989068984985,
-0.02018960937857628,
-0.899519681930542,
0.8498296737670898,
0.1458200365304947,
-1.2385828495025635,
-0.36177611351013184,
-0.9318757653236389,
0.9144399166107178,
-0.16899996995925903,
0.153592050075531,
1.7949596643447876,
0.4556310176849365,
-0.3867531418800354,
0.6398254632949829,
1.165997862815857,
0.6575813293457031,
-0.6254103183746338,
0.30368882417678833,
-0.7311804294586182,
0.3267502188682556,
-1.262384295463562,
0.27535563707351685,
-2.813479423522949,
0.5654392242431641,
-0.10068228095769882,
-0.07747342437505722,
-0.11116120219230652,
-1.4095109701156616,
1.0654510259628296,
2.549607276916504,
-1.2073713541030884,
0.5165620446205139,
0.2781435549259186,
1.1389069557189941,
-1.5740970373153687,
0.2950926721096039,
-0.4543752670288086,
2.1099324226379395,
0.1755579560995102,
1.1637895107269287,
-0.4344315826892853,
-2.279025077819824,
0.6249096989631653,
-1.2343666553497314,
-1.1601650714874268,
0.8081072568893433,
-0.8329631686210632,
0.06244021654129028,
-1.3074668645858765,
-0.24141190946102142,
-0.753123939037323,
-1.2016990184783936,
0.6383074522018433,
0.09841471910476685,
0.5634206533432007,
-0.6262004971504211,
0.34069713950157166,
-2.247396230697632,
-1.334157943725586,
-0.2648734152317047,
-0.9550832509994507,
0.5275852680206299,
-0.26034632325172424,
0.7525150775909424,
-0.18346846103668213,
-0.028894668444991112,
0.3817444145679474,
1.4186972379684448,
3.3650262355804443,
0.12548545002937317,
0.3073110282421112,
-0.17353618144989014,
-0.9302851557731628,
1.390116572380066,
0.8895389437675476,
-0.11567874252796173,
-0.5403910875320435,
-1.1030819416046143,
1.1298747062683105,
1.9983024597167969,
1.0579092502593994,
-0.05148705840110779,
-0.8549126982688904,
-0.8126870393753052,
0.07138624787330627,
0.1863141655921936,
0.44677141308784485,
0.9046845436096191,
0.14152027666568756,
0.03728868067264557,
1.5293817520141602,
1.201175332069397,
-0.3409845232963562,
0.4005909562110901,
-0.8697526454925537,
-0.5092279314994812,
0.5186680555343628,
0.37417900562286377,
-0.022049620747566223,
0.3337038457393646,
-1.0494176149368286,
-0.16705967485904694,
-0.3938668370246887,
-0.8536801934242249,
-0.7373495101928711,
-0.4694365859031677,
-0.4135306775569916,
1.731680154800415,
0.07163582742214203,
-0.5191506743431091,
-0.055093832314014435,
-0.7012684941291809,
-0.0820332020521164,
-1.04274582862854,
0.42545199394226074,
-0.17354460060596466,
-0.0410575270652771,
-0.10542263835668564,
1.7742992639541626,
-0.8942893743515015,
-1.98896324634552,
0.20173251628875732,
0.2111998200416565,
-0.36320433020591736,
0.25427109003067017,
1.647857666015625,
0.5658062100410461,
1.4375547170639038,
1.3451690673828125,
0.9858148097991943,
-0.6990868449211121,
-1.332895278930664,
0.6492135524749756,
0.9514200091362,
-1.4108247756958008,
0.6799893975257874,
0.05412422865629196,
-0.49532991647720337,
0.6021967530250549,
1.2466644048690796,
0.4302047789096832,
-2.0783443450927734,
0.8309081792831421,
-0.9555944800376892,
0.7530876398086548,
0.7534403800964355,
0.7420504093170166,
0.10323309898376465,
0.7653746008872986,
-1.274550437927246,
-1.0846997499465942,
-0.6921554803848267,
-0.7081023454666138,
1.9098232984542847,
-0.3301403224468231,
0.6071288585662842,
-0.28217828273773193,
-1.4116896390914917,
-0.032463330775499344,
0.7229248285293579,
0.3286277949810028,
-0.5377733707427979,
0.7902960777282715,
-0.6141324639320374,
-1.112720012664795,
-1.3480528593063354,
-0.435346782207489,
-1.1437755823135376,
-0.8879916667938232,
1.0383418798446655,
0.815926730632782,
0.32814592123031616,
1.859120488166809,
0.6362888813018799,
0.2760968804359436,
-2.6515696048736572,
0.8935148119926453,
0.2897457480430603,
-0.08620458096265793,
0.8064509630203247,
0.3525809049606323,
1.0372122526168823,
-0.15004941821098328,
0.607168972492218,
-2.4605443477630615,
2.324589967727661,
-0.20959804952144623,
0.7191819548606873,
-0.0005338769406080246,
-0.16413557529449463,
1.034639835357666,
0.6045626401901245,
0.6142941117286682,
-1.1082241535186768,
0.7151490449905396,
-0.6450456976890564,
1.2222154140472412,
0.8046929836273193,
-0.8148894906044006,
-0.08643388748168945,
1.334912657737732,
0.5195181965827942,
-0.45826661586761475,
-0.9299985766410828,
-1.0350779294967651,
0.9110001921653748,
1.7651904821395874,
-0.14842906594276428,
0.024930370971560478,
0.9009519219398499,
0.6886231899261475,
-1.3465752601623535,
0.06697162240743637,
-0.8013991117477417,
-0.7215664982795715,
1.6588541269302368,
2.0901548862457275,
-0.1526428610086441,
-0.18802809715270996,
-0.8122332096099854,
-1.2072668075561523,
0.7817721366882324,
0.07914804667234421,
0.06334954500198364,
0.6001284718513489,
-0.5862599015235901,
1.205088496208191,
0.8858025074005127,
0.915072500705719,
0.2881602942943573,
0.2877364456653595,
0.2781113088130951,
-0.3060038387775421,
-1.2336772680282593,
-0.205994114279747,
-0.9567797780036926,
-2.463733673095703,
0.568536102771759,
-0.241889089345932,
-1.5353496074676514,
0.0025359569117426872,
-1.015408992767334,
0.8669008612632751,
-0.5467081665992737,
-1.1088851690292358,
-1.4893141984939575,
0.25765642523765564,
-0.08203080296516418,
0.9705552458763123,
-1.5193740129470825,
-0.11153566092252731,
1.2932205200195312,
0.8784477114677429,
-0.7000325322151184,
0.9544835090637207,
0.24629110097885132,
1.0638667345046997,
0.9277846813201904,
-0.3041163980960846,
0.5153696537017822,
0.1335650235414505,
-1.3393977880477905,
0.39635202288627625,
1.183132290840149,
0.2092941403388977,
1.4850751161575317,
-0.5966778993606567,
0.06840567290782928,
0.3861214220523834,
-0.4080706834793091,
-0.46245378255844116,
-0.5733499526977539,
0.7017906308174133,
0.01658879965543747,
-0.9345906376838684,
0.04362568259239197,
0.005207819864153862,
-0.2002197504043579,
0.19428525865077972,
-1.4430782794952393,
-0.16253001987934113,
-0.33565905690193176,
-0.638435959815979,
-1.1973679065704346,
-0.07838201522827148,
1.369433045387268,
-0.7877916693687439,
-0.12616600096225739,
0.5294064283370972,
0.29218077659606934,
0.5817233920097351,
0.6703343987464905,
-0.6437307000160217,
-0.319050669670105,
-0.20979107916355133,
-0.355197012424469,
0.3449944257736206,
1.387019395828247,
-0.061902210116386414,
-0.9621033072471619,
0.7373899221420288,
-0.3768883943557739,
0.05651284009218216,
2.0000195503234863,
0.12123678624629974,
-0.835111677646637,
0.32431089878082275,
-0.707979679107666,
1.9060795307159424,
1.8405919075012207,
1.3561443090438843,
-0.0876486748456955,
-1.0969504117965698,
0.5446537733078003,
-0.4130105674266815,
-0.3382108807563782,
0.9657767415046692,
0.4036032557487488,
-0.1933659017086029,
-1.2928826808929443,
0.7272500395774841,
1.2831244468688965,
-0.9075695872306824,
-0.8627480864524841,
0.18696801364421844,
-0.8063275814056396,
1.097188115119934,
0.7413158416748047,
0.4000481367111206,
0.28229784965515137,
1.5836166143417358,
0.7465179562568665,
-0.44260483980178833,
0.6322802901268005,
0.5316609144210815,
-0.2422107458114624,
-2.0070533752441406,
-1.1632230281829834,
0.36511722207069397,
-0.5996872186660767,
-1.6263834238052368,
1.4321385622024536,
-1.194847583770752,
-0.9992309808731079,
0.509310781955719,
0.061699070036411285,
1.4497127532958984,
0.3442969024181366,
1.580053448677063,
2.065678834915161,
0.9427416920661926,
0.39430075883865356,
1.3642467260360718,
-0.2086067795753479,
-0.409356027841568,
1.7741068601608276,
-0.5021526217460632,
0.5247738361358643,
1.1204825639724731,
-0.3072265684604645,
-1.0608583688735962,
-0.8255480527877808,
-1.1396677494049072,
-0.7615722417831421,
1.24301016330719,
0.070114865899086,
-1.084171175956726,
0.3679431676864624,
1.5829174518585205,
0.014608334749937057,
-0.33433273434638977,
0.6480124592781067,
0.31968405842781067,
-0.8484737277030945,
-0.12360665202140808,
-0.9893045425415039,
0.5439966917037964,
-0.24519334733486176,
-0.35019052028656006,
0.31042900681495667,
0.4621693193912506,
1.334691047668457,
-0.02754894271492958,
0.13966180384159088,
1.1690523624420166,
-1.424766182899475,
1.495627522468567,
-0.728710949420929,
0.2529902756214142,
-2.271575450897217,
1.3695794343948364,
-0.7680709362030029,
1.9055577516555786,
-2.7060751914978027,
0.46448424458503723,
-0.5201812386512756,
-0.4405370056629181,
0.24647927284240723,
-0.3232229948043823,
0.14331673085689545,
-0.16119615733623505,
-1.2084203958511353,
-0.10880208015441895,
-0.7829724550247192,
0.5504093766212463,
1.0717841386795044,
1.3920491933822632,
-1.0804364681243896,
-0.35661420226097107,
-1.6536400318145752,
-0.2541157007217407,
-0.7236588597297668,
0.3790244460105896,
-1.8679711818695068,
-0.1890021413564682,
-1.9086874723434448,
-2.5206401348114014,
-1.2795284986495972,
-0.8480263352394104,
1.1293083429336548,
0.012700293213129044,
-0.8764792680740356,
1.1034716367721558,
-0.38300880789756775,
-1.8945683240890503,
1.21721351146698,
-2.2018630504608154
] |
https://github.com/huggingface/datasets/issues/5150 | Problems after upgrading to 2.6.1 | I faced the same issue:
### Repro
```
!pip install datasets==2.6.1
import datasets as Dataset
dataset = Dataset.from_pandas(dataframe)
dataset.save_to_disk(local)
!pip install datasets==2.5.2
import datasets as Dataset
dataset = Dataset.load_from_disk(local)
```
| ### Describe the bug
Loading a dataset_dict from disk with `load_from_disk` is now creating a `KeyError "length"` that was not occurring in v2.5.2.
Context:
- Each individual dataset in the dict is created with `Dataset.from_pandas`
- The dataset_dict is create from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- The pandas dataframe, besides text columns, has a column with a dictionary inside and potentially different keys in each row. Correctly the `Dataset.from_pandas` function adds `key: None` to all dictionaries in each row so that the schema can be correctly inferred.
### Steps to reproduce the bug
Steps to reproduce:
- Upgrade to datasets==2.6.1
- Create a dataset from pandas dataframe with `Dataset.from_pandas`
- Create a dataset_dict from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- Save to disk with the `save` function
### Expected behavior
Same as in v2.5.2, that is load from disk without errors
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.4.209-129.367.amzn2int.x86_64-x86_64-with-glibc2.26
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1 | 461 | 30 | Problems after upgrading to 2.6.1
### Describe the bug
Loading a dataset_dict from disk with `load_from_disk` is now creating a `KeyError "length"` that was not occurring in v2.5.2.
Context:
- Each individual dataset in the dict is created with `Dataset.from_pandas`
- The dataset_dict is create from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- The pandas dataframe, besides text columns, has a column with a dictionary inside and potentially different keys in each row. Correctly the `Dataset.from_pandas` function adds `key: None` to all dictionaries in each row so that the schema can be correctly inferred.
### Steps to reproduce the bug
Steps to reproduce:
- Upgrade to datasets==2.6.1
- Create a dataset from pandas dataframe with `Dataset.from_pandas`
- Create a dataset_dict from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- Save to disk with the `save` function
### Expected behavior
Same as in v2.5.2, that is load from disk without errors
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.4.209-129.367.amzn2int.x86_64-x86_64-with-glibc2.26
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
I faced the same issue:
### Repro
```
!pip install datasets==2.6.1
import datasets as Dataset
dataset = Dataset.from_pandas(dataframe)
dataset.save_to_disk(local)
!pip install datasets==2.5.2
import datasets as Dataset
dataset = Dataset.load_from_disk(local)
```
| [
-1.1304023265838623,
-0.857818603515625,
-0.6848601698875427,
1.3971970081329346,
-0.20777122676372528,
-1.2832344770431519,
0.2150741070508957,
-1.1112054586410522,
1.7614822387695312,
-0.8068758845329285,
0.26854878664016724,
-1.6762346029281616,
0.006469055078923702,
-0.5881531834602356,
-0.6937975287437439,
-0.8767810463905334,
-0.4714916944503784,
-0.6682645678520203,
0.9633793234825134,
2.412400722503662,
1.202614188194275,
-1.328417420387268,
2.638638496398926,
0.7544832825660706,
-0.16928234696388245,
-0.9340899586677551,
0.5015405416488647,
0.08514123409986496,
-1.4519761800765991,
-0.3133189380168915,
-0.9506251811981201,
-0.10478144139051437,
-0.5103041529655457,
-0.5742003917694092,
-0.0033887652680277824,
0.4181711673736572,
-0.3960270881652832,
-0.5476645827293396,
-0.5128530859947205,
-0.8072571754455566,
0.3673883378505707,
-0.33731570839881897,
0.9813176989555359,
-0.39492958784103394,
1.8098835945129395,
-0.5691834688186646,
0.48844417929649353,
0.8176898956298828,
1.2322274446487427,
0.12710988521575928,
-0.02905222773551941,
0.41084322333335876,
0.41116300225257874,
0.045218948274850845,
0.5000627040863037,
1.1143070459365845,
0.6370593905448914,
0.4474879801273346,
0.7616385221481323,
-2.214594602584839,
1.293489933013916,
-0.9562141299247742,
0.3611140549182892,
1.3953299522399902,
-0.99665766954422,
0.3407368063926697,
-1.7268798351287842,
-0.10177856683731079,
0.5251539349555969,
-2.240326404571533,
0.26104632019996643,
-1.3986150026321411,
-0.5643685460090637,
1.078332781791687,
0.4401644170284271,
-1.037445068359375,
0.13097701966762543,
-0.42051005363464355,
0.8934758305549622,
0.4888564348220825,
1.165541410446167,
-1.6534165143966675,
-0.07106762379407883,
-0.32854098081588745,
0.09516450762748718,
-1.2749131917953491,
-1.540759563446045,
0.6099779605865479,
0.7124835848808289,
0.5954322814941406,
-0.16878899931907654,
1.0135986804962158,
-0.9595937728881836,
0.7026808261871338,
-0.9896594882011414,
-1.8146041631698608,
-1.4128515720367432,
-2.2934486865997314,
-2.3447744846343994,
0.7427589297294617,
-0.4497566521167755,
-0.49701717495918274,
2.0868263244628906,
-1.0350663661956787,
-1.7311073541641235,
1.0607209205627441,
0.21884596347808838,
-0.10179641842842102,
2.3307876586914062,
0.2356741726398468,
-0.691973090171814,
0.44333958625793457,
-0.733912467956543,
0.6510383486747742,
-0.2894998788833618,
1.286584496498108,
0.45614704489707947,
-1.1044130325317383,
1.545578956604004,
-0.41021203994750977,
0.5963608622550964,
-0.6419647932052612,
-0.44668811559677124,
-0.659899115562439,
0.23950476944446564,
1.8544842004776,
-0.25454187393188477,
1.493661642074585,
-0.3443082571029663,
-1.6073825359344482,
-1.639201045036316,
0.810399055480957,
0.5129780173301697,
-0.6441576480865479,
0.04631691798567772,
-0.3886401653289795,
0.09055422991514206,
-0.039292432367801666,
1.1898608207702637,
1.2661718130111694,
0.7957950830459595,
-0.3947097361087799,
-0.8501549959182739,
0.13800324499607086,
0.001507716253399849,
-0.8519319295883179,
-1.7362117767333984,
-0.2913278043270111,
0.14945948123931885,
0.5904377698898315,
-1.1664983034133911,
1.7687580585479736,
0.8657572269439697,
1.9111891984939575,
1.0036303997039795,
-0.3670496940612793,
1.47445547580719,
0.11466430872678757,
1.8552052974700928,
-0.4854044020175934,
0.5999308228492737,
-0.3200960159301758,
-1.1410701274871826,
0.8327067494392395,
-0.25589999556541443,
-2.1477367877960205,
-0.6531667709350586,
-0.8110069036483765,
-0.1060815379023552,
-0.7048419713973999,
0.9779537320137024,
-0.15726225078105927,
-1.3985931873321533,
0.19535644352436066,
-0.7392079830169678,
0.1324339210987091,
-1.205575942993164,
0.28934696316719055,
0.7684106826782227,
-0.6366420984268188,
0.08210781961679459,
-0.24592985212802887,
-1.3202728033065796,
-0.40245476365089417,
0.36093243956565857,
1.7553690671920776,
-0.8053604364395142,
0.9531229734420776,
1.0416100025177002,
-0.735639750957489,
0.0012672338634729385,
0.3146476149559021,
-0.35322466492652893,
0.8385609984397888,
-1.059212565422058,
-0.38515302538871765,
1.140128493309021,
-0.21756334602832794,
-0.5961958169937134,
1.5217931270599365,
0.6729244589805603,
-0.9534690976142883,
-0.16242031753063202,
-0.17702177166938782,
-0.8224737644195557,
0.025532562285661697,
-1.6324796676635742,
-0.030304592102766037,
0.37482911348342896,
-1.5016721487045288,
-0.49268537759780884,
-0.19804611802101135,
1.333382487297058,
-0.09694943577051163,
1.3443958759307861,
-0.2826769948005676,
-0.20209449529647827,
-0.4916042983531952,
-0.31193074584007263,
0.11530381441116333,
-0.17007610201835632,
-0.5756115317344666,
0.22765398025512695,
-0.7770422697067261,
0.30721229314804077,
1.4437271356582642,
0.3499727249145508,
0.06702210009098053,
0.5743154883384705,
1.1263065338134766,
0.35360589623451233,
-0.15040020644664764,
-0.7910305261611938,
-1.6134363412857056,
1.9676179885864258,
-1.4054256677627563,
1.9299226999282837,
0.6512829661369324,
-0.0041209799237549305,
-1.9188185930252075,
-1.9554404020309448,
1.3639997243881226,
1.1038554906845093,
2.364522933959961,
0.5388665795326233,
0.44159552454948425,
-0.7921152710914612,
-0.708391010761261,
0.3513278663158417,
-0.8815410733222961,
-0.7042848467826843,
0.2604005038738251,
2.3355255126953125,
1.7456861734390259,
-0.44272157549858093,
-0.16270163655281067,
-1.1138912439346313,
1.4865044355392456,
-0.20128287374973297,
0.1570214182138443,
2.0443613529205322,
-0.2665031850337982,
-1.055576205253601,
1.3983813524246216,
-2.3401715755462646,
0.2027064710855484,
1.9603803157806396,
0.19418764114379883,
0.04099413752555847,
-1.3171573877334595,
-0.7033573985099792,
-0.34048110246658325,
-0.45024430751800537,
-1.1771361827850342,
0.5104221105575562,
-0.28455600142478943,
-0.7712233066558838,
-1.435377836227417,
0.21434806287288666,
-1.0966272354125977,
-1.7286114692687988,
0.14932005107402802,
1.809539794921875,
1.9259365797042847,
-0.7316794395446777,
1.4632928371429443,
-0.31220147013664246,
0.13850682973861694,
1.2593077421188354,
1.2366423606872559,
3.1370999813079834,
1.9615015983581543,
-1.3362213373184204,
0.751386284828186,
-0.01280877087265253,
-0.48554179072380066,
1.1645503044128418,
-1.2623603343963623,
1.307708501815796,
-0.15453048050403595,
-1.2471529245376587,
-1.1792198419570923,
0.9468883872032166,
0.5093048810958862,
0.09759321063756943,
-0.4737113118171692,
1.2048728466033936,
0.04990610107779503,
1.3951973915100098,
0.5803687572479248,
-0.3706033229827881,
0.6857700347900391,
-0.3664030134677887,
-0.5124405026435852,
1.5057209730148315,
0.24239997565746307,
-1.3458471298217773,
-2.292325973510742,
-0.33688977360725403,
-0.8581835627555847,
-0.04646742343902588,
-0.6371524930000305,
-0.9572942852973938,
1.662385106086731,
0.4320133626461029,
-1.228917121887207,
-0.21336089074611664,
-0.25607508420944214,
-0.48554471135139465,
2.749333381652832,
-1.3475004434585571,
-0.13450764119625092,
-1.0414795875549316,
-0.6396738886833191,
1.6666548252105713,
-1.1395481824874878,
-0.29179051518440247,
-1.139577865600586,
-0.5341657996177673,
-1.307759404182434,
-0.6006825566291809,
0.003272388130426407,
-0.9237207770347595,
0.886968195438385,
0.09324708580970764,
-1.2390354871749878,
-0.36055371165275574,
-0.9366646409034729,
0.9913178086280823,
-0.1721089631319046,
0.1257217973470688,
1.8202797174453735,
0.44452205300331116,
-0.4250437319278717,
0.6336391568183899,
1.1467666625976562,
0.6596171259880066,
-0.6464852094650269,
0.3047986626625061,
-0.7695649266242981,
0.31084632873535156,
-1.3049910068511963,
0.25596997141838074,
-2.8409910202026367,
0.5445122122764587,
-0.08816303312778473,
-0.06040963530540466,
-0.08264642208814621,
-1.4013673067092896,
1.019464135169983,
2.5836994647979736,
-1.2298928499221802,
0.4862813949584961,
0.32570695877075195,
1.1471692323684692,
-1.5461126565933228,
0.2915132939815521,
-0.4640713930130005,
2.059509038925171,
0.1834905743598938,
1.218538522720337,
-0.4184657335281372,
-2.241769313812256,
0.5979200601577759,
-1.242875099182129,
-1.156519889831543,
0.8214823603630066,
-0.858941912651062,
0.1095895990729332,
-1.3379524946212769,
-0.24498440325260162,
-0.752348780632019,
-1.1889604330062866,
0.6319981217384338,
0.13496477901935577,
0.5249478816986084,
-0.609187126159668,
0.3653929531574249,
-2.2247657775878906,
-1.283840298652649,
-0.2597208619117737,
-0.9379873871803284,
0.537542462348938,
-0.24163052439689636,
0.7231481671333313,
-0.1781548410654068,
-0.02606959268450737,
0.369017094373703,
1.4024348258972168,
3.3516383171081543,
0.11706045269966125,
0.22409407794475555,
-0.1505623608827591,
-0.9235390424728394,
1.3893924951553345,
0.9053930044174194,
-0.1252530813217163,
-0.5351614952087402,
-1.0952675342559814,
1.124801516532898,
1.9798229932785034,
1.0901236534118652,
-0.06509462743997574,
-0.8841513991355896,
-0.8236939907073975,
0.072027288377285,
0.16137997806072235,
0.45401322841644287,
0.88218092918396,
0.1579953134059906,
0.05049644038081169,
1.5262056589126587,
1.1628425121307373,
-0.29919421672821045,
0.4116579592227936,
-0.8688883781433105,
-0.5473083257675171,
0.5262800455093384,
0.35461169481277466,
0.01196217816323042,
0.33517006039619446,
-1.1217602491378784,
-0.12951624393463135,
-0.4030483365058899,
-0.8518027067184448,
-0.7208009362220764,
-0.46479904651641846,
-0.4082299470901489,
1.694014310836792,
0.042747508734464645,
-0.5334976315498352,
-0.08361741155385971,
-0.701371431350708,
-0.10349275916814804,
-1.0069202184677124,
0.47392162680625916,
-0.180930495262146,
-0.03523961454629898,
-0.12902936339378357,
1.722554326057434,
-0.9338076114654541,
-1.9641075134277344,
0.1934637725353241,
0.19990593194961548,
-0.3403916656970978,
0.247172549366951,
1.623802661895752,
0.5927984118461609,
1.412021279335022,
1.3533332347869873,
0.9828044176101685,
-0.6574687361717224,
-1.3573241233825684,
0.6575449705123901,
0.9459210634231567,
-1.3986884355545044,
0.6834841370582581,
0.02457437664270401,
-0.5398451089859009,
0.6163799166679382,
1.2529683113098145,
0.44266262650489807,
-2.0753958225250244,
0.8354212641716003,
-0.9415029287338257,
0.7173190712928772,
0.7826034426689148,
0.7667605876922607,
0.09718978404998779,
0.814183235168457,
-1.2991317510604858,
-1.109609603881836,
-0.6777581572532654,
-0.6961562633514404,
1.9153285026550293,
-0.2918507754802704,
0.6167692542076111,
-0.31559619307518005,
-1.3929411172866821,
-0.013386284932494164,
0.6988534927368164,
0.3385574519634247,
-0.5788807272911072,
0.8212465047836304,
-0.6021093130111694,
-1.09734308719635,
-1.314969778060913,
-0.4504002034664154,
-1.1661561727523804,
-0.8676442503929138,
1.0288325548171997,
0.8139950037002563,
0.34100714325904846,
1.822113037109375,
0.6239281892776489,
0.3096121549606323,
-2.674024820327759,
0.8732004761695862,
0.2493428736925125,
-0.0803031250834465,
0.7754501700401306,
0.3275771737098694,
1.0297349691390991,
-0.13694950938224792,
0.6379270553588867,
-2.447089910507202,
2.3042898178100586,
-0.20990410447120667,
0.6611123085021973,
-0.023142419755458832,
-0.1608072966337204,
1.0373694896697998,
0.6237539649009705,
0.6129056215286255,
-1.0856367349624634,
0.7113934755325317,
-0.6099871397018433,
1.2053542137145996,
0.7882531881332397,
-0.8205192685127258,
-0.09642744064331055,
1.3771404027938843,
0.5210879445075989,
-0.4418274760246277,
-0.926397979259491,
-1.0504173040390015,
0.9271860718727112,
1.7544658184051514,
-0.11370637267827988,
0.0021540485322475433,
0.898368775844574,
0.700670599937439,
-1.3410134315490723,
0.07403405755758286,
-0.7484053373336792,
-0.6744924187660217,
1.6366379261016846,
2.0861573219299316,
-0.14485019445419312,
-0.18319419026374817,
-0.7949848771095276,
-1.1719377040863037,
0.7725526094436646,
0.06379137188196182,
0.036602482199668884,
0.6397835612297058,
-0.5726674795150757,
1.177320122718811,
0.8589711785316467,
0.940811038017273,
0.2618412375450134,
0.31453368067741394,
0.2918298840522766,
-0.2977890968322754,
-1.2769262790679932,
-0.23382242023944855,
-0.9124353528022766,
-2.4431848526000977,
0.5579401254653931,
-0.22032137215137482,
-1.5361357927322388,
0.026382222771644592,
-1.0357770919799805,
0.8859517574310303,
-0.5594522356987,
-1.1305584907531738,
-1.506263256072998,
0.25093957781791687,
-0.05845688655972481,
0.9644068479537964,
-1.534500241279602,
-0.07552111148834229,
1.268585205078125,
0.8862091898918152,
-0.6765393614768982,
0.9758791923522949,
0.2552456259727478,
1.0512713193893433,
0.9366613626480103,
-0.3000216782093048,
0.5094071626663208,
0.12445813417434692,
-1.318561315536499,
0.41784241795539856,
1.1547316312789917,
0.22603118419647217,
1.4789708852767944,
-0.6248401999473572,
0.05628329887986183,
0.41654545068740845,
-0.4640510380268097,
-0.4267183244228363,
-0.5592783689498901,
0.6736338138580322,
0.023292340338230133,
-0.9272993803024292,
-0.0017927614971995354,
-0.0005947928875684738,
-0.20984739065170288,
0.19499419629573822,
-1.4326914548873901,
-0.1458287090063095,
-0.3436998724937439,
-0.6482713222503662,
-1.1564244031906128,
-0.04694697633385658,
1.3927034139633179,
-0.8090042471885681,
-0.16556501388549805,
0.5423555374145508,
0.27951300144195557,
0.5649071335792542,
0.6759474873542786,
-0.6749177575111389,
-0.2518693804740906,
-0.22139108180999756,
-0.3600011467933655,
0.2940577566623688,
1.4073691368103027,
-0.08255895227193832,
-0.9817794561386108,
0.7514647245407104,
-0.38517865538597107,
0.04561297222971916,
2.004329204559326,
0.13115039467811584,
-0.8291165828704834,
0.3292412757873535,
-0.7508421540260315,
1.8791230916976929,
1.846420168876648,
1.4034154415130615,
-0.10168099403381348,
-1.0549707412719727,
0.47807908058166504,
-0.4164535701274872,
-0.355915367603302,
0.9525433778762817,
0.42595985531806946,
-0.18970131874084473,
-1.289438009262085,
0.7667414546012878,
1.2875685691833496,
-0.9028586745262146,
-0.8298476934432983,
0.20363593101501465,
-0.8092833161354065,
1.0874286890029907,
0.7631012201309204,
0.383934885263443,
0.24517418444156647,
1.5514299869537354,
0.7367772459983826,
-0.4153997302055359,
0.6096318364143372,
0.5376359820365906,
-0.21515582501888275,
-1.9914811849594116,
-1.1432400941848755,
0.3965453505516052,
-0.619785487651825,
-1.6617109775543213,
1.4134187698364258,
-1.2101523876190186,
-0.9794066548347473,
0.500231921672821,
0.07535628229379654,
1.444358229637146,
0.38000378012657166,
1.5940114259719849,
2.0971343517303467,
0.9492080807685852,
0.3866821825504303,
1.3654824495315552,
-0.16141368448734283,
-0.4007716178894043,
1.7754462957382202,
-0.4975705146789551,
0.545353889465332,
1.1019675731658936,
-0.31207650899887085,
-1.052899718284607,
-0.8076597452163696,
-1.1805541515350342,
-0.7227529883384705,
1.20852530002594,
0.050037283450365067,
-1.0838953256607056,
0.3353012502193451,
1.5476256608963013,
0.008809608407318592,
-0.3093926012516022,
0.7197245359420776,
0.28545287251472473,
-0.8440007567405701,
-0.1538330316543579,
-0.966775119304657,
0.5344247221946716,
-0.2570384442806244,
-0.3612886965274811,
0.283430278301239,
0.4617672562599182,
1.3573709726333618,
-0.014097810722887516,
0.13879609107971191,
1.214590311050415,
-1.3847469091415405,
1.47869873046875,
-0.7636376619338989,
0.2621763050556183,
-2.3443777561187744,
1.3850609064102173,
-0.7884523868560791,
1.88406503200531,
-2.706709623336792,
0.48002010583877563,
-0.49531272053718567,
-0.4514322578907013,
0.24735884368419647,
-0.31185322999954224,
0.10586120933294296,
-0.13529081642627716,
-1.231444239616394,
-0.06302719563245773,
-0.7619299292564392,
0.581865668296814,
1.0651721954345703,
1.4209775924682617,
-1.151497483253479,
-0.35743334889411926,
-1.6934559345245361,
-0.27228355407714844,
-0.7556381821632385,
0.43926531076431274,
-1.8758571147918701,
-0.18304672837257385,
-1.8624109029769897,
-2.5900352001190186,
-1.246559739112854,
-0.8313976526260376,
1.1430846452713013,
0.05610250309109688,
-0.8891305327415466,
1.1402744054794312,
-0.38963428139686584,
-1.9110296964645386,
1.1818768978118896,
-2.225930690765381
] |
https://github.com/huggingface/datasets/issues/5150 | Problems after upgrading to 2.6.1 | I bumped into the issue too. @Lokiiiiii thanks for steps. I "solved" if for now by `pip install datasets>=2.6.1` everywhere. | ### Describe the bug
Loading a dataset_dict from disk with `load_from_disk` is now creating a `KeyError "length"` that was not occurring in v2.5.2.
Context:
- Each individual dataset in the dict is created with `Dataset.from_pandas`
- The dataset_dict is create from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- The pandas dataframe, besides text columns, has a column with a dictionary inside and potentially different keys in each row. Correctly the `Dataset.from_pandas` function adds `key: None` to all dictionaries in each row so that the schema can be correctly inferred.
### Steps to reproduce the bug
Steps to reproduce:
- Upgrade to datasets==2.6.1
- Create a dataset from pandas dataframe with `Dataset.from_pandas`
- Create a dataset_dict from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- Save to disk with the `save` function
### Expected behavior
Same as in v2.5.2, that is load from disk without errors
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.4.209-129.367.amzn2int.x86_64-x86_64-with-glibc2.26
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1 | 461 | 20 | Problems after upgrading to 2.6.1
### Describe the bug
Loading a dataset_dict from disk with `load_from_disk` is now creating a `KeyError "length"` that was not occurring in v2.5.2.
Context:
- Each individual dataset in the dict is created with `Dataset.from_pandas`
- The dataset_dict is create from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- The pandas dataframe, besides text columns, has a column with a dictionary inside and potentially different keys in each row. Correctly the `Dataset.from_pandas` function adds `key: None` to all dictionaries in each row so that the schema can be correctly inferred.
### Steps to reproduce the bug
Steps to reproduce:
- Upgrade to datasets==2.6.1
- Create a dataset from pandas dataframe with `Dataset.from_pandas`
- Create a dataset_dict from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- Save to disk with the `save` function
### Expected behavior
Same as in v2.5.2, that is load from disk without errors
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.4.209-129.367.amzn2int.x86_64-x86_64-with-glibc2.26
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
I bumped into the issue too. @Lokiiiiii thanks for steps. I "solved" if for now by `pip install datasets>=2.6.1` everywhere. | [
-1.1133012771606445,
-0.8346743583679199,
-0.7227151393890381,
1.3911914825439453,
-0.1729459911584854,
-1.2756682634353638,
0.2231656014919281,
-1.1174505949020386,
1.7307238578796387,
-0.7928450703620911,
0.32979053258895874,
-1.6463099718093872,
0.014098119921982288,
-0.5949354767799377,
-0.7025763392448425,
-0.8625356554985046,
-0.4343879222869873,
-0.6561452746391296,
0.9432168006896973,
2.442232608795166,
1.1978343725204468,
-1.351717472076416,
2.591013193130493,
0.743560254573822,
-0.17513197660446167,
-0.9500871896743774,
0.5237677693367004,
0.08005421608686447,
-1.4270650148391724,
-0.3385515511035919,
-0.9304889440536499,
-0.10178568214178085,
-0.5265530943870544,
-0.5814383029937744,
-0.023382052779197693,
0.43044283986091614,
-0.39507177472114563,
-0.5216711163520813,
-0.5329040288925171,
-0.8615438938140869,
0.36968231201171875,
-0.32337215542793274,
0.9828606843948364,
-0.3883940279483795,
1.7916837930679321,
-0.5569015741348267,
0.519472599029541,
0.7909345626831055,
1.2445186376571655,
0.15265783667564392,
-0.046990420669317245,
0.3822024166584015,
0.42334598302841187,
0.009347801096737385,
0.48030802607536316,
1.0675688982009888,
0.6452897191047668,
0.448917955160141,
0.7565124034881592,
-2.220919609069824,
1.3232990503311157,
-0.97978276014328,
0.30794569849967957,
1.4052538871765137,
-0.9526427984237671,
0.33456048369407654,
-1.7478961944580078,
-0.1229952946305275,
0.50868159532547,
-2.2521934509277344,
0.25413262844085693,
-1.3957741260528564,
-0.5631715655326843,
1.049250841140747,
0.44247013330459595,
-1.0777547359466553,
0.08712539076805115,
-0.370679646730423,
0.8571791052818298,
0.460419625043869,
1.1533293724060059,
-1.6573209762573242,
-0.09536927938461304,
-0.34370920062065125,
0.10988053679466248,
-1.2595840692520142,
-1.5470753908157349,
0.6086480617523193,
0.6840221285820007,
0.5399223566055298,
-0.13783137500286102,
0.9592155814170837,
-0.9857403635978699,
0.7408124804496765,
-0.9946577548980713,
-1.8141261339187622,
-1.3910493850708008,
-2.2978103160858154,
-2.353670120239258,
0.7515332698822021,
-0.47232964634895325,
-0.4916810095310211,
2.0917930603027344,
-1.0235146284103394,
-1.7016521692276,
1.0594006776809692,
0.21348002552986145,
-0.09541069716215134,
2.364983320236206,
0.23304802179336548,
-0.6916118264198303,
0.44318467378616333,
-0.7734724879264832,
0.6565412878990173,
-0.333730012178421,
1.2975139617919922,
0.44993510842323303,
-1.089369535446167,
1.5884222984313965,
-0.3973804712295532,
0.5491964817047119,
-0.6627312898635864,
-0.45424604415893555,
-0.6442413330078125,
0.2583972215652466,
1.8244601488113403,
-0.2555486559867859,
1.4869604110717773,
-0.329487681388855,
-1.563255786895752,
-1.6158746480941772,
0.8095581531524658,
0.5250552892684937,
-0.6665244102478027,
0.07935154438018799,
-0.34769362211227417,
0.10947703570127487,
-0.03500570356845856,
1.1832252740859985,
1.3129712343215942,
0.8058947324752808,
-0.3959270417690277,
-0.8927941918373108,
0.1525549739599228,
-0.02083558589220047,
-0.8737508058547974,
-1.7328598499298096,
-0.29625535011291504,
0.13848231732845306,
0.6294456720352173,
-1.2022805213928223,
1.7971241474151611,
0.8868366479873657,
1.9371260404586792,
0.9932697415351868,
-0.4143911898136139,
1.48358154296875,
0.0968746468424797,
1.870593547821045,
-0.4683364927768707,
0.6145355701446533,
-0.3611055314540863,
-1.1274542808532715,
0.85139399766922,
-0.23610979318618774,
-2.1192898750305176,
-0.6481376886367798,
-0.8579246997833252,
-0.12413805723190308,
-0.6989227533340454,
1.015458583831787,
-0.13663169741630554,
-1.3347880840301514,
0.22223664820194244,
-0.7600905299186707,
0.0872928723692894,
-1.2381967306137085,
0.31539565324783325,
0.738274335861206,
-0.6036924719810486,
0.12587447464466095,
-0.2368648201227188,
-1.3271406888961792,
-0.4157869219779968,
0.34973400831222534,
1.768959641456604,
-0.7982757091522217,
0.9494963884353638,
1.0288945436477661,
-0.7592529654502869,
-0.0004509594291448593,
0.3539574146270752,
-0.3744885325431824,
0.8524236083030701,
-1.038732647895813,
-0.42455312609672546,
1.117582082748413,
-0.22130277752876282,
-0.5575153827667236,
1.5078251361846924,
0.6590626239776611,
-0.9547034502029419,
-0.16053369641304016,
-0.17010299861431122,
-0.8060681819915771,
0.07175026088953018,
-1.6372299194335938,
-0.03644772246479988,
0.36131903529167175,
-1.5212949514389038,
-0.468824565410614,
-0.17187118530273438,
1.3303672075271606,
-0.10576662421226501,
1.3523317575454712,
-0.28542351722717285,
-0.2196347862482071,
-0.4861859977245331,
-0.3023110628128052,
0.08422212302684784,
-0.1741068810224533,
-0.5615171194076538,
0.2688159942626953,
-0.7652243375778198,
0.31186336278915405,
1.4244581460952759,
0.3030937910079956,
0.06605245918035507,
0.5529188513755798,
1.1076953411102295,
0.3674784004688263,
-0.11801157891750336,
-0.8122813105583191,
-1.5658799409866333,
2.0225086212158203,
-1.4037010669708252,
1.9529368877410889,
0.6812619566917419,
-0.005413082428276539,
-1.907904028892517,
-1.9608616828918457,
1.380523681640625,
1.1188005208969116,
2.359616756439209,
0.5633742809295654,
0.4321240782737732,
-0.7972080707550049,
-0.6787576079368591,
0.3648701608181,
-0.8992742300033569,
-0.7174037098884583,
0.22652457654476166,
2.3374297618865967,
1.7084189653396606,
-0.4362490475177765,
-0.15782561898231506,
-1.1217575073242188,
1.497668743133545,
-0.15652553737163544,
0.1292252242565155,
2.040210008621216,
-0.2841953635215759,
-1.0937083959579468,
1.3760883808135986,
-2.3418145179748535,
0.20786410570144653,
1.9596836566925049,
0.19383345544338226,
0.015177027322351933,
-1.3069446086883545,
-0.698131263256073,
-0.3468233048915863,
-0.4251434803009033,
-1.1180403232574463,
0.5106556415557861,
-0.242628812789917,
-0.7894864082336426,
-1.4877201318740845,
0.2230360358953476,
-1.1155974864959717,
-1.7497539520263672,
0.1742040067911148,
1.7883249521255493,
1.9543263912200928,
-0.7577865123748779,
1.450783610343933,
-0.26434919238090515,
0.1045149564743042,
1.2625116109848022,
1.1935395002365112,
3.0985398292541504,
1.9628286361694336,
-1.3296895027160645,
0.7282148003578186,
-0.0009177271276712418,
-0.4868232011795044,
1.155494213104248,
-1.2733713388442993,
1.2986650466918945,
-0.14366090297698975,
-1.1944084167480469,
-1.1708705425262451,
0.9163953065872192,
0.461186945438385,
0.09220530837774277,
-0.4710211157798767,
1.187809944152832,
0.11342432349920273,
1.3985379934310913,
0.5844941139221191,
-0.3075285851955414,
0.6945472359657288,
-0.3692892789840698,
-0.4977746605873108,
1.523271083831787,
0.25948262214660645,
-1.3752813339233398,
-2.3372204303741455,
-0.32171157002449036,
-0.8694385886192322,
-0.036945078521966934,
-0.6424413919448853,
-0.9833405613899231,
1.6625595092773438,
0.441137433052063,
-1.2078980207443237,
-0.24539786577224731,
-0.3027596175670624,
-0.5187409520149231,
2.755859613418579,
-1.3824318647384644,
-0.1441301554441452,
-1.0654600858688354,
-0.6321088075637817,
1.636765956878662,
-1.1688398122787476,
-0.2704882025718689,
-1.1370056867599487,
-0.5027356743812561,
-1.3057541847229004,
-0.5820875763893127,
-0.01229763962328434,
-0.9131268262863159,
0.8295618891716003,
0.1466008573770523,
-1.234508752822876,
-0.3721722960472107,
-0.9314704537391663,
0.9027524590492249,
-0.14276418089866638,
0.15122826397418976,
1.8012820482254028,
0.46668270230293274,
-0.37118950486183167,
0.6352998614311218,
1.1592141389846802,
0.6549600958824158,
-0.6090466976165771,
0.29640549421310425,
-0.7287716865539551,
0.32116058468818665,
-1.2695300579071045,
0.27878451347351074,
-2.792994976043701,
0.5540041327476501,
-0.11592917144298553,
-0.06830350309610367,
-0.1132330521941185,
-1.4018628597259521,
1.081205129623413,
2.5656330585479736,
-1.2186626195907593,
0.5252844095230103,
0.2854807376861572,
1.128826379776001,
-1.545066475868225,
0.30906352400779724,
-0.44794800877571106,
2.1128573417663574,
0.18702784180641174,
1.1595615148544312,
-0.43004629015922546,
-2.260279655456543,
0.6115559339523315,
-1.2173397541046143,
-1.1512147188186646,
0.7893835306167603,
-0.8441346287727356,
0.05771917477250099,
-1.3184592723846436,
-0.23323571681976318,
-0.7397459745407104,
-1.213059902191162,
0.6381319761276245,
0.1055508628487587,
0.5521450638771057,
-0.6398558616638184,
0.3566727638244629,
-2.2523536682128906,
-1.3351171016693115,
-0.2658935785293579,
-0.9586178064346313,
0.5315003991127014,
-0.2530137002468109,
0.7747079730033875,
-0.17950506508350372,
-0.020552504807710648,
0.3722296357154846,
1.413643717765808,
3.368525266647339,
0.11927804350852966,
0.28977417945861816,
-0.18431676924228668,
-0.9334279298782349,
1.408776879310608,
0.9072118401527405,
-0.11793003976345062,
-0.5206584930419922,
-1.1055606603622437,
1.1223613023757935,
1.9983224868774414,
1.0761171579360962,
-0.053256042301654816,
-0.8663240671157837,
-0.8305516839027405,
0.06758545339107513,
0.18580234050750732,
0.43491461873054504,
0.9086718559265137,
0.16712115705013275,
0.040727123618125916,
1.5187914371490479,
1.1941466331481934,
-0.32313430309295654,
0.3984544575214386,
-0.8683463931083679,
-0.5165055990219116,
0.5314803719520569,
0.3910907804965973,
0.01350907701998949,
0.34597352147102356,
-1.0792741775512695,
-0.16076986491680145,
-0.3933725357055664,
-0.855263352394104,
-0.7426366209983826,
-0.478729784488678,
-0.40387123823165894,
1.7257270812988281,
0.05417000874876976,
-0.5264518857002258,
-0.05996264889836311,
-0.7178187966346741,
-0.06973166763782501,
-1.0302387475967407,
0.44531530141830444,
-0.16665434837341309,
-0.032030049711465836,
-0.10711513459682465,
1.7722116708755493,
-0.9142736792564392,
-1.987313151359558,
0.21163758635520935,
0.20358625054359436,
-0.37371695041656494,
0.26251474022865295,
1.6298701763153076,
0.5821771025657654,
1.4376238584518433,
1.3577156066894531,
0.989249050617218,
-0.6944610476493835,
-1.3390088081359863,
0.6368431448936462,
0.9378681778907776,
-1.4272925853729248,
0.677493155002594,
0.0672803595662117,
-0.487605482339859,
0.5831512212753296,
1.2294862270355225,
0.4231868386268616,
-2.072511911392212,
0.8248854875564575,
-0.9209790825843811,
0.7536953687667847,
0.7546559572219849,
0.7588196992874146,
0.1017400249838829,
0.759621262550354,
-1.27396559715271,
-1.0803078413009644,
-0.6957074999809265,
-0.6985840201377869,
1.918520212173462,
-0.32408514618873596,
0.616710901260376,
-0.2810933589935303,
-1.3869924545288086,
-0.02773461490869522,
0.7023620009422302,
0.3262118399143219,
-0.5550920963287354,
0.8053475618362427,
-0.589072048664093,
-1.1285020112991333,
-1.3449406623840332,
-0.4460084140300751,
-1.1487070322036743,
-0.8883647322654724,
1.0518847703933716,
0.8023326992988586,
0.3466627597808838,
1.861203670501709,
0.6179008483886719,
0.28702443838119507,
-2.667046308517456,
0.9070585370063782,
0.2835178077220917,
-0.07896516472101212,
0.8319770097732544,
0.35434451699256897,
1.02643620967865,
-0.17999230325222015,
0.6219183206558228,
-2.4372823238372803,
2.324700355529785,
-0.1974983513355255,
0.7020794749259949,
-0.0040459162555634975,
-0.17063705623149872,
1.0352829694747925,
0.6294978857040405,
0.6197909712791443,
-1.1144062280654907,
0.7123699188232422,
-0.6410563588142395,
1.217109203338623,
0.7882065176963806,
-0.8024312853813171,
-0.08651096373796463,
1.351536512374878,
0.5328981280326843,
-0.43905404210090637,
-0.9351330399513245,
-1.0417743921279907,
0.9040899276733398,
1.7621617317199707,
-0.1465969979763031,
0.01040585059672594,
0.8796277046203613,
0.6766902804374695,
-1.3548102378845215,
0.06001963093876839,
-0.7858332395553589,
-0.6838443875312805,
1.6387029886245728,
2.088111162185669,
-0.1285257786512375,
-0.20116166770458221,
-0.8184826970100403,
-1.2290440797805786,
0.7680257558822632,
0.08847540616989136,
0.07255978882312775,
0.5927103757858276,
-0.5830768346786499,
1.2082370519638062,
0.8680441379547119,
0.9321232438087463,
0.27843549847602844,
0.30230674147605896,
0.29004865884780884,
-0.3185172379016876,
-1.24558687210083,
-0.2183169275522232,
-0.9485471248626709,
-2.4558727741241455,
0.59896320104599,
-0.24219901859760284,
-1.527912974357605,
-0.004811124410480261,
-1.0191510915756226,
0.879523754119873,
-0.5475793480873108,
-1.1174591779708862,
-1.4881545305252075,
0.24046288430690765,
-0.0982540026307106,
0.9673632979393005,
-1.5373984575271606,
-0.10760475695133209,
1.302803635597229,
0.8938996195793152,
-0.6922990679740906,
0.9800329804420471,
0.26412054896354675,
1.0704686641693115,
0.9155963659286499,
-0.3004339337348938,
0.508130669593811,
0.12428343296051025,
-1.343504548072815,
0.3886446952819824,
1.1610941886901855,
0.22317400574684143,
1.481457233428955,
-0.6294964551925659,
0.08485809713602066,
0.39352354407310486,
-0.3997584581375122,
-0.45616820454597473,
-0.5723252892494202,
0.6972858905792236,
0.0357060544192791,
-0.9486949443817139,
0.02671600505709648,
0.0037132566794753075,
-0.1799565851688385,
0.1856956034898758,
-1.449660062789917,
-0.1695779263973236,
-0.35645124316215515,
-0.6370977163314819,
-1.176997184753418,
-0.0765712559223175,
1.3753951787948608,
-0.7951581478118896,
-0.12503795325756073,
0.5341808795928955,
0.3022163510322571,
0.5714260935783386,
0.6679227948188782,
-0.6353181004524231,
-0.33016857504844666,
-0.2029491811990738,
-0.3695135712623596,
0.3511945903301239,
1.3798712491989136,
-0.06583763659000397,
-0.9753393530845642,
0.7458677887916565,
-0.35708552598953247,
0.05214456468820572,
1.9953179359436035,
0.11697337031364441,
-0.829877495765686,
0.31476128101348877,
-0.6855478286743164,
1.8956067562103271,
1.836690068244934,
1.3641235828399658,
-0.0916825532913208,
-1.0868467092514038,
0.5223396420478821,
-0.41134652495384216,
-0.3420906364917755,
0.9490239024162292,
0.40471336245536804,
-0.20415325462818146,
-1.3004517555236816,
0.7190162539482117,
1.292876124382019,
-0.9234955906867981,
-0.8624130487442017,
0.19422872364521027,
-0.8173568844795227,
1.0868366956710815,
0.753429114818573,
0.40015971660614014,
0.26350635290145874,
1.5708167552947998,
0.74202960729599,
-0.41947194933891296,
0.6249855756759644,
0.5252562761306763,
-0.24456244707107544,
-1.9865853786468506,
-1.1690785884857178,
0.37241989374160767,
-0.6277562379837036,
-1.6253594160079956,
1.4370529651641846,
-1.2232383489608765,
-1.0061589479446411,
0.4949184060096741,
0.07885348796844482,
1.448554515838623,
0.35893961787223816,
1.6001319885253906,
2.0688443183898926,
0.9369261860847473,
0.3974402844905853,
1.354368805885315,
-0.1884717047214508,
-0.4266875982284546,
1.773308277130127,
-0.4954283833503723,
0.5416024923324585,
1.1333147287368774,
-0.3090159296989441,
-1.0473099946975708,
-0.8289283514022827,
-1.1585336923599243,
-0.752154529094696,
1.2544238567352295,
0.07148247212171555,
-1.070583701133728,
0.3633756935596466,
1.58333158493042,
0.016042020171880722,
-0.3358839154243469,
0.634774386882782,
0.3209288418292999,
-0.8316649794578552,
-0.13280387222766876,
-0.9849597811698914,
0.5564020872116089,
-0.25613269209861755,
-0.3752415180206299,
0.31081631779670715,
0.43854448199272156,
1.3567118644714355,
-0.03556528687477112,
0.1482149213552475,
1.1938563585281372,
-1.4130737781524658,
1.5158337354660034,
-0.7343996167182922,
0.22903595864772797,
-2.261012554168701,
1.3824777603149414,
-0.7796084880828857,
1.9061965942382812,
-2.701460838317871,
0.45308852195739746,
-0.5084623694419861,
-0.4291544556617737,
0.2210758477449417,
-0.3271563947200775,
0.13207627832889557,
-0.15414845943450928,
-1.211012840270996,
-0.11030588299036026,
-0.784137487411499,
0.5309387445449829,
1.0644053220748901,
1.3987925052642822,
-1.0925147533416748,
-0.36619555950164795,
-1.681894063949585,
-0.2531318962574005,
-0.7086871266365051,
0.39308008551597595,
-1.8562419414520264,
-0.17458945512771606,
-1.892674446105957,
-2.539003610610962,
-1.2776144742965698,
-0.8429232835769653,
1.1150702238082886,
0.01570744812488556,
-0.8590649366378784,
1.1021950244903564,
-0.3837847113609314,
-1.915274977684021,
1.18977689743042,
-2.21549916267395
] |
https://github.com/huggingface/datasets/issues/5150 | Problems after upgrading to 2.6.1 | Hi all,
I experienced the same issue.
Please note that the pull request is related to the IMDB example provided in the doc, and is a fix for that, in that context, to make sure that people can follow the doc example and have a working system.
It does not provide a fix for Datasets itself. | ### Describe the bug
Loading a dataset_dict from disk with `load_from_disk` is now creating a `KeyError "length"` that was not occurring in v2.5.2.
Context:
- Each individual dataset in the dict is created with `Dataset.from_pandas`
- The dataset_dict is create from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- The pandas dataframe, besides text columns, has a column with a dictionary inside and potentially different keys in each row. Correctly the `Dataset.from_pandas` function adds `key: None` to all dictionaries in each row so that the schema can be correctly inferred.
### Steps to reproduce the bug
Steps to reproduce:
- Upgrade to datasets==2.6.1
- Create a dataset from pandas dataframe with `Dataset.from_pandas`
- Create a dataset_dict from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- Save to disk with the `save` function
### Expected behavior
Same as in v2.5.2, that is load from disk without errors
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.4.209-129.367.amzn2int.x86_64-x86_64-with-glibc2.26
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1 | 461 | 56 | Problems after upgrading to 2.6.1
### Describe the bug
Loading a dataset_dict from disk with `load_from_disk` is now creating a `KeyError "length"` that was not occurring in v2.5.2.
Context:
- Each individual dataset in the dict is created with `Dataset.from_pandas`
- The dataset_dict is create from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- The pandas dataframe, besides text columns, has a column with a dictionary inside and potentially different keys in each row. Correctly the `Dataset.from_pandas` function adds `key: None` to all dictionaries in each row so that the schema can be correctly inferred.
### Steps to reproduce the bug
Steps to reproduce:
- Upgrade to datasets==2.6.1
- Create a dataset from pandas dataframe with `Dataset.from_pandas`
- Create a dataset_dict from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- Save to disk with the `save` function
### Expected behavior
Same as in v2.5.2, that is load from disk without errors
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.4.209-129.367.amzn2int.x86_64-x86_64-with-glibc2.26
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
Hi all,
I experienced the same issue.
Please note that the pull request is related to the IMDB example provided in the doc, and is a fix for that, in that context, to make sure that people can follow the doc example and have a working system.
It does not provide a fix for Datasets itself. | [
-1.1131110191345215,
-0.8637317419052124,
-0.741231381893158,
1.4086195230484009,
-0.17370860278606415,
-1.280288577079773,
0.22080254554748535,
-1.1276520490646362,
1.7342647314071655,
-0.8224511742591858,
0.3115141689777374,
-1.6689578294754028,
0.03850555419921875,
-0.6278249621391296,
-0.7090454697608948,
-0.8553439974784851,
-0.44934365153312683,
-0.7377590537071228,
0.9246386885643005,
2.4397778511047363,
1.2042981386184692,
-1.3659143447875977,
2.616590738296509,
0.775788426399231,
-0.1729975789785385,
-0.9610446691513062,
0.5226191282272339,
0.0353444442152977,
-1.4184914827346802,
-0.36091458797454834,
-0.9480988383293152,
-0.09814431518316269,
-0.5286771655082703,
-0.5516815781593323,
-0.017397617921233177,
0.41481348872184753,
-0.3969113528728485,
-0.5082863569259644,
-0.527356743812561,
-0.8394513726234436,
0.3420375883579254,
-0.3408641517162323,
0.9907530546188354,
-0.3765401244163513,
1.7992488145828247,
-0.5324011445045471,
0.47195127606391907,
0.8048911094665527,
1.2625077962875366,
0.15751983225345612,
-0.03743355721235275,
0.3399505615234375,
0.39280813932418823,
-0.01112286001443863,
0.4850786328315735,
1.0838100910186768,
0.6515559554100037,
0.47940492630004883,
0.7775907516479492,
-2.211916208267212,
1.3494138717651367,
-0.9947861433029175,
0.31903472542762756,
1.3950752019882202,
-0.970070481300354,
0.3386090397834778,
-1.7542204856872559,
-0.1102406457066536,
0.52396559715271,
-2.255013942718506,
0.241231769323349,
-1.3447915315628052,
-0.5598011612892151,
1.0302292108535767,
0.39383664727211,
-1.0665932893753052,
0.1233723908662796,
-0.3845522105693817,
0.8611218929290771,
0.4659193456172943,
1.1677368879318237,
-1.6519607305526733,
-0.06518396735191345,
-0.3267202079296112,
0.10693008452653885,
-1.3152185678482056,
-1.5497403144836426,
0.6163215041160583,
0.6918238401412964,
0.5545423030853271,
-0.13356752693653107,
0.9878620505332947,
-0.9897584915161133,
0.7445035576820374,
-0.9742679595947266,
-1.7903786897659302,
-1.3857990503311157,
-2.2702200412750244,
-2.3386569023132324,
0.7505679726600647,
-0.47080904245376587,
-0.5151788592338562,
2.1055195331573486,
-1.0136960744857788,
-1.6925365924835205,
1.0578476190567017,
0.23059965670108795,
-0.1036643460392952,
2.4174089431762695,
0.2196652889251709,
-0.677405834197998,
0.43054667115211487,
-0.734942615032196,
0.7139003872871399,
-0.3701663911342621,
1.2841328382492065,
0.4249756932258606,
-1.1010160446166992,
1.5725772380828857,
-0.39839261770248413,
0.5502932071685791,
-0.6454724669456482,
-0.45066165924072266,
-0.6697058081626892,
0.27583885192871094,
1.785599708557129,
-0.26581817865371704,
1.4862149953842163,
-0.31098470091819763,
-1.5851751565933228,
-1.6043078899383545,
0.8219417333602905,
0.5066919326782227,
-0.721634030342102,
0.07678303867578506,
-0.3546185791492462,
0.1285698264837265,
-0.05700748413801193,
1.176557183265686,
1.3081676959991455,
0.7822553515434265,
-0.352746844291687,
-0.8779056072235107,
0.14087234437465668,
-0.06438392400741577,
-0.8506216406822205,
-1.7197192907333374,
-0.29948219656944275,
0.12179288268089294,
0.5927366018295288,
-1.1881159543991089,
1.8197853565216064,
0.8996762633323669,
1.9069808721542358,
0.9912511110305786,
-0.40181609988212585,
1.493889570236206,
0.09589720517396927,
1.8429652452468872,
-0.4903598129749298,
0.595788300037384,
-0.3711402118206024,
-1.1189358234405518,
0.8651651740074158,
-0.24789421260356903,
-2.1001389026641846,
-0.6422422528266907,
-0.8203706741333008,
-0.14267583191394806,
-0.6896660327911377,
0.9911452531814575,
-0.1450040340423584,
-1.318098545074463,
0.24597063660621643,
-0.7182015776634216,
0.09336470067501068,
-1.22429358959198,
0.3077090084552765,
0.7308472990989685,
-0.6197719573974609,
0.11113425344228745,
-0.22405385971069336,
-1.329330325126648,
-0.42864641547203064,
0.3311491906642914,
1.7599331140518188,
-0.7822198867797852,
0.9187252521514893,
1.0324225425720215,
-0.7237459421157837,
-0.02186468616127968,
0.36131829023361206,
-0.3441351056098938,
0.8286582827568054,
-1.036820411682129,
-0.42514485120773315,
1.1259734630584717,
-0.21901868283748627,
-0.5849918127059937,
1.5066111087799072,
0.6628905534744263,
-0.967724084854126,
-0.14586278796195984,
-0.15962649881839752,
-0.8500463962554932,
0.05108051002025604,
-1.6408122777938843,
-0.025811051949858665,
0.3702043294906616,
-1.5071895122528076,
-0.4651676118373871,
-0.1821548193693161,
1.3047670125961304,
-0.0909850001335144,
1.3639979362487793,
-0.32177913188934326,
-0.21036161482334137,
-0.47223183512687683,
-0.31580063700675964,
0.10211710631847382,
-0.17669278383255005,
-0.5331318974494934,
0.2635065019130707,
-0.7589291334152222,
0.33404597640037537,
1.4152071475982666,
0.3274346590042114,
0.06724417209625244,
0.5470720529556274,
1.0934932231903076,
0.39195361733436584,
-0.09589637070894241,
-0.8074151277542114,
-1.5217777490615845,
2.0316073894500732,
-1.4324814081192017,
1.9642091989517212,
0.7124208807945251,
0.011664969846606255,
-1.905579924583435,
-1.9460062980651855,
1.363914132118225,
1.1307032108306885,
2.3352067470550537,
0.5667558908462524,
0.43720120191574097,
-0.8007950782775879,
-0.6822500824928284,
0.36992162466049194,
-0.9255752563476562,
-0.7094649076461792,
0.22584721446037292,
2.3326661586761475,
1.7424317598342896,
-0.4395850896835327,
-0.15686698257923126,
-1.0900770425796509,
1.484572172164917,
-0.17629846930503845,
0.11123745143413544,
2.054550886154175,
-0.2981971502304077,
-1.0910619497299194,
1.377647876739502,
-2.369401216506958,
0.18037818372249603,
1.9605566263198853,
0.22577357292175293,
0.022670486941933632,
-1.3098973035812378,
-0.6902557611465454,
-0.3130887448787689,
-0.4119468927383423,
-1.1656159162521362,
0.5210393667221069,
-0.2477588653564453,
-0.7633907198905945,
-1.498883605003357,
0.22291013598442078,
-1.1310011148452759,
-1.727400541305542,
0.17763741314411163,
1.8033589124679565,
1.9894858598709106,
-0.7537357211112976,
1.4643276929855347,
-0.2561440169811249,
0.09637076407670975,
1.24562406539917,
1.188163161277771,
3.1203246116638184,
1.9433648586273193,
-1.3419489860534668,
0.6962014436721802,
-0.0471629798412323,
-0.4897752106189728,
1.136237621307373,
-1.247341513633728,
1.2746005058288574,
-0.15893130004405975,
-1.226493239402771,
-1.1740165948867798,
0.9498957991600037,
0.47504717111587524,
0.10995420813560486,
-0.4841655492782593,
1.1864585876464844,
0.1034407839179039,
1.384684443473816,
0.5772993564605713,
-0.2970468997955322,
0.6486294865608215,
-0.38462403416633606,
-0.5453538298606873,
1.538426160812378,
0.2577115595340729,
-1.3518478870391846,
-2.3161141872406006,
-0.339067280292511,
-0.8273571133613586,
-0.003465179819613695,
-0.6486368775367737,
-0.959428608417511,
1.6698006391525269,
0.41936010122299194,
-1.2392165660858154,
-0.2618151009082794,
-0.29939717054367065,
-0.5359253287315369,
2.7350575923919678,
-1.402402639389038,
-0.16999551653862,
-1.0286555290222168,
-0.6259011626243591,
1.6336244344711304,
-1.172206997871399,
-0.2608518600463867,
-1.1210814714431763,
-0.49881288409233093,
-1.2887870073318481,
-0.583288848400116,
-0.02492702007293701,
-0.8809313774108887,
0.8586844205856323,
0.17210811376571655,
-1.2059214115142822,
-0.35858482122421265,
-0.9278753399848938,
0.9148051738739014,
-0.15390706062316895,
0.1477983593940735,
1.7914061546325684,
0.4852679669857025,
-0.3958466351032257,
0.6445629000663757,
1.1369438171386719,
0.6473649144172668,
-0.6149848103523254,
0.2573467195034027,
-0.7357617020606995,
0.33762475848197937,
-1.259162187576294,
0.26470082998275757,
-2.8188610076904297,
0.5527194142341614,
-0.11059308052062988,
-0.07476077973842621,
-0.08556503802537918,
-1.3917348384857178,
1.0409566164016724,
2.577193021774292,
-1.1771880388259888,
0.4886140525341034,
0.2847507894039154,
1.169258713722229,
-1.5817570686340332,
0.3127106726169586,
-0.4614260196685791,
2.107457399368286,
0.16739684343338013,
1.1564674377441406,
-0.4527508020401001,
-2.306492805480957,
0.5706478953361511,
-1.2574563026428223,
-1.1416971683502197,
0.8178462982177734,
-0.832616925239563,
0.04127373546361923,
-1.3329521417617798,
-0.23430085182189941,
-0.7383190393447876,
-1.1976608037948608,
0.6577129364013672,
0.09837399423122406,
0.5605993270874023,
-0.6503640413284302,
0.3318541944026947,
-2.2205917835235596,
-1.324441909790039,
-0.26204511523246765,
-0.9258390069007874,
0.5243143439292908,
-0.27728137373924255,
0.7594316601753235,
-0.1965053379535675,
-0.01052724290639162,
0.373834490776062,
1.3908450603485107,
3.3761167526245117,
0.13625217974185944,
0.32422715425491333,
-0.21533365547657013,
-0.9070084095001221,
1.4050840139389038,
0.8851626515388489,
-0.10571098327636719,
-0.5649104118347168,
-1.1017776727676392,
1.1494609117507935,
1.9924992322921753,
1.0507888793945312,
-0.029191505163908005,
-0.8608297109603882,
-0.7989590167999268,
0.03343513607978821,
0.17672741413116455,
0.4613458216190338,
0.9004346132278442,
0.12199249863624573,
0.035887621343135834,
1.5388779640197754,
1.2199621200561523,
-0.3284708261489868,
0.4118100702762604,
-0.8346996307373047,
-0.5098580121994019,
0.5281307697296143,
0.3828592598438263,
-0.01870204135775566,
0.3506304621696472,
-1.0574328899383545,
-0.16176092624664307,
-0.4263598322868347,
-0.8613661527633667,
-0.7392637133598328,
-0.4666517674922943,
-0.3789425194263458,
1.7558883428573608,
0.08095735311508179,
-0.5398480892181396,
-0.041920050978660583,
-0.7022935748100281,
-0.08701924234628677,
-1.045837640762329,
0.4330283999443054,
-0.1665899157524109,
-0.03806065768003464,
-0.10768352448940277,
1.7697596549987793,
-0.9067776203155518,
-1.9805502891540527,
0.21394364535808563,
0.18578098714351654,
-0.34626832604408264,
0.2677898108959198,
1.6457277536392212,
0.5483631491661072,
1.4420300722122192,
1.3857979774475098,
0.9921138286590576,
-0.7278201580047607,
-1.340855598449707,
0.6657447814941406,
0.9391579031944275,
-1.444499135017395,
0.70961594581604,
0.03208545595407486,
-0.5160341262817383,
0.6189549565315247,
1.2260996103286743,
0.410420686006546,
-2.0996346473693848,
0.8285437226295471,
-0.9603534936904907,
0.7475734353065491,
0.7519866228103638,
0.7344408631324768,
0.12360543012619019,
0.7701377272605896,
-1.2724113464355469,
-1.1239407062530518,
-0.690106213092804,
-0.6982495188713074,
1.9250797033309937,
-0.3030422031879425,
0.6326635479927063,
-0.25409606099128723,
-1.4395737648010254,
-0.0212741456925869,
0.7242535352706909,
0.32319897413253784,
-0.5266008973121643,
0.7928118109703064,
-0.6174947619438171,
-1.1176575422286987,
-1.3540796041488647,
-0.4387381672859192,
-1.1726667881011963,
-0.8767088055610657,
1.066085934638977,
0.8175285458564758,
0.326310396194458,
1.8581852912902832,
0.6319596171379089,
0.2793281674385071,
-2.649576425552368,
0.8670215606689453,
0.2770872712135315,
-0.0956176370382309,
0.8356594443321228,
0.35224035382270813,
1.012391209602356,
-0.12122797220945358,
0.5968891978263855,
-2.4564852714538574,
2.3358099460601807,
-0.21835799515247345,
0.7310252785682678,
-0.011991194449365139,
-0.1785610020160675,
1.0481704473495483,
0.6218911409378052,
0.6218791007995605,
-1.0850551128387451,
0.6877350211143494,
-0.616141140460968,
1.213149905204773,
0.8186181783676147,
-0.7998408079147339,
-0.08807115256786346,
1.3298605680465698,
0.5117390751838684,
-0.4500972032546997,
-0.939384937286377,
-1.0363304615020752,
0.8809229731559753,
1.7770097255706787,
-0.1554858386516571,
0.039495743811130524,
0.8802576661109924,
0.701964259147644,
-1.3458656072616577,
0.09020762145519257,
-0.7938125133514404,
-0.7278404235839844,
1.640122890472412,
2.068073272705078,
-0.14286202192306519,
-0.16301167011260986,
-0.8066598176956177,
-1.2525240182876587,
0.7842026948928833,
0.07962726056575775,
0.056143879890441895,
0.5945762395858765,
-0.5896658301353455,
1.2069143056869507,
0.8734339475631714,
0.9189445376396179,
0.27209392189979553,
0.30418145656585693,
0.31435057520866394,
-0.3307025134563446,
-1.225525975227356,
-0.1912764459848404,
-0.9818391799926758,
-2.445460319519043,
0.5807726383209229,
-0.23595993220806122,
-1.5371267795562744,
-0.01796436868607998,
-0.994623064994812,
0.8814618587493896,
-0.5279132127761841,
-1.1165268421173096,
-1.491787075996399,
0.2718934416770935,
-0.1126556396484375,
0.9847911596298218,
-1.5335325002670288,
-0.07864058762788773,
1.266616940498352,
0.8870388865470886,
-0.6973714828491211,
0.9591511487960815,
0.24405229091644287,
1.0487910509109497,
0.9339814782142639,
-0.2980101704597473,
0.4916761517524719,
0.12456576526165009,
-1.355481505393982,
0.37272435426712036,
1.1528555154800415,
0.2098826766014099,
1.4667726755142212,
-0.6019505262374878,
0.06661571562290192,
0.3861953318119049,
-0.40481314063072205,
-0.4171994626522064,
-0.5550926923751831,
0.7124069929122925,
0.014743490144610405,
-0.9317585825920105,
0.018315136432647705,
-0.0074146282859146595,
-0.23457171022891998,
0.19265568256378174,
-1.4458591938018799,
-0.1659383624792099,
-0.3825538158416748,
-0.5872007012367249,
-1.212989091873169,
-0.05556783825159073,
1.3851550817489624,
-0.7434360384941101,
-0.14726394414901733,
0.5356881022453308,
0.31612613797187805,
0.5585981011390686,
0.654331624507904,
-0.6368694305419922,
-0.32402896881103516,
-0.21335943043231964,
-0.37569382786750793,
0.36789602041244507,
1.3859169483184814,
-0.07544932514429092,
-0.9464796185493469,
0.7434755563735962,
-0.36206892132759094,
0.04489641636610031,
2.009570598602295,
0.11487092077732086,
-0.8103458285331726,
0.3321619927883148,
-0.7087379693984985,
1.888357162475586,
1.8698681592941284,
1.3506674766540527,
-0.08712480962276459,
-1.0857181549072266,
0.5509860515594482,
-0.4120027422904968,
-0.33891066908836365,
0.951569139957428,
0.408206969499588,
-0.17907114326953888,
-1.3382333517074585,
0.7109845280647278,
1.2637351751327515,
-0.8773082494735718,
-0.8459503054618835,
0.1659523993730545,
-0.7928778529167175,
1.102331280708313,
0.7457336783409119,
0.4238356649875641,
0.24285957217216492,
1.5853203535079956,
0.7383121848106384,
-0.4475216567516327,
0.6118689775466919,
0.516802966594696,
-0.23627063632011414,
-2.014544725418091,
-1.1798652410507202,
0.35556256771087646,
-0.5864707827568054,
-1.6228859424591064,
1.430377721786499,
-1.2169183492660522,
-0.9954037666320801,
0.4869316816329956,
0.042028382420539856,
1.4438591003417969,
0.3651714026927948,
1.564088225364685,
2.088036298751831,
0.9412505626678467,
0.3929867148399353,
1.3841421604156494,
-0.20940956473350525,
-0.4033433794975281,
1.8011635541915894,
-0.4836318790912628,
0.5054563283920288,
1.116962194442749,
-0.3154726028442383,
-1.0392094850540161,
-0.8227652311325073,
-1.112013816833496,
-0.7485447525978088,
1.246619701385498,
0.04444284737110138,
-1.0676259994506836,
0.3740120232105255,
1.578129529953003,
-0.014778254553675652,
-0.34505563974380493,
0.6135607361793518,
0.3524452745914459,
-0.8168771862983704,
-0.12273021787405014,
-0.9382989406585693,
0.5437263250350952,
-0.2593662142753601,
-0.36448603868484497,
0.34711217880249023,
0.4595852196216583,
1.343526005744934,
-0.03218007832765579,
0.1393301784992218,
1.1871687173843384,
-1.4126468896865845,
1.4918156862258911,
-0.7092318534851074,
0.21369457244873047,
-2.2788288593292236,
1.3964382410049438,
-0.7603328227996826,
1.92890465259552,
-2.6948630809783936,
0.4558746814727783,
-0.5204597115516663,
-0.45578160881996155,
0.2568536698818207,
-0.32377877831459045,
0.1429394781589508,
-0.17142821848392487,
-1.175719976425171,
-0.0917975902557373,
-0.766603410243988,
0.5388370156288147,
1.0480034351348877,
1.4097697734832764,
-1.091786503791809,
-0.37575796246528625,
-1.6554388999938965,
-0.25244736671447754,
-0.7202206254005432,
0.3572707772254944,
-1.8788540363311768,
-0.1923486888408661,
-1.9290730953216553,
-2.524134635925293,
-1.3314647674560547,
-0.8421040773391724,
1.1337251663208008,
0.04887963831424713,
-0.8685084581375122,
1.1241694688796997,
-0.3817790448665619,
-1.902194619178772,
1.198725938796997,
-2.1862807273864746
] |
https://github.com/huggingface/datasets/issues/5150 | Problems after upgrading to 2.6.1 | im getting the same error.
- using the base AWS HF container that uses a datasets <2.
- updating the AWS HF container to use dataset 2.4
| ### Describe the bug
Loading a dataset_dict from disk with `load_from_disk` is now creating a `KeyError "length"` that was not occurring in v2.5.2.
Context:
- Each individual dataset in the dict is created with `Dataset.from_pandas`
- The dataset_dict is create from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- The pandas dataframe, besides text columns, has a column with a dictionary inside and potentially different keys in each row. Correctly the `Dataset.from_pandas` function adds `key: None` to all dictionaries in each row so that the schema can be correctly inferred.
### Steps to reproduce the bug
Steps to reproduce:
- Upgrade to datasets==2.6.1
- Create a dataset from pandas dataframe with `Dataset.from_pandas`
- Create a dataset_dict from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- Save to disk with the `save` function
### Expected behavior
Same as in v2.5.2, that is load from disk without errors
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.4.209-129.367.amzn2int.x86_64-x86_64-with-glibc2.26
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1 | 461 | 27 | Problems after upgrading to 2.6.1
### Describe the bug
Loading a dataset_dict from disk with `load_from_disk` is now creating a `KeyError "length"` that was not occurring in v2.5.2.
Context:
- Each individual dataset in the dict is created with `Dataset.from_pandas`
- The dataset_dict is create from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- The pandas dataframe, besides text columns, has a column with a dictionary inside and potentially different keys in each row. Correctly the `Dataset.from_pandas` function adds `key: None` to all dictionaries in each row so that the schema can be correctly inferred.
### Steps to reproduce the bug
Steps to reproduce:
- Upgrade to datasets==2.6.1
- Create a dataset from pandas dataframe with `Dataset.from_pandas`
- Create a dataset_dict from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- Save to disk with the `save` function
### Expected behavior
Same as in v2.5.2, that is load from disk without errors
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.4.209-129.367.amzn2int.x86_64-x86_64-with-glibc2.26
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
im getting the same error.
- using the base AWS HF container that uses a datasets <2.
- updating the AWS HF container to use dataset 2.4
| [
-1.106537938117981,
-0.8342005014419556,
-0.7238746881484985,
1.396823525428772,
-0.16953526437282562,
-1.286149501800537,
0.20455770194530487,
-1.1125913858413696,
1.7377748489379883,
-0.7969160079956055,
0.3013651967048645,
-1.6768022775650024,
0.021251384168863297,
-0.6008858680725098,
-0.7033525109291077,
-0.8616008758544922,
-0.4272497892379761,
-0.6792548894882202,
0.9500321745872498,
2.4699223041534424,
1.191322684288025,
-1.3438795804977417,
2.610166072845459,
0.7539926171302795,
-0.17589308321475983,
-0.9452226758003235,
0.4949529767036438,
0.081192247569561,
-1.450873851776123,
-0.3332669734954834,
-0.9320537447929382,
-0.08671452105045319,
-0.5475776195526123,
-0.5863161683082581,
-0.007311275228857994,
0.4074012339115143,
-0.3915106952190399,
-0.5146864652633667,
-0.5357636213302612,
-0.856681227684021,
0.35689854621887207,
-0.3276052176952362,
0.9709687232971191,
-0.40045425295829773,
1.8088761568069458,
-0.5422973036766052,
0.5098118782043457,
0.7875322103500366,
1.255181908607483,
0.1514495611190796,
-0.03719596192240715,
0.38217273354530334,
0.3939838409423828,
0.015679512172937393,
0.4657939076423645,
1.0921034812927246,
0.6478482484817505,
0.4535422623157501,
0.7590285539627075,
-2.224738836288452,
1.326372742652893,
-0.9802020788192749,
0.33050739765167236,
1.4066505432128906,
-0.9982153177261353,
0.3220970332622528,
-1.7481249570846558,
-0.1267363429069519,
0.5124276876449585,
-2.2607505321502686,
0.25763529539108276,
-1.380163550376892,
-0.5588553547859192,
1.0518280267715454,
0.42082691192626953,
-1.0590651035308838,
0.1234510987997055,
-0.3880329430103302,
0.8645952343940735,
0.455483078956604,
1.1868973970413208,
-1.6632412672042847,
-0.073670394718647,
-0.31357115507125854,
0.10424906760454178,
-1.277439832687378,
-1.558736801147461,
0.6141319274902344,
0.6753305792808533,
0.5467489957809448,
-0.1390998661518097,
0.9686176776885986,
-0.9823692440986633,
0.7356641292572021,
-0.9629188179969788,
-1.8182249069213867,
-1.378740668296814,
-2.3019018173217773,
-2.338592290878296,
0.75031578540802,
-0.45207375288009644,
-0.49619260430336,
2.1138384342193604,
-1.0303184986114502,
-1.6992676258087158,
1.0336583852767944,
0.2458801418542862,
-0.109391950070858,
2.3602821826934814,
0.2336648404598236,
-0.7077316045761108,
0.4347831904888153,
-0.7500432729721069,
0.6731112599372864,
-0.33992791175842285,
1.2874852418899536,
0.43732979893684387,
-1.1171518564224243,
1.5681084394454956,
-0.4119626581668854,
0.564629852771759,
-0.6520226001739502,
-0.4592685401439667,
-0.6473588347434998,
0.25069865584373474,
1.8259011507034302,
-0.25479549169540405,
1.500930666923523,
-0.31084033846855164,
-1.552947759628296,
-1.6011160612106323,
0.8181357979774475,
0.5192242860794067,
-0.6805678606033325,
0.0720587968826294,
-0.3427048921585083,
0.11538976430892944,
-0.046645939350128174,
1.177075982093811,
1.279920220375061,
0.7872680425643921,
-0.3733934462070465,
-0.892240047454834,
0.14185501635074615,
-0.029892684891819954,
-0.852421760559082,
-1.7410153150558472,
-0.27391517162323,
0.14152579009532928,
0.6163026094436646,
-1.2019901275634766,
1.8104480504989624,
0.8696032166481018,
1.9353240728378296,
0.9886351227760315,
-0.3884907364845276,
1.4692692756652832,
0.09926086664199829,
1.8747962713241577,
-0.45414823293685913,
0.6124155521392822,
-0.34387052059173584,
-1.124463677406311,
0.8470703363418579,
-0.24978408217430115,
-2.147698163986206,
-0.6236376762390137,
-0.8484132885932922,
-0.1241193488240242,
-0.7061582803726196,
1.010439395904541,
-0.12122292816638947,
-1.3333938121795654,
0.2272261381149292,
-0.7270249724388123,
0.10152911394834518,
-1.2349597215652466,
0.31003862619400024,
0.7505772709846497,
-0.6019766330718994,
0.11069900542497635,
-0.23682963848114014,
-1.348844051361084,
-0.42404434084892273,
0.3607645630836487,
1.7638921737670898,
-0.8024357557296753,
0.9627184867858887,
1.0415024757385254,
-0.7310531139373779,
0.0066850315779447556,
0.3448825478553772,
-0.38309231400489807,
0.8587002754211426,
-1.0125035047531128,
-0.3944210708141327,
1.1216555833816528,
-0.2375805824995041,
-0.5624963045120239,
1.5057084560394287,
0.6641364693641663,
-0.965178370475769,
-0.1649051308631897,
-0.16263927519321442,
-0.8147870302200317,
0.04335588961839676,
-1.6380946636199951,
-0.026177965104579926,
0.3700227439403534,
-1.5177984237670898,
-0.4905816614627838,
-0.1691598743200302,
1.335755705833435,
-0.10309196263551712,
1.3462498188018799,
-0.28708672523498535,
-0.21844497323036194,
-0.4946540594100952,
-0.32750004529953003,
0.0908842459321022,
-0.15523363649845123,
-0.5584943890571594,
0.2706150710582733,
-0.75480055809021,
0.3086634874343872,
1.404415488243103,
0.32627272605895996,
0.0661415085196495,
0.5657631754875183,
1.118065357208252,
0.36630871891975403,
-0.1261553168296814,
-0.7825363278388977,
-1.5842782258987427,
2.0226387977600098,
-1.3971199989318848,
1.9639112949371338,
0.699106752872467,
0.017860928550362587,
-1.9135769605636597,
-1.9560620784759521,
1.3842089176177979,
1.1038546562194824,
2.347716808319092,
0.5530992150306702,
0.4511474370956421,
-0.7946226000785828,
-0.6687744855880737,
0.37165921926498413,
-0.878973662853241,
-0.7126293182373047,
0.22244472801685333,
2.3326733112335205,
1.7034412622451782,
-0.4176488518714905,
-0.1400289088487625,
-1.1258623600006104,
1.4923274517059326,
-0.17406895756721497,
0.12318173050880432,
2.035322666168213,
-0.2918239235877991,
-1.0895835161209106,
1.3851271867752075,
-2.347682476043701,
0.21529589593410492,
1.9675054550170898,
0.20774748921394348,
0.008896112442016602,
-1.2796622514724731,
-0.6992577314376831,
-0.3464455306529999,
-0.42471179366111755,
-1.1148172616958618,
0.5021060705184937,
-0.2463819980621338,
-0.7755981683731079,
-1.492712378501892,
0.20237699151039124,
-1.1096975803375244,
-1.7405775785446167,
0.1776576191186905,
1.7985918521881104,
1.954437017440796,
-0.727781355381012,
1.4484180212020874,
-0.27252477407455444,
0.08733625710010529,
1.2559070587158203,
1.2152340412139893,
3.134923219680786,
1.9491444826126099,
-1.339823842048645,
0.7084615230560303,
-0.0014514103531837463,
-0.4740488529205322,
1.1432111263275146,
-1.2526099681854248,
1.3109898567199707,
-0.15295572578907013,
-1.211095929145813,
-1.1797986030578613,
0.9174060225486755,
0.4799194633960724,
0.11485699564218521,
-0.4714779257774353,
1.1641201972961426,
0.11078812927007675,
1.392897367477417,
0.5872014164924622,
-0.3089194893836975,
0.6461978554725647,
-0.36039257049560547,
-0.5344846248626709,
1.5292030572891235,
0.252794086933136,
-1.3649975061416626,
-2.3483383655548096,
-0.32365530729293823,
-0.8383650183677673,
-0.04259929805994034,
-0.6706782579421997,
-0.9695403575897217,
1.65634286403656,
0.4542888104915619,
-1.1988991498947144,
-0.23469381034374237,
-0.32191041111946106,
-0.5460675358772278,
2.7351551055908203,
-1.391625165939331,
-0.1424691379070282,
-1.0588788986206055,
-0.6547701954841614,
1.6349157094955444,
-1.160705804824829,
-0.2697504162788391,
-1.1272584199905396,
-0.5194657444953918,
-1.30714750289917,
-0.5884537696838379,
-0.016941267997026443,
-0.909651517868042,
0.8348631262779236,
0.13258664309978485,
-1.2383097410202026,
-0.3579595685005188,
-0.9498814344406128,
0.918716549873352,
-0.16210930049419403,
0.13389341533184052,
1.7894563674926758,
0.480609267950058,
-0.40322020649909973,
0.6171738505363464,
1.1754943132400513,
0.6599618196487427,
-0.6278091073036194,
0.28907662630081177,
-0.74150550365448,
0.33786773681640625,
-1.2556333541870117,
0.260905385017395,
-2.8109145164489746,
0.5615442395210266,
-0.11156042665243149,
-0.07143393158912659,
-0.08337870240211487,
-1.3993984460830688,
1.040763020515442,
2.5627689361572266,
-1.219700574874878,
0.5140215754508972,
0.29260021448135376,
1.1441842317581177,
-1.5796993970870972,
0.2833081781864166,
-0.46300214529037476,
2.094619035720825,
0.157962366938591,
1.1627545356750488,
-0.43800967931747437,
-2.252368688583374,
0.5962322950363159,
-1.232757806777954,
-1.1683086156845093,
0.803524374961853,
-0.8407527208328247,
0.0727529227733612,
-1.3174664974212646,
-0.21216484904289246,
-0.7461790442466736,
-1.2054399251937866,
0.6194679737091064,
0.10599216818809509,
0.5657703876495361,
-0.6386858820915222,
0.3399554491043091,
-2.2555689811706543,
-1.3201591968536377,
-0.25678178668022156,
-0.9687010645866394,
0.5432195067405701,
-0.2612532079219818,
0.7641598582267761,
-0.19138959050178528,
-0.022564278915524483,
0.368726521730423,
1.411726713180542,
3.3648815155029297,
0.11102963984012604,
0.2856188714504242,
-0.19399620592594147,
-0.9394765496253967,
1.4163092374801636,
0.9046160578727722,
-0.11883208900690079,
-0.5407100915908813,
-1.0880684852600098,
1.1312894821166992,
2.003983497619629,
1.0728508234024048,
-0.05113201588392258,
-0.868031919002533,
-0.8173197507858276,
0.057913005352020264,
0.1736297607421875,
0.43474024534225464,
0.9035053849220276,
0.14697720110416412,
0.045363835990428925,
1.5276676416397095,
1.1960588693618774,
-0.3254355490207672,
0.4100879430770874,
-0.8607643842697144,
-0.506106436252594,
0.5183364748954773,
0.3932216167449951,
0.00011889729648828506,
0.35587307810783386,
-1.0826717615127563,
-0.15948984026908875,
-0.4088660180568695,
-0.850702166557312,
-0.7374417781829834,
-0.47755539417266846,
-0.4065893292427063,
1.7411555051803589,
0.06233055889606476,
-0.5219209790229797,
-0.07607472687959671,
-0.6937211155891418,
-0.0653461292386055,
-1.0228629112243652,
0.4622434377670288,
-0.1555829793214798,
-0.025406401604413986,
-0.12142780423164368,
1.735933780670166,
-0.9250489473342896,
-1.9925086498260498,
0.2048111855983734,
0.1875697374343872,
-0.3713321089744568,
0.24392260611057281,
1.6381394863128662,
0.5811943411827087,
1.4402350187301636,
1.3710626363754272,
0.978948712348938,
-0.7216506600379944,
-1.350391149520874,
0.6696662306785583,
0.931988537311554,
-1.4115688800811768,
0.6955205202102661,
0.05750279128551483,
-0.5305712819099426,
0.5980525016784668,
1.2508589029312134,
0.4443996250629425,
-2.081061601638794,
0.8284324407577515,
-0.9434959888458252,
0.7421017289161682,
0.7433661818504333,
0.7549280524253845,
0.09617069363594055,
0.7580346465110779,
-1.283581256866455,
-1.0939170122146606,
-0.6815757751464844,
-0.7077412009239197,
1.9136936664581299,
-0.31223535537719727,
0.5969162583351135,
-0.29632169008255005,
-1.3971662521362305,
-0.036809951066970825,
0.7129908204078674,
0.33143582940101624,
-0.5193036794662476,
0.7944905161857605,
-0.6008189916610718,
-1.1253855228424072,
-1.3367536067962646,
-0.4313185513019562,
-1.1483573913574219,
-0.8566750884056091,
1.0429086685180664,
0.8056302666664124,
0.3359483480453491,
1.8651279211044312,
0.6105557680130005,
0.29757171869277954,
-2.6501102447509766,
0.8989989161491394,
0.2928216755390167,
-0.10166315734386444,
0.8390307426452637,
0.340285986661911,
1.0363584756851196,
-0.1579715758562088,
0.6072083711624146,
-2.435504198074341,
2.3062572479248047,
-0.1869669109582901,
0.7191347479820251,
-0.0025221742689609528,
-0.14334635436534882,
1.0444587469100952,
0.6176825165748596,
0.6185339093208313,
-1.1064919233322144,
0.7436296939849854,
-0.6429856419563293,
1.2014610767364502,
0.8051238656044006,
-0.8035120964050293,
-0.09557773917913437,
1.350981593132019,
0.5409274101257324,
-0.45145535469055176,
-0.9506567716598511,
-1.0407447814941406,
0.9109514951705933,
1.7640674114227295,
-0.14895780384540558,
0.057555101811885834,
0.8730566501617432,
0.6896675229072571,
-1.3655749559402466,
0.07226365804672241,
-0.7697403430938721,
-0.7042476534843445,
1.6484795808792114,
2.0559868812561035,
-0.12197139114141464,
-0.19130362570285797,
-0.8107585310935974,
-1.2420146465301514,
0.7639763951301575,
0.0742601752281189,
0.057046785950660706,
0.6081438660621643,
-0.5907214283943176,
1.1976054906845093,
0.8896172642707825,
0.9192374348640442,
0.25468388199806213,
0.2717066705226898,
0.26502150297164917,
-0.3126024603843689,
-1.2474756240844727,
-0.2036326378583908,
-0.9376066327095032,
-2.426178216934204,
0.587597668170929,
-0.2287440448999405,
-1.5490821599960327,
0.012937717139720917,
-1.0295443534851074,
0.8853643536567688,
-0.537958025932312,
-1.1207036972045898,
-1.5155513286590576,
0.2566116452217102,
-0.0915706679224968,
0.9582364559173584,
-1.5241920948028564,
-0.10820251703262329,
1.2897462844848633,
0.9009413719177246,
-0.6939871907234192,
0.9848212003707886,
0.2415945678949356,
1.0394377708435059,
0.9170578718185425,
-0.31353428959846497,
0.5068605542182922,
0.14728030562400818,
-1.3483161926269531,
0.40844348073005676,
1.1761118173599243,
0.23177458345890045,
1.4699205160140991,
-0.6087891459465027,
0.0802881270647049,
0.40744733810424805,
-0.3767162263393402,
-0.46104100346565247,
-0.5657736659049988,
0.7082086205482483,
0.015142474323511124,
-0.9293878674507141,
0.02206563390791416,
-0.011837795376777649,
-0.19491782784461975,
0.1847819834947586,
-1.4475048780441284,
-0.16781695187091827,
-0.35338181257247925,
-0.6212145090103149,
-1.178859829902649,
-0.06997926533222198,
1.386020302772522,
-0.7814232707023621,
-0.13363422453403473,
0.5426765084266663,
0.3138643503189087,
0.5647361874580383,
0.6743643879890442,
-0.6183124780654907,
-0.29938504099845886,
-0.21866363286972046,
-0.363420695066452,
0.32743144035339355,
1.38368558883667,
-0.07552722096443176,
-0.9645911455154419,
0.7433362007141113,
-0.36895042657852173,
0.06107528507709503,
1.9980511665344238,
0.11720868945121765,
-0.8283900022506714,
0.33292123675346375,
-0.7001879215240479,
1.898977279663086,
1.8549269437789917,
1.368367075920105,
-0.07619211822748184,
-1.1005085706710815,
0.5136298537254333,
-0.4053015112876892,
-0.3320867121219635,
0.9752694368362427,
0.4007855951786041,
-0.20395885407924652,
-1.3023356199264526,
0.7074721455574036,
1.266159176826477,
-0.8977274894714355,
-0.8371471166610718,
0.20262619853019714,
-0.8107078671455383,
1.087491512298584,
0.7506149411201477,
0.3817373514175415,
0.2706564962863922,
1.5618979930877686,
0.7220143675804138,
-0.4487963914871216,
0.6115692257881165,
0.5140056610107422,
-0.25130826234817505,
-1.9747323989868164,
-1.1631587743759155,
0.38079601526260376,
-0.5903897285461426,
-1.6402816772460938,
1.431874394416809,
-1.210179328918457,
-0.9838075041770935,
0.493283212184906,
0.06884746998548508,
1.4361788034439087,
0.3671582341194153,
1.5920745134353638,
2.080157995223999,
0.9533525109291077,
0.39131730794906616,
1.360790729522705,
-0.1954895555973053,
-0.39629119634628296,
1.7727711200714111,
-0.4906548261642456,
0.5243364572525024,
1.1182786226272583,
-0.3279038369655609,
-1.07001793384552,
-0.832216739654541,
-1.1600605249404907,
-0.7716352939605713,
1.222609519958496,
0.08419138938188553,
-1.0899673700332642,
0.3449617326259613,
1.5702508687973022,
0.01687818393111229,
-0.2971786856651306,
0.6349206566810608,
0.3204251527786255,
-0.8217224478721619,
-0.12543876469135284,
-0.978767991065979,
0.5556941628456116,
-0.2625214159488678,
-0.3636990189552307,
0.3176532983779907,
0.46640992164611816,
1.342359185218811,
-0.0095068933442235,
0.1416630893945694,
1.204888105392456,
-1.4090702533721924,
1.5041568279266357,
-0.7484546303749084,
0.23987138271331787,
-2.2567739486694336,
1.4007937908172607,
-0.760338306427002,
1.8980822563171387,
-2.7067372798919678,
0.4507068395614624,
-0.5129640698432922,
-0.43193158507347107,
0.23575277626514435,
-0.3311783969402313,
0.1549590528011322,
-0.15129594504833221,
-1.2101048231124878,
-0.10430295020341873,
-0.7741267085075378,
0.536170244216919,
1.0711790323257446,
1.4027223587036133,
-1.1010379791259766,
-0.40088027715682983,
-1.6609824895858765,
-0.2745838165283203,
-0.6984997987747192,
0.3836764991283417,
-1.8526394367218018,
-0.18629240989685059,
-1.9064565896987915,
-2.56599497795105,
-1.2786376476287842,
-0.839218258857727,
1.1280717849731445,
0.008209198713302612,
-0.8777031898498535,
1.1099145412445068,
-0.3917769193649292,
-1.901544213294983,
1.188691258430481,
-2.219712495803833
] |
https://github.com/huggingface/datasets/issues/5150 | Problems after upgrading to 2.6.1 | Same here, running on our SageMaker pipelines. It's only happening for some but not all of our saved Datasets. | ### Describe the bug
Loading a dataset_dict from disk with `load_from_disk` is now creating a `KeyError "length"` that was not occurring in v2.5.2.
Context:
- Each individual dataset in the dict is created with `Dataset.from_pandas`
- The dataset_dict is create from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- The pandas dataframe, besides text columns, has a column with a dictionary inside and potentially different keys in each row. Correctly the `Dataset.from_pandas` function adds `key: None` to all dictionaries in each row so that the schema can be correctly inferred.
### Steps to reproduce the bug
Steps to reproduce:
- Upgrade to datasets==2.6.1
- Create a dataset from pandas dataframe with `Dataset.from_pandas`
- Create a dataset_dict from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- Save to disk with the `save` function
### Expected behavior
Same as in v2.5.2, that is load from disk without errors
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.4.209-129.367.amzn2int.x86_64-x86_64-with-glibc2.26
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1 | 461 | 19 | Problems after upgrading to 2.6.1
### Describe the bug
Loading a dataset_dict from disk with `load_from_disk` is now creating a `KeyError "length"` that was not occurring in v2.5.2.
Context:
- Each individual dataset in the dict is created with `Dataset.from_pandas`
- The dataset_dict is create from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- The pandas dataframe, besides text columns, has a column with a dictionary inside and potentially different keys in each row. Correctly the `Dataset.from_pandas` function adds `key: None` to all dictionaries in each row so that the schema can be correctly inferred.
### Steps to reproduce the bug
Steps to reproduce:
- Upgrade to datasets==2.6.1
- Create a dataset from pandas dataframe with `Dataset.from_pandas`
- Create a dataset_dict from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- Save to disk with the `save` function
### Expected behavior
Same as in v2.5.2, that is load from disk without errors
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.4.209-129.367.amzn2int.x86_64-x86_64-with-glibc2.26
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
Same here, running on our SageMaker pipelines. It's only happening for some but not all of our saved Datasets. | [
-1.0873130559921265,
-0.8474299907684326,
-0.7299777865409851,
1.4035288095474243,
-0.1605900675058365,
-1.2793278694152832,
0.22228656709194183,
-1.1089138984680176,
1.7225666046142578,
-0.8066931366920471,
0.3086928129196167,
-1.681130290031433,
0.01852182298898697,
-0.6039829254150391,
-0.708506166934967,
-0.858760416507721,
-0.44382619857788086,
-0.6711508631706238,
0.9519355893135071,
2.446775436401367,
1.1840993165969849,
-1.3465198278427124,
2.6067147254943848,
0.7433988451957703,
-0.17340882122516632,
-0.9385536909103394,
0.519980788230896,
0.08152066171169281,
-1.4260284900665283,
-0.32398781180381775,
-0.9281591773033142,
-0.11657030135393143,
-0.5189410448074341,
-0.5644807815551758,
-0.02429368533194065,
0.43454283475875854,
-0.39060333371162415,
-0.5214097499847412,
-0.5233022570610046,
-0.8639293909072876,
0.35847726464271545,
-0.34034401178359985,
0.985120952129364,
-0.3784860372543335,
1.8113465309143066,
-0.5456568002700806,
0.48969385027885437,
0.7848361730575562,
1.250004768371582,
0.16200128197669983,
-0.055203262716531754,
0.37132394313812256,
0.3813323974609375,
0.002639593556523323,
0.4774460792541504,
1.0792957544326782,
0.6259618997573853,
0.45623940229415894,
0.7765682935714722,
-2.2259562015533447,
1.3276177644729614,
-0.9922271966934204,
0.3174203336238861,
1.4030320644378662,
-0.961805522441864,
0.3420153260231018,
-1.7383006811141968,
-0.12098347395658493,
0.5181301236152649,
-2.256955862045288,
0.26315128803253174,
-1.3513362407684326,
-0.549444317817688,
1.044386386871338,
0.4366205930709839,
-1.0566580295562744,
0.10041755437850952,
-0.38032615184783936,
0.8660065531730652,
0.44842737913131714,
1.1450570821762085,
-1.6623456478118896,
-0.0684574693441391,
-0.327397882938385,
0.09936684370040894,
-1.2936521768569946,
-1.5507827997207642,
0.6076213717460632,
0.6786618828773499,
0.5453318953514099,
-0.12228670716285706,
0.9706376791000366,
-0.9777972102165222,
0.7205233573913574,
-1.00290846824646,
-1.8004077672958374,
-1.3890438079833984,
-2.2938411235809326,
-2.3607945442199707,
0.7464980483055115,
-0.45398515462875366,
-0.50795978307724,
2.090547561645508,
-0.9963493347167969,
-1.6957870721817017,
1.0549176931381226,
0.2374560385942459,
-0.10584063082933426,
2.376879930496216,
0.22956582903862,
-0.6870107054710388,
0.44881996512413025,
-0.76619952917099,
0.6731218099594116,
-0.3440402150154114,
1.2984620332717896,
0.43729260563850403,
-1.101102590560913,
1.5862507820129395,
-0.3931925892829895,
0.5534761548042297,
-0.6602835655212402,
-0.4709782600402832,
-0.6501792669296265,
0.27805545926094055,
1.8056471347808838,
-0.2400350719690323,
1.471114158630371,
-0.3265950679779053,
-1.5603501796722412,
-1.5943753719329834,
0.81651771068573,
0.5167412757873535,
-0.6903200149536133,
0.07571618258953094,
-0.3505113422870636,
0.10940468311309814,
-0.03337785229086876,
1.1889013051986694,
1.282026767730713,
0.7868059873580933,
-0.3962065875530243,
-0.8840397596359253,
0.15986084938049316,
-0.02809896692633629,
-0.8510610461235046,
-1.7360719442367554,
-0.29167506098747253,
0.14365001022815704,
0.598362922668457,
-1.207175850868225,
1.7992914915084839,
0.8767869472503662,
1.9550389051437378,
0.9923503994941711,
-0.4135059416294098,
1.470282793045044,
0.08872483670711517,
1.87913978099823,
-0.47514060139656067,
0.6041744947433472,
-0.34928205609321594,
-1.148555040359497,
0.8588919043540955,
-0.2523018419742584,
-2.1272387504577637,
-0.657862663269043,
-0.8573625087738037,
-0.14763221144676208,
-0.7016162276268005,
1.0052289962768555,
-0.14920146763324738,
-1.3434799909591675,
0.21164922416210175,
-0.7492913603782654,
0.10479636490345001,
-1.2499217987060547,
0.2978537678718567,
0.7449041604995728,
-0.6123663783073425,
0.12530699372291565,
-0.22907333076000214,
-1.3296899795532227,
-0.4168958365917206,
0.3642180263996124,
1.7769969701766968,
-0.7900144457817078,
0.9366171360015869,
1.035025954246521,
-0.7306543588638306,
0.004389776848256588,
0.33419084548950195,
-0.368963360786438,
0.851387083530426,
-1.037067174911499,
-0.4356398284435272,
1.13255774974823,
-0.23335421085357666,
-0.5726811289787292,
1.5070406198501587,
0.6680805683135986,
-0.9712432026863098,
-0.15970635414123535,
-0.1656961590051651,
-0.8256230354309082,
0.06443893164396286,
-1.6293344497680664,
-0.021116191521286964,
0.37909626960754395,
-1.5283068418502808,
-0.4526708722114563,
-0.1782582849264145,
1.3300331830978394,
-0.11359888315200806,
1.3556551933288574,
-0.29144540429115295,
-0.20723117887973785,
-0.48630258440971375,
-0.3133973181247711,
0.07894016802310944,
-0.18609529733657837,
-0.5668027997016907,
0.2676772177219391,
-0.7479246854782104,
0.318196564912796,
1.4336909055709839,
0.31705597043037415,
0.08979389071464539,
0.5627453923225403,
1.1054037809371948,
0.38159966468811035,
-0.0916757881641388,
-0.8087506294250488,
-1.5775516033172607,
2.0146896839141846,
-1.4198676347732544,
1.9433372020721436,
0.7036466598510742,
0.01831083744764328,
-1.9076067209243774,
-1.9421778917312622,
1.365641474723816,
1.110787034034729,
2.345349073410034,
0.5538765788078308,
0.43316441774368286,
-0.7994388937950134,
-0.6807010173797607,
0.3549841344356537,
-0.9164687395095825,
-0.70485520362854,
0.2534416913986206,
2.35302472114563,
1.7021552324295044,
-0.4068630337715149,
-0.15588060021400452,
-1.1123968362808228,
1.5118788480758667,
-0.16798248887062073,
0.11997508257627487,
2.0500869750976562,
-0.267171710729599,
-1.1057310104370117,
1.369024395942688,
-2.361422300338745,
0.21097202599048615,
1.9483733177185059,
0.23007364571094513,
0.029593639075756073,
-1.2927132844924927,
-0.7076985239982605,
-0.3475556969642639,
-0.4101426601409912,
-1.125813364982605,
0.5222959518432617,
-0.23536665737628937,
-0.7850675582885742,
-1.4853129386901855,
0.20922790467739105,
-1.107385277748108,
-1.737151861190796,
0.17834502458572388,
1.7853803634643555,
1.9914125204086304,
-0.7488640546798706,
1.4660507440567017,
-0.2573162615299225,
0.09561436623334885,
1.2597640752792358,
1.2030669450759888,
3.096161127090454,
1.9303820133209229,
-1.3310256004333496,
0.71867835521698,
0.000055441632866859436,
-0.4822552502155304,
1.1486659049987793,
-1.2632513046264648,
1.3050323724746704,
-0.16196027398109436,
-1.1981278657913208,
-1.1744717359542847,
0.9236628413200378,
0.48161011934280396,
0.10280729085206985,
-0.47479021549224854,
1.1845531463623047,
0.11994212120771408,
1.384143590927124,
0.5828331708908081,
-0.3084523677825928,
0.656875491142273,
-0.37485426664352417,
-0.5183137655258179,
1.5316694974899292,
0.2638750374317169,
-1.3804248571395874,
-2.328007698059082,
-0.3274889886379242,
-0.835899293422699,
-0.02373836189508438,
-0.6450619697570801,
-0.990791380405426,
1.6732559204101562,
0.4206240177154541,
-1.2030315399169922,
-0.23106858134269714,
-0.2956683337688446,
-0.5367399454116821,
2.7743613719940186,
-1.3862415552139282,
-0.15482071042060852,
-1.0467592477798462,
-0.628328263759613,
1.6394859552383423,
-1.1633516550064087,
-0.26461654901504517,
-1.1392009258270264,
-0.5162990689277649,
-1.2880538702011108,
-0.5952169895172119,
-0.011018531396985054,
-0.9053999185562134,
0.8491911292076111,
0.14385761320590973,
-1.2378391027450562,
-0.3607538342475891,
-0.9456753134727478,
0.939300000667572,
-0.16934198141098022,
0.14992991089820862,
1.7864435911178589,
0.4794020354747772,
-0.3901316821575165,
0.6361927390098572,
1.1749290227890015,
0.6601276397705078,
-0.6181955933570862,
0.2749585509300232,
-0.7291925549507141,
0.3251826763153076,
-1.2566797733306885,
0.2906273901462555,
-2.8192172050476074,
0.5426425933837891,
-0.1052217185497284,
-0.06871283054351807,
-0.09980076551437378,
-1.404493808746338,
1.0786070823669434,
2.551604986190796,
-1.2128623723983765,
0.5047054886817932,
0.30430957674980164,
1.1262352466583252,
-1.5761785507202148,
0.3190707862377167,
-0.4529286324977875,
2.108017683029175,
0.17146801948547363,
1.1576231718063354,
-0.46097633242607117,
-2.287508010864258,
0.6231936812400818,
-1.2501802444458008,
-1.1608452796936035,
0.8076604604721069,
-0.8503850698471069,
0.05728566274046898,
-1.3171637058258057,
-0.24321386218070984,
-0.7547430396080017,
-1.2258374691009521,
0.635876476764679,
0.10109014064073563,
0.5459015369415283,
-0.6144869327545166,
0.35228973627090454,
-2.248030424118042,
-1.3512133359909058,
-0.26751941442489624,
-0.9543050527572632,
0.5191289782524109,
-0.26847174763679504,
0.7849369645118713,
-0.18392130732536316,
-0.02440766803920269,
0.3730827569961548,
1.4177162647247314,
3.3608193397521973,
0.11818880587816238,
0.2824201285839081,
-0.20128922164440155,
-0.9314593076705933,
1.3880271911621094,
0.9208267331123352,
-0.11851198971271515,
-0.5204696655273438,
-1.070519208908081,
1.1348942518234253,
2.022005081176758,
1.0671658515930176,
-0.07033151388168335,
-0.8624665141105652,
-0.8242033123970032,
0.05744002386927605,
0.18687692284584045,
0.4479653239250183,
0.8806358575820923,
0.14053021371364594,
0.03474762290716171,
1.5209239721298218,
1.1973098516464233,
-0.3452218770980835,
0.39131614565849304,
-0.8611079454421997,
-0.5045519471168518,
0.5285906791687012,
0.3795095384120941,
-0.01889730617403984,
0.33916527032852173,
-1.0705846548080444,
-0.16284342110157013,
-0.40080714225769043,
-0.8486207127571106,
-0.7464489340782166,
-0.4603452980518341,
-0.41370081901550293,
1.7370355129241943,
0.07426658272743225,
-0.5203759074211121,
-0.04555311053991318,
-0.7034799456596375,
-0.08545023202896118,
-1.0587525367736816,
0.4365823566913605,
-0.16696469485759735,
-0.03933560848236084,
-0.1139315590262413,
1.7814079523086548,
-0.9261175394058228,
-1.9878664016723633,
0.18434974551200867,
0.20749300718307495,
-0.36625322699546814,
0.2500022053718567,
1.6364781856536865,
0.5635323524475098,
1.440462589263916,
1.365777850151062,
0.9794265031814575,
-0.7008015513420105,
-1.3483060598373413,
0.6477094292640686,
0.9544282555580139,
-1.4258410930633545,
0.6999033689498901,
0.0516616590321064,
-0.4924297630786896,
0.6026727557182312,
1.2487175464630127,
0.4316670894622803,
-2.0870361328125,
0.8228967785835266,
-0.9407359957695007,
0.760585606098175,
0.7507160305976868,
0.7709371447563171,
0.10699985176324844,
0.747715175151825,
-1.2889615297317505,
-1.1089954376220703,
-0.7015237212181091,
-0.7011213302612305,
1.9211335182189941,
-0.31750765442848206,
0.5976976156234741,
-0.260240375995636,
-1.4016473293304443,
-0.020687656477093697,
0.7104737162590027,
0.3326188027858734,
-0.5446345806121826,
0.8045724630355835,
-0.6049045324325562,
-1.1248451471328735,
-1.347934365272522,
-0.44768616557121277,
-1.1467243432998657,
-0.8862317800521851,
1.0572376251220703,
0.8093158006668091,
0.34053680300712585,
1.8542917966842651,
0.6247307658195496,
0.28766772150993347,
-2.641587257385254,
0.885735809803009,
0.28476518392562866,
-0.07409969717264175,
0.8162487745285034,
0.3525606393814087,
1.0392231941223145,
-0.14868731796741486,
0.6173679828643799,
-2.4522578716278076,
2.3192760944366455,
-0.18725138902664185,
0.7216463685035706,
-0.008377324789762497,
-0.15048623085021973,
1.03482186794281,
0.6295833587646484,
0.6049379110336304,
-1.104513168334961,
0.7227361798286438,
-0.6302193403244019,
1.2061036825180054,
0.7831125855445862,
-0.8174326419830322,
-0.08610815554857254,
1.3436603546142578,
0.5488819479942322,
-0.4483146667480469,
-0.9476733207702637,
-1.0435144901275635,
0.9108226895332336,
1.7569481134414673,
-0.14995189011096954,
0.02212393656373024,
0.9007903337478638,
0.6708990931510925,
-1.3395357131958008,
0.05845075473189354,
-0.7730900049209595,
-0.7121711373329163,
1.6432856321334839,
2.086700201034546,
-0.15056021511554718,
-0.18295986950397491,
-0.800285279750824,
-1.2057772874832153,
0.7772109508514404,
0.06500639021396637,
0.06353525072336197,
0.5919524431228638,
-0.5794677138328552,
1.2046018838882446,
0.8720353841781616,
0.9065489768981934,
0.2799740433692932,
0.30177098512649536,
0.27490854263305664,
-0.3139829933643341,
-1.2393817901611328,
-0.21549589931964874,
-0.9582396149635315,
-2.461353302001953,
0.5843595862388611,
-0.24177472293376923,
-1.5391321182250977,
0.009034124203026295,
-1.0157054662704468,
0.8771815299987793,
-0.5381463766098022,
-1.115534782409668,
-1.4812092781066895,
0.2539551258087158,
-0.08088510483503342,
0.9784322381019592,
-1.5149937868118286,
-0.10377077013254166,
1.2880951166152954,
0.8795598149299622,
-0.704923689365387,
0.972453773021698,
0.24766723811626434,
1.05622398853302,
0.9167317152023315,
-0.2889574468135834,
0.5162673592567444,
0.13960906863212585,
-1.3265517950057983,
0.3899059593677521,
1.1660829782485962,
0.19801482558250427,
1.4792760610580444,
-0.6084652543067932,
0.06549914181232452,
0.3878966271877289,
-0.4071214497089386,
-0.45202481746673584,
-0.562114953994751,
0.6894419193267822,
0.024003271013498306,
-0.9258665442466736,
0.027566581964492798,
-0.006330461241304874,
-0.19826892018318176,
0.19228729605674744,
-1.444650650024414,
-0.18881520628929138,
-0.34704506397247314,
-0.6293483972549438,
-1.196121096611023,
-0.06728322058916092,
1.3771568536758423,
-0.7720755934715271,
-0.11392249166965485,
0.5390899777412415,
0.3096061646938324,
0.5601966977119446,
0.6845025420188904,
-0.6329797506332397,
-0.3132045865058899,
-0.2038879543542862,
-0.3606922924518585,
0.3571019172668457,
1.376524567604065,
-0.052293531596660614,
-0.9697553515434265,
0.7551651000976562,
-0.3610791265964508,
0.04011978954076767,
1.9935544729232788,
0.12085578590631485,
-0.8507532477378845,
0.3181849718093872,
-0.7010133862495422,
1.8999007940292358,
1.8362374305725098,
1.3533308506011963,
-0.0966654121875763,
-1.0898962020874023,
0.5424153804779053,
-0.40262311697006226,
-0.33381402492523193,
0.9616406559944153,
0.39721351861953735,
-0.2056073546409607,
-1.3212271928787231,
0.7319527268409729,
1.27035653591156,
-0.8985018730163574,
-0.8568659424781799,
0.20564983785152435,
-0.8161051869392395,
1.0918174982070923,
0.7393083572387695,
0.4089549481868744,
0.2557797133922577,
1.570189356803894,
0.7419835925102234,
-0.43598809838294983,
0.6163308024406433,
0.5200238227844238,
-0.23994697630405426,
-1.9890447854995728,
-1.1643669605255127,
0.379902184009552,
-0.6064429879188538,
-1.627949595451355,
1.429166316986084,
-1.205609917640686,
-0.9989175200462341,
0.5007103085517883,
0.05433094874024391,
1.439911961555481,
0.35834845900535583,
1.5876497030258179,
2.065361738204956,
0.9496220946311951,
0.3766959607601166,
1.37519371509552,
-0.20319581031799316,
-0.40127959847450256,
1.774664044380188,
-0.4912746548652649,
0.5376265645027161,
1.13057541847229,
-0.3164035975933075,
-1.0612131357192993,
-0.8201273083686829,
-1.1478623151779175,
-0.7450329661369324,
1.2244070768356323,
0.07631393522024155,
-1.098034381866455,
0.3621242046356201,
1.5800883769989014,
0.009782944805920124,
-0.3063662052154541,
0.633156418800354,
0.32074201107025146,
-0.8555682897567749,
-0.12881307303905487,
-0.989457368850708,
0.5390922427177429,
-0.2485891729593277,
-0.3530932366847992,
0.31748324632644653,
0.45908311009407043,
1.3434001207351685,
-0.03393550589680672,
0.1535571664571762,
1.1618404388427734,
-1.4283266067504883,
1.4975675344467163,
-0.7467085719108582,
0.23361967504024506,
-2.271592855453491,
1.365829348564148,
-0.7561657428741455,
1.8969212770462036,
-2.712557792663574,
0.4569862484931946,
-0.5048278570175171,
-0.45188748836517334,
0.24960388243198395,
-0.32693272829055786,
0.13946008682250977,
-0.15227773785591125,
-1.2019264698028564,
-0.10876189172267914,
-0.7677031755447388,
0.5456658005714417,
1.0649158954620361,
1.3882040977478027,
-1.065254807472229,
-0.3882110118865967,
-1.6617707014083862,
-0.2724817395210266,
-0.7206172943115234,
0.3902668356895447,
-1.8543848991394043,
-0.19161811470985413,
-1.8885531425476074,
-2.5197529792785645,
-1.2924574613571167,
-0.8310418725013733,
1.1401652097702026,
0.03595200926065445,
-0.8819188475608826,
1.1254466772079468,
-0.38859695196151733,
-1.8793402910232544,
1.2017444372177124,
-2.210728406906128
] |
https://github.com/huggingface/datasets/issues/5150 | Problems after upgrading to 2.6.1 | I am also receiving this error on Sagemaker but not locally, I have noticed that this occurs when the `.dataset/` folder does not contain a single file like:
`dataset.arrow`
but instead contains multiple files like:
`data-00000-of-00002.arrow`
`data-00001-of-00002.arrow`
I think that it may have something to do with this recent PR that updated the behaviour of `dataset.save_to_disk` by introducing sharding: https://github.com/huggingface/datasets/pull/5268
For now I can get around this by forcing datasets==2.8.0 on machine that creates dataset and in the huggingface instance for training (by running this at the start of training script `os.system("pip install datasets==2.8.0")`)
To ensure the dataset is a single shard when saving the dataset locally:
```python3
dataset.flatten_indices().save_to_disk('path/to/dataset', num_shards=1)
```
and then manually changing the name afterwards from `path/to/dataset/data-00000-of-00001.arrow` to `path/to/dataset/dataset.arrow` and updating the `path/to/dataset/state.json` to reflect this name change. i.e. by changing `state.json` to this:
```javascript
{
"_data_files": [
{
"filename": "dataset.arrow"
}
],
"_fingerprint": "420086f0636f8727",
"_format_columns": null,
"_format_kwargs": {},
"_format_type": null,
"_output_all_columns": false,
"_split": null
}
``` | ### Describe the bug
Loading a dataset_dict from disk with `load_from_disk` is now creating a `KeyError "length"` that was not occurring in v2.5.2.
Context:
- Each individual dataset in the dict is created with `Dataset.from_pandas`
- The dataset_dict is create from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- The pandas dataframe, besides text columns, has a column with a dictionary inside and potentially different keys in each row. Correctly the `Dataset.from_pandas` function adds `key: None` to all dictionaries in each row so that the schema can be correctly inferred.
### Steps to reproduce the bug
Steps to reproduce:
- Upgrade to datasets==2.6.1
- Create a dataset from pandas dataframe with `Dataset.from_pandas`
- Create a dataset_dict from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- Save to disk with the `save` function
### Expected behavior
Same as in v2.5.2, that is load from disk without errors
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.4.209-129.367.amzn2int.x86_64-x86_64-with-glibc2.26
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1 | 461 | 160 | Problems after upgrading to 2.6.1
### Describe the bug
Loading a dataset_dict from disk with `load_from_disk` is now creating a `KeyError "length"` that was not occurring in v2.5.2.
Context:
- Each individual dataset in the dict is created with `Dataset.from_pandas`
- The dataset_dict is create from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- The pandas dataframe, besides text columns, has a column with a dictionary inside and potentially different keys in each row. Correctly the `Dataset.from_pandas` function adds `key: None` to all dictionaries in each row so that the schema can be correctly inferred.
### Steps to reproduce the bug
Steps to reproduce:
- Upgrade to datasets==2.6.1
- Create a dataset from pandas dataframe with `Dataset.from_pandas`
- Create a dataset_dict from a dict of `Dataset`s, e.g., `DatasetDict({"train": train_ds, "validation": val_ds})
- Save to disk with the `save` function
### Expected behavior
Same as in v2.5.2, that is load from disk without errors
### Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.4.209-129.367.amzn2int.x86_64-x86_64-with-glibc2.26
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
I am also receiving this error on Sagemaker but not locally, I have noticed that this occurs when the `.dataset/` folder does not contain a single file like:
`dataset.arrow`
but instead contains multiple files like:
`data-00000-of-00002.arrow`
`data-00001-of-00002.arrow`
I think that it may have something to do with this recent PR that updated the behaviour of `dataset.save_to_disk` by introducing sharding: https://github.com/huggingface/datasets/pull/5268
For now I can get around this by forcing datasets==2.8.0 on machine that creates dataset and in the huggingface instance for training (by running this at the start of training script `os.system("pip install datasets==2.8.0")`)
To ensure the dataset is a single shard when saving the dataset locally:
```python3
dataset.flatten_indices().save_to_disk('path/to/dataset', num_shards=1)
```
and then manually changing the name afterwards from `path/to/dataset/data-00000-of-00001.arrow` to `path/to/dataset/dataset.arrow` and updating the `path/to/dataset/state.json` to reflect this name change. i.e. by changing `state.json` to this:
```javascript
{
"_data_files": [
{
"filename": "dataset.arrow"
}
],
"_fingerprint": "420086f0636f8727",
"_format_columns": null,
"_format_kwargs": {},
"_format_type": null,
"_output_all_columns": false,
"_split": null
}
``` | [
-1.0916483402252197,
-0.8213995695114136,
-0.7214500308036804,
1.3985306024551392,
-0.18107321858406067,
-1.2931594848632812,
0.2378867268562317,
-1.1249955892562866,
1.7400928735733032,
-0.8076481819152832,
0.2968730330467224,
-1.66896653175354,
0.05359785631299019,
-0.6021701693534851,
-0.7237987518310547,
-0.8591582775115967,
-0.4355144798755646,
-0.6798867583274841,
0.9607869386672974,
2.43709397315979,
1.1944576501846313,
-1.3407208919525146,
2.5986180305480957,
0.7400002479553223,
-0.17659145593643188,
-0.9554811716079712,
0.47679030895233154,
0.0651916041970253,
-1.4152262210845947,
-0.31968170404434204,
-0.9358879327774048,
-0.1247471496462822,
-0.5506306290626526,
-0.6014646291732788,
-0.02667313441634178,
0.4469546377658844,
-0.3965529501438141,
-0.5248454213142395,
-0.5032619833946228,
-0.8252668976783752,
0.3905498683452606,
-0.3363717198371887,
0.9819850325584412,
-0.37693947553634644,
1.8001693487167358,
-0.5687392950057983,
0.474606990814209,
0.7847867608070374,
1.2533836364746094,
0.15278936922550201,
-0.033863019198179245,
0.3652172386646271,
0.39263856410980225,
0.024735823273658752,
0.49320244789123535,
1.0926666259765625,
0.6414309144020081,
0.4706529378890991,
0.7944919466972351,
-2.217583417892456,
1.3107012510299683,
-0.9533674716949463,
0.33294224739074707,
1.3722527027130127,
-0.9881771802902222,
0.2996141016483307,
-1.7737822532653809,
-0.08752389997243881,
0.4947715401649475,
-2.242403507232666,
0.26828745007514954,
-1.3586491346359253,
-0.5442543625831604,
1.0456995964050293,
0.37686365842819214,
-1.0584077835083008,
0.12450934201478958,
-0.36311399936676025,
0.8770389556884766,
0.4752551019191742,
1.1665300130844116,
-1.6489650011062622,
-0.03276645764708519,
-0.3432636857032776,
0.14604103565216064,
-1.260894536972046,
-1.524118185043335,
0.6011661291122437,
0.721674919128418,
0.5379487872123718,
-0.1734095960855484,
0.98638916015625,
-0.9756385087966919,
0.7280789017677307,
-1.0095669031143188,
-1.8018497228622437,
-1.3894057273864746,
-2.2672879695892334,
-2.320214033126831,
0.7446339130401611,
-0.477837473154068,
-0.48453575372695923,
2.0834333896636963,
-1.0327187776565552,
-1.7374329566955566,
1.0545475482940674,
0.23709188401699066,
-0.09455112367868423,
2.318387746810913,
0.2222452610731125,
-0.6833541393280029,
0.4655088484287262,
-0.7709352374076843,
0.6623876690864563,
-0.3571627140045166,
1.2863949537277222,
0.42589426040649414,
-1.1059941053390503,
1.577610969543457,
-0.38354983925819397,
0.5655504465103149,
-0.6868658661842346,
-0.44764289259910583,
-0.6457794308662415,
0.27663716673851013,
1.843282699584961,
-0.2611720561981201,
1.4852850437164307,
-0.30540552735328674,
-1.5746501684188843,
-1.5861477851867676,
0.8018841743469238,
0.5218510031700134,
-0.679819643497467,
0.09284589439630508,
-0.36760634183883667,
0.1033482477068901,
-0.05753438174724579,
1.1632896661758423,
1.2721737623214722,
0.8076556324958801,
-0.33594420552253723,
-0.8649799227714539,
0.1599268913269043,
-0.016899380832910538,
-0.8406673073768616,
-1.7606059312820435,
-0.2780567407608032,
0.12686818838119507,
0.6004616022109985,
-1.145676851272583,
1.8089447021484375,
0.8688409924507141,
1.944090723991394,
0.9838142395019531,
-0.4023788869380951,
1.522834062576294,
0.10866402834653854,
1.88229501247406,
-0.43024998903274536,
0.6039795279502869,
-0.36628496646881104,
-1.1427028179168701,
0.8379907011985779,
-0.23097936809062958,
-2.104816198348999,
-0.5900558829307556,
-0.8342643976211548,
-0.1320478469133377,
-0.7063855528831482,
0.9770092368125916,
-0.12576819956302643,
-1.3767552375793457,
0.20501139760017395,
-0.7244048118591309,
0.09750876575708389,
-1.2347928285598755,
0.30885788798332214,
0.7548684477806091,
-0.6600210666656494,
0.1279173195362091,
-0.2711717188358307,
-1.3277403116226196,
-0.44263046979904175,
0.34858420491218567,
1.762040376663208,
-0.8052976131439209,
0.9190205335617065,
1.0488542318344116,
-0.6985775828361511,
-0.004234664142131805,
0.3831329643726349,
-0.35553500056266785,
0.8083094358444214,
-1.0440773963928223,
-0.4303719103336334,
1.124793529510498,
-0.20272564888000488,
-0.5636294484138489,
1.4801172018051147,
0.6547619104385376,
-0.9820511937141418,
-0.12321463227272034,
-0.1741792857646942,
-0.8263583183288574,
0.05151284113526344,
-1.6238707304000854,
-0.014184597879648209,
0.3667246401309967,
-1.5122936964035034,
-0.48617199063301086,
-0.18234118819236755,
1.3123266696929932,
-0.0929688885807991,
1.3390228748321533,
-0.2874079644680023,
-0.19002032279968262,
-0.4765150845050812,
-0.33505499362945557,
0.09100624918937683,
-0.16611334681510925,
-0.576337993144989,
0.23972295224666595,
-0.7511324286460876,
0.309207558631897,
1.4281373023986816,
0.28044188022613525,
0.08895478397607803,
0.5724287033081055,
1.1321688890457153,
0.3496271073818207,
-0.10076931864023209,
-0.8020548224449158,
-1.5843937397003174,
2.003072500228882,
-1.4329097270965576,
1.9698997735977173,
0.7122575640678406,
0.03535478189587593,
-1.890030026435852,
-1.9152026176452637,
1.3906986713409424,
1.0977071523666382,
2.3864591121673584,
0.5546785593032837,
0.43704965710639954,
-0.8147070407867432,
-0.6458067297935486,
0.38359081745147705,
-0.8973103165626526,
-0.7253289222717285,
0.22564302384853363,
2.3384010791778564,
1.737350583076477,
-0.4341362714767456,
-0.17889384925365448,
-1.0927207469940186,
1.4955999851226807,
-0.1766667366027832,
0.1469666212797165,
2.0410401821136475,
-0.26942700147628784,
-1.0614550113677979,
1.376977562904358,
-2.3563175201416016,
0.18991592526435852,
1.9540754556655884,
0.1973848193883896,
0.05222351476550102,
-1.2989050149917603,
-0.6793321371078491,
-0.28879639506340027,
-0.4284115433692932,
-1.1624417304992676,
0.49562084674835205,
-0.2626011073589325,
-0.7601463794708252,
-1.4601129293441772,
0.23975785076618195,
-1.10248863697052,
-1.7376022338867188,
0.18159663677215576,
1.812394142150879,
1.973768949508667,
-0.7628445625305176,
1.4512826204299927,
-0.2873842716217041,
0.13000433146953583,
1.269958257675171,
1.1849857568740845,
3.139188766479492,
1.9479591846466064,
-1.32877779006958,
0.6926576495170593,
-0.048101820051670074,
-0.4743395447731018,
1.1604794263839722,
-1.2388484477996826,
1.2654508352279663,
-0.17125725746154785,
-1.2104642391204834,
-1.1860055923461914,
0.9162470698356628,
0.5028669834136963,
0.12179800122976303,
-0.46281012892723083,
1.1793116331100464,
0.11625144630670547,
1.3732001781463623,
0.5871008634567261,
-0.3187275528907776,
0.660875141620636,
-0.3495510220527649,
-0.5072110891342163,
1.529106855392456,
0.2645074129104614,
-1.3466814756393433,
-2.31290602684021,
-0.2875165045261383,
-0.8748519420623779,
-0.023710930719971657,
-0.6458061933517456,
-0.9652711153030396,
1.6523692607879639,
0.43250176310539246,
-1.2112534046173096,
-0.20356544852256775,
-0.2903728485107422,
-0.5502018332481384,
2.7346675395965576,
-1.368416666984558,
-0.20001685619354248,
-1.028752088546753,
-0.6297591328620911,
1.6649147272109985,
-1.1532303094863892,
-0.2698412537574768,
-1.1356767416000366,
-0.48527058959007263,
-1.3086018562316895,
-0.608045756816864,
0.001618686132133007,
-0.8695835471153259,
0.8779827356338501,
0.15726161003112793,
-1.283042073249817,
-0.37682485580444336,
-0.9666680097579956,
0.9331271648406982,
-0.16745200753211975,
0.13171598315238953,
1.8107670545578003,
0.4730939567089081,
-0.39629390835762024,
0.643366813659668,
1.144349455833435,
0.6454735398292542,
-0.6225884556770325,
0.32902753353118896,
-0.7266207933425903,
0.31011462211608887,
-1.3009086847305298,
0.31583842635154724,
-2.838711977005005,
0.5834882259368896,
-0.06771761924028397,
-0.0329602025449276,
-0.1113540381193161,
-1.4182895421981812,
1.0150483846664429,
2.5887022018432617,
-1.1951431035995483,
0.48116984963417053,
0.3208525776863098,
1.1947975158691406,
-1.553687334060669,
0.3033667504787445,
-0.4625938832759857,
2.095561981201172,
0.15592163801193237,
1.1874175071716309,
-0.4335358142852783,
-2.3181114196777344,
0.5721853971481323,
-1.2662798166275024,
-1.1621593236923218,
0.8255013823509216,
-0.8020344972610474,
0.02542761340737343,
-1.3097429275512695,
-0.22967718541622162,
-0.770466685295105,
-1.207654356956482,
0.6793853044509888,
0.13858069479465485,
0.5741906762123108,
-0.6668803095817566,
0.34034639596939087,
-2.236416816711426,
-1.3145455121994019,
-0.25696229934692383,
-0.9419828057289124,
0.481096088886261,
-0.24901922047138214,
0.7690532207489014,
-0.19998590648174286,
-0.032426316291093826,
0.36816301941871643,
1.420785665512085,
3.36629319190979,
0.12731066346168518,
0.2813200354576111,
-0.2230275571346283,
-0.9007314443588257,
1.4249964952468872,
0.8855596780776978,
-0.14148908853530884,
-0.5412888526916504,
-1.0703036785125732,
1.0947877168655396,
1.9972710609436035,
1.0548579692840576,
-0.05459225922822952,
-0.8732438683509827,
-0.8170603513717651,
0.03629344329237938,
0.15922915935516357,
0.46394801139831543,
0.8946684002876282,
0.14860396087169647,
0.027580242604017258,
1.4884506464004517,
1.1866388320922852,
-0.3438437879085541,
0.41478195786476135,
-0.8416630625724792,
-0.48187875747680664,
0.5270572304725647,
0.4049581289291382,
0.05716024711728096,
0.30891698598861694,
-1.1036763191223145,
-0.15539859235286713,
-0.3958423435688019,
-0.8623564839363098,
-0.7260923981666565,
-0.48463520407676697,
-0.39930692315101624,
1.7178425788879395,
0.04858002811670303,
-0.525286078453064,
-0.056946609169244766,
-0.7056597471237183,
-0.0835091695189476,
-1.0206152200698853,
0.43460461497306824,
-0.17743906378746033,
-0.03504710644483566,
-0.103920117020607,
1.7555056810379028,
-0.9387367963790894,
-2.017367362976074,
0.24132490158081055,
0.19265642762184143,
-0.37969329953193665,
0.2439163625240326,
1.6318507194519043,
0.5941392183303833,
1.4084420204162598,
1.3849706649780273,
1.0219045877456665,
-0.7046422362327576,
-1.3314341306686401,
0.6577959656715393,
0.9467942118644714,
-1.4194308519363403,
0.6742428541183472,
0.07488259673118591,
-0.5070172548294067,
0.6185922026634216,
1.2331550121307373,
0.4139934182167053,
-2.110243082046509,
0.8011773228645325,
-0.9447671175003052,
0.7313628792762756,
0.7629522681236267,
0.7629745006561279,
0.10298698395490646,
0.7979784607887268,
-1.2656643390655518,
-1.111886739730835,
-0.692154586315155,
-0.7069405913352966,
1.9113987684249878,
-0.28352871537208557,
0.5982698798179626,
-0.2454073280096054,
-1.449842095375061,
-0.003124318551272154,
0.7125645279884338,
0.3004761040210724,
-0.544921875,
0.7624326348304749,
-0.6405987739562988,
-1.0993061065673828,
-1.322786569595337,
-0.4751158654689789,
-1.1544504165649414,
-0.8969411253929138,
1.0181752443313599,
0.829863429069519,
0.35148388147354126,
1.8534934520721436,
0.6739413142204285,
0.2790469229221344,
-2.6609997749328613,
0.8858072757720947,
0.2821148633956909,
-0.05863209441304207,
0.7994547486305237,
0.37017473578453064,
1.0202505588531494,
-0.11846332252025604,
0.6446962356567383,
-2.481657028198242,
2.3181567192077637,
-0.2303682565689087,
0.6941805481910706,
0.011781674809753895,
-0.19982701539993286,
1.029134750366211,
0.6058831810951233,
0.5774296522140503,
-1.0797468423843384,
0.7140653729438782,
-0.6667696237564087,
1.2160234451293945,
0.7991623878479004,
-0.8233948349952698,
-0.0593084990978241,
1.3232911825180054,
0.5113926529884338,
-0.4718632102012634,
-0.9531760811805725,
-1.0704623460769653,
0.8985534906387329,
1.7818645238876343,
-0.12118066102266312,
0.031609635800123215,
0.9104169011116028,
0.713012158870697,
-1.3279258012771606,
0.0400615818798542,
-0.7722288370132446,
-0.7247146964073181,
1.6591800451278687,
2.0645530223846436,
-0.16784413158893585,
-0.16958630084991455,
-0.8182176947593689,
-1.1919403076171875,
0.7767207622528076,
0.10594457387924194,
0.02159358188509941,
0.6216450333595276,
-0.6010123491287231,
1.1776623725891113,
0.8687570691108704,
0.9140925407409668,
0.297380268573761,
0.2889057397842407,
0.2899475395679474,
-0.3594173491001129,
-1.2311663627624512,
-0.24810943007469177,
-0.9836331009864807,
-2.441941976547241,
0.5712373852729797,
-0.19386766850948334,
-1.523050308227539,
0.013652035035192966,
-1.0206096172332764,
0.851672351360321,
-0.5476356148719788,
-1.1158277988433838,
-1.4608099460601807,
0.25731566548347473,
-0.07080070674419403,
0.9459372758865356,
-1.5285265445709229,
-0.08100199699401855,
1.2410590648651123,
0.8992848992347717,
-0.7165621519088745,
0.9622425436973572,
0.23517057299613953,
1.0595943927764893,
0.9728683233261108,
-0.3314160108566284,
0.49673235416412354,
0.1428690105676651,
-1.3424205780029297,
0.36393627524375916,
1.1785122156143188,
0.18073517084121704,
1.5092798471450806,
-0.6209096908569336,
0.051626745611429214,
0.3977341055870056,
-0.4257386028766632,
-0.46404242515563965,
-0.6185674667358398,
0.6802957653999329,
0.008544928394258022,
-0.9323161244392395,
0.045443806797266006,
0.026631299406290054,
-0.19538076221942902,
0.2077881395816803,
-1.4657630920410156,
-0.13685756921768188,
-0.3207046091556549,
-0.6369178891181946,
-1.182178020477295,
-0.058308638632297516,
1.380393147468567,
-0.7496945261955261,
-0.12172045558691025,
0.546318531036377,
0.27017417550086975,
0.5374665260314941,
0.6262275576591492,
-0.6517845988273621,
-0.3278803527355194,
-0.20486050844192505,
-0.379203200340271,
0.35145437717437744,
1.4067403078079224,
-0.07124602794647217,
-0.9569095969200134,
0.7293021082878113,
-0.3671249449253082,
0.05617154762148857,
2.002490520477295,
0.14009623229503632,
-0.8448470830917358,
0.33323314785957336,
-0.7069987654685974,
1.8969465494155884,
1.8459439277648926,
1.3726569414138794,
-0.08509065955877304,
-1.0545886754989624,
0.5495032668113708,
-0.4255273938179016,
-0.3561525344848633,
0.9433112740516663,
0.39113670587539673,
-0.19474546611309052,
-1.3071315288543701,
0.7223924398422241,
1.2956976890563965,
-0.8700190782546997,
-0.8637447357177734,
0.16713069379329681,
-0.8010829091072083,
1.0896341800689697,
0.7569320797920227,
0.4067780077457428,
0.25630897283554077,
1.572005271911621,
0.7447941899299622,
-0.4208052158355713,
0.6480068564414978,
0.5144311785697937,
-0.19521790742874146,
-2.0104782581329346,
-1.1893419027328491,
0.36256125569343567,
-0.5879166722297668,
-1.6617571115493774,
1.4396202564239502,
-1.2541922330856323,
-0.9913608431816101,
0.4823710024356842,
0.062299106270074844,
1.4204211235046387,
0.358788400888443,
1.59054696559906,
2.0801351070404053,
0.9423723220825195,
0.41123130917549133,
1.345231533050537,
-0.20616620779037476,
-0.4314205050468445,
1.7664333581924438,
-0.5174679756164551,
0.5509294867515564,
1.1217981576919556,
-0.2909662127494812,
-1.0947637557983398,
-0.8409602642059326,
-1.1660412549972534,
-0.7485921382904053,
1.2073707580566406,
0.06416327506303787,
-1.1208924055099487,
0.3781287670135498,
1.5867949724197388,
-0.002949710935354233,
-0.33472350239753723,
0.6889479756355286,
0.3085131049156189,
-0.8654019832611084,
-0.11360923945903778,
-0.9643650650978088,
0.5578217506408691,
-0.2778222858905792,
-0.38290104269981384,
0.3412642478942871,
0.48864805698394775,
1.3244136571884155,
-0.0033503007143735886,
0.11430712044239044,
1.1990946531295776,
-1.4048818349838257,
1.4655163288116455,
-0.7518426775932312,
0.2533058226108551,
-2.3008387088775635,
1.4027738571166992,
-0.7716817855834961,
1.8917170763015747,
-2.6984922885894775,
0.46604469418525696,
-0.5004793405532837,
-0.48041144013404846,
0.23903115093708038,
-0.3160252571105957,
0.1121612936258316,
-0.12697964906692505,
-1.207445502281189,
-0.10279089957475662,
-0.7833051085472107,
0.5402400493621826,
1.0862133502960205,
1.4026341438293457,
-1.0924943685531616,
-0.36002662777900696,
-1.6721011400222778,
-0.245235413312912,
-0.677736759185791,
0.377956748008728,
-1.883020281791687,
-0.20864589512348175,
-1.9076299667358398,
-2.511155843734741,
-1.2973135709762573,
-0.88224196434021,
1.1332859992980957,
0.05984196439385414,
-0.8828044533729553,
1.117156744003296,
-0.40097007155418396,
-1.8754398822784424,
1.181090235710144,
-2.195056676864624
] |
https://github.com/huggingface/datasets/issues/5148 | Cannot find the rvl_cdip dataset | Hi, @santule.
We have transferred all dataset scripts from GitHub to the Hugging Face Hub: https://huggingface.co/datasets
- Concretely, you have "rvl_cdip" here: https://huggingface.co/datasets/rvl_cdip
To be able to load them, you should update your `datasets` library:
```
pip install -U datasets
``` | Hi,
I am trying to use load_dataset to load the official "rvl_cdip" dataset but getting an error.
dataset = load_dataset("rvl_cdip")
Couldn't find 'rvl_cdip' on the Hugging Face Hub either: FileNotFoundError: Couldn't find the file at https://raw.githubusercontent.com/huggingface/datasets/master/datasets/rvl_cdip/rvl_cdip.py
Regards,
| 462 | 41 | Cannot find the rvl_cdip dataset
Hi,
I am trying to use load_dataset to load the official "rvl_cdip" dataset but getting an error.
dataset = load_dataset("rvl_cdip")
Couldn't find 'rvl_cdip' on the Hugging Face Hub either: FileNotFoundError: Couldn't find the file at https://raw.githubusercontent.com/huggingface/datasets/master/datasets/rvl_cdip/rvl_cdip.py
Regards,
Hi, @santule.
We have transferred all dataset scripts from GitHub to the Hugging Face Hub: https://huggingface.co/datasets
- Concretely, you have "rvl_cdip" here: https://huggingface.co/datasets/rvl_cdip
To be able to load them, you should update your `datasets` library:
```
pip install -U datasets
``` | [
-1.2689905166625977,
-1.0017350912094116,
-0.869960367679596,
1.4413106441497803,
-0.20475468039512634,
-1.240904688835144,
0.154368594288826,
-0.9928720593452454,
1.6361660957336426,
-0.7707355618476868,
0.32101869583129883,
-1.7403019666671753,
-0.05362050607800484,
-0.6729921698570251,
-0.7452638745307922,
-0.8874099254608154,
-0.29597440361976624,
-0.6857141256332397,
0.9346778988838196,
2.4787867069244385,
1.2058935165405273,
-1.2025631666183472,
2.7440035343170166,
0.6987674832344055,
-0.13344652950763702,
-1.048975944519043,
0.5757297277450562,
0.035223640501499176,
-1.139388084411621,
-0.43759748339653015,
-0.9767182469367981,
0.053359415382146835,
-0.48804906010627747,
-0.6383731365203857,
0.02750331535935402,
0.44259291887283325,
-0.3652770519256592,
-0.328759104013443,
-0.6099815368652344,
-0.7679899334907532,
0.5153980851173401,
-0.3393634557723999,
0.9757260680198669,
-0.4408052861690521,
1.8870611190795898,
-0.5140191316604614,
0.39487123489379883,
0.7854463458061218,
1.3016058206558228,
0.13874153792858124,
0.08319584280252457,
0.14723087847232819,
0.4123048782348633,
0.07217276096343994,
0.3822665512561798,
1.0825051069259644,
0.5504681468009949,
0.5823326110839844,
0.7455182075500488,
-2.187640428543091,
1.2584701776504517,
-0.985761821269989,
0.24559403955936432,
1.3771088123321533,
-0.8568192720413208,
0.45721718668937683,
-1.7381689548492432,
0.02979321777820587,
0.5804293751716614,
-2.267834186553955,
0.3223203122615814,
-1.3256871700286865,
-0.6017038822174072,
1.006456732749939,
0.3263801336288452,
-1.220689296722412,
0.1740429401397705,
-0.400399386882782,
1.045530080795288,
0.5726244449615479,
1.075221061706543,
-1.7023577690124512,
0.0844198614358902,
-0.24901092052459717,
-0.06654393672943115,
-1.3219847679138184,
-1.505407452583313,
0.4786953032016754,
0.5713788866996765,
0.7051006555557251,
-0.04186975955963135,
0.9836120009422302,
-0.9316741228103638,
0.7830075025558472,
-0.9215580821037292,
-1.5806031227111816,
-1.3299305438995361,
-2.334527015686035,
-2.3735361099243164,
0.6993071436882019,
-0.4915839731693268,
-0.4801611602306366,
1.9297136068344116,
-1.05682373046875,
-1.8215901851654053,
1.2318466901779175,
0.32440048456192017,
0.11495103687047958,
2.31764817237854,
0.30981484055519104,
-0.7217418551445007,
0.4603080451488495,
-0.6749018430709839,
0.8032205700874329,
-0.3590717613697052,
1.3726273775100708,
0.5905089974403381,
-1.0575536489486694,
1.551979899406433,
-0.5802530646324158,
0.6498084664344788,
-0.5665773153305054,
-0.4823054373264313,
-0.9064377546310425,
0.35593461990356445,
1.7890148162841797,
-0.33539530634880066,
1.5778119564056396,
-0.30841201543807983,
-1.571231484413147,
-1.5827406644821167,
0.8349930644035339,
0.4932973384857178,
-0.7600207328796387,
0.08662645518779755,
-0.3739098310470581,
-0.02310977503657341,
-0.10430275648832321,
1.206020712852478,
1.1440855264663696,
0.7183058857917786,
-0.3039209842681885,
-0.8439499139785767,
0.16479963064193726,
-0.044637009501457214,
-0.688833475112915,
-1.8094284534454346,
-0.32372233271598816,
0.32416433095932007,
0.574116051197052,
-1.213146448135376,
1.6183212995529175,
0.885094165802002,
1.9464473724365234,
1.0143258571624756,
-0.21317949891090393,
1.2687861919403076,
0.0017870031297206879,
1.9607691764831543,
-0.6496952176094055,
0.6984252333641052,
-0.1847081333398819,
-1.1221824884414673,
0.7697191834449768,
-0.35516786575317383,
-2.0373709201812744,
-0.8563202023506165,
-0.8707578778266907,
-0.23337186872959137,
-0.7181026339530945,
0.9579511284828186,
-0.43795186281204224,
-1.446909785270691,
0.25163641571998596,
-0.6176313161849976,
0.13968928158283234,
-1.2285326719284058,
0.17255981266498566,
0.7496803402900696,
-0.7212497591972351,
-0.13256563246250153,
-0.20324407517910004,
-1.3210742473602295,
-0.5150310397148132,
0.42844173312187195,
1.8965120315551758,
-0.6833934783935547,
0.9894755482673645,
0.9481590986251831,
-0.76961350440979,
0.11156690865755081,
0.26871782541275024,
-0.3208032250404358,
0.7360444068908691,
-1.0419715642929077,
-0.5157244801521301,
1.1898834705352783,
-0.19406357407569885,
-0.7169381380081177,
1.5053389072418213,
0.8495698571205139,
-0.9316471219062805,
-0.17832408845424652,
-0.29540568590164185,
-0.7106950879096985,
-0.015612026676535606,
-1.5052729845046997,
-0.06862583011388779,
0.21459661424160004,
-1.4145437479019165,
-0.521648645401001,
-0.23204977810382843,
1.2831850051879883,
-0.17302457988262177,
1.2761410474777222,
-0.38824763894081116,
-0.32304614782333374,
-0.3509036600589752,
-0.5317587852478027,
0.14832104742527008,
-0.17452560365200043,
-0.6321178078651428,
0.16352418065071106,
-0.8710190653800964,
0.27795472741127014,
1.433520793914795,
0.37868940830230713,
0.07352762669324875,
0.4786248505115509,
1.1039643287658691,
0.34715843200683594,
0.010709327645599842,
-0.9290127158164978,
-1.590130090713501,
1.8983919620513916,
-1.388956069946289,
1.9317079782485962,
0.7041110396385193,
-0.1073373332619667,
-1.8525416851043701,
-1.8323395252227783,
1.3399726152420044,
1.1358997821807861,
2.3224494457244873,
0.512446403503418,
0.2775701582431793,
-0.8122400045394897,
-0.8105042576789856,
0.3487885892391205,
-1.048442006111145,
-0.6857435703277588,
0.12715931236743927,
2.3987529277801514,
1.8055944442749023,
-0.5897360444068909,
-0.2568608224391937,
-1.0778471231460571,
1.1281754970550537,
-0.11718457192182541,
0.22274088859558105,
2.106510639190674,
-0.3817908465862274,
-1.0986741781234741,
1.3760656118392944,
-2.336524248123169,
0.23186299204826355,
2.0459401607513428,
0.2860540747642517,
0.14365339279174805,
-1.388300895690918,
-0.6273791790008545,
-0.2278081476688385,
-0.4568750560283661,
-1.2758769989013672,
0.6631796360015869,
-0.24760837852954865,
-0.8591268062591553,
-1.2725592851638794,
0.11170957237482071,
-1.1615324020385742,
-1.653140902519226,
0.45146432518959045,
1.7944304943084717,
2.1116783618927,
-0.8455843329429626,
1.5609605312347412,
-0.13790759444236755,
0.17390799522399902,
1.3799958229064941,
1.3409518003463745,
3.1045117378234863,
1.8139166831970215,
-1.255649209022522,
0.7302058935165405,
-0.1329953521490097,
-0.49926209449768066,
1.2569770812988281,
-1.061523199081421,
1.2014771699905396,
-0.23622195422649384,
-1.2016489505767822,
-1.3011565208435059,
1.0438207387924194,
0.5013573169708252,
0.03752339631319046,
-0.535523533821106,
1.2473607063293457,
0.07148274779319763,
1.3106635808944702,
0.6038100123405457,
-0.4783070683479309,
0.5685460567474365,
-0.3410786986351013,
-0.587751567363739,
1.4981242418289185,
0.21636787056922913,
-1.4821749925613403,
-2.2510759830474854,
-0.3070119619369507,
-0.8100661039352417,
-0.15036411583423615,
-0.5761383175849915,
-0.9708322286605835,
1.6206711530685425,
0.4082936644554138,
-1.2832756042480469,
-0.19870884716510773,
-0.4005195200443268,
-0.5299200415611267,
2.7229859828948975,
-1.3636335134506226,
-0.20102399587631226,
-1.0124554634094238,
-0.580403745174408,
1.6346826553344727,
-1.1881943941116333,
-0.24147415161132812,
-1.1109834909439087,
-0.8147888779640198,
-1.4687190055847168,
-0.47396770119667053,
0.09918268769979477,
-0.9062531590461731,
0.8112406730651855,
0.11307113617658615,
-1.0618611574172974,
-0.28544703125953674,
-0.8705318570137024,
0.9845162034034729,
-0.18426769971847534,
0.31547558307647705,
2.034557819366455,
0.42268267273902893,
-0.3496691882610321,
0.7389777898788452,
1.131325125694275,
0.6339815258979797,
-0.767180323600769,
0.22822429239749908,
-0.7697932720184326,
0.2265327125787735,
-1.378391146659851,
0.17938557267189026,
-2.8830161094665527,
0.800713300704956,
-0.08250195533037186,
-0.2645651400089264,
-0.020810339599847794,
-1.3066881895065308,
1.1070700883865356,
2.643218517303467,
-1.1948221921920776,
0.40552210807800293,
0.38161417841911316,
1.0987931489944458,
-1.5961089134216309,
0.3741992712020874,
-0.4335630536079407,
1.995175838470459,
0.14084644615650177,
1.1893173456192017,
-0.5218184590339661,
-2.1253855228424072,
0.7397864460945129,
-1.2212084531784058,
-1.1180872917175293,
0.860846996307373,
-0.7792098522186279,
0.17461061477661133,
-1.5551003217697144,
-0.1696951985359192,
-0.975073516368866,
-1.4449702501296997,
0.7716201543807983,
0.19632714986801147,
0.3862301707267761,
-0.6089383959770203,
0.3000013828277588,
-2.1323912143707275,
-1.405761957168579,
-0.2789263427257538,
-0.9028164744377136,
0.592752993106842,
-0.249174565076828,
0.6071611642837524,
-0.16882982850074768,
0.04651804640889168,
0.35637661814689636,
1.4419149160385132,
3.4399168491363525,
0.2475571483373642,
0.2960112392902374,
-0.021777432411909103,
-1.018161416053772,
1.418825626373291,
1.0880669355392456,
-0.021384214982390404,
-0.5927668809890747,
-0.9624337553977966,
1.183824896812439,
2.0111515522003174,
1.0467109680175781,
0.2245706468820572,
-0.9200605750083923,
-0.6743800640106201,
0.0826520025730133,
0.17444060742855072,
0.4646158218383789,
0.8410497903823853,
0.004072780720889568,
0.1350243091583252,
1.4717092514038086,
1.169963002204895,
-0.3138548731803894,
0.3025672137737274,
-0.9156583547592163,
-0.363577276468277,
0.5864793658256531,
0.2639584541320801,
0.04192967340350151,
0.4233304262161255,
-0.9242997765541077,
-0.281719833612442,
-0.26547402143478394,
-0.9558794498443604,
-0.7066839933395386,
-0.49154719710350037,
-0.4529575705528259,
1.5034680366516113,
0.08271516114473343,
-0.5119359493255615,
-0.02657128870487213,
-0.7492103576660156,
-0.1641564965248108,
-1.0433086156845093,
0.16135020554065704,
-0.13204403221607208,
-0.1269385814666748,
-0.2329251915216446,
1.6583412885665894,
-1.0879735946655273,
-2.1137256622314453,
0.29996615648269653,
0.40438294410705566,
-0.4022745192050934,
0.12961137294769287,
1.6148934364318848,
0.515458345413208,
1.4270139932632446,
1.2876640558242798,
0.9956294298171997,
-0.5063227415084839,
-1.3240108489990234,
0.6729845404624939,
0.998328447341919,
-1.4232786893844604,
0.8624363541603088,
-0.10068730264902115,
-0.6069544553756714,
0.8027437329292297,
1.3254045248031616,
0.3935337960720062,
-1.8338783979415894,
0.6874688267707825,
-0.8867802619934082,
0.8235688805580139,
0.6351750493049622,
0.8348784446716309,
0.13598568737506866,
0.8057882189750671,
-1.2073380947113037,
-1.161300539970398,
-0.7662886381149292,
-0.6292161345481873,
1.9702332019805908,
-0.13385139405727386,
0.5802608132362366,
-0.18007925152778625,
-1.2197072505950928,
-0.08388932049274445,
0.7494748830795288,
0.371579647064209,
-0.43832284212112427,
0.925075352191925,
-0.7208703756332397,
-0.9514617919921875,
-1.3269420862197876,
-0.3671413064002991,
-0.9820356369018555,
-0.9792022705078125,
1.0014784336090088,
0.8017817139625549,
0.37814801931381226,
1.8716415166854858,
0.6745083332061768,
0.3621109127998352,
-2.658688545227051,
0.8557596802711487,
0.12303344905376434,
0.017125248908996582,
0.8852012753486633,
0.3325946033000946,
1.1849783658981323,
-0.009988812729716301,
0.5935574173927307,
-2.312349557876587,
2.2632627487182617,
-0.23188357055187225,
0.5435177683830261,
-0.059586767107248306,
-0.2463866025209427,
1.1976271867752075,
0.46758678555488586,
0.5138400793075562,
-1.0526190996170044,
0.7701374888420105,
-0.4827401340007782,
1.1646109819412231,
0.9562722444534302,
-0.9329779744148254,
-0.02875230461359024,
1.440115213394165,
0.5832715630531311,
-0.39348769187927246,
-0.8261377811431885,
-0.8977810144424438,
0.9534033536911011,
1.6407222747802734,
-0.09942848980426788,
-0.08254681527614594,
0.8075157403945923,
0.5431810021400452,
-1.2824387550354004,
0.0965118408203125,
-0.729960560798645,
-0.5802662372589111,
1.6342920064926147,
1.9456843137741089,
-0.028380587697029114,
-0.14121337234973907,
-0.7841574549674988,
-1.095896601676941,
0.7566866874694824,
0.043188609182834625,
0.14786285161972046,
0.7656537294387817,
-0.7025653123855591,
1.0483554601669312,
0.8111264109611511,
0.8942244052886963,
-0.05068668723106384,
0.4761293828487396,
0.36144307255744934,
-0.3111989200115204,
-1.2251121997833252,
-0.3928150236606598,
-1.1047792434692383,
-2.52431321144104,
0.46615374088287354,
-0.276567667722702,
-1.509621500968933,
-0.06301615387201309,
-1.1157418489456177,
1.049386739730835,
-0.6615917682647705,
-1.1291908025741577,
-1.5778275728225708,
0.2688193917274475,
-0.12737688422203064,
0.8806569576263428,
-1.5678913593292236,
-0.07459569722414017,
1.2625765800476074,
0.8526119589805603,
-0.6085357666015625,
1.0163004398345947,
0.15054088830947876,
1.0515705347061157,
0.7614436745643616,
-0.3999592959880829,
0.4752833843231201,
0.07924389094114304,
-1.4583739042282104,
0.45990216732025146,
1.1102898120880127,
0.355476438999176,
1.3714187145233154,
-0.4536496102809906,
0.12178702652454376,
0.44281017780303955,
-0.6322452425956726,
-0.5173075199127197,
-0.5381218194961548,
0.6985640525817871,
0.12614023685455322,
-0.914081871509552,
0.12953251600265503,
-0.10923394560813904,
-0.3279776871204376,
0.2502196431159973,
-1.5522574186325073,
-0.3488259017467499,
-0.3638117015361786,
-0.5538942813873291,
-1.3025529384613037,
0.014728170819580555,
1.3800954818725586,
-0.7582365274429321,
-0.1836954951286316,
0.5590800642967224,
0.3286975026130676,
0.5248888731002808,
0.5217434763908386,
-0.7469623684883118,
-0.2446610927581787,
-0.4450981914997101,
-0.3455515503883362,
0.1525181233882904,
1.3284475803375244,
-0.18496274948120117,
-1.0242911577224731,
0.763433575630188,
-0.3755562901496887,
0.08954738080501556,
1.9527581930160522,
0.0034252088516950607,
-0.797038733959198,
0.36050188541412354,
-0.7086859941482544,
1.895652174949646,
1.64045250415802,
1.3314943313598633,
-0.09488530457019806,
-0.8313483595848083,
0.5511461496353149,
-0.2714633047580719,
-0.24915964901447296,
1.0390139818191528,
0.49385368824005127,
-0.17740215361118317,
-1.3594108819961548,
0.6947643756866455,
1.3070987462997437,
-0.9327326416969299,
-0.7714953422546387,
0.15701383352279663,
-0.8563088774681091,
1.0472967624664307,
0.5454657077789307,
0.4288804233074188,
0.2744942903518677,
1.6011643409729004,
0.6520925760269165,
-0.4564085602760315,
0.47536003589630127,
0.5215547680854797,
-0.19488348066806793,
-1.9658440351486206,
-1.0619921684265137,
0.29512086510658264,
-0.4307619333267212,
-1.6006206274032593,
1.3532078266143799,
-1.1732689142227173,
-0.9114601016044617,
0.5834029912948608,
0.17597761750221252,
1.3830230236053467,
0.42253172397613525,
1.555189847946167,
1.991145133972168,
0.7888194918632507,
0.3065839409828186,
1.3410422801971436,
0.008128964342176914,
-0.39397722482681274,
1.8320553302764893,
-0.38964101672172546,
0.6483734846115112,
1.1086598634719849,
-0.3819482624530792,
-1.1200783252716064,
-0.7838190197944641,
-1.1545850038528442,
-0.6447314620018005,
1.2582306861877441,
0.19652903079986572,
-1.127001166343689,
0.27206599712371826,
1.6921076774597168,
0.09200025349855423,
-0.25345084071159363,
0.771663248538971,
0.4040966033935547,
-0.7755696773529053,
-0.047967713326215744,
-0.8713043332099915,
0.49486392736434937,
-0.06734315305948257,
-0.24682512879371643,
0.22177602350711823,
0.5232441425323486,
1.297120451927185,
-0.16736045479774475,
0.12642598152160645,
1.1369881629943848,
-1.2996714115142822,
1.5563833713531494,
-0.5987193584442139,
0.30592891573905945,
-2.4554460048675537,
1.3759289979934692,
-0.7374119758605957,
1.8566951751708984,
-2.615849733352661,
0.4284406006336212,
-0.592201292514801,
-0.5414110422134399,
0.3212743103504181,
-0.38480207324028015,
0.07321187853813171,
-0.2115970402956009,
-1.037516474723816,
0.062336746603250504,
-0.7708188891410828,
0.6502073407173157,
1.3130059242248535,
1.3827282190322876,
-1.2317140102386475,
-0.3330751657485962,
-1.8059793710708618,
-0.24098969995975494,
-0.8702582716941833,
0.3541501462459564,
-2.0247132778167725,
-0.1548055112361908,
-1.8780206441879272,
-2.4762508869171143,
-1.4009917974472046,
-0.8889733552932739,
1.1366932392120361,
0.20246869325637817,
-1.0820090770721436,
1.1386102437973022,
-0.35657936334609985,
-1.7971000671386719,
1.096156358718872,
-2.175791025161743
] |
https://github.com/huggingface/datasets/issues/5147 | Allow ignoring kwargs inside fn_kwargs during dataset.map's fingerprinting | Hi ! In the `transformers` issue the object to not hash is a `Pool` - I think you can instantiate it inside your function instead of passing it as a parameter. It's good practice that your function and all its fn_kwargs are picklable, in case you want to parallelize `map` using `num_proc>1`
For the other case `def fn(example, verbose=False):` however, I agree it would be nice to let the user specify that "verbose" needs to be ignored.
Do you think providing a decorator could help ? Maybe
```python
@datasets.hashing.register(ignore_kwargs=["verbose"])
def func(example, verbose=False):
...
``` | ### Feature request
`dataset.map` accepts a `fn_kwargs` that is passed to `fn`. Currently, the whole `fn_kwargs` is used by `fingerprint_transform` to calculate the new fingerprint.
I'd like to be able to inform `fingerprint_transform` which `fn_kwargs` shoud/shouldn't be taken into account during hashing.
Of course, users should be aware to properly use this new feature, just like the internal usages of `fingerprint_transform` [does](https://github.com/huggingface/datasets/blob/2699593b33ee63d17aad2a2bfddedd38a8df57b8/src/datasets/arrow_dataset.py#L2700).
### Motivation
This is originally motivated by https://github.com/huggingface/transformers/pull/18351#issuecomment-1263588680.
Nonetheless, consider a more general processing function that accepts a kwarg that does not influence it's output:
```python
def fn(example, verbose=False):
...
```
Then `dataset.map(fn, verbose=True)` would not benefit from dataset caching.
I'm not sure if other methods in the `Dataset` API could benefit from this feature.
### Your contribution
Based on `fingerprint_transform `'s `wrapper` function [here](https://github.com/huggingface/datasets/blob/c59cc34fcd2a369d27b77cc678017f5976a926a9/src/datasets/fingerprint.py#L443), it seems to me that it should be possible to make `.map`/`._map_single` accept something like `fn_use_fingerprint_kwargs`/`fn_ignore_fingerprint_kwargs` (probably another arg name). This would then be used by `fingerprint_transform.wrapper` to better/more flexibly hash the transformation.
I could contribute with a PR if this feature and approach look good to you. | 463 | 94 | Allow ignoring kwargs inside fn_kwargs during dataset.map's fingerprinting
### Feature request
`dataset.map` accepts a `fn_kwargs` that is passed to `fn`. Currently, the whole `fn_kwargs` is used by `fingerprint_transform` to calculate the new fingerprint.
I'd like to be able to inform `fingerprint_transform` which `fn_kwargs` shoud/shouldn't be taken into account during hashing.
Of course, users should be aware to properly use this new feature, just like the internal usages of `fingerprint_transform` [does](https://github.com/huggingface/datasets/blob/2699593b33ee63d17aad2a2bfddedd38a8df57b8/src/datasets/arrow_dataset.py#L2700).
### Motivation
This is originally motivated by https://github.com/huggingface/transformers/pull/18351#issuecomment-1263588680.
Nonetheless, consider a more general processing function that accepts a kwarg that does not influence it's output:
```python
def fn(example, verbose=False):
...
```
Then `dataset.map(fn, verbose=True)` would not benefit from dataset caching.
I'm not sure if other methods in the `Dataset` API could benefit from this feature.
### Your contribution
Based on `fingerprint_transform `'s `wrapper` function [here](https://github.com/huggingface/datasets/blob/c59cc34fcd2a369d27b77cc678017f5976a926a9/src/datasets/fingerprint.py#L443), it seems to me that it should be possible to make `.map`/`._map_single` accept something like `fn_use_fingerprint_kwargs`/`fn_ignore_fingerprint_kwargs` (probably another arg name). This would then be used by `fingerprint_transform.wrapper` to better/more flexibly hash the transformation.
I could contribute with a PR if this feature and approach look good to you.
Hi ! In the `transformers` issue the object to not hash is a `Pool` - I think you can instantiate it inside your function instead of passing it as a parameter. It's good practice that your function and all its fn_kwargs are picklable, in case you want to parallelize `map` using `num_proc>1`
For the other case `def fn(example, verbose=False):` however, I agree it would be nice to let the user specify that "verbose" needs to be ignored.
Do you think providing a decorator could help ? Maybe
```python
@datasets.hashing.register(ignore_kwargs=["verbose"])
def func(example, verbose=False):
...
``` | [
-1.098184585571289,
-0.8798347115516663,
-0.7810023427009583,
1.4480595588684082,
-0.1625768095254898,
-1.2901285886764526,
0.2110854983329773,
-1.0636675357818604,
1.713141679763794,
-0.739149272441864,
0.3497753441333771,
-1.6711081266403198,
-0.05124442279338837,
-0.714580237865448,
-0.7879689931869507,
-0.8206445574760437,
-0.38425734639167786,
-0.7771989107131958,
1.0694185495376587,
2.4345102310180664,
1.2363356351852417,
-1.3286415338516235,
2.6759071350097656,
0.6566047668457031,
-0.2790210545063019,
-0.9905437231063843,
0.5179852843284607,
-0.011118292808532715,
-1.2023099660873413,
-0.4974089562892914,
-0.8779803514480591,
-0.052811555564403534,
-0.5776880979537964,
-0.5800442695617676,
0.07231379300355911,
0.5125373601913452,
-0.27724751830101013,
-0.4900496006011963,
-0.5420058369636536,
-0.740507185459137,
0.43801364302635193,
-0.3018995523452759,
0.9187699556350708,
-0.3140721023082733,
1.8898617029190063,
-0.5704596042633057,
0.43961313366889954,
0.7656176090240479,
1.4234704971313477,
0.1930205076932907,
-0.0070295510813593864,
0.31539249420166016,
0.3105541169643402,
-0.09401656687259674,
0.4863206148147583,
1.1259859800338745,
0.6927568912506104,
0.5229384899139404,
0.6710816621780396,
-2.2752044200897217,
1.3129969835281372,
-0.9694892764091492,
0.29859983921051025,
1.3285800218582153,
-0.9988152980804443,
0.34115827083587646,
-1.8271573781967163,
0.0762648805975914,
0.5737796425819397,
-2.2114858627319336,
0.22441275417804718,
-1.2734380960464478,
-0.45444610714912415,
1.0088518857955933,
0.26966309547424316,
-1.2971397638320923,
0.2155420333147049,
-0.4118092954158783,
1.0780073404312134,
0.4620620906352997,
1.1763266324996948,
-1.709235668182373,
-0.0720851868391037,
-0.32417112588882446,
0.1512426733970642,
-1.2395567893981934,
-1.5723142623901367,
0.5685272812843323,
0.7142335176467896,
0.5233975648880005,
-0.21778316795825958,
1.0693920850753784,
-0.9202514886856079,
0.7456115484237671,
-0.9629016518592834,
-1.7476345300674438,
-1.4205931425094604,
-2.1479709148406982,
-2.3160197734832764,
0.7559081315994263,
-0.49710360169410706,
-0.3995891213417053,
1.981927752494812,
-1.0081366300582886,
-1.839425802230835,
1.0344682931900024,
0.35968217253685,
0.014736594632267952,
2.301412582397461,
0.279266893863678,
-0.68574059009552,
0.3361714482307434,
-0.75692218542099,
0.7898467183113098,
-0.3602423369884491,
1.425622820854187,
0.4481304883956909,
-1.1121195554733276,
1.616881012916565,
-0.33804383873939514,
0.578000545501709,
-0.7402157783508301,
-0.4857402741909027,
-0.7360155582427979,
0.3374495208263397,
1.9138832092285156,
-0.33079004287719727,
1.5788030624389648,
-0.4327550530433655,
-1.6174997091293335,
-1.6643295288085938,
0.7793062925338745,
0.5379727482795715,
-0.7962303757667542,
0.13593125343322754,
-0.42500901222229004,
0.17515259981155396,
-0.04851759970188141,
1.1735724210739136,
1.247221827507019,
0.7269341945648193,
-0.3440476357936859,
-0.8310834765434265,
0.2039031684398651,
-0.01132997963577509,
-0.7048750519752502,
-1.7979623079299927,
-0.4291897118091583,
0.22761204838752747,
0.6241229772567749,
-1.1639527082443237,
1.8568506240844727,
0.8067722916603088,
1.9710439443588257,
1.0302284955978394,
-0.391961932182312,
1.553713321685791,
0.012106988579034805,
1.8247755765914917,
-0.4384605288505554,
0.6693555116653442,
-0.3363232910633087,
-1.1454225778579712,
0.8642915487289429,
-0.3490065336227417,
-2.0067880153656006,
-0.7935377359390259,
-0.7823716998100281,
-0.1881980448961258,
-0.6797664761543274,
0.8891320824623108,
-0.2781524956226349,
-1.3741321563720703,
0.15245173871517181,
-0.654504120349884,
0.11900034546852112,
-1.2357629537582397,
0.2245299369096756,
0.7578162550926208,
-0.7224668860435486,
0.08394146710634232,
-0.2790903151035309,
-1.2903504371643066,
-0.437239408493042,
0.30574876070022583,
1.889011025428772,
-0.7158492207527161,
0.8652461171150208,
1.0631169080734253,
-0.7230772376060486,
0.023876914754509926,
0.27132079005241394,
-0.30985724925994873,
0.8032407164573669,
-1.1025069952011108,
-0.3201238512992859,
1.2024368047714233,
-0.18422463536262512,
-0.6581018567085266,
1.4013103246688843,
0.7966538071632385,
-1.0433423519134521,
-0.2219877392053604,
-0.17182916402816772,
-0.8343247771263123,
0.04244779050350189,
-1.5894999504089355,
-0.06940272450447083,
0.42897242307662964,
-1.5062544345855713,
-0.45670658349990845,
-0.25298380851745605,
1.3501423597335815,
-0.2369333952665329,
1.4131627082824707,
-0.20997118949890137,
-0.18641529977321625,
-0.36167651414871216,
-0.38677430152893066,
0.144126757979393,
-0.20098088681697845,
-0.777983546257019,
0.25515082478523254,
-0.7719014883041382,
0.4253777265548706,
1.4136959314346313,
0.29224222898483276,
-0.02487054467201233,
0.5690814256668091,
1.1689927577972412,
0.31793326139450073,
0.027840664610266685,
-0.8723511099815369,
-1.5285859107971191,
1.9959235191345215,
-1.436044454574585,
1.9195811748504639,
0.8066878914833069,
0.02138558030128479,
-1.7742174863815308,
-1.8495999574661255,
1.4658151865005493,
1.1502585411071777,
2.292747974395752,
0.6470199823379517,
0.42162036895751953,
-0.8183056116104126,
-0.6263409852981567,
0.35422948002815247,
-1.0182433128356934,
-0.7581203579902649,
0.1727055013179779,
2.4075396060943604,
1.7578953504562378,
-0.5639404654502869,
-0.3056928217411041,
-0.9737831354141235,
1.332552433013916,
-0.23333562910556793,
0.1757814735174179,
2.0601773262023926,
-0.278248131275177,
-0.9887048602104187,
1.2305238246917725,
-2.413775682449341,
0.18443718552589417,
2.0049047470092773,
0.20544934272766113,
0.11387068033218384,
-1.4836432933807373,
-0.6357063055038452,
-0.2047172337770462,
-0.46445736289024353,
-1.2197856903076172,
0.5821561217308044,
-0.16470053791999817,
-0.8168953657150269,
-1.494972586631775,
0.1778360903263092,
-1.0932228565216064,
-1.6155372858047485,
0.2096520960330963,
1.997563362121582,
1.8819005489349365,
-0.7451443076133728,
1.514461636543274,
-0.3839922845363617,
0.15429092943668365,
1.340459942817688,
1.2383064031600952,
3.153482675552368,
1.7765051126480103,
-1.264889121055603,
0.7690891623497009,
-0.14746695756912231,
-0.5647163391113281,
1.1662859916687012,
-1.1233024597167969,
1.1919879913330078,
-0.29088059067726135,
-1.1565921306610107,
-1.3116610050201416,
0.8725954294204712,
0.5318166613578796,
0.07443434000015259,
-0.45522767305374146,
1.287528395652771,
0.20947711169719696,
1.3028632402420044,
0.6232222318649292,
-0.42317456007003784,
0.6463133096694946,
-0.3573034703731537,
-0.4640522003173828,
1.5250595808029175,
0.2761886417865753,
-1.3517632484436035,
-2.285632848739624,
-0.1792115420103073,
-0.8835558295249939,
0.006785107776522636,
-0.5912573337554932,
-1.0113248825073242,
1.631809115409851,
0.3955596089363098,
-1.2551578283309937,
-0.2230086624622345,
-0.2841191291809082,
-0.615494966506958,
2.628208637237549,
-1.3325062990188599,
-0.26332977414131165,
-1.0292555093765259,
-0.5318965315818787,
1.6752010583877563,
-1.1279808282852173,
-0.19338823854923248,
-1.0552139282226562,
-0.5372337698936462,
-1.3332289457321167,
-0.5705739855766296,
0.038807258009910583,
-0.8183577060699463,
0.7878008484840393,
0.0851791575551033,
-1.1956833600997925,
-0.33049893379211426,
-0.8838948011398315,
0.9123914837837219,
-0.19080589711666107,
0.21614012122154236,
1.856562852859497,
0.4935589134693146,
-0.4266212284564972,
0.758425235748291,
1.0902113914489746,
0.5641546249389648,
-0.6406642198562622,
0.25919273495674133,
-0.6439034938812256,
0.310907781124115,
-1.4066178798675537,
0.241586834192276,
-2.843707323074341,
0.5964229702949524,
-0.0554681196808815,
-0.014700466766953468,
0.0405682697892189,
-1.3834058046340942,
1.0748132467269897,
2.635373592376709,
-1.2149240970611572,
0.44388604164123535,
0.37625962495803833,
1.2260761260986328,
-1.59632408618927,
0.2721741199493408,
-0.44298258423805237,
2.1476311683654785,
0.1850328892469406,
1.2830628156661987,
-0.45065614581108093,
-2.1665828227996826,
0.5636835098266602,
-1.2838596105575562,
-1.2238909006118774,
0.858081042766571,
-0.8438842296600342,
0.01749172993004322,
-1.403365135192871,
-0.20756429433822632,
-0.8486943244934082,
-1.2608412504196167,
0.8316084146499634,
0.0773550346493721,
0.3981286585330963,
-0.6433756947517395,
0.40009501576423645,
-2.0519297122955322,
-1.4032437801361084,
-0.18460869789123535,
-1.01119863986969,
0.4110924303531647,
-0.3084290325641632,
0.6926157474517822,
-0.09964550286531448,
0.012658877298235893,
0.2963600754737854,
1.4248970746994019,
3.3868653774261475,
0.21272724866867065,
0.3192243278026581,
-0.15864421427249908,
-0.887208878993988,
1.5020759105682373,
0.8372815847396851,
-0.1364978849887848,
-0.5585002303123474,
-1.0415493249893188,
1.2084773778915405,
1.9823521375656128,
1.1237138509750366,
0.0014960430562496185,
-0.8460355997085571,
-0.8364681601524353,
0.01253071241080761,
0.1360252946615219,
0.40325289964675903,
0.8265635371208191,
0.11822301149368286,
0.13017864525318146,
1.2565709352493286,
1.1712260246276855,
-0.46111032366752625,
0.5480024814605713,
-0.8541605472564697,
-0.41671234369277954,
0.4900214970111847,
0.27814778685569763,
0.025926267728209496,
0.37813568115234375,
-1.120745062828064,
-0.24470721185207367,
-0.38409098982810974,
-0.8829827308654785,
-0.7755035758018494,
-0.4616950750350952,
-0.3350989818572998,
1.6249991655349731,
0.012525646016001701,
-0.5485461950302124,
0.03711459040641785,
-0.7450805306434631,
-0.04247692972421646,
-1.00934898853302,
0.21618293225765228,
-0.1763475239276886,
-0.15086594223976135,
-0.05266673117876053,
1.6809101104736328,
-1.0075256824493408,
-2.021867275238037,
0.1930616796016693,
0.27155065536499023,
-0.38714006543159485,
0.17177267372608185,
1.7141481637954712,
0.49690189957618713,
1.3925672769546509,
1.3786579370498657,
1.0268526077270508,
-0.7352206110954285,
-1.2743312120437622,
0.6321068406105042,
0.9075637459754944,
-1.3788175582885742,
0.7591270208358765,
-0.019113756716251373,
-0.4655691683292389,
0.583775520324707,
1.2733509540557861,
0.4664948880672455,
-1.9760602712631226,
0.7703549861907959,
-0.8740177154541016,
0.6759692430496216,
0.6936550140380859,
0.7736251354217529,
0.33920300006866455,
0.8107959628105164,
-1.1764975786209106,
-1.1952781677246094,
-0.7266337871551514,
-0.7085732817649841,
1.9310063123703003,
-0.18518604338169098,
0.5685396194458008,
-0.11880864948034286,
-1.362791895866394,
-0.19729435443878174,
0.8122340440750122,
0.38932061195373535,
-0.5511839985847473,
0.7701503038406372,
-0.6456499099731445,
-1.0022825002670288,
-1.3165279626846313,
-0.5033130645751953,
-1.069716453552246,
-0.986349880695343,
1.0301368236541748,
0.8806552886962891,
0.3846598267555237,
1.9180361032485962,
0.5678889751434326,
0.2822500765323639,
-2.6704835891723633,
0.9133981466293335,
0.34478163719177246,
-0.038047850131988525,
0.8710604310035706,
0.370517760515213,
1.075543999671936,
0.02539817802608013,
0.6143201589584351,
-2.432208299636841,
2.2814667224884033,
-0.2406332939863205,
0.624902606010437,
0.0236093420535326,
-0.3148534297943115,
1.1362489461898804,
0.4829426407814026,
0.6279218792915344,
-1.147995114326477,
0.7257274389266968,
-0.5811914205551147,
1.163894534111023,
0.8603065013885498,
-0.9841577410697937,
0.04495491087436676,
1.348211646080017,
0.4542437195777893,
-0.4787760078907013,
-0.9502743482589722,
-0.9667655229568481,
0.936500608921051,
1.6829261779785156,
-0.08069932460784912,
0.04850208759307861,
0.8688697814941406,
0.5402616262435913,
-1.3552604913711548,
0.1113070696592331,
-0.7403327226638794,
-0.7904442548751831,
1.7351973056793213,
1.9951934814453125,
-0.2112147957086563,
-0.2627061605453491,
-0.8311526775360107,
-1.1821545362472534,
0.7398616075515747,
0.055305369198322296,
0.04552667587995529,
0.6677564382553101,
-0.6774041652679443,
1.1539697647094727,
0.7983282208442688,
0.9220698475837708,
0.13772419095039368,
0.3232520818710327,
0.39381667971611023,
-0.3417001962661743,
-1.1392240524291992,
-0.22955350577831268,
-1.1191762685775757,
-2.6583633422851562,
0.4404362440109253,
-0.2409180849790573,
-1.3482165336608887,
0.006170426495373249,
-0.985283613204956,
0.8500533699989319,
-0.6280864477157593,
-1.101115345954895,
-1.5007926225662231,
0.32637032866477966,
-0.06194683909416199,
0.8964874744415283,
-1.690400242805481,
-0.04873032867908478,
1.1638325452804565,
0.9137007594108582,
-0.7267865538597107,
0.8969413638114929,
0.29198649525642395,
0.9916191101074219,
0.9783600568771362,
-0.29133477807044983,
0.5656329393386841,
0.03855758160352707,
-1.3982012271881104,
0.40145909786224365,
1.182870626449585,
0.15021677315235138,
1.484312653541565,
-0.5383380651473999,
0.05400963872671127,
0.4720083475112915,
-0.5471137166023254,
-0.46469250321388245,
-0.5240048766136169,
0.6844906806945801,
0.11551167070865631,
-0.9757557511329651,
0.003635610453784466,
-0.0606711283326149,
-0.21792714297771454,
0.20945994555950165,
-1.5446131229400635,
-0.18602238595485687,
-0.2819882333278656,
-0.5545186400413513,
-1.1530207395553589,
-0.031184999272227287,
1.3174415826797485,
-0.7036279439926147,
-0.28467637300491333,
0.504045844078064,
0.2942543625831604,
0.44238564372062683,
0.5330825448036194,
-0.7479618787765503,
-0.3473202884197235,
-0.21597716212272644,
-0.3991127610206604,
0.3322593569755554,
1.389480710029602,
-0.10357119143009186,
-1.005301833152771,
0.6653110980987549,
-0.38499853014945984,
0.011574825271964073,
1.9800416231155396,
0.15456600487232208,
-0.8664931058883667,
0.23003101348876953,
-0.7131205201148987,
1.8981696367263794,
1.725574254989624,
1.3378689289093018,
-0.0887090340256691,
-0.9895275235176086,
0.6401358246803284,
-0.29584529995918274,
-0.3366721272468567,
0.9976391792297363,
0.3632030785083771,
-0.2050817310810089,
-1.4161394834518433,
0.6714268326759338,
1.4184125661849976,
-0.9100324511528015,
-0.8226827383041382,
0.09455745667219162,
-0.8631883263587952,
1.1682846546173096,
0.6693475842475891,
0.3870235085487366,
0.22196532785892487,
1.5526801347732544,
0.6961191296577454,
-0.3355320394039154,
0.566417932510376,
0.4154284596443176,
-0.1525220274925232,
-2.1669604778289795,
-1.115314245223999,
0.3270505964756012,
-0.4567945897579193,
-1.6157690286636353,
1.3303152322769165,
-1.1880228519439697,
-0.9812930226325989,
0.5232577323913574,
0.08546818792819977,
1.499929666519165,
0.3746436834335327,
1.6196238994598389,
2.104326009750366,
0.801490306854248,
0.30245351791381836,
1.2710086107254028,
-0.1563219428062439,
-0.48967444896698,
1.7903469800949097,
-0.5236652493476868,
0.43623045086860657,
1.0401867628097534,
-0.33474645018577576,
-1.0918684005737305,
-0.8018655776977539,
-1.2613657712936401,
-0.7324733734130859,
1.2072452306747437,
0.09695020318031311,
-1.135969638824463,
0.3331785202026367,
1.5821306705474854,
0.010715335607528687,
-0.28010809421539307,
0.6999152898788452,
0.5137312412261963,
-0.799705982208252,
0.008451251313090324,
-0.8034882545471191,
0.5284320116043091,
-0.16049112379550934,
-0.2931317090988159,
0.37520596385002136,
0.5334024429321289,
1.3306206464767456,
0.0006167227402329445,
0.08041777461767197,
1.1384515762329102,
-1.387563943862915,
1.5011744499206543,
-0.6074495911598206,
0.28554707765579224,
-2.421701192855835,
1.3977941274642944,
-0.7741495966911316,
1.910010814666748,
-2.5539956092834473,
0.38084733486175537,
-0.5343380570411682,
-0.45249152183532715,
0.32047683000564575,
-0.32948338985443115,
0.09831176698207855,
-0.17297998070716858,
-1.119888186454773,
-0.07018157094717026,
-0.7321910262107849,
0.5552585124969482,
1.095151424407959,
1.3794798851013184,
-1.0874121189117432,
-0.2536659240722656,
-1.787420630455017,
-0.13448373973369598,
-0.6519710421562195,
0.39587438106536865,
-1.9388055801391602,
-0.20475423336029053,
-1.9716349840164185,
-2.346168041229248,
-1.2591997385025024,
-0.7866330146789551,
1.0605653524398804,
0.08019059896469116,
-0.8646988272666931,
1.196305751800537,
-0.3574100434780121,
-1.855601191520691,
1.0574606657028198,
-2.119978427886963
] |
https://github.com/huggingface/datasets/issues/5147 | Allow ignoring kwargs inside fn_kwargs during dataset.map's fingerprinting | Hi @lhoestq! Thanks for your response.
A `Pool` shouldn't be instantiated within the function, because there's a huge overhead in doing so. The main idea is that the same `Pool` should be used across all function calls. Parallel `map` is not helpful/desired in that specific scenario, because the heavy parallel computation is done by another lib (`pyctcdecode`, called within `transformer`'s model inference code).
But yes, it makes sense to be able to leverage parallel processing by just doing `num_proc>1` when possible.
Your decorator suggestions seems like a pretty clean API to me. I didn't find a `datasets.hashing` module though. Would it be created for this specific purpose? Any downsides in just using `datasets.fingerprint`?
And would `datasets.hashing.register` just add some metadata to `func` in your approach (so it could be inspected from `fingerprint_transform`)?
And looking to the `datasets.Dataset` API, `.filter` would also benefited from this. | ### Feature request
`dataset.map` accepts a `fn_kwargs` that is passed to `fn`. Currently, the whole `fn_kwargs` is used by `fingerprint_transform` to calculate the new fingerprint.
I'd like to be able to inform `fingerprint_transform` which `fn_kwargs` shoud/shouldn't be taken into account during hashing.
Of course, users should be aware to properly use this new feature, just like the internal usages of `fingerprint_transform` [does](https://github.com/huggingface/datasets/blob/2699593b33ee63d17aad2a2bfddedd38a8df57b8/src/datasets/arrow_dataset.py#L2700).
### Motivation
This is originally motivated by https://github.com/huggingface/transformers/pull/18351#issuecomment-1263588680.
Nonetheless, consider a more general processing function that accepts a kwarg that does not influence it's output:
```python
def fn(example, verbose=False):
...
```
Then `dataset.map(fn, verbose=True)` would not benefit from dataset caching.
I'm not sure if other methods in the `Dataset` API could benefit from this feature.
### Your contribution
Based on `fingerprint_transform `'s `wrapper` function [here](https://github.com/huggingface/datasets/blob/c59cc34fcd2a369d27b77cc678017f5976a926a9/src/datasets/fingerprint.py#L443), it seems to me that it should be possible to make `.map`/`._map_single` accept something like `fn_use_fingerprint_kwargs`/`fn_ignore_fingerprint_kwargs` (probably another arg name). This would then be used by `fingerprint_transform.wrapper` to better/more flexibly hash the transformation.
I could contribute with a PR if this feature and approach look good to you. | 463 | 144 | Allow ignoring kwargs inside fn_kwargs during dataset.map's fingerprinting
### Feature request
`dataset.map` accepts a `fn_kwargs` that is passed to `fn`. Currently, the whole `fn_kwargs` is used by `fingerprint_transform` to calculate the new fingerprint.
I'd like to be able to inform `fingerprint_transform` which `fn_kwargs` shoud/shouldn't be taken into account during hashing.
Of course, users should be aware to properly use this new feature, just like the internal usages of `fingerprint_transform` [does](https://github.com/huggingface/datasets/blob/2699593b33ee63d17aad2a2bfddedd38a8df57b8/src/datasets/arrow_dataset.py#L2700).
### Motivation
This is originally motivated by https://github.com/huggingface/transformers/pull/18351#issuecomment-1263588680.
Nonetheless, consider a more general processing function that accepts a kwarg that does not influence it's output:
```python
def fn(example, verbose=False):
...
```
Then `dataset.map(fn, verbose=True)` would not benefit from dataset caching.
I'm not sure if other methods in the `Dataset` API could benefit from this feature.
### Your contribution
Based on `fingerprint_transform `'s `wrapper` function [here](https://github.com/huggingface/datasets/blob/c59cc34fcd2a369d27b77cc678017f5976a926a9/src/datasets/fingerprint.py#L443), it seems to me that it should be possible to make `.map`/`._map_single` accept something like `fn_use_fingerprint_kwargs`/`fn_ignore_fingerprint_kwargs` (probably another arg name). This would then be used by `fingerprint_transform.wrapper` to better/more flexibly hash the transformation.
I could contribute with a PR if this feature and approach look good to you.
Hi @lhoestq! Thanks for your response.
A `Pool` shouldn't be instantiated within the function, because there's a huge overhead in doing so. The main idea is that the same `Pool` should be used across all function calls. Parallel `map` is not helpful/desired in that specific scenario, because the heavy parallel computation is done by another lib (`pyctcdecode`, called within `transformer`'s model inference code).
But yes, it makes sense to be able to leverage parallel processing by just doing `num_proc>1` when possible.
Your decorator suggestions seems like a pretty clean API to me. I didn't find a `datasets.hashing` module though. Would it be created for this specific purpose? Any downsides in just using `datasets.fingerprint`?
And would `datasets.hashing.register` just add some metadata to `func` in your approach (so it could be inspected from `fingerprint_transform`)?
And looking to the `datasets.Dataset` API, `.filter` would also benefited from this. | [
-1.098184585571289,
-0.8798347115516663,
-0.7810023427009583,
1.4480595588684082,
-0.1625768095254898,
-1.2901285886764526,
0.2110854983329773,
-1.0636675357818604,
1.713141679763794,
-0.739149272441864,
0.3497753441333771,
-1.6711081266403198,
-0.05124442279338837,
-0.714580237865448,
-0.7879689931869507,
-0.8206445574760437,
-0.38425734639167786,
-0.7771989107131958,
1.0694185495376587,
2.4345102310180664,
1.2363356351852417,
-1.3286415338516235,
2.6759071350097656,
0.6566047668457031,
-0.2790210545063019,
-0.9905437231063843,
0.5179852843284607,
-0.011118292808532715,
-1.2023099660873413,
-0.4974089562892914,
-0.8779803514480591,
-0.052811555564403534,
-0.5776880979537964,
-0.5800442695617676,
0.07231379300355911,
0.5125373601913452,
-0.27724751830101013,
-0.4900496006011963,
-0.5420058369636536,
-0.740507185459137,
0.43801364302635193,
-0.3018995523452759,
0.9187699556350708,
-0.3140721023082733,
1.8898617029190063,
-0.5704596042633057,
0.43961313366889954,
0.7656176090240479,
1.4234704971313477,
0.1930205076932907,
-0.0070295510813593864,
0.31539249420166016,
0.3105541169643402,
-0.09401656687259674,
0.4863206148147583,
1.1259859800338745,
0.6927568912506104,
0.5229384899139404,
0.6710816621780396,
-2.2752044200897217,
1.3129969835281372,
-0.9694892764091492,
0.29859983921051025,
1.3285800218582153,
-0.9988152980804443,
0.34115827083587646,
-1.8271573781967163,
0.0762648805975914,
0.5737796425819397,
-2.2114858627319336,
0.22441275417804718,
-1.2734380960464478,
-0.45444610714912415,
1.0088518857955933,
0.26966309547424316,
-1.2971397638320923,
0.2155420333147049,
-0.4118092954158783,
1.0780073404312134,
0.4620620906352997,
1.1763266324996948,
-1.709235668182373,
-0.0720851868391037,
-0.32417112588882446,
0.1512426733970642,
-1.2395567893981934,
-1.5723142623901367,
0.5685272812843323,
0.7142335176467896,
0.5233975648880005,
-0.21778316795825958,
1.0693920850753784,
-0.9202514886856079,
0.7456115484237671,
-0.9629016518592834,
-1.7476345300674438,
-1.4205931425094604,
-2.1479709148406982,
-2.3160197734832764,
0.7559081315994263,
-0.49710360169410706,
-0.3995891213417053,
1.981927752494812,
-1.0081366300582886,
-1.839425802230835,
1.0344682931900024,
0.35968217253685,
0.014736594632267952,
2.301412582397461,
0.279266893863678,
-0.68574059009552,
0.3361714482307434,
-0.75692218542099,
0.7898467183113098,
-0.3602423369884491,
1.425622820854187,
0.4481304883956909,
-1.1121195554733276,
1.616881012916565,
-0.33804383873939514,
0.578000545501709,
-0.7402157783508301,
-0.4857402741909027,
-0.7360155582427979,
0.3374495208263397,
1.9138832092285156,
-0.33079004287719727,
1.5788030624389648,
-0.4327550530433655,
-1.6174997091293335,
-1.6643295288085938,
0.7793062925338745,
0.5379727482795715,
-0.7962303757667542,
0.13593125343322754,
-0.42500901222229004,
0.17515259981155396,
-0.04851759970188141,
1.1735724210739136,
1.247221827507019,
0.7269341945648193,
-0.3440476357936859,
-0.8310834765434265,
0.2039031684398651,
-0.01132997963577509,
-0.7048750519752502,
-1.7979623079299927,
-0.4291897118091583,
0.22761204838752747,
0.6241229772567749,
-1.1639527082443237,
1.8568506240844727,
0.8067722916603088,
1.9710439443588257,
1.0302284955978394,
-0.391961932182312,
1.553713321685791,
0.012106988579034805,
1.8247755765914917,
-0.4384605288505554,
0.6693555116653442,
-0.3363232910633087,
-1.1454225778579712,
0.8642915487289429,
-0.3490065336227417,
-2.0067880153656006,
-0.7935377359390259,
-0.7823716998100281,
-0.1881980448961258,
-0.6797664761543274,
0.8891320824623108,
-0.2781524956226349,
-1.3741321563720703,
0.15245173871517181,
-0.654504120349884,
0.11900034546852112,
-1.2357629537582397,
0.2245299369096756,
0.7578162550926208,
-0.7224668860435486,
0.08394146710634232,
-0.2790903151035309,
-1.2903504371643066,
-0.437239408493042,
0.30574876070022583,
1.889011025428772,
-0.7158492207527161,
0.8652461171150208,
1.0631169080734253,
-0.7230772376060486,
0.023876914754509926,
0.27132079005241394,
-0.30985724925994873,
0.8032407164573669,
-1.1025069952011108,
-0.3201238512992859,
1.2024368047714233,
-0.18422463536262512,
-0.6581018567085266,
1.4013103246688843,
0.7966538071632385,
-1.0433423519134521,
-0.2219877392053604,
-0.17182916402816772,
-0.8343247771263123,
0.04244779050350189,
-1.5894999504089355,
-0.06940272450447083,
0.42897242307662964,
-1.5062544345855713,
-0.45670658349990845,
-0.25298380851745605,
1.3501423597335815,
-0.2369333952665329,
1.4131627082824707,
-0.20997118949890137,
-0.18641529977321625,
-0.36167651414871216,
-0.38677430152893066,
0.144126757979393,
-0.20098088681697845,
-0.777983546257019,
0.25515082478523254,
-0.7719014883041382,
0.4253777265548706,
1.4136959314346313,
0.29224222898483276,
-0.02487054467201233,
0.5690814256668091,
1.1689927577972412,
0.31793326139450073,
0.027840664610266685,
-0.8723511099815369,
-1.5285859107971191,
1.9959235191345215,
-1.436044454574585,
1.9195811748504639,
0.8066878914833069,
0.02138558030128479,
-1.7742174863815308,
-1.8495999574661255,
1.4658151865005493,
1.1502585411071777,
2.292747974395752,
0.6470199823379517,
0.42162036895751953,
-0.8183056116104126,
-0.6263409852981567,
0.35422948002815247,
-1.0182433128356934,
-0.7581203579902649,
0.1727055013179779,
2.4075396060943604,
1.7578953504562378,
-0.5639404654502869,
-0.3056928217411041,
-0.9737831354141235,
1.332552433013916,
-0.23333562910556793,
0.1757814735174179,
2.0601773262023926,
-0.278248131275177,
-0.9887048602104187,
1.2305238246917725,
-2.413775682449341,
0.18443718552589417,
2.0049047470092773,
0.20544934272766113,
0.11387068033218384,
-1.4836432933807373,
-0.6357063055038452,
-0.2047172337770462,
-0.46445736289024353,
-1.2197856903076172,
0.5821561217308044,
-0.16470053791999817,
-0.8168953657150269,
-1.494972586631775,
0.1778360903263092,
-1.0932228565216064,
-1.6155372858047485,
0.2096520960330963,
1.997563362121582,
1.8819005489349365,
-0.7451443076133728,
1.514461636543274,
-0.3839922845363617,
0.15429092943668365,
1.340459942817688,
1.2383064031600952,
3.153482675552368,
1.7765051126480103,
-1.264889121055603,
0.7690891623497009,
-0.14746695756912231,
-0.5647163391113281,
1.1662859916687012,
-1.1233024597167969,
1.1919879913330078,
-0.29088059067726135,
-1.1565921306610107,
-1.3116610050201416,
0.8725954294204712,
0.5318166613578796,
0.07443434000015259,
-0.45522767305374146,
1.287528395652771,
0.20947711169719696,
1.3028632402420044,
0.6232222318649292,
-0.42317456007003784,
0.6463133096694946,
-0.3573034703731537,
-0.4640522003173828,
1.5250595808029175,
0.2761886417865753,
-1.3517632484436035,
-2.285632848739624,
-0.1792115420103073,
-0.8835558295249939,
0.006785107776522636,
-0.5912573337554932,
-1.0113248825073242,
1.631809115409851,
0.3955596089363098,
-1.2551578283309937,
-0.2230086624622345,
-0.2841191291809082,
-0.615494966506958,
2.628208637237549,
-1.3325062990188599,
-0.26332977414131165,
-1.0292555093765259,
-0.5318965315818787,
1.6752010583877563,
-1.1279808282852173,
-0.19338823854923248,
-1.0552139282226562,
-0.5372337698936462,
-1.3332289457321167,
-0.5705739855766296,
0.038807258009910583,
-0.8183577060699463,
0.7878008484840393,
0.0851791575551033,
-1.1956833600997925,
-0.33049893379211426,
-0.8838948011398315,
0.9123914837837219,
-0.19080589711666107,
0.21614012122154236,
1.856562852859497,
0.4935589134693146,
-0.4266212284564972,
0.758425235748291,
1.0902113914489746,
0.5641546249389648,
-0.6406642198562622,
0.25919273495674133,
-0.6439034938812256,
0.310907781124115,
-1.4066178798675537,
0.241586834192276,
-2.843707323074341,
0.5964229702949524,
-0.0554681196808815,
-0.014700466766953468,
0.0405682697892189,
-1.3834058046340942,
1.0748132467269897,
2.635373592376709,
-1.2149240970611572,
0.44388604164123535,
0.37625962495803833,
1.2260761260986328,
-1.59632408618927,
0.2721741199493408,
-0.44298258423805237,
2.1476311683654785,
0.1850328892469406,
1.2830628156661987,
-0.45065614581108093,
-2.1665828227996826,
0.5636835098266602,
-1.2838596105575562,
-1.2238909006118774,
0.858081042766571,
-0.8438842296600342,
0.01749172993004322,
-1.403365135192871,
-0.20756429433822632,
-0.8486943244934082,
-1.2608412504196167,
0.8316084146499634,
0.0773550346493721,
0.3981286585330963,
-0.6433756947517395,
0.40009501576423645,
-2.0519297122955322,
-1.4032437801361084,
-0.18460869789123535,
-1.01119863986969,
0.4110924303531647,
-0.3084290325641632,
0.6926157474517822,
-0.09964550286531448,
0.012658877298235893,
0.2963600754737854,
1.4248970746994019,
3.3868653774261475,
0.21272724866867065,
0.3192243278026581,
-0.15864421427249908,
-0.887208878993988,
1.5020759105682373,
0.8372815847396851,
-0.1364978849887848,
-0.5585002303123474,
-1.0415493249893188,
1.2084773778915405,
1.9823521375656128,
1.1237138509750366,
0.0014960430562496185,
-0.8460355997085571,
-0.8364681601524353,
0.01253071241080761,
0.1360252946615219,
0.40325289964675903,
0.8265635371208191,
0.11822301149368286,
0.13017864525318146,
1.2565709352493286,
1.1712260246276855,
-0.46111032366752625,
0.5480024814605713,
-0.8541605472564697,
-0.41671234369277954,
0.4900214970111847,
0.27814778685569763,
0.025926267728209496,
0.37813568115234375,
-1.120745062828064,
-0.24470721185207367,
-0.38409098982810974,
-0.8829827308654785,
-0.7755035758018494,
-0.4616950750350952,
-0.3350989818572998,
1.6249991655349731,
0.012525646016001701,
-0.5485461950302124,
0.03711459040641785,
-0.7450805306434631,
-0.04247692972421646,
-1.00934898853302,
0.21618293225765228,
-0.1763475239276886,
-0.15086594223976135,
-0.05266673117876053,
1.6809101104736328,
-1.0075256824493408,
-2.021867275238037,
0.1930616796016693,
0.27155065536499023,
-0.38714006543159485,
0.17177267372608185,
1.7141481637954712,
0.49690189957618713,
1.3925672769546509,
1.3786579370498657,
1.0268526077270508,
-0.7352206110954285,
-1.2743312120437622,
0.6321068406105042,
0.9075637459754944,
-1.3788175582885742,
0.7591270208358765,
-0.019113756716251373,
-0.4655691683292389,
0.583775520324707,
1.2733509540557861,
0.4664948880672455,
-1.9760602712631226,
0.7703549861907959,
-0.8740177154541016,
0.6759692430496216,
0.6936550140380859,
0.7736251354217529,
0.33920300006866455,
0.8107959628105164,
-1.1764975786209106,
-1.1952781677246094,
-0.7266337871551514,
-0.7085732817649841,
1.9310063123703003,
-0.18518604338169098,
0.5685396194458008,
-0.11880864948034286,
-1.362791895866394,
-0.19729435443878174,
0.8122340440750122,
0.38932061195373535,
-0.5511839985847473,
0.7701503038406372,
-0.6456499099731445,
-1.0022825002670288,
-1.3165279626846313,
-0.5033130645751953,
-1.069716453552246,
-0.986349880695343,
1.0301368236541748,
0.8806552886962891,
0.3846598267555237,
1.9180361032485962,
0.5678889751434326,
0.2822500765323639,
-2.6704835891723633,
0.9133981466293335,
0.34478163719177246,
-0.038047850131988525,
0.8710604310035706,
0.370517760515213,
1.075543999671936,
0.02539817802608013,
0.6143201589584351,
-2.432208299636841,
2.2814667224884033,
-0.2406332939863205,
0.624902606010437,
0.0236093420535326,
-0.3148534297943115,
1.1362489461898804,
0.4829426407814026,
0.6279218792915344,
-1.147995114326477,
0.7257274389266968,
-0.5811914205551147,
1.163894534111023,
0.8603065013885498,
-0.9841577410697937,
0.04495491087436676,
1.348211646080017,
0.4542437195777893,
-0.4787760078907013,
-0.9502743482589722,
-0.9667655229568481,
0.936500608921051,
1.6829261779785156,
-0.08069932460784912,
0.04850208759307861,
0.8688697814941406,
0.5402616262435913,
-1.3552604913711548,
0.1113070696592331,
-0.7403327226638794,
-0.7904442548751831,
1.7351973056793213,
1.9951934814453125,
-0.2112147957086563,
-0.2627061605453491,
-0.8311526775360107,
-1.1821545362472534,
0.7398616075515747,
0.055305369198322296,
0.04552667587995529,
0.6677564382553101,
-0.6774041652679443,
1.1539697647094727,
0.7983282208442688,
0.9220698475837708,
0.13772419095039368,
0.3232520818710327,
0.39381667971611023,
-0.3417001962661743,
-1.1392240524291992,
-0.22955350577831268,
-1.1191762685775757,
-2.6583633422851562,
0.4404362440109253,
-0.2409180849790573,
-1.3482165336608887,
0.006170426495373249,
-0.985283613204956,
0.8500533699989319,
-0.6280864477157593,
-1.101115345954895,
-1.5007926225662231,
0.32637032866477966,
-0.06194683909416199,
0.8964874744415283,
-1.690400242805481,
-0.04873032867908478,
1.1638325452804565,
0.9137007594108582,
-0.7267865538597107,
0.8969413638114929,
0.29198649525642395,
0.9916191101074219,
0.9783600568771362,
-0.29133477807044983,
0.5656329393386841,
0.03855758160352707,
-1.3982012271881104,
0.40145909786224365,
1.182870626449585,
0.15021677315235138,
1.484312653541565,
-0.5383380651473999,
0.05400963872671127,
0.4720083475112915,
-0.5471137166023254,
-0.46469250321388245,
-0.5240048766136169,
0.6844906806945801,
0.11551167070865631,
-0.9757557511329651,
0.003635610453784466,
-0.0606711283326149,
-0.21792714297771454,
0.20945994555950165,
-1.5446131229400635,
-0.18602238595485687,
-0.2819882333278656,
-0.5545186400413513,
-1.1530207395553589,
-0.031184999272227287,
1.3174415826797485,
-0.7036279439926147,
-0.28467637300491333,
0.504045844078064,
0.2942543625831604,
0.44238564372062683,
0.5330825448036194,
-0.7479618787765503,
-0.3473202884197235,
-0.21597716212272644,
-0.3991127610206604,
0.3322593569755554,
1.389480710029602,
-0.10357119143009186,
-1.005301833152771,
0.6653110980987549,
-0.38499853014945984,
0.011574825271964073,
1.9800416231155396,
0.15456600487232208,
-0.8664931058883667,
0.23003101348876953,
-0.7131205201148987,
1.8981696367263794,
1.725574254989624,
1.3378689289093018,
-0.0887090340256691,
-0.9895275235176086,
0.6401358246803284,
-0.29584529995918274,
-0.3366721272468567,
0.9976391792297363,
0.3632030785083771,
-0.2050817310810089,
-1.4161394834518433,
0.6714268326759338,
1.4184125661849976,
-0.9100324511528015,
-0.8226827383041382,
0.09455745667219162,
-0.8631883263587952,
1.1682846546173096,
0.6693475842475891,
0.3870235085487366,
0.22196532785892487,
1.5526801347732544,
0.6961191296577454,
-0.3355320394039154,
0.566417932510376,
0.4154284596443176,
-0.1525220274925232,
-2.1669604778289795,
-1.115314245223999,
0.3270505964756012,
-0.4567945897579193,
-1.6157690286636353,
1.3303152322769165,
-1.1880228519439697,
-0.9812930226325989,
0.5232577323913574,
0.08546818792819977,
1.499929666519165,
0.3746436834335327,
1.6196238994598389,
2.104326009750366,
0.801490306854248,
0.30245351791381836,
1.2710086107254028,
-0.1563219428062439,
-0.48967444896698,
1.7903469800949097,
-0.5236652493476868,
0.43623045086860657,
1.0401867628097534,
-0.33474645018577576,
-1.0918684005737305,
-0.8018655776977539,
-1.2613657712936401,
-0.7324733734130859,
1.2072452306747437,
0.09695020318031311,
-1.135969638824463,
0.3331785202026367,
1.5821306705474854,
0.010715335607528687,
-0.28010809421539307,
0.6999152898788452,
0.5137312412261963,
-0.799705982208252,
0.008451251313090324,
-0.8034882545471191,
0.5284320116043091,
-0.16049112379550934,
-0.2931317090988159,
0.37520596385002136,
0.5334024429321289,
1.3306206464767456,
0.0006167227402329445,
0.08041777461767197,
1.1384515762329102,
-1.387563943862915,
1.5011744499206543,
-0.6074495911598206,
0.28554707765579224,
-2.421701192855835,
1.3977941274642944,
-0.7741495966911316,
1.910010814666748,
-2.5539956092834473,
0.38084733486175537,
-0.5343380570411682,
-0.45249152183532715,
0.32047683000564575,
-0.32948338985443115,
0.09831176698207855,
-0.17297998070716858,
-1.119888186454773,
-0.07018157094717026,
-0.7321910262107849,
0.5552585124969482,
1.095151424407959,
1.3794798851013184,
-1.0874121189117432,
-0.2536659240722656,
-1.787420630455017,
-0.13448373973369598,
-0.6519710421562195,
0.39587438106536865,
-1.9388055801391602,
-0.20475423336029053,
-1.9716349840164185,
-2.346168041229248,
-1.2591997385025024,
-0.7866330146789551,
1.0605653524398804,
0.08019059896469116,
-0.8646988272666931,
1.196305751800537,
-0.3574100434780121,
-1.855601191520691,
1.0574606657028198,
-2.119978427886963
] |
https://github.com/huggingface/datasets/issues/5147 | Allow ignoring kwargs inside fn_kwargs during dataset.map's fingerprinting | > Would it be created for this specific purpose? Any downsides in just using datasets.fingerprint?
This can also go in datasets.fingerprint indeed - but maybe datasets.hashing tells more about what the register function does (i.e. register this function to have a custom hashing) ?
> And would datasets.hashing.register just add some metadata to func in your approach (so it could be inspected from fingerprint_transform)?
Yup that's the idea :)
> And looking to the datasets.Dataset API, .filter would also benefited from this.
Indeed !
-----
If you would like to contribute this you can assign yourself to this issue by posting #self-assign
And of course if you have questions or if I can help, feel free to ping me ! | ### Feature request
`dataset.map` accepts a `fn_kwargs` that is passed to `fn`. Currently, the whole `fn_kwargs` is used by `fingerprint_transform` to calculate the new fingerprint.
I'd like to be able to inform `fingerprint_transform` which `fn_kwargs` shoud/shouldn't be taken into account during hashing.
Of course, users should be aware to properly use this new feature, just like the internal usages of `fingerprint_transform` [does](https://github.com/huggingface/datasets/blob/2699593b33ee63d17aad2a2bfddedd38a8df57b8/src/datasets/arrow_dataset.py#L2700).
### Motivation
This is originally motivated by https://github.com/huggingface/transformers/pull/18351#issuecomment-1263588680.
Nonetheless, consider a more general processing function that accepts a kwarg that does not influence it's output:
```python
def fn(example, verbose=False):
...
```
Then `dataset.map(fn, verbose=True)` would not benefit from dataset caching.
I'm not sure if other methods in the `Dataset` API could benefit from this feature.
### Your contribution
Based on `fingerprint_transform `'s `wrapper` function [here](https://github.com/huggingface/datasets/blob/c59cc34fcd2a369d27b77cc678017f5976a926a9/src/datasets/fingerprint.py#L443), it seems to me that it should be possible to make `.map`/`._map_single` accept something like `fn_use_fingerprint_kwargs`/`fn_ignore_fingerprint_kwargs` (probably another arg name). This would then be used by `fingerprint_transform.wrapper` to better/more flexibly hash the transformation.
I could contribute with a PR if this feature and approach look good to you. | 463 | 120 | Allow ignoring kwargs inside fn_kwargs during dataset.map's fingerprinting
### Feature request
`dataset.map` accepts a `fn_kwargs` that is passed to `fn`. Currently, the whole `fn_kwargs` is used by `fingerprint_transform` to calculate the new fingerprint.
I'd like to be able to inform `fingerprint_transform` which `fn_kwargs` shoud/shouldn't be taken into account during hashing.
Of course, users should be aware to properly use this new feature, just like the internal usages of `fingerprint_transform` [does](https://github.com/huggingface/datasets/blob/2699593b33ee63d17aad2a2bfddedd38a8df57b8/src/datasets/arrow_dataset.py#L2700).
### Motivation
This is originally motivated by https://github.com/huggingface/transformers/pull/18351#issuecomment-1263588680.
Nonetheless, consider a more general processing function that accepts a kwarg that does not influence it's output:
```python
def fn(example, verbose=False):
...
```
Then `dataset.map(fn, verbose=True)` would not benefit from dataset caching.
I'm not sure if other methods in the `Dataset` API could benefit from this feature.
### Your contribution
Based on `fingerprint_transform `'s `wrapper` function [here](https://github.com/huggingface/datasets/blob/c59cc34fcd2a369d27b77cc678017f5976a926a9/src/datasets/fingerprint.py#L443), it seems to me that it should be possible to make `.map`/`._map_single` accept something like `fn_use_fingerprint_kwargs`/`fn_ignore_fingerprint_kwargs` (probably another arg name). This would then be used by `fingerprint_transform.wrapper` to better/more flexibly hash the transformation.
I could contribute with a PR if this feature and approach look good to you.
> Would it be created for this specific purpose? Any downsides in just using datasets.fingerprint?
This can also go in datasets.fingerprint indeed - but maybe datasets.hashing tells more about what the register function does (i.e. register this function to have a custom hashing) ?
> And would datasets.hashing.register just add some metadata to func in your approach (so it could be inspected from fingerprint_transform)?
Yup that's the idea :)
> And looking to the datasets.Dataset API, .filter would also benefited from this.
Indeed !
-----
If you would like to contribute this you can assign yourself to this issue by posting #self-assign
And of course if you have questions or if I can help, feel free to ping me ! | [
-1.098184585571289,
-0.8798347115516663,
-0.7810023427009583,
1.4480595588684082,
-0.1625768095254898,
-1.2901285886764526,
0.2110854983329773,
-1.0636675357818604,
1.713141679763794,
-0.739149272441864,
0.3497753441333771,
-1.6711081266403198,
-0.05124442279338837,
-0.714580237865448,
-0.7879689931869507,
-0.8206445574760437,
-0.38425734639167786,
-0.7771989107131958,
1.0694185495376587,
2.4345102310180664,
1.2363356351852417,
-1.3286415338516235,
2.6759071350097656,
0.6566047668457031,
-0.2790210545063019,
-0.9905437231063843,
0.5179852843284607,
-0.011118292808532715,
-1.2023099660873413,
-0.4974089562892914,
-0.8779803514480591,
-0.052811555564403534,
-0.5776880979537964,
-0.5800442695617676,
0.07231379300355911,
0.5125373601913452,
-0.27724751830101013,
-0.4900496006011963,
-0.5420058369636536,
-0.740507185459137,
0.43801364302635193,
-0.3018995523452759,
0.9187699556350708,
-0.3140721023082733,
1.8898617029190063,
-0.5704596042633057,
0.43961313366889954,
0.7656176090240479,
1.4234704971313477,
0.1930205076932907,
-0.0070295510813593864,
0.31539249420166016,
0.3105541169643402,
-0.09401656687259674,
0.4863206148147583,
1.1259859800338745,
0.6927568912506104,
0.5229384899139404,
0.6710816621780396,
-2.2752044200897217,
1.3129969835281372,
-0.9694892764091492,
0.29859983921051025,
1.3285800218582153,
-0.9988152980804443,
0.34115827083587646,
-1.8271573781967163,
0.0762648805975914,
0.5737796425819397,
-2.2114858627319336,
0.22441275417804718,
-1.2734380960464478,
-0.45444610714912415,
1.0088518857955933,
0.26966309547424316,
-1.2971397638320923,
0.2155420333147049,
-0.4118092954158783,
1.0780073404312134,
0.4620620906352997,
1.1763266324996948,
-1.709235668182373,
-0.0720851868391037,
-0.32417112588882446,
0.1512426733970642,
-1.2395567893981934,
-1.5723142623901367,
0.5685272812843323,
0.7142335176467896,
0.5233975648880005,
-0.21778316795825958,
1.0693920850753784,
-0.9202514886856079,
0.7456115484237671,
-0.9629016518592834,
-1.7476345300674438,
-1.4205931425094604,
-2.1479709148406982,
-2.3160197734832764,
0.7559081315994263,
-0.49710360169410706,
-0.3995891213417053,
1.981927752494812,
-1.0081366300582886,
-1.839425802230835,
1.0344682931900024,
0.35968217253685,
0.014736594632267952,
2.301412582397461,
0.279266893863678,
-0.68574059009552,
0.3361714482307434,
-0.75692218542099,
0.7898467183113098,
-0.3602423369884491,
1.425622820854187,
0.4481304883956909,
-1.1121195554733276,
1.616881012916565,
-0.33804383873939514,
0.578000545501709,
-0.7402157783508301,
-0.4857402741909027,
-0.7360155582427979,
0.3374495208263397,
1.9138832092285156,
-0.33079004287719727,
1.5788030624389648,
-0.4327550530433655,
-1.6174997091293335,
-1.6643295288085938,
0.7793062925338745,
0.5379727482795715,
-0.7962303757667542,
0.13593125343322754,
-0.42500901222229004,
0.17515259981155396,
-0.04851759970188141,
1.1735724210739136,
1.247221827507019,
0.7269341945648193,
-0.3440476357936859,
-0.8310834765434265,
0.2039031684398651,
-0.01132997963577509,
-0.7048750519752502,
-1.7979623079299927,
-0.4291897118091583,
0.22761204838752747,
0.6241229772567749,
-1.1639527082443237,
1.8568506240844727,
0.8067722916603088,
1.9710439443588257,
1.0302284955978394,
-0.391961932182312,
1.553713321685791,
0.012106988579034805,
1.8247755765914917,
-0.4384605288505554,
0.6693555116653442,
-0.3363232910633087,
-1.1454225778579712,
0.8642915487289429,
-0.3490065336227417,
-2.0067880153656006,
-0.7935377359390259,
-0.7823716998100281,
-0.1881980448961258,
-0.6797664761543274,
0.8891320824623108,
-0.2781524956226349,
-1.3741321563720703,
0.15245173871517181,
-0.654504120349884,
0.11900034546852112,
-1.2357629537582397,
0.2245299369096756,
0.7578162550926208,
-0.7224668860435486,
0.08394146710634232,
-0.2790903151035309,
-1.2903504371643066,
-0.437239408493042,
0.30574876070022583,
1.889011025428772,
-0.7158492207527161,
0.8652461171150208,
1.0631169080734253,
-0.7230772376060486,
0.023876914754509926,
0.27132079005241394,
-0.30985724925994873,
0.8032407164573669,
-1.1025069952011108,
-0.3201238512992859,
1.2024368047714233,
-0.18422463536262512,
-0.6581018567085266,
1.4013103246688843,
0.7966538071632385,
-1.0433423519134521,
-0.2219877392053604,
-0.17182916402816772,
-0.8343247771263123,
0.04244779050350189,
-1.5894999504089355,
-0.06940272450447083,
0.42897242307662964,
-1.5062544345855713,
-0.45670658349990845,
-0.25298380851745605,
1.3501423597335815,
-0.2369333952665329,
1.4131627082824707,
-0.20997118949890137,
-0.18641529977321625,
-0.36167651414871216,
-0.38677430152893066,
0.144126757979393,
-0.20098088681697845,
-0.777983546257019,
0.25515082478523254,
-0.7719014883041382,
0.4253777265548706,
1.4136959314346313,
0.29224222898483276,
-0.02487054467201233,
0.5690814256668091,
1.1689927577972412,
0.31793326139450073,
0.027840664610266685,
-0.8723511099815369,
-1.5285859107971191,
1.9959235191345215,
-1.436044454574585,
1.9195811748504639,
0.8066878914833069,
0.02138558030128479,
-1.7742174863815308,
-1.8495999574661255,
1.4658151865005493,
1.1502585411071777,
2.292747974395752,
0.6470199823379517,
0.42162036895751953,
-0.8183056116104126,
-0.6263409852981567,
0.35422948002815247,
-1.0182433128356934,
-0.7581203579902649,
0.1727055013179779,
2.4075396060943604,
1.7578953504562378,
-0.5639404654502869,
-0.3056928217411041,
-0.9737831354141235,
1.332552433013916,
-0.23333562910556793,
0.1757814735174179,
2.0601773262023926,
-0.278248131275177,
-0.9887048602104187,
1.2305238246917725,
-2.413775682449341,
0.18443718552589417,
2.0049047470092773,
0.20544934272766113,
0.11387068033218384,
-1.4836432933807373,
-0.6357063055038452,
-0.2047172337770462,
-0.46445736289024353,
-1.2197856903076172,
0.5821561217308044,
-0.16470053791999817,
-0.8168953657150269,
-1.494972586631775,
0.1778360903263092,
-1.0932228565216064,
-1.6155372858047485,
0.2096520960330963,
1.997563362121582,
1.8819005489349365,
-0.7451443076133728,
1.514461636543274,
-0.3839922845363617,
0.15429092943668365,
1.340459942817688,
1.2383064031600952,
3.153482675552368,
1.7765051126480103,
-1.264889121055603,
0.7690891623497009,
-0.14746695756912231,
-0.5647163391113281,
1.1662859916687012,
-1.1233024597167969,
1.1919879913330078,
-0.29088059067726135,
-1.1565921306610107,
-1.3116610050201416,
0.8725954294204712,
0.5318166613578796,
0.07443434000015259,
-0.45522767305374146,
1.287528395652771,
0.20947711169719696,
1.3028632402420044,
0.6232222318649292,
-0.42317456007003784,
0.6463133096694946,
-0.3573034703731537,
-0.4640522003173828,
1.5250595808029175,
0.2761886417865753,
-1.3517632484436035,
-2.285632848739624,
-0.1792115420103073,
-0.8835558295249939,
0.006785107776522636,
-0.5912573337554932,
-1.0113248825073242,
1.631809115409851,
0.3955596089363098,
-1.2551578283309937,
-0.2230086624622345,
-0.2841191291809082,
-0.615494966506958,
2.628208637237549,
-1.3325062990188599,
-0.26332977414131165,
-1.0292555093765259,
-0.5318965315818787,
1.6752010583877563,
-1.1279808282852173,
-0.19338823854923248,
-1.0552139282226562,
-0.5372337698936462,
-1.3332289457321167,
-0.5705739855766296,
0.038807258009910583,
-0.8183577060699463,
0.7878008484840393,
0.0851791575551033,
-1.1956833600997925,
-0.33049893379211426,
-0.8838948011398315,
0.9123914837837219,
-0.19080589711666107,
0.21614012122154236,
1.856562852859497,
0.4935589134693146,
-0.4266212284564972,
0.758425235748291,
1.0902113914489746,
0.5641546249389648,
-0.6406642198562622,
0.25919273495674133,
-0.6439034938812256,
0.310907781124115,
-1.4066178798675537,
0.241586834192276,
-2.843707323074341,
0.5964229702949524,
-0.0554681196808815,
-0.014700466766953468,
0.0405682697892189,
-1.3834058046340942,
1.0748132467269897,
2.635373592376709,
-1.2149240970611572,
0.44388604164123535,
0.37625962495803833,
1.2260761260986328,
-1.59632408618927,
0.2721741199493408,
-0.44298258423805237,
2.1476311683654785,
0.1850328892469406,
1.2830628156661987,
-0.45065614581108093,
-2.1665828227996826,
0.5636835098266602,
-1.2838596105575562,
-1.2238909006118774,
0.858081042766571,
-0.8438842296600342,
0.01749172993004322,
-1.403365135192871,
-0.20756429433822632,
-0.8486943244934082,
-1.2608412504196167,
0.8316084146499634,
0.0773550346493721,
0.3981286585330963,
-0.6433756947517395,
0.40009501576423645,
-2.0519297122955322,
-1.4032437801361084,
-0.18460869789123535,
-1.01119863986969,
0.4110924303531647,
-0.3084290325641632,
0.6926157474517822,
-0.09964550286531448,
0.012658877298235893,
0.2963600754737854,
1.4248970746994019,
3.3868653774261475,
0.21272724866867065,
0.3192243278026581,
-0.15864421427249908,
-0.887208878993988,
1.5020759105682373,
0.8372815847396851,
-0.1364978849887848,
-0.5585002303123474,
-1.0415493249893188,
1.2084773778915405,
1.9823521375656128,
1.1237138509750366,
0.0014960430562496185,
-0.8460355997085571,
-0.8364681601524353,
0.01253071241080761,
0.1360252946615219,
0.40325289964675903,
0.8265635371208191,
0.11822301149368286,
0.13017864525318146,
1.2565709352493286,
1.1712260246276855,
-0.46111032366752625,
0.5480024814605713,
-0.8541605472564697,
-0.41671234369277954,
0.4900214970111847,
0.27814778685569763,
0.025926267728209496,
0.37813568115234375,
-1.120745062828064,
-0.24470721185207367,
-0.38409098982810974,
-0.8829827308654785,
-0.7755035758018494,
-0.4616950750350952,
-0.3350989818572998,
1.6249991655349731,
0.012525646016001701,
-0.5485461950302124,
0.03711459040641785,
-0.7450805306434631,
-0.04247692972421646,
-1.00934898853302,
0.21618293225765228,
-0.1763475239276886,
-0.15086594223976135,
-0.05266673117876053,
1.6809101104736328,
-1.0075256824493408,
-2.021867275238037,
0.1930616796016693,
0.27155065536499023,
-0.38714006543159485,
0.17177267372608185,
1.7141481637954712,
0.49690189957618713,
1.3925672769546509,
1.3786579370498657,
1.0268526077270508,
-0.7352206110954285,
-1.2743312120437622,
0.6321068406105042,
0.9075637459754944,
-1.3788175582885742,
0.7591270208358765,
-0.019113756716251373,
-0.4655691683292389,
0.583775520324707,
1.2733509540557861,
0.4664948880672455,
-1.9760602712631226,
0.7703549861907959,
-0.8740177154541016,
0.6759692430496216,
0.6936550140380859,
0.7736251354217529,
0.33920300006866455,
0.8107959628105164,
-1.1764975786209106,
-1.1952781677246094,
-0.7266337871551514,
-0.7085732817649841,
1.9310063123703003,
-0.18518604338169098,
0.5685396194458008,
-0.11880864948034286,
-1.362791895866394,
-0.19729435443878174,
0.8122340440750122,
0.38932061195373535,
-0.5511839985847473,
0.7701503038406372,
-0.6456499099731445,
-1.0022825002670288,
-1.3165279626846313,
-0.5033130645751953,
-1.069716453552246,
-0.986349880695343,
1.0301368236541748,
0.8806552886962891,
0.3846598267555237,
1.9180361032485962,
0.5678889751434326,
0.2822500765323639,
-2.6704835891723633,
0.9133981466293335,
0.34478163719177246,
-0.038047850131988525,
0.8710604310035706,
0.370517760515213,
1.075543999671936,
0.02539817802608013,
0.6143201589584351,
-2.432208299636841,
2.2814667224884033,
-0.2406332939863205,
0.624902606010437,
0.0236093420535326,
-0.3148534297943115,
1.1362489461898804,
0.4829426407814026,
0.6279218792915344,
-1.147995114326477,
0.7257274389266968,
-0.5811914205551147,
1.163894534111023,
0.8603065013885498,
-0.9841577410697937,
0.04495491087436676,
1.348211646080017,
0.4542437195777893,
-0.4787760078907013,
-0.9502743482589722,
-0.9667655229568481,
0.936500608921051,
1.6829261779785156,
-0.08069932460784912,
0.04850208759307861,
0.8688697814941406,
0.5402616262435913,
-1.3552604913711548,
0.1113070696592331,
-0.7403327226638794,
-0.7904442548751831,
1.7351973056793213,
1.9951934814453125,
-0.2112147957086563,
-0.2627061605453491,
-0.8311526775360107,
-1.1821545362472534,
0.7398616075515747,
0.055305369198322296,
0.04552667587995529,
0.6677564382553101,
-0.6774041652679443,
1.1539697647094727,
0.7983282208442688,
0.9220698475837708,
0.13772419095039368,
0.3232520818710327,
0.39381667971611023,
-0.3417001962661743,
-1.1392240524291992,
-0.22955350577831268,
-1.1191762685775757,
-2.6583633422851562,
0.4404362440109253,
-0.2409180849790573,
-1.3482165336608887,
0.006170426495373249,
-0.985283613204956,
0.8500533699989319,
-0.6280864477157593,
-1.101115345954895,
-1.5007926225662231,
0.32637032866477966,
-0.06194683909416199,
0.8964874744415283,
-1.690400242805481,
-0.04873032867908478,
1.1638325452804565,
0.9137007594108582,
-0.7267865538597107,
0.8969413638114929,
0.29198649525642395,
0.9916191101074219,
0.9783600568771362,
-0.29133477807044983,
0.5656329393386841,
0.03855758160352707,
-1.3982012271881104,
0.40145909786224365,
1.182870626449585,
0.15021677315235138,
1.484312653541565,
-0.5383380651473999,
0.05400963872671127,
0.4720083475112915,
-0.5471137166023254,
-0.46469250321388245,
-0.5240048766136169,
0.6844906806945801,
0.11551167070865631,
-0.9757557511329651,
0.003635610453784466,
-0.0606711283326149,
-0.21792714297771454,
0.20945994555950165,
-1.5446131229400635,
-0.18602238595485687,
-0.2819882333278656,
-0.5545186400413513,
-1.1530207395553589,
-0.031184999272227287,
1.3174415826797485,
-0.7036279439926147,
-0.28467637300491333,
0.504045844078064,
0.2942543625831604,
0.44238564372062683,
0.5330825448036194,
-0.7479618787765503,
-0.3473202884197235,
-0.21597716212272644,
-0.3991127610206604,
0.3322593569755554,
1.389480710029602,
-0.10357119143009186,
-1.005301833152771,
0.6653110980987549,
-0.38499853014945984,
0.011574825271964073,
1.9800416231155396,
0.15456600487232208,
-0.8664931058883667,
0.23003101348876953,
-0.7131205201148987,
1.8981696367263794,
1.725574254989624,
1.3378689289093018,
-0.0887090340256691,
-0.9895275235176086,
0.6401358246803284,
-0.29584529995918274,
-0.3366721272468567,
0.9976391792297363,
0.3632030785083771,
-0.2050817310810089,
-1.4161394834518433,
0.6714268326759338,
1.4184125661849976,
-0.9100324511528015,
-0.8226827383041382,
0.09455745667219162,
-0.8631883263587952,
1.1682846546173096,
0.6693475842475891,
0.3870235085487366,
0.22196532785892487,
1.5526801347732544,
0.6961191296577454,
-0.3355320394039154,
0.566417932510376,
0.4154284596443176,
-0.1525220274925232,
-2.1669604778289795,
-1.115314245223999,
0.3270505964756012,
-0.4567945897579193,
-1.6157690286636353,
1.3303152322769165,
-1.1880228519439697,
-0.9812930226325989,
0.5232577323913574,
0.08546818792819977,
1.499929666519165,
0.3746436834335327,
1.6196238994598389,
2.104326009750366,
0.801490306854248,
0.30245351791381836,
1.2710086107254028,
-0.1563219428062439,
-0.48967444896698,
1.7903469800949097,
-0.5236652493476868,
0.43623045086860657,
1.0401867628097534,
-0.33474645018577576,
-1.0918684005737305,
-0.8018655776977539,
-1.2613657712936401,
-0.7324733734130859,
1.2072452306747437,
0.09695020318031311,
-1.135969638824463,
0.3331785202026367,
1.5821306705474854,
0.010715335607528687,
-0.28010809421539307,
0.6999152898788452,
0.5137312412261963,
-0.799705982208252,
0.008451251313090324,
-0.8034882545471191,
0.5284320116043091,
-0.16049112379550934,
-0.2931317090988159,
0.37520596385002136,
0.5334024429321289,
1.3306206464767456,
0.0006167227402329445,
0.08041777461767197,
1.1384515762329102,
-1.387563943862915,
1.5011744499206543,
-0.6074495911598206,
0.28554707765579224,
-2.421701192855835,
1.3977941274642944,
-0.7741495966911316,
1.910010814666748,
-2.5539956092834473,
0.38084733486175537,
-0.5343380570411682,
-0.45249152183532715,
0.32047683000564575,
-0.32948338985443115,
0.09831176698207855,
-0.17297998070716858,
-1.119888186454773,
-0.07018157094717026,
-0.7321910262107849,
0.5552585124969482,
1.095151424407959,
1.3794798851013184,
-1.0874121189117432,
-0.2536659240722656,
-1.787420630455017,
-0.13448373973369598,
-0.6519710421562195,
0.39587438106536865,
-1.9388055801391602,
-0.20475423336029053,
-1.9716349840164185,
-2.346168041229248,
-1.2591997385025024,
-0.7866330146789551,
1.0605653524398804,
0.08019059896469116,
-0.8646988272666931,
1.196305751800537,
-0.3574100434780121,
-1.855601191520691,
1.0574606657028198,
-2.119978427886963
] |
https://github.com/huggingface/datasets/issues/5147 | Allow ignoring kwargs inside fn_kwargs during dataset.map's fingerprinting | > This can also go in datasets.fingerprint indeed - but maybe datasets.hashing tells more about what the register function does (i.e. register this function to have a custom hashing) ?
Sure, it makes sense.
---
I don't plan to work on it right now, so I'll let it unassigned in case somebody wants to join. I'll get back at it as soon as possible though.
| ### Feature request
`dataset.map` accepts a `fn_kwargs` that is passed to `fn`. Currently, the whole `fn_kwargs` is used by `fingerprint_transform` to calculate the new fingerprint.
I'd like to be able to inform `fingerprint_transform` which `fn_kwargs` shoud/shouldn't be taken into account during hashing.
Of course, users should be aware to properly use this new feature, just like the internal usages of `fingerprint_transform` [does](https://github.com/huggingface/datasets/blob/2699593b33ee63d17aad2a2bfddedd38a8df57b8/src/datasets/arrow_dataset.py#L2700).
### Motivation
This is originally motivated by https://github.com/huggingface/transformers/pull/18351#issuecomment-1263588680.
Nonetheless, consider a more general processing function that accepts a kwarg that does not influence it's output:
```python
def fn(example, verbose=False):
...
```
Then `dataset.map(fn, verbose=True)` would not benefit from dataset caching.
I'm not sure if other methods in the `Dataset` API could benefit from this feature.
### Your contribution
Based on `fingerprint_transform `'s `wrapper` function [here](https://github.com/huggingface/datasets/blob/c59cc34fcd2a369d27b77cc678017f5976a926a9/src/datasets/fingerprint.py#L443), it seems to me that it should be possible to make `.map`/`._map_single` accept something like `fn_use_fingerprint_kwargs`/`fn_ignore_fingerprint_kwargs` (probably another arg name). This would then be used by `fingerprint_transform.wrapper` to better/more flexibly hash the transformation.
I could contribute with a PR if this feature and approach look good to you. | 463 | 65 | Allow ignoring kwargs inside fn_kwargs during dataset.map's fingerprinting
### Feature request
`dataset.map` accepts a `fn_kwargs` that is passed to `fn`. Currently, the whole `fn_kwargs` is used by `fingerprint_transform` to calculate the new fingerprint.
I'd like to be able to inform `fingerprint_transform` which `fn_kwargs` shoud/shouldn't be taken into account during hashing.
Of course, users should be aware to properly use this new feature, just like the internal usages of `fingerprint_transform` [does](https://github.com/huggingface/datasets/blob/2699593b33ee63d17aad2a2bfddedd38a8df57b8/src/datasets/arrow_dataset.py#L2700).
### Motivation
This is originally motivated by https://github.com/huggingface/transformers/pull/18351#issuecomment-1263588680.
Nonetheless, consider a more general processing function that accepts a kwarg that does not influence it's output:
```python
def fn(example, verbose=False):
...
```
Then `dataset.map(fn, verbose=True)` would not benefit from dataset caching.
I'm not sure if other methods in the `Dataset` API could benefit from this feature.
### Your contribution
Based on `fingerprint_transform `'s `wrapper` function [here](https://github.com/huggingface/datasets/blob/c59cc34fcd2a369d27b77cc678017f5976a926a9/src/datasets/fingerprint.py#L443), it seems to me that it should be possible to make `.map`/`._map_single` accept something like `fn_use_fingerprint_kwargs`/`fn_ignore_fingerprint_kwargs` (probably another arg name). This would then be used by `fingerprint_transform.wrapper` to better/more flexibly hash the transformation.
I could contribute with a PR if this feature and approach look good to you.
> This can also go in datasets.fingerprint indeed - but maybe datasets.hashing tells more about what the register function does (i.e. register this function to have a custom hashing) ?
Sure, it makes sense.
---
I don't plan to work on it right now, so I'll let it unassigned in case somebody wants to join. I'll get back at it as soon as possible though.
| [
-1.098184585571289,
-0.8798347115516663,
-0.7810023427009583,
1.4480595588684082,
-0.1625768095254898,
-1.2901285886764526,
0.2110854983329773,
-1.0636675357818604,
1.713141679763794,
-0.739149272441864,
0.3497753441333771,
-1.6711081266403198,
-0.05124442279338837,
-0.714580237865448,
-0.7879689931869507,
-0.8206445574760437,
-0.38425734639167786,
-0.7771989107131958,
1.0694185495376587,
2.4345102310180664,
1.2363356351852417,
-1.3286415338516235,
2.6759071350097656,
0.6566047668457031,
-0.2790210545063019,
-0.9905437231063843,
0.5179852843284607,
-0.011118292808532715,
-1.2023099660873413,
-0.4974089562892914,
-0.8779803514480591,
-0.052811555564403534,
-0.5776880979537964,
-0.5800442695617676,
0.07231379300355911,
0.5125373601913452,
-0.27724751830101013,
-0.4900496006011963,
-0.5420058369636536,
-0.740507185459137,
0.43801364302635193,
-0.3018995523452759,
0.9187699556350708,
-0.3140721023082733,
1.8898617029190063,
-0.5704596042633057,
0.43961313366889954,
0.7656176090240479,
1.4234704971313477,
0.1930205076932907,
-0.0070295510813593864,
0.31539249420166016,
0.3105541169643402,
-0.09401656687259674,
0.4863206148147583,
1.1259859800338745,
0.6927568912506104,
0.5229384899139404,
0.6710816621780396,
-2.2752044200897217,
1.3129969835281372,
-0.9694892764091492,
0.29859983921051025,
1.3285800218582153,
-0.9988152980804443,
0.34115827083587646,
-1.8271573781967163,
0.0762648805975914,
0.5737796425819397,
-2.2114858627319336,
0.22441275417804718,
-1.2734380960464478,
-0.45444610714912415,
1.0088518857955933,
0.26966309547424316,
-1.2971397638320923,
0.2155420333147049,
-0.4118092954158783,
1.0780073404312134,
0.4620620906352997,
1.1763266324996948,
-1.709235668182373,
-0.0720851868391037,
-0.32417112588882446,
0.1512426733970642,
-1.2395567893981934,
-1.5723142623901367,
0.5685272812843323,
0.7142335176467896,
0.5233975648880005,
-0.21778316795825958,
1.0693920850753784,
-0.9202514886856079,
0.7456115484237671,
-0.9629016518592834,
-1.7476345300674438,
-1.4205931425094604,
-2.1479709148406982,
-2.3160197734832764,
0.7559081315994263,
-0.49710360169410706,
-0.3995891213417053,
1.981927752494812,
-1.0081366300582886,
-1.839425802230835,
1.0344682931900024,
0.35968217253685,
0.014736594632267952,
2.301412582397461,
0.279266893863678,
-0.68574059009552,
0.3361714482307434,
-0.75692218542099,
0.7898467183113098,
-0.3602423369884491,
1.425622820854187,
0.4481304883956909,
-1.1121195554733276,
1.616881012916565,
-0.33804383873939514,
0.578000545501709,
-0.7402157783508301,
-0.4857402741909027,
-0.7360155582427979,
0.3374495208263397,
1.9138832092285156,
-0.33079004287719727,
1.5788030624389648,
-0.4327550530433655,
-1.6174997091293335,
-1.6643295288085938,
0.7793062925338745,
0.5379727482795715,
-0.7962303757667542,
0.13593125343322754,
-0.42500901222229004,
0.17515259981155396,
-0.04851759970188141,
1.1735724210739136,
1.247221827507019,
0.7269341945648193,
-0.3440476357936859,
-0.8310834765434265,
0.2039031684398651,
-0.01132997963577509,
-0.7048750519752502,
-1.7979623079299927,
-0.4291897118091583,
0.22761204838752747,
0.6241229772567749,
-1.1639527082443237,
1.8568506240844727,
0.8067722916603088,
1.9710439443588257,
1.0302284955978394,
-0.391961932182312,
1.553713321685791,
0.012106988579034805,
1.8247755765914917,
-0.4384605288505554,
0.6693555116653442,
-0.3363232910633087,
-1.1454225778579712,
0.8642915487289429,
-0.3490065336227417,
-2.0067880153656006,
-0.7935377359390259,
-0.7823716998100281,
-0.1881980448961258,
-0.6797664761543274,
0.8891320824623108,
-0.2781524956226349,
-1.3741321563720703,
0.15245173871517181,
-0.654504120349884,
0.11900034546852112,
-1.2357629537582397,
0.2245299369096756,
0.7578162550926208,
-0.7224668860435486,
0.08394146710634232,
-0.2790903151035309,
-1.2903504371643066,
-0.437239408493042,
0.30574876070022583,
1.889011025428772,
-0.7158492207527161,
0.8652461171150208,
1.0631169080734253,
-0.7230772376060486,
0.023876914754509926,
0.27132079005241394,
-0.30985724925994873,
0.8032407164573669,
-1.1025069952011108,
-0.3201238512992859,
1.2024368047714233,
-0.18422463536262512,
-0.6581018567085266,
1.4013103246688843,
0.7966538071632385,
-1.0433423519134521,
-0.2219877392053604,
-0.17182916402816772,
-0.8343247771263123,
0.04244779050350189,
-1.5894999504089355,
-0.06940272450447083,
0.42897242307662964,
-1.5062544345855713,
-0.45670658349990845,
-0.25298380851745605,
1.3501423597335815,
-0.2369333952665329,
1.4131627082824707,
-0.20997118949890137,
-0.18641529977321625,
-0.36167651414871216,
-0.38677430152893066,
0.144126757979393,
-0.20098088681697845,
-0.777983546257019,
0.25515082478523254,
-0.7719014883041382,
0.4253777265548706,
1.4136959314346313,
0.29224222898483276,
-0.02487054467201233,
0.5690814256668091,
1.1689927577972412,
0.31793326139450073,
0.027840664610266685,
-0.8723511099815369,
-1.5285859107971191,
1.9959235191345215,
-1.436044454574585,
1.9195811748504639,
0.8066878914833069,
0.02138558030128479,
-1.7742174863815308,
-1.8495999574661255,
1.4658151865005493,
1.1502585411071777,
2.292747974395752,
0.6470199823379517,
0.42162036895751953,
-0.8183056116104126,
-0.6263409852981567,
0.35422948002815247,
-1.0182433128356934,
-0.7581203579902649,
0.1727055013179779,
2.4075396060943604,
1.7578953504562378,
-0.5639404654502869,
-0.3056928217411041,
-0.9737831354141235,
1.332552433013916,
-0.23333562910556793,
0.1757814735174179,
2.0601773262023926,
-0.278248131275177,
-0.9887048602104187,
1.2305238246917725,
-2.413775682449341,
0.18443718552589417,
2.0049047470092773,
0.20544934272766113,
0.11387068033218384,
-1.4836432933807373,
-0.6357063055038452,
-0.2047172337770462,
-0.46445736289024353,
-1.2197856903076172,
0.5821561217308044,
-0.16470053791999817,
-0.8168953657150269,
-1.494972586631775,
0.1778360903263092,
-1.0932228565216064,
-1.6155372858047485,
0.2096520960330963,
1.997563362121582,
1.8819005489349365,
-0.7451443076133728,
1.514461636543274,
-0.3839922845363617,
0.15429092943668365,
1.340459942817688,
1.2383064031600952,
3.153482675552368,
1.7765051126480103,
-1.264889121055603,
0.7690891623497009,
-0.14746695756912231,
-0.5647163391113281,
1.1662859916687012,
-1.1233024597167969,
1.1919879913330078,
-0.29088059067726135,
-1.1565921306610107,
-1.3116610050201416,
0.8725954294204712,
0.5318166613578796,
0.07443434000015259,
-0.45522767305374146,
1.287528395652771,
0.20947711169719696,
1.3028632402420044,
0.6232222318649292,
-0.42317456007003784,
0.6463133096694946,
-0.3573034703731537,
-0.4640522003173828,
1.5250595808029175,
0.2761886417865753,
-1.3517632484436035,
-2.285632848739624,
-0.1792115420103073,
-0.8835558295249939,
0.006785107776522636,
-0.5912573337554932,
-1.0113248825073242,
1.631809115409851,
0.3955596089363098,
-1.2551578283309937,
-0.2230086624622345,
-0.2841191291809082,
-0.615494966506958,
2.628208637237549,
-1.3325062990188599,
-0.26332977414131165,
-1.0292555093765259,
-0.5318965315818787,
1.6752010583877563,
-1.1279808282852173,
-0.19338823854923248,
-1.0552139282226562,
-0.5372337698936462,
-1.3332289457321167,
-0.5705739855766296,
0.038807258009910583,
-0.8183577060699463,
0.7878008484840393,
0.0851791575551033,
-1.1956833600997925,
-0.33049893379211426,
-0.8838948011398315,
0.9123914837837219,
-0.19080589711666107,
0.21614012122154236,
1.856562852859497,
0.4935589134693146,
-0.4266212284564972,
0.758425235748291,
1.0902113914489746,
0.5641546249389648,
-0.6406642198562622,
0.25919273495674133,
-0.6439034938812256,
0.310907781124115,
-1.4066178798675537,
0.241586834192276,
-2.843707323074341,
0.5964229702949524,
-0.0554681196808815,
-0.014700466766953468,
0.0405682697892189,
-1.3834058046340942,
1.0748132467269897,
2.635373592376709,
-1.2149240970611572,
0.44388604164123535,
0.37625962495803833,
1.2260761260986328,
-1.59632408618927,
0.2721741199493408,
-0.44298258423805237,
2.1476311683654785,
0.1850328892469406,
1.2830628156661987,
-0.45065614581108093,
-2.1665828227996826,
0.5636835098266602,
-1.2838596105575562,
-1.2238909006118774,
0.858081042766571,
-0.8438842296600342,
0.01749172993004322,
-1.403365135192871,
-0.20756429433822632,
-0.8486943244934082,
-1.2608412504196167,
0.8316084146499634,
0.0773550346493721,
0.3981286585330963,
-0.6433756947517395,
0.40009501576423645,
-2.0519297122955322,
-1.4032437801361084,
-0.18460869789123535,
-1.01119863986969,
0.4110924303531647,
-0.3084290325641632,
0.6926157474517822,
-0.09964550286531448,
0.012658877298235893,
0.2963600754737854,
1.4248970746994019,
3.3868653774261475,
0.21272724866867065,
0.3192243278026581,
-0.15864421427249908,
-0.887208878993988,
1.5020759105682373,
0.8372815847396851,
-0.1364978849887848,
-0.5585002303123474,
-1.0415493249893188,
1.2084773778915405,
1.9823521375656128,
1.1237138509750366,
0.0014960430562496185,
-0.8460355997085571,
-0.8364681601524353,
0.01253071241080761,
0.1360252946615219,
0.40325289964675903,
0.8265635371208191,
0.11822301149368286,
0.13017864525318146,
1.2565709352493286,
1.1712260246276855,
-0.46111032366752625,
0.5480024814605713,
-0.8541605472564697,
-0.41671234369277954,
0.4900214970111847,
0.27814778685569763,
0.025926267728209496,
0.37813568115234375,
-1.120745062828064,
-0.24470721185207367,
-0.38409098982810974,
-0.8829827308654785,
-0.7755035758018494,
-0.4616950750350952,
-0.3350989818572998,
1.6249991655349731,
0.012525646016001701,
-0.5485461950302124,
0.03711459040641785,
-0.7450805306434631,
-0.04247692972421646,
-1.00934898853302,
0.21618293225765228,
-0.1763475239276886,
-0.15086594223976135,
-0.05266673117876053,
1.6809101104736328,
-1.0075256824493408,
-2.021867275238037,
0.1930616796016693,
0.27155065536499023,
-0.38714006543159485,
0.17177267372608185,
1.7141481637954712,
0.49690189957618713,
1.3925672769546509,
1.3786579370498657,
1.0268526077270508,
-0.7352206110954285,
-1.2743312120437622,
0.6321068406105042,
0.9075637459754944,
-1.3788175582885742,
0.7591270208358765,
-0.019113756716251373,
-0.4655691683292389,
0.583775520324707,
1.2733509540557861,
0.4664948880672455,
-1.9760602712631226,
0.7703549861907959,
-0.8740177154541016,
0.6759692430496216,
0.6936550140380859,
0.7736251354217529,
0.33920300006866455,
0.8107959628105164,
-1.1764975786209106,
-1.1952781677246094,
-0.7266337871551514,
-0.7085732817649841,
1.9310063123703003,
-0.18518604338169098,
0.5685396194458008,
-0.11880864948034286,
-1.362791895866394,
-0.19729435443878174,
0.8122340440750122,
0.38932061195373535,
-0.5511839985847473,
0.7701503038406372,
-0.6456499099731445,
-1.0022825002670288,
-1.3165279626846313,
-0.5033130645751953,
-1.069716453552246,
-0.986349880695343,
1.0301368236541748,
0.8806552886962891,
0.3846598267555237,
1.9180361032485962,
0.5678889751434326,
0.2822500765323639,
-2.6704835891723633,
0.9133981466293335,
0.34478163719177246,
-0.038047850131988525,
0.8710604310035706,
0.370517760515213,
1.075543999671936,
0.02539817802608013,
0.6143201589584351,
-2.432208299636841,
2.2814667224884033,
-0.2406332939863205,
0.624902606010437,
0.0236093420535326,
-0.3148534297943115,
1.1362489461898804,
0.4829426407814026,
0.6279218792915344,
-1.147995114326477,
0.7257274389266968,
-0.5811914205551147,
1.163894534111023,
0.8603065013885498,
-0.9841577410697937,
0.04495491087436676,
1.348211646080017,
0.4542437195777893,
-0.4787760078907013,
-0.9502743482589722,
-0.9667655229568481,
0.936500608921051,
1.6829261779785156,
-0.08069932460784912,
0.04850208759307861,
0.8688697814941406,
0.5402616262435913,
-1.3552604913711548,
0.1113070696592331,
-0.7403327226638794,
-0.7904442548751831,
1.7351973056793213,
1.9951934814453125,
-0.2112147957086563,
-0.2627061605453491,
-0.8311526775360107,
-1.1821545362472534,
0.7398616075515747,
0.055305369198322296,
0.04552667587995529,
0.6677564382553101,
-0.6774041652679443,
1.1539697647094727,
0.7983282208442688,
0.9220698475837708,
0.13772419095039368,
0.3232520818710327,
0.39381667971611023,
-0.3417001962661743,
-1.1392240524291992,
-0.22955350577831268,
-1.1191762685775757,
-2.6583633422851562,
0.4404362440109253,
-0.2409180849790573,
-1.3482165336608887,
0.006170426495373249,
-0.985283613204956,
0.8500533699989319,
-0.6280864477157593,
-1.101115345954895,
-1.5007926225662231,
0.32637032866477966,
-0.06194683909416199,
0.8964874744415283,
-1.690400242805481,
-0.04873032867908478,
1.1638325452804565,
0.9137007594108582,
-0.7267865538597107,
0.8969413638114929,
0.29198649525642395,
0.9916191101074219,
0.9783600568771362,
-0.29133477807044983,
0.5656329393386841,
0.03855758160352707,
-1.3982012271881104,
0.40145909786224365,
1.182870626449585,
0.15021677315235138,
1.484312653541565,
-0.5383380651473999,
0.05400963872671127,
0.4720083475112915,
-0.5471137166023254,
-0.46469250321388245,
-0.5240048766136169,
0.6844906806945801,
0.11551167070865631,
-0.9757557511329651,
0.003635610453784466,
-0.0606711283326149,
-0.21792714297771454,
0.20945994555950165,
-1.5446131229400635,
-0.18602238595485687,
-0.2819882333278656,
-0.5545186400413513,
-1.1530207395553589,
-0.031184999272227287,
1.3174415826797485,
-0.7036279439926147,
-0.28467637300491333,
0.504045844078064,
0.2942543625831604,
0.44238564372062683,
0.5330825448036194,
-0.7479618787765503,
-0.3473202884197235,
-0.21597716212272644,
-0.3991127610206604,
0.3322593569755554,
1.389480710029602,
-0.10357119143009186,
-1.005301833152771,
0.6653110980987549,
-0.38499853014945984,
0.011574825271964073,
1.9800416231155396,
0.15456600487232208,
-0.8664931058883667,
0.23003101348876953,
-0.7131205201148987,
1.8981696367263794,
1.725574254989624,
1.3378689289093018,
-0.0887090340256691,
-0.9895275235176086,
0.6401358246803284,
-0.29584529995918274,
-0.3366721272468567,
0.9976391792297363,
0.3632030785083771,
-0.2050817310810089,
-1.4161394834518433,
0.6714268326759338,
1.4184125661849976,
-0.9100324511528015,
-0.8226827383041382,
0.09455745667219162,
-0.8631883263587952,
1.1682846546173096,
0.6693475842475891,
0.3870235085487366,
0.22196532785892487,
1.5526801347732544,
0.6961191296577454,
-0.3355320394039154,
0.566417932510376,
0.4154284596443176,
-0.1525220274925232,
-2.1669604778289795,
-1.115314245223999,
0.3270505964756012,
-0.4567945897579193,
-1.6157690286636353,
1.3303152322769165,
-1.1880228519439697,
-0.9812930226325989,
0.5232577323913574,
0.08546818792819977,
1.499929666519165,
0.3746436834335327,
1.6196238994598389,
2.104326009750366,
0.801490306854248,
0.30245351791381836,
1.2710086107254028,
-0.1563219428062439,
-0.48967444896698,
1.7903469800949097,
-0.5236652493476868,
0.43623045086860657,
1.0401867628097534,
-0.33474645018577576,
-1.0918684005737305,
-0.8018655776977539,
-1.2613657712936401,
-0.7324733734130859,
1.2072452306747437,
0.09695020318031311,
-1.135969638824463,
0.3331785202026367,
1.5821306705474854,
0.010715335607528687,
-0.28010809421539307,
0.6999152898788452,
0.5137312412261963,
-0.799705982208252,
0.008451251313090324,
-0.8034882545471191,
0.5284320116043091,
-0.16049112379550934,
-0.2931317090988159,
0.37520596385002136,
0.5334024429321289,
1.3306206464767456,
0.0006167227402329445,
0.08041777461767197,
1.1384515762329102,
-1.387563943862915,
1.5011744499206543,
-0.6074495911598206,
0.28554707765579224,
-2.421701192855835,
1.3977941274642944,
-0.7741495966911316,
1.910010814666748,
-2.5539956092834473,
0.38084733486175537,
-0.5343380570411682,
-0.45249152183532715,
0.32047683000564575,
-0.32948338985443115,
0.09831176698207855,
-0.17297998070716858,
-1.119888186454773,
-0.07018157094717026,
-0.7321910262107849,
0.5552585124969482,
1.095151424407959,
1.3794798851013184,
-1.0874121189117432,
-0.2536659240722656,
-1.787420630455017,
-0.13448373973369598,
-0.6519710421562195,
0.39587438106536865,
-1.9388055801391602,
-0.20475423336029053,
-1.9716349840164185,
-2.346168041229248,
-1.2591997385025024,
-0.7866330146789551,
1.0605653524398804,
0.08019059896469116,
-0.8646988272666931,
1.196305751800537,
-0.3574100434780121,
-1.855601191520691,
1.0574606657028198,
-2.119978427886963
] |
https://github.com/huggingface/datasets/issues/5145 | Dataset order is not deterministic with ZIP archives and `iter_files` | Thanks for reporting ! The issue doesn't come from shuffling, but from `beans` row order not being deterministic:
https://huggingface.co/datasets/beans/blob/main/beans.py uses `dl_manager.iter_files` on ZIP archives and the file order doesn't seen to be deterministic and changes across machines | ### Describe the bug
For the `beans` dataset (did not try on other), the order of samples is not the same on different machines. Tested on my local laptop, github actions machine, and ec2 instance. The three yield a different order.
### Steps to reproduce the bug
In a clean docker container or conda environment with datasets==2.6.1, run
```python
from datasets import load_dataset
from pprint import pprint
data = load_dataset("beans", split="validation")
pprint(data["image_file_path"])
```
### Expected behavior
The order of the images is the same on all machines.
### Environment info
On the EC2 instance:
```
- `datasets` version: 2.6.1
- Platform: Linux-4.14.291-218.527.amzn2.x86_64-x86_64-with-glibc2.2.5
- Python version: 3.7.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
- Numpy version: not checked
```
On my local laptop:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-50-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- PyArrow version: 7.0.0
- Pandas version: 1.3.5
- Numpy version: 1.23.1
```
On github actions:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-azure-x86_64-with-glibc2.2.5
- Python version: 3.8.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
- Numpy version: 1.23.4
``` | 464 | 37 | Dataset order is not deterministic with ZIP archives and `iter_files`
### Describe the bug
For the `beans` dataset (did not try on other), the order of samples is not the same on different machines. Tested on my local laptop, github actions machine, and ec2 instance. The three yield a different order.
### Steps to reproduce the bug
In a clean docker container or conda environment with datasets==2.6.1, run
```python
from datasets import load_dataset
from pprint import pprint
data = load_dataset("beans", split="validation")
pprint(data["image_file_path"])
```
### Expected behavior
The order of the images is the same on all machines.
### Environment info
On the EC2 instance:
```
- `datasets` version: 2.6.1
- Platform: Linux-4.14.291-218.527.amzn2.x86_64-x86_64-with-glibc2.2.5
- Python version: 3.7.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
- Numpy version: not checked
```
On my local laptop:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-50-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- PyArrow version: 7.0.0
- Pandas version: 1.3.5
- Numpy version: 1.23.1
```
On github actions:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-azure-x86_64-with-glibc2.2.5
- Python version: 3.8.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
- Numpy version: 1.23.4
```
Thanks for reporting ! The issue doesn't come from shuffling, but from `beans` row order not being deterministic:
https://huggingface.co/datasets/beans/blob/main/beans.py uses `dl_manager.iter_files` on ZIP archives and the file order doesn't seen to be deterministic and changes across machines | [
-1.156820297241211,
-0.8541995882987976,
-0.6713904738426208,
1.4366990327835083,
-0.16772979497909546,
-1.2823423147201538,
0.22777239978313446,
-1.0658773183822632,
1.7186483144760132,
-0.7839601635932922,
0.344544380903244,
-1.6809827089309692,
0.07539056241512299,
-0.5144255757331848,
-0.7394057512283325,
-0.8512347936630249,
-0.49323344230651855,
-0.6472393870353699,
1.0689361095428467,
2.4203155040740967,
1.2027872800827026,
-1.354773759841919,
2.622436046600342,
0.7005427479743958,
-0.16309988498687744,
-0.9389510154724121,
0.48339030146598816,
0.014331593178212643,
-1.498708963394165,
-0.2790422737598419,
-0.8877640962600708,
-0.12353114038705826,
-0.5626222491264343,
-0.6532057523727417,
0.039491575211286545,
0.3762226700782776,
-0.3127281367778778,
-0.5184544920921326,
-0.4643822908401489,
-0.8341249823570251,
0.4213177263736725,
-0.2946590483188629,
0.9079052805900574,
-0.42540499567985535,
1.740086317062378,
-0.5565201640129089,
0.6085407733917236,
0.7806418538093567,
1.272632122039795,
0.22030892968177795,
-0.06995857506990433,
0.33911871910095215,
0.3998520076274872,
0.08717958629131317,
0.5388169288635254,
1.117462396621704,
0.6744176149368286,
0.39967307448387146,
0.7338295578956604,
-2.2253916263580322,
1.3117051124572754,
-0.9360080361366272,
0.3223758935928345,
1.3258540630340576,
-1.0294053554534912,
0.26062673330307007,
-1.7935055494308472,
-0.08362136036157608,
0.4679868221282959,
-2.222651481628418,
0.24458441138267517,
-1.3553966283798218,
-0.5036988258361816,
1.1308138370513916,
0.40261101722717285,
-1.1829010248184204,
0.01995411142706871,
-0.36609452962875366,
0.9185722470283508,
0.43753957748413086,
1.2036190032958984,
-1.6270105838775635,
-0.034237682819366455,
-0.300412654876709,
0.21042142808437347,
-1.2071177959442139,
-1.494821310043335,
0.5248681306838989,
0.7355360388755798,
0.5235919952392578,
-0.14405252039432526,
0.9457861185073853,
-0.9593358039855957,
0.768518328666687,
-0.9719770550727844,
-1.809425950050354,
-1.3656777143478394,
-2.289616584777832,
-2.304410457611084,
0.7275388240814209,
-0.4321673810482025,
-0.3989718556404114,
2.170984983444214,
-1.0670899152755737,
-1.7737740278244019,
1.0396472215652466,
0.25792062282562256,
-0.04505337402224541,
2.303271770477295,
0.18261301517486572,
-0.6997582912445068,
0.5039981007575989,
-0.8417425751686096,
0.5860411524772644,
-0.3719581067562103,
1.2479084730148315,
0.389371782541275,
-1.1121618747711182,
1.5227917432785034,
-0.33337798714637756,
0.6396520733833313,
-0.6792786121368408,
-0.3944915235042572,
-0.5900146961212158,
0.2217463254928589,
1.9307787418365479,
-0.3105026185512543,
1.4313511848449707,
-0.26759856939315796,
-1.5084850788116455,
-1.47967529296875,
0.7722140550613403,
0.6327712535858154,
-0.5788024067878723,
0.11555157601833344,
-0.26678645610809326,
0.0726604163646698,
-0.05472322553396225,
1.0249824523925781,
1.2809053659439087,
0.8891767859458923,
-0.32382041215896606,
-0.9228588342666626,
0.21834786236286163,
0.041230399161577225,
-0.7578141093254089,
-1.7519453763961792,
-0.2686949670314789,
0.06668327748775482,
0.6559895873069763,
-1.2193599939346313,
1.7936367988586426,
0.8158645033836365,
1.9766268730163574,
0.9562792181968689,
-0.40256670117378235,
1.5935566425323486,
0.15138889849185944,
1.8905737400054932,
-0.38869717717170715,
0.6702030301094055,
-0.3796897232532501,
-1.1445919275283813,
0.8002684116363525,
-0.29033327102661133,
-2.0950279235839844,
-0.48678073287010193,
-0.8294309973716736,
-0.11434207111597061,
-0.777519702911377,
1.0287704467773438,
-0.1852845400571823,
-1.4009263515472412,
0.2120838612318039,
-0.7915537357330322,
0.059322062879800797,
-1.3364946842193604,
0.3139476478099823,
0.7883697748184204,
-0.6368463635444641,
0.11793223023414612,
-0.35118332505226135,
-1.2894138097763062,
-0.5319883823394775,
0.3935560882091522,
1.7235983610153198,
-0.7541241645812988,
1.0567576885223389,
1.0836032629013062,
-0.6912394165992737,
-0.043414391577243805,
0.4489767849445343,
-0.32196637988090515,
0.9541562795639038,
-1.0447545051574707,
-0.4241637587547302,
1.171006679534912,
-0.2021002322435379,
-0.5637864470481873,
1.4484481811523438,
0.6882505416870117,
-0.9694884419441223,
-0.21227224171161652,
-0.08734705299139023,
-0.7642083168029785,
0.060348693281412125,
-1.665549874305725,
-0.011978059075772762,
0.3345087468624115,
-1.584385871887207,
-0.46795347332954407,
-0.176325261592865,
1.3509597778320312,
-0.08105254173278809,
1.429108738899231,
-0.2073613703250885,
-0.19413377344608307,
-0.4803493320941925,
-0.32203149795532227,
0.07867277413606644,
-0.23696956038475037,
-0.5639212727546692,
0.316956490278244,
-0.7209065556526184,
0.2978591024875641,
1.4476261138916016,
0.30111411213874817,
-0.01948533207178116,
0.5582564473152161,
1.052217960357666,
0.41175907850265503,
-0.16056424379348755,
-0.8688623309135437,
-1.5825949907302856,
2.0275003910064697,
-1.412232756614685,
2.0048255920410156,
0.7756378054618835,
-0.02812514454126358,
-1.7945467233657837,
-2.0209896564483643,
1.4219393730163574,
1.0115376710891724,
2.4429378509521484,
0.6043818593025208,
0.45954909920692444,
-0.8714368939399719,
-0.6254594922065735,
0.36536693572998047,
-0.9012570381164551,
-0.8154370188713074,
0.12950603663921356,
2.430462598800659,
1.6202298402786255,
-0.3724850118160248,
-0.13730354607105255,
-1.1469345092773438,
1.4926214218139648,
-0.07585582882165909,
0.19281542301177979,
1.9469573497772217,
-0.2565034031867981,
-1.0372333526611328,
1.280147671699524,
-2.279890298843384,
0.20765981078147888,
1.9781913757324219,
0.20434704422950745,
0.08818688988685608,
-1.4039325714111328,
-0.7451435923576355,
-0.18412861227989197,
-0.5011618733406067,
-1.1748719215393066,
0.5498276948928833,
-0.18954411149024963,
-0.801339328289032,
-1.4136971235275269,
0.1367494761943817,
-1.0895600318908691,
-1.784062385559082,
0.19090425968170166,
1.781138300895691,
1.916727066040039,
-0.767805814743042,
1.522864580154419,
-0.3049725294113159,
0.1994788944721222,
1.210907220840454,
1.1895408630371094,
3.135289192199707,
1.9895859956741333,
-1.3546503782272339,
0.7810450196266174,
-0.006499204318970442,
-0.4116114377975464,
1.1765625476837158,
-1.1761218309402466,
1.295228362083435,
-0.18422718346118927,
-1.2077597379684448,
-1.1720702648162842,
0.8953707218170166,
0.48468920588493347,
0.07415927946567535,
-0.40439021587371826,
1.140644907951355,
0.13915593922138214,
1.3436425924301147,
0.5957208275794983,
-0.23652073740959167,
0.771888017654419,
-0.3630443513393402,
-0.4345759451389313,
1.5636714696884155,
0.20103555917739868,
-1.3336331844329834,
-2.3292155265808105,
-0.23063498735427856,
-0.8884881138801575,
0.011578568257391453,
-0.6449689269065857,
-0.934822142124176,
1.6286559104919434,
0.5286951661109924,
-1.1617395877838135,
-0.17412827908992767,
-0.36276760697364807,
-0.58016037940979,
2.652061700820923,
-1.4515058994293213,
-0.19549258053302765,
-1.0606759786605835,
-0.6284680366516113,
1.5693272352218628,
-1.1703240871429443,
-0.2286434918642044,
-1.0605071783065796,
-0.48961520195007324,
-1.2771648168563843,
-0.647897481918335,
-0.054772380739450455,
-0.8588659167289734,
0.8679367899894714,
0.12064242362976074,
-1.2889683246612549,
-0.369888573884964,
-0.9517421722412109,
0.8356936573982239,
-0.049568697810173035,
0.1384819746017456,
1.8061546087265015,
0.4245019853115082,
-0.3225940465927124,
0.6503573656082153,
1.0606689453125,
0.597943127155304,
-0.57394939661026,
0.38482725620269775,
-0.7321956157684326,
0.3433913588523865,
-1.2418683767318726,
0.2790469527244568,
-2.821911334991455,
0.6150473952293396,
-0.04110889509320259,
-0.025211237370967865,
-0.16710561513900757,
-1.3185691833496094,
1.1071852445602417,
2.6598317623138428,
-1.1567015647888184,
0.5751286149024963,
0.2724868655204773,
1.158945083618164,
-1.5145188570022583,
0.17758449912071228,
-0.49039947986602783,
2.157944917678833,
0.14855735003948212,
1.203319787979126,
-0.4414941072463989,
-2.347731113433838,
0.6468626260757446,
-1.2138885259628296,
-1.1249232292175293,
0.8043614625930786,
-0.7690314054489136,
0.04952742159366608,
-1.201200246810913,
-0.16751781105995178,
-0.7674563527107239,
-1.1805044412612915,
0.5966339707374573,
0.08407219499349594,
0.6265890002250671,
-0.7270216345787048,
0.35447990894317627,
-2.2088208198547363,
-1.2687795162200928,
-0.2709078788757324,
-0.9521821737289429,
0.39134153723716736,
-0.275623619556427,
0.8108592629432678,
-0.21362346410751343,
-0.06709091365337372,
0.3596692383289337,
1.2670235633850098,
3.3554697036743164,
0.03544355183839798,
0.28479495644569397,
-0.20069560408592224,
-1.0021326541900635,
1.426689624786377,
0.9321746230125427,
-0.17873695492744446,
-0.5512517690658569,
-1.0561070442199707,
1.1325165033340454,
1.9956837892532349,
1.0913952589035034,
0.03406640887260437,
-0.9000571966171265,
-0.8782790899276733,
0.06107719615101814,
0.13691255450248718,
0.5257974863052368,
0.9462231397628784,
0.140677347779274,
0.08639531582593918,
1.4718621969223022,
1.1692286729812622,
-0.3197450041770935,
0.39698028564453125,
-0.8441569209098816,
-0.5218972563743591,
0.6103094816207886,
0.4119186997413635,
0.03717968240380287,
0.2892798185348511,
-1.1618026494979858,
-0.17450442910194397,
-0.34064650535583496,
-0.9208942651748657,
-0.7140672206878662,
-0.3916294574737549,
-0.3984581530094147,
1.7381372451782227,
-0.0054865144193172455,
-0.5247638821601868,
-0.04922977089881897,
-0.7814497947692871,
0.07204190641641617,
-0.9637542963027954,
0.44869688153266907,
-0.2622441351413727,
0.040550749748945236,
-0.11261630058288574,
1.7502799034118652,
-0.9382791519165039,
-2.0621719360351562,
0.27666929364204407,
0.13087376952171326,
-0.418441504240036,
0.24210187792778015,
1.6187875270843506,
0.6772395968437195,
1.440962553024292,
1.4307326078414917,
1.0296703577041626,
-0.678573489189148,
-1.3578072786331177,
0.6588404774665833,
0.979998767375946,
-1.4690741300582886,
0.6356990933418274,
0.05275030434131622,
-0.5193471908569336,
0.5381707549095154,
1.311920166015625,
0.42398694157600403,
-2.0807957649230957,
0.7808337211608887,
-0.8923372626304626,
0.7170524597167969,
0.7648305296897888,
0.7871757745742798,
0.04098210856318474,
0.7666574120521545,
-1.283720850944519,
-1.0465108156204224,
-0.6043089032173157,
-0.6766124367713928,
1.8603051900863647,
-0.386435866355896,
0.5564287900924683,
-0.25466325879096985,
-1.4380669593811035,
-0.06803025305271149,
0.5811817049980164,
0.2982241213321686,
-0.537879467010498,
0.7769618034362793,
-0.586543619632721,
-1.2001042366027832,
-1.3206007480621338,
-0.5692628622055054,
-1.0681711435317993,
-0.9088086485862732,
0.9950078129768372,
0.8346937894821167,
0.48403123021125793,
1.8186122179031372,
0.6096636056900024,
0.1740674525499344,
-2.6420211791992188,
0.8594346642494202,
0.36818280816078186,
-0.06190689653158188,
0.841109037399292,
0.2970205545425415,
1.019049882888794,
-0.18784162402153015,
0.6529619097709656,
-2.4187328815460205,
2.4029617309570312,
-0.147873193025589,
0.6718902587890625,
0.09311258047819138,
-0.14159153401851654,
0.9990251660346985,
0.6155436635017395,
0.5990139245986938,
-1.1052772998809814,
0.7754450440406799,
-0.7064375281333923,
1.3450250625610352,
0.7461507320404053,
-0.8378427624702454,
-0.1200358122587204,
1.226023554801941,
0.4522199332714081,
-0.40717437863349915,
-0.9007143378257751,
-1.10866379737854,
0.9573134779930115,
1.8226075172424316,
-0.11395160853862762,
0.10693950951099396,
0.8544146418571472,
0.7432951927185059,
-1.394019603729248,
-0.04612831026315689,
-0.8018164038658142,
-0.6530783176422119,
1.640350103378296,
2.0295333862304688,
-0.08198056370019913,
-0.21895632147789001,
-0.8399900794029236,
-1.275855541229248,
0.762202262878418,
0.11912611126899719,
0.051527123898267746,
0.6531957387924194,
-0.5430539846420288,
1.2141331434249878,
0.9024549722671509,
0.9735017418861389,
0.2952132225036621,
0.24092042446136475,
0.11347422003746033,
-0.3906508684158325,
-1.2550042867660522,
-0.22817793488502502,
-0.9606477618217468,
-2.4970595836639404,
0.5067804455757141,
-0.16693101823329926,
-1.4651710987091064,
-0.0029667112976312637,
-1.0219643115997314,
0.7723672986030579,
-0.4860323667526245,
-1.1452643871307373,
-1.4375818967819214,
0.16223393380641937,
-0.15080559253692627,
0.9354466199874878,
-1.5764256715774536,
-0.027083635330200195,
1.301666259765625,
1.0377651453018188,
-0.7453987002372742,
0.9667401313781738,
0.22257542610168457,
1.0531569719314575,
0.9175847768783569,
-0.29200437664985657,
0.45482540130615234,
0.2234734445810318,
-1.297275185585022,
0.3707566261291504,
1.2271076440811157,
0.1864495724439621,
1.5659582614898682,
-0.7240022420883179,
0.03763727471232414,
0.3882119059562683,
-0.3829895257949829,
-0.4955262839794159,
-0.7636157274246216,
0.7136080861091614,
-0.09661367535591125,
-0.9652841091156006,
0.0994175374507904,
-0.020964354276657104,
-0.08596797287464142,
0.19193726778030396,
-1.5070338249206543,
-0.06780589371919632,
-0.3041386008262634,
-0.6732897758483887,
-1.228070855140686,
-0.05450491979718208,
1.3423292636871338,
-0.7791165709495544,
-0.08328238874673843,
0.47051090002059937,
0.20118966698646545,
0.5421007871627808,
0.7332735657691956,
-0.6369176506996155,
-0.4699542224407196,
-0.2048187255859375,
-0.4499591588973999,
0.39865049719810486,
1.3396244049072266,
-0.06648629903793335,
-0.967613935470581,
0.7136790752410889,
-0.41925081610679626,
0.04919063672423363,
1.9450418949127197,
0.039067693054676056,
-0.8628185987472534,
0.3709169924259186,
-0.7222028970718384,
1.953549861907959,
1.7379589080810547,
1.3425880670547485,
-0.11602652072906494,
-1.0696793794631958,
0.5672903060913086,
-0.37319496273994446,
-0.43291404843330383,
0.9718126654624939,
0.4139278829097748,
-0.26163724064826965,
-1.3198018074035645,
0.6387298107147217,
1.2951453924179077,
-0.9362369179725647,
-0.8956400156021118,
0.19931136071681976,
-0.7672562003135681,
1.0840437412261963,
0.7995051741600037,
0.36412280797958374,
0.2869541645050049,
1.5823421478271484,
0.8063793778419495,
-0.46741339564323425,
0.6035218238830566,
0.42528021335601807,
-0.2121240347623825,
-2.027693748474121,
-1.1701797246932983,
0.3505847752094269,
-0.5925636887550354,
-1.6019877195358276,
1.370923399925232,
-1.2574728727340698,
-0.969141960144043,
0.5187669992446899,
0.12775468826293945,
1.3918498754501343,
0.2960006594657898,
1.5729862451553345,
1.9640733003616333,
0.9360016584396362,
0.3736690878868103,
1.3184012174606323,
-0.22932308912277222,
-0.4188673496246338,
1.7080092430114746,
-0.5741363167762756,
0.5853851437568665,
1.1147196292877197,
-0.3647240698337555,
-1.0845454931259155,
-0.8788091540336609,
-1.1524053812026978,
-0.8139521479606628,
1.167590618133545,
0.06110164895653725,
-1.133681058883667,
0.33233198523521423,
1.5461106300354004,
0.05571061000227928,
-0.21983122825622559,
0.7079529166221619,
0.24916955828666687,
-0.7775425314903259,
-0.10664084553718567,
-0.9588168859481812,
0.48787567019462585,
-0.3403787612915039,
-0.42275145649909973,
0.2817639410495758,
0.4888139069080353,
1.2768502235412598,
-0.01357029564678669,
0.08930455148220062,
1.2389343976974487,
-1.3598240613937378,
1.501548171043396,
-0.8439575433731079,
0.30113765597343445,
-2.3559975624084473,
1.3485383987426758,
-0.8663274645805359,
1.861777663230896,
-2.718230724334717,
0.3931258022785187,
-0.42788511514663696,
-0.4323924779891968,
0.178824320435524,
-0.2893398404121399,
0.1673389971256256,
-0.16637329757213593,
-1.2112957239151,
-0.18119776248931885,
-0.853607177734375,
0.566131591796875,
1.0726505517959595,
1.3912971019744873,
-1.061601161956787,
-0.3102411925792694,
-1.7184809446334839,
-0.20858672261238098,
-0.6432369947433472,
0.43734925985336304,
-1.8561551570892334,
-0.2067193239927292,
-1.8911281824111938,
-2.4409854412078857,
-1.2220709323883057,
-0.8851625919342041,
1.1398676633834839,
0.048951394855976105,
-0.8164104223251343,
1.0544050931930542,
-0.3750673830509186,
-1.9126689434051514,
1.1473191976547241,
-2.259873628616333
] |
https://github.com/huggingface/datasets/issues/5145 | Dataset order is not deterministic with ZIP archives and `iter_files` | This is still a bug, so I'd keep this one open if you don't mind ;) | ### Describe the bug
For the `beans` dataset (did not try on other), the order of samples is not the same on different machines. Tested on my local laptop, github actions machine, and ec2 instance. The three yield a different order.
### Steps to reproduce the bug
In a clean docker container or conda environment with datasets==2.6.1, run
```python
from datasets import load_dataset
from pprint import pprint
data = load_dataset("beans", split="validation")
pprint(data["image_file_path"])
```
### Expected behavior
The order of the images is the same on all machines.
### Environment info
On the EC2 instance:
```
- `datasets` version: 2.6.1
- Platform: Linux-4.14.291-218.527.amzn2.x86_64-x86_64-with-glibc2.2.5
- Python version: 3.7.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
- Numpy version: not checked
```
On my local laptop:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-50-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- PyArrow version: 7.0.0
- Pandas version: 1.3.5
- Numpy version: 1.23.1
```
On github actions:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-azure-x86_64-with-glibc2.2.5
- Python version: 3.8.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
- Numpy version: 1.23.4
``` | 464 | 16 | Dataset order is not deterministic with ZIP archives and `iter_files`
### Describe the bug
For the `beans` dataset (did not try on other), the order of samples is not the same on different machines. Tested on my local laptop, github actions machine, and ec2 instance. The three yield a different order.
### Steps to reproduce the bug
In a clean docker container or conda environment with datasets==2.6.1, run
```python
from datasets import load_dataset
from pprint import pprint
data = load_dataset("beans", split="validation")
pprint(data["image_file_path"])
```
### Expected behavior
The order of the images is the same on all machines.
### Environment info
On the EC2 instance:
```
- `datasets` version: 2.6.1
- Platform: Linux-4.14.291-218.527.amzn2.x86_64-x86_64-with-glibc2.2.5
- Python version: 3.7.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
- Numpy version: not checked
```
On my local laptop:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-50-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- PyArrow version: 7.0.0
- Pandas version: 1.3.5
- Numpy version: 1.23.1
```
On github actions:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-azure-x86_64-with-glibc2.2.5
- Python version: 3.8.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
- Numpy version: 1.23.4
```
This is still a bug, so I'd keep this one open if you don't mind ;) | [
-1.169071078300476,
-0.8590708374977112,
-0.6717019081115723,
1.431121826171875,
-0.16566883027553558,
-1.2785286903381348,
0.2317829579114914,
-1.061316728591919,
1.7319945096969604,
-0.7846059203147888,
0.34944450855255127,
-1.6719064712524414,
0.06820923835039139,
-0.5086649060249329,
-0.7324503064155579,
-0.8631585240364075,
-0.47591832280158997,
-0.6601938605308533,
1.0751800537109375,
2.4331517219543457,
1.1816835403442383,
-1.3600889444351196,
2.6347527503967285,
0.7023386359214783,
-0.15167124569416046,
-0.9399684071540833,
0.4829650819301605,
0.019382081925868988,
-1.4929901361465454,
-0.27982762455940247,
-0.8847446441650391,
-0.12138007581233978,
-0.5631487965583801,
-0.6427066922187805,
0.03135361894965172,
0.3640558421611786,
-0.31121811270713806,
-0.5247363448143005,
-0.4352112412452698,
-0.8265009522438049,
0.419243723154068,
-0.30601468682289124,
0.8972444534301758,
-0.42440706491470337,
1.7448351383209229,
-0.5414755940437317,
0.6034701466560364,
0.7743802070617676,
1.2538948059082031,
0.22960610687732697,
-0.07408902794122696,
0.3541991114616394,
0.39586180448532104,
0.09608818590641022,
0.5392206907272339,
1.1190005540847778,
0.6798588633537292,
0.39872148633003235,
0.7303479313850403,
-2.2187600135803223,
1.3135466575622559,
-0.9454169273376465,
0.3410692512989044,
1.310464859008789,
-1.0366201400756836,
0.26549333333969116,
-1.7772846221923828,
-0.10135839134454727,
0.4809313714504242,
-2.2240633964538574,
0.24647657573223114,
-1.3622256517410278,
-0.4965038299560547,
1.1378463506698608,
0.41133174300193787,
-1.1790223121643066,
0.005454249680042267,
-0.3640616834163666,
0.9170277714729309,
0.4203247129917145,
1.209397554397583,
-1.6260755062103271,
-0.03640614077448845,
-0.3035019040107727,
0.19643792510032654,
-1.208227276802063,
-1.5039453506469727,
0.5201303362846375,
0.7256143093109131,
0.5277409553527832,
-0.1337052434682846,
0.9404176473617554,
-0.9708308577537537,
0.7702440619468689,
-0.9740948677062988,
-1.8126100301742554,
-1.3823399543762207,
-2.299899101257324,
-2.3125557899475098,
0.7456579804420471,
-0.4264708459377289,
-0.3869904577732086,
2.172450065612793,
-1.076513648033142,
-1.763405442237854,
1.0554205179214478,
0.2702477276325226,
-0.055744919925928116,
2.2984588146209717,
0.18882882595062256,
-0.714577317237854,
0.5077380537986755,
-0.8652422428131104,
0.5823383927345276,
-0.36583277583122253,
1.2491087913513184,
0.3924625515937805,
-1.1063899993896484,
1.5248230695724487,
-0.3278963565826416,
0.6419958472251892,
-0.676162600517273,
-0.39849257469177246,
-0.6135581731796265,
0.22505079209804535,
1.911577820777893,
-0.2920919954776764,
1.4469410181045532,
-0.2790369987487793,
-1.5041173696517944,
-1.483567714691162,
0.7719333171844482,
0.6260297298431396,
-0.5855658650398254,
0.10885129868984222,
-0.2694595456123352,
0.07878415286540985,
-0.037460751831531525,
1.029615044593811,
1.2780085802078247,
0.8750396370887756,
-0.3272048830986023,
-0.947987973690033,
0.22112135589122772,
0.03323476016521454,
-0.7501741647720337,
-1.7575727701187134,
-0.281820684671402,
0.06260134279727936,
0.6537355780601501,
-1.2189947366714478,
1.793107271194458,
0.819896936416626,
1.9707802534103394,
0.9768354296684265,
-0.3952659070491791,
1.5988807678222656,
0.15401652455329895,
1.8860447406768799,
-0.38734373450279236,
0.6817343235015869,
-0.3703157305717468,
-1.1192436218261719,
0.794691801071167,
-0.29544299840927124,
-2.108640432357788,
-0.499861478805542,
-0.8279936909675598,
-0.1106182187795639,
-0.7678015232086182,
1.0319187641143799,
-0.19410358369350433,
-1.4047454595565796,
0.2191244512796402,
-0.7929510474205017,
0.03266259655356407,
-1.333580493927002,
0.3216783404350281,
0.786063015460968,
-0.6337772011756897,
0.13221903145313263,
-0.3435002565383911,
-1.2891556024551392,
-0.5093215107917786,
0.38980281352996826,
1.7284691333770752,
-0.7626101970672607,
1.0518360137939453,
1.0970890522003174,
-0.6899408102035522,
-0.05678906664252281,
0.44261977076530457,
-0.3232765793800354,
0.9679373502731323,
-1.0348491668701172,
-0.41495510935783386,
1.1661523580551147,
-0.2113395780324936,
-0.5750852227210999,
1.4343029260635376,
0.6762926578521729,
-0.9601715803146362,
-0.2047823667526245,
-0.08010026067495346,
-0.7726653814315796,
0.07591903209686279,
-1.6650251150131226,
-0.03192787989974022,
0.35094794631004333,
-1.5902959108352661,
-0.46703752875328064,
-0.18046934902668,
1.3476842641830444,
-0.06360603868961334,
1.4120428562164307,
-0.20274434983730316,
-0.19742681086063385,
-0.47670623660087585,
-0.32795143127441406,
0.07913936674594879,
-0.22586865723133087,
-0.5575340986251831,
0.31154665350914,
-0.7174777984619141,
0.2955022156238556,
1.4445288181304932,
0.31063327193260193,
-0.017006054520606995,
0.5708506107330322,
1.034090518951416,
0.40478286147117615,
-0.15661758184432983,
-0.8577731847763062,
-1.6012274026870728,
2.0419211387634277,
-1.407678484916687,
2.002223253250122,
0.7759425044059753,
-0.04157959669828415,
-1.7837995290756226,
-2.009413003921509,
1.4272626638412476,
1.0019596815109253,
2.44340443611145,
0.5963127017021179,
0.45733487606048584,
-0.8635619282722473,
-0.6419838666915894,
0.3684106469154358,
-0.9050610065460205,
-0.8211641311645508,
0.11904413998126984,
2.432887077331543,
1.6107099056243896,
-0.35357406735420227,
-0.11827237159013748,
-1.1539555788040161,
1.4990168809890747,
-0.08003149926662445,
0.19813579320907593,
1.9394044876098633,
-0.25678104162216187,
-1.0477409362792969,
1.2743161916732788,
-2.285226583480835,
0.19021277129650116,
1.9773212671279907,
0.21526768803596497,
0.08218394219875336,
-1.4128925800323486,
-0.7360590696334839,
-0.19099785387516022,
-0.5039843320846558,
-1.1690490245819092,
0.5696006417274475,
-0.17990216612815857,
-0.793091893196106,
-1.4154925346374512,
0.13280171155929565,
-1.1057803630828857,
-1.798068881034851,
0.18775054812431335,
1.7821574211120605,
1.9347167015075684,
-0.7609239220619202,
1.5111491680145264,
-0.29055720567703247,
0.21299366652965546,
1.1951723098754883,
1.1909704208374023,
3.1472926139831543,
1.9943211078643799,
-1.3501474857330322,
0.749180018901825,
0.0019874321296811104,
-0.4309444725513458,
1.1664048433303833,
-1.1751532554626465,
1.3069437742233276,
-0.16988886892795563,
-1.193910002708435,
-1.1835936307907104,
0.8948143720626831,
0.49126771092414856,
0.06335937976837158,
-0.3910430371761322,
1.1349416971206665,
0.12983913719654083,
1.3311667442321777,
0.5909525752067566,
-0.22640672326087952,
0.7670133709907532,
-0.36494314670562744,
-0.4482865333557129,
1.5571447610855103,
0.192259281873703,
-1.3311389684677124,
-2.323585271835327,
-0.2254166305065155,
-0.8921955227851868,
0.008804519660770893,
-0.6461122632026672,
-0.9319092631340027,
1.6140787601470947,
0.5314175486564636,
-1.1500529050827026,
-0.16723871231079102,
-0.3593694269657135,
-0.5990771055221558,
2.6525232791900635,
-1.4328618049621582,
-0.20426717400550842,
-1.0611106157302856,
-0.6402307152748108,
1.5565282106399536,
-1.1575788259506226,
-0.2252713143825531,
-1.0456887483596802,
-0.4979623854160309,
-1.2764654159545898,
-0.6486955881118774,
-0.06790447980165482,
-0.864013671875,
0.8685643076896667,
0.1263376921415329,
-1.282641887664795,
-0.35563477873802185,
-0.9534326791763306,
0.8254086375236511,
-0.03930870443582535,
0.13755731284618378,
1.7839521169662476,
0.3894806504249573,
-0.29816192388534546,
0.656743049621582,
1.0621464252471924,
0.6101412177085876,
-0.5731985569000244,
0.3833993077278137,
-0.732492208480835,
0.33538317680358887,
-1.2202188968658447,
0.2812930643558502,
-2.839721918106079,
0.5970919728279114,
-0.054601024836301804,
-0.03409966826438904,
-0.15896447002887726,
-1.3192033767700195,
1.1202857494354248,
2.6564061641693115,
-1.1551018953323364,
0.5980657935142517,
0.27567216753959656,
1.1640772819519043,
-1.5260647535324097,
0.1996764838695526,
-0.5092800259590149,
2.161125898361206,
0.16353145241737366,
1.2091073989868164,
-0.45725932717323303,
-2.3514955043792725,
0.6487293839454651,
-1.2236202955245972,
-1.1415579319000244,
0.8031014204025269,
-0.7915122509002686,
0.06489061564207077,
-1.1944063901901245,
-0.17063505947589874,
-0.7529007792472839,
-1.1857938766479492,
0.5713748931884766,
0.0887131541967392,
0.6279821395874023,
-0.7063105702400208,
0.35482460260391235,
-2.229612112045288,
-1.2730967998504639,
-0.26118892431259155,
-0.959287166595459,
0.39533692598342896,
-0.28400519490242004,
0.8058292269706726,
-0.20427446067333221,
-0.06912297755479813,
0.3593425452709198,
1.2673817873001099,
3.3540918827056885,
0.04633060470223427,
0.28863710165023804,
-0.1946106255054474,
-1.0002082586288452,
1.4242126941680908,
0.9290327429771423,
-0.18739572167396545,
-0.5460330843925476,
-1.0679587125778198,
1.1577140092849731,
2.001832962036133,
1.0871888399124146,
0.042969413101673126,
-0.889074981212616,
-0.8717212677001953,
0.05860006809234619,
0.1377861499786377,
0.5103597640991211,
0.9428651332855225,
0.15318264067173004,
0.09229036420583725,
1.4870233535766602,
1.1658591032028198,
-0.32725346088409424,
0.40679484605789185,
-0.8382846117019653,
-0.5151092410087585,
0.6107107400894165,
0.38612380623817444,
0.03968095779418945,
0.28996092081069946,
-1.162458062171936,
-0.1784793585538864,
-0.3433060348033905,
-0.9027627110481262,
-0.7187528610229492,
-0.38208046555519104,
-0.3915412724018097,
1.740936279296875,
-0.016195671632885933,
-0.5289273262023926,
-0.05309941619634628,
-0.7779624462127686,
0.06760214269161224,
-0.9509560465812683,
0.4392223656177521,
-0.2524588406085968,
0.026178427040576935,
-0.11481564491987228,
1.7637338638305664,
-0.9268439412117004,
-2.0678839683532715,
0.27061015367507935,
0.14276820421218872,
-0.3980504274368286,
0.22928954660892487,
1.6094238758087158,
0.678487241268158,
1.4480341672897339,
1.4247959852218628,
1.022925853729248,
-0.6733531355857849,
-1.3737691640853882,
0.6620491743087769,
0.9655035734176636,
-1.444716215133667,
0.6328179240226746,
0.030121054500341415,
-0.5340155363082886,
0.541512131690979,
1.2976726293563843,
0.43790292739868164,
-2.0954864025115967,
0.7796702980995178,
-0.893276572227478,
0.7326180934906006,
0.7556915879249573,
0.7870343327522278,
0.04099027067422867,
0.7568396329879761,
-1.2945597171783447,
-1.0283854007720947,
-0.6126391887664795,
-0.6852137446403503,
1.8833483457565308,
-0.37631985545158386,
0.574737548828125,
-0.24389347434043884,
-1.452399492263794,
-0.04837498813867569,
0.5636626482009888,
0.29911163449287415,
-0.5351707339286804,
0.7831159234046936,
-0.5872882008552551,
-1.223311424255371,
-1.3504667282104492,
-0.5389552116394043,
-1.0776268243789673,
-0.8956142663955688,
0.9957628846168518,
0.8263877034187317,
0.48887690901756287,
1.810551643371582,
0.6048521995544434,
0.18212246894836426,
-2.6596624851226807,
0.8691641092300415,
0.36407849192619324,
-0.06166138872504234,
0.8194894790649414,
0.2929843068122864,
1.0127027034759521,
-0.18569158017635345,
0.650210976600647,
-2.419945001602173,
2.4064667224884033,
-0.1578112542629242,
0.6912627816200256,
0.09767089039087296,
-0.1331566423177719,
0.993723452091217,
0.6151259541511536,
0.6307801604270935,
-1.1151460409164429,
0.7766383290290833,
-0.689957320690155,
1.3468782901763916,
0.7668423652648926,
-0.8383753895759583,
-0.11729580909013748,
1.2351255416870117,
0.4436267912387848,
-0.3944527804851532,
-0.9050113558769226,
-1.1140141487121582,
0.9573677182197571,
1.8282150030136108,
-0.10870040953159332,
0.07978048175573349,
0.8625314831733704,
0.7322334051132202,
-1.3915704488754272,
-0.04993176460266113,
-0.787817656993866,
-0.6614288091659546,
1.6492600440979004,
2.0630927085876465,
-0.09040650725364685,
-0.22856292128562927,
-0.821774423122406,
-1.284550428390503,
0.7539585828781128,
0.10946271568536758,
0.03606879338622093,
0.6558495759963989,
-0.5278729796409607,
1.201097011566162,
0.91774582862854,
0.9730508923530579,
0.2996998131275177,
0.21928146481513977,
0.1033494621515274,
-0.37470778822898865,
-1.2573708295822144,
-0.24500355124473572,
-0.9370842576026917,
-2.5037126541137695,
0.487549751996994,
-0.1601869910955429,
-1.466511845588684,
0.004681277088820934,
-1.023918628692627,
0.7726453542709351,
-0.4718295633792877,
-1.1165517568588257,
-1.4385566711425781,
0.1571188122034073,
-0.14619319140911102,
0.9270360469818115,
-1.5913381576538086,
-0.029349830001592636,
1.2985247373580933,
1.033934235572815,
-0.7461585998535156,
0.9821719527244568,
0.21980206668376923,
1.0256853103637695,
0.9082002639770508,
-0.3041664659976959,
0.45938488841056824,
0.23495198786258698,
-1.2964836359024048,
0.3860083222389221,
1.2261637449264526,
0.1941889375448227,
1.564541220664978,
-0.7253893613815308,
0.042821597307920456,
0.4042840600013733,
-0.37937021255493164,
-0.49459564685821533,
-0.756550133228302,
0.7239310145378113,
-0.09266310930252075,
-0.9563258290290833,
0.09454774856567383,
-0.014398743398487568,
-0.08460987359285355,
0.19198453426361084,
-1.5098117589950562,
-0.07493387907743454,
-0.30477339029312134,
-0.6790062785148621,
-1.211706280708313,
-0.06286618113517761,
1.3409113883972168,
-0.790192723274231,
-0.08772704750299454,
0.46809878945350647,
0.2010517418384552,
0.5495280027389526,
0.7416607737541199,
-0.6424235105514526,
-0.459805428981781,
-0.19693723320960999,
-0.42781755328178406,
0.4027802050113678,
1.3310765027999878,
-0.07196070998907089,
-0.9624107480049133,
0.7064212560653687,
-0.4146496057510376,
0.05861305445432663,
1.9375332593917847,
0.03748886287212372,
-0.8643317222595215,
0.3640396296977997,
-0.7258789539337158,
1.9492610692977905,
1.7207192182540894,
1.343082308769226,
-0.0942719355225563,
-1.0697873830795288,
0.5526807308197021,
-0.36575064063072205,
-0.45047011971473694,
0.9733681678771973,
0.4239189922809601,
-0.2437233030796051,
-1.3081847429275513,
0.6406428813934326,
1.281710147857666,
-0.9498729109764099,
-0.877678632736206,
0.1974860578775406,
-0.7745667099952698,
1.0941108465194702,
0.7834588289260864,
0.3668763041496277,
0.27704358100891113,
1.6008758544921875,
0.8064635992050171,
-0.48540639877319336,
0.6056217551231384,
0.41334718465805054,
-0.21878790855407715,
-2.0383546352386475,
-1.164758324623108,
0.34497782588005066,
-0.5897967219352722,
-1.6033525466918945,
1.3648838996887207,
-1.2398523092269897,
-0.9625056982040405,
0.52474445104599,
0.11967039108276367,
1.4017198085784912,
0.29758408665657043,
1.5736665725708008,
1.9578499794006348,
0.9385259747505188,
0.3745138943195343,
1.310482382774353,
-0.24845753610134125,
-0.41924527287483215,
1.6944632530212402,
-0.5546043515205383,
0.5742477774620056,
1.1076115369796753,
-0.37638601660728455,
-1.0793246030807495,
-0.8664276003837585,
-1.1611974239349365,
-0.7997381091117859,
1.143658995628357,
0.06082521378993988,
-1.1379055976867676,
0.328498512506485,
1.540809988975525,
0.048664070665836334,
-0.22818070650100708,
0.6970563530921936,
0.24924232065677643,
-0.7645156383514404,
-0.11186423152685165,
-0.985973596572876,
0.4800061285495758,
-0.3580399751663208,
-0.42187532782554626,
0.2678031027317047,
0.4731729030609131,
1.2726472616195679,
-0.01047459989786148,
0.09194031357765198,
1.249660849571228,
-1.360550045967102,
1.509250521659851,
-0.8402036428451538,
0.3157036006450653,
-2.3424782752990723,
1.3531991243362427,
-0.8678601384162903,
1.8715531826019287,
-2.715082883834839,
0.3895355463027954,
-0.4371744692325592,
-0.4397849440574646,
0.1845182478427887,
-0.28499114513397217,
0.15798348188400269,
-0.17804664373397827,
-1.2082388401031494,
-0.1859075427055359,
-0.8561223745346069,
0.5540541410446167,
1.072108268737793,
1.3866264820098877,
-1.0609794855117798,
-0.3007179796695709,
-1.7014727592468262,
-0.20231738686561584,
-0.6417866349220276,
0.43120077252388,
-1.8689298629760742,
-0.19796936213970184,
-1.8942543268203735,
-2.4442849159240723,
-1.1927664279937744,
-0.8796824812889099,
1.1493037939071655,
0.044535454362630844,
-0.831729531288147,
1.0632834434509277,
-0.3624400496482849,
-1.912880778312683,
1.160238265991211,
-2.2374684810638428
] |
https://github.com/huggingface/datasets/issues/5145 | Dataset order is not deterministic with ZIP archives and `iter_files` | Besides the linked PR, to make the loading process fully deterministic, I believe we should also sort the data files [here](https://github.com/huggingface/datasets/blob/df4bdd365f2abb695f113cbf8856a925bc70901b/src/datasets/data_files.py#L276) and [here](https://github.com/huggingface/datasets/blob/df4bdd365f2abb695f113cbf8856a925bc70901b/src/datasets/data_files.py#L485) (e.g. fsspec's `LocalFileSystem.glob` relies on `os.scandir`, which yields the contents in arbitrary order). My concern is the overhead of these sorts... Maybe we could introduce a new flag to `load_dataset` similar to TFDS' [`shuffle_files`](https://www.tensorflow.org/datasets/determinism#determinism_when_reading) or sort only if the number of data files is small? | ### Describe the bug
For the `beans` dataset (did not try on other), the order of samples is not the same on different machines. Tested on my local laptop, github actions machine, and ec2 instance. The three yield a different order.
### Steps to reproduce the bug
In a clean docker container or conda environment with datasets==2.6.1, run
```python
from datasets import load_dataset
from pprint import pprint
data = load_dataset("beans", split="validation")
pprint(data["image_file_path"])
```
### Expected behavior
The order of the images is the same on all machines.
### Environment info
On the EC2 instance:
```
- `datasets` version: 2.6.1
- Platform: Linux-4.14.291-218.527.amzn2.x86_64-x86_64-with-glibc2.2.5
- Python version: 3.7.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
- Numpy version: not checked
```
On my local laptop:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-50-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- PyArrow version: 7.0.0
- Pandas version: 1.3.5
- Numpy version: 1.23.1
```
On github actions:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-azure-x86_64-with-glibc2.2.5
- Python version: 3.8.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
- Numpy version: 1.23.4
``` | 464 | 68 | Dataset order is not deterministic with ZIP archives and `iter_files`
### Describe the bug
For the `beans` dataset (did not try on other), the order of samples is not the same on different machines. Tested on my local laptop, github actions machine, and ec2 instance. The three yield a different order.
### Steps to reproduce the bug
In a clean docker container or conda environment with datasets==2.6.1, run
```python
from datasets import load_dataset
from pprint import pprint
data = load_dataset("beans", split="validation")
pprint(data["image_file_path"])
```
### Expected behavior
The order of the images is the same on all machines.
### Environment info
On the EC2 instance:
```
- `datasets` version: 2.6.1
- Platform: Linux-4.14.291-218.527.amzn2.x86_64-x86_64-with-glibc2.2.5
- Python version: 3.7.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
- Numpy version: not checked
```
On my local laptop:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-50-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- PyArrow version: 7.0.0
- Pandas version: 1.3.5
- Numpy version: 1.23.1
```
On github actions:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-azure-x86_64-with-glibc2.2.5
- Python version: 3.8.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
- Numpy version: 1.23.4
```
Besides the linked PR, to make the loading process fully deterministic, I believe we should also sort the data files [here](https://github.com/huggingface/datasets/blob/df4bdd365f2abb695f113cbf8856a925bc70901b/src/datasets/data_files.py#L276) and [here](https://github.com/huggingface/datasets/blob/df4bdd365f2abb695f113cbf8856a925bc70901b/src/datasets/data_files.py#L485) (e.g. fsspec's `LocalFileSystem.glob` relies on `os.scandir`, which yields the contents in arbitrary order). My concern is the overhead of these sorts... Maybe we could introduce a new flag to `load_dataset` similar to TFDS' [`shuffle_files`](https://www.tensorflow.org/datasets/determinism#determinism_when_reading) or sort only if the number of data files is small? | [
-1.1683191061019897,
-0.8405848741531372,
-0.6860842704772949,
1.42128586769104,
-0.16996097564697266,
-1.2829854488372803,
0.22453084588050842,
-1.080722451210022,
1.7210544347763062,
-0.7880798578262329,
0.34916266798973083,
-1.678794264793396,
0.07029286026954651,
-0.5135806202888489,
-0.7411773800849915,
-0.8606942296028137,
-0.48798227310180664,
-0.6471756100654602,
1.0652674436569214,
2.422390937805176,
1.1933592557907104,
-1.3522732257843018,
2.632603406906128,
0.7087148427963257,
-0.14862345159053802,
-0.9337313771247864,
0.49640098214149475,
0.01907600462436676,
-1.4880294799804688,
-0.2778741717338562,
-0.8994022607803345,
-0.12090469151735306,
-0.5560408234596252,
-0.6391489505767822,
0.03257879614830017,
0.34981927275657654,
-0.31281420588493347,
-0.5163669586181641,
-0.4650658667087555,
-0.8198853135108948,
0.4206562340259552,
-0.30004602670669556,
0.9154852032661438,
-0.4225645065307617,
1.7469239234924316,
-0.548485517501831,
0.6033366918563843,
0.7838395833969116,
1.2645279169082642,
0.22638912498950958,
-0.06711804121732712,
0.35691559314727783,
0.4022665321826935,
0.10686101019382477,
0.5396809577941895,
1.1173019409179688,
0.6674344539642334,
0.40670689940452576,
0.7437271475791931,
-2.2223684787750244,
1.2997605800628662,
-0.9370460510253906,
0.32660117745399475,
1.3236515522003174,
-1.032690405845642,
0.2665364742279053,
-1.784446120262146,
-0.09158700704574585,
0.48762211203575134,
-2.240173816680908,
0.24303391575813293,
-1.3627121448516846,
-0.518179178237915,
1.10819411277771,
0.4041910469532013,
-1.1766767501831055,
0.021362915635108948,
-0.386548787355423,
0.9158867001533508,
0.445722758769989,
1.224265694618225,
-1.6336982250213623,
-0.02891366556286812,
-0.3021124005317688,
0.19914177060127258,
-1.2085626125335693,
-1.5013240575790405,
0.5316804647445679,
0.7386084198951721,
0.5124496817588806,
-0.15446990728378296,
0.9533967971801758,
-0.9661436080932617,
0.7803822159767151,
-0.9626356363296509,
-1.81484055519104,
-1.3628785610198975,
-2.2824513912200928,
-2.2891252040863037,
0.7320284843444824,
-0.4394966661930084,
-0.3929261267185211,
2.1782398223876953,
-1.066576600074768,
-1.769588589668274,
1.035363793373108,
0.26070094108581543,
-0.055046841502189636,
2.311654806137085,
0.16868221759796143,
-0.6940348744392395,
0.49915263056755066,
-0.8468504548072815,
0.6021248698234558,
-0.36293017864227295,
1.2242587804794312,
0.39196744561195374,
-1.1100008487701416,
1.5246574878692627,
-0.3328395485877991,
0.6485834717750549,
-0.6719691157341003,
-0.39196524024009705,
-0.6152212619781494,
0.2074798196554184,
1.9383437633514404,
-0.308610737323761,
1.4501111507415771,
-0.26947474479675293,
-1.501340389251709,
-1.4907734394073486,
0.7892357110977173,
0.6312350630760193,
-0.5861116647720337,
0.11640606820583344,
-0.2588910460472107,
0.08793782442808151,
-0.05243271216750145,
1.0471274852752686,
1.27134108543396,
0.8843319416046143,
-0.31768089532852173,
-0.9200138449668884,
0.20964652299880981,
0.03271448612213135,
-0.7714377045631409,
-1.7484370470046997,
-0.28008195757865906,
0.06554988771677017,
0.6547406315803528,
-1.2214219570159912,
1.7875066995620728,
0.8228380680084229,
1.9707051515579224,
0.9610499143600464,
-0.4051540791988373,
1.601852297782898,
0.14039181172847748,
1.8906697034835815,
-0.4026924967765808,
0.6631457209587097,
-0.37941625714302063,
-1.139270544052124,
0.7997685670852661,
-0.291946142911911,
-2.1054165363311768,
-0.4919489324092865,
-0.8451132774353027,
-0.11626426875591278,
-0.7667558193206787,
1.0191625356674194,
-0.20754684507846832,
-1.3783797025680542,
0.2010432481765747,
-0.7853981256484985,
0.022108428180217743,
-1.3346325159072876,
0.31461232900619507,
0.7869806289672852,
-0.6393487453460693,
0.10543419420719147,
-0.3351711332798004,
-1.290541648864746,
-0.5262294411659241,
0.39299386739730835,
1.7277004718780518,
-0.7590819597244263,
1.0431264638900757,
1.0877066850662231,
-0.7096888422966003,
-0.056179992854595184,
0.437147319316864,
-0.31695839762687683,
0.9543409943580627,
-1.0448486804962158,
-0.43923044204711914,
1.167634129524231,
-0.20045876502990723,
-0.5713816285133362,
1.4438127279281616,
0.6748056411743164,
-0.9742787480354309,
-0.22639045119285583,
-0.07784656435251236,
-0.7670937180519104,
0.06728307902812958,
-1.6532437801361084,
-0.0368763729929924,
0.34111228585243225,
-1.593465805053711,
-0.4797613322734833,
-0.19357500970363617,
1.3505977392196655,
-0.06541111320257187,
1.425514578819275,
-0.20269273221492767,
-0.2047651708126068,
-0.4820284843444824,
-0.3415558338165283,
0.08927638083696365,
-0.22720304131507874,
-0.5576413869857788,
0.309879332780838,
-0.7161062955856323,
0.2847349941730499,
1.4445228576660156,
0.305083692073822,
-0.008818550035357475,
0.5715945363044739,
1.0402628183364868,
0.4076420068740845,
-0.17099912464618683,
-0.8722673654556274,
-1.5893433094024658,
2.0373027324676514,
-1.411695957183838,
1.9892398118972778,
0.7704474925994873,
-0.02852296084165573,
-1.8025926351547241,
-2.0298261642456055,
1.42425537109375,
1.0092096328735352,
2.4282217025756836,
0.5930048823356628,
0.45630326867103577,
-0.8549295663833618,
-0.6302279829978943,
0.35867416858673096,
-0.8985639214515686,
-0.8125420808792114,
0.12731881439685822,
2.4399573802948,
1.6112624406814575,
-0.38475972414016724,
-0.12986673414707184,
-1.1482688188552856,
1.4871047735214233,
-0.07524379342794418,
0.20446906983852386,
1.9463450908660889,
-0.26169541478157043,
-1.0485948324203491,
1.2685052156448364,
-2.281904697418213,
0.19273610413074493,
1.9680366516113281,
0.21444018185138702,
0.08173869550228119,
-1.3950681686401367,
-0.7340085506439209,
-0.19452472031116486,
-0.512417197227478,
-1.1726089715957642,
0.558911144733429,
-0.19957830011844635,
-0.8028746843338013,
-1.3963909149169922,
0.12138579785823822,
-1.093827247619629,
-1.78506338596344,
0.18633760511875153,
1.795544981956482,
1.916516900062561,
-0.765545666217804,
1.5122498273849487,
-0.3197818696498871,
0.19873204827308655,
1.2155041694641113,
1.1880446672439575,
3.146533727645874,
1.9978456497192383,
-1.3444864749908447,
0.7613831162452698,
-0.008772746659815311,
-0.4083256125450134,
1.1735512018203735,
-1.1633703708648682,
1.3013992309570312,
-0.17011578381061554,
-1.2136207818984985,
-1.1715701818466187,
0.9110738039016724,
0.49360015988349915,
0.07703065127134323,
-0.4099545478820801,
1.150502324104309,
0.13337600231170654,
1.3437789678573608,
0.6025975346565247,
-0.24068810045719147,
0.757790744304657,
-0.357120156288147,
-0.45317184925079346,
1.5790081024169922,
0.18531101942062378,
-1.3303660154342651,
-2.3443939685821533,
-0.240715891122818,
-0.897114098072052,
0.02956727147102356,
-0.6380809545516968,
-0.9362750053405762,
1.631629467010498,
0.5148993730545044,
-1.1581246852874756,
-0.1785016804933548,
-0.37453150749206543,
-0.5959451794624329,
2.6504929065704346,
-1.450736165046692,
-0.19340407848358154,
-1.0453194379806519,
-0.6211724281311035,
1.5621211528778076,
-1.170899748802185,
-0.23111075162887573,
-1.046613335609436,
-0.4836673140525818,
-1.28779137134552,
-0.6434000730514526,
-0.05228995904326439,
-0.8645773530006409,
0.8755854964256287,
0.11359933763742447,
-1.2797006368637085,
-0.34048694372177124,
-0.9471750259399414,
0.8370557427406311,
-0.0502142570912838,
0.14778047800064087,
1.8054752349853516,
0.42238011956214905,
-0.3061615824699402,
0.6536029577255249,
1.072953224182129,
0.6249815225601196,
-0.5800476670265198,
0.384000688791275,
-0.7329690456390381,
0.32530608773231506,
-1.2316842079162598,
0.2704099118709564,
-2.829144239425659,
0.5991523861885071,
-0.05549884960055351,
-0.021195240318775177,
-0.15520110726356506,
-1.3210333585739136,
1.0952128171920776,
2.6726579666137695,
-1.1652636528015137,
0.563991904258728,
0.27369171380996704,
1.1728646755218506,
-1.5031170845031738,
0.17833100259304047,
-0.5021322965621948,
2.150970458984375,
0.15965282917022705,
1.1938791275024414,
-0.4413019120693207,
-2.3363876342773438,
0.6426073312759399,
-1.2191526889801025,
-1.1481060981750488,
0.8262671828269958,
-0.7772472500801086,
0.05967119708657265,
-1.2085330486297607,
-0.16251914203166962,
-0.7591457366943359,
-1.1802341938018799,
0.5846060514450073,
0.09826918691396713,
0.6348469257354736,
-0.725028932094574,
0.34065109491348267,
-2.217057228088379,
-1.265942096710205,
-0.2606660723686218,
-0.9557735919952393,
0.4020957946777344,
-0.2642776668071747,
0.8100732564926147,
-0.20585763454437256,
-0.05479897931218147,
0.3580883741378784,
1.2793141603469849,
3.3470730781555176,
0.04299725219607353,
0.2865080237388611,
-0.19904884696006775,
-0.99936842918396,
1.438122272491455,
0.926139771938324,
-0.18626317381858826,
-0.5449605584144592,
-1.0566409826278687,
1.1350032091140747,
2.0012593269348145,
1.083396315574646,
0.04102180898189545,
-0.891373872756958,
-0.8596599102020264,
0.05941211059689522,
0.15174496173858643,
0.5283224582672119,
0.9390900135040283,
0.1319109946489334,
0.08326079696416855,
1.4722400903701782,
1.1692761182785034,
-0.3287034332752228,
0.4122384190559387,
-0.8423073887825012,
-0.5200296640396118,
0.6132276654243469,
0.39015892148017883,
0.04498223587870598,
0.29806646704673767,
-1.1561570167541504,
-0.19748492538928986,
-0.35097962617874146,
-0.9116129279136658,
-0.7061204314231873,
-0.37657293677330017,
-0.40931475162506104,
1.7274187803268433,
-0.00939047522842884,
-0.5211489796638489,
-0.04955696687102318,
-0.7663776278495789,
0.0581493116915226,
-0.9652978777885437,
0.4476325213909149,
-0.2540037930011749,
0.025736428797245026,
-0.10171743482351303,
1.7470552921295166,
-0.9337570071220398,
-2.0680906772613525,
0.28368884325027466,
0.1309344619512558,
-0.41377130150794983,
0.24889877438545227,
1.6105085611343384,
0.6772764921188354,
1.4510319232940674,
1.4249223470687866,
1.0256928205490112,
-0.683961033821106,
-1.3574203252792358,
0.6577046513557434,
0.9643596410751343,
-1.4624813795089722,
0.6337252855300903,
0.041886720806360245,
-0.5389605760574341,
0.5475785732269287,
1.291087031364441,
0.4205380380153656,
-2.0947604179382324,
0.7896636128425598,
-0.8821746110916138,
0.718816339969635,
0.7504587769508362,
0.7870870232582092,
0.042365752160549164,
0.763607919216156,
-1.2736667394638062,
-1.0481733083724976,
-0.6274526119232178,
-0.6751729249954224,
1.8719358444213867,
-0.3711341321468353,
0.5489175319671631,
-0.24976874887943268,
-1.4341800212860107,
-0.04780961573123932,
0.5594934821128845,
0.3116734027862549,
-0.5293816328048706,
0.7943310141563416,
-0.607384979724884,
-1.2090004682540894,
-1.3312450647354126,
-0.5547158122062683,
-1.0703387260437012,
-0.9019983410835266,
0.9967601299285889,
0.8401230573654175,
0.4850078225135803,
1.8142997026443481,
0.5963560342788696,
0.17997196316719055,
-2.644057273864746,
0.8635505437850952,
0.3649708926677704,
-0.07890357822179794,
0.8287887573242188,
0.30578112602233887,
1.023119330406189,
-0.18919891119003296,
0.6492161154747009,
-2.4140336513519287,
2.4012084007263184,
-0.16454528272151947,
0.683768630027771,
0.09497562050819397,
-0.1348409205675125,
0.9904773235321045,
0.6116575598716736,
0.6178877949714661,
-1.1154121160507202,
0.7619792819023132,
-0.7004849314689636,
1.3319518566131592,
0.7742979526519775,
-0.844755232334137,
-0.10946067422628403,
1.242154836654663,
0.473266065120697,
-0.39066454768180847,
-0.893839955329895,
-1.0998649597167969,
0.9532216191291809,
1.8300966024398804,
-0.11455364525318146,
0.1042766124010086,
0.8536041378974915,
0.7332427501678467,
-1.400252103805542,
-0.03984382376074791,
-0.8039796352386475,
-0.6686854958534241,
1.6308348178863525,
2.032224416732788,
-0.08100136369466782,
-0.21019116044044495,
-0.8326363563537598,
-1.288693904876709,
0.7569771409034729,
0.10394597798585892,
0.05370675399899483,
0.6562207937240601,
-0.5357755422592163,
1.2008808851242065,
0.9064827561378479,
0.9715978503227234,
0.30782216787338257,
0.2323622852563858,
0.12039831280708313,
-0.3735405504703522,
-1.2340854406356812,
-0.23492218554019928,
-0.9428688883781433,
-2.500028610229492,
0.5002633929252625,
-0.18744830787181854,
-1.4694050550460815,
-0.004630400333553553,
-1.0194363594055176,
0.7696499824523926,
-0.47692009806632996,
-1.1314778327941895,
-1.4427927732467651,
0.169549822807312,
-0.1359027773141861,
0.9399855136871338,
-1.5794050693511963,
-0.03361364081501961,
1.2950279712677002,
1.0256881713867188,
-0.7356716394424438,
0.9600006937980652,
0.23776450753211975,
1.0488911867141724,
0.9091854691505432,
-0.30807244777679443,
0.4537409543991089,
0.2175111323595047,
-1.3013967275619507,
0.36670422554016113,
1.2085745334625244,
0.18578045070171356,
1.5669193267822266,
-0.7182027101516724,
0.030618984252214432,
0.40229901671409607,
-0.38028568029403687,
-0.49714791774749756,
-0.7699586749076843,
0.704227089881897,
-0.10135464370250702,
-0.9675580859184265,
0.09238779544830322,
-0.010096349753439426,
-0.10120753943920135,
0.20978602766990662,
-1.4951837062835693,
-0.07974870502948761,
-0.3124998211860657,
-0.6688311696052551,
-1.2314316034317017,
-0.051097322255373,
1.3364754915237427,
-0.7872084975242615,
-0.08241942524909973,
0.46463534235954285,
0.20246827602386475,
0.5366896390914917,
0.7407066822052002,
-0.637588381767273,
-0.45700839161872864,
-0.2071821540594101,
-0.4463629126548767,
0.38836726546287537,
1.34176766872406,
-0.08652912825345993,
-0.975207507610321,
0.703682541847229,
-0.40820440649986267,
0.05713311955332756,
1.949236512184143,
0.050902534276247025,
-0.8628488183021545,
0.36475199460983276,
-0.7193010449409485,
1.9350484609603882,
1.7359240055084229,
1.3481647968292236,
-0.1093110516667366,
-1.0489429235458374,
0.5611913204193115,
-0.37314116954803467,
-0.4251665472984314,
0.9682466387748718,
0.42184486985206604,
-0.25426873564720154,
-1.3227835893630981,
0.6383743286132812,
1.3126379251480103,
-0.9443109631538391,
-0.8831197619438171,
0.195402592420578,
-0.7608025670051575,
1.0850005149841309,
0.800144374370575,
0.3611099123954773,
0.2788422107696533,
1.5814217329025269,
0.8154395818710327,
-0.4793042242527008,
0.58888840675354,
0.43322303891181946,
-0.1998385339975357,
-2.0488688945770264,
-1.1676877737045288,
0.35004082322120667,
-0.5703338384628296,
-1.6103135347366333,
1.3732048273086548,
-1.2422540187835693,
-0.9672476649284363,
0.5233645439147949,
0.12132704257965088,
1.390039086341858,
0.3031322956085205,
1.5794994831085205,
1.9616786241531372,
0.9283562898635864,
0.372553288936615,
1.3260098695755005,
-0.21612803637981415,
-0.4077579379081726,
1.700934648513794,
-0.5575944185256958,
0.5730910301208496,
1.116405963897705,
-0.3564257323741913,
-1.0722092390060425,
-0.8753001689910889,
-1.163631796836853,
-0.8069426417350769,
1.173056960105896,
0.06168275699019432,
-1.130401372909546,
0.3333590030670166,
1.5405794382095337,
0.06515200436115265,
-0.23674897849559784,
0.699792206287384,
0.24828752875328064,
-0.7689806818962097,
-0.11545000970363617,
-0.969711184501648,
0.4914851486682892,
-0.33374160528182983,
-0.42289721965789795,
0.2891315221786499,
0.47745269536972046,
1.272807002067566,
-0.009564011357724667,
0.09666099399328232,
1.2503637075424194,
-1.3570908308029175,
1.5080384016036987,
-0.8266629576683044,
0.3143104612827301,
-2.3564348220825195,
1.3666945695877075,
-0.8613041639328003,
1.8627129793167114,
-2.7147552967071533,
0.39852356910705566,
-0.43383634090423584,
-0.4284607768058777,
0.18644504249095917,
-0.291199654340744,
0.1519773304462433,
-0.17205408215522766,
-1.209218978881836,
-0.1895177811384201,
-0.8614842891693115,
0.5653850436210632,
1.085801601409912,
1.3930370807647705,
-1.0573782920837402,
-0.30711910128593445,
-1.7050659656524658,
-0.2090543657541275,
-0.6397298574447632,
0.4392554759979248,
-1.8708873987197876,
-0.20960524678230286,
-1.8920042514801025,
-2.4546828269958496,
-1.2057393789291382,
-0.8905126452445984,
1.1517621278762817,
0.05499431863427162,
-0.8231329321861267,
1.0663962364196777,
-0.37894290685653687,
-1.9149518013000488,
1.1592928171157837,
-2.253967523574829
] |
https://github.com/huggingface/datasets/issues/5145 | Dataset order is not deterministic with ZIP archives and `iter_files` | We already return the result sorted at the end of `_resolve_single_pattern_locally` and `_resolve_single_pattern_in_dataset_repository` if I'm not mistaken | ### Describe the bug
For the `beans` dataset (did not try on other), the order of samples is not the same on different machines. Tested on my local laptop, github actions machine, and ec2 instance. The three yield a different order.
### Steps to reproduce the bug
In a clean docker container or conda environment with datasets==2.6.1, run
```python
from datasets import load_dataset
from pprint import pprint
data = load_dataset("beans", split="validation")
pprint(data["image_file_path"])
```
### Expected behavior
The order of the images is the same on all machines.
### Environment info
On the EC2 instance:
```
- `datasets` version: 2.6.1
- Platform: Linux-4.14.291-218.527.amzn2.x86_64-x86_64-with-glibc2.2.5
- Python version: 3.7.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
- Numpy version: not checked
```
On my local laptop:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-50-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- PyArrow version: 7.0.0
- Pandas version: 1.3.5
- Numpy version: 1.23.1
```
On github actions:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-azure-x86_64-with-glibc2.2.5
- Python version: 3.8.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
- Numpy version: 1.23.4
``` | 464 | 17 | Dataset order is not deterministic with ZIP archives and `iter_files`
### Describe the bug
For the `beans` dataset (did not try on other), the order of samples is not the same on different machines. Tested on my local laptop, github actions machine, and ec2 instance. The three yield a different order.
### Steps to reproduce the bug
In a clean docker container or conda environment with datasets==2.6.1, run
```python
from datasets import load_dataset
from pprint import pprint
data = load_dataset("beans", split="validation")
pprint(data["image_file_path"])
```
### Expected behavior
The order of the images is the same on all machines.
### Environment info
On the EC2 instance:
```
- `datasets` version: 2.6.1
- Platform: Linux-4.14.291-218.527.amzn2.x86_64-x86_64-with-glibc2.2.5
- Python version: 3.7.10
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
- Numpy version: not checked
```
On my local laptop:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-50-generic-x86_64-with-glibc2.35
- Python version: 3.9.12
- PyArrow version: 7.0.0
- Pandas version: 1.3.5
- Numpy version: 1.23.1
```
On github actions:
```
- `datasets` version: 2.6.1
- Platform: Linux-5.15.0-1022-azure-x86_64-with-glibc2.2.5
- Python version: 3.8.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.1
- Numpy version: 1.23.4
```
We already return the result sorted at the end of `_resolve_single_pattern_locally` and `_resolve_single_pattern_in_dataset_repository` if I'm not mistaken | [
-1.1718409061431885,
-0.8479702472686768,
-0.6664557456970215,
1.4503424167633057,
-0.16230417788028717,
-1.299710750579834,
0.2539917826652527,
-1.0689380168914795,
1.7175891399383545,
-0.8049889802932739,
0.34100115299224854,
-1.666566252708435,
0.06584074348211288,
-0.5082171559333801,
-0.7371997833251953,
-0.8602964282035828,
-0.47593438625335693,
-0.6494322419166565,
1.0750012397766113,
2.4027442932128906,
1.211704134941101,
-1.3242818117141724,
2.623579263687134,
0.6924846172332764,
-0.16063927114009857,
-0.941394567489624,
0.46850210428237915,
0.010991381481289864,
-1.4826022386550903,
-0.28721752762794495,
-0.8730708360671997,
-0.11259683966636658,
-0.566500723361969,
-0.6246494054794312,
0.02852039970457554,
0.38222482800483704,
-0.3233964741230011,
-0.5238032937049866,
-0.461961954832077,
-0.8430822491645813,
0.42833852767944336,
-0.2889426648616791,
0.8982506990432739,
-0.4323422312736511,
1.7366031408309937,
-0.5577141642570496,
0.6101135611534119,
0.7974160313606262,
1.261025071144104,
0.20307470858097076,
-0.06839875876903534,
0.32943567633628845,
0.3967055678367615,
0.10054539889097214,
0.5426837801933289,
1.119818091392517,
0.6660906076431274,
0.4066188335418701,
0.7320194840431213,
-2.236513137817383,
1.3222819566726685,
-0.9428097605705261,
0.321853369474411,
1.3148013353347778,
-1.03342866897583,
0.2477700263261795,
-1.7820589542388916,
-0.08840562403202057,
0.4842171370983124,
-2.2287256717681885,
0.25937631726264954,
-1.3741408586502075,
-0.5062510371208191,
1.1218334436416626,
0.41250482201576233,
-1.1592077016830444,
0.004188157618045807,
-0.3829704821109772,
0.9370697736740112,
0.45390716195106506,
1.183396816253662,
-1.6418033838272095,
-0.046706974506378174,
-0.2942647635936737,
0.20776493847370148,
-1.2178794145584106,
-1.5091053247451782,
0.519313395023346,
0.7338845729827881,
0.518575131893158,
-0.15327581763267517,
0.9662624597549438,
-0.9787501096725464,
0.7721633911132812,
-0.9933506846427917,
-1.8049228191375732,
-1.3710778951644897,
-2.294049024581909,
-2.292661666870117,
0.7152578234672546,
-0.4299142062664032,
-0.3953689932823181,
2.186908483505249,
-1.0706146955490112,
-1.755208134651184,
1.0427680015563965,
0.24335877597332,
-0.037239812314510345,
2.2991080284118652,
0.1884552538394928,
-0.7025753855705261,
0.5029008388519287,
-0.8413531184196472,
0.5891735553741455,
-0.371841698884964,
1.2228487730026245,
0.392086923122406,
-1.1314071416854858,
1.4992386102676392,
-0.32834622263908386,
0.667206346988678,
-0.6713333129882812,
-0.4068688452243805,
-0.6111851334571838,
0.20306365191936493,
1.912606954574585,
-0.2858950197696686,
1.4311974048614502,
-0.25031474232673645,
-1.4885557889938354,
-1.497373104095459,
0.7951791882514954,
0.6152632832527161,
-0.583528459072113,
0.10331524163484573,
-0.27878695726394653,
0.07320600748062134,
-0.05978342145681381,
1.0520139932632446,
1.2870182991027832,
0.8860864639282227,
-0.35428500175476074,
-0.9081187844276428,
0.2012101113796234,
0.04339414834976196,
-0.7616773247718811,
-1.7519872188568115,
-0.2612726092338562,
0.0688156932592392,
0.6506991982460022,
-1.1994634866714478,
1.8005162477493286,
0.8207150101661682,
1.9713051319122314,
0.9706665277481079,
-0.3933923840522766,
1.582686424255371,
0.13692215085029602,
1.8861175775527954,
-0.3839772939682007,
0.6515002846717834,
-0.37746644020080566,
-1.1319286823272705,
0.8089902400970459,
-0.2852185070514679,
-2.111232280731201,
-0.5101954340934753,
-0.806664764881134,
-0.11298297345638275,
-0.7643976211547852,
1.0231740474700928,
-0.20311103761196136,
-1.39424467086792,
0.1850709468126297,
-0.7758249044418335,
0.05002652853727341,
-1.3049637079238892,
0.3173281252384186,
0.7856631875038147,
-0.6482715010643005,
0.1256227046251297,
-0.3421320915222168,
-1.2745859622955322,
-0.535002589225769,
0.4429587721824646,
1.7192323207855225,
-0.7320421934127808,
1.042584776878357,
1.10107421875,
-0.6974339485168457,
-0.03579522669315338,
0.4080106019973755,
-0.315470814704895,
0.9432047009468079,
-1.0250035524368286,
-0.4287745952606201,
1.1961241960525513,
-0.231772318482399,
-0.6028386354446411,
1.4572159051895142,
0.6645873785018921,
-0.9736639857292175,
-0.21128453314304352,
-0.0927572101354599,
-0.7775667905807495,
0.07244063913822174,
-1.6480481624603271,
-0.007832190953195095,
0.3688437342643738,
-1.6021219491958618,
-0.45850977301597595,
-0.17849673330783844,
1.3771538734436035,
-0.074551522731781,
1.4322693347930908,
-0.20063109695911407,
-0.19016948342323303,
-0.46660876274108887,
-0.33896735310554504,
0.09139813482761383,
-0.2186013013124466,
-0.5492104291915894,
0.28918057680130005,
-0.7206977605819702,
0.28491002321243286,
1.448980689048767,
0.2824256718158722,
-0.005250247661024332,
0.5468282103538513,
1.0531641244888306,
0.394326776266098,
-0.17021113634109497,
-0.8692294955253601,
-1.5906727313995361,
2.035529136657715,
-1.3976483345031738,
2.0116214752197266,
0.7639783620834351,
-0.048033878207206726,
-1.7964845895767212,
-2.0328142642974854,
1.4008939266204834,
1.007416844367981,
2.4249496459960938,
0.5767084360122681,
0.4426875114440918,
-0.8640385866165161,
-0.640870213508606,
0.3753581941127777,
-0.9062785506248474,
-0.7936766743659973,
0.12741830945014954,
2.4119770526885986,
1.6141695976257324,
-0.3514912724494934,
-0.13554459810256958,
-1.1525771617889404,
1.500825047492981,
-0.0988205149769783,
0.21532104909420013,
1.946255087852478,
-0.25340378284454346,
-1.0261698961257935,
1.2824360132217407,
-2.282074213027954,
0.2111508846282959,
2.003692150115967,
0.20936882495880127,
0.08378108590841293,
-1.3991122245788574,
-0.7275983095169067,
-0.22047099471092224,
-0.48180752992630005,
-1.1729185581207275,
0.5621955394744873,
-0.19392603635787964,
-0.7838150858879089,
-1.3926290273666382,
0.14573030173778534,
-1.0834085941314697,
-1.7923650741577148,
0.19106359779834747,
1.8172451257705688,
1.9353058338165283,
-0.7376232743263245,
1.530683159828186,
-0.31544598937034607,
0.1910768747329712,
1.212458848953247,
1.2225195169448853,
3.1415176391601562,
1.9896541833877563,
-1.353882074356079,
0.773445725440979,
-0.009451509453356266,
-0.41576430201530457,
1.1709401607513428,
-1.1775397062301636,
1.312134861946106,
-0.18312063813209534,
-1.2153769731521606,
-1.1907837390899658,
0.9205612540245056,
0.5000289678573608,
0.07516725361347198,
-0.4193345904350281,
1.1463909149169922,
0.14044195413589478,
1.3478752374649048,
0.6099026203155518,
-0.2471560835838318,
0.7531878352165222,
-0.36807215213775635,
-0.47053277492523193,
1.5581128597259521,
0.207168847322464,
-1.3368173837661743,
-2.331061363220215,
-0.23505164682865143,
-0.8771047592163086,
0.014916909858584404,
-0.6290647387504578,
-0.9390667676925659,
1.6293827295303345,
0.5152634382247925,
-1.1673978567123413,
-0.16884446144104004,
-0.36727049946784973,
-0.5871479511260986,
2.664965867996216,
-1.4168652296066284,
-0.17489440739154816,
-1.0595828294754028,
-0.6410927176475525,
1.5823427438735962,
-1.1891649961471558,
-0.2355654239654541,
-1.0507904291152954,
-0.48310139775276184,
-1.264792799949646,
-0.6308614015579224,
-0.04006151109933853,
-0.8733224272727966,
0.8815441131591797,
0.11237384378910065,
-1.3071762323379517,
-0.36515966057777405,
-0.9515749216079712,
0.8610987663269043,
-0.06152743846178055,
0.12919320166110992,
1.782386064529419,
0.40071341395378113,
-0.313416987657547,
0.6893038153648376,
1.0552045106887817,
0.6129261255264282,
-0.5701146125793457,
0.3661143481731415,
-0.7160096764564514,
0.3464163541793823,
-1.2232781648635864,
0.2937632203102112,
-2.8404486179351807,
0.5947692394256592,
-0.05787699669599533,
-0.02734897844493389,
-0.16964523494243622,
-1.3417850732803345,
1.0949925184249878,
2.6550302505493164,
-1.1965728998184204,
0.5874325037002563,
0.2755647599697113,
1.1429028511047363,
-1.5156188011169434,
0.19055601954460144,
-0.5009263157844543,
2.137260913848877,
0.16172946989536285,
1.224656105041504,
-0.4427706003189087,
-2.3472814559936523,
0.642829418182373,
-1.2102826833724976,
-1.1371526718139648,
0.8274096250534058,
-0.7803826928138733,
0.07105979323387146,
-1.1972639560699463,
-0.18820060789585114,
-0.7509104013442993,
-1.1855862140655518,
0.5720590353012085,
0.10283917188644409,
0.6338942646980286,
-0.724936306476593,
0.33838018774986267,
-2.2198486328125,
-1.2680104970932007,
-0.270221084356308,
-0.9608156681060791,
0.4011518359184265,
-0.30014941096305847,
0.7929873466491699,
-0.20135386288166046,
-0.05715782940387726,
0.3629794120788574,
1.303077220916748,
3.3529937267303467,
0.0381346121430397,
0.253370463848114,
-0.21392722427845,
-0.9822999835014343,
1.4300891160964966,
0.9333017468452454,
-0.1817747801542282,
-0.5408400893211365,
-1.0433738231658936,
1.126912236213684,
1.9987534284591675,
1.0589109659194946,
0.020880868658423424,
-0.9088592529296875,
-0.8732333779335022,
0.03234587609767914,
0.12914444506168365,
0.5371387004852295,
0.9339497685432434,
0.1579570472240448,
0.08721800148487091,
1.470046877861023,
1.1611008644104004,
-0.320370078086853,
0.40668317675590515,
-0.8323473334312439,
-0.5106073617935181,
0.6057826280593872,
0.392304390668869,
0.02094316855072975,
0.2949199080467224,
-1.1524986028671265,
-0.16793042421340942,
-0.3733978867530823,
-0.8975688815116882,
-0.7242915034294128,
-0.38598236441612244,
-0.4176587462425232,
1.729170322418213,
-0.0011160243302583694,
-0.5228899121284485,
-0.04371950775384903,
-0.7589225172996521,
0.048808753490448,
-0.9549630880355835,
0.45929309725761414,
-0.2564781606197357,
0.02475143037736416,
-0.11478843539953232,
1.7400692701339722,
-0.9415069222450256,
-2.0594630241394043,
0.2785691022872925,
0.11995404958724976,
-0.4028650224208832,
0.2447926551103592,
1.6293907165527344,
0.6633527874946594,
1.4487240314483643,
1.430057168006897,
1.0166501998901367,
-0.6943540573120117,
-1.3705681562423706,
0.6586549878120422,
0.9594056010246277,
-1.47089684009552,
0.6429877281188965,
0.04379331320524216,
-0.5237323045730591,
0.5606427192687988,
1.277489185333252,
0.4282938539981842,
-2.0911076068878174,
0.7801716327667236,
-0.9241978526115417,
0.724370539188385,
0.7847929000854492,
0.7768943309783936,
0.04750397801399231,
0.7905137538909912,
-1.256968379020691,
-1.0405865907669067,
-0.5987928509712219,
-0.7153672575950623,
1.8547873497009277,
-0.41804149746894836,
0.5645268559455872,
-0.22413773834705353,
-1.4456301927566528,
-0.06396704167127609,
0.5856484770774841,
0.3109167516231537,
-0.5274185538291931,
0.7870177626609802,
-0.6035879254341125,
-1.1772114038467407,
-1.3128818273544312,
-0.5606769919395447,
-1.0787734985351562,
-0.9261077046394348,
0.9832762479782104,
0.8374877572059631,
0.478164404630661,
1.8019158840179443,
0.6173644065856934,
0.20322881639003754,
-2.630340337753296,
0.857056200504303,
0.3674416244029999,
-0.07369443774223328,
0.8304604887962341,
0.2956143915653229,
1.0072146654129028,
-0.15423758327960968,
0.6554782390594482,
-2.425623655319214,
2.4086039066314697,
-0.1651279777288437,
0.6685206890106201,
0.08309613913297653,
-0.1541517972946167,
1.0065337419509888,
0.6163206100463867,
0.5976569056510925,
-1.1107592582702637,
0.7972874641418457,
-0.7049869894981384,
1.3359416723251343,
0.7401794195175171,
-0.845914363861084,
-0.11587754637002945,
1.2649563550949097,
0.44933849573135376,
-0.42013224959373474,
-0.9026418924331665,
-1.1294828653335571,
0.9375702142715454,
1.8067598342895508,
-0.10645835846662521,
0.09868635982275009,
0.8442559838294983,
0.74850994348526,
-1.3721840381622314,
-0.03363214433193207,
-0.7825008034706116,
-0.6704346537590027,
1.6239657402038574,
2.041635274887085,
-0.09321535378694534,
-0.19492699205875397,
-0.8293251991271973,
-1.2656476497650146,
0.7486038208007812,
0.09841909259557724,
0.015482135117053986,
0.6217730045318604,
-0.5290220379829407,
1.1772228479385376,
0.900878369808197,
0.9772146344184875,
0.2928597033023834,
0.23286819458007812,
0.12912702560424805,
-0.3809475302696228,
-1.261561393737793,
-0.2377198189496994,
-0.9607602953910828,
-2.5024046897888184,
0.49216100573539734,
-0.17393308877944946,
-1.4716435670852661,
0.006774011999368668,
-1.0289185047149658,
0.7781906723976135,
-0.47996851801872253,
-1.1437666416168213,
-1.454687237739563,
0.16144153475761414,
-0.136957585811615,
0.9366811513900757,
-1.5844440460205078,
-0.04041396826505661,
1.3014936447143555,
1.0266376733779907,
-0.7591455578804016,
0.9665828943252563,
0.21540327370166779,
1.044919729232788,
0.9012153744697571,
-0.31818312406539917,
0.46400657296180725,
0.2153664231300354,
-1.3067675828933716,
0.38749566674232483,
1.2271982431411743,
0.1776426136493683,
1.5781697034835815,
-0.7176184058189392,
0.0409621000289917,
0.40362221002578735,
-0.4002652168273926,
-0.49118009209632874,
-0.754306435585022,
0.7206305265426636,
-0.09874711185693741,
-0.9501972198486328,
0.09479279071092606,
-0.02623658999800682,
-0.110803984105587,
0.19599421322345734,
-1.5091503858566284,
-0.07644727826118469,
-0.3038143515586853,
-0.6632879972457886,
-1.2498126029968262,
-0.04875802993774414,
1.3459457159042358,
-0.7642666101455688,
-0.08826345950365067,
0.4634614586830139,
0.21582862734794617,
0.5509793162345886,
0.7424902319908142,
-0.6663749814033508,
-0.42684149742126465,
-0.21948833763599396,
-0.42769232392311096,
0.4077097475528717,
1.3508156538009644,
-0.0666813850402832,
-0.9506738781929016,
0.7112929821014404,
-0.4181763231754303,
0.059305138885974884,
1.9570856094360352,
0.05492693930864334,
-0.8458878397941589,
0.3749444782733917,
-0.7345535159111023,
1.9555035829544067,
1.7294567823410034,
1.3302230834960938,
-0.10914190858602524,
-1.0719505548477173,
0.5616587996482849,
-0.38098055124282837,
-0.42638805508613586,
0.9605783820152283,
0.4206569492816925,
-0.27793261408805847,
-1.3061065673828125,
0.6853861212730408,
1.2685072422027588,
-0.9387834668159485,
-0.8813462853431702,
0.20894932746887207,
-0.7570867538452148,
1.0995677709579468,
0.7799108624458313,
0.3587940037250519,
0.2915991544723511,
1.5847676992416382,
0.8055421113967896,
-0.4696023464202881,
0.5993508696556091,
0.42347684502601624,
-0.2105228453874588,
-2.032254934310913,
-1.1831028461456299,
0.3659629821777344,
-0.5929428935050964,
-1.6072956323623657,
1.38197660446167,
-1.2437859773635864,
-0.9833024740219116,
0.5165576338768005,
0.11386473476886749,
1.394173502922058,
0.3057531416416168,
1.5740338563919067,
1.9590038061141968,
0.9461743831634521,
0.405594140291214,
1.3395190238952637,
-0.24721157550811768,
-0.4339832663536072,
1.705353856086731,
-0.5725879669189453,
0.5682122111320496,
1.1339460611343384,
-0.37618735432624817,
-1.085531234741211,
-0.8700346946716309,
-1.154551386833191,
-0.7945157885551453,
1.1544554233551025,
0.060362644493579865,
-1.1236432790756226,
0.33487656712532043,
1.5383341312408447,
0.07510502636432648,
-0.21244320273399353,
0.7167884111404419,
0.23961710929870605,
-0.779289722442627,
-0.12164904922246933,
-0.9700567722320557,
0.49112215638160706,
-0.3587038516998291,
-0.4259655475616455,
0.2983144521713257,
0.4613374173641205,
1.2672452926635742,
-0.022477012127637863,
0.10097348690032959,
1.2227922677993774,
-1.3691344261169434,
1.485451579093933,
-0.8282871842384338,
0.31056371331214905,
-2.342461347579956,
1.3480912446975708,
-0.856827974319458,
1.887969732284546,
-2.7159206867218018,
0.3944236934185028,
-0.4365796744823456,
-0.45234987139701843,
0.19802604615688324,
-0.27865538001060486,
0.14586786925792694,
-0.16948232054710388,
-1.2117199897766113,
-0.17023327946662903,
-0.8530091047286987,
0.5801832675933838,
1.078339695930481,
1.4052832126617432,
-1.0620863437652588,
-0.28717389702796936,
-1.6947169303894043,
-0.21083568036556244,
-0.6532070636749268,
0.4517437815666199,
-1.864707112312317,
-0.1998705118894577,
-1.9000717401504517,
-2.448245048522949,
-1.196963906288147,
-0.88315749168396,
1.1316660642623901,
0.07215877622365952,
-0.8109641075134277,
1.0808730125427246,
-0.36244499683380127,
-1.9056453704833984,
1.1423412561416626,
-2.2486603260040283
] |
https://github.com/huggingface/datasets/issues/5144 | Inconsistent documentation on map remove_columns | Thanks for reporting, @zhaowei-wang-nlp.
You are right, the documentation is confusing on the behavior of `remove_columns`. We should better explain it. | ### Describe the bug
The page [process](https://huggingface.co/docs/datasets/process) says this about the parameter `remove_columns` of the function `map`:
When you remove a column, it is only removed after the example has been provided to the mapped function.
So it seems that the `remove_columns` parameter removes after the mapped functions.
However, another page, [the documentation of the function map](https://huggingface.co/docs/datasets/v2.6.1/en/package_reference/main_classes#datasets.Dataset.map.remove_columns) says:
Columns will be removed before updating the examples with the output of `function`, i.e. if `function` is adding columns with names in remove_columns, these columns will be kept.
So one page says "after the mapped function" and another says "before the mapped function."
Is there something wrong?
### Steps to reproduce the bug
Not about code.
### Expected behavior
consistent about the descriptions of the behavior of the parameter `remove_columns` in the function `map`.
### Environment info
datasets V2.6.0 | 465 | 21 | Inconsistent documentation on map remove_columns
### Describe the bug
The page [process](https://huggingface.co/docs/datasets/process) says this about the parameter `remove_columns` of the function `map`:
When you remove a column, it is only removed after the example has been provided to the mapped function.
So it seems that the `remove_columns` parameter removes after the mapped functions.
However, another page, [the documentation of the function map](https://huggingface.co/docs/datasets/v2.6.1/en/package_reference/main_classes#datasets.Dataset.map.remove_columns) says:
Columns will be removed before updating the examples with the output of `function`, i.e. if `function` is adding columns with names in remove_columns, these columns will be kept.
So one page says "after the mapped function" and another says "before the mapped function."
Is there something wrong?
### Steps to reproduce the bug
Not about code.
### Expected behavior
consistent about the descriptions of the behavior of the parameter `remove_columns` in the function `map`.
### Environment info
datasets V2.6.0
Thanks for reporting, @zhaowei-wang-nlp.
You are right, the documentation is confusing on the behavior of `remove_columns`. We should better explain it. | [
-1.0703139305114746,
-0.873953104019165,
-0.8252960443496704,
1.5100481510162354,
-0.056572288274765015,
-1.2727981805801392,
0.17917226254940033,
-1.0717113018035889,
1.7138564586639404,
-0.8709501028060913,
0.37398988008499146,
-1.7086706161499023,
-0.0040800850838422775,
-0.6522396802902222,
-0.7247546911239624,
-0.9031126499176025,
-0.37034666538238525,
-0.7585372924804688,
0.9250696897506714,
2.4958713054656982,
1.2279072999954224,
-1.2784839868545532,
2.7387053966522217,
0.6919193863868713,
-0.14417970180511475,
-0.9630062580108643,
0.5688621997833252,
-0.06251098960638046,
-1.299679160118103,
-0.4640488028526306,
-0.9507625102996826,
-0.060102544724941254,
-0.4643579125404358,
-0.585807740688324,
-0.024130243808031082,
0.404229998588562,
-0.3591282069683075,
-0.42515265941619873,
-0.5485121011734009,
-0.8516464233398438,
0.3999066650867462,
-0.37376588582992554,
0.9729355573654175,
-0.45144495368003845,
1.9069888591766357,
-0.6277168393135071,
0.4813570976257324,
0.7811595797538757,
1.281731367111206,
0.2148805856704712,
-0.11918464303016663,
0.23959816992282867,
0.4234372675418854,
0.022457821294665337,
0.5104539394378662,
1.1142246723175049,
0.6493347883224487,
0.4424222707748413,
0.6874608993530273,
-2.2515575885772705,
1.3165819644927979,
-1.0545748472213745,
0.287202924489975,
1.4281960725784302,
-1.0122114419937134,
0.22971008718013763,
-1.7665706872940063,
-0.08963116258382797,
0.5770643353462219,
-2.3500938415527344,
0.11189772188663483,
-1.2892696857452393,
-0.47514787316322327,
1.0080212354660034,
0.3479178249835968,
-1.3826944828033447,
0.1160326674580574,
-0.4458887577056885,
1.050930142402649,
0.558858335018158,
1.1028501987457275,
-1.753454566001892,
-0.08385702222585678,
-0.320390522480011,
0.0883454978466034,
-1.3348400592803955,
-1.5393562316894531,
0.5870125889778137,
0.6708285808563232,
0.5283313989639282,
-0.03457926958799362,
0.8924458622932434,
-0.9743024706840515,
0.8275206089019775,
-0.9247867465019226,
-1.7671728134155273,
-1.3867405652999878,
-2.2258591651916504,
-2.2918245792388916,
0.7670981287956238,
-0.5010318160057068,
-0.4427468180656433,
1.9306548833847046,
-1.025519609451294,
-1.7388339042663574,
1.131716012954712,
0.2673307955265045,
-0.01743742823600769,
2.3744382858276367,
0.19912996888160706,
-0.6609113216400146,
0.2918706238269806,
-0.6699307560920715,
0.7663713097572327,
-0.4182282090187073,
1.3128966093063354,
0.45227280259132385,
-1.1079808473587036,
1.6240280866622925,
-0.5122870206832886,
0.46406930685043335,
-0.6991264224052429,
-0.46208250522613525,
-0.7321244478225708,
0.27292877435684204,
1.8701926469802856,
-0.46327489614486694,
1.5837000608444214,
-0.36258894205093384,
-1.4300395250320435,
-1.6272534132003784,
0.8767505288124084,
0.4031180739402771,
-0.7825680375099182,
0.09993938356637955,
-0.3842746913433075,
0.06578797101974487,
-0.1441158950328827,
1.175094485282898,
1.2338529825210571,
0.7404179573059082,
-0.29559338092803955,
-0.7294207811355591,
0.17331625521183014,
-0.10459184646606445,
-0.8074108362197876,
-1.7737033367156982,
-0.327677845954895,
0.15493854880332947,
0.6073024868965149,
-1.2036490440368652,
1.767656922340393,
0.8107385039329529,
1.941442608833313,
1.0355850458145142,
-0.3438206613063812,
1.5278205871582031,
0.1032535657286644,
1.978470802307129,
-0.5499902963638306,
0.6507588624954224,
-0.3476685881614685,
-1.1436488628387451,
0.8468820452690125,
-0.36565420031547546,
-2.0113577842712402,
-0.7411049604415894,
-0.8548908829689026,
-0.10300863534212112,
-0.7695611715316772,
0.953678548336029,
-0.2625751793384552,
-1.3555406332015991,
0.2018270641565323,
-0.7528000473976135,
0.011103762313723564,
-1.3086843490600586,
0.2866174578666687,
0.8530862927436829,
-0.6255148649215698,
0.1319829225540161,
-0.2026255577802658,
-1.3105920553207397,
-0.4983099699020386,
0.2558443248271942,
1.8980185985565186,
-0.7372514009475708,
0.9201943874359131,
1.0187748670578003,
-0.7255468368530273,
-0.023380957543849945,
0.3562162518501282,
-0.41677939891815186,
0.8107906579971313,
-0.9947364330291748,
-0.4714176058769226,
1.2297818660736084,
-0.23716340959072113,
-0.655397355556488,
1.5525115728378296,
0.7308421730995178,
-1.0475654602050781,
-0.15585288405418396,
-0.1729806810617447,
-0.8363702297210693,
0.11728351563215256,
-1.6371071338653564,
-0.10082867741584778,
0.3058397173881531,
-1.4728199243545532,
-0.5229074358940125,
-0.15777084231376648,
1.3576736450195312,
-0.1414674073457718,
1.4765876531600952,
-0.38354483246803284,
-0.2940685451030731,
-0.375828355550766,
-0.3765822947025299,
0.11194811016321182,
-0.2231418639421463,
-0.6320664286613464,
0.2860914468765259,
-0.7345935702323914,
0.28873345255851746,
1.4042339324951172,
0.41962212324142456,
0.0883009061217308,
0.6012932062149048,
1.0188353061676025,
0.30467626452445984,
-0.09023646265268326,
-0.9098125696182251,
-1.5205821990966797,
2.1208834648132324,
-1.2443960905075073,
1.9548499584197998,
0.8031924366950989,
-0.09017878770828247,
-1.8523098230361938,
-1.8980566263198853,
1.2992421388626099,
1.183524489402771,
2.235623836517334,
0.5774744153022766,
0.3790290653705597,
-0.7600618600845337,
-0.6525672078132629,
0.3640330731868744,
-0.976325511932373,
-0.6992834210395813,
0.08413117378950119,
2.37235164642334,
1.7529841661453247,
-0.4780300557613373,
-0.20508787035942078,
-1.1281788349151611,
1.326325535774231,
-0.22262823581695557,
0.18863508105278015,
1.8494197130203247,
-0.22081032395362854,
-1.1125715970993042,
1.3049743175506592,
-2.265303373336792,
0.1988055258989334,
2.0160608291625977,
0.21825632452964783,
0.03300792723894119,
-1.484344720840454,
-0.6878767609596252,
-0.3470778167247772,
-0.2929961085319519,
-1.2135417461395264,
0.5080951452255249,
-0.3515891134738922,
-0.9104562997817993,
-1.42743718624115,
0.14914490282535553,
-0.9900673627853394,
-1.715201735496521,
0.18486440181732178,
1.794691801071167,
1.872741460800171,
-0.630298376083374,
1.556345820426941,
-0.23557701706886292,
0.1514321118593216,
1.2760846614837646,
1.2781414985656738,
3.187696695327759,
1.922377586364746,
-1.3460142612457275,
0.7415172457695007,
-0.11088795959949493,
-0.42898160219192505,
1.172957181930542,
-1.110908031463623,
1.2845258712768555,
-0.22076387703418732,
-1.3022502660751343,
-1.283515214920044,
1.008928656578064,
0.42795529961586,
0.08250850439071655,
-0.5411767959594727,
1.2899525165557861,
-0.0028013153932988644,
1.4010614156723022,
0.6931076645851135,
-0.3370455801486969,
0.6180699467658997,
-0.3414459526538849,
-0.5175381302833557,
1.5620298385620117,
0.27001532912254333,
-1.3964694738388062,
-2.3151564598083496,
-0.22544950246810913,
-0.8027646541595459,
-0.014865631237626076,
-0.6427958011627197,
-1.0079532861709595,
1.73196280002594,
0.5190933346748352,
-1.2573390007019043,
-0.41283977031707764,
-0.42582976818084717,
-0.5711243152618408,
2.704047679901123,
-1.4418325424194336,
-0.19753552973270416,
-1.029758334159851,
-0.5691084861755371,
1.6616424322128296,
-1.2897664308547974,
-0.17538344860076904,
-1.0394068956375122,
-0.6006466746330261,
-1.2521708011627197,
-0.6170883178710938,
-0.03166140988469124,
-0.9075753092765808,
0.8599978089332581,
0.12973807752132416,
-1.1048223972320557,
-0.3429957330226898,
-0.8556314706802368,
0.8133277893066406,
-0.16203069686889648,
0.2825099229812622,
1.8703269958496094,
0.5103765726089478,
-0.49152451753616333,
0.7599437236785889,
1.118628740310669,
0.6868796348571777,
-0.5784808397293091,
0.27335041761398315,
-0.6261361837387085,
0.1916089951992035,
-1.2265212535858154,
0.24669744074344635,
-2.918483018875122,
0.5120375752449036,
-0.16091150045394897,
-0.07614880800247192,
0.008525939658284187,
-1.2972183227539062,
1.138771653175354,
2.5516574382781982,
-1.1661109924316406,
0.4019538164138794,
0.26097607612609863,
1.233730673789978,
-1.5926145315170288,
0.3633820414543152,
-0.38071587681770325,
2.102628231048584,
0.16833120584487915,
1.1617190837860107,
-0.4849373698234558,
-2.1453840732574463,
0.706217348575592,
-1.2570747137069702,
-1.1157029867172241,
0.8235514163970947,
-0.7516456246376038,
0.0519842728972435,
-1.4216029644012451,
-0.17615588009357452,
-0.7377920150756836,
-1.3031082153320312,
0.7844335436820984,
0.08825865387916565,
0.5133370757102966,
-0.6181078553199768,
0.2775295674800873,
-2.119445562362671,
-1.3728924989700317,
-0.14988210797309875,
-0.9875254034996033,
0.43149787187576294,
-0.2988940477371216,
0.7509129643440247,
-0.14544060826301575,
-0.035902734845876694,
0.34569084644317627,
1.3661553859710693,
3.520502805709839,
0.27299436926841736,
0.3224831223487854,
-0.2104923576116562,
-0.9379159808158875,
1.447524070739746,
0.9295164942741394,
-0.18338635563850403,
-0.5438895225524902,
-0.8984522223472595,
1.2653733491897583,
1.9901952743530273,
0.9999072551727295,
0.08834312856197357,
-0.8325893878936768,
-0.7408485412597656,
-0.101958267390728,
0.2090614140033722,
0.4897002875804901,
0.9200350046157837,
0.0789906308054924,
0.105592280626297,
1.517245888710022,
1.2633436918258667,
-0.49580663442611694,
0.46971407532691956,
-0.7853206396102905,
-0.4497762620449066,
0.5804616212844849,
0.3466072082519531,
-0.025182029232382774,
0.386133074760437,
-1.061245083808899,
-0.3409358263015747,
-0.4272744059562683,
-0.8354836106300354,
-0.638038694858551,
-0.42102575302124023,
-0.3450813889503479,
1.6670691967010498,
0.11417581886053085,
-0.4565869867801666,
-0.05176277458667755,
-0.7970879077911377,
-0.15900444984436035,
-1.0892070531845093,
0.3117312788963318,
-0.17535069584846497,
-0.09537476301193237,
-0.06221991777420044,
1.7818495035171509,
-0.919979453086853,
-2.1374459266662598,
0.26007184386253357,
0.22452351450920105,
-0.3133179843425751,
0.23547664284706116,
1.5721993446350098,
0.43982380628585815,
1.4553742408752441,
1.3653982877731323,
0.9284960627555847,
-0.7878255248069763,
-1.2651152610778809,
0.6744213104248047,
0.8838796019554138,
-1.484319806098938,
0.7154373526573181,
-0.02857940085232258,
-0.513147234916687,
0.7253193259239197,
1.2282848358154297,
0.41205278038978577,
-1.9276158809661865,
0.8214178085327148,
-0.876553475856781,
0.8358672857284546,
0.7196887731552124,
0.7033528685569763,
0.18092378973960876,
0.7498012781143188,
-1.3113892078399658,
-1.147265076637268,
-0.7016850113868713,
-0.6047892570495605,
1.8271005153656006,
-0.21684443950653076,
0.5480465292930603,
-0.052786730229854584,
-1.354386568069458,
-0.0936400294303894,
0.7225083112716675,
0.3811458647251129,
-0.4184027910232544,
0.7908591628074646,
-0.6811316609382629,
-1.0681065320968628,
-1.4665580987930298,
-0.5323078632354736,
-1.0752679109573364,
-0.9342822432518005,
1.051853895187378,
0.8637651801109314,
0.27480337023735046,
1.832021713256836,
0.524687647819519,
0.21273671090602875,
-2.6263461112976074,
0.9036624431610107,
0.26270759105682373,
-0.08481010794639587,
0.9969810247421265,
0.3429256081581116,
1.0738266706466675,
-0.045585498213768005,
0.5199045538902283,
-2.498135566711426,
2.2850112915039062,
-0.19645841419696808,
0.6368658542633057,
-0.0413849875330925,
-0.2761988639831543,
1.1141011714935303,
0.5436261296272278,
0.5489533543586731,
-1.1694248914718628,
0.7628922462463379,
-0.6423097848892212,
1.2187978029251099,
0.9403436779975891,
-0.8913546800613403,
-0.07674131542444229,
1.3552361726760864,
0.5489243865013123,
-0.543356716632843,
-0.8370528817176819,
-1.0152462720870972,
0.8436515927314758,
1.6680316925048828,
-0.014732365496456623,
0.006276736967265606,
0.8951759934425354,
0.6059414744377136,
-1.2831979990005493,
0.17338787019252777,
-0.7646995782852173,
-0.7117975950241089,
1.6068427562713623,
2.0601933002471924,
-0.10280285030603409,
-0.10774769634008408,
-0.7773067355155945,
-1.2216745615005493,
0.6646586656570435,
0.015813352540135384,
0.09721390157938004,
0.6075605750083923,
-0.6537434458732605,
1.0610721111297607,
0.8369935154914856,
0.9277560114860535,
0.22461538016796112,
0.4001117944717407,
0.37766727805137634,
-0.34341567754745483,
-1.17449951171875,
-0.2618703842163086,
-1.1553411483764648,
-2.569485902786255,
0.5727353096008301,
-0.36024099588394165,
-1.4917378425598145,
0.07167793065309525,
-0.9809087514877319,
0.8416985869407654,
-0.5964532494544983,
-1.166676640510559,
-1.4050742387771606,
0.2947791516780853,
-0.10428846627473831,
0.9497777223587036,
-1.5350154638290405,
-0.10621529817581177,
1.3821567296981812,
0.8503475189208984,
-0.6132062673568726,
0.9720375537872314,
0.30943214893341064,
1.0748268365859985,
0.8016815781593323,
-0.37336865067481995,
0.4399721324443817,
0.09889275580644608,
-1.4140937328338623,
0.4680398106575012,
1.1220122575759888,
0.15990112721920013,
1.5653456449508667,
-0.48864519596099854,
0.10415279865264893,
0.4131705164909363,
-0.4925514757633209,
-0.5617306232452393,
-0.6233497262001038,
0.7204620838165283,
0.05611926317214966,
-0.8899422287940979,
0.0536021813750267,
-0.006041407585144043,
-0.298174113035202,
0.14961974322795868,
-1.377948522567749,
-0.16448774933815002,
-0.3364686667919159,
-0.602928876876831,
-1.2806193828582764,
-0.04950109124183655,
1.3673901557922363,
-0.7853783965110779,
-0.1403554230928421,
0.4795074760913849,
0.36955997347831726,
0.5440406203269958,
0.6816474199295044,
-0.6302905082702637,
-0.42941322922706604,
-0.32741495966911316,
-0.3365704417228699,
0.3490821421146393,
1.333361029624939,
-0.12727107107639313,
-1.004616379737854,
0.7396653294563293,
-0.4007793962955475,
0.01927155628800392,
2.0003442764282227,
0.1861543506383896,
-0.7613974213600159,
0.2693118453025818,
-0.665597677230835,
2.0193753242492676,
1.7529648542404175,
1.3275810480117798,
-0.09153212606906891,
-0.9361110925674438,
0.6204035878181458,
-0.23834118247032166,
-0.2781922519207001,
0.9178970456123352,
0.42031213641166687,
-0.1648198664188385,
-1.4438018798828125,
0.6101799011230469,
1.2749801874160767,
-0.9842502474784851,
-0.7600388526916504,
0.13320399820804596,
-0.7834422588348389,
1.1545908451080322,
0.7134304046630859,
0.34542354941368103,
0.25786125659942627,
1.5887893438339233,
0.6686180233955383,
-0.43292734026908875,
0.4895099103450775,
0.5005362629890442,
-0.17390157282352448,
-2.0574147701263428,
-1.0409398078918457,
0.422561913728714,
-0.49558696150779724,
-1.5301839113235474,
1.3851754665374756,
-1.0579750537872314,
-0.931087851524353,
0.47376975417137146,
0.14522922039031982,
1.4119395017623901,
0.3111806809902191,
1.577149748802185,
2.100372314453125,
0.904636800289154,
0.21353428065776825,
1.3581162691116333,
-0.07527030259370804,
-0.45410096645355225,
1.7928873300552368,
-0.3784790337085724,
0.4676992893218994,
1.1094688177108765,
-0.4160674512386322,
-1.1434484720230103,
-0.7069201469421387,
-1.194498896598816,
-0.6147333383560181,
1.2401264905929565,
0.0950026884675026,
-1.0862932205200195,
0.20190176367759705,
1.4294300079345703,
0.10018280893564224,
-0.2913292646408081,
0.566222071647644,
0.5270344018936157,
-0.707571804523468,
-0.045543208718299866,
-0.9248682856559753,
0.5563827157020569,
-0.18076710402965546,
-0.3622383773326874,
0.38513845205307007,
0.4527972638607025,
1.3081954717636108,
-0.11251582205295563,
0.18084533512592316,
1.2530505657196045,
-1.3621405363082886,
1.5129330158233643,
-0.649509072303772,
0.2586521506309509,
-2.3499162197113037,
1.3628672361373901,
-0.7730602025985718,
1.8427280187606812,
-2.503068447113037,
0.4281617999076843,
-0.5659362077713013,
-0.32455533742904663,
0.3552533984184265,
-0.3844420909881592,
0.11182250827550888,
-0.1933058351278305,
-1.1213600635528564,
-0.1934068650007248,
-0.7818425297737122,
0.5492185950279236,
1.1456321477890015,
1.3781368732452393,
-1.177063226699829,
-0.2887346148490906,
-1.6713858842849731,
-0.0839071124792099,
-0.720499575138092,
0.3909095823764801,
-1.9208208322525024,
-0.14137668907642365,
-1.9559681415557861,
-2.4201297760009766,
-1.3504923582077026,
-0.7115840315818787,
1.0397733449935913,
0.19716371595859528,
-0.8499305248260498,
1.1573258638381958,
-0.26379767060279846,
-1.855682373046875,
0.9540616273880005,
-2.1602635383605957
] |
https://github.com/huggingface/datasets/issues/5144 | Inconsistent documentation on map remove_columns | I'm closing this issue because as @mariosasko pointed out, it is a duplicate of:
- #2343 | ### Describe the bug
The page [process](https://huggingface.co/docs/datasets/process) says this about the parameter `remove_columns` of the function `map`:
When you remove a column, it is only removed after the example has been provided to the mapped function.
So it seems that the `remove_columns` parameter removes after the mapped functions.
However, another page, [the documentation of the function map](https://huggingface.co/docs/datasets/v2.6.1/en/package_reference/main_classes#datasets.Dataset.map.remove_columns) says:
Columns will be removed before updating the examples with the output of `function`, i.e. if `function` is adding columns with names in remove_columns, these columns will be kept.
So one page says "after the mapped function" and another says "before the mapped function."
Is there something wrong?
### Steps to reproduce the bug
Not about code.
### Expected behavior
consistent about the descriptions of the behavior of the parameter `remove_columns` in the function `map`.
### Environment info
datasets V2.6.0 | 465 | 16 | Inconsistent documentation on map remove_columns
### Describe the bug
The page [process](https://huggingface.co/docs/datasets/process) says this about the parameter `remove_columns` of the function `map`:
When you remove a column, it is only removed after the example has been provided to the mapped function.
So it seems that the `remove_columns` parameter removes after the mapped functions.
However, another page, [the documentation of the function map](https://huggingface.co/docs/datasets/v2.6.1/en/package_reference/main_classes#datasets.Dataset.map.remove_columns) says:
Columns will be removed before updating the examples with the output of `function`, i.e. if `function` is adding columns with names in remove_columns, these columns will be kept.
So one page says "after the mapped function" and another says "before the mapped function."
Is there something wrong?
### Steps to reproduce the bug
Not about code.
### Expected behavior
consistent about the descriptions of the behavior of the parameter `remove_columns` in the function `map`.
### Environment info
datasets V2.6.0
I'm closing this issue because as @mariosasko pointed out, it is a duplicate of:
- #2343 | [
-1.0522171258926392,
-0.8894546627998352,
-0.8712867498397827,
1.5305967330932617,
-0.07183395326137543,
-1.257954716682434,
0.16691240668296814,
-1.0501177310943604,
1.704339861869812,
-0.865088701248169,
0.3592607378959656,
-1.7187820672988892,
0.00037020817399024963,
-0.6585548520088196,
-0.7001018524169922,
-0.8800318241119385,
-0.36476466059684753,
-0.7840728163719177,
0.9426825046539307,
2.526052474975586,
1.220323920249939,
-1.2844631671905518,
2.766965866088867,
0.7027727961540222,
-0.11512476950883865,
-0.9572349190711975,
0.5447919368743896,
-0.06120898574590683,
-1.2961223125457764,
-0.4737650156021118,
-0.9212920665740967,
-0.037742093205451965,
-0.4729776382446289,
-0.5736169219017029,
-0.013970129191875458,
0.4207196533679962,
-0.3501198887825012,
-0.43703219294548035,
-0.5209271907806396,
-0.8471276760101318,
0.41053155064582825,
-0.36988645792007446,
0.9738766551017761,
-0.4420342743396759,
1.9175560474395752,
-0.619625985622406,
0.4190181493759155,
0.7617269158363342,
1.2902348041534424,
0.2081272006034851,
-0.11134940385818481,
0.2628851532936096,
0.3912137746810913,
-0.006093692034482956,
0.495496928691864,
1.1330851316452026,
0.6675171852111816,
0.4393758773803711,
0.6998291015625,
-2.2169189453125,
1.3260340690612793,
-1.04692804813385,
0.301012247800827,
1.4116144180297852,
-1.026790976524353,
0.22607958316802979,
-1.7335736751556396,
-0.07454131543636322,
0.5794374346733093,
-2.3212995529174805,
0.12575499713420868,
-1.2896941900253296,
-0.49657243490219116,
0.9816204905509949,
0.32089781761169434,
-1.3959804773330688,
0.09736811369657516,
-0.4652707874774933,
1.0574880838394165,
0.5584835410118103,
1.093239426612854,
-1.7558178901672363,
-0.05483681708574295,
-0.31713420152664185,
0.09420172870159149,
-1.3471903800964355,
-1.5431859493255615,
0.5734556913375854,
0.6535260677337646,
0.5543631911277771,
-0.03977436572313309,
0.8834947347640991,
-0.9760645627975464,
0.7989217638969421,
-0.913720965385437,
-1.757266640663147,
-1.3921338319778442,
-2.240025758743286,
-2.297579526901245,
0.7567034363746643,
-0.49881264567375183,
-0.4541087746620178,
1.9322919845581055,
-1.0099401473999023,
-1.7257025241851807,
1.1219006776809692,
0.2672120928764343,
-0.014406014233827591,
2.3543624877929688,
0.21121284365653992,
-0.686411440372467,
0.2871229946613312,
-0.661100447177887,
0.7921409606933594,
-0.4430207908153534,
1.3057340383529663,
0.46639493107795715,
-1.059259295463562,
1.6262822151184082,
-0.5119850635528564,
0.48367220163345337,
-0.6995272636413574,
-0.4548306465148926,
-0.7468326091766357,
0.28156042098999023,
1.8421417474746704,
-0.4549606144428253,
1.6076606512069702,
-0.37967538833618164,
-1.4593478441238403,
-1.6122291088104248,
0.8901986479759216,
0.37834325432777405,
-0.7820595502853394,
0.12672802805900574,
-0.42182108759880066,
0.06093553453683853,
-0.14167751371860504,
1.1639825105667114,
1.2194794416427612,
0.7135928273200989,
-0.2873080372810364,
-0.7563639283180237,
0.18771229684352875,
-0.0832444503903389,
-0.803520679473877,
-1.7595503330230713,
-0.2751937210559845,
0.1705811768770218,
0.5936378836631775,
-1.2080254554748535,
1.7527557611465454,
0.783144474029541,
1.9640576839447021,
1.0391724109649658,
-0.2955878674983978,
1.532006859779358,
0.09139897674322128,
1.9435486793518066,
-0.5650511384010315,
0.6301425099372864,
-0.3401503264904022,
-1.123039722442627,
0.8418495059013367,
-0.40250369906425476,
-2.006126880645752,
-0.7601290345191956,
-0.8542884588241577,
-0.0947500541806221,
-0.7928627729415894,
0.9743427634239197,
-0.2685604989528656,
-1.364465594291687,
0.2135927379131317,
-0.7566754221916199,
-0.005496147088706493,
-1.2950325012207031,
0.25937917828559875,
0.8361402750015259,
-0.6026919484138489,
0.13559161126613617,
-0.18422172963619232,
-1.3164088726043701,
-0.493932843208313,
0.26765596866607666,
1.9252780675888062,
-0.7327427268028259,
0.938298225402832,
1.0237587690353394,
-0.7222755551338196,
-0.014908354729413986,
0.3759367763996124,
-0.4212645888328552,
0.8371258974075317,
-1.0197397470474243,
-0.4599519371986389,
1.216750144958496,
-0.2310446798801422,
-0.6388620734214783,
1.5647435188293457,
0.7335304617881775,
-1.0459321737289429,
-0.13540130853652954,
-0.17243623733520508,
-0.8596414923667908,
0.12431079149246216,
-1.6465474367141724,
-0.12497943639755249,
0.3000955283641815,
-1.4709974527359009,
-0.5343241691589355,
-0.16005989909172058,
1.3400795459747314,
-0.13299134373664856,
1.4764012098312378,
-0.4077547788619995,
-0.29452282190322876,
-0.35079607367515564,
-0.38402819633483887,
0.11163025349378586,
-0.2329443395137787,
-0.662386953830719,
0.2670576274394989,
-0.7208470702171326,
0.2971683740615845,
1.4094666242599487,
0.40974679589271545,
0.0830414667725563,
0.5931832790374756,
1.0331134796142578,
0.2939514219760895,
-0.07181902229785919,
-0.8902077674865723,
-1.5091779232025146,
2.112355947494507,
-1.2390941381454468,
1.9499883651733398,
0.824215829372406,
-0.07701382786035538,
-1.8406654596328735,
-1.8997488021850586,
1.3184150457382202,
1.2026716470718384,
2.2395474910736084,
0.6004818677902222,
0.3655296266078949,
-0.7772402167320251,
-0.6807231307029724,
0.3313749134540558,
-0.9905372858047485,
-0.7088887095451355,
0.09914843738079071,
2.37831974029541,
1.7644808292388916,
-0.48320987820625305,
-0.2071818858385086,
-1.1145129203796387,
1.3001184463500977,
-0.2176506072282791,
0.17030788958072662,
1.8710155487060547,
-0.19222673773765564,
-1.088509440422058,
1.2827321290969849,
-2.268373727798462,
0.17828543484210968,
2.013942003250122,
0.22804202139377594,
0.057145245373249054,
-1.4865775108337402,
-0.7258521318435669,
-0.36054298281669617,
-0.274991512298584,
-1.2091389894485474,
0.5375285148620605,
-0.3656623959541321,
-0.886271595954895,
-1.4471464157104492,
0.1696190983057022,
-0.9846630096435547,
-1.707120418548584,
0.17715589702129364,
1.812124490737915,
1.8858588933944702,
-0.6512152552604675,
1.5477038621902466,
-0.22091449797153473,
0.13470932841300964,
1.2978473901748657,
1.2646825313568115,
3.2042746543884277,
1.9165452718734741,
-1.330194354057312,
0.7322548627853394,
-0.10881500691175461,
-0.4164859354496002,
1.1697707176208496,
-1.1253046989440918,
1.2457008361816406,
-0.23523157835006714,
-1.2988921403884888,
-1.2956703901290894,
0.9849492907524109,
0.4182557165622711,
0.07551398873329163,
-0.5215176343917847,
1.2933193445205688,
-0.03471460938453674,
1.3925213813781738,
0.7148754596710205,
-0.33156147599220276,
0.5973227024078369,
-0.3305363655090332,
-0.4895833134651184,
1.5567725896835327,
0.24985958635807037,
-1.4053153991699219,
-2.297849655151367,
-0.21164090931415558,
-0.787544310092926,
-0.023159468546509743,
-0.629033625125885,
-1.0423939228057861,
1.7283076047897339,
0.546255886554718,
-1.2547343969345093,
-0.40571877360343933,
-0.4268440008163452,
-0.5795158743858337,
2.690692663192749,
-1.4535809755325317,
-0.2535727620124817,
-1.0393613576889038,
-0.5477978587150574,
1.669306755065918,
-1.2888507843017578,
-0.19830672442913055,
-1.0197877883911133,
-0.5881622433662415,
-1.2590526342391968,
-0.6227582097053528,
-0.05384343862533569,
-0.8831839561462402,
0.873406708240509,
0.09100471436977386,
-1.0979217290878296,
-0.30763140320777893,
-0.8618009090423584,
0.8210166692733765,
-0.1558251678943634,
0.30243462324142456,
1.8773423433303833,
0.5076040625572205,
-0.4991632401943207,
0.7877957820892334,
1.1198550462722778,
0.6847082376480103,
-0.5863966941833496,
0.2581723630428314,
-0.6207743883132935,
0.20443272590637207,
-1.2392481565475464,
0.2701190412044525,
-2.921773672103882,
0.5287089943885803,
-0.15517498552799225,
-0.07671932876110077,
0.03082178719341755,
-1.315008282661438,
1.144975185394287,
2.5298526287078857,
-1.168448805809021,
0.4063391089439392,
0.2573229670524597,
1.2529221773147583,
-1.6330703496932983,
0.3575838506221771,
-0.3852016031742096,
2.1031131744384766,
0.17770710587501526,
1.1645382642745972,
-0.47253093123435974,
-2.1639211177825928,
0.7136675715446472,
-1.303647756576538,
-1.1109691858291626,
0.8071079254150391,
-0.7677582502365112,
0.030839404091238976,
-1.4313790798187256,
-0.18597739934921265,
-0.7572808861732483,
-1.302632212638855,
0.7892281413078308,
0.07985904812812805,
0.4891285002231598,
-0.6400288939476013,
0.27249085903167725,
-2.1441943645477295,
-1.3773949146270752,
-0.14821873605251312,
-0.9731329083442688,
0.41952744126319885,
-0.3295177221298218,
0.7463032603263855,
-0.16675591468811035,
-0.007873761467635632,
0.33381327986717224,
1.3448554277420044,
3.5298495292663574,
0.2761543095111847,
0.3147992491722107,
-0.19030070304870605,
-0.9068530797958374,
1.4309018850326538,
0.9293525815010071,
-0.19124358892440796,
-0.5411819815635681,
-0.9171497225761414,
1.2929859161376953,
1.9838765859603882,
0.9820007085800171,
0.1057894304394722,
-0.8053444623947144,
-0.7229220867156982,
-0.10152029246091843,
0.21700261533260345,
0.46687451004981995,
0.9135515689849854,
0.0662245973944664,
0.10879408568143845,
1.5313421487808228,
1.2428882122039795,
-0.48340392112731934,
0.4649098515510559,
-0.7728403210639954,
-0.4238273501396179,
0.5932145118713379,
0.3346463143825531,
-0.03720182925462723,
0.40034598112106323,
-1.0657329559326172,
-0.35891708731651306,
-0.4330989420413971,
-0.8538463115692139,
-0.6467670798301697,
-0.4297502636909485,
-0.2966582775115967,
1.644256830215454,
0.11326365172863007,
-0.48265397548675537,
-0.08949629962444305,
-0.8025079369544983,
-0.1559213250875473,
-1.102294683456421,
0.29493093490600586,
-0.19203314185142517,
-0.10195817053318024,
-0.07127413898706436,
1.7841379642486572,
-0.943161129951477,
-2.1557178497314453,
0.2625039219856262,
0.23407724499702454,
-0.30163219571113586,
0.21542130410671234,
1.5832089185714722,
0.42819806933403015,
1.4470022916793823,
1.37954843044281,
0.9373223185539246,
-0.7892127633094788,
-1.2739020586013794,
0.6592808961868286,
0.8836010694503784,
-1.4786237478256226,
0.7258642315864563,
-0.036705560982227325,
-0.5244283080101013,
0.7175942063331604,
1.2562991380691528,
0.4392251968383789,
-1.9081335067749023,
0.8008293509483337,
-0.8751785755157471,
0.8281946778297424,
0.7293006777763367,
0.7275265455245972,
0.22198155522346497,
0.7461247444152832,
-1.3303451538085938,
-1.1588466167449951,
-0.6990833878517151,
-0.6222481727600098,
1.8333836793899536,
-0.20781096816062927,
0.5527238845825195,
-0.04674278944730759,
-1.3455508947372437,
-0.08633223921060562,
0.7302796840667725,
0.3717559576034546,
-0.41400080919265747,
0.8152952194213867,
-0.7023065686225891,
-1.072441577911377,
-1.4707293510437012,
-0.5210140347480774,
-1.024621844291687,
-0.927946925163269,
1.0505545139312744,
0.8875336050987244,
0.27080607414245605,
1.8398257493972778,
0.5743448138237,
0.2101357877254486,
-2.597121477127075,
0.8808629512786865,
0.26626789569854736,
-0.04968356341123581,
0.9865629076957703,
0.3449763357639313,
1.053748607635498,
-0.01242506131529808,
0.4981197714805603,
-2.4890825748443604,
2.2788569927215576,
-0.18629848957061768,
0.6448726654052734,
-0.05161193013191223,
-0.28212541341781616,
1.1354179382324219,
0.5507265329360962,
0.5360323786735535,
-1.1746147871017456,
0.7580405473709106,
-0.6345526576042175,
1.2124837636947632,
0.9381852746009827,
-0.8815430998802185,
-0.06234339624643326,
1.3428244590759277,
0.5374565720558167,
-0.5550724267959595,
-0.8417719602584839,
-0.9686138033866882,
0.8663502931594849,
1.6742024421691895,
0.014253173023462296,
0.046458758413791656,
0.8813855648040771,
0.612061619758606,
-1.2854681015014648,
0.1658700555562973,
-0.7428682446479797,
-0.7239373922348022,
1.6332837343215942,
2.054027795791626,
-0.10709375143051147,
-0.10247620195150375,
-0.7739991545677185,
-1.2118518352508545,
0.6634140610694885,
0.00781329721212387,
0.06989980489015579,
0.6289365291595459,
-0.6533634066581726,
1.0264883041381836,
0.8314736485481262,
0.9403349757194519,
0.18599586188793182,
0.40227487683296204,
0.41630080342292786,
-0.3328399658203125,
-1.183282494544983,
-0.28448033332824707,
-1.1841334104537964,
-2.535215377807617,
0.5889864563941956,
-0.3588201701641083,
-1.5027543306350708,
0.0925140380859375,
-0.9872655272483826,
0.8538150787353516,
-0.5930793881416321,
-1.180862307548523,
-1.3864549398422241,
0.2901230454444885,
-0.10072250664234161,
0.9237768650054932,
-1.509316086769104,
-0.10042225569486618,
1.3905497789382935,
0.8534030914306641,
-0.624893069267273,
0.9558930397033691,
0.26887083053588867,
1.0524187088012695,
0.8135754466056824,
-0.36887675523757935,
0.43252691626548767,
0.10614655166864395,
-1.4120928049087524,
0.4941919445991516,
1.1442539691925049,
0.15490303933620453,
1.5900812149047852,
-0.4666312634944916,
0.09164401888847351,
0.41014620661735535,
-0.49903276562690735,
-0.5507075786590576,
-0.6252279877662659,
0.7154017686843872,
0.08796457946300507,
-0.8542964458465576,
0.021257475018501282,
-0.010620147921144962,
-0.31668686866760254,
0.14508779346942902,
-1.4047654867172241,
-0.1786695271730423,
-0.34104564785957336,
-0.6021581292152405,
-1.2845094203948975,
-0.04040346294641495,
1.394578218460083,
-0.7831321954727173,
-0.17340268194675446,
0.48268529772758484,
0.4073067903518677,
0.5590323805809021,
0.6844196915626526,
-0.6206185221672058,
-0.4390479326248169,
-0.3234620988368988,
-0.3073899745941162,
0.3186596930027008,
1.2999380826950073,
-0.11530466377735138,
-1.0173174142837524,
0.7262792587280273,
-0.4107495844364166,
0.03263556957244873,
1.9830536842346191,
0.15557031333446503,
-0.749927818775177,
0.26941370964050293,
-0.665789783000946,
2.0321712493896484,
1.7356892824172974,
1.3210535049438477,
-0.07439450174570084,
-0.9284170866012573,
0.6349786520004272,
-0.19922198355197906,
-0.30314600467681885,
0.9031510353088379,
0.43506741523742676,
-0.1672167330980301,
-1.4558805227279663,
0.6116477251052856,
1.2711098194122314,
-1.0082367658615112,
-0.7798846960067749,
0.11642816662788391,
-0.8058435320854187,
1.1249775886535645,
0.7173042893409729,
0.35012635588645935,
0.27195632457733154,
1.6008191108703613,
0.6626040935516357,
-0.4716050922870636,
0.47166717052459717,
0.47031310200691223,
-0.1264840066432953,
-2.0398998260498047,
-1.0452722311019897,
0.4327899217605591,
-0.4872540831565857,
-1.5543992519378662,
1.3566749095916748,
-1.0503677129745483,
-0.9142503142356873,
0.47667667269706726,
0.14185433089733124,
1.3668678998947144,
0.293256014585495,
1.5692793130874634,
2.103013277053833,
0.8939999938011169,
0.2164274901151657,
1.3443918228149414,
-0.07971863448619843,
-0.47800084948539734,
1.7798435688018799,
-0.3709104657173157,
0.5152359008789062,
1.095361351966858,
-0.4439316391944885,
-1.1656749248504639,
-0.6957691311836243,
-1.1766557693481445,
-0.6072834134101868,
1.2365161180496216,
0.1414322406053543,
-1.105036973953247,
0.18937595188617706,
1.422616720199585,
0.10198540985584259,
-0.29180455207824707,
0.5416191816329956,
0.5315821766853333,
-0.7060189247131348,
-0.04089823365211487,
-0.9378776550292969,
0.5538133978843689,
-0.17160719633102417,
-0.3712298572063446,
0.39494067430496216,
0.47291019558906555,
1.3106592893600464,
-0.09554345905780792,
0.158380925655365,
1.2873514890670776,
-1.3764208555221558,
1.520532250404358,
-0.6568002700805664,
0.23999878764152527,
-2.376990795135498,
1.3785765171051025,
-0.7717151641845703,
1.863033652305603,
-2.512437105178833,
0.4197865128517151,
-0.5898008346557617,
-0.31352663040161133,
0.37254956364631653,
-0.3572497069835663,
0.13176001608371735,
-0.17941123247146606,
-1.0885107517242432,
-0.16719281673431396,
-0.7882165908813477,
0.5523925423622131,
1.147574782371521,
1.39120352268219,
-1.1900779008865356,
-0.26190102100372314,
-1.6572208404541016,
-0.09830877184867859,
-0.7205972671508789,
0.3626224398612976,
-1.9433903694152832,
-0.1580253392457962,
-1.9498769044876099,
-2.4261693954467773,
-1.355008602142334,
-0.7121574878692627,
1.0379996299743652,
0.20890933275222778,
-0.890597403049469,
1.155241847038269,
-0.2786727249622345,
-1.816609501838684,
0.9445522427558899,
-2.142908811569214
] |
https://github.com/huggingface/datasets/issues/5143 | DownloadManager Git LFS support | Hey ! Actually it works, just pass the right URL ;)
The URL must be the one with “/resolve/”
e.g. https://huggingface.co/datasets/imagenet-1k/resolve/main/data/test_images.tar.gz
You can even pass a relative path to the dl_manager instead, like `dl_manager.download("data/test_images.tar.gz")` | ### Feature request
Maybe I'm mistaken but the `DownloadManager` does not support extracting git lfs files out of the box right?
Using `dl_manager.download()` or `dl_manager.download_and_extract()` still returns lfs files afaict.
Is there a good way to write a dataset loading script for a repo with lfs files?
### Motivation
/
### Your contribution
/ | 466 | 34 | DownloadManager Git LFS support
### Feature request
Maybe I'm mistaken but the `DownloadManager` does not support extracting git lfs files out of the box right?
Using `dl_manager.download()` or `dl_manager.download_and_extract()` still returns lfs files afaict.
Is there a good way to write a dataset loading script for a repo with lfs files?
### Motivation
/
### Your contribution
/
Hey ! Actually it works, just pass the right URL ;)
The URL must be the one with “/resolve/”
e.g. https://huggingface.co/datasets/imagenet-1k/resolve/main/data/test_images.tar.gz
You can even pass a relative path to the dl_manager instead, like `dl_manager.download("data/test_images.tar.gz")` | [
-1.1340396404266357,
-0.9294008016586304,
-0.8457137942314148,
1.5645302534103394,
-0.09562935680150986,
-1.3655706644058228,
0.11485815048217773,
-0.9327598214149475,
1.6963379383087158,
-0.8180897235870361,
0.26070716977119446,
-1.6619460582733154,
0.060668520629405975,
-0.5916336178779602,
-0.8420609831809998,
-0.9074518084526062,
-0.3258011043071747,
-0.7632548809051514,
1.0249660015106201,
2.518831253051758,
1.2176588773727417,
-1.2361983060836792,
2.7137837409973145,
0.7350152730941772,
-0.23206296563148499,
-1.083534598350525,
0.5474342107772827,
-0.03356106951832771,
-1.2087924480438232,
-0.43858602643013,
-0.940933346748352,
-0.09046110510826111,
-0.5718880295753479,
-0.568477213382721,
0.02636762708425522,
0.45792436599731445,
-0.3221518099308014,
-0.4438076317310333,
-0.6560158133506775,
-0.8088317513465881,
0.43680423498153687,
-0.4500913918018341,
0.9624296426773071,
-0.4032970368862152,
1.8840584754943848,
-0.5789813995361328,
0.3849180042743683,
0.5780701637268066,
1.3949635028839111,
0.17221146821975708,
0.02122991904616356,
0.28966018557548523,
0.4420166313648224,
0.09042758494615555,
0.39501142501831055,
1.212812066078186,
0.5285181403160095,
0.557488739490509,
0.6156211495399475,
-2.2583506107330322,
1.3689064979553223,
-0.9908568263053894,
0.2525581121444702,
1.2636092901229858,
-0.9764606356620789,
0.35812804102897644,
-1.7195217609405518,
-0.07535912841558456,
0.5203417539596558,
-2.297863721847534,
0.1634993702173233,
-1.306075930595398,
-0.5084133148193359,
0.9665480256080627,
0.39501136541366577,
-1.2350095510482788,
0.0336688831448555,
-0.5511130690574646,
1.0530872344970703,
0.49720945954322815,
1.0642207860946655,
-1.6042312383651733,
-0.05534043535590172,
-0.3144738972187042,
0.021877113729715347,
-1.377065896987915,
-1.5577588081359863,
0.5983418226242065,
0.8336074948310852,
0.6082280874252319,
-0.06592445075511932,
1.0350655317306519,
-0.9464996457099915,
0.8510977029800415,
-0.8655261993408203,
-1.7409695386886597,
-1.499403953552246,
-2.379722833633423,
-2.285637855529785,
0.7906383872032166,
-0.45618364214897156,
-0.5402001142501831,
2.117504119873047,
-1.03499174118042,
-1.7900718450546265,
1.138962984085083,
0.10636494308710098,
-0.009612185880541801,
2.3525760173797607,
0.16421616077423096,
-0.7017619013786316,
0.29751431941986084,
-0.6756604909896851,
0.8260625004768372,
-0.5001961588859558,
1.44720458984375,
0.5295059084892273,
-1.0389286279678345,
1.6104440689086914,
-0.3360968828201294,
0.5681003928184509,
-0.6776713132858276,
-0.5014707446098328,
-0.7661780118942261,
0.34276846051216125,
1.8931026458740234,
-0.4159562587738037,
1.699194073677063,
-0.27019941806793213,
-1.4764752388000488,
-1.655227541923523,
0.8734029531478882,
0.43903666734695435,
-0.7844310998916626,
0.10998038202524185,
-0.5143792033195496,
0.13018915057182312,
-0.11171430349349976,
1.1833069324493408,
1.1997908353805542,
0.6020982265472412,
-0.29723575711250305,
-0.7665824890136719,
0.36706680059432983,
-0.03438153490424156,
-0.6373802423477173,
-1.7166008949279785,
-0.3938262164592743,
0.21234022080898285,
0.6434734463691711,
-1.1264028549194336,
1.7409512996673584,
0.733496367931366,
2.013350486755371,
0.982323169708252,
-0.22179263830184937,
1.4247727394104004,
-0.07818591594696045,
1.8332957029342651,
-0.522732675075531,
0.6102210879325867,
-0.36390912532806396,
-1.1655853986740112,
0.8171484470367432,
-0.3719945549964905,
-2.013120412826538,
-0.8112068176269531,
-0.9688980579376221,
-0.1132279485464096,
-0.6957492232322693,
0.8970605731010437,
-0.43678852915763855,
-1.3478364944458008,
0.16860434412956238,
-0.7999539375305176,
0.10451030731201172,
-1.2264902591705322,
0.16900630295276642,
0.7946231961250305,
-0.7131069302558899,
0.09053737670183182,
-0.20653189718723297,
-1.2161729335784912,
-0.46409812569618225,
0.42101362347602844,
2.0452799797058105,
-0.6428107023239136,
0.8781582713127136,
1.0410114526748657,
-0.7092542052268982,
0.06967094540596008,
0.3684798777103424,
-0.263803094625473,
0.8627675175666809,
-1.0301294326782227,
-0.32546988129615784,
1.2773915529251099,
-0.3662421703338623,
-0.7551661133766174,
1.423278570175171,
0.8420127630233765,
-0.9699636697769165,
-0.16229721903800964,
-0.15397106111049652,
-0.8430576920509338,
0.06839535385370255,
-1.590999960899353,
-0.08498155325651169,
0.4532502591609955,
-1.5760151147842407,
-0.4390224516391754,
-0.2689763307571411,
1.3339492082595825,
-0.06970182806253433,
1.4879939556121826,
-0.26977747678756714,
-0.18853050470352173,
-0.2439187914133072,
-0.4033677577972412,
0.2146618515253067,
-0.20237024128437042,
-0.5401207804679871,
0.23281364142894745,
-0.7524178624153137,
0.30560049414634705,
1.4300497770309448,
0.32720866799354553,
0.21487997472286224,
0.6308215856552124,
1.0818219184875488,
0.35269737243652344,
-0.12283386290073395,
-0.8454269766807556,
-1.5687255859375,
2.011903762817383,
-1.3761944770812988,
1.9087772369384766,
0.7848546504974365,
-0.11798036098480225,
-1.7830431461334229,
-1.944566249847412,
1.2768908739089966,
1.1086344718933105,
2.2689461708068848,
0.5850599408149719,
0.27556318044662476,
-0.8051741123199463,
-0.6896290183067322,
0.39865097403526306,
-1.098092794418335,
-0.7001524567604065,
0.10910925269126892,
2.2612621784210205,
1.7966766357421875,
-0.4885978698730469,
-0.26938217878341675,
-1.0367720127105713,
1.334228754043579,
-0.17193496227264404,
0.25423553586006165,
1.9283562898635864,
-0.35136541724205017,
-0.9798450469970703,
1.188886046409607,
-2.3271212577819824,
0.14816413819789886,
1.9658548831939697,
0.22451433539390564,
-0.002546091563999653,
-1.524864912033081,
-0.6136764287948608,
-0.33725064992904663,
-0.2959885895252228,
-1.2489960193634033,
0.5606797933578491,
-0.28389501571655273,
-0.822092592716217,
-1.4772099256515503,
0.17179186642169952,
-1.0046632289886475,
-1.7257949113845825,
0.30265772342681885,
1.9603182077407837,
1.9263834953308105,
-0.7578248977661133,
1.5440645217895508,
-0.22646208107471466,
0.16116492450237274,
1.2987654209136963,
1.3052173852920532,
3.243302345275879,
1.9520293474197388,
-1.1776713132858276,
0.7706173062324524,
-0.07662860304117203,
-0.456079363822937,
1.2391592264175415,
-1.2332788705825806,
1.1467509269714355,
-0.18586595356464386,
-1.1015081405639648,
-1.2690999507904053,
1.0054377317428589,
0.5175942182540894,
-0.030382715165615082,
-0.4393523931503296,
1.3500096797943115,
0.13396966457366943,
1.2706495523452759,
0.5732858180999756,
-0.40829452872276306,
0.539389431476593,
-0.3878084719181061,
-0.5351073145866394,
1.562693476676941,
0.27357760071754456,
-1.4481306076049805,
-2.213104724884033,
-0.22085003554821014,
-0.821681797504425,
-0.03552940487861633,
-0.5911593437194824,
-1.0365670919418335,
1.691178798675537,
0.42917969822883606,
-1.1866198778152466,
-0.29944518208503723,
-0.3840484917163849,
-0.6751481294631958,
2.7397048473358154,
-1.3291983604431152,
-0.22198614478111267,
-1.0141047239303589,
-0.5594620108604431,
1.693556785583496,
-1.2702912092208862,
-0.19530896842479706,
-1.04859459400177,
-0.5499629974365234,
-1.3119871616363525,
-0.5987035036087036,
0.012079746462404728,
-0.8864459991455078,
0.7323251962661743,
0.04248915985226631,
-1.1029447317123413,
-0.30936986207962036,
-0.8122247457504272,
1.0376747846603394,
-0.16155946254730225,
0.3025895357131958,
1.9354593753814697,
0.4012889564037323,
-0.4639355540275574,
0.7308926582336426,
1.0760762691497803,
0.6585473418235779,
-0.5599461197853088,
0.26525524258613586,
-0.5686267614364624,
0.2818601727485657,
-1.3704854249954224,
0.3300933539867401,
-2.7912120819091797,
0.6471178531646729,
-0.18556566536426544,
-0.14087432622909546,
-0.09716802090406418,
-1.3673160076141357,
1.0357550382614136,
2.6658682823181152,
-1.213550329208374,
0.3799980580806732,
0.27469033002853394,
1.1401896476745605,
-1.6093642711639404,
0.41937780380249023,
-0.4752236306667328,
2.1038641929626465,
0.1810382902622223,
1.2078680992126465,
-0.45417049527168274,
-2.083422899246216,
0.7574028372764587,
-1.2533029317855835,
-1.0613127946853638,
0.8899361491203308,
-0.8655990362167358,
0.057577766478061676,
-1.3069509267807007,
-0.14248959720134735,
-0.8360810875892639,
-1.3231524229049683,
0.707818865776062,
0.08424881845712662,
0.48401421308517456,
-0.5922166109085083,
0.3001175820827484,
-2.0696825981140137,
-1.3580069541931152,
-0.28756946325302124,
-0.9552121162414551,
0.38378816843032837,
-0.35242196917533875,
0.580625057220459,
-0.1478927582502365,
0.10688021034002304,
0.4095924198627472,
1.4933688640594482,
3.457509994506836,
0.13952569663524628,
0.3004806637763977,
-0.029151123017072678,
-0.9348839521408081,
1.4436167478561401,
0.8513495326042175,
-0.10263288766145706,
-0.6089919209480286,
-1.01083242893219,
1.2647687196731567,
1.9838370084762573,
1.0896714925765991,
0.14573630690574646,
-0.7891122102737427,
-0.7993679046630859,
-0.005675649736076593,
0.21407844126224518,
0.3958989977836609,
0.8539289236068726,
0.02952832356095314,
0.1074308454990387,
1.377997636795044,
1.2594355344772339,
-0.5089085698127747,
0.4367688000202179,
-0.8902909755706787,
-0.4050769805908203,
0.4268472492694855,
0.2591114938259125,
-0.1395307332277298,
0.3773733377456665,
-1.0251623392105103,
-0.3074280023574829,
-0.38375693559646606,
-0.9228056073188782,
-0.7168869972229004,
-0.3556478023529053,
-0.3543448746204376,
1.6706171035766602,
0.13377933204174042,
-0.5181457996368408,
-0.06749224662780762,
-0.7022611498832703,
-0.21873445808887482,
-0.9806579351425171,
0.12111807614564896,
-0.16146442294120789,
-0.08416938781738281,
0.019814960658550262,
1.7375320196151733,
-0.9771189093589783,
-2.2375338077545166,
0.35833489894866943,
0.24127855896949768,
-0.4337099492549896,
0.21459664404392242,
1.6875678300857544,
0.5135149955749512,
1.3567471504211426,
1.4000192880630493,
0.9340819120407104,
-0.7133262157440186,
-1.27181875705719,
0.7342378497123718,
0.9481353163719177,
-1.4586946964263916,
0.874519944190979,
-0.1155722364783287,
-0.46338388323783875,
0.6603290438652039,
1.2522934675216675,
0.34682199358940125,
-1.9593143463134766,
0.8628934621810913,
-0.8963455557823181,
0.7145376205444336,
0.7216341495513916,
0.7429434657096863,
0.26566651463508606,
0.8933754563331604,
-1.129837989807129,
-1.2050334215164185,
-0.8069189786911011,
-0.7076006531715393,
1.8847204446792603,
-0.20011839270591736,
0.5983265042304993,
-0.04540087655186653,
-1.406539797782898,
-0.12933389842510223,
0.7465569972991943,
0.292202353477478,
-0.45281872153282166,
0.9438550472259521,
-0.7432659268379211,
-1.0184009075164795,
-1.3420912027359009,
-0.5153775811195374,
-1.0346229076385498,
-0.9916649460792542,
1.0207117795944214,
0.6531213521957397,
0.30354535579681396,
2.01727032661438,
0.5237504839897156,
0.3022087514400482,
-2.695188045501709,
0.8692053556442261,
0.33972012996673584,
0.1221928820014,
0.8705281019210815,
0.19313538074493408,
1.07819402217865,
-0.09825222939252853,
0.4979306161403656,
-2.251682996749878,
2.3253390789031982,
-0.26415523886680603,
0.6650117039680481,
-0.01232108660042286,
-0.2204291969537735,
1.0042469501495361,
0.5522944927215576,
0.6456184387207031,
-1.015660047531128,
0.8039836883544922,
-0.6861850619316101,
1.1733721494674683,
0.9753570556640625,
-0.9152090549468994,
0.0288144089281559,
1.4049677848815918,
0.5833353996276855,
-0.5133044719696045,
-0.9964815378189087,
-0.9165542721748352,
0.8861697316169739,
1.700247883796692,
0.02653380110859871,
0.003501255065202713,
0.9000452160835266,
0.6183904409408569,
-1.1520683765411377,
0.13843685388565063,
-0.7801192998886108,
-0.7513805031776428,
1.6438512802124023,
2.0529723167419434,
-0.12488803267478943,
-0.14950548112392426,
-0.7876827716827393,
-1.1674903631210327,
0.6973273754119873,
-0.050222624093294144,
-0.0027607628144323826,
0.7426702976226807,
-0.6512015461921692,
1.0560017824172974,
0.7613982558250427,
0.9719838500022888,
0.15022923052310944,
0.2962011694908142,
0.42620858550071716,
-0.26453685760498047,
-1.194345474243164,
-0.36329329013824463,
-1.1610713005065918,
-2.5696194171905518,
0.5270383954048157,
-0.2940347492694855,
-1.388915777206421,
0.035885296761989594,
-1.1354643106460571,
1.0014185905456543,
-0.5654138922691345,
-0.9787711501121521,
-1.4113982915878296,
0.28942015767097473,
-0.20934978127479553,
0.9137517809867859,
-1.5969280004501343,
-0.13888239860534668,
1.2280972003936768,
0.8434398174285889,
-0.7275315523147583,
0.9385916590690613,
0.20512863993644714,
1.1092123985290527,
0.9432367086410522,
-0.4002038836479187,
0.45308807492256165,
0.05979033559560776,
-1.3493763208389282,
0.5244994163513184,
1.1192517280578613,
0.040519509464502335,
1.5105515718460083,
-0.4928952157497406,
0.04249539226293564,
0.4432288110256195,
-0.645666778087616,
-0.45245736837387085,
-0.6317319273948669,
0.7728988528251648,
-0.022182513028383255,
-0.8634648323059082,
0.009900196455419064,
-0.23462054133415222,
-0.26596495509147644,
0.133119136095047,
-1.6615644693374634,
-0.14600175619125366,
-0.26283228397369385,
-0.5627340078353882,
-1.3080414533615112,
-0.013262651860713959,
1.369259238243103,
-0.7743998169898987,
-0.23975558578968048,
0.42908886075019836,
0.30005142092704773,
0.5681461095809937,
0.5828893780708313,
-0.7363693714141846,
-0.22256125509738922,
-0.32778599858283997,
-0.31297656893730164,
0.40358391404151917,
1.246402621269226,
-0.08793043345212936,
-0.9154796004295349,
0.7602978348731995,
-0.33571961522102356,
0.09682419896125793,
1.938812255859375,
0.05125538259744644,
-0.7744372487068176,
0.2207515984773636,
-0.5907842516899109,
1.8741570711135864,
1.6042484045028687,
1.2042255401611328,
-0.10856464505195618,
-0.8750174045562744,
0.6641564965248108,
-0.23696796596050262,
-0.38091766834259033,
0.7788235545158386,
0.43443432450294495,
-0.2655273973941803,
-1.3333914279937744,
0.648798942565918,
1.1794540882110596,
-0.9270086288452148,
-0.853445291519165,
0.10109170526266098,
-0.8456223607063293,
1.1736570596694946,
0.6968586444854736,
0.3656393587589264,
0.24712425470352173,
1.7088086605072021,
0.6742801070213318,
-0.45957663655281067,
0.41942840814590454,
0.4851321876049042,
-0.16258229315280914,
-2.1310789585113525,
-0.9877399802207947,
0.3052367866039276,
-0.4445047676563263,
-1.5494259595870972,
1.3257282972335815,
-1.2161933183670044,
-0.8589168190956116,
0.5129598379135132,
0.19017916917800903,
1.4859070777893066,
0.25412705540657043,
1.6851005554199219,
2.019005060195923,
0.8025859594345093,
0.39847108721733093,
1.3174015283584595,
-0.07437552511692047,
-0.4459284245967865,
1.7306108474731445,
-0.5005108714103699,
0.5471292734146118,
1.1139506101608276,
-0.4474436640739441,
-0.9744623303413391,
-0.7776219844818115,
-1.1503773927688599,
-0.6244755387306213,
1.234071135520935,
0.11379210650920868,
-1.1290861368179321,
0.23413176834583282,
1.505645513534546,
0.1558334231376648,
-0.18989932537078857,
0.4817054569721222,
0.3890911340713501,
-0.6513991355895996,
-0.031362466514110565,
-0.9321752190589905,
0.5618166923522949,
-0.16766616702079773,
-0.39298662543296814,
0.3252231180667877,
0.5033132433891296,
1.219447374343872,
-0.07464286684989929,
0.2029995620250702,
1.2591674327850342,
-1.42129647731781,
1.4701069593429565,
-0.5805784463882446,
0.10209394991397858,
-2.3887834548950195,
1.4258208274841309,
-0.8892343044281006,
1.949369192123413,
-2.6218557357788086,
0.45006483793258667,
-0.5681542754173279,
-0.43840503692626953,
0.39546942710876465,
-0.4094254970550537,
0.04323219880461693,
-0.219778910279274,
-1.0913571119308472,
-0.06889674067497253,
-0.7014626264572144,
0.6126552820205688,
1.1646738052368164,
1.3600022792816162,
-1.077484130859375,
-0.17841565608978271,
-1.7821660041809082,
-0.15004727244377136,
-0.697811484336853,
0.42839041352272034,
-1.9846662282943726,
-0.22637073695659637,
-1.973602533340454,
-2.3873913288116455,
-1.368194341659546,
-0.766197919845581,
0.9528486132621765,
0.09794323891401291,
-0.7891027927398682,
1.1159076690673828,
-0.336193710565567,
-1.7769989967346191,
1.0188425779342651,
-2.2009592056274414
] |
https://github.com/huggingface/datasets/issues/5137 | Align task tags in dataset metadata | I have opened PRs to fix the task_ids in all datasets within a namespace as well.
Working on task_categories... | ## Describe
Once we have agreed on a common naming for task tags for all open source projects, we should align on them.
## Steps
- [x] Align task tags in canonical datasets
- [x] task_categories: 4 datasets
- [x] task_ids (by @lhoestq)
- [x] Open PRs in community datasets
- [x] task_categories: 451 datasets
- [x] task_ids: 556 datasets
| 467 | 19 | Align task tags in dataset metadata
## Describe
Once we have agreed on a common naming for task tags for all open source projects, we should align on them.
## Steps
- [x] Align task tags in canonical datasets
- [x] task_categories: 4 datasets
- [x] task_ids (by @lhoestq)
- [x] Open PRs in community datasets
- [x] task_categories: 451 datasets
- [x] task_ids: 556 datasets
I have opened PRs to fix the task_ids in all datasets within a namespace as well.
Working on task_categories... | [
-1.353729009628296,
-0.8502987623214722,
-0.8420729637145996,
1.3711129426956177,
-0.0743594840168953,
-1.2630029916763306,
0.05344940349459648,
-1.222676396369934,
1.8642094135284424,
-0.9720121026039124,
0.2138565629720688,
-1.6839433908462524,
0.010918867774307728,
-0.6479184627532959,
-0.73541659116745,
-1.0142778158187866,
-0.44235461950302124,
-0.8044365644454956,
1.0381708145141602,
2.462280511856079,
0.9880653023719788,
-1.358688235282898,
2.9095401763916016,
0.766120970249176,
-0.29377275705337524,
-0.8101654648780823,
0.5172898173332214,
0.0748380795121193,
-1.328675627708435,
-0.3554627597332001,
-1.1128394603729248,
-0.052102651447057724,
-0.5386784672737122,
-0.45233410596847534,
0.04834699258208275,
0.21232572197914124,
-0.1870385706424713,
-0.3412304222583771,
-0.32654017210006714,
-0.7857875227928162,
0.2813710868358612,
-0.19011850655078888,
0.853835940361023,
-0.48857244849205017,
1.7897391319274902,
-0.5969282984733582,
0.17458857595920563,
0.626102864742279,
1.3089323043823242,
0.2795507609844208,
-0.16008830070495605,
0.23318253457546234,
0.2761068344116211,
-0.09262274205684662,
0.48952966928482056,
0.9990255832672119,
0.45866212248802185,
0.6285539865493774,
0.7642626762390137,
-2.3085343837738037,
1.333217978477478,
-1.031162142753601,
0.39239034056663513,
1.5980165004730225,
-1.018652319908142,
0.26682502031326294,
-1.7853106260299683,
-0.05415892228484154,
0.6527690887451172,
-2.373648166656494,
0.16781878471374512,
-1.2106022834777832,
-0.5977250933647156,
0.9653082489967346,
0.4034619629383087,
-1.313033938407898,
0.11610793322324753,
-0.43936559557914734,
0.9953829050064087,
0.48440343141555786,
1.15628981590271,
-1.6842354536056519,
0.21651096642017365,
-0.28181740641593933,
-0.00040596071630716324,
-1.2985042333602905,
-1.4573744535446167,
0.6121597290039062,
0.5393410921096802,
0.5990898013114929,
-0.03017711266875267,
0.8231346607208252,
-0.9551637768745422,
0.7999040484428406,
-0.8839163184165955,
-1.7046314477920532,
-1.2952507734298706,
-2.404728412628174,
-2.443387746810913,
0.7982136011123657,
-0.47321632504463196,
-0.4413466453552246,
2.0271878242492676,
-1.042634129524231,
-1.7808268070220947,
1.1506526470184326,
0.33237406611442566,
0.038752611726522446,
2.4592652320861816,
0.32369840145111084,
-0.684298038482666,
0.48001739382743835,
-0.8175437450408936,
0.6991170644760132,
-0.3669784367084503,
1.32297682762146,
0.479937344789505,
-0.9929580688476562,
1.6100904941558838,
-0.39182010293006897,
0.6126041412353516,
-0.6421687602996826,
-0.556834876537323,
-0.9398349523544312,
0.4594976305961609,
1.8918882608413696,
-0.20756785571575165,
1.515398383140564,
-0.3323943316936493,
-1.5560683012008667,
-1.5151121616363525,
0.8246608376502991,
0.6999533176422119,
-0.8601205348968506,
0.22241297364234924,
-0.410584032535553,
0.06229013577103615,
0.050974342972040176,
1.215641975402832,
1.1787588596343994,
0.6801633834838867,
-0.22291326522827148,
-0.8716273307800293,
0.2041759043931961,
0.0347917266190052,
-0.7736603021621704,
-1.874260663986206,
-0.2711033523082733,
0.13558585941791534,
0.7297191023826599,
-1.250305414199829,
1.6151636838912964,
0.911874532699585,
1.9262720346450806,
0.9570255279541016,
-0.291496604681015,
1.4882975816726685,
0.03727920725941658,
1.7896801233291626,
-0.3248688280582428,
0.7491483688354492,
-0.3019942343235016,
-1.3307675123214722,
0.9408295154571533,
-0.4547915756702423,
-1.988728404045105,
-0.8264545202255249,
-0.8785587549209595,
-0.18325839936733246,
-0.7851433753967285,
0.9858327507972717,
-0.2920556664466858,
-1.417472004890442,
0.23113150894641876,
-0.6249435544013977,
0.31136059761047363,
-1.313978910446167,
0.20570287108421326,
0.7699075937271118,
-0.5486927032470703,
-0.008005050010979176,
-0.14396846294403076,
-1.4423692226409912,
-0.5661411881446838,
0.249283567070961,
1.7574141025543213,
-0.8493533134460449,
0.9426268935203552,
1.0379339456558228,
-0.5900722146034241,
-0.00881611742079258,
0.33990478515625,
-0.16499054431915283,
0.8874022960662842,
-1.0521678924560547,
-0.38524699211120605,
1.2860088348388672,
-0.1095430850982666,
-0.6432219743728638,
1.5207420587539673,
0.6797636151313782,
-1.0423660278320312,
-0.17093829810619354,
-0.25952619314193726,
-0.7962049245834351,
-0.0871710255742073,
-1.632307529449463,
-0.22884909808635712,
0.37292903661727905,
-1.5694537162780762,
-0.4067315459251404,
-0.060772333294153214,
1.3977398872375488,
-0.19415554404258728,
1.3901984691619873,
-0.33721163868904114,
-0.2690771818161011,
-0.4322708249092102,
-0.3504590094089508,
0.23682145774364471,
-0.15403814613819122,
-0.5957704782485962,
0.3980828523635864,
-0.7792473435401917,
0.3311617374420166,
1.427678108215332,
0.36596062779426575,
0.26485079526901245,
0.6122181415557861,
1.01475989818573,
0.1941136121749878,
-0.249660924077034,
-0.8403376936912537,
-1.739275574684143,
2.0664939880371094,
-1.486251950263977,
1.984428882598877,
0.6229476928710938,
-0.1138233169913292,
-1.7458113431930542,
-1.856438398361206,
1.4728354215621948,
1.0977200269699097,
2.269294023513794,
0.6353672742843628,
0.407336562871933,
-0.9002283811569214,
-0.6348444223403931,
0.29367080330848694,
-0.9541693329811096,
-0.6518628001213074,
0.19064445793628693,
2.2319133281707764,
1.7110334634780884,
-0.45641931891441345,
-0.001592792570590973,
-0.7930572032928467,
1.3106807470321655,
-0.35309770703315735,
0.1779371201992035,
1.975688099861145,
-0.6254661679267883,
-1.1560660600662231,
1.2127110958099365,
-2.4262917041778564,
0.07260414958000183,
1.9544836282730103,
0.30651044845581055,
0.057790737599134445,
-1.3843588829040527,
-0.7872174978256226,
-0.3132421672344208,
-0.33772456645965576,
-1.2723110914230347,
0.5964334607124329,
-0.24261148273944855,
-0.8940381407737732,
-1.432571291923523,
0.22560805082321167,
-1.0762277841567993,
-1.6108959913253784,
0.41602224111557007,
1.8481088876724243,
2.197150468826294,
-0.7543659210205078,
1.4681079387664795,
-0.26927658915519714,
0.22717030346393585,
1.1885441541671753,
1.068590521812439,
3.0233418941497803,
1.8300514221191406,
-1.258961796760559,
0.7162365317344666,
0.03127003461122513,
-0.4471004903316498,
1.1065226793289185,
-0.9854230880737305,
1.3803693056106567,
-0.1093534603714943,
-1.3445631265640259,
-1.4659684896469116,
0.9432631731033325,
0.5235047936439514,
0.07480400800704956,
-0.5760266184806824,
1.2953985929489136,
-0.08082929253578186,
1.2666337490081787,
0.3500029146671295,
-0.4433337450027466,
0.47845542430877686,
-0.3622552454471588,
-0.4610544741153717,
1.5832749605178833,
0.1144280880689621,
-1.5178297758102417,
-2.2454164028167725,
-0.35002458095550537,
-0.8030113577842712,
-0.2102656066417694,
-0.6616702079772949,
-1.085511326789856,
1.578657627105713,
0.5504300594329834,
-1.1106332540512085,
-0.2519039511680603,
-0.3185083270072937,
-0.5374841094017029,
2.6137256622314453,
-1.3508422374725342,
-0.13409920036792755,
-0.78131103515625,
-0.40856796503067017,
1.6378899812698364,
-1.207284688949585,
-0.15066789090633392,
-1.021301507949829,
-0.6497397422790527,
-1.2641136646270752,
-0.5752297043800354,
-0.01905563473701477,
-1.1376813650131226,
0.8325172662734985,
0.008655291981995106,
-1.2104496955871582,
-0.31332793831825256,
-0.7659251093864441,
0.9685606956481934,
-0.019236654043197632,
0.21964077651500702,
1.9575848579406738,
0.25558552145957947,
-0.3896525204181671,
0.6789414882659912,
1.3214571475982666,
0.8356025218963623,
-0.690371572971344,
0.11669797450304031,
-0.5803884267807007,
0.4221011996269226,
-1.3106235265731812,
0.27217555046081543,
-3.106433153152466,
0.6987790465354919,
0.0011397190392017365,
-0.002358915749937296,
0.0037068380042910576,
-1.2589575052261353,
1.1331983804702759,
2.5622775554656982,
-1.2019379138946533,
0.40891268849372864,
0.39096352458000183,
1.1067569255828857,
-1.3928645849227905,
0.1531132310628891,
-0.4273679852485657,
2.0876920223236084,
0.10553456097841263,
1.2166951894760132,
-0.42134779691696167,
-2.096747398376465,
0.6595902442932129,
-1.3160650730133057,
-1.1402350664138794,
0.8766153454780579,
-0.860910177230835,
0.1719411164522171,
-1.5205943584442139,
-0.12058670073747635,
-0.8375928997993469,
-1.216274619102478,
0.5882719159126282,
0.21414043009281158,
0.5889648199081421,
-0.6762417554855347,
0.4423765242099762,
-2.299593448638916,
-1.2847050428390503,
-0.07070978730916977,
-1.0412920713424683,
0.3801492750644684,
-0.31113171577453613,
0.662427544593811,
-0.11459628492593765,
0.14508239924907684,
0.43113023042678833,
1.4415854215621948,
3.3681423664093018,
0.09155627340078354,
0.43946194648742676,
-0.17897982895374298,
-0.8719150424003601,
1.4494624137878418,
1.1634259223937988,
-0.10427261888980865,
-0.4599786102771759,
-0.8789262771606445,
1.3411023616790771,
1.9741719961166382,
0.9879887104034424,
-0.029113925993442535,
-0.8746780157089233,
-0.6026328802108765,
-0.027676202356815338,
0.2461424618959427,
0.536088228225708,
0.8276098966598511,
-0.07193981111049652,
0.010637202300131321,
1.422717809677124,
1.0313223600387573,
-0.5162785053253174,
0.49422141909599304,
-0.911786675453186,
-0.538598895072937,
0.5063611268997192,
0.42157962918281555,
0.029358047991991043,
0.5042285323143005,
-0.9890862703323364,
-0.06425779312849045,
-0.1980035901069641,
-0.8855962753295898,
-0.6671444773674011,
-0.21971850097179413,
-0.48234957456588745,
1.5875760316848755,
-0.008316710591316223,
-0.521284818649292,
-0.024257250130176544,
-0.8432856798171997,
-0.18672506511211395,
-1.0754880905151367,
0.3713621497154236,
-0.06711139529943466,
-0.09827904403209686,
-0.29014015197753906,
1.7522720098495483,
-1.1332123279571533,
-2.0355780124664307,
0.09106162190437317,
0.22754959762096405,
-0.3472473919391632,
0.14420799911022186,
1.7554093599319458,
0.5316870808601379,
1.5260884761810303,
1.346631407737732,
0.8514341711997986,
-0.6820113062858582,
-1.3451863527297974,
0.6154156923294067,
0.8782222867012024,
-1.3632879257202148,
0.8456594944000244,
-0.1742595136165619,
-0.5634112358093262,
0.7221885323524475,
1.2587910890579224,
0.4486590623855591,
-1.8546055555343628,
0.9129335284233093,
-1.0929902791976929,
0.8109959959983826,
0.6843162178993225,
0.9145979881286621,
0.08828724920749664,
0.9048358201980591,
-1.098639965057373,
-1.1305489540100098,
-0.8584099411964417,
-0.6772806644439697,
1.9306035041809082,
-0.2572399973869324,
0.3788610100746155,
-0.22171956300735474,
-1.154813528060913,
0.09273108094930649,
0.5453914999961853,
0.33549800515174866,
-0.029772955924272537,
0.6987199783325195,
-0.731670081615448,
-1.1731849908828735,
-1.3440773487091064,
-0.43012309074401855,
-0.9814178943634033,
-0.8848925828933716,
1.1008596420288086,
0.8736760020256042,
0.3906572163105011,
1.7923011779785156,
0.6053834557533264,
0.2904645800590515,
-2.548582077026367,
0.7291338443756104,
0.42069754004478455,
-0.03309056535363197,
0.8555648326873779,
0.3345282971858978,
1.198615550994873,
0.036468930542469025,
0.3254368305206299,
-2.240846872329712,
2.189192056655884,
-0.2398790717124939,
0.6126712560653687,
-0.007072168868035078,
0.12255441397428513,
0.9650394320487976,
0.7007824182510376,
0.5357388257980347,
-1.1116220951080322,
0.7460451126098633,
-0.5227189064025879,
1.2441258430480957,
0.8989360928535461,
-0.7505698204040527,
-0.12163147330284119,
1.3224035501480103,
0.5446847081184387,
-0.3889538049697876,
-0.9739470481872559,
-0.8651214241981506,
0.9815812706947327,
1.6662100553512573,
0.024828966706991196,
-0.07419095933437347,
0.7033967971801758,
0.6040529608726501,
-1.2919273376464844,
-0.11964839696884155,
-0.6166607737541199,
-0.7359669804573059,
1.5819368362426758,
2.0576229095458984,
-0.077837273478508,
-0.008600268512964249,
-0.6709558963775635,
-1.3462424278259277,
0.7395521998405457,
-0.20929297804832458,
0.01574038341641426,
0.5393683910369873,
-0.6413554549217224,
1.1201930046081543,
0.9102818965911865,
0.7675119042396545,
0.13026516139507294,
0.34811174869537354,
0.22446899116039276,
-0.05176097899675369,
-1.2430634498596191,
-0.3043263256549835,
-0.8986958861351013,
-2.593686580657959,
0.27769333124160767,
-0.4173792898654938,
-1.4228779077529907,
0.02474299445748329,
-1.0439088344573975,
0.8536207675933838,
-0.6080161333084106,
-0.9743280410766602,
-1.5159642696380615,
0.17960359156131744,
0.004012157209217548,
0.8511873483657837,
-1.3655915260314941,
-0.05687457695603371,
1.4184901714324951,
0.8718202114105225,
-0.7192527651786804,
1.105002760887146,
0.2739194631576538,
1.0335546731948853,
0.7642761468887329,
-0.3850398063659668,
0.512660562992096,
0.12960384786128998,
-1.3070982694625854,
0.5068687200546265,
1.292632818222046,
0.08354702591896057,
1.5050710439682007,
-0.5600425601005554,
-0.13940508663654327,
0.4334195852279663,
-0.5156197547912598,
-0.40370091795921326,
-0.7102278470993042,
0.7231855392456055,
0.17136719822883606,
-0.774457573890686,
-0.008908095769584179,
-0.044542476534843445,
-0.3585900068283081,
0.3502231240272522,
-1.564481496810913,
-0.37379351258277893,
-0.4900681674480438,
-0.5373223423957825,
-1.3629570007324219,
0.0242379829287529,
1.429870843887329,
-0.8734923005104065,
-0.14971551299095154,
0.5466558337211609,
0.4767705798149109,
0.47923600673675537,
0.8264372944831848,
-0.6402285099029541,
-0.2095550149679184,
-0.4458073079586029,
-0.40416526794433594,
0.28344833850860596,
1.2877261638641357,
-0.1502026915550232,
-0.9645439982414246,
0.6794460415840149,
-0.24755890667438507,
-0.11011354625225067,
2.079192876815796,
0.09707314521074295,
-0.9951944947242737,
0.2695896029472351,
-0.8004138469696045,
2.1184277534484863,
1.53022038936615,
1.2129312753677368,
-0.1314278095960617,
-0.9762737154960632,
0.6995859742164612,
-0.23974217474460602,
-0.2998696565628052,
0.9199719429016113,
0.48868101835250854,
-0.24570584297180176,
-1.4480087757110596,
0.5800613760948181,
1.205674409866333,
-0.8143467903137207,
-0.7624997496604919,
0.09309974312782288,
-0.690035879611969,
0.9892910718917847,
0.8662573099136353,
0.3753029406070709,
0.34580615162849426,
1.5930474996566772,
0.7205072641372681,
-0.6733185052871704,
0.14627240598201752,
0.5538338422775269,
0.0981472060084343,
-1.9538590908050537,
-0.9139916896820068,
0.38444870710372925,
-0.41234463453292847,
-1.4910187721252441,
1.2423834800720215,
-1.0541932582855225,
-0.9688739776611328,
0.5520744323730469,
0.04970639571547508,
1.2801231145858765,
0.1947014331817627,
1.7560187578201294,
1.9814783334732056,
1.0091208219528198,
0.2239801436662674,
1.3896801471710205,
-0.2373376190662384,
-0.21441254019737244,
1.7879291772842407,
-0.419570654630661,
0.5320378541946411,
1.1838122606277466,
-0.5035966038703918,
-0.9288719892501831,
-0.7579615712165833,
-1.1236133575439453,
-0.6153945326805115,
1.0073304176330566,
0.297578901052475,
-1.3188154697418213,
0.2228725403547287,
1.4625414609909058,
0.18968385457992554,
-0.12236586213111877,
0.629629909992218,
0.44549891352653503,
-0.8369455337524414,
-0.04816107451915741,
-1.0403088331222534,
0.4946364462375641,
-0.22915931046009064,
-0.35747814178466797,
0.35269826650619507,
0.49408671259880066,
1.3446648120880127,
0.029369372874498367,
0.12863200902938843,
1.1857174634933472,
-1.4896727800369263,
1.242332935333252,
-0.8016123175621033,
0.33611738681793213,
-2.367438316345215,
1.2752540111541748,
-0.7481513023376465,
1.9255017042160034,
-2.8904967308044434,
0.46849972009658813,
-0.6149845719337463,
-0.42815154790878296,
0.26045846939086914,
-0.28648170828819275,
0.21428182721138,
-0.14672647416591644,
-1.2263623476028442,
-0.13745038211345673,
-0.8209673166275024,
0.6391624212265015,
1.1610952615737915,
1.3211926221847534,
-0.9771769046783447,
-0.3593420088291168,
-1.5494372844696045,
-0.33873873949050903,
-0.6882182359695435,
0.16432376205921173,
-1.9206647872924805,
-0.04495298117399216,
-1.8908753395080566,
-2.403247594833374,
-1.392630696296692,
-0.6854591965675354,
1.2287185192108154,
0.11853528767824173,
-0.8775124549865723,
1.22718346118927,
-0.422232449054718,
-1.7708079814910889,
1.084395170211792,
-2.174861192703247
] |
https://github.com/huggingface/datasets/issues/5137 | Align task tags in dataset metadata | For future reference: this fix had some complications
When trying to open a PR to fix the task tags, an exception was thrown if:
- the metadata contained "languages" or "licenses" (instead of "language" or "license")
- the metadata contained a non-valid language: `en-US` (instead of `en`), `no` (instead of `'no'`),...
- the metadata contained a non-valid license
- either `task_categories` or `task_ids` was not an array (a dict for each config)
- the metadata contained non-valid tag names
Errors:
```
ValueError: - Error: "languages" is deprecated. Use "language" instead.
```
```
ValueError: - Error: "licenses" is deprecated. Use "license" instead.
```
```
ValueError: - Error: "language[17]" must only contain lowercase characters
```
```
ValueError: - Error: "language[0]" with value "cz, de, it" is not valid. It must be an ISO 639-1, 639-2 or 639-3 code (two/three letters), or a special value like "code", "multilingual". If you want to use BCP-47 identifiers, you can specify them in language_bcp47.
```
```
ValueError: - Error: "task_ids" must be an array
``` | ## Describe
Once we have agreed on a common naming for task tags for all open source projects, we should align on them.
## Steps
- [x] Align task tags in canonical datasets
- [x] task_categories: 4 datasets
- [x] task_ids (by @lhoestq)
- [x] Open PRs in community datasets
- [x] task_categories: 451 datasets
- [x] task_ids: 556 datasets
| 467 | 169 | Align task tags in dataset metadata
## Describe
Once we have agreed on a common naming for task tags for all open source projects, we should align on them.
## Steps
- [x] Align task tags in canonical datasets
- [x] task_categories: 4 datasets
- [x] task_ids (by @lhoestq)
- [x] Open PRs in community datasets
- [x] task_categories: 451 datasets
- [x] task_ids: 556 datasets
For future reference: this fix had some complications
When trying to open a PR to fix the task tags, an exception was thrown if:
- the metadata contained "languages" or "licenses" (instead of "language" or "license")
- the metadata contained a non-valid language: `en-US` (instead of `en`), `no` (instead of `'no'`),...
- the metadata contained a non-valid license
- either `task_categories` or `task_ids` was not an array (a dict for each config)
- the metadata contained non-valid tag names
Errors:
```
ValueError: - Error: "languages" is deprecated. Use "language" instead.
```
```
ValueError: - Error: "licenses" is deprecated. Use "license" instead.
```
```
ValueError: - Error: "language[17]" must only contain lowercase characters
```
```
ValueError: - Error: "language[0]" with value "cz, de, it" is not valid. It must be an ISO 639-1, 639-2 or 639-3 code (two/three letters), or a special value like "code", "multilingual". If you want to use BCP-47 identifiers, you can specify them in language_bcp47.
```
```
ValueError: - Error: "task_ids" must be an array
``` | [
-1.0488719940185547,
-0.7844398617744446,
-0.8028276562690735,
1.5662145614624023,
-0.11721699684858322,
-1.2505743503570557,
0.13491269946098328,
-1.1481696367263794,
1.744569182395935,
-0.8671489953994751,
0.4039473235607147,
-1.6739534139633179,
0.05895040184259415,
-0.7435422539710999,
-0.8014187216758728,
-0.8256444931030273,
-0.41316235065460205,
-0.677527904510498,
1.007568120956421,
2.4965507984161377,
1.1927882432937622,
-1.3984386920928955,
2.7263734340667725,
0.6752722859382629,
-0.12628813087940216,
-0.8375455737113953,
0.45973503589630127,
-0.08740178495645523,
-1.2159956693649292,
-0.4082169234752655,
-1.0068117380142212,
-0.19194519519805908,
-0.6253170967102051,
-0.6013251543045044,
-0.014813371002674103,
0.4028785228729248,
-0.39003217220306396,
-0.5082886219024658,
-0.46794500946998596,
-0.8730122447013855,
0.44985055923461914,
-0.28236013650894165,
0.9570079445838928,
-0.39188188314437866,
1.8039344549179077,
-0.6754974126815796,
0.39780643582344055,
0.6174294352531433,
1.2941181659698486,
0.3964301347732544,
-0.04950340837240219,
0.3120064437389374,
0.3455842435359955,
-0.07745420932769775,
0.5919361114501953,
1.1559300422668457,
0.6736810803413391,
0.5688242316246033,
0.8472440838813782,
-2.251629590988159,
1.2050256729125977,
-1.109910488128662,
0.20917046070098877,
1.3520727157592773,
-0.8724294304847717,
0.2892129421234131,
-1.9113348722457886,
-0.03735893592238426,
0.5249581336975098,
-2.191922903060913,
0.312753289937973,
-1.330511212348938,
-0.519441545009613,
1.1026636362075806,
0.34462812542915344,
-1.2705965042114258,
0.1047796681523323,
-0.1984187513589859,
0.9321451783180237,
0.36633020639419556,
1.1213724613189697,
-1.6806365251541138,
0.06679846346378326,
-0.3427004814147949,
0.22273525595664978,
-1.0831530094146729,
-1.492807388305664,
0.6159582734107971,
0.6011645793914795,
0.48579323291778564,
-0.14616098999977112,
1.012250304222107,
-0.9415505528450012,
0.7775241136550903,
-1.092429518699646,
-1.8456796407699585,
-1.411121129989624,
-2.132312059402466,
-2.3381385803222656,
0.7611661553382874,
-0.50492924451828,
-0.43701979517936707,
2.030674695968628,
-0.936235785484314,
-1.7234488725662231,
1.0832877159118652,
0.4046824276447296,
-0.058406416326761246,
2.3608241081237793,
0.23925626277923584,
-0.7921615242958069,
0.5557267665863037,
-0.8190391063690186,
0.6789283752441406,
-0.32924947142601013,
1.423128366470337,
0.3676024377346039,
-1.1223102807998657,
1.6122357845306396,
-0.38368234038352966,
0.6557884812355042,
-0.6811065673828125,
-0.44218283891677856,
-0.5912103652954102,
0.42355799674987793,
1.892232060432434,
-0.2964904308319092,
1.4410754442214966,
-0.24396714568138123,
-1.4647094011306763,
-1.5280213356018066,
0.8489601016044617,
0.5016748905181885,
-0.7327774167060852,
0.15388090908527374,
-0.3075598180294037,
0.09455300867557526,
-0.06619833409786224,
1.2217328548431396,
1.2369126081466675,
0.8347183465957642,
-0.25230157375335693,
-0.8063331842422485,
0.09423980861902237,
0.053349196910858154,
-0.8532288670539856,
-1.6757445335388184,
-0.3924068212509155,
0.1514984667301178,
0.5861556529998779,
-1.2523784637451172,
1.810626745223999,
0.856221079826355,
1.8794633150100708,
1.033637523651123,
-0.3689844012260437,
1.5426830053329468,
0.0966552272439003,
1.8951221704483032,
-0.3155967891216278,
0.5513381361961365,
-0.42831847071647644,
-1.2827963829040527,
0.859311044216156,
-0.3321382403373718,
-2.06453537940979,
-0.7113475203514099,
-0.893868088722229,
-0.17324234545230865,
-0.8216822743415833,
0.9134950041770935,
-0.19844558835029602,
-1.3634485006332397,
0.20212310552597046,
-0.7596663236618042,
0.01580396667122841,
-1.2966184616088867,
0.34680309891700745,
0.6626466512680054,
-0.6822307705879211,
0.18254859745502472,
-0.21395963430404663,
-1.3303303718566895,
-0.5999331474304199,
0.2585980296134949,
1.8953784704208374,
-0.7964169383049011,
0.8761033415794373,
1.1296067237854004,
-0.6972556710243225,
-0.04315625876188278,
0.45117366313934326,
-0.4054020345211029,
0.8627962470054626,
-1.0614776611328125,
-0.5422584414482117,
1.2237555980682373,
-0.06573784351348877,
-0.5838748812675476,
1.4106323719024658,
0.6268264651298523,
-1.0342463254928589,
-0.20248593389987946,
-0.16501574218273163,
-0.7865747213363647,
0.0901431292295456,
-1.5516902208328247,
-0.1387033611536026,
0.42842862010002136,
-1.5326217412948608,
-0.5214027762413025,
-0.12322241067886353,
1.2736650705337524,
-0.2565547227859497,
1.3470983505249023,
-0.3733311593532562,
-0.24569348990917206,
-0.41628921031951904,
-0.32807257771492004,
0.028501272201538086,
-0.19712840020656586,
-0.7081751227378845,
0.265566885471344,
-0.6965268850326538,
0.3732970654964447,
1.3780171871185303,
0.26120758056640625,
0.04112875089049339,
0.4930502772331238,
1.1647058725357056,
0.3490046560764313,
-0.025480203330516815,
-0.9608874320983887,
-1.5287669897079468,
2.043022871017456,
-1.450169563293457,
2.0266568660736084,
0.7273656129837036,
0.0637771487236023,
-1.7413198947906494,
-1.9048787355422974,
1.5167779922485352,
1.1419401168823242,
2.4235823154449463,
0.6343489289283752,
0.4259292185306549,
-0.846791684627533,
-0.5427283048629761,
0.41282427310943604,
-0.9453129172325134,
-0.710054337978363,
0.26182273030281067,
2.4239871501922607,
1.7172285318374634,
-0.3921809792518616,
-0.14778627455234528,
-0.9454944133758545,
1.4537150859832764,
-0.25542131066322327,
0.1758299618959427,
1.9449888467788696,
-0.32833290100097656,
-1.1353224515914917,
1.27264404296875,
-2.3314836025238037,
0.11376334726810455,
1.9854623079299927,
0.24141304194927216,
0.049233924597501755,
-1.2745051383972168,
-0.6473495960235596,
-0.2148481011390686,
-0.3927225172519684,
-1.1695115566253662,
0.4747467637062073,
-0.12673556804656982,
-0.712233304977417,
-1.4457722902297974,
0.21231713891029358,
-1.187090277671814,
-1.5969477891921997,
0.20840103924274445,
1.8573371171951294,
2.04441237449646,
-0.7924742102622986,
1.5795155763626099,
-0.3355329632759094,
0.176137775182724,
1.2556214332580566,
1.1998729705810547,
3.1962711811065674,
1.811996579170227,
-1.2836627960205078,
0.6278629302978516,
-0.13166995346546173,
-0.4984075725078583,
1.1889399290084839,
-1.1681697368621826,
1.279106616973877,
-0.2141897827386856,
-1.1545946598052979,
-1.2995970249176025,
0.7677929997444153,
0.4706648886203766,
0.06448930501937866,
-0.5314816832542419,
1.019393801689148,
0.21294720470905304,
1.2629364728927612,
0.5758069753646851,
-0.2753787636756897,
0.6359261870384216,
-0.3001391589641571,
-0.3652207851409912,
1.4996763467788696,
0.16191059350967407,
-1.328469157218933,
-2.278212785720825,
-0.16705121099948883,
-0.9923747777938843,
0.00006922334432601929,
-0.6007373332977295,
-1.0493139028549194,
1.7051509618759155,
0.3893186151981354,
-1.2057112455368042,
-0.21835336089134216,
-0.3917468786239624,
-0.6132897734642029,
2.740323781967163,
-1.4349219799041748,
-0.23365798592567444,
-0.980719804763794,
-0.643635630607605,
1.6209216117858887,
-1.1154216527938843,
-0.18348638713359833,
-1.0344629287719727,
-0.46620580554008484,
-1.2600903511047363,
-0.6122169494628906,
0.10100768506526947,
-0.9391817450523376,
0.9242642521858215,
0.17910444736480713,
-1.3210862874984741,
-0.41883188486099243,
-0.8678461909294128,
0.8338097929954529,
-0.19853219389915466,
0.14876669645309448,
2.003512144088745,
0.42201268672943115,
-0.32746466994285583,
0.6821675300598145,
1.2011457681655884,
0.6787400841712952,
-0.47479140758514404,
0.4104599952697754,
-0.6228037476539612,
0.3336808681488037,
-1.3661506175994873,
0.3236215114593506,
-2.8411829471588135,
0.5739263296127319,
-0.0004370417445898056,
0.006276845000684261,
0.008555066771805286,
-1.3405876159667969,
1.090103030204773,
2.5446784496307373,
-1.1756647825241089,
0.42237815260887146,
0.29741427302360535,
1.1342759132385254,
-1.571718692779541,
0.09147948771715164,
-0.4100751578807831,
2.1110587120056152,
0.039437923580408096,
1.1109910011291504,
-0.4360787868499756,
-2.3241608142852783,
0.6009955406188965,
-1.3265597820281982,
-1.2039234638214111,
0.8218703269958496,
-0.7860139012336731,
0.053324759006500244,
-1.3665438890457153,
-0.23186811804771423,
-0.8583162426948547,
-1.1607623100280762,
0.7206954956054688,
0.04559103772044182,
0.5158379673957825,
-0.638871967792511,
0.38917437195777893,
-2.1942994594573975,
-1.468914270401001,
-0.23244896531105042,
-0.9349052309989929,
0.3682851195335388,
-0.3759153485298157,
0.8307580947875977,
-0.23579496145248413,
-0.06237955391407013,
0.44701170921325684,
1.5557324886322021,
3.369320869445801,
0.24428428709506989,
0.44836878776550293,
-0.2867701053619385,
-0.9518516063690186,
1.4225220680236816,
0.8877834677696228,
-0.135677769780159,
-0.46024033427238464,
-1.01285719871521,
1.2254319190979004,
1.9732224941253662,
0.9870615601539612,
-0.01782979629933834,
-0.8702055215835571,
-0.7563654184341431,
-0.06650769710540771,
0.1798977255821228,
0.4154525697231293,
0.8727788329124451,
0.15538637340068817,
0.08459122478961945,
1.3121373653411865,
1.0242983102798462,
-0.496708482503891,
0.35979390144348145,
-0.7278492450714111,
-0.4784073829650879,
0.6215536594390869,
0.305446594953537,
0.03411358594894409,
0.29266807436943054,
-0.9616492390632629,
-0.2999642789363861,
-0.376701682806015,
-0.9083152413368225,
-0.6509653925895691,
-0.466399610042572,
-0.3060373365879059,
1.5956370830535889,
-0.035893987864255905,
-0.5013272762298584,
-0.04014711454510689,
-0.8794088363647461,
-0.04731787368655205,
-1.0263408422470093,
0.1977267563343048,
-0.16974937915802002,
-0.1510656625032425,
-0.21669697761535645,
1.7015619277954102,
-0.9769884943962097,
-1.931085228919983,
0.19607329368591309,
0.16533978283405304,
-0.3684753179550171,
0.19359008967876434,
1.765415906906128,
0.595779538154602,
1.4419599771499634,
1.3637844324111938,
0.9079337120056152,
-0.6642367243766785,
-1.2897348403930664,
0.5550144910812378,
1.0057307481765747,
-1.3407121896743774,
0.7992827892303467,
0.004938768222928047,
-0.44861745834350586,
0.5167345404624939,
1.2396644353866577,
0.4651655852794647,
-1.9357272386550903,
0.6612008810043335,
-0.9323588609695435,
0.794516921043396,
0.7608484625816345,
0.7389178276062012,
0.11049184948205948,
0.7713547348976135,
-1.0658084154129028,
-1.101502537727356,
-0.645218551158905,
-0.6881210803985596,
1.9372044801712036,
-0.21544086933135986,
0.44636112451553345,
-0.22296051681041718,
-1.370297908782959,
0.025828830897808075,
0.650479257106781,
0.4300488233566284,
-0.5133703947067261,
0.6519367694854736,
-0.6205549836158752,
-0.9549509882926941,
-1.3702822923660278,
-0.4740111827850342,
-1.03032386302948,
-0.9912875294685364,
1.0393110513687134,
0.8931191563606262,
0.36306625604629517,
1.9141627550125122,
0.8512665629386902,
0.21326126158237457,
-2.5431761741638184,
0.9173374176025391,
0.41175660490989685,
-0.1864788979291916,
0.8632293939590454,
0.43036678433418274,
1.0727367401123047,
-0.0906248465180397,
0.605185866355896,
-2.3962903022766113,
2.3536384105682373,
-0.1632552444934845,
0.6527680158615112,
-0.029826276004314423,
-0.1685401052236557,
1.0387012958526611,
0.5106310248374939,
0.40227699279785156,
-1.128636121749878,
0.6022496819496155,
-0.5766949653625488,
1.2002151012420654,
0.8117789030075073,
-0.7981958985328674,
-0.03369392082095146,
1.3003218173980713,
0.4810260236263275,
-0.5736450552940369,
-0.9695919752120972,
-0.9576687812805176,
1.00608491897583,
1.687134861946106,
-0.0023970152251422405,
0.0149902468547225,
0.9674369096755981,
0.6200007796287537,
-1.3189948797225952,
0.03136472404003143,
-0.6597347855567932,
-0.8317469954490662,
1.6835002899169922,
2.1178693771362305,
-0.1683230698108673,
-0.17632892727851868,
-0.7845308780670166,
-1.2532018423080444,
0.8785790205001831,
-0.00010864716023206711,
0.033173006027936935,
0.5672823786735535,
-0.6589128971099854,
1.2058687210083008,
1.0373756885528564,
0.8537843227386475,
0.3393888473510742,
0.3045493960380554,
0.3712657690048218,
-0.3112066984176636,
-1.1717091798782349,
-0.1723310649394989,
-0.9942737221717834,
-2.57053542137146,
0.4812035858631134,
-0.1840822398662567,
-1.358911395072937,
-0.03479766845703125,
-0.9877036213874817,
0.8154141306877136,
-0.6026671528816223,
-1.0460847616195679,
-1.4396306276321411,
0.24008990824222565,
0.05537167936563492,
0.953683078289032,
-1.549220085144043,
-0.10486627370119095,
1.2323991060256958,
0.9677301049232483,
-0.808997631072998,
0.8028112649917603,
0.18720842897891998,
1.132332444190979,
0.983416736125946,
-0.31668785214424133,
0.5106638669967651,
0.0446428582072258,
-1.311470627784729,
0.33416086435317993,
1.275327444076538,
0.1347247064113617,
1.5108537673950195,
-0.4828895628452301,
-0.020626109093427658,
0.37518277764320374,
-0.40144219994544983,
-0.5427324771881104,
-0.8097051978111267,
0.5315132141113281,
0.07356937974691391,
-0.8064606785774231,
0.04342072457075119,
0.13598093390464783,
-0.17312569916248322,
0.18140572309494019,
-1.5548417568206787,
-0.05391357094049454,
-0.29478850960731506,
-0.6873982548713684,
-1.2358098030090332,
-0.1772611141204834,
1.3131473064422607,
-0.7169626951217651,
-0.15697461366653442,
0.5598411560058594,
0.2267283946275711,
0.4558384418487549,
0.5859538912773132,
-0.698214054107666,
-0.3653475046157837,
-0.25012704730033875,
-0.47601258754730225,
0.3061990439891815,
1.4663516283035278,
-0.05231514945626259,
-0.941267728805542,
0.6402440667152405,
-0.32501935958862305,
-0.00532497139647603,
1.9223350286483765,
0.08061514794826508,
-0.9423112273216248,
0.27533408999443054,
-0.6810475587844849,
1.9846302270889282,
1.7762210369110107,
1.2409260272979736,
-0.10206447541713715,
-1.0844521522521973,
0.7888636589050293,
-0.4785385727882385,
-0.44780221581459045,
0.9248477220535278,
0.19390524923801422,
-0.28376609086990356,
-1.4657964706420898,
0.6558358073234558,
1.4136167764663696,
-0.8548688292503357,
-0.8749468922615051,
0.12043081969022751,
-0.8319762349128723,
1.0096861124038696,
0.7479605674743652,
0.3195563852787018,
0.3459530472755432,
1.6143871545791626,
0.8506282567977905,
-0.4816243648529053,
0.5203744769096375,
0.5750157833099365,
-0.031660810112953186,
-2.0122053623199463,
-1.2468252182006836,
0.333631306886673,
-0.49484455585479736,
-1.5880744457244873,
1.419960618019104,
-1.1606593132019043,
-1.0153305530548096,
0.6455821990966797,
0.02135559543967247,
1.4149893522262573,
0.3161689341068268,
1.582533597946167,
2.012021064758301,
0.8512804508209229,
0.4226120114326477,
1.204310655593872,
-0.266652375459671,
-0.37251633405685425,
1.8167307376861572,
-0.5747939944267273,
0.5079866647720337,
1.141743779182434,
-0.2974942624568939,
-1.1465874910354614,
-0.8099150657653809,
-1.371872901916504,
-0.8528719544410706,
1.1753023862838745,
0.09239882230758667,
-1.1937663555145264,
0.4003402292728424,
1.7360291481018066,
0.005193020217120647,
-0.3451913595199585,
0.6701429486274719,
0.39656051993370056,
-0.9012959599494934,
0.006233758293092251,
-0.943848192691803,
0.620690107345581,
-0.11768084019422531,
-0.3660354018211365,
0.4161585569381714,
0.47769469022750854,
1.3778034448623657,
0.05009109526872635,
0.06186189502477646,
1.0418106317520142,
-1.5102784633636475,
1.5000025033950806,
-0.8443345427513123,
0.355876624584198,
-2.316253185272217,
1.3560700416564941,
-0.8493181467056274,
1.895865797996521,
-2.6488730907440186,
0.45639267563819885,
-0.4892544448375702,
-0.5489045977592468,
0.2119397073984146,
-0.3530453145503998,
0.19104774296283722,
-0.05412096530199051,
-1.2360626459121704,
-0.16663551330566406,
-0.7732253670692444,
0.6151405572891235,
1.1554625034332275,
1.4373284578323364,
-1.0506850481033325,
-0.43386879563331604,
-1.6542795896530151,
-0.1268090307712555,
-0.5092113614082336,
0.1469050794839859,
-1.8814600706100464,
-0.13974373042583466,
-1.9068734645843506,
-2.318207263946533,
-1.3293031454086304,
-0.8225817680358887,
1.127004623413086,
0.03290114179253578,
-0.9436404705047607,
1.1554393768310547,
-0.4884171187877655,
-1.8429136276245117,
1.1581611633300781,
-2.1037113666534424
] |
https://github.com/huggingface/datasets/issues/5137 | Align task tags in dataset metadata | Yes, @julien-c. These are some of the feedbacks:
- Most people just thank for the fix: [cahya/librivox-indonesia](https://huggingface.co/datasets/cahya/librivox-indonesia/discussions/1#6357cd8a292a050ebd705f84), [TurkuNLP/xlsum-fi](https://huggingface.co/datasets/TurkuNLP/xlsum-fi/discussions/1#6357828aa1f8ad1c31bcbe46), [coastalcph/fairlex](https://huggingface.co/datasets/coastalcph/fairlex/discussions/4#6351a527a8e595171ab1aef2)
- Why are we changing their task names? [joelito/lextreme](https://huggingface.co/datasets/joelito/lextreme/discussions/1#6351b576fe367c0d9b12041b)
- I take note of this for the next bulk operation; besides the PR title, we should also add a description to explain the reason for the change and also maybe putting a link to some pertinent GH Issue page
- Some of them ask where to find the list of the supported task values is: [dennlinger/klexikon](https://huggingface.co/datasets/dennlinger/klexikon/discussions/3#6356b3ea80f8cb3ab777ac5c), [lmqg/qg_jaquad](https://huggingface.co/datasets/lmqg/qg_jaquad/discussions/1#635262467e4cc3135fd09f58)
- Currently, the list is here: https://github.com/huggingface/hub-docs/blob/main/js/src/lib/interfaces/Types.ts#L85
- Maybe we could made them more easily accessible
- Some people do not agree about current "hierarchy":
- text-scoring: [emrecan/nli_tr_for_simcse](https://huggingface.co/datasets/emrecan/nli_tr_for_simcse/discussions/1#6357c1b128792d8cdd51e9f9) (but referring to [emrecan/nli_tr_for_simcse](https://huggingface.co/datasets/emrecan/nli_tr_for_simcse/discussions/2/files))
- Before "text-scoring" was a task_category, with task_ids ["semantic-similarity-scoring", "sentiment-scoring"]
- Now all three are task_ids ["text-scoring", "semantic-similarity-scoring", "sentiment-scoring"] under the task_category "text-classification"
- People complain that their scoring tasks are not classification task
- binary-classification: why don't we have binary-classification? We have multi-class-classification, multi-label-classification and sentiment-classification, but not binary-classification
- symbolic-regression: [yoshitomo-matsubara/srsd-feynman_hard](https://huggingface.co/datasets/yoshitomo-matsubara/srsd-feynman_hard/discussions/2#63614194c12a09b8a31457cc), [yoshitomo-matsubara/srsd-feynman_medium](https://huggingface.co/datasets/yoshitomo-matsubara/srsd-feynman_medium/discussions/2#6361418aeee0d27f04379e43), [yoshitomo-matsubara/srsd-feynman_easy](https://huggingface.co/datasets/yoshitomo-matsubara/srsd-feynman_easy/discussions/2#6361416e00905b1ffb8d0112)
- Why don't we have symbolic-regression task?
NOTE: I'm editing this comment to add more feedback | ## Describe
Once we have agreed on a common naming for task tags for all open source projects, we should align on them.
## Steps
- [x] Align task tags in canonical datasets
- [x] task_categories: 4 datasets
- [x] task_ids (by @lhoestq)
- [x] Open PRs in community datasets
- [x] task_categories: 451 datasets
- [x] task_ids: 556 datasets
| 467 | 189 | Align task tags in dataset metadata
## Describe
Once we have agreed on a common naming for task tags for all open source projects, we should align on them.
## Steps
- [x] Align task tags in canonical datasets
- [x] task_categories: 4 datasets
- [x] task_ids (by @lhoestq)
- [x] Open PRs in community datasets
- [x] task_categories: 451 datasets
- [x] task_ids: 556 datasets
Yes, @julien-c. These are some of the feedbacks:
- Most people just thank for the fix: [cahya/librivox-indonesia](https://huggingface.co/datasets/cahya/librivox-indonesia/discussions/1#6357cd8a292a050ebd705f84), [TurkuNLP/xlsum-fi](https://huggingface.co/datasets/TurkuNLP/xlsum-fi/discussions/1#6357828aa1f8ad1c31bcbe46), [coastalcph/fairlex](https://huggingface.co/datasets/coastalcph/fairlex/discussions/4#6351a527a8e595171ab1aef2)
- Why are we changing their task names? [joelito/lextreme](https://huggingface.co/datasets/joelito/lextreme/discussions/1#6351b576fe367c0d9b12041b)
- I take note of this for the next bulk operation; besides the PR title, we should also add a description to explain the reason for the change and also maybe putting a link to some pertinent GH Issue page
- Some of them ask where to find the list of the supported task values is: [dennlinger/klexikon](https://huggingface.co/datasets/dennlinger/klexikon/discussions/3#6356b3ea80f8cb3ab777ac5c), [lmqg/qg_jaquad](https://huggingface.co/datasets/lmqg/qg_jaquad/discussions/1#635262467e4cc3135fd09f58)
- Currently, the list is here: https://github.com/huggingface/hub-docs/blob/main/js/src/lib/interfaces/Types.ts#L85
- Maybe we could made them more easily accessible
- Some people do not agree about current "hierarchy":
- text-scoring: [emrecan/nli_tr_for_simcse](https://huggingface.co/datasets/emrecan/nli_tr_for_simcse/discussions/1#6357c1b128792d8cdd51e9f9) (but referring to [emrecan/nli_tr_for_simcse](https://huggingface.co/datasets/emrecan/nli_tr_for_simcse/discussions/2/files))
- Before "text-scoring" was a task_category, with task_ids ["semantic-similarity-scoring", "sentiment-scoring"]
- Now all three are task_ids ["text-scoring", "semantic-similarity-scoring", "sentiment-scoring"] under the task_category "text-classification"
- People complain that their scoring tasks are not classification task
- binary-classification: why don't we have binary-classification? We have multi-class-classification, multi-label-classification and sentiment-classification, but not binary-classification
- symbolic-regression: [yoshitomo-matsubara/srsd-feynman_hard](https://huggingface.co/datasets/yoshitomo-matsubara/srsd-feynman_hard/discussions/2#63614194c12a09b8a31457cc), [yoshitomo-matsubara/srsd-feynman_medium](https://huggingface.co/datasets/yoshitomo-matsubara/srsd-feynman_medium/discussions/2#6361418aeee0d27f04379e43), [yoshitomo-matsubara/srsd-feynman_easy](https://huggingface.co/datasets/yoshitomo-matsubara/srsd-feynman_easy/discussions/2#6361416e00905b1ffb8d0112)
- Why don't we have symbolic-regression task?
NOTE: I'm editing this comment to add more feedback | [
-1.180944800376892,
-0.8646109104156494,
-0.8273071050643921,
1.4037902355194092,
-0.017600826919078827,
-1.2778146266937256,
0.04989466816186905,
-1.0743975639343262,
1.6362239122390747,
-0.6931372880935669,
0.266597181558609,
-1.7166111469268799,
-0.07438246160745621,
-0.6688560843467712,
-0.743207573890686,
-0.8647735118865967,
-0.3302382826805115,
-0.7937555313110352,
0.9803314208984375,
2.5219202041625977,
1.1790366172790527,
-1.3440223932266235,
2.881230354309082,
0.7238792181015015,
-0.3631974160671234,
-0.9155588746070862,
0.5343747735023499,
-0.03228636458516121,
-1.280596375465393,
-0.4461541771888733,
-0.9929575324058533,
0.02246769145131111,
-0.5286341905593872,
-0.4515024721622467,
0.0864088237285614,
0.3501717746257782,
-0.17978273332118988,
-0.31577667593955994,
-0.5646779537200928,
-0.745937705039978,
0.41053539514541626,
-0.24923105537891388,
0.9016892910003662,
-0.2972235679626465,
1.7879337072372437,
-0.6432740688323975,
0.30424702167510986,
0.6724488139152527,
1.3611969947814941,
0.18981537222862244,
0.009577319957315922,
0.2800184190273285,
0.28287211060523987,
-0.012085015885531902,
0.5517609119415283,
1.2861833572387695,
0.6084119081497192,
0.4919690191745758,
0.7352780103683472,
-2.1941421031951904,
1.284118413925171,
-0.8809266686439514,
0.33014053106307983,
1.403678297996521,
-0.9139204025268555,
0.3501417338848114,
-1.814312219619751,
-0.0355566181242466,
0.5765259861946106,
-2.329272747039795,
0.1700506955385208,
-1.2634831666946411,
-0.545390784740448,
0.8599848747253418,
0.24663536250591278,
-1.2641850709915161,
0.21555456519126892,
-0.5556941628456116,
1.109909176826477,
0.49579963088035583,
1.2150589227676392,
-1.699787974357605,
0.00022469833493232727,
-0.2535591721534729,
0.06981093436479568,
-1.278883934020996,
-1.6284364461898804,
0.5090042352676392,
0.634871244430542,
0.607035219669342,
-0.056877028197050095,
0.9265563488006592,
-0.956441342830658,
0.8494775891304016,
-0.8841398358345032,
-1.659177303314209,
-1.392877459526062,
-2.32609224319458,
-2.236717462539673,
0.8508987426757812,
-0.48018550872802734,
-0.5227454304695129,
1.964938759803772,
-1.0520561933517456,
-1.8294246196746826,
1.0498067140579224,
0.3782305419445038,
0.019020594656467438,
2.4214043617248535,
0.26058635115623474,
-0.7544583678245544,
0.4640873074531555,
-0.7105547785758972,
0.7091506719589233,
-0.3925941288471222,
1.3667892217636108,
0.468526691198349,
-0.9652705192565918,
1.59308660030365,
-0.48569706082344055,
0.5000365376472473,
-0.7877906560897827,
-0.5326904654502869,
-0.8061432838439941,
0.3450396656990051,
1.8902794122695923,
-0.3875385522842407,
1.598644733428955,
-0.36468109488487244,
-1.5623267889022827,
-1.5252920389175415,
0.7975907325744629,
0.5758969783782959,
-0.8590360283851624,
0.11821125447750092,
-0.4543195366859436,
0.04293828085064888,
0.02398436889052391,
1.0796180963516235,
1.1536451578140259,
0.6361328959465027,
-0.27276286482810974,
-0.8340728282928467,
0.20659233629703522,
-0.02612263709306717,
-0.7161155343055725,
-1.819897174835205,
-0.2774347960948944,
0.29413437843322754,
0.624186098575592,
-1.3305126428604126,
1.6840183734893799,
0.7968739867210388,
2.007106304168701,
0.9975534081459045,
-0.3131224513053894,
1.5263923406600952,
0.051647450774908066,
1.7823418378829956,
-0.474904865026474,
0.6495074033737183,
-0.3325042426586151,
-1.208235263824463,
0.818667471408844,
-0.46353280544281006,
-2.0273427963256836,
-0.7221503257751465,
-0.8266593813896179,
-0.11009173095226288,
-0.8094764351844788,
0.9400413632392883,
-0.3085169494152069,
-1.3298578262329102,
0.17779748141765594,
-0.6711952090263367,
0.17624352872371674,
-1.3345664739608765,
0.1801869422197342,
0.7721441984176636,
-0.6218551993370056,
-0.030671611428260803,
-0.2327805608510971,
-1.3318328857421875,
-0.46556809544563293,
0.261962354183197,
1.8718631267547607,
-0.6857858896255493,
0.8939051628112793,
1.0410661697387695,
-0.5968402028083801,
0.10957956314086914,
0.38057127594947815,
-0.30508163571357727,
0.915025532245636,
-1.0777885913848877,
-0.3831968903541565,
1.1186352968215942,
-0.06687088310718536,
-0.6241818070411682,
1.4330207109451294,
0.8213164806365967,
-1.044323205947876,
-0.2961253523826599,
-0.12919847667217255,
-0.8760173320770264,
-0.029458332806825638,
-1.5829538106918335,
-0.1620064675807953,
0.24164985120296478,
-1.4802767038345337,
-0.4087715148925781,
-0.21927854418754578,
1.3704763650894165,
-0.1711329221725464,
1.4162707328796387,
-0.2898605763912201,
-0.16547943651676178,
-0.38052064180374146,
-0.5132597088813782,
0.09837237745523453,
-0.22535687685012817,
-0.6809190511703491,
0.31073108315467834,
-0.764509379863739,
0.2986179292201996,
1.45485520362854,
0.37125298380851746,
0.09696230292320251,
0.5291373133659363,
1.122412919998169,
0.22552965581417084,
-0.09363047778606415,
-0.9137097001075745,
-1.6643421649932861,
2.060267210006714,
-1.5243332386016846,
2.0056912899017334,
0.9219784140586853,
-0.021336855366826057,
-1.7820467948913574,
-1.8473191261291504,
1.414169192314148,
1.1597341299057007,
2.3899877071380615,
0.5089627504348755,
0.4388541281223297,
-0.8079496622085571,
-0.6950961947441101,
0.2893105149269104,
-0.9406744837760925,
-0.7338988184928894,
0.14501462876796722,
2.3863437175750732,
1.8524141311645508,
-0.49113914370536804,
-0.21185684204101562,
-0.9253904223442078,
1.2054417133331299,
-0.23947037756443024,
0.1499268114566803,
1.9805351495742798,
-0.3010704219341278,
-1.0671875476837158,
1.2578518390655518,
-2.3332674503326416,
0.15379546582698822,
2.0113306045532227,
0.28991374373435974,
0.06843261420726776,
-1.3611066341400146,
-0.69951993227005,
-0.328482985496521,
-0.45282575488090515,
-1.213352084159851,
0.5480677485466003,
-0.3300219476222992,
-0.9409465193748474,
-1.4689115285873413,
0.043350089341402054,
-1.1730239391326904,
-1.645054817199707,
0.42384859919548035,
1.8738174438476562,
2.0912561416625977,
-0.8608822822570801,
1.435804009437561,
-0.2658633887767792,
0.15118859708309174,
1.1954535245895386,
1.2800670862197876,
3.193603277206421,
1.757453203201294,
-1.3669241666793823,
0.6927827596664429,
-0.1395408809185028,
-0.43172121047973633,
1.1366328001022339,
-1.080640435218811,
1.1819761991500854,
-0.23022787272930145,
-1.3083717823028564,
-1.30807363986969,
1.0641369819641113,
0.534365177154541,
-0.022232886403799057,
-0.5893881916999817,
1.238178014755249,
0.04623563215136528,
1.2848647832870483,
0.5602240562438965,
-0.43262043595314026,
0.4759199023246765,
-0.28696995973587036,
-0.5438488721847534,
1.5540883541107178,
0.0737701952457428,
-1.5280661582946777,
-2.3603954315185547,
-0.23186220228672028,
-0.8587117791175842,
-0.12591984868049622,
-0.7154772281646729,
-1.0694103240966797,
1.5920439958572388,
0.4618607461452484,
-1.2199251651763916,
-0.3157583177089691,
-0.3508714735507965,
-0.5410671234130859,
2.5821495056152344,
-1.4424421787261963,
-0.1696811020374298,
-0.9724307656288147,
-0.3446018099784851,
1.591294527053833,
-1.16592276096344,
-0.15147002041339874,
-0.9832983016967773,
-0.6859683990478516,
-1.2462314367294312,
-0.5091018676757812,
-0.01945224590599537,
-0.8981253504753113,
0.7158052325248718,
0.09312693029642105,
-1.053567886352539,
-0.21321846544742584,
-0.8522984385490417,
1.016273856163025,
-0.21437174081802368,
0.16432958841323853,
1.908305287361145,
0.38786303997039795,
-0.43677523732185364,
0.6736570596694946,
1.2262983322143555,
0.6692196726799011,
-0.6960561275482178,
0.06089140474796295,
-0.6473686695098877,
0.29975220561027527,
-1.5169861316680908,
0.3170274496078491,
-2.9110629558563232,
0.6464909911155701,
-0.022237546741962433,
-0.010943647474050522,
0.015408183448016644,
-1.2925812005996704,
1.0846564769744873,
2.5867879390716553,
-1.151283621788025,
0.44081592559814453,
0.4132619798183441,
1.1481690406799316,
-1.6389540433883667,
0.2523500919342041,
-0.42910128831863403,
2.0926499366760254,
0.101734459400177,
1.2064646482467651,
-0.45537319779396057,
-2.1158721446990967,
0.5354695916175842,
-1.2675843238830566,
-0.9693747162818909,
0.8531673550605774,
-0.8245310187339783,
0.21595551073551178,
-1.5150439739227295,
-0.14454159140586853,
-0.9291912317276001,
-1.1882083415985107,
0.7249305844306946,
0.1024264395236969,
0.4851927161216736,
-0.6484733819961548,
0.3561885356903076,
-2.1266028881073,
-1.3231518268585205,
-0.09219451993703842,
-0.9432405829429626,
0.46320641040802,
-0.277132511138916,
0.6297404766082764,
-0.08814406394958496,
0.06973128765821457,
0.3043597340583801,
1.382510781288147,
3.3829424381256104,
0.21188919246196747,
0.35448068380355835,
-0.16356487572193146,
-0.9418286681175232,
1.3628491163253784,
1.0215916633605957,
-0.1045113056898117,
-0.5443848371505737,
-0.9177514910697937,
1.4044393301010132,
1.9824707508087158,
1.170242190361023,
0.13953609764575958,
-0.9011139869689941,
-0.8574312925338745,
0.02440899983048439,
0.28201526403427124,
0.48868656158447266,
0.8777374029159546,
-0.08018013089895248,
0.12082304060459137,
1.427946925163269,
1.2171459197998047,
-0.44573184847831726,
0.5072607398033142,
-0.972042977809906,
-0.4462421238422394,
0.3726898431777954,
0.32024306058883667,
0.0814274474978447,
0.4880933165550232,
-1.0976322889328003,
-0.33335238695144653,
-0.3078247010707855,
-0.8919501304626465,
-0.716551661491394,
-0.34166285395622253,
-0.3730391263961792,
1.5891165733337402,
0.08762109279632568,
-0.4413047432899475,
0.02765604481101036,
-0.718383252620697,
-0.25108233094215393,
-1.1178703308105469,
0.23394395411014557,
-0.12195687741041183,
0.005410706624388695,
-0.16423188149929047,
1.6890984773635864,
-1.009779691696167,
-2.1482715606689453,
0.16250458359718323,
0.2613474428653717,
-0.4256438612937927,
0.1411273032426834,
1.7713685035705566,
0.5316344499588013,
1.421274185180664,
1.3185170888900757,
0.9664494395256042,
-0.6507976055145264,
-1.262366533279419,
0.6867814064025879,
0.9705946445465088,
-1.3787343502044678,
0.9203917980194092,
-0.18049044907093048,
-0.5523474812507629,
0.7303003668785095,
1.3709383010864258,
0.3770986497402191,
-1.970790147781372,
0.8475784063339233,
-0.9122106432914734,
0.722503125667572,
0.6490176916122437,
0.8716506958007812,
0.2751258611679077,
0.8366754651069641,
-1.297410011291504,
-1.2027244567871094,
-0.8143267631530762,
-0.5619440674781799,
1.8779501914978027,
-0.1565614938735962,
0.4699346423149109,
-0.23564296960830688,
-1.203494906425476,
-0.07787618786096573,
0.7071775197982788,
0.34488818049430847,
-0.30874204635620117,
0.8469343185424805,
-0.688793420791626,
-1.0861386060714722,
-1.2864940166473389,
-0.3967060148715973,
-0.8976464867591858,
-0.8734256029129028,
1.0061149597167969,
0.8285289406776428,
0.43525806069374084,
1.949609637260437,
0.5958228707313538,
0.2857101559638977,
-2.5399444103240967,
0.870775580406189,
0.2927153408527374,
-0.04272574558854103,
0.8980726003646851,
0.27836304903030396,
1.1830086708068848,
0.06627096235752106,
0.5341671109199524,
-2.308239459991455,
2.1664750576019287,
-0.14546175301074982,
0.70472651720047,
-0.07007905840873718,
-0.142277792096138,
1.063428521156311,
0.5714841485023499,
0.5366790294647217,
-1.1098932027816772,
0.6838570833206177,
-0.5970268249511719,
1.0772168636322021,
0.9330790042877197,
-0.8768029808998108,
0.047090787440538406,
1.3511872291564941,
0.475754976272583,
-0.4341717064380646,
-0.9300736784934998,
-0.8156034350395203,
0.9201220273971558,
1.6592854261398315,
0.0775013193488121,
0.02252129092812538,
0.9379873275756836,
0.6661712527275085,
-1.3034573793411255,
0.09432317316532135,
-0.6282110810279846,
-0.7183066010475159,
1.7549235820770264,
2.056919574737549,
-0.09685954451560974,
-0.12276814877986908,
-0.6802561283111572,
-1.2529751062393188,
0.761185884475708,
-0.1481534093618393,
0.13177621364593506,
0.7171187400817871,
-0.7148445248603821,
1.1700063943862915,
0.7453439831733704,
0.9144207835197449,
0.07054466754198074,
0.326824426651001,
0.3770592510700226,
-0.2532792091369629,
-1.1631640195846558,
-0.3374330401420593,
-1.0995103120803833,
-2.48123836517334,
0.42479121685028076,
-0.26079973578453064,
-1.4564285278320312,
0.04111810773611069,
-0.9957631230354309,
0.8564851880073547,
-0.6646485328674316,
-1.032111406326294,
-1.458751916885376,
0.34225356578826904,
-0.13455630838871002,
0.8754240274429321,
-1.5737024545669556,
-0.09195798635482788,
1.1985794305801392,
0.9148200154304504,
-0.48214519023895264,
0.9700618386268616,
0.2767539918422699,
0.973285973072052,
0.8957234025001526,
-0.37040975689888,
0.46334362030029297,
0.1387331187725067,
-1.3489872217178345,
0.4172058701515198,
1.2127436399459839,
0.2275555431842804,
1.4853019714355469,
-0.4953199326992035,
0.025247354060411453,
0.4711846113204956,
-0.4643474221229553,
-0.4580809772014618,
-0.5903547406196594,
0.6492331624031067,
0.15073268115520477,
-0.9651778340339661,
-0.06761644035577774,
-0.13870498538017273,
-0.3020053207874298,
0.2558732330799103,
-1.539684772491455,
-0.25675132870674133,
-0.4311811327934265,
-0.5323342084884644,
-1.353057622909546,
0.04850991815328598,
1.341719627380371,
-0.8891393542289734,
-0.21603205800056458,
0.5404930114746094,
0.4417402744293213,
0.5114328265190125,
0.6853345632553101,
-0.6535294055938721,
-0.2612658739089966,
-0.2902955710887909,
-0.37112802267074585,
0.25452935695648193,
1.204729676246643,
-0.12069788575172424,
-1.0132148265838623,
0.6305781602859497,
-0.48036348819732666,
0.03171747177839279,
2.057576894760132,
0.0657428726553917,
-0.7945899963378906,
0.3300376832485199,
-0.6848474144935608,
1.9163446426391602,
1.6601606607437134,
1.330962896347046,
-0.14589494466781616,
-0.9140554070472717,
0.6256648302078247,
-0.17605037987232208,
-0.3088476061820984,
0.9374256730079651,
0.41728514432907104,
-0.19266201555728912,
-1.5431797504425049,
0.426491379737854,
1.315869927406311,
-0.9169692397117615,
-0.7021893262863159,
0.10135563462972641,
-0.9145757555961609,
1.106833815574646,
0.7328354120254517,
0.260598361492157,
0.2457169145345688,
1.5750975608825684,
0.6794569492340088,
-0.5494345426559448,
0.36900076270103455,
0.46291598677635193,
-0.07910868525505066,
-2.0902280807495117,
-0.9067434668540955,
0.2572256028652191,
-0.2597578465938568,
-1.542327642440796,
1.2753382921218872,
-1.1961153745651245,
-0.9591520428657532,
0.5087534189224243,
0.08687113970518112,
1.2892359495162964,
0.24498747289180756,
1.707093358039856,
2.1453301906585693,
0.8528180122375488,
0.2912486493587494,
1.3134592771530151,
-0.09265731275081635,
-0.2906245291233063,
1.8347554206848145,
-0.458418607711792,
0.6651716828346252,
0.9985054135322571,
-0.4344804286956787,
-1.1536749601364136,
-0.7753072381019592,
-1.230523705482483,
-0.6845239996910095,
1.236034631729126,
0.13456857204437256,
-1.125185489654541,
0.2555672526359558,
1.5778045654296875,
0.15966257452964783,
-0.27755239605903625,
0.6552481055259705,
0.5185359120368958,
-0.6949477195739746,
-0.06730177253484726,
-0.9583448171615601,
0.5534020066261292,
-0.06174271181225777,
-0.28121960163116455,
0.28337472677230835,
0.5774797797203064,
1.273118495941162,
0.02879805490374565,
0.09723611921072006,
1.2974294424057007,
-1.4195533990859985,
1.4254989624023438,
-0.7101016044616699,
0.2456437200307846,
-2.525862455368042,
1.4603060483932495,
-0.7909398674964905,
1.8531595468521118,
-2.614687442779541,
0.4807540774345398,
-0.5912322402000427,
-0.4710066318511963,
0.348976194858551,
-0.3575842082500458,
0.13395743072032928,
-0.11587236821651459,
-1.0586038827896118,
-0.09626221656799316,
-0.7537866234779358,
0.574855387210846,
1.246078372001648,
1.361392617225647,
-0.9820777177810669,
-0.267034113407135,
-1.722870111465454,
-0.20967887341976166,
-0.7005290985107422,
0.1779521405696869,
-1.9598509073257446,
-0.06690411269664764,
-1.9465792179107666,
-2.421339511871338,
-1.5655499696731567,
-0.7962465882301331,
1.0764621496200562,
0.2053944617509842,
-0.977705180644989,
1.1609208583831787,
-0.49474433064460754,
-1.779449224472046,
1.0382397174835205,
-2.1911566257476807
] |
https://github.com/huggingface/datasets/issues/5137 | Align task tags in dataset metadata | As someone with feedback on the updates (which I highly appreciate seeing included here :D), a few comments from a "user perspective":
* I think the general confusion for me was also surrounding the hierarchy; it doesn't really become super clear (even when using the tagger space) that one is a subset of the other, especially since it seems to be still possible to include fine-grained tasks without the "parent category"?
* The datasets explorer still shows tags that are no longer valid (e.g., super specific ones such as `summarization-other-paper-abstract-generation`, but also ones that should be `task_categories`, such as `summarization`). I'm assuming this will be fixed soon, but until then it can confuse people who don't understand why they suddenly can't use seemingly still valid tags anymore.
* As I mentioned to @albertvillanova, having a dedicated page in the docs with explanations (especially wrt the difference between `task_categories` and `task_ids`) would be super helpful. However, I think it would have been sufficient to just include some description in the dataset PRs where you can link to the Github/other discussion on the topic :) That way, I can check myself what changes are expected to happen.
Thanks again for the streamlining process, I personally learned a fair bit about the tagging structure in the meantime!
Best,
Dennis | ## Describe
Once we have agreed on a common naming for task tags for all open source projects, we should align on them.
## Steps
- [x] Align task tags in canonical datasets
- [x] task_categories: 4 datasets
- [x] task_ids (by @lhoestq)
- [x] Open PRs in community datasets
- [x] task_categories: 451 datasets
- [x] task_ids: 556 datasets
| 467 | 216 | Align task tags in dataset metadata
## Describe
Once we have agreed on a common naming for task tags for all open source projects, we should align on them.
## Steps
- [x] Align task tags in canonical datasets
- [x] task_categories: 4 datasets
- [x] task_ids (by @lhoestq)
- [x] Open PRs in community datasets
- [x] task_categories: 451 datasets
- [x] task_ids: 556 datasets
As someone with feedback on the updates (which I highly appreciate seeing included here :D), a few comments from a "user perspective":
* I think the general confusion for me was also surrounding the hierarchy; it doesn't really become super clear (even when using the tagger space) that one is a subset of the other, especially since it seems to be still possible to include fine-grained tasks without the "parent category"?
* The datasets explorer still shows tags that are no longer valid (e.g., super specific ones such as `summarization-other-paper-abstract-generation`, but also ones that should be `task_categories`, such as `summarization`). I'm assuming this will be fixed soon, but until then it can confuse people who don't understand why they suddenly can't use seemingly still valid tags anymore.
* As I mentioned to @albertvillanova, having a dedicated page in the docs with explanations (especially wrt the difference between `task_categories` and `task_ids`) would be super helpful. However, I think it would have been sufficient to just include some description in the dataset PRs where you can link to the Github/other discussion on the topic :) That way, I can check myself what changes are expected to happen.
Thanks again for the streamlining process, I personally learned a fair bit about the tagging structure in the meantime!
Best,
Dennis | [
-1.2530194520950317,
-0.893706202507019,
-0.8219945430755615,
1.423622727394104,
-0.11059881001710892,
-1.277165174484253,
0.02048655040562153,
-1.1950576305389404,
1.753598690032959,
-0.8477498888969421,
0.2826399505138397,
-1.5881112813949585,
0.07797124981880188,
-0.6203397512435913,
-0.8115153312683105,
-0.876109778881073,
-0.3686049282550812,
-0.8853996396064758,
1.0090999603271484,
2.4938535690307617,
1.0579304695129395,
-1.4718735218048096,
2.77945876121521,
0.6653159856796265,
-0.1967085897922516,
-0.9767366647720337,
0.5270028114318848,
-0.05449090152978897,
-1.2815601825714111,
-0.48507460951805115,
-0.9713165163993835,
-0.05229787528514862,
-0.5541012287139893,
-0.5192181468009949,
0.03867068886756897,
0.3338594138622284,
-0.23917491734027863,
-0.4476875066757202,
-0.46817395091056824,
-0.8119035959243774,
0.41161760687828064,
-0.2386476993560791,
1.0189331769943237,
-0.36993172764778137,
1.8065358400344849,
-0.5053458213806152,
0.34405744075775146,
0.6422805190086365,
1.3717118501663208,
0.2813148498535156,
-0.04426509141921997,
0.23641636967658997,
0.361410915851593,
-0.053766973316669464,
0.539587140083313,
1.0560741424560547,
0.6591349840164185,
0.5909658074378967,
0.7310082316398621,
-2.1951704025268555,
1.315466046333313,
-1.0939836502075195,
0.3605535328388214,
1.4539061784744263,
-0.9576522707939148,
0.3985925018787384,
-1.83293879032135,
-0.0494890958070755,
0.5488567352294922,
-2.2668697834014893,
0.21513217687606812,
-1.2164698839187622,
-0.4965744614601135,
1.0051244497299194,
0.2571971118450165,
-1.2867815494537354,
0.2156190425157547,
-0.40435919165611267,
1.0039942264556885,
0.45341023802757263,
1.1536006927490234,
-1.6748381853103638,
0.07558444142341614,
-0.2585603892803192,
0.11569340527057648,
-1.2394979000091553,
-1.5297433137893677,
0.5855593085289001,
0.5796638131141663,
0.4804207980632782,
-0.05956879258155823,
0.9563774466514587,
-0.9985016584396362,
0.851202666759491,
-0.9270786046981812,
-1.643221378326416,
-1.3967055082321167,
-2.271730422973633,
-2.371631383895874,
0.8230692744255066,
-0.49922847747802734,
-0.48165297508239746,
2.1041386127471924,
-1.0881073474884033,
-1.7022401094436646,
1.1682443618774414,
0.26470109820365906,
0.0162690207362175,
2.427273988723755,
0.20289093255996704,
-0.7453686594963074,
0.5026262998580933,
-0.7102474570274353,
0.8369303941726685,
-0.4839186370372772,
1.3785032033920288,
0.4773813784122467,
-0.9733448624610901,
1.6113628149032593,
-0.36977243423461914,
0.5357415080070496,
-0.625413179397583,
-0.5405125617980957,
-0.8864142894744873,
0.42837589979171753,
1.953450322151184,
-0.2882746160030365,
1.5262277126312256,
-0.3151703476905823,
-1.541077733039856,
-1.5104495286941528,
0.8846657276153564,
0.5844863057136536,
-0.8857429623603821,
0.16253113746643066,
-0.39071133732795715,
0.10440430045127869,
-0.032073214650154114,
1.1777851581573486,
1.2278528213500977,
0.6923933625221252,
-0.23167672753334045,
-0.9147359728813171,
0.2005552351474762,
-0.0953042209148407,
-0.7392235398292542,
-1.7250076532363892,
-0.38283276557922363,
0.1253858506679535,
0.6676478981971741,
-1.2326350212097168,
1.7315294742584229,
0.9084758758544922,
1.8545724153518677,
0.967511773109436,
-0.327012300491333,
1.5267655849456787,
0.10418263077735901,
1.8232641220092773,
-0.39181432127952576,
0.6691673398017883,
-0.41380617022514343,
-1.2628421783447266,
0.8877475261688232,
-0.4016518294811249,
-2.0074594020843506,
-0.7487599849700928,
-0.8816304206848145,
-0.23992985486984253,
-0.7338072657585144,
0.8815600275993347,
-0.30679041147232056,
-1.3869705200195312,
0.3138546943664551,
-0.6235269904136658,
0.21728014945983887,
-1.260913372039795,
0.37484055757522583,
0.7514792084693909,
-0.6925985813140869,
0.007679169997572899,
-0.23391859233379364,
-1.3196474313735962,
-0.5561584830284119,
0.24403804540634155,
1.8859974145889282,
-0.7989640831947327,
0.9437915086746216,
1.0505632162094116,
-0.6618119478225708,
-0.08086798340082169,
0.38716059923171997,
-0.30384811758995056,
0.8997513055801392,
-1.0835330486297607,
-0.47156795859336853,
1.1817364692687988,
-0.1914701610803604,
-0.5000270009040833,
1.4260843992233276,
0.6270766258239746,
-0.9897151589393616,
-0.264536589384079,
-0.15941646695137024,
-0.9023986458778381,
0.03992517292499542,
-1.5823702812194824,
-0.127854585647583,
0.4061449468135834,
-1.6031925678253174,
-0.4740053117275238,
-0.12384781241416931,
1.262747883796692,
-0.21100129187107086,
1.4648405313491821,
-0.4178183376789093,
-0.20331928133964539,
-0.3591902554035187,
-0.38213613629341125,
0.21282272040843964,
-0.1561771184206009,
-0.6844134330749512,
0.25694790482521057,
-0.7338767051696777,
0.319709450006485,
1.3795374631881714,
0.36511388421058655,
0.02285577543079853,
0.5169515609741211,
1.157304048538208,
0.31935232877731323,
-0.06956692039966583,
-0.888130784034729,
-1.5709770917892456,
2.077742099761963,
-1.5310076475143433,
1.9966622591018677,
0.7875245213508606,
0.02080049365758896,
-1.7217894792556763,
-1.7913579940795898,
1.444628357887268,
1.1428446769714355,
2.2808244228363037,
0.5830514430999756,
0.4132360816001892,
-0.8358470797538757,
-0.5968984961509705,
0.3799406588077545,
-0.9977955222129822,
-0.7600128054618835,
0.10742106288671494,
2.3024134635925293,
1.7534446716308594,
-0.4537599980831146,
-0.2181510478258133,
-0.928111732006073,
1.4292722940444946,
-0.2596002519130707,
0.19662882387638092,
1.9848660230636597,
-0.3795450031757355,
-1.1484053134918213,
1.2849640846252441,
-2.432452917098999,
0.14263410866260529,
2.007246255874634,
0.35114845633506775,
0.019867919385433197,
-1.4176911115646362,
-0.5928481221199036,
-0.1876102238893509,
-0.3900117874145508,
-1.251899242401123,
0.5414557456970215,
-0.26232054829597473,
-0.7617032527923584,
-1.4877771139144897,
0.17644624412059784,
-1.1892751455307007,
-1.6371634006500244,
0.24835461378097534,
1.8541072607040405,
2.1225779056549072,
-0.7364704608917236,
1.5120418071746826,
-0.3133838474750519,
0.27358028292655945,
1.204420566558838,
1.1945655345916748,
3.167558193206787,
1.8307420015335083,
-1.3107199668884277,
0.5825626850128174,
-0.10451379418373108,
-0.5028768181800842,
1.1251165866851807,
-1.0276063680648804,
1.2805168628692627,
-0.10579261928796768,
-1.2029263973236084,
-1.2589460611343384,
0.9053243398666382,
0.515055775642395,
0.05869419127702713,
-0.47450336813926697,
1.1658560037612915,
0.04647810012102127,
1.249070167541504,
0.48820725083351135,
-0.41157713532447815,
0.5337257981300354,
-0.40012964606285095,
-0.4888896346092224,
1.5575846433639526,
0.10246541351079941,
-1.4001444578170776,
-2.2219631671905518,
-0.26718342304229736,
-0.8151394724845886,
0.050561659038066864,
-0.6467901468276978,
-0.9866830110549927,
1.5853062868118286,
0.39974695444107056,
-1.2145508527755737,
-0.29439252614974976,
-0.37685444951057434,
-0.6395517587661743,
2.591219186782837,
-1.4041247367858887,
-0.2431129515171051,
-0.9319771528244019,
-0.6247023940086365,
1.5859633684158325,
-1.2250477075576782,
-0.23143768310546875,
-1.0182548761367798,
-0.588077187538147,
-1.2834696769714355,
-0.6346563696861267,
-0.00780474441125989,
-0.975565493106842,
0.765567421913147,
0.1719060242176056,
-1.149750828742981,
-0.33345723152160645,
-0.8023819327354431,
0.8436998128890991,
-0.10544143617153168,
0.21717840433120728,
1.8764128684997559,
0.3473038077354431,
-0.4098688066005707,
0.7233254313468933,
1.2373708486557007,
0.7247931361198425,
-0.5681000351905823,
0.16241253912448883,
-0.6357304453849792,
0.3797280788421631,
-1.307494878768921,
0.33360445499420166,
-2.9004099369049072,
0.6944137215614319,
-0.03538385033607483,
-0.0017307107336819172,
-0.0036444487050175667,
-1.2919312715530396,
1.0494860410690308,
2.584822654724121,
-1.1456053256988525,
0.4570905268192291,
0.2831611931324005,
1.1642932891845703,
-1.659043550491333,
0.24385255575180054,
-0.345182329416275,
2.178004264831543,
0.13599085807800293,
1.1807540655136108,
-0.472055584192276,
-2.3681235313415527,
0.5533182621002197,
-1.2996474504470825,
-1.2011239528656006,
0.774591326713562,
-0.7991303205490112,
0.023241041228175163,
-1.4305322170257568,
-0.18744762241840363,
-0.8537209033966064,
-1.1680039167404175,
0.7368618845939636,
0.11128219217061996,
0.5084118843078613,
-0.6273369789123535,
0.35543015599250793,
-2.2216248512268066,
-1.3424338102340698,
-0.17028479278087616,
-0.9642630219459534,
0.43037793040275574,
-0.3834202289581299,
0.6824713349342346,
-0.14269933104515076,
0.07682289183139801,
0.3362046480178833,
1.4849157333374023,
3.4061832427978516,
0.1743803173303604,
0.4976165294647217,
-0.1924261897802353,
-0.9461971521377563,
1.43539559841156,
0.9665698409080505,
-0.183275043964386,
-0.5814151167869568,
-1.0363596677780151,
1.308136224746704,
1.9600881338119507,
0.8984327912330627,
0.07295218110084534,
-0.7501606941223145,
-0.6924337148666382,
-0.06633320450782776,
0.19667144119739532,
0.44261452555656433,
0.9100638628005981,
0.055324405431747437,
0.0781852975487709,
1.4041111469268799,
1.1289105415344238,
-0.4096367657184601,
0.4162333309650421,
-0.7775404453277588,
-0.4902969300746918,
0.5134856700897217,
0.3661212921142578,
-0.03311014175415039,
0.37744852900505066,
-0.9263848066329956,
-0.23993928730487823,
-0.3292498290538788,
-0.9700051546096802,
-0.6600893139839172,
-0.34879258275032043,
-0.3240022659301758,
1.655738353729248,
0.12092702090740204,
-0.518805742263794,
-0.005807721521705389,
-0.8122712969779968,
-0.1396232396364212,
-1.118599772453308,
0.2294820249080658,
-0.10964147746562958,
-0.18517442047595978,
-0.1441548466682434,
1.7782249450683594,
-0.9240736961364746,
-2.0255815982818604,
0.15125980973243713,
0.2156429886817932,
-0.29818981885910034,
0.16041669249534607,
1.725999116897583,
0.5037761330604553,
1.4816851615905762,
1.4196549654006958,
0.9043991565704346,
-0.70099937915802,
-1.3311289548873901,
0.6876441836357117,
0.9347797632217407,
-1.4232183694839478,
0.8012340068817139,
-0.011838584206998348,
-0.4947540760040283,
0.6668851375579834,
1.2710754871368408,
0.4206484854221344,
-1.9359792470932007,
0.8375622034072876,
-0.9953980445861816,
0.7100807428359985,
0.7017662525177002,
0.7748218178749084,
0.21797619760036469,
0.8675152063369751,
-1.161076545715332,
-1.1078975200653076,
-0.7286137938499451,
-0.6721161007881165,
2.004551649093628,
-0.2804754376411438,
0.48701927065849304,
-0.19945447146892548,
-1.3126990795135498,
-0.05820946395397186,
0.677520215511322,
0.3733929991722107,
-0.23960357904434204,
0.7235422730445862,
-0.8134768605232239,
-1.1889638900756836,
-1.4630547761917114,
-0.38691768050193787,
-0.9519168734550476,
-0.9270827174186707,
1.0392954349517822,
0.8745903968811035,
0.24871796369552612,
1.9278216361999512,
0.699682354927063,
0.21974509954452515,
-2.6210126876831055,
0.785891056060791,
0.3722284138202667,
-0.1367524266242981,
0.9062796235084534,
0.27633562684059143,
1.1039377450942993,
0.074729785323143,
0.4962809681892395,
-2.3822150230407715,
2.287022829055786,
-0.2106582224369049,
0.7777196764945984,
0.010608451440930367,
-0.2127159833908081,
1.1056126356124878,
0.6375449299812317,
0.5674123167991638,
-1.141972303390503,
0.6801780462265015,
-0.6248829364776611,
1.2290235757827759,
0.9469643235206604,
-0.8251981735229492,
-0.05606108158826828,
1.3586090803146362,
0.4494953751564026,
-0.510522723197937,
-0.9690095782279968,
-0.9282968044281006,
0.9333153963088989,
1.766431212425232,
0.02221018075942993,
-0.033341675996780396,
0.7751733660697937,
0.7210128903388977,
-1.3098509311676025,
0.05891972780227661,
-0.6739048361778259,
-0.8817232251167297,
1.6034353971481323,
2.0676379203796387,
-0.07995283603668213,
-0.15164077281951904,
-0.6973425149917603,
-1.3437862396240234,
0.7854558825492859,
-0.03309524804353714,
0.10830045491456985,
0.5953178405761719,
-0.6938408017158508,
1.1119896173477173,
1.000623345375061,
0.8570371866226196,
0.19112002849578857,
0.2239730954170227,
0.31258052587509155,
-0.23807679116725922,
-1.0891079902648926,
-0.20057429373264313,
-1.0302751064300537,
-2.6107192039489746,
0.4514000713825226,
-0.2512529790401459,
-1.4308130741119385,
0.037478573620319366,
-0.9371256828308105,
0.8929265141487122,
-0.5918521881103516,
-1.1238083839416504,
-1.5533561706542969,
0.19431792199611664,
-0.05546020716428757,
0.9075129628181458,
-1.5393621921539307,
-0.20116379857063293,
1.2226712703704834,
0.9334437251091003,
-0.6426931619644165,
0.9759358167648315,
0.16524744033813477,
0.981340229511261,
0.8771545886993408,
-0.43684685230255127,
0.5309717655181885,
0.10755641758441925,
-1.3827877044677734,
0.4507717788219452,
1.2057920694351196,
0.12174347043037415,
1.4515156745910645,
-0.5161741375923157,
0.01892196759581566,
0.41290658712387085,
-0.4687550365924835,
-0.4156435430049896,
-0.6380582451820374,
0.7512642741203308,
0.035021692514419556,
-0.7792226076126099,
0.05631747841835022,
-0.08659500628709793,
-0.2997623383998871,
0.2116086781024933,
-1.5694860219955444,
-0.22899237275123596,
-0.4195908010005951,
-0.5773533582687378,
-1.2599351406097412,
-0.04809831082820892,
1.3972569704055786,
-0.8309304118156433,
-0.2070705145597458,
0.48769769072532654,
0.4750576317310333,
0.47250378131866455,
0.6956127882003784,
-0.6602373719215393,
-0.2973706126213074,
-0.27463066577911377,
-0.41253727674484253,
0.2562502920627594,
1.3659900426864624,
-0.12586911022663116,
-0.9206120371818542,
0.6167778372764587,
-0.31369781494140625,
0.017095545306801796,
1.9625422954559326,
0.0951857641339302,
-0.8794180750846863,
0.3538913428783417,
-0.6808431148529053,
1.9929314851760864,
1.6961805820465088,
1.260043978691101,
-0.13478879630565643,
-0.973090410232544,
0.7009443044662476,
-0.36356621980667114,
-0.3135092854499817,
0.9032307267189026,
0.4387172758579254,
-0.18838369846343994,
-1.4637006521224976,
0.6402437090873718,
1.2248660326004028,
-0.7826319932937622,
-0.7577950358390808,
0.061922281980514526,
-0.7751033306121826,
1.0398905277252197,
0.6890019178390503,
0.45140552520751953,
0.23781460523605347,
1.7178173065185547,
0.786268413066864,
-0.5691076517105103,
0.4708171784877777,
0.5797117352485657,
-0.11858206987380981,
-2.090954542160034,
-1.113050937652588,
0.28650757670402527,
-0.4351572096347809,
-1.5250760316848755,
1.3489573001861572,
-1.0725353956222534,
-0.9320899248123169,
0.538009524345398,
-0.0021994998678565025,
1.3347809314727783,
0.3392777442932129,
1.6243315935134888,
2.0578348636627197,
0.8358665108680725,
0.3439732491970062,
1.247986078262329,
-0.1821388453245163,
-0.33959531784057617,
1.8497021198272705,
-0.46108174324035645,
0.4987381100654602,
1.1897441148757935,
-0.4268730878829956,
-1.049245834350586,
-0.7673106789588928,
-1.1772311925888062,
-0.695165753364563,
1.1034200191497803,
0.11432431638240814,
-1.1638635396957397,
0.31396397948265076,
1.6449276208877563,
0.04125365614891052,
-0.2518078088760376,
0.5597742795944214,
0.45160040259361267,
-0.7381585836410522,
-0.039663124829530716,
-0.9730545282363892,
0.4622237980365753,
-0.21558651328086853,
-0.3739919066429138,
0.44044530391693115,
0.4964008331298828,
1.330322504043579,
0.0025270162150263786,
0.059283241629600525,
1.1614985466003418,
-1.5005265474319458,
1.3562121391296387,
-0.7389684915542603,
0.2719525694847107,
-2.3262856006622314,
1.3581607341766357,
-0.8006789684295654,
2.0184428691864014,
-2.6546318531036377,
0.39485540986061096,
-0.6386716365814209,
-0.48052456974983215,
0.3224529027938843,
-0.35466268658638,
0.1743011623620987,
-0.14261314272880554,
-1.0780333280563354,
-0.11841415613889694,
-0.7134273052215576,
0.646211564540863,
1.1395171880722046,
1.3072131872177124,
-1.0015836954116821,
-0.28389254212379456,
-1.6464225053787231,
-0.15020456910133362,
-0.558751106262207,
0.19870498776435852,
-1.927582859992981,
-0.15957432985305786,
-1.9889475107192993,
-2.2980704307556152,
-1.360520839691162,
-0.8067536950111389,
1.1019805669784546,
0.11950178444385529,
-0.8754952549934387,
1.2146986722946167,
-0.39868292212486267,
-1.7864775657653809,
1.1028556823730469,
-2.1178154945373535
] |
https://github.com/huggingface/datasets/issues/5137 | Align task tags in dataset metadata | Thanks to you both for your feedback! super useful! cc'ing @osanseviero too 🙂
> The datasets explorer still shows tags that are no longer valid
wait which explorer is that? is it https://huggingface.co/datasets/viewer/ ?
| ## Describe
Once we have agreed on a common naming for task tags for all open source projects, we should align on them.
## Steps
- [x] Align task tags in canonical datasets
- [x] task_categories: 4 datasets
- [x] task_ids (by @lhoestq)
- [x] Open PRs in community datasets
- [x] task_categories: 451 datasets
- [x] task_ids: 556 datasets
| 467 | 34 | Align task tags in dataset metadata
## Describe
Once we have agreed on a common naming for task tags for all open source projects, we should align on them.
## Steps
- [x] Align task tags in canonical datasets
- [x] task_categories: 4 datasets
- [x] task_ids (by @lhoestq)
- [x] Open PRs in community datasets
- [x] task_categories: 451 datasets
- [x] task_ids: 556 datasets
Thanks to you both for your feedback! super useful! cc'ing @osanseviero too 🙂
> The datasets explorer still shows tags that are no longer valid
wait which explorer is that? is it https://huggingface.co/datasets/viewer/ ?
| [
-1.226220726966858,
-0.8197015523910522,
-0.8830233216285706,
1.4472309350967407,
-0.0806853249669075,
-1.2926926612854004,
0.024962402880191803,
-1.1603962182998657,
1.762030839920044,
-0.9696635007858276,
0.26094603538513184,
-1.6746482849121094,
-0.005265637766569853,
-0.6097897887229919,
-0.7188013792037964,
-0.999528169631958,
-0.4152040481567383,
-0.7875757813453674,
0.947696328163147,
2.4558401107788086,
1.0132795572280884,
-1.357168197631836,
2.8756771087646484,
0.7143356800079346,
-0.33014512062072754,
-0.9235314726829529,
0.5680185556411743,
0.05661889910697937,
-1.2666747570037842,
-0.3423802852630615,
-1.1107009649276733,
-0.008854418992996216,
-0.5439932346343994,
-0.4188790023326874,
0.07970922440290451,
0.26240187883377075,
-0.15695948898792267,
-0.3267817497253418,
-0.4435155987739563,
-0.7536215782165527,
0.32205820083618164,
-0.21372386813163757,
0.9185977578163147,
-0.4616716504096985,
1.8098362684249878,
-0.5878006219863892,
0.14859944581985474,
0.5982151031494141,
1.3677277565002441,
0.20422294735908508,
-0.09332230687141418,
0.14140895009040833,
0.28119370341300964,
-0.04794774577021599,
0.4326465427875519,
1.0708786249160767,
0.5106764435768127,
0.6368327140808105,
0.7232664823532104,
-2.253898859024048,
1.3120101690292358,
-0.9909150004386902,
0.3714942932128906,
1.534221887588501,
-1.0054794549942017,
0.3271521031856537,
-1.8449223041534424,
-0.04405168816447258,
0.5903964042663574,
-2.3078689575195312,
0.14799077808856964,
-1.196470856666565,
-0.5842162370681763,
0.9023109674453735,
0.2931385934352875,
-1.281543493270874,
0.15319612622261047,
-0.4418259263038635,
1.048181176185608,
0.48927897214889526,
1.1518112421035767,
-1.6846041679382324,
0.18870578706264496,
-0.3279886245727539,
-0.0029685338959097862,
-1.33482825756073,
-1.499855875968933,
0.6089583039283752,
0.6213237047195435,
0.6442080736160278,
0.028235651552677155,
0.8545754551887512,
-0.931431233882904,
0.7955026626586914,
-0.8732281923294067,
-1.6497514247894287,
-1.322424054145813,
-2.3610739707946777,
-2.407904863357544,
0.754906952381134,
-0.5012193918228149,
-0.45701801776885986,
2.0269477367401123,
-1.0714904069900513,
-1.8196438550949097,
1.135192632675171,
0.2958661615848541,
0.061065398156642914,
2.481682062149048,
0.2697138488292694,
-0.7017027735710144,
0.4004741311073303,
-0.6788104772567749,
0.7411343455314636,
-0.3643950819969177,
1.3516465425491333,
0.5075967311859131,
-1.0223456621170044,
1.6557872295379639,
-0.39253687858581543,
0.5880233645439148,
-0.6306430101394653,
-0.5971920490264893,
-0.9318784475326538,
0.38890311121940613,
1.8535523414611816,
-0.332289457321167,
1.562773585319519,
-0.3292384743690491,
-1.5220739841461182,
-1.5559568405151367,
0.7977641820907593,
0.6355835795402527,
-0.8823816776275635,
0.1725248545408249,
-0.44589823484420776,
0.025863047689199448,
0.019477497786283493,
1.2305351495742798,
1.1546794176101685,
0.6006357669830322,
-0.18378055095672607,
-0.8785831928253174,
0.22876398265361786,
0.06981632113456726,
-0.7220560312271118,
-1.803877830505371,
-0.3368496000766754,
0.19271452724933624,
0.7194779515266418,
-1.251630187034607,
1.642337679862976,
0.903085470199585,
1.8690773248672485,
0.9848405122756958,
-0.22696395218372345,
1.4733424186706543,
-0.008258301764726639,
1.7301186323165894,
-0.38971617817878723,
0.6766213774681091,
-0.3312051296234131,
-1.3323358297348022,
0.8785794377326965,
-0.4714656174182892,
-1.990483045578003,
-0.891981303691864,
-0.9305673241615295,
-0.16529057919979095,
-0.8488016128540039,
0.9629135131835938,
-0.33866673707962036,
-1.3968547582626343,
0.2505979835987091,
-0.5706579685211182,
0.2963149845600128,
-1.2641561031341553,
0.2643515467643738,
0.7613092660903931,
-0.583928108215332,
-0.09039288014173508,
-0.17310532927513123,
-1.3879590034484863,
-0.5537964105606079,
0.19404688477516174,
1.8962093591690063,
-0.7917463183403015,
0.8999589085578918,
1.0168025493621826,
-0.6151251792907715,
0.07501138746738434,
0.28767579793930054,
-0.23100848495960236,
0.8959208726882935,
-1.0695933103561401,
-0.41081732511520386,
1.2058022022247314,
-0.11711553484201431,
-0.6347126960754395,
1.5213764905929565,
0.7423609495162964,
-0.9962995052337646,
-0.27863648533821106,
-0.2339547723531723,
-0.7410556674003601,
-0.10173279792070389,
-1.60427725315094,
-0.19613929092884064,
0.3409336805343628,
-1.459014892578125,
-0.4543519914150238,
-0.1346040964126587,
1.3626015186309814,
-0.21577873826026917,
1.3449649810791016,
-0.32828882336616516,
-0.274651437997818,
-0.4299962520599365,
-0.3958703577518463,
0.23764364421367645,
-0.2025531381368637,
-0.7022562623023987,
0.38286128640174866,
-0.7765113115310669,
0.33138349652290344,
1.3966563940048218,
0.4473237693309784,
0.19837693870067596,
0.6263348460197449,
1.0355631113052368,
0.22141863405704498,
-0.1520519107580185,
-0.900121808052063,
-1.6814947128295898,
2.0582969188690186,
-1.4748188257217407,
1.9908522367477417,
0.7050674557685852,
-0.11884734034538269,
-1.7723822593688965,
-1.9016565084457397,
1.5060421228408813,
1.1813970804214478,
2.2723751068115234,
0.6491549611091614,
0.44900044798851013,
-0.8739301562309265,
-0.6871243119239807,
0.3228297829627991,
-0.9537370800971985,
-0.7014711499214172,
0.15770107507705688,
2.253556728363037,
1.7301087379455566,
-0.44743648171424866,
-0.07957281917333603,
-0.8796305060386658,
1.2256290912628174,
-0.28267452120780945,
0.1787268966436386,
1.9869837760925293,
-0.5798096060752869,
-1.1698414087295532,
1.2081778049468994,
-2.4645111560821533,
0.08304890990257263,
2.0065972805023193,
0.29636189341545105,
0.000491701066493988,
-1.4084415435791016,
-0.6410346031188965,
-0.34887346625328064,
-0.3774973750114441,
-1.3296455144882202,
0.5553615689277649,
-0.222881019115448,
-0.8309232592582703,
-1.4840028285980225,
0.23084259033203125,
-1.1802560091018677,
-1.538798213005066,
0.45909011363983154,
1.8324052095413208,
2.163520574569702,
-0.7542022466659546,
1.449596881866455,
-0.3022850453853607,
0.26269271969795227,
1.1880686283111572,
1.2086455821990967,
3.14622163772583,
1.8280006647109985,
-1.2881402969360352,
0.7416619062423706,
-0.03819824382662773,
-0.49934113025665283,
1.1330939531326294,
-0.9589281678199768,
1.3264890909194946,
-0.14587587118148804,
-1.3233716487884521,
-1.4010716676712036,
0.9482879638671875,
0.4986959397792816,
0.03331192210316658,
-0.5943582653999329,
1.3292306661605835,
-0.021726693958044052,
1.2453715801239014,
0.4306378662586212,
-0.41031768918037415,
0.46911394596099854,
-0.41089367866516113,
-0.43614012002944946,
1.5761479139328003,
0.04461625590920448,
-1.5157685279846191,
-2.2849676609039307,
-0.3427819013595581,
-0.8177516460418701,
-0.20630982518196106,
-0.6472783088684082,
-1.122800350189209,
1.6266733407974243,
0.5241134166717529,
-1.2094634771347046,
-0.2649630010128021,
-0.358245313167572,
-0.54634690284729,
2.616834878921509,
-1.4443086385726929,
-0.08132590353488922,
-0.8791382908821106,
-0.43776294589042664,
1.687368631362915,
-1.2114763259887695,
-0.15293259918689728,
-0.9777103066444397,
-0.6996310949325562,
-1.3408421277999878,
-0.5966304540634155,
0.04308263212442398,
-1.0517629384994507,
0.7555837035179138,
0.10546356439590454,
-1.1492356061935425,
-0.297418475151062,
-0.7774015069007874,
1.001835584640503,
-0.12087385356426239,
0.21551364660263062,
1.9486045837402344,
0.3374956250190735,
-0.3841221332550049,
0.6890099048614502,
1.3194667100906372,
0.7486768960952759,
-0.7132853865623474,
0.12481322139501572,
-0.649405837059021,
0.3614778220653534,
-1.383790373802185,
0.25897741317749023,
-3.0659165382385254,
0.7073865532875061,
-0.008971058763563633,
-0.000178472138941288,
0.0865681990981102,
-1.2626358270645142,
1.1519839763641357,
2.5690770149230957,
-1.2169523239135742,
0.37949302792549133,
0.30590447783470154,
1.1046744585037231,
-1.4644743204116821,
0.10467831790447235,
-0.44838833808898926,
2.123006820678711,
0.06143752485513687,
1.2139875888824463,
-0.4509202539920807,
-2.129409074783325,
0.6141652464866638,
-1.2941703796386719,
-1.072084665298462,
0.8524397611618042,
-0.8682726621627808,
0.17758530378341675,
-1.4799354076385498,
-0.14264698326587677,
-0.9340212345123291,
-1.1804524660110474,
0.6724982857704163,
0.08864462375640869,
0.516108512878418,
-0.6362124085426331,
0.36596617102622986,
-2.1883747577667236,
-1.3422513008117676,
-0.0926307663321495,
-1.0540755987167358,
0.4072924554347992,
-0.2880387008190155,
0.6887813210487366,
-0.12135689705610275,
0.1742347776889801,
0.4162454307079315,
1.3934621810913086,
3.349330186843872,
0.1563096046447754,
0.49078938364982605,
-0.13746720552444458,
-0.905625581741333,
1.450637936592102,
1.0773835182189941,
-0.027399662882089615,
-0.4813482463359833,
-0.9000770449638367,
1.3809560537338257,
1.9180562496185303,
0.9907771944999695,
0.0271281935274601,
-0.8448636531829834,
-0.6554625630378723,
0.025954853743314743,
0.2999298870563507,
0.5645524263381958,
0.794517993927002,
-0.07700404524803162,
0.10482374578714371,
1.4057822227478027,
1.0832992792129517,
-0.46567562222480774,
0.47634923458099365,
-0.910010039806366,
-0.5176818370819092,
0.4953314960002899,
0.3357889950275421,
0.012247099541127682,
0.5225038528442383,
-0.9951472878456116,
-0.2210388332605362,
-0.211868554353714,
-0.8886604309082031,
-0.6298398971557617,
-0.31047600507736206,
-0.35634443163871765,
1.5637476444244385,
0.014651046134531498,
-0.5205148458480835,
0.031881630420684814,
-0.9236973524093628,
-0.1954776793718338,
-1.1222712993621826,
0.28671735525131226,
-0.1266898661851883,
-0.06913644075393677,
-0.22524577379226685,
1.7408798933029175,
-1.04458487033844,
-2.0755555629730225,
0.15530526638031006,
0.25085949897766113,
-0.3912864625453949,
0.09758058935403824,
1.7543809413909912,
0.5117748379707336,
1.5087860822677612,
1.3191012144088745,
0.9409928917884827,
-0.6554444432258606,
-1.3243751525878906,
0.6001830697059631,
0.945801854133606,
-1.3765376806259155,
0.9379337430000305,
-0.22679780423641205,
-0.5688214302062988,
0.7197332382202148,
1.3150253295898438,
0.4271344244480133,
-1.8157416582107544,
0.8821825981140137,
-0.9921749830245972,
0.7374442219734192,
0.7635290622711182,
0.9141129851341248,
0.21374207735061646,
0.8903812766075134,
-1.1564627885818481,
-1.1467318534851074,
-0.8023116588592529,
-0.6145359873771667,
1.8930338621139526,
-0.24836139380931854,
0.4062064588069916,
-0.18498964607715607,
-1.1456680297851562,
0.013703332282602787,
0.6051976680755615,
0.3359632194042206,
-0.10161563754081726,
0.8302289843559265,
-0.7123124599456787,
-1.1171165704727173,
-1.340552568435669,
-0.45297688245773315,
-0.9409726858139038,
-0.9017402529716492,
1.1156936883926392,
0.9378398060798645,
0.3878979980945587,
1.8823169469833374,
0.614645779132843,
0.2238570600748062,
-2.572577476501465,
0.7752631902694702,
0.34990376234054565,
-0.012535188347101212,
0.8841179013252258,
0.3116014003753662,
1.2115929126739502,
0.08105446398258209,
0.3410700857639313,
-2.2493553161621094,
2.1743550300598145,
-0.17859439551830292,
0.6633956432342529,
-0.013281932100653648,
0.009179568849503994,
0.9926016926765442,
0.5852521657943726,
0.5745505690574646,
-1.160269021987915,
0.7505311965942383,
-0.5624027848243713,
1.210153341293335,
0.971922755241394,
-0.8281688690185547,
-0.03617308661341667,
1.3182365894317627,
0.5313997864723206,
-0.4406748414039612,
-0.9250059723854065,
-0.7984562516212463,
0.9765138030052185,
1.6641865968704224,
0.1203288808465004,
-0.04077461361885071,
0.7824687361717224,
0.6133596897125244,
-1.3210585117340088,
-0.0552423894405365,
-0.6174967288970947,
-0.7310440540313721,
1.6123422384262085,
2.0023765563964844,
-0.05657089501619339,
-0.013747422024607658,
-0.7007357478141785,
-1.258809208869934,
0.7394132018089294,
-0.23215144872665405,
0.025054726749658585,
0.6470884084701538,
-0.748802661895752,
1.1211955547332764,
0.9144622683525085,
0.8066430687904358,
0.04468077793717384,
0.38178184628486633,
0.3463641107082367,
-0.10243801027536392,
-1.2106205224990845,
-0.23692096769809723,
-0.9858705997467041,
-2.624051332473755,
0.33323967456817627,
-0.46121859550476074,
-1.325049877166748,
0.004026866517961025,
-1.0443980693817139,
0.8784370422363281,
-0.6520471572875977,
-0.9756041169166565,
-1.5090436935424805,
0.19284670054912567,
-0.013878077268600464,
0.8908973336219788,
-1.4599270820617676,
-0.044087011367082596,
1.3744436502456665,
0.9458436965942383,
-0.7067079544067383,
1.0523360967636108,
0.2897830009460449,
1.0155749320983887,
0.7777083516120911,
-0.3848077952861786,
0.489937424659729,
0.10496148467063904,
-1.306405782699585,
0.46427854895591736,
1.2571585178375244,
0.18281030654907227,
1.4275381565093994,
-0.5026970505714417,
-0.08957146108150482,
0.48126456141471863,
-0.4531640112400055,
-0.373891681432724,
-0.6550140380859375,
0.7027559280395508,
0.24633914232254028,
-0.8122329711914062,
0.037045709788799286,
-0.13848777115345,
-0.3678477704524994,
0.3155404031276703,
-1.5622198581695557,
-0.37189337611198425,
-0.4781562089920044,
-0.513121485710144,
-1.3798273801803589,
0.04059717059135437,
1.3925801515579224,
-0.8454527854919434,
-0.1730300337076187,
0.5151733756065369,
0.40989673137664795,
0.5169723033905029,
0.8136293292045593,
-0.6687214374542236,
-0.23094108700752258,
-0.3789917528629303,
-0.3897942006587982,
0.25911685824394226,
1.1883416175842285,
-0.19430023431777954,
-0.973206102848053,
0.6670746207237244,
-0.29850274324417114,
-0.040186796337366104,
2.0754024982452393,
0.06641767174005508,
-0.9657389521598816,
0.27771681547164917,
-0.7610401511192322,
2.068802833557129,
1.563177466392517,
1.2727831602096558,
-0.17435818910598755,
-0.9517180919647217,
0.7408842444419861,
-0.21219748258590698,
-0.2705843448638916,
0.9121851921081543,
0.4719126522541046,
-0.196089506149292,
-1.4655894041061401,
0.5745295882225037,
1.2661396265029907,
-0.9050799608230591,
-0.7477564811706543,
0.13023585081100464,
-0.775568425655365,
0.9830561280250549,
0.7869880795478821,
0.3292652666568756,
0.32327303290367126,
1.619973063468933,
0.7002115249633789,
-0.5967180132865906,
0.20614425837993622,
0.5642474293708801,
0.054550521075725555,
-1.9516198635101318,
-0.8724503517150879,
0.3369857370853424,
-0.34031179547309875,
-1.485347032546997,
1.2461018562316895,
-1.106406807899475,
-0.928217887878418,
0.5299022197723389,
0.07367110997438431,
1.335953950881958,
0.2646104097366333,
1.739804744720459,
1.973610758781433,
0.9342180490493774,
0.22808919847011566,
1.388372778892517,
-0.10884484648704529,
-0.2293422818183899,
1.8024119138717651,
-0.4595119059085846,
0.5138667225837708,
1.1698178052902222,
-0.49002605676651,
-1.0066027641296387,
-0.7731112241744995,
-1.1564310789108276,
-0.6146647930145264,
1.0976099967956543,
0.23475030064582825,
-1.2833002805709839,
0.24121692776679993,
1.5275121927261353,
0.14702455699443817,
-0.16512003540992737,
0.6045693159103394,
0.5082030296325684,
-0.7928245663642883,
-0.0783601701259613,
-1.0449464321136475,
0.5768013000488281,
-0.15714892745018005,
-0.3015074133872986,
0.3490423262119293,
0.499124139547348,
1.2918835878372192,
0.0421852171421051,
0.08659549057483673,
1.2578626871109009,
-1.4842123985290527,
1.2699788808822632,
-0.7250142693519592,
0.2819465398788452,
-2.465855598449707,
1.3377597332000732,
-0.7266472578048706,
1.9486970901489258,
-2.759889602661133,
0.42852461338043213,
-0.6701613664627075,
-0.4202987253665924,
0.2903314232826233,
-0.3283408284187317,
0.14932088553905487,
-0.17826880514621735,
-1.0760846138000488,
-0.11053016781806946,
-0.8045135140419006,
0.6078329086303711,
1.171515941619873,
1.272225260734558,
-1.0131752490997314,
-0.3405609130859375,
-1.6167038679122925,
-0.26651281118392944,
-0.6750532984733582,
0.17297916114330292,
-1.957650899887085,
-0.08491124957799911,
-1.957132339477539,
-2.4655795097351074,
-1.4389952421188354,
-0.6757290959358215,
1.174896001815796,
0.17068277299404144,
-0.9150623679161072,
1.2002049684524536,
-0.39524516463279724,
-1.7356541156768799,
1.0478641986846924,
-2.1175084114074707
] |
https://github.com/huggingface/datasets/issues/5137 | Align task tags in dataset metadata | - Some people do not agree about current "hierarchy":
- symbolic-regression: [yoshitomo-matsubara/srsd-feynman_hard](https://huggingface.co/datasets/yoshitomo-matsubara/srsd-feynman_hard/discussions/2#63614194c12a09b8a31457cc), [yoshitomo-matsubara/srsd-feynman_medium](https://huggingface.co/datasets/yoshitomo-matsubara/srsd-feynman_medium/discussions/2#6361418aeee0d27f04379e43), [yoshitomo-matsubara/srsd-feynman_easy](https://huggingface.co/datasets/yoshitomo-matsubara/srsd-feynman_easy/discussions/2#6361416e00905b1ffb8d0112)
- Why don't we have symbolic-regression task? | ## Describe
Once we have agreed on a common naming for task tags for all open source projects, we should align on them.
## Steps
- [x] Align task tags in canonical datasets
- [x] task_categories: 4 datasets
- [x] task_ids (by @lhoestq)
- [x] Open PRs in community datasets
- [x] task_categories: 451 datasets
- [x] task_ids: 556 datasets
| 467 | 21 | Align task tags in dataset metadata
## Describe
Once we have agreed on a common naming for task tags for all open source projects, we should align on them.
## Steps
- [x] Align task tags in canonical datasets
- [x] task_categories: 4 datasets
- [x] task_ids (by @lhoestq)
- [x] Open PRs in community datasets
- [x] task_categories: 451 datasets
- [x] task_ids: 556 datasets
- Some people do not agree about current "hierarchy":
- symbolic-regression: [yoshitomo-matsubara/srsd-feynman_hard](https://huggingface.co/datasets/yoshitomo-matsubara/srsd-feynman_hard/discussions/2#63614194c12a09b8a31457cc), [yoshitomo-matsubara/srsd-feynman_medium](https://huggingface.co/datasets/yoshitomo-matsubara/srsd-feynman_medium/discussions/2#6361418aeee0d27f04379e43), [yoshitomo-matsubara/srsd-feynman_easy](https://huggingface.co/datasets/yoshitomo-matsubara/srsd-feynman_easy/discussions/2#6361416e00905b1ffb8d0112)
- Why don't we have symbolic-regression task? | [
-1.2388193607330322,
-0.8212980031967163,
-0.833560049533844,
1.4211735725402832,
0.006033729761838913,
-1.251948356628418,
0.010178374126553535,
-0.9509046077728271,
1.6723837852478027,
-0.776684582233429,
0.34297147393226624,
-1.7616064548492432,
-0.08506344258785248,
-0.7230706810951233,
-0.7238235473632812,
-0.8375784158706665,
-0.36610791087150574,
-0.8213972449302673,
1.0623629093170166,
2.522777795791626,
1.216212272644043,
-1.390160322189331,
2.7761600017547607,
0.8151507377624512,
-0.3300745189189911,
-0.8703433871269226,
0.5129876732826233,
0.004719451069831848,
-1.314709186553955,
-0.42252424359321594,
-0.9974094033241272,
-0.021058984100818634,
-0.5698663592338562,
-0.4281967282295227,
0.09922277182340622,
0.3660849630832672,
-0.16078369319438934,
-0.2537303566932678,
-0.5287081599235535,
-0.7852709293365479,
0.35401424765586853,
-0.2866743505001068,
0.9099196791648865,
-0.3292633295059204,
1.8405039310455322,
-0.6093321442604065,
0.29065605998039246,
0.6024047136306763,
1.2326123714447021,
0.15789516270160675,
0.023882843554019928,
0.2569602429866791,
0.28292861580848694,
-0.10592028498649597,
0.5471857190132141,
1.2814877033233643,
0.629269003868103,
0.4524628520011902,
0.7375345826148987,
-2.261335849761963,
1.3275606632232666,
-0.9214879870414734,
0.2814687192440033,
1.4571049213409424,
-0.9727526903152466,
0.3370433449745178,
-1.870255470275879,
-0.06241985782980919,
0.54384845495224,
-2.3418569564819336,
0.11414221674203873,
-1.2418534755706787,
-0.5918620228767395,
0.9508985280990601,
0.329231858253479,
-1.2585606575012207,
0.13960520923137665,
-0.4870654046535492,
1.0868523120880127,
0.5009649991989136,
1.1441819667816162,
-1.7565791606903076,
0.047932036221027374,
-0.21027594804763794,
0.1290670484304428,
-1.288994312286377,
-1.5844190120697021,
0.5016574263572693,
0.6320608854293823,
0.5622571706771851,
-0.02307652309536934,
0.9220636487007141,
-1.0400574207305908,
0.8316861987113953,
-0.8738289475440979,
-1.6734063625335693,
-1.4625513553619385,
-2.408813953399658,
-2.3386049270629883,
0.810063898563385,
-0.4897216558456421,
-0.41763585805892944,
1.97943115234375,
-1.1245319843292236,
-1.7896757125854492,
1.0502865314483643,
0.3443428874015808,
0.03458889573812485,
2.4223411083221436,
0.2508564293384552,
-0.9289430975914001,
0.5108022093772888,
-0.773221492767334,
0.7146569490432739,
-0.378250390291214,
1.4016039371490479,
0.47799596190452576,
-1.0532312393188477,
1.5960078239440918,
-0.4264445900917053,
0.5415840744972229,
-0.755231499671936,
-0.4991304874420166,
-0.7889961004257202,
0.2683912217617035,
1.89198899269104,
-0.29774221777915955,
1.56797194480896,
-0.2458215057849884,
-1.5076026916503906,
-1.494035243988037,
0.7913040518760681,
0.571252167224884,
-0.8654400110244751,
0.1519460678100586,
-0.5074903964996338,
0.11636191606521606,
-0.000037593767046928406,
1.0967514514923096,
1.2053930759429932,
0.6206538677215576,
-0.24924437701702118,
-0.7938900589942932,
0.23320063948631287,
-0.006231213919818401,
-0.6300904750823975,
-1.7384700775146484,
-0.3575553596019745,
0.2182503044605255,
0.6386107206344604,
-1.4032628536224365,
1.7756497859954834,
0.8444803953170776,
2.0579886436462402,
1.05845046043396,
-0.33858487010002136,
1.585165023803711,
0.09332828968763351,
1.8475728034973145,
-0.35446083545684814,
0.6782785058021545,
-0.34776952862739563,
-1.2460789680480957,
0.8572090268135071,
-0.4146870970726013,
-2.035551071166992,
-0.7640140056610107,
-0.8373125791549683,
-0.1394648253917694,
-0.808770477771759,
0.9987637400627136,
-0.27033525705337524,
-1.3815484046936035,
0.21452482044696808,
-0.7101319432258606,
0.17419056594371796,
-1.3525135517120361,
0.18868419528007507,
0.7518705725669861,
-0.5664661526679993,
-0.03214019536972046,
-0.2678653597831726,
-1.4047048091888428,
-0.4644213318824768,
0.30931901931762695,
1.9145243167877197,
-0.6106123328208923,
0.8585268259048462,
1.042287826538086,
-0.5806016325950623,
0.038247257471084595,
0.43515336513519287,
-0.30258482694625854,
0.9470916390419006,
-0.991361677646637,
-0.35505929589271545,
1.1883277893066406,
-0.0974498987197876,
-0.6847060322761536,
1.437706708908081,
0.728975772857666,
-0.969815731048584,
-0.31398722529411316,
-0.17894534766674042,
-0.8481329679489136,
0.03713652491569519,
-1.648197889328003,
-0.17109490931034088,
0.346946120262146,
-1.4527623653411865,
-0.3928215503692627,
-0.14357289671897888,
1.3800976276397705,
-0.24271288514137268,
1.4044897556304932,
-0.321312814950943,
-0.11867332458496094,
-0.3776248097419739,
-0.5009686946868896,
0.23326954245567322,
-0.12922246754169464,
-0.6721692681312561,
0.37487101554870605,
-0.8997993469238281,
0.31386798620224,
1.430649995803833,
0.38289156556129456,
0.059565186500549316,
0.5145074725151062,
1.0603382587432861,
0.2914392948150635,
-0.1475878357887268,
-0.8565478324890137,
-1.670609951019287,
2.105149507522583,
-1.5521793365478516,
1.990082025527954,
0.8025293946266174,
-0.06794264912605286,
-1.793302059173584,
-1.8394436836242676,
1.40632963180542,
1.11238694190979,
2.421175956726074,
0.595889687538147,
0.4558301270008087,
-0.8673627376556396,
-0.7522948384284973,
0.3543996214866638,
-0.9559004902839661,
-0.7575534582138062,
0.15873713791370392,
2.318796157836914,
1.7656986713409424,
-0.41132354736328125,
-0.15667444467544556,
-0.8438910841941833,
1.243776798248291,
-0.34303194284439087,
0.14041754603385925,
1.9929916858673096,
-0.36249104142189026,
-1.0417566299438477,
1.2636334896087646,
-2.376357078552246,
0.21602913737297058,
1.9870483875274658,
0.3158661127090454,
0.06806576997041702,
-1.3323886394500732,
-0.6743355393409729,
-0.25510573387145996,
-0.4422820210456848,
-1.1950271129608154,
0.5585092902183533,
-0.28019633889198303,
-0.9218864440917969,
-1.4633502960205078,
0.0328940823674202,
-1.1195101737976074,
-1.6160588264465332,
0.3834379017353058,
1.8195416927337646,
2.1846039295196533,
-0.8499767184257507,
1.4246082305908203,
-0.246782124042511,
0.1187250167131424,
1.1763370037078857,
1.2508494853973389,
3.131253719329834,
1.7733540534973145,
-1.3296782970428467,
0.7395226359367371,
-0.1495201140642166,
-0.5087153911590576,
1.1660044193267822,
-1.1190836429595947,
1.1314241886138916,
-0.1779790073633194,
-1.3022725582122803,
-1.3378033638000488,
0.9982782006263733,
0.5128404498100281,
-0.0026633795350790024,
-0.6474437117576599,
1.260106086730957,
0.03097446635365486,
1.2787716388702393,
0.45416420698165894,
-0.3693402111530304,
0.4061969220638275,
-0.34066659212112427,
-0.6276829838752747,
1.5544943809509277,
0.01303878054022789,
-1.5750095844268799,
-2.3420886993408203,
-0.22518427670001984,
-0.9353035688400269,
-0.08064250648021698,
-0.7972692847251892,
-1.105548620223999,
1.6541094779968262,
0.46547818183898926,
-1.1656455993652344,
-0.2707674503326416,
-0.3850255012512207,
-0.6131832599639893,
2.6356420516967773,
-1.3505640029907227,
-0.20006163418293,
-0.9269697666168213,
-0.47007855772972107,
1.5447661876678467,
-1.1428697109222412,
-0.13304755091667175,
-0.9534998536109924,
-0.6563277840614319,
-1.3100535869598389,
-0.5772988796234131,
-0.04408198967576027,
-0.9673786163330078,
0.7521539926528931,
0.010733740404248238,
-1.1450018882751465,
-0.24071769416332245,
-0.9297326803207397,
1.0143930912017822,
-0.16111315786838531,
0.21113868057727814,
1.8858850002288818,
0.3534395396709442,
-0.37293410301208496,
0.7177445888519287,
1.2695653438568115,
0.7940078973770142,
-0.5828316807746887,
0.06654416769742966,
-0.6499947905540466,
0.40863803029060364,
-1.3832621574401855,
0.281196653842926,
-2.9504687786102295,
0.6756147742271423,
0.03957247734069824,
-0.035134151577949524,
-0.012522244825959206,
-1.2589397430419922,
1.0637140274047852,
2.545327663421631,
-1.2453441619873047,
0.507736086845398,
0.4094359874725342,
1.150707721710205,
-1.578902006149292,
0.18713614344596863,
-0.5335633754730225,
2.100306749343872,
0.14802642166614532,
1.1768975257873535,
-0.4854361414909363,
-2.1382315158843994,
0.593870222568512,
-1.2880313396453857,
-0.9373937249183655,
0.8721402287483215,
-0.8808847069740295,
0.2283560335636139,
-1.4234514236450195,
-0.12904399633407593,
-0.9055919647216797,
-1.154355764389038,
0.6747568845748901,
0.07306061685085297,
0.5576688051223755,
-0.6361123919487,
0.4202369451522827,
-2.2322182655334473,
-1.3285143375396729,
-0.11306034028530121,
-1.0003681182861328,
0.4846239984035492,
-0.23382918536663055,
0.5853005647659302,
-0.04162154719233513,
0.08148008584976196,
0.37251701951026917,
1.388261318206787,
3.349726438522339,
0.18022523820400238,
0.4032277762889862,
-0.06584325432777405,
-0.9475263953208923,
1.4185006618499756,
0.9670655727386475,
-0.054732922464609146,
-0.5030289888381958,
-0.9352648854255676,
1.4451262950897217,
1.875004529953003,
1.1533246040344238,
0.07662899047136307,
-0.901695728302002,
-0.8360762000083923,
0.13200914859771729,
0.25648966431617737,
0.5052404999732971,
0.8435458540916443,
0.024172015488147736,
0.09163437783718109,
1.3286621570587158,
1.1121909618377686,
-0.41466018557548523,
0.5434831380844116,
-0.9519661664962769,
-0.39946746826171875,
0.4046221673488617,
0.31767794489860535,
0.028483502566814423,
0.4642169177532196,
-0.999239981174469,
-0.25274360179901123,
-0.24062512814998627,
-0.8467357754707336,
-0.7304627895355225,
-0.34378355741500854,
-0.41021645069122314,
1.6543169021606445,
0.05794624239206314,
-0.49105724692344666,
0.040555477142333984,
-0.7957988381385803,
-0.1898098587989807,
-1.169764757156372,
0.24231433868408203,
-0.0906389057636261,
0.04169202968478203,
-0.163608580827713,
1.7566406726837158,
-0.9864733219146729,
-2.1068453788757324,
0.055206067860126495,
0.3486223518848419,
-0.41532784700393677,
0.04251040145754814,
1.8522772789001465,
0.5177283883094788,
1.3182363510131836,
1.2782456874847412,
0.9577325582504272,
-0.6679685115814209,
-1.1996874809265137,
0.6787548661231995,
0.9668110609054565,
-1.3130261898040771,
0.9834210872650146,
-0.18090906739234924,
-0.522443413734436,
0.6674848198890686,
1.3729329109191895,
0.4534333348274231,
-1.8682963848114014,
0.830601692199707,
-1.0295014381408691,
0.7433232069015503,
0.6296048760414124,
0.7716039419174194,
0.24037615954875946,
0.8537187576293945,
-1.267897605895996,
-1.1229078769683838,
-0.7512574195861816,
-0.6152413487434387,
1.8059313297271729,
-0.16779302060604095,
0.4277760088443756,
-0.15530180931091309,
-1.1847732067108154,
0.017527420073747635,
0.6870724558830261,
0.3202923536300659,
-0.15123164653778076,
0.755895733833313,
-0.7187252044677734,
-1.03712797164917,
-1.318901777267456,
-0.42184731364250183,
-0.9299286603927612,
-0.8742910623550415,
1.088543176651001,
0.7590557932853699,
0.38464993238449097,
1.911508321762085,
0.5835742354393005,
0.2769984006881714,
-2.5559165477752686,
0.8211567401885986,
0.32901865243911743,
0.03697579354047775,
0.9357202053070068,
0.3200632333755493,
1.2354753017425537,
0.050305530428886414,
0.4413118064403534,
-2.354201078414917,
2.1327195167541504,
-0.33106380701065063,
0.6733232736587524,
0.05818167328834534,
-0.09347240626811981,
1.045020341873169,
0.5670517683029175,
0.5279456377029419,
-1.0854666233062744,
0.734628438949585,
-0.5493794679641724,
1.0827529430389404,
0.911903440952301,
-0.9060876965522766,
0.05555292218923569,
1.3056550025939941,
0.4014885723590851,
-0.43509146571159363,
-0.938286304473877,
-0.7226291298866272,
0.9347702264785767,
1.674534559249878,
0.12111364305019379,
-0.04892507568001747,
0.8412222862243652,
0.6407146453857422,
-1.281282901763916,
0.03409744054079056,
-0.6162121891975403,
-0.7498073577880859,
1.7308974266052246,
2.1350061893463135,
-0.0636424571275711,
-0.07457494735717773,
-0.6842079758644104,
-1.2498204708099365,
0.7866678237915039,
-0.20191897451877594,
0.03593818470835686,
0.6275258660316467,
-0.7145766019821167,
1.086606502532959,
0.797268271446228,
0.9372462630271912,
0.05358761548995972,
0.1562979519367218,
0.3865572512149811,
-0.21620061993598938,
-1.1793227195739746,
-0.26799800992012024,
-1.050661325454712,
-2.641509771347046,
0.3521997928619385,
-0.3103708028793335,
-1.4283525943756104,
0.01560470461845398,
-0.9719038009643555,
0.8530548810958862,
-0.556013286113739,
-0.9950459599494934,
-1.3739798069000244,
0.31018325686454773,
-0.13415974378585815,
0.7971736788749695,
-1.64662504196167,
-0.22667011618614197,
1.3360517024993896,
0.8736176490783691,
-0.5981371402740479,
0.9685640931129456,
0.25875499844551086,
0.9857883453369141,
0.8577564358711243,
-0.3855357766151428,
0.5151689648628235,
0.204412043094635,
-1.3482811450958252,
0.40522047877311707,
1.3038218021392822,
0.17622432112693787,
1.4388351440429688,
-0.49673348665237427,
0.0006378553807735443,
0.40041276812553406,
-0.445445716381073,
-0.47173795104026794,
-0.5748974084854126,
0.6301304697990417,
0.20019707083702087,
-0.9270228147506714,
-0.08159290254116058,
-0.06452800333499908,
-0.2549903392791748,
0.2879619002342224,
-1.5650150775909424,
-0.23696818947792053,
-0.38235583901405334,
-0.5131850242614746,
-1.4008920192718506,
-0.018091022968292236,
1.3617968559265137,
-0.9364188313484192,
-0.17925326526165009,
0.5577344298362732,
0.39054641127586365,
0.5992870926856995,
0.7531771063804626,
-0.6992842555046082,
-0.23539124429225922,
-0.294453501701355,
-0.4032408595085144,
0.36817246675491333,
1.2370622158050537,
-0.1073155477643013,
-0.866188645362854,
0.5929821729660034,
-0.2603190541267395,
0.05871386080980301,
2.012699842453003,
0.11006057262420654,
-0.9201202988624573,
0.2582251727581024,
-0.7157884240150452,
1.9028732776641846,
1.6299784183502197,
1.2923719882965088,
-0.13869459927082062,
-0.878753125667572,
0.6424289345741272,
-0.2953732907772064,
-0.43609166145324707,
0.9309123158454895,
0.3779906630516052,
-0.25570932030677795,
-1.5121591091156006,
0.5521003603935242,
1.3742804527282715,
-0.8566431403160095,
-0.7220026254653931,
0.09145256131887436,
-0.9314567446708679,
1.077181339263916,
0.6348078846931458,
0.2795529365539551,
0.323236346244812,
1.486053466796875,
0.7145625948905945,
-0.599364697933197,
0.3171831965446472,
0.508566677570343,
-0.09249112755060196,
-2.111409902572632,
-0.9213252663612366,
0.3465290367603302,
-0.290518581867218,
-1.451373815536499,
1.3183703422546387,
-1.1958308219909668,
-0.9955518841743469,
0.5965697169303894,
0.11862994730472565,
1.2737679481506348,
0.28059911727905273,
1.745718240737915,
2.0371766090393066,
0.8303887844085693,
0.2989380657672882,
1.2798233032226562,
-0.12062588334083557,
-0.2655274569988251,
1.6850638389587402,
-0.46365728974342346,
0.5720357298851013,
1.041083812713623,
-0.36745190620422363,
-1.1313998699188232,
-0.7066949009895325,
-1.223318338394165,
-0.7016100883483887,
1.1167871952056885,
0.221171572804451,
-1.221203327178955,
0.2005603313446045,
1.626587152481079,
0.1019279956817627,
-0.19008468091487885,
0.5782015323638916,
0.5587717890739441,
-0.800649106502533,
-0.0269609484821558,
-1.0461184978485107,
0.5680292844772339,
-0.05483280122280121,
-0.2805277407169342,
0.2329576313495636,
0.5587769150733948,
1.2932424545288086,
0.051850151270627975,
0.18912385404109955,
1.1978235244750977,
-1.4749443531036377,
1.3314859867095947,
-0.735222578048706,
0.2627526521682739,
-2.44704532623291,
1.3900024890899658,
-0.7655006051063538,
1.9548680782318115,
-2.6510396003723145,
0.49152231216430664,
-0.5150867104530334,
-0.47689133882522583,
0.2823319137096405,
-0.26160773634910583,
0.12578104436397552,
-0.09451874345541,
-0.9980032444000244,
-0.22201472520828247,
-0.7949856519699097,
0.513444721698761,
1.164036750793457,
1.3661174774169922,
-0.9170072078704834,
-0.2903880476951599,
-1.6767911911010742,
-0.2471606731414795,
-0.6669653058052063,
0.17026101052761078,
-1.8466026782989502,
-0.06752225011587143,
-2.004058837890625,
-2.470715045928955,
-1.5342416763305664,
-0.843294084072113,
1.1826682090759277,
0.19913260638713837,
-0.9339269399642944,
1.1974236965179443,
-0.40144747495651245,
-1.7885456085205078,
1.0151631832122803,
-2.2021331787109375
] |
https://github.com/huggingface/datasets/issues/5137 | Align task tags in dataset metadata | @albertvillanova
Thank you for sharing our voice here!
Yes, we want `symbolic-regression` to be listed as a task. This task has been attracting attention from the machine learning/deep learning community, and unfortunately existing symbolic regression datasets are de-centralized in the community (hosted at individual platforms like author website, github, etc).
It would be great for the community if Hugging Face can support the task. | ## Describe
Once we have agreed on a common naming for task tags for all open source projects, we should align on them.
## Steps
- [x] Align task tags in canonical datasets
- [x] task_categories: 4 datasets
- [x] task_ids (by @lhoestq)
- [x] Open PRs in community datasets
- [x] task_categories: 451 datasets
- [x] task_ids: 556 datasets
| 467 | 64 | Align task tags in dataset metadata
## Describe
Once we have agreed on a common naming for task tags for all open source projects, we should align on them.
## Steps
- [x] Align task tags in canonical datasets
- [x] task_categories: 4 datasets
- [x] task_ids (by @lhoestq)
- [x] Open PRs in community datasets
- [x] task_categories: 451 datasets
- [x] task_ids: 556 datasets
@albertvillanova
Thank you for sharing our voice here!
Yes, we want `symbolic-regression` to be listed as a task. This task has been attracting attention from the machine learning/deep learning community, and unfortunately existing symbolic regression datasets are de-centralized in the community (hosted at individual platforms like author website, github, etc).
It would be great for the community if Hugging Face can support the task. | [
-1.325711965560913,
-0.9132120013237,
-0.8572994470596313,
1.4346624612808228,
-0.09854624420404434,
-1.290134072303772,
0.08452367037534714,
-1.1833277940750122,
1.8017864227294922,
-0.9850851893424988,
0.29853492975234985,
-1.7094632387161255,
0.05268317461013794,
-0.6583153009414673,
-0.7933762669563293,
-0.9736401438713074,
-0.3759276866912842,
-0.7589973211288452,
0.9921257495880127,
2.488255023956299,
1.068094253540039,
-1.3549251556396484,
2.866046190261841,
0.6649585962295532,
-0.27190032601356506,
-0.8644616603851318,
0.5654000043869019,
0.024063007906079292,
-1.287408471107483,
-0.424830824136734,
-1.0318913459777832,
-0.054530173540115356,
-0.5047758221626282,
-0.4712386727333069,
0.04986266791820526,
0.25526463985443115,
-0.1795365959405899,
-0.3730362355709076,
-0.39438629150390625,
-0.7819772958755493,
0.31111961603164673,
-0.2090359777212143,
0.9691905379295349,
-0.3734394907951355,
1.8142902851104736,
-0.576974093914032,
0.23291057348251343,
0.5844202041625977,
1.2840532064437866,
0.22508342564105988,
-0.1194179430603981,
0.18040160834789276,
0.30205434560775757,
-0.08849728107452393,
0.5369361639022827,
1.0710335969924927,
0.5816589593887329,
0.5980802774429321,
0.7549381256103516,
-2.2541558742523193,
1.346791386604309,
-1.0996991395950317,
0.34572461247444153,
1.554211139678955,
-1.0234410762786865,
0.40344998240470886,
-1.7570717334747314,
-0.17564833164215088,
0.5138517618179321,
-2.3865041732788086,
0.11839193105697632,
-1.2065491676330566,
-0.5408411622047424,
0.9428920149803162,
0.32027244567871094,
-1.3555675745010376,
0.14931705594062805,
-0.422634094953537,
1.0423715114593506,
0.46202799677848816,
1.1748046875,
-1.6854267120361328,
0.13957472145557404,
-0.31873849034309387,
0.04230496287345886,
-1.3110077381134033,
-1.4835319519042969,
0.6548393964767456,
0.5441043376922607,
0.5836406350135803,
-0.04025132954120636,
0.8776207566261292,
-0.9973100423812866,
0.8844623565673828,
-0.9345164895057678,
-1.6923710107803345,
-1.3882787227630615,
-2.390279531478882,
-2.409867286682129,
0.788737952709198,
-0.47247135639190674,
-0.4839927554130554,
2.070636034011841,
-1.1078394651412964,
-1.7655394077301025,
1.1882615089416504,
0.24778765439987183,
0.021659892052412033,
2.4853854179382324,
0.2676179111003876,
-0.6966180801391602,
0.4770425260066986,
-0.7191573977470398,
0.7365842461585999,
-0.3699481189250946,
1.3645718097686768,
0.44373124837875366,
-1.0506596565246582,
1.5780097246170044,
-0.3854871988296509,
0.5106571316719055,
-0.6178953051567078,
-0.5321049094200134,
-0.8463423252105713,
0.38830456137657166,
1.8421931266784668,
-0.2513778805732727,
1.499708890914917,
-0.3494946360588074,
-1.447532057762146,
-1.5208251476287842,
0.8217306733131409,
0.6301876902580261,
-0.8006085157394409,
0.17178358137607574,
-0.33914297819137573,
0.02948846109211445,
0.02515164203941822,
1.234819769859314,
1.179622769355774,
0.6371309161186218,
-0.2492600679397583,
-0.8066579103469849,
0.30486544966697693,
-0.012205088511109352,
-0.7181143760681152,
-1.8186978101730347,
-0.30147242546081543,
0.1970437616109848,
0.7304393649101257,
-1.2494714260101318,
1.6400409936904907,
0.9058873057365417,
1.9056452512741089,
1.0305713415145874,
-0.24217915534973145,
1.5166864395141602,
0.037462107837200165,
1.7835559844970703,
-0.4056738615036011,
0.6994995474815369,
-0.3764645457267761,
-1.252594232559204,
0.9466485977172852,
-0.4501822292804718,
-1.9879841804504395,
-0.795017659664154,
-0.9391140937805176,
-0.19437041878700256,
-0.8708809614181519,
1.0206137895584106,
-0.37216639518737793,
-1.4243086576461792,
0.2677006721496582,
-0.646148681640625,
0.2610319256782532,
-1.2735666036605835,
0.2665899097919464,
0.7633541226387024,
-0.6281989812850952,
0.01216149516403675,
-0.1746811866760254,
-1.3677070140838623,
-0.5101603269577026,
0.24716711044311523,
1.8366353511810303,
-0.7899457812309265,
0.8961119651794434,
0.9911149740219116,
-0.5707309246063232,
-0.07033181935548782,
0.4091312289237976,
-0.23675735294818878,
0.92573481798172,
-1.0060511827468872,
-0.4694240093231201,
1.1884874105453491,
-0.16772110760211945,
-0.5744169354438782,
1.5431028604507446,
0.6777969002723694,
-1.0086939334869385,
-0.2520618438720703,
-0.19117175042629242,
-0.8299511075019836,
-0.07737138122320175,
-1.5961699485778809,
-0.24057580530643463,
0.36573392152786255,
-1.5992262363433838,
-0.3975861668586731,
-0.1458650678396225,
1.3370317220687866,
-0.25122687220573425,
1.4253000020980835,
-0.3151458203792572,
-0.23869913816452026,
-0.33259904384613037,
-0.376086562871933,
0.22104667127132416,
-0.11792320758104324,
-0.639017641544342,
0.4042322635650635,
-0.7668499946594238,
0.33636707067489624,
1.477065920829773,
0.37004444003105164,
0.14101700484752655,
0.5361324548721313,
1.0244234800338745,
0.29318997263908386,
-0.17375241219997406,
-0.8940355181694031,
-1.6794098615646362,
2.161675214767456,
-1.557919979095459,
1.9845455884933472,
0.7452834844589233,
-0.06810898333787918,
-1.7754393815994263,
-1.8060328960418701,
1.4985767602920532,
1.1873968839645386,
2.2540321350097656,
0.5913397669792175,
0.34285056591033936,
-0.8069807887077332,
-0.6147074103355408,
0.3011038899421692,
-1.010872483253479,
-0.7400485277175903,
0.1472463458776474,
2.3021371364593506,
1.74503493309021,
-0.3922167718410492,
-0.11177506297826767,
-0.8849597573280334,
1.298449993133545,
-0.2781897485256195,
0.16431495547294617,
1.9750124216079712,
-0.5247641205787659,
-1.1951475143432617,
1.231796145439148,
-2.37270188331604,
0.05509219318628311,
1.9768145084381104,
0.3274759352207184,
-0.03302455693483353,
-1.4045017957687378,
-0.6746163368225098,
-0.289541631937027,
-0.31719347834587097,
-1.3020970821380615,
0.6032493114471436,
-0.28214675188064575,
-0.848960816860199,
-1.5076647996902466,
0.1563827246427536,
-1.170165777206421,
-1.6244666576385498,
0.42203593254089355,
1.7729731798171997,
2.2032711505889893,
-0.7204446792602539,
1.494089961051941,
-0.29869234561920166,
0.3233706057071686,
1.2086985111236572,
1.1079497337341309,
3.125486373901367,
1.8545866012573242,
-1.3114851713180542,
0.6300970315933228,
-0.038863327354192734,
-0.515424370765686,
1.154727816581726,
-0.9729087948799133,
1.3525310754776,
-0.08511222153902054,
-1.3054901361465454,
-1.3730754852294922,
0.9277492165565491,
0.450996071100235,
0.04032879322767258,
-0.6207273602485657,
1.2876551151275635,
0.002657279372215271,
1.2485219240188599,
0.45009103417396545,
-0.3482356071472168,
0.4882700741291046,
-0.437343031167984,
-0.47862178087234497,
1.5600463151931763,
0.10336975753307343,
-1.48227858543396,
-2.247277021408081,
-0.2645186185836792,
-0.8020760416984558,
-0.08580741286277771,
-0.5925295948982239,
-1.0549284219741821,
1.5821256637573242,
0.4952957332134247,
-1.1790988445281982,
-0.2832326591014862,
-0.32026758790016174,
-0.5900373458862305,
2.6345088481903076,
-1.398732304573059,
-0.12578020989894867,
-0.929330587387085,
-0.5123363137245178,
1.6447511911392212,
-1.2191669940948486,
-0.16742399334907532,
-1.018134593963623,
-0.6159981489181519,
-1.3505871295928955,
-0.5837243795394897,
-0.039472028613090515,
-1.0286093950271606,
0.7459798455238342,
0.09861839562654495,
-1.1497821807861328,
-0.39690065383911133,
-0.7711895704269409,
0.9069257378578186,
-0.13641993701457977,
0.3137494921684265,
1.9200226068496704,
0.3528478145599365,
-0.41445448994636536,
0.6799364686012268,
1.2250691652297974,
0.8132823705673218,
-0.6642659902572632,
0.1066376119852066,
-0.6658424139022827,
0.39462143182754517,
-1.3081183433532715,
0.3120291531085968,
-2.998556613922119,
0.6208739876747131,
-0.038700103759765625,
-0.0597991943359375,
0.032901860773563385,
-1.240891695022583,
1.1280624866485596,
2.536339521408081,
-1.157110571861267,
0.40805113315582275,
0.3563551604747772,
1.1641979217529297,
-1.5013089179992676,
0.25116682052612305,
-0.4468768835067749,
2.1387789249420166,
0.11421141028404236,
1.1876927614212036,
-0.47706255316734314,
-2.1289970874786377,
0.6492247581481934,
-1.3209761381149292,
-1.160770058631897,
0.8299262523651123,
-0.8270463943481445,
0.08849909901618958,
-1.4424524307250977,
-0.09017865359783173,
-0.8717378973960876,
-1.1954373121261597,
0.666001558303833,
0.1734791249036789,
0.5163806080818176,
-0.6365770697593689,
0.418678879737854,
-2.1438677310943604,
-1.3805233240127563,
-0.08375655114650726,
-0.9627295732498169,
0.3403255045413971,
-0.37628740072250366,
0.6924889087677002,
-0.15551446378231049,
0.07697928696870804,
0.39304637908935547,
1.4698222875595093,
3.349693536758423,
0.2126958817243576,
0.5243580937385559,
-0.1697680950164795,
-0.946845531463623,
1.4994468688964844,
1.0775381326675415,
-0.1325502246618271,
-0.4744108319282532,
-0.9722131490707397,
1.3683075904846191,
1.8829224109649658,
0.9283836483955383,
0.055232055485248566,
-0.7587137818336487,
-0.6916849613189697,
0.01378927193582058,
0.25950178503990173,
0.47900447249412537,
0.8447534441947937,
-0.05000125616788864,
0.06639398634433746,
1.4363397359848022,
1.112138271331787,
-0.5082439184188843,
0.48053157329559326,
-0.8425942659378052,
-0.4916989207267761,
0.5232284665107727,
0.34809163212776184,
-0.08954032510519028,
0.4557032287120819,
-0.901387095451355,
-0.2769027054309845,
-0.24323029816150665,
-0.9188469052314758,
-0.6479118466377258,
-0.27253028750419617,
-0.42589032649993896,
1.5971475839614868,
0.025188354775309563,
-0.4890552759170532,
-0.0029061688110232353,
-0.8880350589752197,
-0.18644633889198303,
-1.087233304977417,
0.27786603569984436,
-0.14080362021923065,
-0.14615614712238312,
-0.19849595427513123,
1.8447139263153076,
-1.0226585865020752,
-2.040908098220825,
0.13550372421741486,
0.19773834943771362,
-0.35452666878700256,
0.164211243391037,
1.6785329580307007,
0.48783132433891296,
1.5079545974731445,
1.3080387115478516,
0.9197508096694946,
-0.6375476717948914,
-1.3200902938842773,
0.69439297914505,
0.9638618230819702,
-1.418304443359375,
0.8829399943351746,
-0.12750457227230072,
-0.513920783996582,
0.7935861349105835,
1.3074193000793457,
0.3973180949687958,
-1.871121883392334,
0.8770351409912109,
-1.0077792406082153,
0.7502292394638062,
0.7714552879333496,
0.837421178817749,
0.17196863889694214,
0.8546881675720215,
-1.1637362241744995,
-1.1369317770004272,
-0.8187788128852844,
-0.6108115911483765,
1.9051234722137451,
-0.2365269660949707,
0.44830644130706787,
-0.19312945008277893,
-1.1869761943817139,
0.0158107690513134,
0.6055358648300171,
0.32113122940063477,
-0.1460898071527481,
0.713466227054596,
-0.7725632190704346,
-1.1260086297988892,
-1.4165267944335938,
-0.445597380399704,
-0.9398807883262634,
-0.9775088429450989,
1.085922122001648,
0.8532524704933167,
0.31453830003738403,
1.8619369268417358,
0.5790429711341858,
0.20965532958507538,
-2.502837657928467,
0.7477666735649109,
0.36730900406837463,
-0.012425726279616356,
0.8893329501152039,
0.319724440574646,
1.2181059122085571,
0.05126394331455231,
0.40219831466674805,
-2.2767488956451416,
2.2448573112487793,
-0.17072303593158722,
0.7061068415641785,
-0.015974819660186768,
-0.03805984556674957,
1.0475502014160156,
0.6224560141563416,
0.5349026918411255,
-1.1041573286056519,
0.7189062237739563,
-0.5296289920806885,
1.2666006088256836,
0.9564710855484009,
-0.8569254875183105,
-0.0636659488081932,
1.3403871059417725,
0.5170888900756836,
-0.45943740010261536,
-0.8837592005729675,
-0.8988111615180969,
0.944212019443512,
1.6869397163391113,
0.027425171807408333,
-0.029560215771198273,
0.7908536791801453,
0.6863318681716919,
-1.260219693183899,
0.013154322281479836,
-0.644873857498169,
-0.8046055436134338,
1.6028594970703125,
2.0583996772766113,
-0.0791991576552391,
-0.02002018690109253,
-0.75274258852005,
-1.2351421117782593,
0.7952961325645447,
-0.15260465443134308,
0.06104481965303421,
0.6409346461296082,
-0.6522606611251831,
1.084886908531189,
1.0456703901290894,
0.7655975222587585,
0.1996700018644333,
0.3574686646461487,
0.278404176235199,
-0.11520518362522125,
-1.1573964357376099,
-0.1963980793952942,
-1.022754430770874,
-2.638887405395508,
0.3604055941104889,
-0.41783207654953003,
-1.3896085023880005,
0.05718693882226944,
-1.0021780729293823,
0.8393152356147766,
-0.6358848214149475,
-1.0421828031539917,
-1.528845191001892,
0.22928492724895477,
-0.023177970200777054,
0.9000656604766846,
-1.486180067062378,
-0.06357384473085403,
1.3222397565841675,
0.8941140174865723,
-0.6433671712875366,
1.00739586353302,
0.2229674905538559,
1.042848825454712,
0.7955703735351562,
-0.3553844094276428,
0.5114639401435852,
0.12361398339271545,
-1.3637765645980835,
0.43045493960380554,
1.2475095987319946,
0.12192614376544952,
1.435628890991211,
-0.5289378762245178,
-0.044407472014427185,
0.4385918080806732,
-0.43202531337738037,
-0.3661099076271057,
-0.6822845339775085,
0.7151271104812622,
0.16304151713848114,
-0.7085365653038025,
0.02853270061314106,
-0.10406212508678436,
-0.390544056892395,
0.25604215264320374,
-1.574325680732727,
-0.31518837809562683,
-0.4386002719402313,
-0.634981095790863,
-1.388683795928955,
-0.03001389466226101,
1.375610589981079,
-0.8857704401016235,
-0.20433904230594635,
0.5259470343589783,
0.4369191825389862,
0.4489016830921173,
0.8108415603637695,
-0.6867340803146362,
-0.29123812913894653,
-0.3663114905357361,
-0.370705246925354,
0.2946733236312866,
1.2793811559677124,
-0.15377789735794067,
-0.978672206401825,
0.6137955188751221,
-0.2621760666370392,
-0.10688355565071106,
2.0169637203216553,
0.08850444853305817,
-0.949203372001648,
0.31312069296836853,
-0.7110524773597717,
2.067953586578369,
1.5663131475448608,
1.2456014156341553,
-0.12204515188932419,
-0.9693868160247803,
0.7550369501113892,
-0.25179848074913025,
-0.2983047366142273,
0.9524391293525696,
0.4020553231239319,
-0.18889227509498596,
-1.488235592842102,
0.5900994539260864,
1.3132933378219604,
-0.8689879775047302,
-0.8071699142456055,
0.10928014665842056,
-0.7880499362945557,
1.0052461624145508,
0.7773014903068542,
0.36915645003318787,
0.29060593247413635,
1.6523175239562988,
0.7630798816680908,
-0.6086286306381226,
0.2671862840652466,
0.5833967924118042,
0.0012538153678178787,
-2.0849266052246094,
-0.9606872200965881,
0.2637243866920471,
-0.3837531507015228,
-1.417230248451233,
1.3032047748565674,
-1.1043490171432495,
-0.9307816028594971,
0.5974558591842651,
0.08018798381090164,
1.3338167667388916,
0.23988039791584015,
1.6459176540374756,
2.0079009532928467,
0.8720393776893616,
0.22068318724632263,
1.3796051740646362,
-0.19669249653816223,
-0.2780391275882721,
1.8031071424484253,
-0.4588509500026703,
0.5294824838638306,
1.1341813802719116,
-0.47153449058532715,
-0.9998298287391663,
-0.7665832042694092,
-1.1214560270309448,
-0.5913267731666565,
1.0602333545684814,
0.2214355319738388,
-1.236556053161621,
0.20374290645122528,
1.4446330070495605,
0.17335306107997894,
-0.2330453097820282,
0.5161392688751221,
0.4565816819667816,
-0.7117289900779724,
-0.1239810436964035,
-1.0413033962249756,
0.5665807723999023,
-0.23004719614982605,
-0.29362213611602783,
0.42222005128860474,
0.49592188000679016,
1.2491884231567383,
0.005468178540468216,
0.12168428301811218,
1.2134597301483154,
-1.4770276546478271,
1.2596158981323242,
-0.7495265007019043,
0.2652244567871094,
-2.4144256114959717,
1.3855117559432983,
-0.797783374786377,
1.9158929586410522,
-2.7815728187561035,
0.44540295004844666,
-0.6338220238685608,
-0.4990869164466858,
0.326058566570282,
-0.28084102272987366,
0.1871911734342575,
-0.1810562163591385,
-1.0678484439849854,
-0.14171727001667023,
-0.790559709072113,
0.6033536195755005,
1.1762924194335938,
1.2823138236999512,
-0.9916784167289734,
-0.34851229190826416,
-1.5740947723388672,
-0.2669949531555176,
-0.6413148641586304,
0.18133202195167542,
-1.954495906829834,
-0.05279574543237686,
-1.9204224348068237,
-2.4285671710968018,
-1.4046318531036377,
-0.7237268090248108,
1.215232014656067,
0.151178777217865,
-0.8243182301521301,
1.2186185121536255,
-0.3936775028705597,
-1.7535024881362915,
1.0141383409500122,
-2.1451187133789062
] |
https://github.com/huggingface/datasets/issues/5134 | Raise ImportError instead of OSError if required extraction library is not installed | hey @mariosasko , i made a pr for this issue. Could you please review it.
Also i found multiple `OSError` in `extract.py` file which i thought could be replaced too but wasn't sure about them.
Please do tell if that also needs to be done. | According to the official Python docs, `OSError` should be thrown in the following situations:
> This exception is raised when a system function returns a system-related error, including I/O failures such as “file not found” or “disk full” (not for illegal argument types or other incidental errors).
Hence, it makes more sense to raise `ImportError` instead of `OSError` when the required extraction/decompression library is not installed. | 468 | 45 | Raise ImportError instead of OSError if required extraction library is not installed
According to the official Python docs, `OSError` should be thrown in the following situations:
> This exception is raised when a system function returns a system-related error, including I/O failures such as “file not found” or “disk full” (not for illegal argument types or other incidental errors).
Hence, it makes more sense to raise `ImportError` instead of `OSError` when the required extraction/decompression library is not installed.
hey @mariosasko , i made a pr for this issue. Could you please review it.
Also i found multiple `OSError` in `extract.py` file which i thought could be replaced too but wasn't sure about them.
Please do tell if that also needs to be done. | [
-1.1586605310440063,
-0.8614652752876282,
-0.80323326587677,
1.5350009202957153,
-0.21551471948623657,
-1.2452843189239502,
0.0990568995475769,
-1.1168522834777832,
1.7061939239501953,
-0.845525860786438,
0.44679760932922363,
-1.6096185445785522,
0.0905766487121582,
-0.6702711582183838,
-0.776654064655304,
-0.6547955274581909,
-0.33039724826812744,
-0.8615292906761169,
1.0132850408554077,
2.569270372390747,
1.2349845170974731,
-1.488489031791687,
2.7810583114624023,
0.5696198344230652,
-0.17028094828128815,
-1.1412092447280884,
0.5060926079750061,
-0.08072376996278763,
-1.11879301071167,
-0.470539927482605,
-0.9758926630020142,
0.009104380384087563,
-0.44417667388916016,
-0.5423370003700256,
0.06540091335773468,
0.30941158533096313,
-0.22435049712657928,
-0.38916927576065063,
-0.5468780398368835,
-0.8709000945091248,
0.4753432273864746,
-0.3170141577720642,
1.0051276683807373,
-0.3642316162586212,
1.765904188156128,
-0.4846210777759552,
0.3484814763069153,
0.7760030627250671,
1.5046416521072388,
0.25602734088897705,
-0.11130524426698685,
0.3786979615688324,
0.344380259513855,
0.008068809285759926,
0.45822033286094666,
0.9083189964294434,
0.5982545018196106,
0.579656183719635,
0.7007538080215454,
-2.1194162368774414,
1.2514654397964478,
-1.1234312057495117,
0.08008754998445511,
1.277464747428894,
-1.019382357597351,
0.39799657464027405,
-1.8768260478973389,
-0.014386778697371483,
0.5212873220443726,
-2.278275489807129,
0.17601780593395233,
-1.202595591545105,
-0.44748976826667786,
1.028908371925354,
0.2094254046678543,
-1.41160249710083,
0.0799548327922821,
-0.4107917249202728,
0.9328993558883667,
0.45102840662002563,
1.0902814865112305,
-1.7458610534667969,
0.08881875872612,
-0.338714599609375,
0.1797754466533661,
-1.344762921333313,
-1.4064643383026123,
0.5326960682868958,
0.7160391211509705,
0.5520787239074707,
-0.07247673720121384,
1.0484215021133423,
-0.8811137676239014,
0.8334493041038513,
-1.0633858442306519,
-1.6911051273345947,
-1.3073240518569946,
-2.1692960262298584,
-2.1365175247192383,
0.8500531315803528,
-0.5031088590621948,
-0.5588967800140381,
2.022127389907837,
-0.9921598434448242,
-1.8040175437927246,
1.1614519357681274,
0.2509959638118744,
-0.02340129017829895,
2.4646308422088623,
0.21646720170974731,
-0.7031874060630798,
0.3998852074146271,
-0.6960842609405518,
0.818867564201355,
-0.4087834358215332,
1.380110263824463,
0.510784387588501,
-1.0845228433609009,
1.7949146032333374,
-0.27148979902267456,
0.48169711232185364,
-0.6499966382980347,
-0.4904916286468506,
-0.8239273428916931,
0.46285223960876465,
1.9754600524902344,
-0.32430529594421387,
1.5349454879760742,
-0.4776986837387085,
-1.5688176155090332,
-1.6621326208114624,
0.8620229959487915,
0.45418253540992737,
-0.8586325645446777,
0.06759210675954819,
-0.40405532717704773,
0.17651143670082092,
0.018922856077551842,
1.0511671304702759,
1.2788668870925903,
0.73280930519104,
-0.05715236812829971,
-0.8993071913719177,
0.22882913053035736,
0.07622078061103821,
-0.7215494513511658,
-1.8795058727264404,
-0.4070589244365692,
0.1154281422495842,
0.7245376110076904,
-1.1070621013641357,
1.7079811096191406,
0.9690794944763184,
1.8560899496078491,
1.0984166860580444,
-0.2049141228199005,
1.537168264389038,
-0.0046901945024728775,
1.824652910232544,
-0.40143799781799316,
0.6163206696510315,
-0.23247820138931274,
-1.1262820959091187,
0.7414374351501465,
-0.3210284411907196,
-1.976836085319519,
-0.6379388570785522,
-0.8213555216789246,
-0.21424448490142822,
-0.7622345089912415,
0.9545559883117676,
-0.3176361620426178,
-1.2621341943740845,
0.3030172288417816,
-0.7161104679107666,
0.06908304244279861,
-1.1863378286361694,
0.35491743683815,
0.6769047975540161,
-0.7047041654586792,
0.23506176471710205,
-0.36632204055786133,
-1.2661973237991333,
-0.6542948484420776,
0.3358827233314514,
2.013862133026123,
-0.8595492839813232,
0.8933613896369934,
1.0362884998321533,
-0.825530469417572,
-0.16045193374156952,
0.40957966446876526,
-0.35157543420791626,
0.7240793704986572,
-1.0305465459823608,
-0.4274708032608032,
1.190346121788025,
-0.23350271582603455,
-0.5624242424964905,
1.4823718070983887,
0.8006892204284668,
-1.0383806228637695,
-0.127951979637146,
-0.3124969005584717,
-0.873214066028595,
0.05062730610370636,
-1.752553939819336,
-0.28412318229675293,
0.17546817660331726,
-1.5401339530944824,
-0.4671195447444916,
-0.14575622975826263,
1.351081132888794,
-0.13721780478954315,
1.3560078144073486,
-0.3710516393184662,
-0.3238556981086731,
-0.27270224690437317,
-0.391740620136261,
0.0590800940990448,
-0.11179126799106598,
-0.5865423679351807,
0.19012732803821564,
-0.8140026926994324,
0.47518548369407654,
1.4435935020446777,
0.34302908182144165,
0.05634533613920212,
0.504586398601532,
0.9617917537689209,
0.4025995135307312,
0.1041783019900322,
-0.8838558793067932,
-1.5113825798034668,
2.037465810775757,
-1.45681893825531,
2.0803685188293457,
0.7538415193557739,
-0.09047728031873703,
-1.7317229509353638,
-1.7773112058639526,
1.472852349281311,
1.2665696144104004,
2.3046481609344482,
0.6717271208763123,
0.23352570831775665,
-0.7699756026268005,
-0.5592247247695923,
0.36835289001464844,
-1.0611960887908936,
-0.8458318710327148,
0.09244564920663834,
2.4308815002441406,
1.6929543018341064,
-0.5370185375213623,
-0.12503176927566528,
-1.000110387802124,
1.2022285461425781,
-0.07445614784955978,
0.18358877301216125,
1.973312497138977,
-0.299070805311203,
-1.1820014715194702,
1.2327085733413696,
-2.4010000228881836,
0.16948942840099335,
2.039219856262207,
0.2809419631958008,
0.07993335276842117,
-1.463636040687561,
-0.5549229383468628,
-0.19501769542694092,
-0.3060925006866455,
-1.2494940757751465,
0.658645510673523,
-0.3031269907951355,
-0.8222731947898865,
-1.4794672727584839,
0.21560652554035187,
-1.0749211311340332,
-1.6524243354797363,
0.41443413496017456,
1.941598653793335,
2.0015876293182373,
-0.6714540719985962,
1.6059179306030273,
-0.27607572078704834,
0.17429915070533752,
1.337445616722107,
1.2536848783493042,
3.103661298751831,
1.8051903247833252,
-1.158473253250122,
0.6213312745094299,
-0.15208622813224792,
-0.532791018486023,
1.136136531829834,
-1.1113612651824951,
1.2191188335418701,
-0.20722579956054688,
-1.1853514909744263,
-1.2473782300949097,
0.7498849630355835,
0.4426078498363495,
0.01073504239320755,
-0.40553992986679077,
1.2062532901763916,
0.19922637939453125,
1.2030344009399414,
0.49613597989082336,
-0.28231149911880493,
0.6837201714515686,
-0.3050071895122528,
-0.4580599367618561,
1.5676279067993164,
0.27253642678260803,
-1.5575023889541626,
-2.3263020515441895,
-0.09284677356481552,
-0.8046922087669373,
0.08151091635227203,
-0.5625162720680237,
-0.9981490969657898,
1.6808112859725952,
0.27352195978164673,
-1.2999762296676636,
-0.28378114104270935,
-0.4394247531890869,
-0.5099551677703857,
2.617760419845581,
-1.3283038139343262,
-0.38794082403182983,
-0.9249681234359741,
-0.5177174210548401,
1.7083704471588135,
-1.3493833541870117,
-0.17603370547294617,
-0.9169098734855652,
-0.5642300248146057,
-1.3801438808441162,
-0.5649995803833008,
0.011324137449264526,
-0.834539532661438,
0.7239437103271484,
0.2053152173757553,
-1.0599949359893799,
-0.3657503128051758,
-0.8654977083206177,
0.7104015946388245,
-0.2531674802303314,
0.3625420331954956,
1.9572190046310425,
0.4653264284133911,
-0.36379650235176086,
0.7837344408035278,
1.0946749448776245,
0.5872617959976196,
-0.4160385727882385,
0.3474138081073761,
-0.5644453763961792,
0.3055780529975891,
-1.305703043937683,
0.2542508840560913,
-3.0167014598846436,
0.5988582372665405,
-0.0077882627956569195,
-0.04737073928117752,
-0.10992121696472168,
-1.3140497207641602,
1.1616657972335815,
2.7053065299987793,
-1.1873083114624023,
0.4221728444099426,
0.2769728899002075,
1.1894675493240356,
-1.467249870300293,
0.3045317232608795,
-0.2655056416988373,
2.2140026092529297,
0.18833720684051514,
1.1599552631378174,
-0.5234370827674866,
-2.2920289039611816,
0.72185879945755,
-1.2086583375930786,
-1.1463794708251953,
0.6472144722938538,
-0.7040232419967651,
-0.10428009182214737,
-1.397384762763977,
-0.1167432889342308,
-0.8293371200561523,
-1.1942473649978638,
0.9292507767677307,
0.1656707227230072,
0.4309954345226288,
-0.5485644340515137,
0.30686187744140625,
-2.0729081630706787,
-1.4557373523712158,
-0.23415382206439972,
-1.0862746238708496,
0.46322348713874817,
-0.34015700221061707,
0.5921905636787415,
-0.2192208468914032,
-0.002572337631136179,
0.37483227252960205,
1.4688371419906616,
3.3930935859680176,
0.3148530423641205,
0.5036583542823792,
-0.2630644738674164,
-0.888247013092041,
1.5675379037857056,
0.8212286829948425,
-0.009625277481973171,
-0.512909471988678,
-1.0271199941635132,
1.1740671396255493,
2.0327789783477783,
0.9236896634101868,
0.10783229023218155,
-0.8570114970207214,
-0.7310322523117065,
-0.06430121511220932,
0.18957243859767914,
0.5713158845901489,
1.0108213424682617,
0.017826750874519348,
-0.07232103496789932,
1.2976971864700317,
1.2426022291183472,
-0.6545549035072327,
0.5079803466796875,
-0.8210121989250183,
-0.3632047772407532,
0.4865853488445282,
0.24578796327114105,
-0.022400155663490295,
0.3665478229522705,
-0.756976842880249,
-0.20391599833965302,
-0.20720119774341583,
-1.0023821592330933,
-0.717402994632721,
-0.4775090217590332,
-0.2576299011707306,
1.6230995655059814,
0.10528869181871414,
-0.48537200689315796,
-0.05001508444547653,
-0.8524925708770752,
-0.046028345823287964,
-0.8920232057571411,
0.15020392835140228,
-0.019080430269241333,
-0.21691925823688507,
-0.09773804247379303,
1.767098307609558,
-0.952515721321106,
-2.1719865798950195,
0.32567158341407776,
0.266517698764801,
-0.3888486921787262,
0.32130739092826843,
1.62528657913208,
0.5052230954170227,
1.4246034622192383,
1.5012987852096558,
0.9895346760749817,
-0.6657271981239319,
-1.2840884923934937,
0.6985505223274231,
0.7979801297187805,
-1.4470722675323486,
0.8345233201980591,
-0.009099677205085754,
-0.4155758321285248,
0.6984912157058716,
1.244271993637085,
0.5843784213066101,
-1.958449125289917,
0.6799737215042114,
-0.853428065776825,
0.8498332500457764,
0.7525895237922668,
0.7331478595733643,
0.281517893075943,
0.7687994837760925,
-1.1147407293319702,
-1.1845736503601074,
-0.7467175126075745,
-0.8052732348442078,
1.9057978391647339,
-0.2267289161682129,
0.5716580152511597,
-0.019960496574640274,
-1.3998582363128662,
-0.22723281383514404,
0.6567554473876953,
0.3092763125896454,
-0.468506783246994,
0.7326016426086426,
-0.8180666565895081,
-1.1331486701965332,
-1.482919454574585,
-0.593068540096283,
-0.9617101550102234,
-1.0292032957077026,
1.0158774852752686,
0.7584463357925415,
0.21742889285087585,
1.9047985076904297,
0.5656644701957703,
0.1940021514892578,
-2.619641065597534,
0.957108199596405,
0.3486666679382324,
-0.02788948453962803,
0.9038487672805786,
0.3473885655403137,
0.8722773790359497,
-0.04151884466409683,
0.5530453324317932,
-2.3302783966064453,
2.3930070400238037,
-0.2787173390388489,
0.7439391613006592,
0.07337513566017151,
-0.2976277470588684,
1.0600578784942627,
0.4948415458202362,
0.5711997151374817,
-1.2209532260894775,
0.7764479517936707,
-0.6588627099990845,
1.2645524740219116,
0.8932669162750244,
-0.7911092638969421,
-0.05439044535160065,
1.2067760229110718,
0.4960916340351105,
-0.5887772440910339,
-0.8264927864074707,
-0.9722129106521606,
0.9163463711738586,
1.6987178325653076,
-0.1418449878692627,
-0.03089050203561783,
0.7258602380752563,
0.6039671301841736,
-1.2736985683441162,
-0.028171956539154053,
-0.815133273601532,
-0.864662230014801,
1.615693211555481,
1.9889687299728394,
-0.11219358444213867,
-0.27560755610466003,
-0.738741934299469,
-1.1879760026931763,
0.8471041917800903,
0.08762110769748688,
0.021474814042448997,
0.5579288005828857,
-0.625093400478363,
1.271070122718811,
0.9678851366043091,
0.9463873505592346,
0.16952303051948547,
0.3741757571697235,
0.2942276895046234,
-0.27485743165016174,
-1.150722622871399,
-0.37940430641174316,
-1.253370761871338,
-2.568911552429199,
0.4613015055656433,
-0.30667221546173096,
-1.4049745798110962,
-0.013116177171468735,
-1.0001405477523804,
0.7379242777824402,
-0.5580780506134033,
-0.9196398854255676,
-1.448995590209961,
0.11568019539117813,
-0.16652432084083557,
0.8556879758834839,
-1.703430414199829,
-0.02562648244202137,
1.3170298337936401,
0.8710012435913086,
-0.8099052906036377,
0.8947652578353882,
0.23713330924510956,
1.1105924844741821,
0.9297863245010376,
-0.38736453652381897,
0.4926188290119171,
0.05295639485120773,
-1.323472499847412,
0.3921617865562439,
1.078487515449524,
0.1311052441596985,
1.5299493074417114,
-0.3859806954860687,
0.06172206252813339,
0.38710832595825195,
-0.5588856935501099,
-0.49460265040397644,
-0.7258687615394592,
0.6965723633766174,
-0.036974452435970306,
-0.9089255332946777,
0.10283804684877396,
0.007984520867466927,
-0.16717161238193512,
0.15819309651851654,
-1.7262941598892212,
-0.1961621344089508,
-0.3397749662399292,
-0.42876240611076355,
-1.2921922206878662,
-0.16742555797100067,
1.432103157043457,
-0.6237683892250061,
-0.24508117139339447,
0.3844502866268158,
0.4063042104244232,
0.47450900077819824,
0.6024190783500671,
-0.7085535526275635,
-0.5560712218284607,
-0.2403247356414795,
-0.34323251247406006,
0.44193580746650696,
1.2154991626739502,
-0.12661400437355042,
-0.9718815684318542,
0.7439138889312744,
-0.3316069543361664,
0.022534267976880074,
1.8189313411712646,
-0.02607932686805725,
-0.821450412273407,
0.2746270000934601,
-0.7361577749252319,
2.0334339141845703,
1.6869350671768188,
1.2172671556472778,
-0.05003521591424942,
-0.9676551818847656,
0.8341462016105652,
-0.3649367094039917,
-0.282671183347702,
0.8940158486366272,
0.44438618421554565,
-0.24409344792366028,
-1.3520936965942383,
0.6065667271614075,
1.2795065641403198,
-0.7448418736457825,
-0.8637279868125916,
-0.1579355150461197,
-0.7192593812942505,
0.9828439354896545,
0.8048800826072693,
0.33797094225883484,
0.2935663163661957,
1.650372862815857,
0.6368563771247864,
-0.41117388010025024,
0.5259585976600647,
0.3830786943435669,
-0.14720465242862701,
-2.116959810256958,
-1.22367525100708,
0.3039112389087677,
-0.3158300518989563,
-1.5885636806488037,
1.4489574432373047,
-1.151953101158142,
-0.857573390007019,
0.5291266441345215,
0.07046569138765335,
1.5062148571014404,
0.3702489137649536,
1.5028127431869507,
1.9555845260620117,
0.9416649341583252,
0.3896481394767761,
1.3500466346740723,
-0.26322609186172485,
-0.490964412689209,
1.7978901863098145,
-0.4626123309135437,
0.3524884879589081,
1.0273423194885254,
-0.25600406527519226,
-1.0124011039733887,
-0.8769741654396057,
-1.243068814277649,
-0.7756922245025635,
1.2737442255020142,
0.09069285541772842,
-1.3089646100997925,
0.3033704459667206,
1.6099357604980469,
0.12447256594896317,
-0.2832787334918976,
0.47692903876304626,
0.509219229221344,
-0.81474369764328,
-0.07195435464382172,
-0.8828460574150085,
0.5826870203018188,
-0.3127409815788269,
-0.4793110191822052,
0.4504658579826355,
0.4280564486980438,
1.2171183824539185,
-0.07502732425928116,
0.11718135327100754,
1.1545499563217163,
-1.4325957298278809,
1.4527980089187622,
-0.5810752511024475,
0.2778414785861969,
-2.3421411514282227,
1.46397864818573,
-0.8055711984634399,
2.037677049636841,
-2.6422507762908936,
0.3802785873413086,
-0.6133468747138977,
-0.531104564666748,
0.3885519802570343,
-0.3245498538017273,
0.2554571330547333,
-0.2606804072856903,
-0.971912145614624,
-0.12687517702579498,
-0.7403926849365234,
0.4825844168663025,
1.1485637426376343,
1.2597601413726807,
-1.0012198686599731,
-0.2229246199131012,
-1.7793526649475098,
-0.2041906714439392,
-0.5744822025299072,
0.2392866015434265,
-2.066870927810669,
-0.2269529402256012,
-2.0449392795562744,
-2.2029266357421875,
-1.3227921724319458,
-0.6938674449920654,
1.146837592124939,
0.0550825297832489,
-0.8079604506492615,
1.1086112260818481,
-0.38822290301322937,
-1.740577220916748,
1.072151780128479,
-1.9542427062988281
] |
https://github.com/huggingface/datasets/issues/5133 | Tensor operation not functioning in dataset mapping | Hi! The Torch ops in your snippet are not equivalent to the NumPy ones, hence the difference. You can get the same behavior by replacing the line `feature = torch.mean(feature, dim=1)` with `feature = feature.squeeze().mean(1)` . | ## Describe the bug
I'm doing a torch.mean() operation in data preprocessing, and it's not working.
## Steps to reproduce the bug
```
from transformers import pipeline
import torch
import numpy as np
from datasets import load_dataset
device = 'cuda:0'
raw_dataset = load_dataset("glue", "sst2")
feature_extraction = pipeline('feature-extraction', 'bert-base-uncased', device=device)
def extracted_data(examples):
# feature = torch.tensor(feature_extraction(examples['sentence'], batch_size=16), device=device)
# feature = torch.mean(feature, dim=1)
feature = np.asarray(feature_extraction(examples['sentence'], batch_size=16)).squeeze().mean(1)
print(feature.shape)
return {'feature': feature}
extracted_dataset = raw_dataset.map(extracted_data, batched=True, batch_size=16)
```
## Results
When running with torch.mean(), the shape printed out is [16, seq_len, 768], which is exactly the same before the operation. While numpy works just fine, which gives [16, 768].
## Environment info
- `datasets` version: 2.6.1
- Platform: Linux-4.4.0-142-generic-x86_64-with-glibc2.31
- Python version: 3.10.6
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 469 | 36 | Tensor operation not functioning in dataset mapping
## Describe the bug
I'm doing a torch.mean() operation in data preprocessing, and it's not working.
## Steps to reproduce the bug
```
from transformers import pipeline
import torch
import numpy as np
from datasets import load_dataset
device = 'cuda:0'
raw_dataset = load_dataset("glue", "sst2")
feature_extraction = pipeline('feature-extraction', 'bert-base-uncased', device=device)
def extracted_data(examples):
# feature = torch.tensor(feature_extraction(examples['sentence'], batch_size=16), device=device)
# feature = torch.mean(feature, dim=1)
feature = np.asarray(feature_extraction(examples['sentence'], batch_size=16)).squeeze().mean(1)
print(feature.shape)
return {'feature': feature}
extracted_dataset = raw_dataset.map(extracted_data, batched=True, batch_size=16)
```
## Results
When running with torch.mean(), the shape printed out is [16, seq_len, 768], which is exactly the same before the operation. While numpy works just fine, which gives [16, 768].
## Environment info
- `datasets` version: 2.6.1
- Platform: Linux-4.4.0-142-generic-x86_64-with-glibc2.31
- Python version: 3.10.6
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Hi! The Torch ops in your snippet are not equivalent to the NumPy ones, hence the difference. You can get the same behavior by replacing the line `feature = torch.mean(feature, dim=1)` with `feature = feature.squeeze().mean(1)` . | [
-1.3166909217834473,
-0.905734658241272,
-0.7399864792823792,
1.5519955158233643,
-0.160722553730011,
-1.178183913230896,
0.16023918986320496,
-1.0170131921768188,
1.612521767616272,
-0.8476625680923462,
0.3067799508571625,
-1.6057908535003662,
0.058340102434158325,
-0.5638511180877686,
-0.7323872447013855,
-0.8807318806648254,
-0.4127434194087982,
-0.7207512259483337,
1.1863089799880981,
2.427978277206421,
1.2064932584762573,
-1.3623565435409546,
2.6367814540863037,
0.7354791760444641,
-0.20109377801418304,
-1.0564868450164795,
0.47470512986183167,
-0.014599429443478584,
-1.3507285118103027,
-0.4093509614467621,
-0.991926908493042,
-0.11781054735183716,
-0.6401803493499756,
-0.6192526817321777,
0.021406887099146843,
0.39635375142097473,
-0.3383798599243164,
-0.42626962065696716,
-0.43203631043434143,
-0.7807530760765076,
0.3924270570278168,
-0.37221089005470276,
0.8334831595420837,
-0.2502742409706116,
1.7472847700119019,
-0.5649433732032776,
0.5269354581832886,
0.7143937349319458,
1.3827998638153076,
0.31668367981910706,
-0.059433430433273315,
0.4699220061302185,
0.3644551634788513,
0.030263664200901985,
0.5632652044296265,
1.165449619293213,
0.7145993113517761,
0.42690014839172363,
0.709656834602356,
-2.3025643825531006,
1.3482400178909302,
-1.0688698291778564,
0.34615886211395264,
1.357795238494873,
-1.0530498027801514,
0.3144817352294922,
-1.7414461374282837,
-0.08196983486413956,
0.5395954847335815,
-2.2251174449920654,
0.3097827136516571,
-1.270518183708191,
-0.4862866997718811,
1.040871500968933,
0.4884268641471863,
-1.2449836730957031,
0.06621935963630676,
-0.3856743574142456,
1.0017818212509155,
0.4167935848236084,
1.016871690750122,
-1.723838448524475,
-0.017096061259508133,
-0.3017766773700714,
0.21725192666053772,
-1.1911309957504272,
-1.5644161701202393,
0.49410873651504517,
0.6723570227622986,
0.5745635032653809,
-0.12858182191848755,
1.0320377349853516,
-1.1483168601989746,
0.7826666235923767,
-1.0862255096435547,
-1.8031580448150635,
-1.4498826265335083,
-2.3944997787475586,
-2.252669334411621,
0.6414985656738281,
-0.4184921383857727,
-0.5562249422073364,
2.1988751888275146,
-1.057939887046814,
-1.7046124935150146,
1.1460950374603271,
0.19177748262882233,
-0.03731386363506317,
2.404707431793213,
0.19239255785942078,
-0.7999159693717957,
0.4744722843170166,
-0.8692082166671753,
0.7632881999015808,
-0.342050164937973,
1.3095500469207764,
0.4598621129989624,
-0.9779810309410095,
1.6026276350021362,
-0.31127604842185974,
0.474997878074646,
-0.588310956954956,
-0.3622388541698456,
-0.6977481245994568,
0.32549911737442017,
1.964500904083252,
-0.18244574964046478,
1.4814226627349854,
-0.33654120564460754,
-1.50481379032135,
-1.5790561437606812,
0.9138078093528748,
0.4613322913646698,
-0.7925938367843628,
0.19264625012874603,
-0.38217610120773315,
0.2112230509519577,
0.009291203692555428,
1.217678189277649,
1.3853695392608643,
0.7384853363037109,
-0.4149942100048065,
-0.9583021998405457,
0.12057098746299744,
-0.1645841896533966,
-0.6579998731613159,
-1.7124004364013672,
-0.356150358915329,
-0.0031573716551065445,
0.6813715100288391,
-1.1760152578353882,
1.7700872421264648,
0.8978259563446045,
1.8363820314407349,
1.0039559602737427,
-0.38400447368621826,
1.464082956314087,
0.14039257168769836,
1.926931381225586,
-0.5084485411643982,
0.731482207775116,
-0.4473702907562256,
-1.2097563743591309,
0.8850561380386353,
-0.351474791765213,
-1.9871244430541992,
-0.6992288827896118,
-0.8156424164772034,
-0.19123536348342896,
-0.7967597842216492,
1.0193226337432861,
-0.2882525622844696,
-1.4890602827072144,
0.2754265069961548,
-0.8293349146842957,
0.1597149670124054,
-1.2739381790161133,
0.3173937499523163,
0.7352237105369568,
-0.6574699878692627,
0.1288652867078781,
-0.3771846890449524,
-1.2602384090423584,
-0.4881908893585205,
0.36458444595336914,
1.8551862239837646,
-0.7402279376983643,
0.9351500868797302,
1.0429500341415405,
-0.678815484046936,
-0.09526710957288742,
0.3374529778957367,
-0.2149679958820343,
0.9245826005935669,
-0.9376552700996399,
-0.47583839297294617,
1.1650598049163818,
-0.21089346706867218,
-0.6866102814674377,
1.3983303308486938,
0.6917659640312195,
-0.98546302318573,
-0.19301286339759827,
-0.07514530420303345,
-0.8321002721786499,
0.1470980942249298,
-1.6730982065200806,
-0.06580403447151184,
0.5556498169898987,
-1.6199933290481567,
-0.45334967970848083,
-0.16727271676063538,
1.338728904724121,
-0.10137467086315155,
1.4999644756317139,
-0.3474236726760864,
-0.1320399045944214,
-0.40085309743881226,
-0.2973124086856842,
0.16651052236557007,
-0.20054900646209717,
-0.5907208919525146,
0.17013417184352875,
-0.7484173774719238,
0.31421446800231934,
1.4090615510940552,
0.3199096918106079,
0.04840364307165146,
0.5386045575141907,
1.1220483779907227,
0.35228651762008667,
-0.13069260120391846,
-0.8545174598693848,
-1.5809367895126343,
2.029296636581421,
-1.4248790740966797,
2.0167388916015625,
0.6895332336425781,
-0.020906537771224976,
-1.842092514038086,
-1.83805251121521,
1.3438220024108887,
1.1106599569320679,
2.3444135189056396,
0.6148969531059265,
0.45290642976760864,
-0.8303350806236267,
-0.5776937007904053,
0.3312564194202423,
-0.9624219536781311,
-0.8085837960243225,
0.1059453934431076,
2.3954501152038574,
1.7065277099609375,
-0.32814979553222656,
-0.1644963175058365,
-1.0243802070617676,
1.4150395393371582,
-0.25279501080513,
0.2870567739009857,
1.9423989057540894,
-0.26451146602630615,
-0.9906285405158997,
1.3405531644821167,
-2.4092352390289307,
0.13737092912197113,
2.036223888397217,
0.3192363977432251,
0.07569247484207153,
-1.3245141506195068,
-0.6652963161468506,
-0.24528786540031433,
-0.5160589218139648,
-1.2376681566238403,
0.5270058512687683,
-0.2150367796421051,
-0.7825837135314941,
-1.4192918539047241,
0.15481866896152496,
-1.0469768047332764,
-1.7449649572372437,
0.16566583514213562,
1.822440266609192,
2.0520927906036377,
-0.8051128387451172,
1.551346778869629,
-0.30579113960266113,
0.23113718628883362,
1.203233003616333,
1.1911147832870483,
3.034222364425659,
1.9382917881011963,
-1.288443684577942,
0.6530141234397888,
-0.11802776157855988,
-0.4576962888240814,
1.2091474533081055,
-1.2366127967834473,
1.2511577606201172,
-0.044074855744838715,
-1.295961618423462,
-1.2048664093017578,
1.0187063217163086,
0.4727199375629425,
-0.02419811673462391,
-0.4909895956516266,
1.2132498025894165,
0.04258512705564499,
1.254246473312378,
0.5795673131942749,
-0.20670875906944275,
0.6263313889503479,
-0.4672291576862335,
-0.5716415643692017,
1.544517993927002,
0.1901465654373169,
-1.4585562944412231,
-2.267810821533203,
-0.15812477469444275,
-0.8484303951263428,
0.02945779822766781,
-0.6512491703033447,
-0.9476852416992188,
1.6492773294448853,
0.3318336308002472,
-1.0707604885101318,
-0.24955756962299347,
-0.4043937623500824,
-0.6243760585784912,
2.738865375518799,
-1.3086330890655518,
-0.248457670211792,
-1.0598803758621216,
-0.67498379945755,
1.600214958190918,
-1.245569109916687,
-0.2566312849521637,
-1.0568344593048096,
-0.4905550181865692,
-1.220956563949585,
-0.5647374391555786,
-0.07694326341152191,
-0.9191087484359741,
0.7784121632575989,
0.18037861585617065,
-1.2654002904891968,
-0.3514026403427124,
-0.8887529373168945,
0.8390246629714966,
-0.08893809467554092,
0.1862771064043045,
1.8457313776016235,
0.3452882170677185,
-0.3793606460094452,
0.7869970798492432,
1.1597410440444946,
0.6549137830734253,
-0.5265876650810242,
0.21059754490852356,
-0.6012670397758484,
0.3302789032459259,
-1.1917327642440796,
0.2587263584136963,
-2.8710086345672607,
0.6211366057395935,
-0.033120110630989075,
-0.08865298330783844,
-0.09834318608045578,
-1.337095022201538,
1.1234216690063477,
2.5496389865875244,
-1.2114629745483398,
0.5744189620018005,
0.26005861163139343,
1.2441390752792358,
-1.546947956085205,
0.3590956926345825,
-0.5451424717903137,
2.120511770248413,
0.3018944561481476,
1.2002661228179932,
-0.4677483141422272,
-2.352259397506714,
0.6582315564155579,
-1.2583191394805908,
-1.1372781991958618,
0.7356272339820862,
-0.8406955003738403,
0.1982271373271942,
-1.3200682401657104,
-0.30043646693229675,
-0.7362434267997742,
-1.1405887603759766,
0.6826292872428894,
0.06823156774044037,
0.4496236741542816,
-0.5851731300354004,
0.4039403796195984,
-2.2643706798553467,
-1.2780917882919312,
-0.18486401438713074,
-0.9890940189361572,
0.4315781891345978,
-0.368412047624588,
0.6480991840362549,
-0.20744946599006653,
0.017766082659363747,
0.32636213302612305,
1.442835807800293,
3.413522720336914,
0.11738327145576477,
0.37881097197532654,
-0.21765653789043427,
-0.9758443236351013,
1.4644010066986084,
0.9472667574882507,
-0.18709297478199005,
-0.567412257194519,
-1.0818297863006592,
1.2589507102966309,
1.8467625379562378,
0.9742395281791687,
0.014358635991811752,
-0.8344699144363403,
-0.7553828358650208,
0.08690465986728668,
0.21487222611904144,
0.4876057505607605,
0.9703817367553711,
0.15743249654769897,
0.12208244204521179,
1.4853838682174683,
1.1133320331573486,
-0.3994530439376831,
0.3771224617958069,
-0.8812714219093323,
-0.468532919883728,
0.4632163941860199,
0.31733542680740356,
-0.017404336482286453,
0.3141923248767853,
-1.1095879077911377,
-0.1962883323431015,
-0.33160558342933655,
-0.87995845079422,
-0.7029616236686707,
-0.3728724718093872,
-0.33694711327552795,
1.7579044103622437,
0.11149871349334717,
-0.464908629655838,
-0.09345637261867523,
-0.7768164873123169,
-0.07055484503507614,
-1.0706160068511963,
0.3586347699165344,
-0.09243134409189224,
-0.1647299826145172,
-0.15652167797088623,
1.8251450061798096,
-0.9129937887191772,
-2.098085403442383,
0.2581094801425934,
0.2301212102174759,
-0.2607886493206024,
0.19804918766021729,
1.6837778091430664,
0.6014795899391174,
1.4206407070159912,
1.3793294429779053,
0.9340206384658813,
-0.5942939519882202,
-1.3511947393417358,
0.6829615235328674,
0.9586661458015442,
-1.3860608339309692,
0.7403910160064697,
0.021490903571248055,
-0.5472806692123413,
0.5805449485778809,
1.2045739889144897,
0.4681970477104187,
-2.039731979370117,
0.859153687953949,
-1.066629409790039,
0.8393070101737976,
0.6563199758529663,
0.6984317898750305,
0.13621358573436737,
0.800402820110321,
-1.2874311208724976,
-1.156457781791687,
-0.7023948431015015,
-0.7354208827018738,
1.9064511060714722,
-0.39448490738868713,
0.6227165460586548,
-0.19791017472743988,
-1.3789021968841553,
-0.06590227782726288,
0.6813395023345947,
0.2373000830411911,
-0.4420773386955261,
0.8973196148872375,
-0.6539014577865601,
-1.2364193201065063,
-1.4324687719345093,
-0.4777260422706604,
-0.973881185054779,
-0.9317113757133484,
0.9751134514808655,
0.7014371752738953,
0.27546459436416626,
1.8325129747390747,
0.6406134963035583,
0.22267334163188934,
-2.633615732192993,
0.9124655723571777,
0.2305515855550766,
-0.05999963730573654,
0.8151564002037048,
0.3784378468990326,
1.0448942184448242,
-0.09287471324205399,
0.5248748064041138,
-2.4778389930725098,
2.347182035446167,
-0.2435716986656189,
0.7300696969032288,
0.029760433360934258,
-0.0038677859120070934,
1.068963885307312,
0.6375301480293274,
0.5737648010253906,
-0.9455671310424805,
0.7455449104309082,
-0.6780136227607727,
1.36624014377594,
0.8992798924446106,
-0.7771243453025818,
-0.12567231059074402,
1.3220345973968506,
0.3950348198413849,
-0.5134427547454834,
-0.9689982533454895,
-1.0288881063461304,
0.9378682971000671,
1.7535585165023804,
-0.038035064935684204,
-0.02147066593170166,
0.7424667477607727,
0.649088442325592,
-1.2827906608581543,
0.03365033119916916,
-0.729836642742157,
-0.6634343266487122,
1.6912388801574707,
2.092258930206299,
-0.2566605508327484,
-0.19227904081344604,
-0.618841290473938,
-1.3090931177139282,
0.6855014562606812,
-0.0330386757850647,
0.06097463518381119,
0.7104478478431702,
-0.5329417586326599,
0.9597246050834656,
0.8323026895523071,
0.9590124487876892,
0.2602849006652832,
0.17134620249271393,
0.28766557574272156,
-0.3337005078792572,
-1.2244648933410645,
-0.22959817945957184,
-1.0581740140914917,
-2.5697712898254395,
0.3321491777896881,
-0.2246837317943573,
-1.4350683689117432,
0.15599478781223297,
-0.9528723359107971,
0.8809665441513062,
-0.4951460063457489,
-1.1276938915252686,
-1.4855760335922241,
0.17066891491413116,
-0.009376817382872105,
0.9049623012542725,
-1.6053529977798462,
-0.06339602917432785,
1.2545217275619507,
0.9427198171615601,
-0.6907426118850708,
1.0706686973571777,
0.293720006942749,
1.0486935377120972,
0.8389627933502197,
-0.41796284914016724,
0.5242210626602173,
0.09962347149848938,
-1.315212368965149,
0.4675177335739136,
1.2007029056549072,
0.1771712601184845,
1.5619155168533325,
-0.563088059425354,
-0.14394144713878632,
0.41923394799232483,
-0.5613463521003723,
-0.43872588872909546,
-0.49821823835372925,
0.7033668160438538,
0.007521826773881912,
-0.8943822979927063,
-0.04522118717432022,
0.008462294936180115,
-0.2450801432132721,
0.23435303568840027,
-1.5398249626159668,
-0.057281672954559326,
-0.402734637260437,
-0.662760317325592,
-1.2619138956069946,
-0.07846782356500626,
1.3283807039260864,
-0.8927359580993652,
-0.1609460562467575,
0.462166428565979,
0.3074321150779724,
0.5665039420127869,
0.6889869570732117,
-0.6525418162345886,
-0.4230888783931732,
-0.18358077108860016,
-0.30710387229919434,
0.37454932928085327,
1.2869572639465332,
-0.15641142427921295,
-0.9827196002006531,
0.6627712845802307,
-0.2850778102874756,
0.06497286260128021,
1.8101763725280762,
-0.0474596843123436,
-0.8661182522773743,
0.2757832705974579,
-0.6447485089302063,
1.9341799020767212,
1.583261489868164,
1.2311789989471436,
-0.20559456944465637,
-0.9410184621810913,
0.6137927770614624,
-0.2956520915031433,
-0.38822948932647705,
0.7858167886734009,
0.4807891249656677,
-0.1922781765460968,
-1.3464527130126953,
0.7527197003364563,
1.1587986946105957,
-0.8873527646064758,
-0.896082878112793,
0.19230970740318298,
-0.7565265893936157,
1.1484856605529785,
0.6895566582679749,
0.3503418266773224,
0.21145489811897278,
1.6873337030410767,
0.8304720520973206,
-0.5212485790252686,
0.5672029256820679,
0.49744075536727905,
-0.19751016795635223,
-2.1347849369049072,
-1.1149908304214478,
0.29959723353385925,
-0.5255298018455505,
-1.5691883563995361,
1.3595949411392212,
-1.1964751482009888,
-0.9337378740310669,
0.5783163905143738,
0.06722752749919891,
1.402944564819336,
0.3249560594558716,
1.5725542306900024,
2.0360865592956543,
0.9039859771728516,
0.4523177146911621,
1.2747162580490112,
-0.13517729938030243,
-0.4113540053367615,
1.7641170024871826,
-0.4363071024417877,
0.5127729773521423,
1.120664119720459,
-0.28886792063713074,
-1.0655179023742676,
-0.7439783811569214,
-1.2976136207580566,
-0.7133896946907043,
1.088248372077942,
0.14546121656894684,
-1.108321189880371,
0.28930744528770447,
1.3816072940826416,
0.13864432275295258,
-0.27960145473480225,
0.6144920587539673,
0.35993602871894836,
-0.728451132774353,
-0.07966062426567078,
-0.8819851875305176,
0.4959036707878113,
-0.34713461995124817,
-0.3651826083660126,
0.3146076500415802,
0.3567146062850952,
1.3311173915863037,
0.029219334945082664,
0.1927752047777176,
1.1888710260391235,
-1.3987919092178345,
1.5288926362991333,
-0.6826589107513428,
0.31773293018341064,
-2.279200315475464,
1.3105106353759766,
-0.8668291568756104,
1.9503173828125,
-2.742461919784546,
0.4817102253437042,
-0.5755239725112915,
-0.46282756328582764,
0.31602969765663147,
-0.30472758412361145,
0.11324059963226318,
-0.12894898653030396,
-1.2008826732635498,
-0.15833963453769684,
-0.7476586103439331,
0.48870253562927246,
1.0846465826034546,
1.296907663345337,
-1.1094998121261597,
-0.23046742379665375,
-1.703683614730835,
-0.06310367584228516,
-0.7182440161705017,
0.39556458592414856,
-1.9431616067886353,
-0.190257728099823,
-1.9280297756195068,
-2.332832098007202,
-1.1295053958892822,
-0.8257281184196472,
1.2408653497695923,
0.14317333698272705,
-0.786824643611908,
1.2650865316390991,
-0.33435559272766113,
-1.7393275499343872,
1.0506926774978638,
-2.1095962524414062
] |
https://github.com/huggingface/datasets/issues/5133 | Tensor operation not functioning in dataset mapping | > Hi! The Torch ops in your snippet are not equivalent to the NumPy ones, hence the difference. You can get the same behavior by replacing the line `feature = torch.mean(feature, dim=1)` with `feature = feature.squeeze().mean(1)` .
Thank you. | ## Describe the bug
I'm doing a torch.mean() operation in data preprocessing, and it's not working.
## Steps to reproduce the bug
```
from transformers import pipeline
import torch
import numpy as np
from datasets import load_dataset
device = 'cuda:0'
raw_dataset = load_dataset("glue", "sst2")
feature_extraction = pipeline('feature-extraction', 'bert-base-uncased', device=device)
def extracted_data(examples):
# feature = torch.tensor(feature_extraction(examples['sentence'], batch_size=16), device=device)
# feature = torch.mean(feature, dim=1)
feature = np.asarray(feature_extraction(examples['sentence'], batch_size=16)).squeeze().mean(1)
print(feature.shape)
return {'feature': feature}
extracted_dataset = raw_dataset.map(extracted_data, batched=True, batch_size=16)
```
## Results
When running with torch.mean(), the shape printed out is [16, seq_len, 768], which is exactly the same before the operation. While numpy works just fine, which gives [16, 768].
## Environment info
- `datasets` version: 2.6.1
- Platform: Linux-4.4.0-142-generic-x86_64-with-glibc2.31
- Python version: 3.10.6
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 469 | 39 | Tensor operation not functioning in dataset mapping
## Describe the bug
I'm doing a torch.mean() operation in data preprocessing, and it's not working.
## Steps to reproduce the bug
```
from transformers import pipeline
import torch
import numpy as np
from datasets import load_dataset
device = 'cuda:0'
raw_dataset = load_dataset("glue", "sst2")
feature_extraction = pipeline('feature-extraction', 'bert-base-uncased', device=device)
def extracted_data(examples):
# feature = torch.tensor(feature_extraction(examples['sentence'], batch_size=16), device=device)
# feature = torch.mean(feature, dim=1)
feature = np.asarray(feature_extraction(examples['sentence'], batch_size=16)).squeeze().mean(1)
print(feature.shape)
return {'feature': feature}
extracted_dataset = raw_dataset.map(extracted_data, batched=True, batch_size=16)
```
## Results
When running with torch.mean(), the shape printed out is [16, seq_len, 768], which is exactly the same before the operation. While numpy works just fine, which gives [16, 768].
## Environment info
- `datasets` version: 2.6.1
- Platform: Linux-4.4.0-142-generic-x86_64-with-glibc2.31
- Python version: 3.10.6
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
> Hi! The Torch ops in your snippet are not equivalent to the NumPy ones, hence the difference. You can get the same behavior by replacing the line `feature = torch.mean(feature, dim=1)` with `feature = feature.squeeze().mean(1)` .
Thank you. | [
-1.31351637840271,
-0.9110934734344482,
-0.7413968443870544,
1.5601929426193237,
-0.16609534621238708,
-1.1743741035461426,
0.14990335702896118,
-1.029416561126709,
1.6210994720458984,
-0.834199070930481,
0.30893388390541077,
-1.6169604063034058,
0.05151892080903053,
-0.564231812953949,
-0.7188109159469604,
-0.8893182873725891,
-0.41273415088653564,
-0.7237720489501953,
1.1854543685913086,
2.433603525161743,
1.1982427835464478,
-1.3507981300354004,
2.641201972961426,
0.7388250231742859,
-0.19310157001018524,
-1.0596593618392944,
0.47921815514564514,
-0.026696674525737762,
-1.3518133163452148,
-0.4083225727081299,
-0.9886175394058228,
-0.11844527721405029,
-0.6381611227989197,
-0.6155518889427185,
0.021046411246061325,
0.39432811737060547,
-0.3343425393104553,
-0.412968248128891,
-0.42931047081947327,
-0.7780172228813171,
0.38970258831977844,
-0.37539198994636536,
0.8250493407249451,
-0.24764227867126465,
1.736114263534546,
-0.5729815363883972,
0.5286961793899536,
0.7216494083404541,
1.3807413578033447,
0.3152149021625519,
-0.06026637926697731,
0.4667505919933319,
0.37483885884284973,
0.027718938887119293,
0.5510682463645935,
1.164568543434143,
0.715563178062439,
0.43110859394073486,
0.7036632895469666,
-2.308198928833008,
1.3495690822601318,
-1.06803297996521,
0.3372457027435303,
1.360137701034546,
-1.0512975454330444,
0.3066515624523163,
-1.7468714714050293,
-0.07627619057893753,
0.5392975807189941,
-2.2322773933410645,
0.32148054242134094,
-1.276566743850708,
-0.4864547848701477,
1.0399513244628906,
0.4856612980365753,
-1.2443513870239258,
0.06265303492546082,
-0.36654341220855713,
1.002237319946289,
0.4269064962863922,
1.0094566345214844,
-1.7298400402069092,
-0.022804006934165955,
-0.3061828017234802,
0.2102743536233902,
-1.187963843345642,
-1.5551317930221558,
0.49702978134155273,
0.6748356223106384,
0.5742886662483215,
-0.12840591371059418,
1.0263118743896484,
-1.145326852798462,
0.7790390849113464,
-1.0852733850479126,
-1.8019239902496338,
-1.4673047065734863,
-2.3904571533203125,
-2.2534940242767334,
0.6474379897117615,
-0.42555585503578186,
-0.5468392968177795,
2.2006936073303223,
-1.0708158016204834,
-1.7058446407318115,
1.1403627395629883,
0.1910945475101471,
-0.030795034021139145,
2.4034342765808105,
0.1913326382637024,
-0.8025191426277161,
0.46029624342918396,
-0.8712380528450012,
0.7598887085914612,
-0.3364626169204712,
1.3105401992797852,
0.4520348906517029,
-0.9737779498100281,
1.59847891330719,
-0.3053301274776459,
0.48799917101860046,
-0.597474992275238,
-0.3609296679496765,
-0.6998432278633118,
0.3267066180706024,
1.9673765897750854,
-0.17346984148025513,
1.4913041591644287,
-0.33650410175323486,
-1.508689522743225,
-1.578407883644104,
0.9114607572555542,
0.4620237350463867,
-0.7908877730369568,
0.18148286640644073,
-0.38261157274246216,
0.20740526914596558,
0.002050247974693775,
1.2211174964904785,
1.394635558128357,
0.7396135926246643,
-0.4155154526233673,
-0.9525129199028015,
0.11362812668085098,
-0.16401946544647217,
-0.6643281579017639,
-1.7137569189071655,
-0.3632189631462097,
-0.000589798204600811,
0.6837363839149475,
-1.1677075624465942,
1.7715370655059814,
0.8998550772666931,
1.8357946872711182,
0.9965748190879822,
-0.39000529050827026,
1.4609440565109253,
0.14521774649620056,
1.9269344806671143,
-0.5180538892745972,
0.7348581552505493,
-0.44627195596694946,
-1.208756923675537,
0.8857746124267578,
-0.349814236164093,
-1.9856747388839722,
-0.6960886120796204,
-0.8114035129547119,
-0.19059957563877106,
-0.7951955199241638,
1.024815320968628,
-0.2897263467311859,
-1.4787837266921997,
0.27494433522224426,
-0.828070342540741,
0.1571335643529892,
-1.2698678970336914,
0.31787458062171936,
0.7326961755752563,
-0.651630163192749,
0.13512662053108215,
-0.3768782317638397,
-1.2742739915847778,
-0.4952809512615204,
0.3565143942832947,
1.8406769037246704,
-0.7344031929969788,
0.9248005747795105,
1.0340102910995483,
-0.678434431552887,
-0.09777067601680756,
0.3462789058685303,
-0.20887809991836548,
0.9231818318367004,
-0.9438413977622986,
-0.4678942561149597,
1.1583751440048218,
-0.21567775309085846,
-0.6918265223503113,
1.3980789184570312,
0.6919059157371521,
-0.9813599586486816,
-0.19269387423992157,
-0.0777035728096962,
-0.8277187943458557,
0.14430645108222961,
-1.6735618114471436,
-0.07618791610002518,
0.5579946041107178,
-1.6239389181137085,
-0.4634978473186493,
-0.16230995953083038,
1.3429067134857178,
-0.10569842159748077,
1.4918426275253296,
-0.3456208407878876,
-0.1258065551519394,
-0.405719131231308,
-0.2972221076488495,
0.16055570542812347,
-0.20625151693820953,
-0.5889682173728943,
0.16844162344932556,
-0.7629481554031372,
0.3060348629951477,
1.418157935142517,
0.32372409105300903,
0.045016638934612274,
0.5284647941589355,
1.1196719408035278,
0.3436064124107361,
-0.1332932859659195,
-0.862650990486145,
-1.5859079360961914,
2.0248591899871826,
-1.4353904724121094,
2.0247139930725098,
0.6924515962600708,
-0.018317129462957382,
-1.8475044965744019,
-1.8375424146652222,
1.351127028465271,
1.1036828756332397,
2.3414981365203857,
0.6191017031669617,
0.46043679118156433,
-0.8395798206329346,
-0.57125324010849,
0.33120980858802795,
-0.9686837792396545,
-0.8138888478279114,
0.09920139610767365,
2.4025042057037354,
1.699428915977478,
-0.3343539237976074,
-0.17431266605854034,
-1.0242494344711304,
1.4086582660675049,
-0.24129320681095123,
0.2928783595561981,
1.9474005699157715,
-0.2540607452392578,
-0.9950375556945801,
1.3280727863311768,
-2.4012820720672607,
0.12986865639686584,
2.040175199508667,
0.3131812810897827,
0.09307150542736053,
-1.3214807510375977,
-0.6760785579681396,
-0.2416653037071228,
-0.5202321410179138,
-1.2473607063293457,
0.5226377844810486,
-0.2166430503129959,
-0.7856332063674927,
-1.40461266040802,
0.1555664837360382,
-1.0525333881378174,
-1.745310664176941,
0.16563846170902252,
1.830469012260437,
2.0547497272491455,
-0.8128436803817749,
1.55300772190094,
-0.3085276782512665,
0.22787323594093323,
1.1940375566482544,
1.1996686458587646,
3.0411078929901123,
1.9498066902160645,
-1.2820048332214355,
0.654837965965271,
-0.1209574043750763,
-0.464951753616333,
1.2131602764129639,
-1.229878306388855,
1.254209280014038,
-0.05877717584371567,
-1.300329327583313,
-1.2013685703277588,
1.0173472166061401,
0.4739670753479004,
-0.03282420337200165,
-0.49370625615119934,
1.2130547761917114,
0.035913314670324326,
1.2514324188232422,
0.5785053968429565,
-0.21100808680057526,
0.634009063243866,
-0.45830830931663513,
-0.56471186876297,
1.5443682670593262,
0.19062289595603943,
-1.4637662172317505,
-2.269850254058838,
-0.16344861686229706,
-0.8421339988708496,
0.028912004083395004,
-0.6378348469734192,
-0.9466103911399841,
1.6514967679977417,
0.3283239006996155,
-1.0691004991531372,
-0.2536155581474304,
-0.39854344725608826,
-0.6180943250656128,
2.7441859245300293,
-1.3074308633804321,
-0.24918349087238312,
-1.0498179197311401,
-0.6671520471572876,
1.5976074934005737,
-1.2433947324752808,
-0.25508755445480347,
-1.047277569770813,
-0.48257946968078613,
-1.2247954607009888,
-0.5654314756393433,
-0.07310282438993454,
-0.9139732718467712,
0.7764791250228882,
0.18494813144207,
-1.2620924711227417,
-0.34820806980133057,
-0.8817632794380188,
0.8415648937225342,
-0.08958226442337036,
0.18624769151210785,
1.8501410484313965,
0.3464288115501404,
-0.37084901332855225,
0.7869537472724915,
1.1550297737121582,
0.6437422633171082,
-0.5314636826515198,
0.2145569771528244,
-0.5926122665405273,
0.33167943358421326,
-1.1860259771347046,
0.25313806533813477,
-2.8760085105895996,
0.6235526204109192,
-0.03246746584773064,
-0.0862884372472763,
-0.09210097789764404,
-1.3347548246383667,
1.130959391593933,
2.5537450313568115,
-1.2108047008514404,
0.5680148601531982,
0.2626713216304779,
1.2392014265060425,
-1.5507127046585083,
0.3618048429489136,
-0.5424312353134155,
2.126610279083252,
0.30206742882728577,
1.2074415683746338,
-0.4729093313217163,
-2.3583033084869385,
0.658392071723938,
-1.2589634656906128,
-1.1315562725067139,
0.7370476722717285,
-0.8558997511863708,
0.19936752319335938,
-1.320471167564392,
-0.2989298105239868,
-0.7368882298469543,
-1.1446946859359741,
0.6786895394325256,
0.0785050094127655,
0.44560176134109497,
-0.5769336223602295,
0.3983193635940552,
-2.248652696609497,
-1.277471661567688,
-0.1911959946155548,
-0.9774383902549744,
0.4196530878543854,
-0.37127405405044556,
0.6501109600067139,
-0.2097947746515274,
0.022120468318462372,
0.3269657790660858,
1.442825198173523,
3.4083070755004883,
0.11890314519405365,
0.37219008803367615,
-0.22976547479629517,
-0.9702629446983337,
1.4626986980438232,
0.9570594429969788,
-0.19671516120433807,
-0.5655574202537537,
-1.0780677795410156,
1.2672979831695557,
1.8518497943878174,
0.9684349894523621,
0.011071241460740566,
-0.8408870100975037,
-0.7504090666770935,
0.07833847403526306,
0.21053574979305267,
0.4851629137992859,
0.978805661201477,
0.16447597742080688,
0.12648974359035492,
1.4893455505371094,
1.1132060289382935,
-0.39479172229766846,
0.37831443548202515,
-0.8810823559761047,
-0.4719840884208679,
0.46140867471694946,
0.31621336936950684,
-0.01983529143035412,
0.31699979305267334,
-1.100725769996643,
-0.20204459130764008,
-0.32211053371429443,
-0.8844990730285645,
-0.7081419825553894,
-0.37734609842300415,
-0.3284902572631836,
1.760102391242981,
0.11474566161632538,
-0.4583938419818878,
-0.09517551958560944,
-0.770630955696106,
-0.07310966402292252,
-1.0683138370513916,
0.3648703396320343,
-0.1040470153093338,
-0.1600549817085266,
-0.14714349806308746,
1.8172757625579834,
-0.9190958142280579,
-2.093949317932129,
0.2719610631465912,
0.2411274015903473,
-0.26470690965652466,
0.2066805362701416,
1.6826624870300293,
0.6087002158164978,
1.4198426008224487,
1.3804690837860107,
0.9473599195480347,
-0.5980409979820251,
-1.3452016115188599,
0.677954912185669,
0.9585761427879333,
-1.4005423784255981,
0.7436358332633972,
0.008341304026544094,
-0.5500730872154236,
0.5707774758338928,
1.210637092590332,
0.47191449999809265,
-2.048373222351074,
0.8618919849395752,
-1.0594286918640137,
0.8452673554420471,
0.6523310542106628,
0.7073607444763184,
0.13098350167274475,
0.8014646768569946,
-1.2792872190475464,
-1.1588075160980225,
-0.7065134048461914,
-0.7321457862854004,
1.900047779083252,
-0.38728177547454834,
0.6170206665992737,
-0.20214906334877014,
-1.3814489841461182,
-0.07124801725149155,
0.6724724769592285,
0.23740342259407043,
-0.45028623938560486,
0.9042155742645264,
-0.6485045552253723,
-1.2246627807617188,
-1.437943696975708,
-0.4714307188987732,
-0.9789525866508484,
-0.9259514808654785,
0.9710286855697632,
0.6944142580032349,
0.28004658222198486,
1.8236336708068848,
0.6375218629837036,
0.22425702214241028,
-2.635693073272705,
0.9227467775344849,
0.21864508092403412,
-0.05878012627363205,
0.815053403377533,
0.37880608439445496,
1.0473450422286987,
-0.10515936464071274,
0.5326204299926758,
-2.476447582244873,
2.3480985164642334,
-0.2562754154205322,
0.7336219549179077,
0.030132003128528595,
0.00009526032954454422,
1.0567882061004639,
0.623285710811615,
0.573331356048584,
-0.9423564672470093,
0.7346012592315674,
-0.6669322848320007,
1.3576185703277588,
0.9024830460548401,
-0.777603805065155,
-0.12710823118686676,
1.3150126934051514,
0.3887571096420288,
-0.5190065503120422,
-0.9638203978538513,
-1.0190563201904297,
0.9341778755187988,
1.7501225471496582,
-0.04692648723721504,
-0.024419257417321205,
0.7466897964477539,
0.640901505947113,
-1.2805557250976562,
0.032754313200712204,
-0.725078284740448,
-0.6614252328872681,
1.6868244409561157,
2.087651491165161,
-0.25387901067733765,
-0.1964983344078064,
-0.6195915341377258,
-1.3045607805252075,
0.6836100220680237,
-0.04013442620635033,
0.0561828687787056,
0.7068145871162415,
-0.5236874222755432,
0.9610475897789001,
0.8281266093254089,
0.9478365182876587,
0.26905810832977295,
0.18222284317016602,
0.2950150668621063,
-0.3328021168708801,
-1.2125880718231201,
-0.23281079530715942,
-1.0643048286437988,
-2.573784589767456,
0.3319070339202881,
-0.22852075099945068,
-1.4282585382461548,
0.14255961775779724,
-0.9661037921905518,
0.8819653391838074,
-0.4987162947654724,
-1.1326963901519775,
-1.485315203666687,
0.16442367434501648,
-0.02582435868680477,
0.9108752608299255,
-1.5948829650878906,
-0.06708589941263199,
1.254862666130066,
0.9422274231910706,
-0.691432774066925,
1.073185682296753,
0.29218629002571106,
1.0529378652572632,
0.8447577357292175,
-0.42418307065963745,
0.5244793891906738,
0.09029106795787811,
-1.3167978525161743,
0.46456483006477356,
1.2072758674621582,
0.18904145061969757,
1.5636892318725586,
-0.5576949119567871,
-0.14760147035121918,
0.4223533570766449,
-0.5598374605178833,
-0.43426787853240967,
-0.5064433813095093,
0.7113462686538696,
0.02296622097492218,
-0.8955613374710083,
-0.04724488407373428,
0.0049775131046772,
-0.2342943251132965,
0.23792201280593872,
-1.538121223449707,
-0.05758974701166153,
-0.39835435152053833,
-0.6572959423065186,
-1.255959391593933,
-0.0748850628733635,
1.3290349245071411,
-0.8847253322601318,
-0.1660582423210144,
0.4770604968070984,
0.2885150909423828,
0.5692601203918457,
0.6811739802360535,
-0.6629331707954407,
-0.4169495105743408,
-0.19045186042785645,
-0.3113444745540619,
0.3763546645641327,
1.29030179977417,
-0.15179480612277985,
-0.9827677607536316,
0.6691496968269348,
-0.27556079626083374,
0.06132752448320389,
1.8100529909133911,
-0.052001286298036575,
-0.8720671534538269,
0.2722058892250061,
-0.6379907131195068,
1.9341251850128174,
1.5896646976470947,
1.2317314147949219,
-0.21493421494960785,
-0.9327576756477356,
0.620528519153595,
-0.2973381280899048,
-0.3920595943927765,
0.781857967376709,
0.485683798789978,
-0.1918737292289734,
-1.3455817699432373,
0.7638596296310425,
1.162765383720398,
-0.8878502249717712,
-0.8957778215408325,
0.18816140294075012,
-0.7437636256217957,
1.147868037223816,
0.6940546035766602,
0.3557334840297699,
0.21451501548290253,
1.6862772703170776,
0.8291801810264587,
-0.5180684328079224,
0.5637584328651428,
0.5014805793762207,
-0.20291003584861755,
-2.129099130630493,
-1.1321121454238892,
0.30244743824005127,
-0.5287547707557678,
-1.5779945850372314,
1.3607378005981445,
-1.2009084224700928,
-0.9379112720489502,
0.5786051750183105,
0.0680023580789566,
1.4117515087127686,
0.3242618441581726,
1.5699496269226074,
2.0425000190734863,
0.8968061208724976,
0.4514479339122772,
1.2738854885101318,
-0.13191215693950653,
-0.4119613766670227,
1.7672699689865112,
-0.43809571862220764,
0.5151649713516235,
1.1181590557098389,
-0.2898329198360443,
-1.0767247676849365,
-0.7461725473403931,
-1.2920390367507935,
-0.7089322209358215,
1.0996142625808716,
0.13511793315410614,
-1.107679843902588,
0.2849242687225342,
1.3861886262893677,
0.13751435279846191,
-0.29782357811927795,
0.6215325593948364,
0.3653906285762787,
-0.7289357781410217,
-0.08031157404184341,
-0.8742027282714844,
0.4916195273399353,
-0.34317225217819214,
-0.363617479801178,
0.329904705286026,
0.3560797870159149,
1.3285422325134277,
0.0317997969686985,
0.18392477929592133,
1.1825480461120605,
-1.3865628242492676,
1.5284878015518188,
-0.6875635385513306,
0.3145819902420044,
-2.284039258956909,
1.3119910955429077,
-0.8598957061767578,
1.93972647190094,
-2.7355380058288574,
0.491091787815094,
-0.5715792179107666,
-0.46485912799835205,
0.3195078372955322,
-0.3062345087528229,
0.11391176283359528,
-0.13168035447597504,
-1.1969361305236816,
-0.16123831272125244,
-0.7516504526138306,
0.4862240254878998,
1.0765522718429565,
1.3007962703704834,
-1.1005090475082397,
-0.2255646139383316,
-1.711950659751892,
-0.05793677642941475,
-0.7174547910690308,
0.3890576958656311,
-1.9402940273284912,
-0.19811774790287018,
-1.9138232469558716,
-2.330469846725464,
-1.1299632787704468,
-0.8209500312805176,
1.2425302267074585,
0.1542445570230484,
-0.7810908555984497,
1.267730474472046,
-0.32789549231529236,
-1.7404463291168213,
1.0598671436309814,
-2.112166404724121
] |
https://github.com/huggingface/datasets/issues/5129 | unexpected `cast` or `class_encode_column` result after `rename_column` | Hi! Unfortunately, I can't reproduce this issue locally (in Python 3.7/3.10) or in Colab. I would assume this is due to a bug we fixed in the latest release, but your version is up-to-date, so I'm not sure if there is something we can do to help... | ## Describe the bug
When invoke `cast` or `class_encode_column` to a colunm renamed by `rename_column` , it will convert all the variables in this column into one variable. I also run this script in version 2.5.2, this bug does not appear. So I switched to the older version.
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("amazon_reviews_multi", "en")
data = dataset['train']
data = data.remove_columns(
[
"review_id",
"product_id",
"reviewer_id",
"review_title",
"language",
"product_category",
]
)
data = data.rename_column("review_body", "text")
data1 = data.class_encode_column("stars")
print(set(data1.data.columns[0]))
# output: {<pyarrow.Int64Scalar: 4>, <pyarrow.Int64Scalar: 2>, <pyarrow.Int64Scalar: 3>, <pyarrow.Int64Scalar: 0>, <pyarrow.Int64Scalar: 1>}
data = data.rename_column("stars", "label")
print(set(data.data.columns[0]))
# output: {<pyarrow.Int32Scalar: 5>, <pyarrow.Int32Scalar: 4>, <pyarrow.Int32Scalar: 1>, <pyarrow.Int32Scalar: 3>, <pyarrow.Int32Scalar: 2>}
data2 = data.class_encode_column("label")
print(set(data2.data.columns[0]))
# output: {<pyarrow.Int64Scalar: 0>}
```
## Expected results
the last print should be:
{<pyarrow.Int64Scalar: 4>, <pyarrow.Int64Scalar: 2>, <pyarrow.Int64Scalar: 3>, <pyarrow.Int64Scalar: 0>, <pyarrow.Int64Scalar: 1>}
## Actual results
but it output:
{<pyarrow.Int64Scalar: 0>}
## Environment info
- `datasets` version: 2.6.1
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.10.6
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 471 | 47 | unexpected `cast` or `class_encode_column` result after `rename_column`
## Describe the bug
When invoke `cast` or `class_encode_column` to a colunm renamed by `rename_column` , it will convert all the variables in this column into one variable. I also run this script in version 2.5.2, this bug does not appear. So I switched to the older version.
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("amazon_reviews_multi", "en")
data = dataset['train']
data = data.remove_columns(
[
"review_id",
"product_id",
"reviewer_id",
"review_title",
"language",
"product_category",
]
)
data = data.rename_column("review_body", "text")
data1 = data.class_encode_column("stars")
print(set(data1.data.columns[0]))
# output: {<pyarrow.Int64Scalar: 4>, <pyarrow.Int64Scalar: 2>, <pyarrow.Int64Scalar: 3>, <pyarrow.Int64Scalar: 0>, <pyarrow.Int64Scalar: 1>}
data = data.rename_column("stars", "label")
print(set(data.data.columns[0]))
# output: {<pyarrow.Int32Scalar: 5>, <pyarrow.Int32Scalar: 4>, <pyarrow.Int32Scalar: 1>, <pyarrow.Int32Scalar: 3>, <pyarrow.Int32Scalar: 2>}
data2 = data.class_encode_column("label")
print(set(data2.data.columns[0]))
# output: {<pyarrow.Int64Scalar: 0>}
```
## Expected results
the last print should be:
{<pyarrow.Int64Scalar: 4>, <pyarrow.Int64Scalar: 2>, <pyarrow.Int64Scalar: 3>, <pyarrow.Int64Scalar: 0>, <pyarrow.Int64Scalar: 1>}
## Actual results
but it output:
{<pyarrow.Int64Scalar: 0>}
## Environment info
- `datasets` version: 2.6.1
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.10.6
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Hi! Unfortunately, I can't reproduce this issue locally (in Python 3.7/3.10) or in Colab. I would assume this is due to a bug we fixed in the latest release, but your version is up-to-date, so I'm not sure if there is something we can do to help... | [
-1.1592960357666016,
-0.7789490222930908,
-0.5669161677360535,
1.5010372400283813,
-0.12522678077220917,
-1.1274248361587524,
0.25514858961105347,
-1.1502554416656494,
1.6793831586837769,
-0.7185186147689819,
0.28748202323913574,
-1.6195738315582275,
0.023260755464434624,
-0.47995197772979736,
-0.6789268851280212,
-0.9933697581291199,
-0.4098317325115204,
-0.7237848043441772,
1.030131220817566,
2.5068700313568115,
1.368522047996521,
-1.4732234477996826,
2.7249412536621094,
0.7347733974456787,
-0.11073058098554611,
-0.9893386960029602,
0.5281793475151062,
-0.03601902723312378,
-1.3869905471801758,
-0.4596661329269409,
-0.9258913397789001,
-0.25448811054229736,
-0.5373871922492981,
-0.5317779779434204,
-0.06690765172243118,
0.48621904850006104,
-0.34973570704460144,
-0.49950462579727173,
-0.615281343460083,
-0.8484716415405273,
0.4727775454521179,
-0.47608718276023865,
0.9223625063896179,
-0.43795132637023926,
1.683894157409668,
-0.6001572608947754,
0.582728385925293,
0.7920841574668884,
1.314950942993164,
0.1793692708015442,
-0.07192876189947128,
0.45046424865722656,
0.3466375768184662,
0.02281993068754673,
0.589989960193634,
1.0283029079437256,
0.8037174940109253,
0.42688557505607605,
0.7093691229820251,
-2.2059431076049805,
1.1334171295166016,
-1.0507917404174805,
0.2242073267698288,
1.3458294868469238,
-0.8280368447303772,
0.28099238872528076,
-1.734978437423706,
-0.14843906462192535,
0.586284875869751,
-2.2314558029174805,
0.3389713168144226,
-1.392076015472412,
-0.4480452835559845,
0.9501218199729919,
0.407564252614975,
-1.1868436336517334,
-0.052499353885650635,
-0.3790544271469116,
0.9829472303390503,
0.43243491649627686,
1.0503158569335938,
-1.7145782709121704,
0.02768481709063053,
-0.34908920526504517,
0.14697113633155823,
-1.0969561338424683,
-1.6092320680618286,
0.6007367968559265,
0.6559697985649109,
0.5761397480964661,
-0.10622573643922806,
1.0096708536148071,
-1.0722078084945679,
0.7152814269065857,
-1.0549646615982056,
-1.8507695198059082,
-1.3771178722381592,
-2.2822375297546387,
-2.237025260925293,
0.7035139799118042,
-0.49130865931510925,
-0.5115422010421753,
2.16713285446167,
-1.023158311843872,
-1.635885238647461,
1.0609755516052246,
0.2572367787361145,
-0.06345124542713165,
2.4615509510040283,
0.12411442399024963,
-0.7350050806999207,
0.6054387092590332,
-0.7798389792442322,
0.7001067399978638,
-0.3169876039028168,
1.3762907981872559,
0.33791545033454895,
-0.9900665283203125,
1.5881952047348022,
-0.34248507022857666,
0.6185698509216309,
-0.5410996079444885,
-0.5502992272377014,
-0.6263128519058228,
0.20199163258075714,
1.9014486074447632,
-0.21834717690944672,
1.4227933883666992,
-0.21350812911987305,
-1.569549322128296,
-1.5851812362670898,
0.9253190159797668,
0.4385651648044586,
-0.7480800151824951,
0.059442758560180664,
-0.42155298590660095,
0.17006081342697144,
-0.08002977818250656,
1.1516153812408447,
1.3257001638412476,
0.8472296595573425,
-0.47398775815963745,
-0.8499035239219666,
0.0805971622467041,
-0.011965928599238396,
-0.825693666934967,
-1.682505488395691,
-0.33841508626937866,
0.05956023931503296,
0.6260541677474976,
-1.208051085472107,
1.7589542865753174,
0.80884850025177,
1.8481539487838745,
1.07976496219635,
-0.47273221611976624,
1.5473297834396362,
0.1616584062576294,
1.8101682662963867,
-0.490599662065506,
0.5147791504859924,
-0.4472212493419647,
-1.170668601989746,
0.8898594379425049,
-0.23484544456005096,
-2.050900936126709,
-0.729308545589447,
-0.6270204782485962,
-0.14833921194076538,
-0.8592010140419006,
1.0440782308578491,
-0.23335207998752594,
-1.3819509744644165,
0.29371705651283264,
-0.8454931974411011,
0.07729790359735489,
-1.2299715280532837,
0.3920486271381378,
0.6844051480293274,
-0.6082680821418762,
0.09739906340837479,
-0.2418777197599411,
-1.2545987367630005,
-0.45424801111221313,
0.27555137872695923,
1.8199012279510498,
-0.7073675394058228,
0.8179892897605896,
1.1211665868759155,
-0.7160565853118896,
-0.04647962003946304,
0.2133711278438568,
-0.31942903995513916,
0.7505599856376648,
-1.0691927671432495,
-0.48060888051986694,
1.2514474391937256,
-0.2507752478122711,
-0.5570841431617737,
1.4873536825180054,
0.673974335193634,
-1.0040934085845947,
-0.2030254602432251,
-0.1352817565202713,
-0.84874027967453,
0.14111553132534027,
-1.5891026258468628,
-0.06816871464252472,
0.6169010400772095,
-1.5948705673217773,
-0.4674120545387268,
-0.12771479785442352,
1.3098390102386475,
-0.07824160903692245,
1.3672527074813843,
-0.3412829339504242,
-0.04197496175765991,
-0.3337615430355072,
-0.3126315474510193,
0.007705973461270332,
-0.25189080834388733,
-0.5914492011070251,
0.15942226350307465,
-0.8175326585769653,
0.3166666328907013,
1.388513445854187,
0.32492583990097046,
0.1163521409034729,
0.45153144001960754,
1.0874967575073242,
0.4774904251098633,
-0.1494368463754654,
-0.7707661390304565,
-1.4318909645080566,
1.9866306781768799,
-1.3513728380203247,
2.0532455444335938,
0.779127299785614,
-0.09339059889316559,
-1.800125002861023,
-1.9356989860534668,
1.3272793292999268,
1.1244986057281494,
2.2870941162109375,
0.4674566984176636,
0.4753468334674835,
-0.7304573655128479,
-0.6769848465919495,
0.2533665597438812,
-1.0092570781707764,
-0.7232780456542969,
0.3622452914714813,
2.4156973361968994,
1.6559604406356812,
-0.3801165223121643,
-0.06536290049552917,
-0.9895331859588623,
1.481484293937683,
-0.21081224083900452,
0.23744221031665802,
2.04732608795166,
-0.14998146891593933,
-1.040237307548523,
1.3882731199264526,
-2.360750913619995,
0.18661046028137207,
2.053842067718506,
0.25709646940231323,
0.09448123723268509,
-1.3155343532562256,
-0.6760725378990173,
-0.4280935525894165,
-0.4112291932106018,
-1.264431118965149,
0.563103199005127,
-0.21353158354759216,
-0.7907809615135193,
-1.3616656064987183,
0.22211091220378876,
-1.1102262735366821,
-1.707518219947815,
0.09560414403676987,
1.984374761581421,
2.020869493484497,
-0.7966712713241577,
1.6272541284561157,
-0.32580405473709106,
0.13634085655212402,
1.2456550598144531,
1.1275097131729126,
3.076444387435913,
1.8724026679992676,
-1.241721272468567,
0.6879292726516724,
-0.197114959359169,
-0.5170313715934753,
1.1955560445785522,
-1.3039323091506958,
1.2776349782943726,
-0.16325868666172028,
-1.2881659269332886,
-1.193722128868103,
0.9588210582733154,
0.4408378005027771,
0.009171037003397942,
-0.4357162415981293,
1.2508233785629272,
0.0745619460940361,
1.4718419313430786,
0.5554131865501404,
-0.16116297245025635,
0.6120611429214478,
-0.35656532645225525,
-0.4776490330696106,
1.5382404327392578,
0.27318090200424194,
-1.4432826042175293,
-2.306305408477783,
-0.2805421054363251,
-0.8224802613258362,
0.07534736394882202,
-0.527797281742096,
-0.9845789074897766,
1.6530100107192993,
0.314877986907959,
-1.2411093711853027,
-0.3032737076282501,
-0.3364596366882324,
-0.45298951864242554,
2.8003363609313965,
-1.294073224067688,
-0.14452826976776123,
-0.9369300007820129,
-0.6826546788215637,
1.6113641262054443,
-1.311335802078247,
-0.1533133089542389,
-1.020583987236023,
-0.5086864829063416,
-1.242508053779602,
-0.5841601490974426,
0.0493147149682045,
-1.066530466079712,
0.7135696411132812,
0.3290761709213257,
-1.2149219512939453,
-0.37104859948158264,
-0.9237496852874756,
0.9056394696235657,
-0.17448286712169647,
0.2849523723125458,
1.8643819093704224,
0.47255146503448486,
-0.4004441499710083,
0.7942101359367371,
1.1159838438034058,
0.6133142113685608,
-0.5313892960548401,
0.17073670029640198,
-0.7467685341835022,
0.3723193109035492,
-1.259987473487854,
0.20256765186786652,
-2.7562901973724365,
0.6970604658126831,
-0.05932997167110443,
-0.01707061380147934,
0.018227234482765198,
-1.278723120689392,
1.133148193359375,
2.594196319580078,
-1.1766520738601685,
0.5116450786590576,
0.40100252628326416,
1.1168705224990845,
-1.4928559064865112,
0.3314802050590515,
-0.3247475028038025,
2.1138134002685547,
0.22161050140857697,
1.1812745332717896,
-0.4136557877063751,
-2.502885580062866,
0.7819675207138062,
-1.28312087059021,
-1.2627230882644653,
0.7804551720619202,
-0.9984866976737976,
0.11899636685848236,
-1.511934518814087,
-0.17548760771751404,
-0.8294364213943481,
-1.1054314374923706,
0.6604419946670532,
0.07095027714967728,
0.34499478340148926,
-0.5031442642211914,
0.26068592071533203,
-2.2456448078155518,
-1.4647793769836426,
-0.24511925876140594,
-1.0123889446258545,
0.5772535800933838,
-0.40294769406318665,
0.7455220818519592,
-0.21030153334140778,
-0.13604532182216644,
0.46143513917922974,
1.449095368385315,
3.363424062728882,
0.18891195952892303,
0.34868133068084717,
-0.22353075444698334,
-1.056549310684204,
1.4563881158828735,
0.8035892248153687,
-0.1594458818435669,
-0.45170292258262634,
-0.983418345451355,
1.1755601167678833,
1.9552175998687744,
0.904200553894043,
0.020596275106072426,
-0.9156649708747864,
-0.7795367240905762,
-0.008555571548640728,
0.22861503064632416,
0.44571995735168457,
0.908045768737793,
0.04519239813089371,
-0.06132647395133972,
1.5319792032241821,
1.2149320840835571,
-0.37614285945892334,
0.38189420104026794,
-0.8254636526107788,
-0.5738593339920044,
0.6402574181556702,
0.1999981552362442,
-0.019147507846355438,
0.353577584028244,
-0.971246063709259,
-0.2805793285369873,
-0.42935070395469666,
-0.7379177212715149,
-0.7813884019851685,
-0.37001267075538635,
-0.3880191445350647,
1.6665986776351929,
0.07715223729610443,
-0.5587777495384216,
0.07359803467988968,
-0.7360615134239197,
-0.13656862080097198,
-1.1304571628570557,
0.323556512594223,
-0.15007296204566956,
-0.10678477585315704,
-0.2697353959083557,
1.773516058921814,
-0.989224910736084,
-2.038726329803467,
0.263361394405365,
0.25080180168151855,
-0.1898985356092453,
0.30598896741867065,
1.736785650253296,
0.5549519658088684,
1.5070621967315674,
1.289399266242981,
0.9153175950050354,
-0.6799737811088562,
-1.3801817893981934,
0.794060230255127,
0.9468245506286621,
-1.3174705505371094,
0.7698445320129395,
-0.02118169330060482,
-0.515034556388855,
0.5090618133544922,
1.218361735343933,
0.5529425144195557,
-2.015817403793335,
0.8537753820419312,
-0.89032381772995,
0.8559240102767944,
0.7164908051490784,
0.7363265752792358,
0.1708836853504181,
0.7496377825737,
-1.2121896743774414,
-1.1392371654510498,
-0.723315954208374,
-0.7494248151779175,
1.8603686094284058,
-0.4275440573692322,
0.6363610029220581,
-0.2181091457605362,
-1.491425633430481,
-0.12469901144504547,
0.5848944187164307,
0.4492700695991516,
-0.5849014520645142,
0.7944158911705017,
-0.6095691323280334,
-1.070037603378296,
-1.302433729171753,
-0.3618488311767578,
-1.0614559650421143,
-0.9521962404251099,
0.9979340434074402,
0.734269380569458,
0.28917190432548523,
1.816300868988037,
0.6622653007507324,
0.22303198277950287,
-2.6050186157226562,
0.9603624939918518,
0.2459079772233963,
-0.1865842342376709,
0.8707472085952759,
0.4823276996612549,
0.9713099002838135,
-0.11126554757356644,
0.5916697978973389,
-2.443723678588867,
2.413156270980835,
-0.22145970165729523,
0.7115790843963623,
0.01527586579322815,
-0.1785006821155548,
1.0040991306304932,
0.579433798789978,
0.47949808835983276,
-1.0194756984710693,
0.5337543487548828,
-0.5865712761878967,
1.2995771169662476,
0.7692196369171143,
-0.7458346486091614,
-0.08886131644248962,
1.3184010982513428,
0.5285483598709106,
-0.544343113899231,
-0.971562385559082,
-0.9276891946792603,
0.9457303285598755,
1.5928572416305542,
-0.13288624584674835,
-0.06355386227369308,
0.8704906105995178,
0.6421855688095093,
-1.335671067237854,
0.022951727733016014,
-0.6691588759422302,
-0.7208632230758667,
1.6531754732131958,
2.160050868988037,
-0.18376745283603668,
-0.21759675443172455,
-0.68389892578125,
-1.2997335195541382,
0.8782318830490112,
-0.11044658720493317,
0.13424964249134064,
0.5614043474197388,
-0.5372183322906494,
0.9897505044937134,
0.8782334923744202,
0.9995524287223816,
0.22479470074176788,
0.3493664264678955,
0.2844555974006653,
-0.3724301755428314,
-1.136401891708374,
-0.1527034193277359,
-1.0960983037948608,
-2.5336945056915283,
0.3967333734035492,
-0.2640548050403595,
-1.390511155128479,
-0.013368796557188034,
-1.0747153759002686,
0.9691210389137268,
-0.5098095536231995,
-1.0463441610336304,
-1.4754093885421753,
0.10299280285835266,
-0.0042171785607934,
1.1419280767440796,
-1.5255986452102661,
-0.12143988907337189,
1.1746857166290283,
0.8909662365913391,
-0.7295611500740051,
0.9231476783752441,
0.3272498846054077,
1.1631397008895874,
0.8118412494659424,
-0.3883035480976105,
0.5996698141098022,
-0.017529025673866272,
-1.2898300886154175,
0.42141562700271606,
1.1449838876724243,
0.15437890589237213,
1.4700491428375244,
-0.5569185614585876,
-0.043142810463905334,
0.3318552076816559,
-0.6345858573913574,
-0.42408889532089233,
-0.5819357633590698,
0.6572117805480957,
0.10332352668046951,
-1.0126363039016724,
-0.1413995921611786,
-0.10300057381391525,
-0.21480439603328705,
0.19884353876113892,
-1.4715592861175537,
-0.1640302985906601,
-0.42147424817085266,
-0.6076211333274841,
-1.2300626039505005,
-0.09242326766252518,
1.3379485607147217,
-0.7161126136779785,
-0.18922121822834015,
0.3458441495895386,
0.2699620723724365,
0.5965944528579712,
0.6407627463340759,
-0.7765809893608093,
-0.36930519342422485,
-0.3366362750530243,
-0.4608771800994873,
0.24388693273067474,
1.4040511846542358,
-0.043507449328899384,
-1.0485310554504395,
0.757555365562439,
-0.39290088415145874,
0.05435416102409363,
1.904719352722168,
0.06809692829847336,
-0.875403642654419,
0.22664155066013336,
-0.7071912288665771,
1.8128294944763184,
1.8219959735870361,
1.3794304132461548,
-0.24387799203395844,
-0.9474482536315918,
0.663750410079956,
-0.4538431763648987,
-0.36572596430778503,
0.7323055863380432,
0.3383329510688782,
-0.29601097106933594,
-1.4030282497406006,
0.8026648163795471,
1.1768131256103516,
-0.8125168085098267,
-0.7862750887870789,
0.18418346345424652,
-0.7087627053260803,
1.1843980550765991,
0.7563101053237915,
0.3802812695503235,
0.3439512550830841,
1.6420100927352905,
0.813075065612793,
-0.44180357456207275,
0.519500732421875,
0.6223601698875427,
-0.18462641537189484,
-2.1287450790405273,
-1.180174469947815,
0.3547115623950958,
-0.5755719542503357,
-1.6703486442565918,
1.5735366344451904,
-1.1878862380981445,
-0.9498633742332458,
0.5489029884338379,
-0.00979637075215578,
1.4106175899505615,
0.4576656222343445,
1.5300676822662354,
1.9918066263198853,
0.8970447778701782,
0.4182312488555908,
1.1762468814849854,
-0.13842029869556427,
-0.3763048052787781,
1.8004060983657837,
-0.43418240547180176,
0.48851385712623596,
1.070627212524414,
-0.3003590404987335,
-1.0491772890090942,
-0.8383055925369263,
-1.340289831161499,
-0.7561604380607605,
1.2887842655181885,
0.00786665454506874,
-1.1855841875076294,
0.29339709877967834,
1.6255619525909424,
-0.0012141838669776917,
-0.3895188570022583,
0.6113467216491699,
0.31609171628952026,
-0.843197226524353,
-0.13857212662696838,
-0.8415522575378418,
0.5753656625747681,
-0.19930540025234222,
-0.3319644033908844,
0.3375139534473419,
0.4320450723171234,
1.4408100843429565,
-0.05136696249246597,
0.09439306706190109,
1.0328621864318848,
-1.4205125570297241,
1.4221670627593994,
-0.6358841061592102,
0.18993273377418518,
-2.1265552043914795,
1.350541114807129,
-0.6838746070861816,
1.9963892698287964,
-2.7137973308563232,
0.5790714025497437,
-0.48212018609046936,
-0.37606263160705566,
0.1703815758228302,
-0.40568509697914124,
0.12055803835391998,
-0.11043298989534378,
-1.1282819509506226,
-0.11058036983013153,
-0.6448119282722473,
0.6161030530929565,
1.0303573608398438,
1.553009271621704,
-1.059073567390442,
-0.2560689151287079,
-1.655745029449463,
-0.1280115395784378,
-0.8004583120346069,
0.26840001344680786,
-1.8464865684509277,
-0.2508079409599304,
-2.0036399364471436,
-2.3052148818969727,
-1.1855705976486206,
-0.6324548125267029,
1.0844863653182983,
0.07266609370708466,
-0.8796202540397644,
1.2434831857681274,
-0.3865315318107605,
-1.8730900287628174,
1.123240351676941,
-2.1565401554107666
] |
https://github.com/huggingface/datasets/issues/5129 | unexpected `cast` or `class_encode_column` result after `rename_column` | Hi, 方子东. I tried running the code with exact the same configuration (both datasets 2.5.2 and 2.6.1, python, pyarrow, pandas), but on Linux. The results seem to be the expected `{<pyarrow.Int64Scalar: 4>, <pyarrow.Int64Scalar: 2>, <pyarrow.Int64Scalar: 3>, <pyarrow.Int64Scalar: 0>, <pyarrow.Int64Scalar: 1>}`.
I don't have a Mac device. I can't verify whether this is a M1 chip-specific problem. | ## Describe the bug
When invoke `cast` or `class_encode_column` to a colunm renamed by `rename_column` , it will convert all the variables in this column into one variable. I also run this script in version 2.5.2, this bug does not appear. So I switched to the older version.
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("amazon_reviews_multi", "en")
data = dataset['train']
data = data.remove_columns(
[
"review_id",
"product_id",
"reviewer_id",
"review_title",
"language",
"product_category",
]
)
data = data.rename_column("review_body", "text")
data1 = data.class_encode_column("stars")
print(set(data1.data.columns[0]))
# output: {<pyarrow.Int64Scalar: 4>, <pyarrow.Int64Scalar: 2>, <pyarrow.Int64Scalar: 3>, <pyarrow.Int64Scalar: 0>, <pyarrow.Int64Scalar: 1>}
data = data.rename_column("stars", "label")
print(set(data.data.columns[0]))
# output: {<pyarrow.Int32Scalar: 5>, <pyarrow.Int32Scalar: 4>, <pyarrow.Int32Scalar: 1>, <pyarrow.Int32Scalar: 3>, <pyarrow.Int32Scalar: 2>}
data2 = data.class_encode_column("label")
print(set(data2.data.columns[0]))
# output: {<pyarrow.Int64Scalar: 0>}
```
## Expected results
the last print should be:
{<pyarrow.Int64Scalar: 4>, <pyarrow.Int64Scalar: 2>, <pyarrow.Int64Scalar: 3>, <pyarrow.Int64Scalar: 0>, <pyarrow.Int64Scalar: 1>}
## Actual results
but it output:
{<pyarrow.Int64Scalar: 0>}
## Environment info
- `datasets` version: 2.6.1
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.10.6
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 471 | 56 | unexpected `cast` or `class_encode_column` result after `rename_column`
## Describe the bug
When invoke `cast` or `class_encode_column` to a colunm renamed by `rename_column` , it will convert all the variables in this column into one variable. I also run this script in version 2.5.2, this bug does not appear. So I switched to the older version.
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("amazon_reviews_multi", "en")
data = dataset['train']
data = data.remove_columns(
[
"review_id",
"product_id",
"reviewer_id",
"review_title",
"language",
"product_category",
]
)
data = data.rename_column("review_body", "text")
data1 = data.class_encode_column("stars")
print(set(data1.data.columns[0]))
# output: {<pyarrow.Int64Scalar: 4>, <pyarrow.Int64Scalar: 2>, <pyarrow.Int64Scalar: 3>, <pyarrow.Int64Scalar: 0>, <pyarrow.Int64Scalar: 1>}
data = data.rename_column("stars", "label")
print(set(data.data.columns[0]))
# output: {<pyarrow.Int32Scalar: 5>, <pyarrow.Int32Scalar: 4>, <pyarrow.Int32Scalar: 1>, <pyarrow.Int32Scalar: 3>, <pyarrow.Int32Scalar: 2>}
data2 = data.class_encode_column("label")
print(set(data2.data.columns[0]))
# output: {<pyarrow.Int64Scalar: 0>}
```
## Expected results
the last print should be:
{<pyarrow.Int64Scalar: 4>, <pyarrow.Int64Scalar: 2>, <pyarrow.Int64Scalar: 3>, <pyarrow.Int64Scalar: 0>, <pyarrow.Int64Scalar: 1>}
## Actual results
but it output:
{<pyarrow.Int64Scalar: 0>}
## Environment info
- `datasets` version: 2.6.1
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.10.6
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Hi, 方子东. I tried running the code with exact the same configuration (both datasets 2.5.2 and 2.6.1, python, pyarrow, pandas), but on Linux. The results seem to be the expected `{<pyarrow.Int64Scalar: 4>, <pyarrow.Int64Scalar: 2>, <pyarrow.Int64Scalar: 3>, <pyarrow.Int64Scalar: 0>, <pyarrow.Int64Scalar: 1>}`.
I don't have a Mac device. I can't verify whether this is a M1 chip-specific problem. | [
-1.1592960357666016,
-0.7789490222930908,
-0.5669161677360535,
1.5010372400283813,
-0.12522678077220917,
-1.1274248361587524,
0.25514858961105347,
-1.1502554416656494,
1.6793831586837769,
-0.7185186147689819,
0.28748202323913574,
-1.6195738315582275,
0.023260755464434624,
-0.47995197772979736,
-0.6789268851280212,
-0.9933697581291199,
-0.4098317325115204,
-0.7237848043441772,
1.030131220817566,
2.5068700313568115,
1.368522047996521,
-1.4732234477996826,
2.7249412536621094,
0.7347733974456787,
-0.11073058098554611,
-0.9893386960029602,
0.5281793475151062,
-0.03601902723312378,
-1.3869905471801758,
-0.4596661329269409,
-0.9258913397789001,
-0.25448811054229736,
-0.5373871922492981,
-0.5317779779434204,
-0.06690765172243118,
0.48621904850006104,
-0.34973570704460144,
-0.49950462579727173,
-0.615281343460083,
-0.8484716415405273,
0.4727775454521179,
-0.47608718276023865,
0.9223625063896179,
-0.43795132637023926,
1.683894157409668,
-0.6001572608947754,
0.582728385925293,
0.7920841574668884,
1.314950942993164,
0.1793692708015442,
-0.07192876189947128,
0.45046424865722656,
0.3466375768184662,
0.02281993068754673,
0.589989960193634,
1.0283029079437256,
0.8037174940109253,
0.42688557505607605,
0.7093691229820251,
-2.2059431076049805,
1.1334171295166016,
-1.0507917404174805,
0.2242073267698288,
1.3458294868469238,
-0.8280368447303772,
0.28099238872528076,
-1.734978437423706,
-0.14843906462192535,
0.586284875869751,
-2.2314558029174805,
0.3389713168144226,
-1.392076015472412,
-0.4480452835559845,
0.9501218199729919,
0.407564252614975,
-1.1868436336517334,
-0.052499353885650635,
-0.3790544271469116,
0.9829472303390503,
0.43243491649627686,
1.0503158569335938,
-1.7145782709121704,
0.02768481709063053,
-0.34908920526504517,
0.14697113633155823,
-1.0969561338424683,
-1.6092320680618286,
0.6007367968559265,
0.6559697985649109,
0.5761397480964661,
-0.10622573643922806,
1.0096708536148071,
-1.0722078084945679,
0.7152814269065857,
-1.0549646615982056,
-1.8507695198059082,
-1.3771178722381592,
-2.2822375297546387,
-2.237025260925293,
0.7035139799118042,
-0.49130865931510925,
-0.5115422010421753,
2.16713285446167,
-1.023158311843872,
-1.635885238647461,
1.0609755516052246,
0.2572367787361145,
-0.06345124542713165,
2.4615509510040283,
0.12411442399024963,
-0.7350050806999207,
0.6054387092590332,
-0.7798389792442322,
0.7001067399978638,
-0.3169876039028168,
1.3762907981872559,
0.33791545033454895,
-0.9900665283203125,
1.5881952047348022,
-0.34248507022857666,
0.6185698509216309,
-0.5410996079444885,
-0.5502992272377014,
-0.6263128519058228,
0.20199163258075714,
1.9014486074447632,
-0.21834717690944672,
1.4227933883666992,
-0.21350812911987305,
-1.569549322128296,
-1.5851812362670898,
0.9253190159797668,
0.4385651648044586,
-0.7480800151824951,
0.059442758560180664,
-0.42155298590660095,
0.17006081342697144,
-0.08002977818250656,
1.1516153812408447,
1.3257001638412476,
0.8472296595573425,
-0.47398775815963745,
-0.8499035239219666,
0.0805971622467041,
-0.011965928599238396,
-0.825693666934967,
-1.682505488395691,
-0.33841508626937866,
0.05956023931503296,
0.6260541677474976,
-1.208051085472107,
1.7589542865753174,
0.80884850025177,
1.8481539487838745,
1.07976496219635,
-0.47273221611976624,
1.5473297834396362,
0.1616584062576294,
1.8101682662963867,
-0.490599662065506,
0.5147791504859924,
-0.4472212493419647,
-1.170668601989746,
0.8898594379425049,
-0.23484544456005096,
-2.050900936126709,
-0.729308545589447,
-0.6270204782485962,
-0.14833921194076538,
-0.8592010140419006,
1.0440782308578491,
-0.23335207998752594,
-1.3819509744644165,
0.29371705651283264,
-0.8454931974411011,
0.07729790359735489,
-1.2299715280532837,
0.3920486271381378,
0.6844051480293274,
-0.6082680821418762,
0.09739906340837479,
-0.2418777197599411,
-1.2545987367630005,
-0.45424801111221313,
0.27555137872695923,
1.8199012279510498,
-0.7073675394058228,
0.8179892897605896,
1.1211665868759155,
-0.7160565853118896,
-0.04647962003946304,
0.2133711278438568,
-0.31942903995513916,
0.7505599856376648,
-1.0691927671432495,
-0.48060888051986694,
1.2514474391937256,
-0.2507752478122711,
-0.5570841431617737,
1.4873536825180054,
0.673974335193634,
-1.0040934085845947,
-0.2030254602432251,
-0.1352817565202713,
-0.84874027967453,
0.14111553132534027,
-1.5891026258468628,
-0.06816871464252472,
0.6169010400772095,
-1.5948705673217773,
-0.4674120545387268,
-0.12771479785442352,
1.3098390102386475,
-0.07824160903692245,
1.3672527074813843,
-0.3412829339504242,
-0.04197496175765991,
-0.3337615430355072,
-0.3126315474510193,
0.007705973461270332,
-0.25189080834388733,
-0.5914492011070251,
0.15942226350307465,
-0.8175326585769653,
0.3166666328907013,
1.388513445854187,
0.32492583990097046,
0.1163521409034729,
0.45153144001960754,
1.0874967575073242,
0.4774904251098633,
-0.1494368463754654,
-0.7707661390304565,
-1.4318909645080566,
1.9866306781768799,
-1.3513728380203247,
2.0532455444335938,
0.779127299785614,
-0.09339059889316559,
-1.800125002861023,
-1.9356989860534668,
1.3272793292999268,
1.1244986057281494,
2.2870941162109375,
0.4674566984176636,
0.4753468334674835,
-0.7304573655128479,
-0.6769848465919495,
0.2533665597438812,
-1.0092570781707764,
-0.7232780456542969,
0.3622452914714813,
2.4156973361968994,
1.6559604406356812,
-0.3801165223121643,
-0.06536290049552917,
-0.9895331859588623,
1.481484293937683,
-0.21081224083900452,
0.23744221031665802,
2.04732608795166,
-0.14998146891593933,
-1.040237307548523,
1.3882731199264526,
-2.360750913619995,
0.18661046028137207,
2.053842067718506,
0.25709646940231323,
0.09448123723268509,
-1.3155343532562256,
-0.6760725378990173,
-0.4280935525894165,
-0.4112291932106018,
-1.264431118965149,
0.563103199005127,
-0.21353158354759216,
-0.7907809615135193,
-1.3616656064987183,
0.22211091220378876,
-1.1102262735366821,
-1.707518219947815,
0.09560414403676987,
1.984374761581421,
2.020869493484497,
-0.7966712713241577,
1.6272541284561157,
-0.32580405473709106,
0.13634085655212402,
1.2456550598144531,
1.1275097131729126,
3.076444387435913,
1.8724026679992676,
-1.241721272468567,
0.6879292726516724,
-0.197114959359169,
-0.5170313715934753,
1.1955560445785522,
-1.3039323091506958,
1.2776349782943726,
-0.16325868666172028,
-1.2881659269332886,
-1.193722128868103,
0.9588210582733154,
0.4408378005027771,
0.009171037003397942,
-0.4357162415981293,
1.2508233785629272,
0.0745619460940361,
1.4718419313430786,
0.5554131865501404,
-0.16116297245025635,
0.6120611429214478,
-0.35656532645225525,
-0.4776490330696106,
1.5382404327392578,
0.27318090200424194,
-1.4432826042175293,
-2.306305408477783,
-0.2805421054363251,
-0.8224802613258362,
0.07534736394882202,
-0.527797281742096,
-0.9845789074897766,
1.6530100107192993,
0.314877986907959,
-1.2411093711853027,
-0.3032737076282501,
-0.3364596366882324,
-0.45298951864242554,
2.8003363609313965,
-1.294073224067688,
-0.14452826976776123,
-0.9369300007820129,
-0.6826546788215637,
1.6113641262054443,
-1.311335802078247,
-0.1533133089542389,
-1.020583987236023,
-0.5086864829063416,
-1.242508053779602,
-0.5841601490974426,
0.0493147149682045,
-1.066530466079712,
0.7135696411132812,
0.3290761709213257,
-1.2149219512939453,
-0.37104859948158264,
-0.9237496852874756,
0.9056394696235657,
-0.17448286712169647,
0.2849523723125458,
1.8643819093704224,
0.47255146503448486,
-0.4004441499710083,
0.7942101359367371,
1.1159838438034058,
0.6133142113685608,
-0.5313892960548401,
0.17073670029640198,
-0.7467685341835022,
0.3723193109035492,
-1.259987473487854,
0.20256765186786652,
-2.7562901973724365,
0.6970604658126831,
-0.05932997167110443,
-0.01707061380147934,
0.018227234482765198,
-1.278723120689392,
1.133148193359375,
2.594196319580078,
-1.1766520738601685,
0.5116450786590576,
0.40100252628326416,
1.1168705224990845,
-1.4928559064865112,
0.3314802050590515,
-0.3247475028038025,
2.1138134002685547,
0.22161050140857697,
1.1812745332717896,
-0.4136557877063751,
-2.502885580062866,
0.7819675207138062,
-1.28312087059021,
-1.2627230882644653,
0.7804551720619202,
-0.9984866976737976,
0.11899636685848236,
-1.511934518814087,
-0.17548760771751404,
-0.8294364213943481,
-1.1054314374923706,
0.6604419946670532,
0.07095027714967728,
0.34499478340148926,
-0.5031442642211914,
0.26068592071533203,
-2.2456448078155518,
-1.4647793769836426,
-0.24511925876140594,
-1.0123889446258545,
0.5772535800933838,
-0.40294769406318665,
0.7455220818519592,
-0.21030153334140778,
-0.13604532182216644,
0.46143513917922974,
1.449095368385315,
3.363424062728882,
0.18891195952892303,
0.34868133068084717,
-0.22353075444698334,
-1.056549310684204,
1.4563881158828735,
0.8035892248153687,
-0.1594458818435669,
-0.45170292258262634,
-0.983418345451355,
1.1755601167678833,
1.9552175998687744,
0.904200553894043,
0.020596275106072426,
-0.9156649708747864,
-0.7795367240905762,
-0.008555571548640728,
0.22861503064632416,
0.44571995735168457,
0.908045768737793,
0.04519239813089371,
-0.06132647395133972,
1.5319792032241821,
1.2149320840835571,
-0.37614285945892334,
0.38189420104026794,
-0.8254636526107788,
-0.5738593339920044,
0.6402574181556702,
0.1999981552362442,
-0.019147507846355438,
0.353577584028244,
-0.971246063709259,
-0.2805793285369873,
-0.42935070395469666,
-0.7379177212715149,
-0.7813884019851685,
-0.37001267075538635,
-0.3880191445350647,
1.6665986776351929,
0.07715223729610443,
-0.5587777495384216,
0.07359803467988968,
-0.7360615134239197,
-0.13656862080097198,
-1.1304571628570557,
0.323556512594223,
-0.15007296204566956,
-0.10678477585315704,
-0.2697353959083557,
1.773516058921814,
-0.989224910736084,
-2.038726329803467,
0.263361394405365,
0.25080180168151855,
-0.1898985356092453,
0.30598896741867065,
1.736785650253296,
0.5549519658088684,
1.5070621967315674,
1.289399266242981,
0.9153175950050354,
-0.6799737811088562,
-1.3801817893981934,
0.794060230255127,
0.9468245506286621,
-1.3174705505371094,
0.7698445320129395,
-0.02118169330060482,
-0.515034556388855,
0.5090618133544922,
1.218361735343933,
0.5529425144195557,
-2.015817403793335,
0.8537753820419312,
-0.89032381772995,
0.8559240102767944,
0.7164908051490784,
0.7363265752792358,
0.1708836853504181,
0.7496377825737,
-1.2121896743774414,
-1.1392371654510498,
-0.723315954208374,
-0.7494248151779175,
1.8603686094284058,
-0.4275440573692322,
0.6363610029220581,
-0.2181091457605362,
-1.491425633430481,
-0.12469901144504547,
0.5848944187164307,
0.4492700695991516,
-0.5849014520645142,
0.7944158911705017,
-0.6095691323280334,
-1.070037603378296,
-1.302433729171753,
-0.3618488311767578,
-1.0614559650421143,
-0.9521962404251099,
0.9979340434074402,
0.734269380569458,
0.28917190432548523,
1.816300868988037,
0.6622653007507324,
0.22303198277950287,
-2.6050186157226562,
0.9603624939918518,
0.2459079772233963,
-0.1865842342376709,
0.8707472085952759,
0.4823276996612549,
0.9713099002838135,
-0.11126554757356644,
0.5916697978973389,
-2.443723678588867,
2.413156270980835,
-0.22145970165729523,
0.7115790843963623,
0.01527586579322815,
-0.1785006821155548,
1.0040991306304932,
0.579433798789978,
0.47949808835983276,
-1.0194756984710693,
0.5337543487548828,
-0.5865712761878967,
1.2995771169662476,
0.7692196369171143,
-0.7458346486091614,
-0.08886131644248962,
1.3184010982513428,
0.5285483598709106,
-0.544343113899231,
-0.971562385559082,
-0.9276891946792603,
0.9457303285598755,
1.5928572416305542,
-0.13288624584674835,
-0.06355386227369308,
0.8704906105995178,
0.6421855688095093,
-1.335671067237854,
0.022951727733016014,
-0.6691588759422302,
-0.7208632230758667,
1.6531754732131958,
2.160050868988037,
-0.18376745283603668,
-0.21759675443172455,
-0.68389892578125,
-1.2997335195541382,
0.8782318830490112,
-0.11044658720493317,
0.13424964249134064,
0.5614043474197388,
-0.5372183322906494,
0.9897505044937134,
0.8782334923744202,
0.9995524287223816,
0.22479470074176788,
0.3493664264678955,
0.2844555974006653,
-0.3724301755428314,
-1.136401891708374,
-0.1527034193277359,
-1.0960983037948608,
-2.5336945056915283,
0.3967333734035492,
-0.2640548050403595,
-1.390511155128479,
-0.013368796557188034,
-1.0747153759002686,
0.9691210389137268,
-0.5098095536231995,
-1.0463441610336304,
-1.4754093885421753,
0.10299280285835266,
-0.0042171785607934,
1.1419280767440796,
-1.5255986452102661,
-0.12143988907337189,
1.1746857166290283,
0.8909662365913391,
-0.7295611500740051,
0.9231476783752441,
0.3272498846054077,
1.1631397008895874,
0.8118412494659424,
-0.3883035480976105,
0.5996698141098022,
-0.017529025673866272,
-1.2898300886154175,
0.42141562700271606,
1.1449838876724243,
0.15437890589237213,
1.4700491428375244,
-0.5569185614585876,
-0.043142810463905334,
0.3318552076816559,
-0.6345858573913574,
-0.42408889532089233,
-0.5819357633590698,
0.6572117805480957,
0.10332352668046951,
-1.0126363039016724,
-0.1413995921611786,
-0.10300057381391525,
-0.21480439603328705,
0.19884353876113892,
-1.4715592861175537,
-0.1640302985906601,
-0.42147424817085266,
-0.6076211333274841,
-1.2300626039505005,
-0.09242326766252518,
1.3379485607147217,
-0.7161126136779785,
-0.18922121822834015,
0.3458441495895386,
0.2699620723724365,
0.5965944528579712,
0.6407627463340759,
-0.7765809893608093,
-0.36930519342422485,
-0.3366362750530243,
-0.4608771800994873,
0.24388693273067474,
1.4040511846542358,
-0.043507449328899384,
-1.0485310554504395,
0.757555365562439,
-0.39290088415145874,
0.05435416102409363,
1.904719352722168,
0.06809692829847336,
-0.875403642654419,
0.22664155066013336,
-0.7071912288665771,
1.8128294944763184,
1.8219959735870361,
1.3794304132461548,
-0.24387799203395844,
-0.9474482536315918,
0.663750410079956,
-0.4538431763648987,
-0.36572596430778503,
0.7323055863380432,
0.3383329510688782,
-0.29601097106933594,
-1.4030282497406006,
0.8026648163795471,
1.1768131256103516,
-0.8125168085098267,
-0.7862750887870789,
0.18418346345424652,
-0.7087627053260803,
1.1843980550765991,
0.7563101053237915,
0.3802812695503235,
0.3439512550830841,
1.6420100927352905,
0.813075065612793,
-0.44180357456207275,
0.519500732421875,
0.6223601698875427,
-0.18462641537189484,
-2.1287450790405273,
-1.180174469947815,
0.3547115623950958,
-0.5755719542503357,
-1.6703486442565918,
1.5735366344451904,
-1.1878862380981445,
-0.9498633742332458,
0.5489029884338379,
-0.00979637075215578,
1.4106175899505615,
0.4576656222343445,
1.5300676822662354,
1.9918066263198853,
0.8970447778701782,
0.4182312488555908,
1.1762468814849854,
-0.13842029869556427,
-0.3763048052787781,
1.8004060983657837,
-0.43418240547180176,
0.48851385712623596,
1.070627212524414,
-0.3003590404987335,
-1.0491772890090942,
-0.8383055925369263,
-1.340289831161499,
-0.7561604380607605,
1.2887842655181885,
0.00786665454506874,
-1.1855841875076294,
0.29339709877967834,
1.6255619525909424,
-0.0012141838669776917,
-0.3895188570022583,
0.6113467216491699,
0.31609171628952026,
-0.843197226524353,
-0.13857212662696838,
-0.8415522575378418,
0.5753656625747681,
-0.19930540025234222,
-0.3319644033908844,
0.3375139534473419,
0.4320450723171234,
1.4408100843429565,
-0.05136696249246597,
0.09439306706190109,
1.0328621864318848,
-1.4205125570297241,
1.4221670627593994,
-0.6358841061592102,
0.18993273377418518,
-2.1265552043914795,
1.350541114807129,
-0.6838746070861816,
1.9963892698287964,
-2.7137973308563232,
0.5790714025497437,
-0.48212018609046936,
-0.37606263160705566,
0.1703815758228302,
-0.40568509697914124,
0.12055803835391998,
-0.11043298989534378,
-1.1282819509506226,
-0.11058036983013153,
-0.6448119282722473,
0.6161030530929565,
1.0303573608398438,
1.553009271621704,
-1.059073567390442,
-0.2560689151287079,
-1.655745029449463,
-0.1280115395784378,
-0.8004583120346069,
0.26840001344680786,
-1.8464865684509277,
-0.2508079409599304,
-2.0036399364471436,
-2.3052148818969727,
-1.1855705976486206,
-0.6324548125267029,
1.0844863653182983,
0.07266609370708466,
-0.8796202540397644,
1.2434831857681274,
-0.3865315318107605,
-1.8730900287628174,
1.123240351676941,
-2.1565401554107666
] |
https://github.com/huggingface/datasets/issues/5129 | unexpected `cast` or `class_encode_column` result after `rename_column` | > Hi! Unfortunately, I can't reproduce this issue locally (in Python 3.7/3.10) or in Colab. I would assume this is due to a bug we fixed in the latest release, but your version is up-to-date, so I'm not sure if there is something we can do to help...
Thank you for your attention and feel sorry to take your time. Since this is a bug of old version, I think mybe my problem is because `cast` operation directaly used cached data generated by older verion of `datasets`. I tried to deleted the cached data and I got expected result.
| ## Describe the bug
When invoke `cast` or `class_encode_column` to a colunm renamed by `rename_column` , it will convert all the variables in this column into one variable. I also run this script in version 2.5.2, this bug does not appear. So I switched to the older version.
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("amazon_reviews_multi", "en")
data = dataset['train']
data = data.remove_columns(
[
"review_id",
"product_id",
"reviewer_id",
"review_title",
"language",
"product_category",
]
)
data = data.rename_column("review_body", "text")
data1 = data.class_encode_column("stars")
print(set(data1.data.columns[0]))
# output: {<pyarrow.Int64Scalar: 4>, <pyarrow.Int64Scalar: 2>, <pyarrow.Int64Scalar: 3>, <pyarrow.Int64Scalar: 0>, <pyarrow.Int64Scalar: 1>}
data = data.rename_column("stars", "label")
print(set(data.data.columns[0]))
# output: {<pyarrow.Int32Scalar: 5>, <pyarrow.Int32Scalar: 4>, <pyarrow.Int32Scalar: 1>, <pyarrow.Int32Scalar: 3>, <pyarrow.Int32Scalar: 2>}
data2 = data.class_encode_column("label")
print(set(data2.data.columns[0]))
# output: {<pyarrow.Int64Scalar: 0>}
```
## Expected results
the last print should be:
{<pyarrow.Int64Scalar: 4>, <pyarrow.Int64Scalar: 2>, <pyarrow.Int64Scalar: 3>, <pyarrow.Int64Scalar: 0>, <pyarrow.Int64Scalar: 1>}
## Actual results
but it output:
{<pyarrow.Int64Scalar: 0>}
## Environment info
- `datasets` version: 2.6.1
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.10.6
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
| 471 | 99 | unexpected `cast` or `class_encode_column` result after `rename_column`
## Describe the bug
When invoke `cast` or `class_encode_column` to a colunm renamed by `rename_column` , it will convert all the variables in this column into one variable. I also run this script in version 2.5.2, this bug does not appear. So I switched to the older version.
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("amazon_reviews_multi", "en")
data = dataset['train']
data = data.remove_columns(
[
"review_id",
"product_id",
"reviewer_id",
"review_title",
"language",
"product_category",
]
)
data = data.rename_column("review_body", "text")
data1 = data.class_encode_column("stars")
print(set(data1.data.columns[0]))
# output: {<pyarrow.Int64Scalar: 4>, <pyarrow.Int64Scalar: 2>, <pyarrow.Int64Scalar: 3>, <pyarrow.Int64Scalar: 0>, <pyarrow.Int64Scalar: 1>}
data = data.rename_column("stars", "label")
print(set(data.data.columns[0]))
# output: {<pyarrow.Int32Scalar: 5>, <pyarrow.Int32Scalar: 4>, <pyarrow.Int32Scalar: 1>, <pyarrow.Int32Scalar: 3>, <pyarrow.Int32Scalar: 2>}
data2 = data.class_encode_column("label")
print(set(data2.data.columns[0]))
# output: {<pyarrow.Int64Scalar: 0>}
```
## Expected results
the last print should be:
{<pyarrow.Int64Scalar: 4>, <pyarrow.Int64Scalar: 2>, <pyarrow.Int64Scalar: 3>, <pyarrow.Int64Scalar: 0>, <pyarrow.Int64Scalar: 1>}
## Actual results
but it output:
{<pyarrow.Int64Scalar: 0>}
## Environment info
- `datasets` version: 2.6.1
- Platform: macOS-12.5.1-arm64-arm-64bit
- Python version: 3.10.6
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
> Hi! Unfortunately, I can't reproduce this issue locally (in Python 3.7/3.10) or in Colab. I would assume this is due to a bug we fixed in the latest release, but your version is up-to-date, so I'm not sure if there is something we can do to help...
Thank you for your attention and feel sorry to take your time. Since this is a bug of old version, I think mybe my problem is because `cast` operation directaly used cached data generated by older verion of `datasets`. I tried to deleted the cached data and I got expected result.
| [
-1.1592960357666016,
-0.7789490222930908,
-0.5669161677360535,
1.5010372400283813,
-0.12522678077220917,
-1.1274248361587524,
0.25514858961105347,
-1.1502554416656494,
1.6793831586837769,
-0.7185186147689819,
0.28748202323913574,
-1.6195738315582275,
0.023260755464434624,
-0.47995197772979736,
-0.6789268851280212,
-0.9933697581291199,
-0.4098317325115204,
-0.7237848043441772,
1.030131220817566,
2.5068700313568115,
1.368522047996521,
-1.4732234477996826,
2.7249412536621094,
0.7347733974456787,
-0.11073058098554611,
-0.9893386960029602,
0.5281793475151062,
-0.03601902723312378,
-1.3869905471801758,
-0.4596661329269409,
-0.9258913397789001,
-0.25448811054229736,
-0.5373871922492981,
-0.5317779779434204,
-0.06690765172243118,
0.48621904850006104,
-0.34973570704460144,
-0.49950462579727173,
-0.615281343460083,
-0.8484716415405273,
0.4727775454521179,
-0.47608718276023865,
0.9223625063896179,
-0.43795132637023926,
1.683894157409668,
-0.6001572608947754,
0.582728385925293,
0.7920841574668884,
1.314950942993164,
0.1793692708015442,
-0.07192876189947128,
0.45046424865722656,
0.3466375768184662,
0.02281993068754673,
0.589989960193634,
1.0283029079437256,
0.8037174940109253,
0.42688557505607605,
0.7093691229820251,
-2.2059431076049805,
1.1334171295166016,
-1.0507917404174805,
0.2242073267698288,
1.3458294868469238,
-0.8280368447303772,
0.28099238872528076,
-1.734978437423706,
-0.14843906462192535,
0.586284875869751,
-2.2314558029174805,
0.3389713168144226,
-1.392076015472412,
-0.4480452835559845,
0.9501218199729919,
0.407564252614975,
-1.1868436336517334,
-0.052499353885650635,
-0.3790544271469116,
0.9829472303390503,
0.43243491649627686,
1.0503158569335938,
-1.7145782709121704,
0.02768481709063053,
-0.34908920526504517,
0.14697113633155823,
-1.0969561338424683,
-1.6092320680618286,
0.6007367968559265,
0.6559697985649109,
0.5761397480964661,
-0.10622573643922806,
1.0096708536148071,
-1.0722078084945679,
0.7152814269065857,
-1.0549646615982056,
-1.8507695198059082,
-1.3771178722381592,
-2.2822375297546387,
-2.237025260925293,
0.7035139799118042,
-0.49130865931510925,
-0.5115422010421753,
2.16713285446167,
-1.023158311843872,
-1.635885238647461,
1.0609755516052246,
0.2572367787361145,
-0.06345124542713165,
2.4615509510040283,
0.12411442399024963,
-0.7350050806999207,
0.6054387092590332,
-0.7798389792442322,
0.7001067399978638,
-0.3169876039028168,
1.3762907981872559,
0.33791545033454895,
-0.9900665283203125,
1.5881952047348022,
-0.34248507022857666,
0.6185698509216309,
-0.5410996079444885,
-0.5502992272377014,
-0.6263128519058228,
0.20199163258075714,
1.9014486074447632,
-0.21834717690944672,
1.4227933883666992,
-0.21350812911987305,
-1.569549322128296,
-1.5851812362670898,
0.9253190159797668,
0.4385651648044586,
-0.7480800151824951,
0.059442758560180664,
-0.42155298590660095,
0.17006081342697144,
-0.08002977818250656,
1.1516153812408447,
1.3257001638412476,
0.8472296595573425,
-0.47398775815963745,
-0.8499035239219666,
0.0805971622467041,
-0.011965928599238396,
-0.825693666934967,
-1.682505488395691,
-0.33841508626937866,
0.05956023931503296,
0.6260541677474976,
-1.208051085472107,
1.7589542865753174,
0.80884850025177,
1.8481539487838745,
1.07976496219635,
-0.47273221611976624,
1.5473297834396362,
0.1616584062576294,
1.8101682662963867,
-0.490599662065506,
0.5147791504859924,
-0.4472212493419647,
-1.170668601989746,
0.8898594379425049,
-0.23484544456005096,
-2.050900936126709,
-0.729308545589447,
-0.6270204782485962,
-0.14833921194076538,
-0.8592010140419006,
1.0440782308578491,
-0.23335207998752594,
-1.3819509744644165,
0.29371705651283264,
-0.8454931974411011,
0.07729790359735489,
-1.2299715280532837,
0.3920486271381378,
0.6844051480293274,
-0.6082680821418762,
0.09739906340837479,
-0.2418777197599411,
-1.2545987367630005,
-0.45424801111221313,
0.27555137872695923,
1.8199012279510498,
-0.7073675394058228,
0.8179892897605896,
1.1211665868759155,
-0.7160565853118896,
-0.04647962003946304,
0.2133711278438568,
-0.31942903995513916,
0.7505599856376648,
-1.0691927671432495,
-0.48060888051986694,
1.2514474391937256,
-0.2507752478122711,
-0.5570841431617737,
1.4873536825180054,
0.673974335193634,
-1.0040934085845947,
-0.2030254602432251,
-0.1352817565202713,
-0.84874027967453,
0.14111553132534027,
-1.5891026258468628,
-0.06816871464252472,
0.6169010400772095,
-1.5948705673217773,
-0.4674120545387268,
-0.12771479785442352,
1.3098390102386475,
-0.07824160903692245,
1.3672527074813843,
-0.3412829339504242,
-0.04197496175765991,
-0.3337615430355072,
-0.3126315474510193,
0.007705973461270332,
-0.25189080834388733,
-0.5914492011070251,
0.15942226350307465,
-0.8175326585769653,
0.3166666328907013,
1.388513445854187,
0.32492583990097046,
0.1163521409034729,
0.45153144001960754,
1.0874967575073242,
0.4774904251098633,
-0.1494368463754654,
-0.7707661390304565,
-1.4318909645080566,
1.9866306781768799,
-1.3513728380203247,
2.0532455444335938,
0.779127299785614,
-0.09339059889316559,
-1.800125002861023,
-1.9356989860534668,
1.3272793292999268,
1.1244986057281494,
2.2870941162109375,
0.4674566984176636,
0.4753468334674835,
-0.7304573655128479,
-0.6769848465919495,
0.2533665597438812,
-1.0092570781707764,
-0.7232780456542969,
0.3622452914714813,
2.4156973361968994,
1.6559604406356812,
-0.3801165223121643,
-0.06536290049552917,
-0.9895331859588623,
1.481484293937683,
-0.21081224083900452,
0.23744221031665802,
2.04732608795166,
-0.14998146891593933,
-1.040237307548523,
1.3882731199264526,
-2.360750913619995,
0.18661046028137207,
2.053842067718506,
0.25709646940231323,
0.09448123723268509,
-1.3155343532562256,
-0.6760725378990173,
-0.4280935525894165,
-0.4112291932106018,
-1.264431118965149,
0.563103199005127,
-0.21353158354759216,
-0.7907809615135193,
-1.3616656064987183,
0.22211091220378876,
-1.1102262735366821,
-1.707518219947815,
0.09560414403676987,
1.984374761581421,
2.020869493484497,
-0.7966712713241577,
1.6272541284561157,
-0.32580405473709106,
0.13634085655212402,
1.2456550598144531,
1.1275097131729126,
3.076444387435913,
1.8724026679992676,
-1.241721272468567,
0.6879292726516724,
-0.197114959359169,
-0.5170313715934753,
1.1955560445785522,
-1.3039323091506958,
1.2776349782943726,
-0.16325868666172028,
-1.2881659269332886,
-1.193722128868103,
0.9588210582733154,
0.4408378005027771,
0.009171037003397942,
-0.4357162415981293,
1.2508233785629272,
0.0745619460940361,
1.4718419313430786,
0.5554131865501404,
-0.16116297245025635,
0.6120611429214478,
-0.35656532645225525,
-0.4776490330696106,
1.5382404327392578,
0.27318090200424194,
-1.4432826042175293,
-2.306305408477783,
-0.2805421054363251,
-0.8224802613258362,
0.07534736394882202,
-0.527797281742096,
-0.9845789074897766,
1.6530100107192993,
0.314877986907959,
-1.2411093711853027,
-0.3032737076282501,
-0.3364596366882324,
-0.45298951864242554,
2.8003363609313965,
-1.294073224067688,
-0.14452826976776123,
-0.9369300007820129,
-0.6826546788215637,
1.6113641262054443,
-1.311335802078247,
-0.1533133089542389,
-1.020583987236023,
-0.5086864829063416,
-1.242508053779602,
-0.5841601490974426,
0.0493147149682045,
-1.066530466079712,
0.7135696411132812,
0.3290761709213257,
-1.2149219512939453,
-0.37104859948158264,
-0.9237496852874756,
0.9056394696235657,
-0.17448286712169647,
0.2849523723125458,
1.8643819093704224,
0.47255146503448486,
-0.4004441499710083,
0.7942101359367371,
1.1159838438034058,
0.6133142113685608,
-0.5313892960548401,
0.17073670029640198,
-0.7467685341835022,
0.3723193109035492,
-1.259987473487854,
0.20256765186786652,
-2.7562901973724365,
0.6970604658126831,
-0.05932997167110443,
-0.01707061380147934,
0.018227234482765198,
-1.278723120689392,
1.133148193359375,
2.594196319580078,
-1.1766520738601685,
0.5116450786590576,
0.40100252628326416,
1.1168705224990845,
-1.4928559064865112,
0.3314802050590515,
-0.3247475028038025,
2.1138134002685547,
0.22161050140857697,
1.1812745332717896,
-0.4136557877063751,
-2.502885580062866,
0.7819675207138062,
-1.28312087059021,
-1.2627230882644653,
0.7804551720619202,
-0.9984866976737976,
0.11899636685848236,
-1.511934518814087,
-0.17548760771751404,
-0.8294364213943481,
-1.1054314374923706,
0.6604419946670532,
0.07095027714967728,
0.34499478340148926,
-0.5031442642211914,
0.26068592071533203,
-2.2456448078155518,
-1.4647793769836426,
-0.24511925876140594,
-1.0123889446258545,
0.5772535800933838,
-0.40294769406318665,
0.7455220818519592,
-0.21030153334140778,
-0.13604532182216644,
0.46143513917922974,
1.449095368385315,
3.363424062728882,
0.18891195952892303,
0.34868133068084717,
-0.22353075444698334,
-1.056549310684204,
1.4563881158828735,
0.8035892248153687,
-0.1594458818435669,
-0.45170292258262634,
-0.983418345451355,
1.1755601167678833,
1.9552175998687744,
0.904200553894043,
0.020596275106072426,
-0.9156649708747864,
-0.7795367240905762,
-0.008555571548640728,
0.22861503064632416,
0.44571995735168457,
0.908045768737793,
0.04519239813089371,
-0.06132647395133972,
1.5319792032241821,
1.2149320840835571,
-0.37614285945892334,
0.38189420104026794,
-0.8254636526107788,
-0.5738593339920044,
0.6402574181556702,
0.1999981552362442,
-0.019147507846355438,
0.353577584028244,
-0.971246063709259,
-0.2805793285369873,
-0.42935070395469666,
-0.7379177212715149,
-0.7813884019851685,
-0.37001267075538635,
-0.3880191445350647,
1.6665986776351929,
0.07715223729610443,
-0.5587777495384216,
0.07359803467988968,
-0.7360615134239197,
-0.13656862080097198,
-1.1304571628570557,
0.323556512594223,
-0.15007296204566956,
-0.10678477585315704,
-0.2697353959083557,
1.773516058921814,
-0.989224910736084,
-2.038726329803467,
0.263361394405365,
0.25080180168151855,
-0.1898985356092453,
0.30598896741867065,
1.736785650253296,
0.5549519658088684,
1.5070621967315674,
1.289399266242981,
0.9153175950050354,
-0.6799737811088562,
-1.3801817893981934,
0.794060230255127,
0.9468245506286621,
-1.3174705505371094,
0.7698445320129395,
-0.02118169330060482,
-0.515034556388855,
0.5090618133544922,
1.218361735343933,
0.5529425144195557,
-2.015817403793335,
0.8537753820419312,
-0.89032381772995,
0.8559240102767944,
0.7164908051490784,
0.7363265752792358,
0.1708836853504181,
0.7496377825737,
-1.2121896743774414,
-1.1392371654510498,
-0.723315954208374,
-0.7494248151779175,
1.8603686094284058,
-0.4275440573692322,
0.6363610029220581,
-0.2181091457605362,
-1.491425633430481,
-0.12469901144504547,
0.5848944187164307,
0.4492700695991516,
-0.5849014520645142,
0.7944158911705017,
-0.6095691323280334,
-1.070037603378296,
-1.302433729171753,
-0.3618488311767578,
-1.0614559650421143,
-0.9521962404251099,
0.9979340434074402,
0.734269380569458,
0.28917190432548523,
1.816300868988037,
0.6622653007507324,
0.22303198277950287,
-2.6050186157226562,
0.9603624939918518,
0.2459079772233963,
-0.1865842342376709,
0.8707472085952759,
0.4823276996612549,
0.9713099002838135,
-0.11126554757356644,
0.5916697978973389,
-2.443723678588867,
2.413156270980835,
-0.22145970165729523,
0.7115790843963623,
0.01527586579322815,
-0.1785006821155548,
1.0040991306304932,
0.579433798789978,
0.47949808835983276,
-1.0194756984710693,
0.5337543487548828,
-0.5865712761878967,
1.2995771169662476,
0.7692196369171143,
-0.7458346486091614,
-0.08886131644248962,
1.3184010982513428,
0.5285483598709106,
-0.544343113899231,
-0.971562385559082,
-0.9276891946792603,
0.9457303285598755,
1.5928572416305542,
-0.13288624584674835,
-0.06355386227369308,
0.8704906105995178,
0.6421855688095093,
-1.335671067237854,
0.022951727733016014,
-0.6691588759422302,
-0.7208632230758667,
1.6531754732131958,
2.160050868988037,
-0.18376745283603668,
-0.21759675443172455,
-0.68389892578125,
-1.2997335195541382,
0.8782318830490112,
-0.11044658720493317,
0.13424964249134064,
0.5614043474197388,
-0.5372183322906494,
0.9897505044937134,
0.8782334923744202,
0.9995524287223816,
0.22479470074176788,
0.3493664264678955,
0.2844555974006653,
-0.3724301755428314,
-1.136401891708374,
-0.1527034193277359,
-1.0960983037948608,
-2.5336945056915283,
0.3967333734035492,
-0.2640548050403595,
-1.390511155128479,
-0.013368796557188034,
-1.0747153759002686,
0.9691210389137268,
-0.5098095536231995,
-1.0463441610336304,
-1.4754093885421753,
0.10299280285835266,
-0.0042171785607934,
1.1419280767440796,
-1.5255986452102661,
-0.12143988907337189,
1.1746857166290283,
0.8909662365913391,
-0.7295611500740051,
0.9231476783752441,
0.3272498846054077,
1.1631397008895874,
0.8118412494659424,
-0.3883035480976105,
0.5996698141098022,
-0.017529025673866272,
-1.2898300886154175,
0.42141562700271606,
1.1449838876724243,
0.15437890589237213,
1.4700491428375244,
-0.5569185614585876,
-0.043142810463905334,
0.3318552076816559,
-0.6345858573913574,
-0.42408889532089233,
-0.5819357633590698,
0.6572117805480957,
0.10332352668046951,
-1.0126363039016724,
-0.1413995921611786,
-0.10300057381391525,
-0.21480439603328705,
0.19884353876113892,
-1.4715592861175537,
-0.1640302985906601,
-0.42147424817085266,
-0.6076211333274841,
-1.2300626039505005,
-0.09242326766252518,
1.3379485607147217,
-0.7161126136779785,
-0.18922121822834015,
0.3458441495895386,
0.2699620723724365,
0.5965944528579712,
0.6407627463340759,
-0.7765809893608093,
-0.36930519342422485,
-0.3366362750530243,
-0.4608771800994873,
0.24388693273067474,
1.4040511846542358,
-0.043507449328899384,
-1.0485310554504395,
0.757555365562439,
-0.39290088415145874,
0.05435416102409363,
1.904719352722168,
0.06809692829847336,
-0.875403642654419,
0.22664155066013336,
-0.7071912288665771,
1.8128294944763184,
1.8219959735870361,
1.3794304132461548,
-0.24387799203395844,
-0.9474482536315918,
0.663750410079956,
-0.4538431763648987,
-0.36572596430778503,
0.7323055863380432,
0.3383329510688782,
-0.29601097106933594,
-1.4030282497406006,
0.8026648163795471,
1.1768131256103516,
-0.8125168085098267,
-0.7862750887870789,
0.18418346345424652,
-0.7087627053260803,
1.1843980550765991,
0.7563101053237915,
0.3802812695503235,
0.3439512550830841,
1.6420100927352905,
0.813075065612793,
-0.44180357456207275,
0.519500732421875,
0.6223601698875427,
-0.18462641537189484,
-2.1287450790405273,
-1.180174469947815,
0.3547115623950958,
-0.5755719542503357,
-1.6703486442565918,
1.5735366344451904,
-1.1878862380981445,
-0.9498633742332458,
0.5489029884338379,
-0.00979637075215578,
1.4106175899505615,
0.4576656222343445,
1.5300676822662354,
1.9918066263198853,
0.8970447778701782,
0.4182312488555908,
1.1762468814849854,
-0.13842029869556427,
-0.3763048052787781,
1.8004060983657837,
-0.43418240547180176,
0.48851385712623596,
1.070627212524414,
-0.3003590404987335,
-1.0491772890090942,
-0.8383055925369263,
-1.340289831161499,
-0.7561604380607605,
1.2887842655181885,
0.00786665454506874,
-1.1855841875076294,
0.29339709877967834,
1.6255619525909424,
-0.0012141838669776917,
-0.3895188570022583,
0.6113467216491699,
0.31609171628952026,
-0.843197226524353,
-0.13857212662696838,
-0.8415522575378418,
0.5753656625747681,
-0.19930540025234222,
-0.3319644033908844,
0.3375139534473419,
0.4320450723171234,
1.4408100843429565,
-0.05136696249246597,
0.09439306706190109,
1.0328621864318848,
-1.4205125570297241,
1.4221670627593994,
-0.6358841061592102,
0.18993273377418518,
-2.1265552043914795,
1.350541114807129,
-0.6838746070861816,
1.9963892698287964,
-2.7137973308563232,
0.5790714025497437,
-0.48212018609046936,
-0.37606263160705566,
0.1703815758228302,
-0.40568509697914124,
0.12055803835391998,
-0.11043298989534378,
-1.1282819509506226,
-0.11058036983013153,
-0.6448119282722473,
0.6161030530929565,
1.0303573608398438,
1.553009271621704,
-1.059073567390442,
-0.2560689151287079,
-1.655745029449463,
-0.1280115395784378,
-0.8004583120346069,
0.26840001344680786,
-1.8464865684509277,
-0.2508079409599304,
-2.0036399364471436,
-2.3052148818969727,
-1.1855705976486206,
-0.6324548125267029,
1.0844863653182983,
0.07266609370708466,
-0.8796202540397644,
1.2434831857681274,
-0.3865315318107605,
-1.8730900287628174,
1.123240351676941,
-2.1565401554107666
] |
https://github.com/huggingface/datasets/issues/5123 | datasets freezes with streaming mode in multiple-gpu | @lhoestq I tested the script without accelerator, and I confirm this is due to datasets part as this gets similar results without accelerator. | ## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
| 472 | 23 | datasets freezes with streaming mode in multiple-gpu
## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
@lhoestq I tested the script without accelerator, and I confirm this is due to datasets part as this gets similar results without accelerator. | [
-1.2196941375732422,
-0.9265390634536743,
-0.7154155969619751,
1.4646788835525513,
-0.1441868543624878,
-1.2404600381851196,
0.09818949550390244,
-1.0889145135879517,
1.561210036277771,
-0.766279399394989,
0.27157339453697205,
-1.6538593769073486,
-0.031017590314149857,
-0.48414796590805054,
-0.753449022769928,
-0.8564292192459106,
-0.43187132477760315,
-0.9085370302200317,
1.0544241666793823,
2.541456460952759,
1.238066554069519,
-1.3789085149765015,
2.707625150680542,
0.6183651089668274,
-0.28375476598739624,
-1.0562281608581543,
0.4914971888065338,
0.05265944451093674,
-1.3426010608673096,
-0.4690755605697632,
-0.9343588948249817,
-0.021768631413578987,
-0.513971745967865,
-0.5481430292129517,
0.1315504014492035,
0.3927555978298187,
-0.19097450375556946,
-0.39653557538986206,
-0.4776310622692108,
-0.674271285533905,
0.45003896951675415,
-0.34303489327430725,
0.9542774558067322,
-0.29673346877098083,
1.7764742374420166,
-0.5822340250015259,
0.4204208552837372,
0.7471269965171814,
1.3177675008773804,
0.1977892965078354,
0.00911825243383646,
0.2995719015598297,
0.3690434694290161,
-0.027073003351688385,
0.5006393194198608,
1.2133288383483887,
0.6470579504966736,
0.4258016347885132,
0.6730741858482361,
-2.206968069076538,
1.32177734375,
-0.8521214723587036,
0.3151848018169403,
1.3639508485794067,
-0.948898196220398,
0.33002108335494995,
-1.8636839389801025,
-0.0408516488969326,
0.5247939229011536,
-2.209108591079712,
0.2663412094116211,
-1.3120408058166504,
-0.5187820196151733,
1.0780906677246094,
0.22621382772922516,
-1.2553026676177979,
0.22724923491477966,
-0.5109614729881287,
1.0825048685073853,
0.502551794052124,
1.2045079469680786,
-1.6525177955627441,
-0.053055305033922195,
-0.22096458077430725,
0.1501053422689438,
-1.269885778427124,
-1.5829702615737915,
0.5515368580818176,
0.622783362865448,
0.6200190186500549,
-0.1245521530508995,
0.9918457865715027,
-1.0412336587905884,
0.8439581394195557,
-0.9657367467880249,
-1.702380895614624,
-1.3975653648376465,
-2.2875359058380127,
-2.3538496494293213,
0.7833411693572998,
-0.49098339676856995,
-0.48595762252807617,
2.043440818786621,
-1.0940463542938232,
-1.8045988082885742,
1.0968130826950073,
0.31212225556373596,
0.03665555268526077,
2.3266162872314453,
0.27054035663604736,
-0.7715662121772766,
0.4353873133659363,
-0.7007548213005066,
0.7579501867294312,
-0.29536670446395874,
1.3403102159500122,
0.49578747153282166,
-0.9768232703208923,
1.5886470079421997,
-0.3369218707084656,
0.5592484474182129,
-0.678779661655426,
-0.5001794695854187,
-0.7466428279876709,
0.28943055868148804,
1.8903740644454956,
-0.3424609899520874,
1.557119607925415,
-0.35824042558670044,
-1.6710333824157715,
-1.553488850593567,
0.783078670501709,
0.5672897100448608,
-0.8038462996482849,
0.08542395383119583,
-0.45937302708625793,
0.04574445262551308,
-0.024679530411958694,
1.0531243085861206,
1.2256052494049072,
0.764526903629303,
-0.3791036903858185,
-0.8700701594352722,
0.22228902578353882,
-0.024389881640672684,
-0.6564667820930481,
-1.7730416059494019,
-0.3114410936832428,
0.19685357809066772,
0.7159045338630676,
-1.2066057920455933,
1.728532314300537,
0.9023963809013367,
1.9766522645950317,
0.9846182465553284,
-0.36182960867881775,
1.5362764596939087,
0.051193155348300934,
1.822758674621582,
-0.48359543085098267,
0.6152960658073425,
-0.3046688437461853,
-1.1953858137130737,
0.8193591833114624,
-0.3840271532535553,
-2.0460617542266846,
-0.7889803051948547,
-0.8046810030937195,
-0.1774633824825287,
-0.765680193901062,
0.9259167909622192,
-0.24395380914211273,
-1.5002785921096802,
0.18586590886116028,
-0.7031571269035339,
0.21713046729564667,
-1.2631146907806396,
0.2876998782157898,
0.7585954666137695,
-0.6546574831008911,
0.03635474294424057,
-0.2847440540790558,
-1.3299492597579956,
-0.482089638710022,
0.2555885314941406,
1.935956597328186,
-0.7466676831245422,
0.9977244734764099,
1.0288703441619873,
-0.6965973377227783,
0.11828635632991791,
0.2761755883693695,
-0.3382411301136017,
0.833848774433136,
-1.1520915031433105,
-0.315114289522171,
1.1405011415481567,
-0.14047589898109436,
-0.5562839508056641,
1.471627116203308,
0.8417165875434875,
-1.0451849699020386,
-0.3005620241165161,
-0.12290839850902557,
-0.7805737853050232,
-0.03752228990197182,
-1.568975567817688,
-0.12197384983301163,
0.3518800139427185,
-1.4865142107009888,
-0.3980593681335449,
-0.24516715109348297,
1.3649996519088745,
-0.20235849916934967,
1.4160126447677612,
-0.23609648644924164,
-0.16662970185279846,
-0.2959860861301422,
-0.41663509607315063,
0.19382227957248688,
-0.23418529331684113,
-0.6433618068695068,
0.318690687417984,
-0.7788034081459045,
0.3863050639629364,
1.5006078481674194,
0.3884235918521881,
-0.00019022077322006226,
0.47417497634887695,
1.1080034971237183,
0.37883907556533813,
-0.002778146415948868,
-0.8164379000663757,
-1.6140708923339844,
2.0191421508789062,
-1.4656296968460083,
1.939512848854065,
0.8449747562408447,
-0.046081412583589554,
-1.7433342933654785,
-1.848331093788147,
1.3511232137680054,
1.1672942638397217,
2.4696943759918213,
0.5762004852294922,
0.42126747965812683,
-0.7756940126419067,
-0.6782505512237549,
0.3392564654350281,
-0.9890856146812439,
-0.6823289394378662,
0.20723594725131989,
2.3987951278686523,
1.7446309328079224,
-0.4842599630355835,
-0.2373860478401184,
-0.8973423838615417,
1.2812271118164062,
-0.15210215747356415,
0.2147456407546997,
2.0669326782226562,
-0.2068791687488556,
-1.0644787549972534,
1.3586879968643188,
-2.3524374961853027,
0.2507283091545105,
2.0961709022521973,
0.23586231470108032,
0.029642552137374878,
-1.4289990663528442,
-0.6397950649261475,
-0.30462199449539185,
-0.4333078861236572,
-1.1869637966156006,
0.587566077709198,
-0.2887362241744995,
-0.8351829648017883,
-1.5269949436187744,
0.11956657469272614,
-1.155600905418396,
-1.7167274951934814,
0.32368239760398865,
1.849785327911377,
2.0171334743499756,
-0.7661897540092468,
1.425772786140442,
-0.30981558561325073,
0.1503465175628662,
1.2077202796936035,
1.297251582145691,
3.0895423889160156,
1.801468849182129,
-1.2655190229415894,
0.7652720212936401,
-0.19671571254730225,
-0.539990246295929,
1.0875061750411987,
-1.1737041473388672,
1.1934410333633423,
-0.18639099597930908,
-1.225818395614624,
-1.2079122066497803,
1.0307289361953735,
0.49156299233436584,
0.11513937264680862,
-0.48870187997817993,
1.25287926197052,
0.13206298649311066,
1.3606230020523071,
0.5472378134727478,
-0.33754125237464905,
0.5767080783843994,
-0.42384764552116394,
-0.5459473729133606,
1.548958659172058,
0.17662404477596283,
-1.4700467586517334,
-2.2897047996520996,
-0.2891959846019745,
-0.83060622215271,
-0.06987574696540833,
-0.6241534948348999,
-1.031946063041687,
1.6046165227890015,
0.4489043653011322,
-1.2942005395889282,
-0.2761368155479431,
-0.2938218116760254,
-0.5316752195358276,
2.5729079246520996,
-1.3579460382461548,
-0.15288743376731873,
-0.9766233563423157,
-0.5494853854179382,
1.6470723152160645,
-1.136026382446289,
-0.24366657435894012,
-1.0180833339691162,
-0.6197898387908936,
-1.290596842765808,
-0.6515306234359741,
0.014519116841256618,
-0.898371696472168,
0.7493624687194824,
0.10976632684469223,
-1.1049569845199585,
-0.2543349862098694,
-0.8716477751731873,
0.9739378690719604,
-0.10408321022987366,
0.21624097228050232,
1.8497835397720337,
0.42586252093315125,
-0.41084054112434387,
0.7086337804794312,
1.1682676076889038,
0.6527948975563049,
-0.7188342809677124,
0.08778499811887741,
-0.7523595690727234,
0.27312031388282776,
-1.3963708877563477,
0.27732372283935547,
-2.920530080795288,
0.6473391652107239,
-0.03915109112858772,
-0.10190664231777191,
-0.01194615289568901,
-1.354688048362732,
1.150322675704956,
2.604787588119507,
-1.1559698581695557,
0.45400241017341614,
0.4082641303539276,
1.1024219989776611,
-1.561321496963501,
0.2809440493583679,
-0.40414464473724365,
2.0925590991973877,
0.1753041297197342,
1.3182090520858765,
-0.4970410168170929,
-2.244457483291626,
0.6311855316162109,
-1.3103537559509277,
-1.1318570375442505,
0.8182228207588196,
-0.9041734337806702,
0.1373426616191864,
-1.402640461921692,
-0.22787636518478394,
-0.874118447303772,
-1.2131516933441162,
0.735505998134613,
0.09235156327486038,
0.4400927424430847,
-0.5481333136558533,
0.40668684244155884,
-2.171538829803467,
-1.3483706712722778,
-0.243732750415802,
-0.9873079657554626,
0.468234121799469,
-0.34478795528411865,
0.6460316181182861,
-0.12398447841405869,
0.10691895335912704,
0.3336278796195984,
1.3938778638839722,
3.356300115585327,
0.26448503136634827,
0.31335100531578064,
-0.07852749526500702,
-0.9935678243637085,
1.4641997814178467,
0.9334990382194519,
-0.09758613258600235,
-0.6031655669212341,
-0.9990250468254089,
1.1396456956863403,
2.052079200744629,
1.1207813024520874,
-0.006237646099179983,
-0.905368447303772,
-0.8131141066551208,
0.025303009897470474,
0.1922958791255951,
0.4902430772781372,
0.9256752133369446,
-0.00039423536509275436,
0.12187507748603821,
1.471239686012268,
1.1707947254180908,
-0.43878719210624695,
0.42896193265914917,
-0.9041079878807068,
-0.4822046160697937,
0.4004333019256592,
0.296958327293396,
0.05653358995914459,
0.4317501485347748,
-1.1210416555404663,
-0.1530856490135193,
-0.3772937059402466,
-0.9523237347602844,
-0.7993472814559937,
-0.46154555678367615,
-0.3354898989200592,
1.592426061630249,
0.03188944607973099,
-0.4231318235397339,
-0.023643802851438522,
-0.7166863083839417,
-0.1101628988981247,
-1.1042165756225586,
0.26067405939102173,
-0.09152278304100037,
-0.059500668197870255,
-0.13640739023685455,
1.7569867372512817,
-0.9890809059143066,
-2.0471696853637695,
0.25865548849105835,
0.2427690327167511,
-0.39798101782798767,
0.12420280277729034,
1.6489001512527466,
0.5068750381469727,
1.3894144296646118,
1.327484130859375,
1.0175814628601074,
-0.6459847092628479,
-1.2752317190170288,
0.7207511067390442,
0.9678804278373718,
-1.300871729850769,
0.8165826797485352,
-0.11118783056735992,
-0.5508304834365845,
0.6469881534576416,
1.3411006927490234,
0.45485082268714905,
-2.0625720024108887,
0.823930561542511,
-0.8976891040802002,
0.6816296577453613,
0.6471803784370422,
0.7939374446868896,
0.1646786481142044,
0.8232812285423279,
-1.2386083602905273,
-1.1066597700119019,
-0.6955675482749939,
-0.6255927085876465,
1.8918193578720093,
-0.2414528876543045,
0.5784627199172974,
-0.1486203968524933,
-1.2790189981460571,
-0.145253986120224,
0.7584624886512756,
0.3545883595943451,
-0.4690890610218048,
0.8293514251708984,
-0.6006035208702087,
-1.0724514722824097,
-1.3015717267990112,
-0.4464477002620697,
-1.0006465911865234,
-0.8824666738510132,
1.025266408920288,
0.70685213804245,
0.3753829896450043,
1.9114933013916016,
0.6000938415527344,
0.29863283038139343,
-2.7106900215148926,
0.8057000637054443,
0.2375808209180832,
-0.05415402725338936,
0.9706848859786987,
0.2624855637550354,
1.0838196277618408,
0.01351988036185503,
0.49397388100624084,
-2.428398609161377,
2.1844253540039062,
-0.17958612740039825,
0.6687203645706177,
-0.013192619197070599,
-0.22652117908000946,
1.1370424032211304,
0.5322349667549133,
0.5769769549369812,
-1.130793809890747,
0.7605836391448975,
-0.5691848993301392,
1.1377058029174805,
0.8039891123771667,
-0.867215096950531,
0.03022468090057373,
1.3170307874679565,
0.43901240825653076,
-0.4231123626232147,
-0.9110164046287537,
-0.9066488742828369,
0.9603777527809143,
1.7261966466903687,
-0.09707985073328018,
0.01699872314929962,
0.8202066421508789,
0.7248592376708984,
-1.2786717414855957,
-0.02794082835316658,
-0.7057914137840271,
-0.7477854490280151,
1.7095874547958374,
2.0935585498809814,
-0.06351744383573532,
-0.27786919474601746,
-0.7600245475769043,
-1.148963451385498,
0.7606449723243713,
-0.08941537886857986,
0.10329741984605789,
0.6662474274635315,
-0.6407580375671387,
1.1971540451049805,
0.7253331542015076,
0.9833413362503052,
0.1105804294347763,
0.3084678649902344,
0.3044417202472687,
-0.26742637157440186,
-1.1745692491531372,
-0.3157472312450409,
-1.055521845817566,
-2.5313963890075684,
0.4662782549858093,
-0.19151100516319275,
-1.45058012008667,
0.059001654386520386,
-1.0368480682373047,
0.8048184514045715,
-0.6094637513160706,
-1.1177098751068115,
-1.5219165086746216,
0.3157980144023895,
-0.15662401914596558,
0.920346200466156,
-1.6107361316680908,
-0.1411217451095581,
1.200111746788025,
0.9329019784927368,
-0.6209761500358582,
0.9791308045387268,
0.23964087665081024,
0.9473481178283691,
0.8147612810134888,
-0.33332934975624084,
0.4917972981929779,
0.2095366269350052,
-1.329925298690796,
0.42729970812797546,
1.2449049949645996,
0.19945387542247772,
1.439924955368042,
-0.5421908497810364,
0.09676084667444229,
0.45800334215164185,
-0.549057126045227,
-0.4840928614139557,
-0.5361000299453735,
0.78970867395401,
0.011676338501274586,
-0.9862543344497681,
0.03036605194211006,
-0.17264914512634277,
-0.2391441911458969,
0.22841103374958038,
-1.543778657913208,
-0.2517963647842407,
-0.3719506859779358,
-0.59010910987854,
-1.24989652633667,
0.047456301748752594,
1.3877105712890625,
-0.8705412745475769,
-0.1880919337272644,
0.4236986041069031,
0.3818496763706207,
0.49899986386299133,
0.6076264381408691,
-0.6488073468208313,
-0.3576003909111023,
-0.268405556678772,
-0.31560778617858887,
0.29020458459854126,
1.2710829973220825,
-0.07541612535715103,
-1.0201566219329834,
0.7526609301567078,
-0.39846861362457275,
0.055150002241134644,
1.9806333780288696,
0.09971404820680618,
-0.7420483231544495,
0.3380867540836334,
-0.6433494687080383,
1.89082670211792,
1.6995576620101929,
1.3766683340072632,
-0.13688240945339203,
-0.9615724682807922,
0.5847254395484924,
-0.23065632581710815,
-0.34625834226608276,
1.0050840377807617,
0.4827395975589752,
-0.16587024927139282,
-1.4012162685394287,
0.57035893201828,
1.298850417137146,
-0.9285339713096619,
-0.7487396597862244,
0.12431658804416656,
-0.902099072933197,
1.130395531654358,
0.6895737648010254,
0.36860132217407227,
0.20259366929531097,
1.5824801921844482,
0.7269153594970703,
-0.4535524845123291,
0.5803003311157227,
0.4690524637699127,
-0.11768174916505814,
-2.0830559730529785,
-0.9730139374732971,
0.34312790632247925,
-0.366370290517807,
-1.5562635660171509,
1.330164909362793,
-1.1540919542312622,
-0.9812217950820923,
0.5206158757209778,
0.10811688750982285,
1.4288722276687622,
0.36608561873435974,
1.6444567441940308,
2.150678873062134,
0.9133062362670898,
0.2801154851913452,
1.237135648727417,
-0.11873719841241837,
-0.4847700595855713,
1.8297356367111206,
-0.4800776243209839,
0.5195631384849548,
1.0618311166763306,
-0.3405071794986725,
-1.052426815032959,
-0.8439233303070068,
-1.1450340747833252,
-0.6678059697151184,
1.1552212238311768,
0.12710312008857727,
-1.2194374799728394,
0.2582300901412964,
1.5545369386672974,
0.1543097198009491,
-0.22860950231552124,
0.6601303219795227,
0.3644070029258728,
-0.7845331430435181,
-0.09692972153425217,
-0.8735353350639343,
0.43150636553764343,
-0.19066351652145386,
-0.30623289942741394,
0.2271261066198349,
0.5726096034049988,
1.2929388284683228,
-0.07162633538246155,
0.024216756224632263,
1.1975769996643066,
-1.454452395439148,
1.510317087173462,
-0.6592196226119995,
0.31169459223747253,
-2.388334274291992,
1.4107471704483032,
-0.8357357978820801,
1.8286961317062378,
-2.634979486465454,
0.3752976357936859,
-0.5417857766151428,
-0.48155999183654785,
0.2566426396369934,
-0.3703153729438782,
0.16529659926891327,
-0.188480943441391,
-1.013573408126831,
-0.1682310402393341,
-0.7394644618034363,
0.6530424356460571,
1.0746451616287231,
1.346523642539978,
-1.1406933069229126,
-0.34748944640159607,
-1.7432204484939575,
-0.2526768445968628,
-0.7143016457557678,
0.34992173314094543,
-1.9305070638656616,
-0.21130608022212982,
-2.0183868408203125,
-2.3586933612823486,
-1.358266830444336,
-0.8189138174057007,
1.0420145988464355,
0.16698923707008362,
-0.9193757176399231,
1.0346778631210327,
-0.3684466481208801,
-1.8442034721374512,
1.1765406131744385,
-2.161062717437744
] |
https://github.com/huggingface/datasets/issues/5123 | datasets freezes with streaming mode in multiple-gpu | Hi ! You said it works on 1 GPU but doesn't wortk without accelerator - what's the difference between running on 1 GPU and running without accelerator in your case ? | ## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
| 472 | 31 | datasets freezes with streaming mode in multiple-gpu
## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
Hi ! You said it works on 1 GPU but doesn't wortk without accelerator - what's the difference between running on 1 GPU and running without accelerator in your case ? | [
-1.2196941375732422,
-0.9265390634536743,
-0.7154155969619751,
1.4646788835525513,
-0.1441868543624878,
-1.2404600381851196,
0.09818949550390244,
-1.0889145135879517,
1.561210036277771,
-0.766279399394989,
0.27157339453697205,
-1.6538593769073486,
-0.031017590314149857,
-0.48414796590805054,
-0.753449022769928,
-0.8564292192459106,
-0.43187132477760315,
-0.9085370302200317,
1.0544241666793823,
2.541456460952759,
1.238066554069519,
-1.3789085149765015,
2.707625150680542,
0.6183651089668274,
-0.28375476598739624,
-1.0562281608581543,
0.4914971888065338,
0.05265944451093674,
-1.3426010608673096,
-0.4690755605697632,
-0.9343588948249817,
-0.021768631413578987,
-0.513971745967865,
-0.5481430292129517,
0.1315504014492035,
0.3927555978298187,
-0.19097450375556946,
-0.39653557538986206,
-0.4776310622692108,
-0.674271285533905,
0.45003896951675415,
-0.34303489327430725,
0.9542774558067322,
-0.29673346877098083,
1.7764742374420166,
-0.5822340250015259,
0.4204208552837372,
0.7471269965171814,
1.3177675008773804,
0.1977892965078354,
0.00911825243383646,
0.2995719015598297,
0.3690434694290161,
-0.027073003351688385,
0.5006393194198608,
1.2133288383483887,
0.6470579504966736,
0.4258016347885132,
0.6730741858482361,
-2.206968069076538,
1.32177734375,
-0.8521214723587036,
0.3151848018169403,
1.3639508485794067,
-0.948898196220398,
0.33002108335494995,
-1.8636839389801025,
-0.0408516488969326,
0.5247939229011536,
-2.209108591079712,
0.2663412094116211,
-1.3120408058166504,
-0.5187820196151733,
1.0780906677246094,
0.22621382772922516,
-1.2553026676177979,
0.22724923491477966,
-0.5109614729881287,
1.0825048685073853,
0.502551794052124,
1.2045079469680786,
-1.6525177955627441,
-0.053055305033922195,
-0.22096458077430725,
0.1501053422689438,
-1.269885778427124,
-1.5829702615737915,
0.5515368580818176,
0.622783362865448,
0.6200190186500549,
-0.1245521530508995,
0.9918457865715027,
-1.0412336587905884,
0.8439581394195557,
-0.9657367467880249,
-1.702380895614624,
-1.3975653648376465,
-2.2875359058380127,
-2.3538496494293213,
0.7833411693572998,
-0.49098339676856995,
-0.48595762252807617,
2.043440818786621,
-1.0940463542938232,
-1.8045988082885742,
1.0968130826950073,
0.31212225556373596,
0.03665555268526077,
2.3266162872314453,
0.27054035663604736,
-0.7715662121772766,
0.4353873133659363,
-0.7007548213005066,
0.7579501867294312,
-0.29536670446395874,
1.3403102159500122,
0.49578747153282166,
-0.9768232703208923,
1.5886470079421997,
-0.3369218707084656,
0.5592484474182129,
-0.678779661655426,
-0.5001794695854187,
-0.7466428279876709,
0.28943055868148804,
1.8903740644454956,
-0.3424609899520874,
1.557119607925415,
-0.35824042558670044,
-1.6710333824157715,
-1.553488850593567,
0.783078670501709,
0.5672897100448608,
-0.8038462996482849,
0.08542395383119583,
-0.45937302708625793,
0.04574445262551308,
-0.024679530411958694,
1.0531243085861206,
1.2256052494049072,
0.764526903629303,
-0.3791036903858185,
-0.8700701594352722,
0.22228902578353882,
-0.024389881640672684,
-0.6564667820930481,
-1.7730416059494019,
-0.3114410936832428,
0.19685357809066772,
0.7159045338630676,
-1.2066057920455933,
1.728532314300537,
0.9023963809013367,
1.9766522645950317,
0.9846182465553284,
-0.36182960867881775,
1.5362764596939087,
0.051193155348300934,
1.822758674621582,
-0.48359543085098267,
0.6152960658073425,
-0.3046688437461853,
-1.1953858137130737,
0.8193591833114624,
-0.3840271532535553,
-2.0460617542266846,
-0.7889803051948547,
-0.8046810030937195,
-0.1774633824825287,
-0.765680193901062,
0.9259167909622192,
-0.24395380914211273,
-1.5002785921096802,
0.18586590886116028,
-0.7031571269035339,
0.21713046729564667,
-1.2631146907806396,
0.2876998782157898,
0.7585954666137695,
-0.6546574831008911,
0.03635474294424057,
-0.2847440540790558,
-1.3299492597579956,
-0.482089638710022,
0.2555885314941406,
1.935956597328186,
-0.7466676831245422,
0.9977244734764099,
1.0288703441619873,
-0.6965973377227783,
0.11828635632991791,
0.2761755883693695,
-0.3382411301136017,
0.833848774433136,
-1.1520915031433105,
-0.315114289522171,
1.1405011415481567,
-0.14047589898109436,
-0.5562839508056641,
1.471627116203308,
0.8417165875434875,
-1.0451849699020386,
-0.3005620241165161,
-0.12290839850902557,
-0.7805737853050232,
-0.03752228990197182,
-1.568975567817688,
-0.12197384983301163,
0.3518800139427185,
-1.4865142107009888,
-0.3980593681335449,
-0.24516715109348297,
1.3649996519088745,
-0.20235849916934967,
1.4160126447677612,
-0.23609648644924164,
-0.16662970185279846,
-0.2959860861301422,
-0.41663509607315063,
0.19382227957248688,
-0.23418529331684113,
-0.6433618068695068,
0.318690687417984,
-0.7788034081459045,
0.3863050639629364,
1.5006078481674194,
0.3884235918521881,
-0.00019022077322006226,
0.47417497634887695,
1.1080034971237183,
0.37883907556533813,
-0.002778146415948868,
-0.8164379000663757,
-1.6140708923339844,
2.0191421508789062,
-1.4656296968460083,
1.939512848854065,
0.8449747562408447,
-0.046081412583589554,
-1.7433342933654785,
-1.848331093788147,
1.3511232137680054,
1.1672942638397217,
2.4696943759918213,
0.5762004852294922,
0.42126747965812683,
-0.7756940126419067,
-0.6782505512237549,
0.3392564654350281,
-0.9890856146812439,
-0.6823289394378662,
0.20723594725131989,
2.3987951278686523,
1.7446309328079224,
-0.4842599630355835,
-0.2373860478401184,
-0.8973423838615417,
1.2812271118164062,
-0.15210215747356415,
0.2147456407546997,
2.0669326782226562,
-0.2068791687488556,
-1.0644787549972534,
1.3586879968643188,
-2.3524374961853027,
0.2507283091545105,
2.0961709022521973,
0.23586231470108032,
0.029642552137374878,
-1.4289990663528442,
-0.6397950649261475,
-0.30462199449539185,
-0.4333078861236572,
-1.1869637966156006,
0.587566077709198,
-0.2887362241744995,
-0.8351829648017883,
-1.5269949436187744,
0.11956657469272614,
-1.155600905418396,
-1.7167274951934814,
0.32368239760398865,
1.849785327911377,
2.0171334743499756,
-0.7661897540092468,
1.425772786140442,
-0.30981558561325073,
0.1503465175628662,
1.2077202796936035,
1.297251582145691,
3.0895423889160156,
1.801468849182129,
-1.2655190229415894,
0.7652720212936401,
-0.19671571254730225,
-0.539990246295929,
1.0875061750411987,
-1.1737041473388672,
1.1934410333633423,
-0.18639099597930908,
-1.225818395614624,
-1.2079122066497803,
1.0307289361953735,
0.49156299233436584,
0.11513937264680862,
-0.48870187997817993,
1.25287926197052,
0.13206298649311066,
1.3606230020523071,
0.5472378134727478,
-0.33754125237464905,
0.5767080783843994,
-0.42384764552116394,
-0.5459473729133606,
1.548958659172058,
0.17662404477596283,
-1.4700467586517334,
-2.2897047996520996,
-0.2891959846019745,
-0.83060622215271,
-0.06987574696540833,
-0.6241534948348999,
-1.031946063041687,
1.6046165227890015,
0.4489043653011322,
-1.2942005395889282,
-0.2761368155479431,
-0.2938218116760254,
-0.5316752195358276,
2.5729079246520996,
-1.3579460382461548,
-0.15288743376731873,
-0.9766233563423157,
-0.5494853854179382,
1.6470723152160645,
-1.136026382446289,
-0.24366657435894012,
-1.0180833339691162,
-0.6197898387908936,
-1.290596842765808,
-0.6515306234359741,
0.014519116841256618,
-0.898371696472168,
0.7493624687194824,
0.10976632684469223,
-1.1049569845199585,
-0.2543349862098694,
-0.8716477751731873,
0.9739378690719604,
-0.10408321022987366,
0.21624097228050232,
1.8497835397720337,
0.42586252093315125,
-0.41084054112434387,
0.7086337804794312,
1.1682676076889038,
0.6527948975563049,
-0.7188342809677124,
0.08778499811887741,
-0.7523595690727234,
0.27312031388282776,
-1.3963708877563477,
0.27732372283935547,
-2.920530080795288,
0.6473391652107239,
-0.03915109112858772,
-0.10190664231777191,
-0.01194615289568901,
-1.354688048362732,
1.150322675704956,
2.604787588119507,
-1.1559698581695557,
0.45400241017341614,
0.4082641303539276,
1.1024219989776611,
-1.561321496963501,
0.2809440493583679,
-0.40414464473724365,
2.0925590991973877,
0.1753041297197342,
1.3182090520858765,
-0.4970410168170929,
-2.244457483291626,
0.6311855316162109,
-1.3103537559509277,
-1.1318570375442505,
0.8182228207588196,
-0.9041734337806702,
0.1373426616191864,
-1.402640461921692,
-0.22787636518478394,
-0.874118447303772,
-1.2131516933441162,
0.735505998134613,
0.09235156327486038,
0.4400927424430847,
-0.5481333136558533,
0.40668684244155884,
-2.171538829803467,
-1.3483706712722778,
-0.243732750415802,
-0.9873079657554626,
0.468234121799469,
-0.34478795528411865,
0.6460316181182861,
-0.12398447841405869,
0.10691895335912704,
0.3336278796195984,
1.3938778638839722,
3.356300115585327,
0.26448503136634827,
0.31335100531578064,
-0.07852749526500702,
-0.9935678243637085,
1.4641997814178467,
0.9334990382194519,
-0.09758613258600235,
-0.6031655669212341,
-0.9990250468254089,
1.1396456956863403,
2.052079200744629,
1.1207813024520874,
-0.006237646099179983,
-0.905368447303772,
-0.8131141066551208,
0.025303009897470474,
0.1922958791255951,
0.4902430772781372,
0.9256752133369446,
-0.00039423536509275436,
0.12187507748603821,
1.471239686012268,
1.1707947254180908,
-0.43878719210624695,
0.42896193265914917,
-0.9041079878807068,
-0.4822046160697937,
0.4004333019256592,
0.296958327293396,
0.05653358995914459,
0.4317501485347748,
-1.1210416555404663,
-0.1530856490135193,
-0.3772937059402466,
-0.9523237347602844,
-0.7993472814559937,
-0.46154555678367615,
-0.3354898989200592,
1.592426061630249,
0.03188944607973099,
-0.4231318235397339,
-0.023643802851438522,
-0.7166863083839417,
-0.1101628988981247,
-1.1042165756225586,
0.26067405939102173,
-0.09152278304100037,
-0.059500668197870255,
-0.13640739023685455,
1.7569867372512817,
-0.9890809059143066,
-2.0471696853637695,
0.25865548849105835,
0.2427690327167511,
-0.39798101782798767,
0.12420280277729034,
1.6489001512527466,
0.5068750381469727,
1.3894144296646118,
1.327484130859375,
1.0175814628601074,
-0.6459847092628479,
-1.2752317190170288,
0.7207511067390442,
0.9678804278373718,
-1.300871729850769,
0.8165826797485352,
-0.11118783056735992,
-0.5508304834365845,
0.6469881534576416,
1.3411006927490234,
0.45485082268714905,
-2.0625720024108887,
0.823930561542511,
-0.8976891040802002,
0.6816296577453613,
0.6471803784370422,
0.7939374446868896,
0.1646786481142044,
0.8232812285423279,
-1.2386083602905273,
-1.1066597700119019,
-0.6955675482749939,
-0.6255927085876465,
1.8918193578720093,
-0.2414528876543045,
0.5784627199172974,
-0.1486203968524933,
-1.2790189981460571,
-0.145253986120224,
0.7584624886512756,
0.3545883595943451,
-0.4690890610218048,
0.8293514251708984,
-0.6006035208702087,
-1.0724514722824097,
-1.3015717267990112,
-0.4464477002620697,
-1.0006465911865234,
-0.8824666738510132,
1.025266408920288,
0.70685213804245,
0.3753829896450043,
1.9114933013916016,
0.6000938415527344,
0.29863283038139343,
-2.7106900215148926,
0.8057000637054443,
0.2375808209180832,
-0.05415402725338936,
0.9706848859786987,
0.2624855637550354,
1.0838196277618408,
0.01351988036185503,
0.49397388100624084,
-2.428398609161377,
2.1844253540039062,
-0.17958612740039825,
0.6687203645706177,
-0.013192619197070599,
-0.22652117908000946,
1.1370424032211304,
0.5322349667549133,
0.5769769549369812,
-1.130793809890747,
0.7605836391448975,
-0.5691848993301392,
1.1377058029174805,
0.8039891123771667,
-0.867215096950531,
0.03022468090057373,
1.3170307874679565,
0.43901240825653076,
-0.4231123626232147,
-0.9110164046287537,
-0.9066488742828369,
0.9603777527809143,
1.7261966466903687,
-0.09707985073328018,
0.01699872314929962,
0.8202066421508789,
0.7248592376708984,
-1.2786717414855957,
-0.02794082835316658,
-0.7057914137840271,
-0.7477854490280151,
1.7095874547958374,
2.0935585498809814,
-0.06351744383573532,
-0.27786919474601746,
-0.7600245475769043,
-1.148963451385498,
0.7606449723243713,
-0.08941537886857986,
0.10329741984605789,
0.6662474274635315,
-0.6407580375671387,
1.1971540451049805,
0.7253331542015076,
0.9833413362503052,
0.1105804294347763,
0.3084678649902344,
0.3044417202472687,
-0.26742637157440186,
-1.1745692491531372,
-0.3157472312450409,
-1.055521845817566,
-2.5313963890075684,
0.4662782549858093,
-0.19151100516319275,
-1.45058012008667,
0.059001654386520386,
-1.0368480682373047,
0.8048184514045715,
-0.6094637513160706,
-1.1177098751068115,
-1.5219165086746216,
0.3157980144023895,
-0.15662401914596558,
0.920346200466156,
-1.6107361316680908,
-0.1411217451095581,
1.200111746788025,
0.9329019784927368,
-0.6209761500358582,
0.9791308045387268,
0.23964087665081024,
0.9473481178283691,
0.8147612810134888,
-0.33332934975624084,
0.4917972981929779,
0.2095366269350052,
-1.329925298690796,
0.42729970812797546,
1.2449049949645996,
0.19945387542247772,
1.439924955368042,
-0.5421908497810364,
0.09676084667444229,
0.45800334215164185,
-0.549057126045227,
-0.4840928614139557,
-0.5361000299453735,
0.78970867395401,
0.011676338501274586,
-0.9862543344497681,
0.03036605194211006,
-0.17264914512634277,
-0.2391441911458969,
0.22841103374958038,
-1.543778657913208,
-0.2517963647842407,
-0.3719506859779358,
-0.59010910987854,
-1.24989652633667,
0.047456301748752594,
1.3877105712890625,
-0.8705412745475769,
-0.1880919337272644,
0.4236986041069031,
0.3818496763706207,
0.49899986386299133,
0.6076264381408691,
-0.6488073468208313,
-0.3576003909111023,
-0.268405556678772,
-0.31560778617858887,
0.29020458459854126,
1.2710829973220825,
-0.07541612535715103,
-1.0201566219329834,
0.7526609301567078,
-0.39846861362457275,
0.055150002241134644,
1.9806333780288696,
0.09971404820680618,
-0.7420483231544495,
0.3380867540836334,
-0.6433494687080383,
1.89082670211792,
1.6995576620101929,
1.3766683340072632,
-0.13688240945339203,
-0.9615724682807922,
0.5847254395484924,
-0.23065632581710815,
-0.34625834226608276,
1.0050840377807617,
0.4827395975589752,
-0.16587024927139282,
-1.4012162685394287,
0.57035893201828,
1.298850417137146,
-0.9285339713096619,
-0.7487396597862244,
0.12431658804416656,
-0.902099072933197,
1.130395531654358,
0.6895737648010254,
0.36860132217407227,
0.20259366929531097,
1.5824801921844482,
0.7269153594970703,
-0.4535524845123291,
0.5803003311157227,
0.4690524637699127,
-0.11768174916505814,
-2.0830559730529785,
-0.9730139374732971,
0.34312790632247925,
-0.366370290517807,
-1.5562635660171509,
1.330164909362793,
-1.1540919542312622,
-0.9812217950820923,
0.5206158757209778,
0.10811688750982285,
1.4288722276687622,
0.36608561873435974,
1.6444567441940308,
2.150678873062134,
0.9133062362670898,
0.2801154851913452,
1.237135648727417,
-0.11873719841241837,
-0.4847700595855713,
1.8297356367111206,
-0.4800776243209839,
0.5195631384849548,
1.0618311166763306,
-0.3405071794986725,
-1.052426815032959,
-0.8439233303070068,
-1.1450340747833252,
-0.6678059697151184,
1.1552212238311768,
0.12710312008857727,
-1.2194374799728394,
0.2582300901412964,
1.5545369386672974,
0.1543097198009491,
-0.22860950231552124,
0.6601303219795227,
0.3644070029258728,
-0.7845331430435181,
-0.09692972153425217,
-0.8735353350639343,
0.43150636553764343,
-0.19066351652145386,
-0.30623289942741394,
0.2271261066198349,
0.5726096034049988,
1.2929388284683228,
-0.07162633538246155,
0.024216756224632263,
1.1975769996643066,
-1.454452395439148,
1.510317087173462,
-0.6592196226119995,
0.31169459223747253,
-2.388334274291992,
1.4107471704483032,
-0.8357357978820801,
1.8286961317062378,
-2.634979486465454,
0.3752976357936859,
-0.5417857766151428,
-0.48155999183654785,
0.2566426396369934,
-0.3703153729438782,
0.16529659926891327,
-0.188480943441391,
-1.013573408126831,
-0.1682310402393341,
-0.7394644618034363,
0.6530424356460571,
1.0746451616287231,
1.346523642539978,
-1.1406933069229126,
-0.34748944640159607,
-1.7432204484939575,
-0.2526768445968628,
-0.7143016457557678,
0.34992173314094543,
-1.9305070638656616,
-0.21130608022212982,
-2.0183868408203125,
-2.3586933612823486,
-1.358266830444336,
-0.8189138174057007,
1.0420145988464355,
0.16698923707008362,
-0.9193757176399231,
1.0346778631210327,
-0.3684466481208801,
-1.8442034721374512,
1.1765406131744385,
-2.161062717437744
] |
https://github.com/huggingface/datasets/issues/5123 | datasets freezes with streaming mode in multiple-gpu | Hi @lhoestq
thanks for coming back to me. Sorry for the confusion I made. I meant this works fine on 1 GPU, but on multi-gpu it is freezing. "accelerator" is not an issue as if you adapt the code without accelerator this still gets the same issue.
In order to test it. Please run "accelerate config", then use the setup for multi-gpu in one node.
After that run "accelerate launch code.py" and then you would see the freezing occurs. | ## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
| 472 | 79 | datasets freezes with streaming mode in multiple-gpu
## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
Hi @lhoestq
thanks for coming back to me. Sorry for the confusion I made. I meant this works fine on 1 GPU, but on multi-gpu it is freezing. "accelerator" is not an issue as if you adapt the code without accelerator this still gets the same issue.
In order to test it. Please run "accelerate config", then use the setup for multi-gpu in one node.
After that run "accelerate launch code.py" and then you would see the freezing occurs. | [
-1.2196941375732422,
-0.9265390634536743,
-0.7154155969619751,
1.4646788835525513,
-0.1441868543624878,
-1.2404600381851196,
0.09818949550390244,
-1.0889145135879517,
1.561210036277771,
-0.766279399394989,
0.27157339453697205,
-1.6538593769073486,
-0.031017590314149857,
-0.48414796590805054,
-0.753449022769928,
-0.8564292192459106,
-0.43187132477760315,
-0.9085370302200317,
1.0544241666793823,
2.541456460952759,
1.238066554069519,
-1.3789085149765015,
2.707625150680542,
0.6183651089668274,
-0.28375476598739624,
-1.0562281608581543,
0.4914971888065338,
0.05265944451093674,
-1.3426010608673096,
-0.4690755605697632,
-0.9343588948249817,
-0.021768631413578987,
-0.513971745967865,
-0.5481430292129517,
0.1315504014492035,
0.3927555978298187,
-0.19097450375556946,
-0.39653557538986206,
-0.4776310622692108,
-0.674271285533905,
0.45003896951675415,
-0.34303489327430725,
0.9542774558067322,
-0.29673346877098083,
1.7764742374420166,
-0.5822340250015259,
0.4204208552837372,
0.7471269965171814,
1.3177675008773804,
0.1977892965078354,
0.00911825243383646,
0.2995719015598297,
0.3690434694290161,
-0.027073003351688385,
0.5006393194198608,
1.2133288383483887,
0.6470579504966736,
0.4258016347885132,
0.6730741858482361,
-2.206968069076538,
1.32177734375,
-0.8521214723587036,
0.3151848018169403,
1.3639508485794067,
-0.948898196220398,
0.33002108335494995,
-1.8636839389801025,
-0.0408516488969326,
0.5247939229011536,
-2.209108591079712,
0.2663412094116211,
-1.3120408058166504,
-0.5187820196151733,
1.0780906677246094,
0.22621382772922516,
-1.2553026676177979,
0.22724923491477966,
-0.5109614729881287,
1.0825048685073853,
0.502551794052124,
1.2045079469680786,
-1.6525177955627441,
-0.053055305033922195,
-0.22096458077430725,
0.1501053422689438,
-1.269885778427124,
-1.5829702615737915,
0.5515368580818176,
0.622783362865448,
0.6200190186500549,
-0.1245521530508995,
0.9918457865715027,
-1.0412336587905884,
0.8439581394195557,
-0.9657367467880249,
-1.702380895614624,
-1.3975653648376465,
-2.2875359058380127,
-2.3538496494293213,
0.7833411693572998,
-0.49098339676856995,
-0.48595762252807617,
2.043440818786621,
-1.0940463542938232,
-1.8045988082885742,
1.0968130826950073,
0.31212225556373596,
0.03665555268526077,
2.3266162872314453,
0.27054035663604736,
-0.7715662121772766,
0.4353873133659363,
-0.7007548213005066,
0.7579501867294312,
-0.29536670446395874,
1.3403102159500122,
0.49578747153282166,
-0.9768232703208923,
1.5886470079421997,
-0.3369218707084656,
0.5592484474182129,
-0.678779661655426,
-0.5001794695854187,
-0.7466428279876709,
0.28943055868148804,
1.8903740644454956,
-0.3424609899520874,
1.557119607925415,
-0.35824042558670044,
-1.6710333824157715,
-1.553488850593567,
0.783078670501709,
0.5672897100448608,
-0.8038462996482849,
0.08542395383119583,
-0.45937302708625793,
0.04574445262551308,
-0.024679530411958694,
1.0531243085861206,
1.2256052494049072,
0.764526903629303,
-0.3791036903858185,
-0.8700701594352722,
0.22228902578353882,
-0.024389881640672684,
-0.6564667820930481,
-1.7730416059494019,
-0.3114410936832428,
0.19685357809066772,
0.7159045338630676,
-1.2066057920455933,
1.728532314300537,
0.9023963809013367,
1.9766522645950317,
0.9846182465553284,
-0.36182960867881775,
1.5362764596939087,
0.051193155348300934,
1.822758674621582,
-0.48359543085098267,
0.6152960658073425,
-0.3046688437461853,
-1.1953858137130737,
0.8193591833114624,
-0.3840271532535553,
-2.0460617542266846,
-0.7889803051948547,
-0.8046810030937195,
-0.1774633824825287,
-0.765680193901062,
0.9259167909622192,
-0.24395380914211273,
-1.5002785921096802,
0.18586590886116028,
-0.7031571269035339,
0.21713046729564667,
-1.2631146907806396,
0.2876998782157898,
0.7585954666137695,
-0.6546574831008911,
0.03635474294424057,
-0.2847440540790558,
-1.3299492597579956,
-0.482089638710022,
0.2555885314941406,
1.935956597328186,
-0.7466676831245422,
0.9977244734764099,
1.0288703441619873,
-0.6965973377227783,
0.11828635632991791,
0.2761755883693695,
-0.3382411301136017,
0.833848774433136,
-1.1520915031433105,
-0.315114289522171,
1.1405011415481567,
-0.14047589898109436,
-0.5562839508056641,
1.471627116203308,
0.8417165875434875,
-1.0451849699020386,
-0.3005620241165161,
-0.12290839850902557,
-0.7805737853050232,
-0.03752228990197182,
-1.568975567817688,
-0.12197384983301163,
0.3518800139427185,
-1.4865142107009888,
-0.3980593681335449,
-0.24516715109348297,
1.3649996519088745,
-0.20235849916934967,
1.4160126447677612,
-0.23609648644924164,
-0.16662970185279846,
-0.2959860861301422,
-0.41663509607315063,
0.19382227957248688,
-0.23418529331684113,
-0.6433618068695068,
0.318690687417984,
-0.7788034081459045,
0.3863050639629364,
1.5006078481674194,
0.3884235918521881,
-0.00019022077322006226,
0.47417497634887695,
1.1080034971237183,
0.37883907556533813,
-0.002778146415948868,
-0.8164379000663757,
-1.6140708923339844,
2.0191421508789062,
-1.4656296968460083,
1.939512848854065,
0.8449747562408447,
-0.046081412583589554,
-1.7433342933654785,
-1.848331093788147,
1.3511232137680054,
1.1672942638397217,
2.4696943759918213,
0.5762004852294922,
0.42126747965812683,
-0.7756940126419067,
-0.6782505512237549,
0.3392564654350281,
-0.9890856146812439,
-0.6823289394378662,
0.20723594725131989,
2.3987951278686523,
1.7446309328079224,
-0.4842599630355835,
-0.2373860478401184,
-0.8973423838615417,
1.2812271118164062,
-0.15210215747356415,
0.2147456407546997,
2.0669326782226562,
-0.2068791687488556,
-1.0644787549972534,
1.3586879968643188,
-2.3524374961853027,
0.2507283091545105,
2.0961709022521973,
0.23586231470108032,
0.029642552137374878,
-1.4289990663528442,
-0.6397950649261475,
-0.30462199449539185,
-0.4333078861236572,
-1.1869637966156006,
0.587566077709198,
-0.2887362241744995,
-0.8351829648017883,
-1.5269949436187744,
0.11956657469272614,
-1.155600905418396,
-1.7167274951934814,
0.32368239760398865,
1.849785327911377,
2.0171334743499756,
-0.7661897540092468,
1.425772786140442,
-0.30981558561325073,
0.1503465175628662,
1.2077202796936035,
1.297251582145691,
3.0895423889160156,
1.801468849182129,
-1.2655190229415894,
0.7652720212936401,
-0.19671571254730225,
-0.539990246295929,
1.0875061750411987,
-1.1737041473388672,
1.1934410333633423,
-0.18639099597930908,
-1.225818395614624,
-1.2079122066497803,
1.0307289361953735,
0.49156299233436584,
0.11513937264680862,
-0.48870187997817993,
1.25287926197052,
0.13206298649311066,
1.3606230020523071,
0.5472378134727478,
-0.33754125237464905,
0.5767080783843994,
-0.42384764552116394,
-0.5459473729133606,
1.548958659172058,
0.17662404477596283,
-1.4700467586517334,
-2.2897047996520996,
-0.2891959846019745,
-0.83060622215271,
-0.06987574696540833,
-0.6241534948348999,
-1.031946063041687,
1.6046165227890015,
0.4489043653011322,
-1.2942005395889282,
-0.2761368155479431,
-0.2938218116760254,
-0.5316752195358276,
2.5729079246520996,
-1.3579460382461548,
-0.15288743376731873,
-0.9766233563423157,
-0.5494853854179382,
1.6470723152160645,
-1.136026382446289,
-0.24366657435894012,
-1.0180833339691162,
-0.6197898387908936,
-1.290596842765808,
-0.6515306234359741,
0.014519116841256618,
-0.898371696472168,
0.7493624687194824,
0.10976632684469223,
-1.1049569845199585,
-0.2543349862098694,
-0.8716477751731873,
0.9739378690719604,
-0.10408321022987366,
0.21624097228050232,
1.8497835397720337,
0.42586252093315125,
-0.41084054112434387,
0.7086337804794312,
1.1682676076889038,
0.6527948975563049,
-0.7188342809677124,
0.08778499811887741,
-0.7523595690727234,
0.27312031388282776,
-1.3963708877563477,
0.27732372283935547,
-2.920530080795288,
0.6473391652107239,
-0.03915109112858772,
-0.10190664231777191,
-0.01194615289568901,
-1.354688048362732,
1.150322675704956,
2.604787588119507,
-1.1559698581695557,
0.45400241017341614,
0.4082641303539276,
1.1024219989776611,
-1.561321496963501,
0.2809440493583679,
-0.40414464473724365,
2.0925590991973877,
0.1753041297197342,
1.3182090520858765,
-0.4970410168170929,
-2.244457483291626,
0.6311855316162109,
-1.3103537559509277,
-1.1318570375442505,
0.8182228207588196,
-0.9041734337806702,
0.1373426616191864,
-1.402640461921692,
-0.22787636518478394,
-0.874118447303772,
-1.2131516933441162,
0.735505998134613,
0.09235156327486038,
0.4400927424430847,
-0.5481333136558533,
0.40668684244155884,
-2.171538829803467,
-1.3483706712722778,
-0.243732750415802,
-0.9873079657554626,
0.468234121799469,
-0.34478795528411865,
0.6460316181182861,
-0.12398447841405869,
0.10691895335912704,
0.3336278796195984,
1.3938778638839722,
3.356300115585327,
0.26448503136634827,
0.31335100531578064,
-0.07852749526500702,
-0.9935678243637085,
1.4641997814178467,
0.9334990382194519,
-0.09758613258600235,
-0.6031655669212341,
-0.9990250468254089,
1.1396456956863403,
2.052079200744629,
1.1207813024520874,
-0.006237646099179983,
-0.905368447303772,
-0.8131141066551208,
0.025303009897470474,
0.1922958791255951,
0.4902430772781372,
0.9256752133369446,
-0.00039423536509275436,
0.12187507748603821,
1.471239686012268,
1.1707947254180908,
-0.43878719210624695,
0.42896193265914917,
-0.9041079878807068,
-0.4822046160697937,
0.4004333019256592,
0.296958327293396,
0.05653358995914459,
0.4317501485347748,
-1.1210416555404663,
-0.1530856490135193,
-0.3772937059402466,
-0.9523237347602844,
-0.7993472814559937,
-0.46154555678367615,
-0.3354898989200592,
1.592426061630249,
0.03188944607973099,
-0.4231318235397339,
-0.023643802851438522,
-0.7166863083839417,
-0.1101628988981247,
-1.1042165756225586,
0.26067405939102173,
-0.09152278304100037,
-0.059500668197870255,
-0.13640739023685455,
1.7569867372512817,
-0.9890809059143066,
-2.0471696853637695,
0.25865548849105835,
0.2427690327167511,
-0.39798101782798767,
0.12420280277729034,
1.6489001512527466,
0.5068750381469727,
1.3894144296646118,
1.327484130859375,
1.0175814628601074,
-0.6459847092628479,
-1.2752317190170288,
0.7207511067390442,
0.9678804278373718,
-1.300871729850769,
0.8165826797485352,
-0.11118783056735992,
-0.5508304834365845,
0.6469881534576416,
1.3411006927490234,
0.45485082268714905,
-2.0625720024108887,
0.823930561542511,
-0.8976891040802002,
0.6816296577453613,
0.6471803784370422,
0.7939374446868896,
0.1646786481142044,
0.8232812285423279,
-1.2386083602905273,
-1.1066597700119019,
-0.6955675482749939,
-0.6255927085876465,
1.8918193578720093,
-0.2414528876543045,
0.5784627199172974,
-0.1486203968524933,
-1.2790189981460571,
-0.145253986120224,
0.7584624886512756,
0.3545883595943451,
-0.4690890610218048,
0.8293514251708984,
-0.6006035208702087,
-1.0724514722824097,
-1.3015717267990112,
-0.4464477002620697,
-1.0006465911865234,
-0.8824666738510132,
1.025266408920288,
0.70685213804245,
0.3753829896450043,
1.9114933013916016,
0.6000938415527344,
0.29863283038139343,
-2.7106900215148926,
0.8057000637054443,
0.2375808209180832,
-0.05415402725338936,
0.9706848859786987,
0.2624855637550354,
1.0838196277618408,
0.01351988036185503,
0.49397388100624084,
-2.428398609161377,
2.1844253540039062,
-0.17958612740039825,
0.6687203645706177,
-0.013192619197070599,
-0.22652117908000946,
1.1370424032211304,
0.5322349667549133,
0.5769769549369812,
-1.130793809890747,
0.7605836391448975,
-0.5691848993301392,
1.1377058029174805,
0.8039891123771667,
-0.867215096950531,
0.03022468090057373,
1.3170307874679565,
0.43901240825653076,
-0.4231123626232147,
-0.9110164046287537,
-0.9066488742828369,
0.9603777527809143,
1.7261966466903687,
-0.09707985073328018,
0.01699872314929962,
0.8202066421508789,
0.7248592376708984,
-1.2786717414855957,
-0.02794082835316658,
-0.7057914137840271,
-0.7477854490280151,
1.7095874547958374,
2.0935585498809814,
-0.06351744383573532,
-0.27786919474601746,
-0.7600245475769043,
-1.148963451385498,
0.7606449723243713,
-0.08941537886857986,
0.10329741984605789,
0.6662474274635315,
-0.6407580375671387,
1.1971540451049805,
0.7253331542015076,
0.9833413362503052,
0.1105804294347763,
0.3084678649902344,
0.3044417202472687,
-0.26742637157440186,
-1.1745692491531372,
-0.3157472312450409,
-1.055521845817566,
-2.5313963890075684,
0.4662782549858093,
-0.19151100516319275,
-1.45058012008667,
0.059001654386520386,
-1.0368480682373047,
0.8048184514045715,
-0.6094637513160706,
-1.1177098751068115,
-1.5219165086746216,
0.3157980144023895,
-0.15662401914596558,
0.920346200466156,
-1.6107361316680908,
-0.1411217451095581,
1.200111746788025,
0.9329019784927368,
-0.6209761500358582,
0.9791308045387268,
0.23964087665081024,
0.9473481178283691,
0.8147612810134888,
-0.33332934975624084,
0.4917972981929779,
0.2095366269350052,
-1.329925298690796,
0.42729970812797546,
1.2449049949645996,
0.19945387542247772,
1.439924955368042,
-0.5421908497810364,
0.09676084667444229,
0.45800334215164185,
-0.549057126045227,
-0.4840928614139557,
-0.5361000299453735,
0.78970867395401,
0.011676338501274586,
-0.9862543344497681,
0.03036605194211006,
-0.17264914512634277,
-0.2391441911458969,
0.22841103374958038,
-1.543778657913208,
-0.2517963647842407,
-0.3719506859779358,
-0.59010910987854,
-1.24989652633667,
0.047456301748752594,
1.3877105712890625,
-0.8705412745475769,
-0.1880919337272644,
0.4236986041069031,
0.3818496763706207,
0.49899986386299133,
0.6076264381408691,
-0.6488073468208313,
-0.3576003909111023,
-0.268405556678772,
-0.31560778617858887,
0.29020458459854126,
1.2710829973220825,
-0.07541612535715103,
-1.0201566219329834,
0.7526609301567078,
-0.39846861362457275,
0.055150002241134644,
1.9806333780288696,
0.09971404820680618,
-0.7420483231544495,
0.3380867540836334,
-0.6433494687080383,
1.89082670211792,
1.6995576620101929,
1.3766683340072632,
-0.13688240945339203,
-0.9615724682807922,
0.5847254395484924,
-0.23065632581710815,
-0.34625834226608276,
1.0050840377807617,
0.4827395975589752,
-0.16587024927139282,
-1.4012162685394287,
0.57035893201828,
1.298850417137146,
-0.9285339713096619,
-0.7487396597862244,
0.12431658804416656,
-0.902099072933197,
1.130395531654358,
0.6895737648010254,
0.36860132217407227,
0.20259366929531097,
1.5824801921844482,
0.7269153594970703,
-0.4535524845123291,
0.5803003311157227,
0.4690524637699127,
-0.11768174916505814,
-2.0830559730529785,
-0.9730139374732971,
0.34312790632247925,
-0.366370290517807,
-1.5562635660171509,
1.330164909362793,
-1.1540919542312622,
-0.9812217950820923,
0.5206158757209778,
0.10811688750982285,
1.4288722276687622,
0.36608561873435974,
1.6444567441940308,
2.150678873062134,
0.9133062362670898,
0.2801154851913452,
1.237135648727417,
-0.11873719841241837,
-0.4847700595855713,
1.8297356367111206,
-0.4800776243209839,
0.5195631384849548,
1.0618311166763306,
-0.3405071794986725,
-1.052426815032959,
-0.8439233303070068,
-1.1450340747833252,
-0.6678059697151184,
1.1552212238311768,
0.12710312008857727,
-1.2194374799728394,
0.2582300901412964,
1.5545369386672974,
0.1543097198009491,
-0.22860950231552124,
0.6601303219795227,
0.3644070029258728,
-0.7845331430435181,
-0.09692972153425217,
-0.8735353350639343,
0.43150636553764343,
-0.19066351652145386,
-0.30623289942741394,
0.2271261066198349,
0.5726096034049988,
1.2929388284683228,
-0.07162633538246155,
0.024216756224632263,
1.1975769996643066,
-1.454452395439148,
1.510317087173462,
-0.6592196226119995,
0.31169459223747253,
-2.388334274291992,
1.4107471704483032,
-0.8357357978820801,
1.8286961317062378,
-2.634979486465454,
0.3752976357936859,
-0.5417857766151428,
-0.48155999183654785,
0.2566426396369934,
-0.3703153729438782,
0.16529659926891327,
-0.188480943441391,
-1.013573408126831,
-0.1682310402393341,
-0.7394644618034363,
0.6530424356460571,
1.0746451616287231,
1.346523642539978,
-1.1406933069229126,
-0.34748944640159607,
-1.7432204484939575,
-0.2526768445968628,
-0.7143016457557678,
0.34992173314094543,
-1.9305070638656616,
-0.21130608022212982,
-2.0183868408203125,
-2.3586933612823486,
-1.358266830444336,
-0.8189138174057007,
1.0420145988464355,
0.16698923707008362,
-0.9193757176399231,
1.0346778631210327,
-0.3684466481208801,
-1.8442034721374512,
1.1765406131744385,
-2.161062717437744
] |
https://github.com/huggingface/datasets/issues/5123 | datasets freezes with streaming mode in multiple-gpu | Hi @lhoestq
could you have the chance to reproduce the error by running the minimal example shared?
thanks | ## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
| 472 | 18 | datasets freezes with streaming mode in multiple-gpu
## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
Hi @lhoestq
could you have the chance to reproduce the error by running the minimal example shared?
thanks | [
-1.2196941375732422,
-0.9265390634536743,
-0.7154155969619751,
1.4646788835525513,
-0.1441868543624878,
-1.2404600381851196,
0.09818949550390244,
-1.0889145135879517,
1.561210036277771,
-0.766279399394989,
0.27157339453697205,
-1.6538593769073486,
-0.031017590314149857,
-0.48414796590805054,
-0.753449022769928,
-0.8564292192459106,
-0.43187132477760315,
-0.9085370302200317,
1.0544241666793823,
2.541456460952759,
1.238066554069519,
-1.3789085149765015,
2.707625150680542,
0.6183651089668274,
-0.28375476598739624,
-1.0562281608581543,
0.4914971888065338,
0.05265944451093674,
-1.3426010608673096,
-0.4690755605697632,
-0.9343588948249817,
-0.021768631413578987,
-0.513971745967865,
-0.5481430292129517,
0.1315504014492035,
0.3927555978298187,
-0.19097450375556946,
-0.39653557538986206,
-0.4776310622692108,
-0.674271285533905,
0.45003896951675415,
-0.34303489327430725,
0.9542774558067322,
-0.29673346877098083,
1.7764742374420166,
-0.5822340250015259,
0.4204208552837372,
0.7471269965171814,
1.3177675008773804,
0.1977892965078354,
0.00911825243383646,
0.2995719015598297,
0.3690434694290161,
-0.027073003351688385,
0.5006393194198608,
1.2133288383483887,
0.6470579504966736,
0.4258016347885132,
0.6730741858482361,
-2.206968069076538,
1.32177734375,
-0.8521214723587036,
0.3151848018169403,
1.3639508485794067,
-0.948898196220398,
0.33002108335494995,
-1.8636839389801025,
-0.0408516488969326,
0.5247939229011536,
-2.209108591079712,
0.2663412094116211,
-1.3120408058166504,
-0.5187820196151733,
1.0780906677246094,
0.22621382772922516,
-1.2553026676177979,
0.22724923491477966,
-0.5109614729881287,
1.0825048685073853,
0.502551794052124,
1.2045079469680786,
-1.6525177955627441,
-0.053055305033922195,
-0.22096458077430725,
0.1501053422689438,
-1.269885778427124,
-1.5829702615737915,
0.5515368580818176,
0.622783362865448,
0.6200190186500549,
-0.1245521530508995,
0.9918457865715027,
-1.0412336587905884,
0.8439581394195557,
-0.9657367467880249,
-1.702380895614624,
-1.3975653648376465,
-2.2875359058380127,
-2.3538496494293213,
0.7833411693572998,
-0.49098339676856995,
-0.48595762252807617,
2.043440818786621,
-1.0940463542938232,
-1.8045988082885742,
1.0968130826950073,
0.31212225556373596,
0.03665555268526077,
2.3266162872314453,
0.27054035663604736,
-0.7715662121772766,
0.4353873133659363,
-0.7007548213005066,
0.7579501867294312,
-0.29536670446395874,
1.3403102159500122,
0.49578747153282166,
-0.9768232703208923,
1.5886470079421997,
-0.3369218707084656,
0.5592484474182129,
-0.678779661655426,
-0.5001794695854187,
-0.7466428279876709,
0.28943055868148804,
1.8903740644454956,
-0.3424609899520874,
1.557119607925415,
-0.35824042558670044,
-1.6710333824157715,
-1.553488850593567,
0.783078670501709,
0.5672897100448608,
-0.8038462996482849,
0.08542395383119583,
-0.45937302708625793,
0.04574445262551308,
-0.024679530411958694,
1.0531243085861206,
1.2256052494049072,
0.764526903629303,
-0.3791036903858185,
-0.8700701594352722,
0.22228902578353882,
-0.024389881640672684,
-0.6564667820930481,
-1.7730416059494019,
-0.3114410936832428,
0.19685357809066772,
0.7159045338630676,
-1.2066057920455933,
1.728532314300537,
0.9023963809013367,
1.9766522645950317,
0.9846182465553284,
-0.36182960867881775,
1.5362764596939087,
0.051193155348300934,
1.822758674621582,
-0.48359543085098267,
0.6152960658073425,
-0.3046688437461853,
-1.1953858137130737,
0.8193591833114624,
-0.3840271532535553,
-2.0460617542266846,
-0.7889803051948547,
-0.8046810030937195,
-0.1774633824825287,
-0.765680193901062,
0.9259167909622192,
-0.24395380914211273,
-1.5002785921096802,
0.18586590886116028,
-0.7031571269035339,
0.21713046729564667,
-1.2631146907806396,
0.2876998782157898,
0.7585954666137695,
-0.6546574831008911,
0.03635474294424057,
-0.2847440540790558,
-1.3299492597579956,
-0.482089638710022,
0.2555885314941406,
1.935956597328186,
-0.7466676831245422,
0.9977244734764099,
1.0288703441619873,
-0.6965973377227783,
0.11828635632991791,
0.2761755883693695,
-0.3382411301136017,
0.833848774433136,
-1.1520915031433105,
-0.315114289522171,
1.1405011415481567,
-0.14047589898109436,
-0.5562839508056641,
1.471627116203308,
0.8417165875434875,
-1.0451849699020386,
-0.3005620241165161,
-0.12290839850902557,
-0.7805737853050232,
-0.03752228990197182,
-1.568975567817688,
-0.12197384983301163,
0.3518800139427185,
-1.4865142107009888,
-0.3980593681335449,
-0.24516715109348297,
1.3649996519088745,
-0.20235849916934967,
1.4160126447677612,
-0.23609648644924164,
-0.16662970185279846,
-0.2959860861301422,
-0.41663509607315063,
0.19382227957248688,
-0.23418529331684113,
-0.6433618068695068,
0.318690687417984,
-0.7788034081459045,
0.3863050639629364,
1.5006078481674194,
0.3884235918521881,
-0.00019022077322006226,
0.47417497634887695,
1.1080034971237183,
0.37883907556533813,
-0.002778146415948868,
-0.8164379000663757,
-1.6140708923339844,
2.0191421508789062,
-1.4656296968460083,
1.939512848854065,
0.8449747562408447,
-0.046081412583589554,
-1.7433342933654785,
-1.848331093788147,
1.3511232137680054,
1.1672942638397217,
2.4696943759918213,
0.5762004852294922,
0.42126747965812683,
-0.7756940126419067,
-0.6782505512237549,
0.3392564654350281,
-0.9890856146812439,
-0.6823289394378662,
0.20723594725131989,
2.3987951278686523,
1.7446309328079224,
-0.4842599630355835,
-0.2373860478401184,
-0.8973423838615417,
1.2812271118164062,
-0.15210215747356415,
0.2147456407546997,
2.0669326782226562,
-0.2068791687488556,
-1.0644787549972534,
1.3586879968643188,
-2.3524374961853027,
0.2507283091545105,
2.0961709022521973,
0.23586231470108032,
0.029642552137374878,
-1.4289990663528442,
-0.6397950649261475,
-0.30462199449539185,
-0.4333078861236572,
-1.1869637966156006,
0.587566077709198,
-0.2887362241744995,
-0.8351829648017883,
-1.5269949436187744,
0.11956657469272614,
-1.155600905418396,
-1.7167274951934814,
0.32368239760398865,
1.849785327911377,
2.0171334743499756,
-0.7661897540092468,
1.425772786140442,
-0.30981558561325073,
0.1503465175628662,
1.2077202796936035,
1.297251582145691,
3.0895423889160156,
1.801468849182129,
-1.2655190229415894,
0.7652720212936401,
-0.19671571254730225,
-0.539990246295929,
1.0875061750411987,
-1.1737041473388672,
1.1934410333633423,
-0.18639099597930908,
-1.225818395614624,
-1.2079122066497803,
1.0307289361953735,
0.49156299233436584,
0.11513937264680862,
-0.48870187997817993,
1.25287926197052,
0.13206298649311066,
1.3606230020523071,
0.5472378134727478,
-0.33754125237464905,
0.5767080783843994,
-0.42384764552116394,
-0.5459473729133606,
1.548958659172058,
0.17662404477596283,
-1.4700467586517334,
-2.2897047996520996,
-0.2891959846019745,
-0.83060622215271,
-0.06987574696540833,
-0.6241534948348999,
-1.031946063041687,
1.6046165227890015,
0.4489043653011322,
-1.2942005395889282,
-0.2761368155479431,
-0.2938218116760254,
-0.5316752195358276,
2.5729079246520996,
-1.3579460382461548,
-0.15288743376731873,
-0.9766233563423157,
-0.5494853854179382,
1.6470723152160645,
-1.136026382446289,
-0.24366657435894012,
-1.0180833339691162,
-0.6197898387908936,
-1.290596842765808,
-0.6515306234359741,
0.014519116841256618,
-0.898371696472168,
0.7493624687194824,
0.10976632684469223,
-1.1049569845199585,
-0.2543349862098694,
-0.8716477751731873,
0.9739378690719604,
-0.10408321022987366,
0.21624097228050232,
1.8497835397720337,
0.42586252093315125,
-0.41084054112434387,
0.7086337804794312,
1.1682676076889038,
0.6527948975563049,
-0.7188342809677124,
0.08778499811887741,
-0.7523595690727234,
0.27312031388282776,
-1.3963708877563477,
0.27732372283935547,
-2.920530080795288,
0.6473391652107239,
-0.03915109112858772,
-0.10190664231777191,
-0.01194615289568901,
-1.354688048362732,
1.150322675704956,
2.604787588119507,
-1.1559698581695557,
0.45400241017341614,
0.4082641303539276,
1.1024219989776611,
-1.561321496963501,
0.2809440493583679,
-0.40414464473724365,
2.0925590991973877,
0.1753041297197342,
1.3182090520858765,
-0.4970410168170929,
-2.244457483291626,
0.6311855316162109,
-1.3103537559509277,
-1.1318570375442505,
0.8182228207588196,
-0.9041734337806702,
0.1373426616191864,
-1.402640461921692,
-0.22787636518478394,
-0.874118447303772,
-1.2131516933441162,
0.735505998134613,
0.09235156327486038,
0.4400927424430847,
-0.5481333136558533,
0.40668684244155884,
-2.171538829803467,
-1.3483706712722778,
-0.243732750415802,
-0.9873079657554626,
0.468234121799469,
-0.34478795528411865,
0.6460316181182861,
-0.12398447841405869,
0.10691895335912704,
0.3336278796195984,
1.3938778638839722,
3.356300115585327,
0.26448503136634827,
0.31335100531578064,
-0.07852749526500702,
-0.9935678243637085,
1.4641997814178467,
0.9334990382194519,
-0.09758613258600235,
-0.6031655669212341,
-0.9990250468254089,
1.1396456956863403,
2.052079200744629,
1.1207813024520874,
-0.006237646099179983,
-0.905368447303772,
-0.8131141066551208,
0.025303009897470474,
0.1922958791255951,
0.4902430772781372,
0.9256752133369446,
-0.00039423536509275436,
0.12187507748603821,
1.471239686012268,
1.1707947254180908,
-0.43878719210624695,
0.42896193265914917,
-0.9041079878807068,
-0.4822046160697937,
0.4004333019256592,
0.296958327293396,
0.05653358995914459,
0.4317501485347748,
-1.1210416555404663,
-0.1530856490135193,
-0.3772937059402466,
-0.9523237347602844,
-0.7993472814559937,
-0.46154555678367615,
-0.3354898989200592,
1.592426061630249,
0.03188944607973099,
-0.4231318235397339,
-0.023643802851438522,
-0.7166863083839417,
-0.1101628988981247,
-1.1042165756225586,
0.26067405939102173,
-0.09152278304100037,
-0.059500668197870255,
-0.13640739023685455,
1.7569867372512817,
-0.9890809059143066,
-2.0471696853637695,
0.25865548849105835,
0.2427690327167511,
-0.39798101782798767,
0.12420280277729034,
1.6489001512527466,
0.5068750381469727,
1.3894144296646118,
1.327484130859375,
1.0175814628601074,
-0.6459847092628479,
-1.2752317190170288,
0.7207511067390442,
0.9678804278373718,
-1.300871729850769,
0.8165826797485352,
-0.11118783056735992,
-0.5508304834365845,
0.6469881534576416,
1.3411006927490234,
0.45485082268714905,
-2.0625720024108887,
0.823930561542511,
-0.8976891040802002,
0.6816296577453613,
0.6471803784370422,
0.7939374446868896,
0.1646786481142044,
0.8232812285423279,
-1.2386083602905273,
-1.1066597700119019,
-0.6955675482749939,
-0.6255927085876465,
1.8918193578720093,
-0.2414528876543045,
0.5784627199172974,
-0.1486203968524933,
-1.2790189981460571,
-0.145253986120224,
0.7584624886512756,
0.3545883595943451,
-0.4690890610218048,
0.8293514251708984,
-0.6006035208702087,
-1.0724514722824097,
-1.3015717267990112,
-0.4464477002620697,
-1.0006465911865234,
-0.8824666738510132,
1.025266408920288,
0.70685213804245,
0.3753829896450043,
1.9114933013916016,
0.6000938415527344,
0.29863283038139343,
-2.7106900215148926,
0.8057000637054443,
0.2375808209180832,
-0.05415402725338936,
0.9706848859786987,
0.2624855637550354,
1.0838196277618408,
0.01351988036185503,
0.49397388100624084,
-2.428398609161377,
2.1844253540039062,
-0.17958612740039825,
0.6687203645706177,
-0.013192619197070599,
-0.22652117908000946,
1.1370424032211304,
0.5322349667549133,
0.5769769549369812,
-1.130793809890747,
0.7605836391448975,
-0.5691848993301392,
1.1377058029174805,
0.8039891123771667,
-0.867215096950531,
0.03022468090057373,
1.3170307874679565,
0.43901240825653076,
-0.4231123626232147,
-0.9110164046287537,
-0.9066488742828369,
0.9603777527809143,
1.7261966466903687,
-0.09707985073328018,
0.01699872314929962,
0.8202066421508789,
0.7248592376708984,
-1.2786717414855957,
-0.02794082835316658,
-0.7057914137840271,
-0.7477854490280151,
1.7095874547958374,
2.0935585498809814,
-0.06351744383573532,
-0.27786919474601746,
-0.7600245475769043,
-1.148963451385498,
0.7606449723243713,
-0.08941537886857986,
0.10329741984605789,
0.6662474274635315,
-0.6407580375671387,
1.1971540451049805,
0.7253331542015076,
0.9833413362503052,
0.1105804294347763,
0.3084678649902344,
0.3044417202472687,
-0.26742637157440186,
-1.1745692491531372,
-0.3157472312450409,
-1.055521845817566,
-2.5313963890075684,
0.4662782549858093,
-0.19151100516319275,
-1.45058012008667,
0.059001654386520386,
-1.0368480682373047,
0.8048184514045715,
-0.6094637513160706,
-1.1177098751068115,
-1.5219165086746216,
0.3157980144023895,
-0.15662401914596558,
0.920346200466156,
-1.6107361316680908,
-0.1411217451095581,
1.200111746788025,
0.9329019784927368,
-0.6209761500358582,
0.9791308045387268,
0.23964087665081024,
0.9473481178283691,
0.8147612810134888,
-0.33332934975624084,
0.4917972981929779,
0.2095366269350052,
-1.329925298690796,
0.42729970812797546,
1.2449049949645996,
0.19945387542247772,
1.439924955368042,
-0.5421908497810364,
0.09676084667444229,
0.45800334215164185,
-0.549057126045227,
-0.4840928614139557,
-0.5361000299453735,
0.78970867395401,
0.011676338501274586,
-0.9862543344497681,
0.03036605194211006,
-0.17264914512634277,
-0.2391441911458969,
0.22841103374958038,
-1.543778657913208,
-0.2517963647842407,
-0.3719506859779358,
-0.59010910987854,
-1.24989652633667,
0.047456301748752594,
1.3877105712890625,
-0.8705412745475769,
-0.1880919337272644,
0.4236986041069031,
0.3818496763706207,
0.49899986386299133,
0.6076264381408691,
-0.6488073468208313,
-0.3576003909111023,
-0.268405556678772,
-0.31560778617858887,
0.29020458459854126,
1.2710829973220825,
-0.07541612535715103,
-1.0201566219329834,
0.7526609301567078,
-0.39846861362457275,
0.055150002241134644,
1.9806333780288696,
0.09971404820680618,
-0.7420483231544495,
0.3380867540836334,
-0.6433494687080383,
1.89082670211792,
1.6995576620101929,
1.3766683340072632,
-0.13688240945339203,
-0.9615724682807922,
0.5847254395484924,
-0.23065632581710815,
-0.34625834226608276,
1.0050840377807617,
0.4827395975589752,
-0.16587024927139282,
-1.4012162685394287,
0.57035893201828,
1.298850417137146,
-0.9285339713096619,
-0.7487396597862244,
0.12431658804416656,
-0.902099072933197,
1.130395531654358,
0.6895737648010254,
0.36860132217407227,
0.20259366929531097,
1.5824801921844482,
0.7269153594970703,
-0.4535524845123291,
0.5803003311157227,
0.4690524637699127,
-0.11768174916505814,
-2.0830559730529785,
-0.9730139374732971,
0.34312790632247925,
-0.366370290517807,
-1.5562635660171509,
1.330164909362793,
-1.1540919542312622,
-0.9812217950820923,
0.5206158757209778,
0.10811688750982285,
1.4288722276687622,
0.36608561873435974,
1.6444567441940308,
2.150678873062134,
0.9133062362670898,
0.2801154851913452,
1.237135648727417,
-0.11873719841241837,
-0.4847700595855713,
1.8297356367111206,
-0.4800776243209839,
0.5195631384849548,
1.0618311166763306,
-0.3405071794986725,
-1.052426815032959,
-0.8439233303070068,
-1.1450340747833252,
-0.6678059697151184,
1.1552212238311768,
0.12710312008857727,
-1.2194374799728394,
0.2582300901412964,
1.5545369386672974,
0.1543097198009491,
-0.22860950231552124,
0.6601303219795227,
0.3644070029258728,
-0.7845331430435181,
-0.09692972153425217,
-0.8735353350639343,
0.43150636553764343,
-0.19066351652145386,
-0.30623289942741394,
0.2271261066198349,
0.5726096034049988,
1.2929388284683228,
-0.07162633538246155,
0.024216756224632263,
1.1975769996643066,
-1.454452395439148,
1.510317087173462,
-0.6592196226119995,
0.31169459223747253,
-2.388334274291992,
1.4107471704483032,
-0.8357357978820801,
1.8286961317062378,
-2.634979486465454,
0.3752976357936859,
-0.5417857766151428,
-0.48155999183654785,
0.2566426396369934,
-0.3703153729438782,
0.16529659926891327,
-0.188480943441391,
-1.013573408126831,
-0.1682310402393341,
-0.7394644618034363,
0.6530424356460571,
1.0746451616287231,
1.346523642539978,
-1.1406933069229126,
-0.34748944640159607,
-1.7432204484939575,
-0.2526768445968628,
-0.7143016457557678,
0.34992173314094543,
-1.9305070638656616,
-0.21130608022212982,
-2.0183868408203125,
-2.3586933612823486,
-1.358266830444336,
-0.8189138174057007,
1.0420145988464355,
0.16698923707008362,
-0.9193757176399231,
1.0346778631210327,
-0.3684466481208801,
-1.8442034721374512,
1.1765406131744385,
-2.161062717437744
] |
https://github.com/huggingface/datasets/issues/5123 | datasets freezes with streaming mode in multiple-gpu | I think you need to do `train_dataset = train_dataset.with_format("torch")` to work with the DataLoader in a multiprocessing setup :)
The hang is probably caused by our streamign lib `fsspec` which doesn't work in multiprocessing out of the box - but we made it work with the PyTorch DataLoader when the dataset format is set to "torch" | ## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
| 472 | 56 | datasets freezes with streaming mode in multiple-gpu
## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
I think you need to do `train_dataset = train_dataset.with_format("torch")` to work with the DataLoader in a multiprocessing setup :)
The hang is probably caused by our streamign lib `fsspec` which doesn't work in multiprocessing out of the box - but we made it work with the PyTorch DataLoader when the dataset format is set to "torch" | [
-1.2196941375732422,
-0.9265390634536743,
-0.7154155969619751,
1.4646788835525513,
-0.1441868543624878,
-1.2404600381851196,
0.09818949550390244,
-1.0889145135879517,
1.561210036277771,
-0.766279399394989,
0.27157339453697205,
-1.6538593769073486,
-0.031017590314149857,
-0.48414796590805054,
-0.753449022769928,
-0.8564292192459106,
-0.43187132477760315,
-0.9085370302200317,
1.0544241666793823,
2.541456460952759,
1.238066554069519,
-1.3789085149765015,
2.707625150680542,
0.6183651089668274,
-0.28375476598739624,
-1.0562281608581543,
0.4914971888065338,
0.05265944451093674,
-1.3426010608673096,
-0.4690755605697632,
-0.9343588948249817,
-0.021768631413578987,
-0.513971745967865,
-0.5481430292129517,
0.1315504014492035,
0.3927555978298187,
-0.19097450375556946,
-0.39653557538986206,
-0.4776310622692108,
-0.674271285533905,
0.45003896951675415,
-0.34303489327430725,
0.9542774558067322,
-0.29673346877098083,
1.7764742374420166,
-0.5822340250015259,
0.4204208552837372,
0.7471269965171814,
1.3177675008773804,
0.1977892965078354,
0.00911825243383646,
0.2995719015598297,
0.3690434694290161,
-0.027073003351688385,
0.5006393194198608,
1.2133288383483887,
0.6470579504966736,
0.4258016347885132,
0.6730741858482361,
-2.206968069076538,
1.32177734375,
-0.8521214723587036,
0.3151848018169403,
1.3639508485794067,
-0.948898196220398,
0.33002108335494995,
-1.8636839389801025,
-0.0408516488969326,
0.5247939229011536,
-2.209108591079712,
0.2663412094116211,
-1.3120408058166504,
-0.5187820196151733,
1.0780906677246094,
0.22621382772922516,
-1.2553026676177979,
0.22724923491477966,
-0.5109614729881287,
1.0825048685073853,
0.502551794052124,
1.2045079469680786,
-1.6525177955627441,
-0.053055305033922195,
-0.22096458077430725,
0.1501053422689438,
-1.269885778427124,
-1.5829702615737915,
0.5515368580818176,
0.622783362865448,
0.6200190186500549,
-0.1245521530508995,
0.9918457865715027,
-1.0412336587905884,
0.8439581394195557,
-0.9657367467880249,
-1.702380895614624,
-1.3975653648376465,
-2.2875359058380127,
-2.3538496494293213,
0.7833411693572998,
-0.49098339676856995,
-0.48595762252807617,
2.043440818786621,
-1.0940463542938232,
-1.8045988082885742,
1.0968130826950073,
0.31212225556373596,
0.03665555268526077,
2.3266162872314453,
0.27054035663604736,
-0.7715662121772766,
0.4353873133659363,
-0.7007548213005066,
0.7579501867294312,
-0.29536670446395874,
1.3403102159500122,
0.49578747153282166,
-0.9768232703208923,
1.5886470079421997,
-0.3369218707084656,
0.5592484474182129,
-0.678779661655426,
-0.5001794695854187,
-0.7466428279876709,
0.28943055868148804,
1.8903740644454956,
-0.3424609899520874,
1.557119607925415,
-0.35824042558670044,
-1.6710333824157715,
-1.553488850593567,
0.783078670501709,
0.5672897100448608,
-0.8038462996482849,
0.08542395383119583,
-0.45937302708625793,
0.04574445262551308,
-0.024679530411958694,
1.0531243085861206,
1.2256052494049072,
0.764526903629303,
-0.3791036903858185,
-0.8700701594352722,
0.22228902578353882,
-0.024389881640672684,
-0.6564667820930481,
-1.7730416059494019,
-0.3114410936832428,
0.19685357809066772,
0.7159045338630676,
-1.2066057920455933,
1.728532314300537,
0.9023963809013367,
1.9766522645950317,
0.9846182465553284,
-0.36182960867881775,
1.5362764596939087,
0.051193155348300934,
1.822758674621582,
-0.48359543085098267,
0.6152960658073425,
-0.3046688437461853,
-1.1953858137130737,
0.8193591833114624,
-0.3840271532535553,
-2.0460617542266846,
-0.7889803051948547,
-0.8046810030937195,
-0.1774633824825287,
-0.765680193901062,
0.9259167909622192,
-0.24395380914211273,
-1.5002785921096802,
0.18586590886116028,
-0.7031571269035339,
0.21713046729564667,
-1.2631146907806396,
0.2876998782157898,
0.7585954666137695,
-0.6546574831008911,
0.03635474294424057,
-0.2847440540790558,
-1.3299492597579956,
-0.482089638710022,
0.2555885314941406,
1.935956597328186,
-0.7466676831245422,
0.9977244734764099,
1.0288703441619873,
-0.6965973377227783,
0.11828635632991791,
0.2761755883693695,
-0.3382411301136017,
0.833848774433136,
-1.1520915031433105,
-0.315114289522171,
1.1405011415481567,
-0.14047589898109436,
-0.5562839508056641,
1.471627116203308,
0.8417165875434875,
-1.0451849699020386,
-0.3005620241165161,
-0.12290839850902557,
-0.7805737853050232,
-0.03752228990197182,
-1.568975567817688,
-0.12197384983301163,
0.3518800139427185,
-1.4865142107009888,
-0.3980593681335449,
-0.24516715109348297,
1.3649996519088745,
-0.20235849916934967,
1.4160126447677612,
-0.23609648644924164,
-0.16662970185279846,
-0.2959860861301422,
-0.41663509607315063,
0.19382227957248688,
-0.23418529331684113,
-0.6433618068695068,
0.318690687417984,
-0.7788034081459045,
0.3863050639629364,
1.5006078481674194,
0.3884235918521881,
-0.00019022077322006226,
0.47417497634887695,
1.1080034971237183,
0.37883907556533813,
-0.002778146415948868,
-0.8164379000663757,
-1.6140708923339844,
2.0191421508789062,
-1.4656296968460083,
1.939512848854065,
0.8449747562408447,
-0.046081412583589554,
-1.7433342933654785,
-1.848331093788147,
1.3511232137680054,
1.1672942638397217,
2.4696943759918213,
0.5762004852294922,
0.42126747965812683,
-0.7756940126419067,
-0.6782505512237549,
0.3392564654350281,
-0.9890856146812439,
-0.6823289394378662,
0.20723594725131989,
2.3987951278686523,
1.7446309328079224,
-0.4842599630355835,
-0.2373860478401184,
-0.8973423838615417,
1.2812271118164062,
-0.15210215747356415,
0.2147456407546997,
2.0669326782226562,
-0.2068791687488556,
-1.0644787549972534,
1.3586879968643188,
-2.3524374961853027,
0.2507283091545105,
2.0961709022521973,
0.23586231470108032,
0.029642552137374878,
-1.4289990663528442,
-0.6397950649261475,
-0.30462199449539185,
-0.4333078861236572,
-1.1869637966156006,
0.587566077709198,
-0.2887362241744995,
-0.8351829648017883,
-1.5269949436187744,
0.11956657469272614,
-1.155600905418396,
-1.7167274951934814,
0.32368239760398865,
1.849785327911377,
2.0171334743499756,
-0.7661897540092468,
1.425772786140442,
-0.30981558561325073,
0.1503465175628662,
1.2077202796936035,
1.297251582145691,
3.0895423889160156,
1.801468849182129,
-1.2655190229415894,
0.7652720212936401,
-0.19671571254730225,
-0.539990246295929,
1.0875061750411987,
-1.1737041473388672,
1.1934410333633423,
-0.18639099597930908,
-1.225818395614624,
-1.2079122066497803,
1.0307289361953735,
0.49156299233436584,
0.11513937264680862,
-0.48870187997817993,
1.25287926197052,
0.13206298649311066,
1.3606230020523071,
0.5472378134727478,
-0.33754125237464905,
0.5767080783843994,
-0.42384764552116394,
-0.5459473729133606,
1.548958659172058,
0.17662404477596283,
-1.4700467586517334,
-2.2897047996520996,
-0.2891959846019745,
-0.83060622215271,
-0.06987574696540833,
-0.6241534948348999,
-1.031946063041687,
1.6046165227890015,
0.4489043653011322,
-1.2942005395889282,
-0.2761368155479431,
-0.2938218116760254,
-0.5316752195358276,
2.5729079246520996,
-1.3579460382461548,
-0.15288743376731873,
-0.9766233563423157,
-0.5494853854179382,
1.6470723152160645,
-1.136026382446289,
-0.24366657435894012,
-1.0180833339691162,
-0.6197898387908936,
-1.290596842765808,
-0.6515306234359741,
0.014519116841256618,
-0.898371696472168,
0.7493624687194824,
0.10976632684469223,
-1.1049569845199585,
-0.2543349862098694,
-0.8716477751731873,
0.9739378690719604,
-0.10408321022987366,
0.21624097228050232,
1.8497835397720337,
0.42586252093315125,
-0.41084054112434387,
0.7086337804794312,
1.1682676076889038,
0.6527948975563049,
-0.7188342809677124,
0.08778499811887741,
-0.7523595690727234,
0.27312031388282776,
-1.3963708877563477,
0.27732372283935547,
-2.920530080795288,
0.6473391652107239,
-0.03915109112858772,
-0.10190664231777191,
-0.01194615289568901,
-1.354688048362732,
1.150322675704956,
2.604787588119507,
-1.1559698581695557,
0.45400241017341614,
0.4082641303539276,
1.1024219989776611,
-1.561321496963501,
0.2809440493583679,
-0.40414464473724365,
2.0925590991973877,
0.1753041297197342,
1.3182090520858765,
-0.4970410168170929,
-2.244457483291626,
0.6311855316162109,
-1.3103537559509277,
-1.1318570375442505,
0.8182228207588196,
-0.9041734337806702,
0.1373426616191864,
-1.402640461921692,
-0.22787636518478394,
-0.874118447303772,
-1.2131516933441162,
0.735505998134613,
0.09235156327486038,
0.4400927424430847,
-0.5481333136558533,
0.40668684244155884,
-2.171538829803467,
-1.3483706712722778,
-0.243732750415802,
-0.9873079657554626,
0.468234121799469,
-0.34478795528411865,
0.6460316181182861,
-0.12398447841405869,
0.10691895335912704,
0.3336278796195984,
1.3938778638839722,
3.356300115585327,
0.26448503136634827,
0.31335100531578064,
-0.07852749526500702,
-0.9935678243637085,
1.4641997814178467,
0.9334990382194519,
-0.09758613258600235,
-0.6031655669212341,
-0.9990250468254089,
1.1396456956863403,
2.052079200744629,
1.1207813024520874,
-0.006237646099179983,
-0.905368447303772,
-0.8131141066551208,
0.025303009897470474,
0.1922958791255951,
0.4902430772781372,
0.9256752133369446,
-0.00039423536509275436,
0.12187507748603821,
1.471239686012268,
1.1707947254180908,
-0.43878719210624695,
0.42896193265914917,
-0.9041079878807068,
-0.4822046160697937,
0.4004333019256592,
0.296958327293396,
0.05653358995914459,
0.4317501485347748,
-1.1210416555404663,
-0.1530856490135193,
-0.3772937059402466,
-0.9523237347602844,
-0.7993472814559937,
-0.46154555678367615,
-0.3354898989200592,
1.592426061630249,
0.03188944607973099,
-0.4231318235397339,
-0.023643802851438522,
-0.7166863083839417,
-0.1101628988981247,
-1.1042165756225586,
0.26067405939102173,
-0.09152278304100037,
-0.059500668197870255,
-0.13640739023685455,
1.7569867372512817,
-0.9890809059143066,
-2.0471696853637695,
0.25865548849105835,
0.2427690327167511,
-0.39798101782798767,
0.12420280277729034,
1.6489001512527466,
0.5068750381469727,
1.3894144296646118,
1.327484130859375,
1.0175814628601074,
-0.6459847092628479,
-1.2752317190170288,
0.7207511067390442,
0.9678804278373718,
-1.300871729850769,
0.8165826797485352,
-0.11118783056735992,
-0.5508304834365845,
0.6469881534576416,
1.3411006927490234,
0.45485082268714905,
-2.0625720024108887,
0.823930561542511,
-0.8976891040802002,
0.6816296577453613,
0.6471803784370422,
0.7939374446868896,
0.1646786481142044,
0.8232812285423279,
-1.2386083602905273,
-1.1066597700119019,
-0.6955675482749939,
-0.6255927085876465,
1.8918193578720093,
-0.2414528876543045,
0.5784627199172974,
-0.1486203968524933,
-1.2790189981460571,
-0.145253986120224,
0.7584624886512756,
0.3545883595943451,
-0.4690890610218048,
0.8293514251708984,
-0.6006035208702087,
-1.0724514722824097,
-1.3015717267990112,
-0.4464477002620697,
-1.0006465911865234,
-0.8824666738510132,
1.025266408920288,
0.70685213804245,
0.3753829896450043,
1.9114933013916016,
0.6000938415527344,
0.29863283038139343,
-2.7106900215148926,
0.8057000637054443,
0.2375808209180832,
-0.05415402725338936,
0.9706848859786987,
0.2624855637550354,
1.0838196277618408,
0.01351988036185503,
0.49397388100624084,
-2.428398609161377,
2.1844253540039062,
-0.17958612740039825,
0.6687203645706177,
-0.013192619197070599,
-0.22652117908000946,
1.1370424032211304,
0.5322349667549133,
0.5769769549369812,
-1.130793809890747,
0.7605836391448975,
-0.5691848993301392,
1.1377058029174805,
0.8039891123771667,
-0.867215096950531,
0.03022468090057373,
1.3170307874679565,
0.43901240825653076,
-0.4231123626232147,
-0.9110164046287537,
-0.9066488742828369,
0.9603777527809143,
1.7261966466903687,
-0.09707985073328018,
0.01699872314929962,
0.8202066421508789,
0.7248592376708984,
-1.2786717414855957,
-0.02794082835316658,
-0.7057914137840271,
-0.7477854490280151,
1.7095874547958374,
2.0935585498809814,
-0.06351744383573532,
-0.27786919474601746,
-0.7600245475769043,
-1.148963451385498,
0.7606449723243713,
-0.08941537886857986,
0.10329741984605789,
0.6662474274635315,
-0.6407580375671387,
1.1971540451049805,
0.7253331542015076,
0.9833413362503052,
0.1105804294347763,
0.3084678649902344,
0.3044417202472687,
-0.26742637157440186,
-1.1745692491531372,
-0.3157472312450409,
-1.055521845817566,
-2.5313963890075684,
0.4662782549858093,
-0.19151100516319275,
-1.45058012008667,
0.059001654386520386,
-1.0368480682373047,
0.8048184514045715,
-0.6094637513160706,
-1.1177098751068115,
-1.5219165086746216,
0.3157980144023895,
-0.15662401914596558,
0.920346200466156,
-1.6107361316680908,
-0.1411217451095581,
1.200111746788025,
0.9329019784927368,
-0.6209761500358582,
0.9791308045387268,
0.23964087665081024,
0.9473481178283691,
0.8147612810134888,
-0.33332934975624084,
0.4917972981929779,
0.2095366269350052,
-1.329925298690796,
0.42729970812797546,
1.2449049949645996,
0.19945387542247772,
1.439924955368042,
-0.5421908497810364,
0.09676084667444229,
0.45800334215164185,
-0.549057126045227,
-0.4840928614139557,
-0.5361000299453735,
0.78970867395401,
0.011676338501274586,
-0.9862543344497681,
0.03036605194211006,
-0.17264914512634277,
-0.2391441911458969,
0.22841103374958038,
-1.543778657913208,
-0.2517963647842407,
-0.3719506859779358,
-0.59010910987854,
-1.24989652633667,
0.047456301748752594,
1.3877105712890625,
-0.8705412745475769,
-0.1880919337272644,
0.4236986041069031,
0.3818496763706207,
0.49899986386299133,
0.6076264381408691,
-0.6488073468208313,
-0.3576003909111023,
-0.268405556678772,
-0.31560778617858887,
0.29020458459854126,
1.2710829973220825,
-0.07541612535715103,
-1.0201566219329834,
0.7526609301567078,
-0.39846861362457275,
0.055150002241134644,
1.9806333780288696,
0.09971404820680618,
-0.7420483231544495,
0.3380867540836334,
-0.6433494687080383,
1.89082670211792,
1.6995576620101929,
1.3766683340072632,
-0.13688240945339203,
-0.9615724682807922,
0.5847254395484924,
-0.23065632581710815,
-0.34625834226608276,
1.0050840377807617,
0.4827395975589752,
-0.16587024927139282,
-1.4012162685394287,
0.57035893201828,
1.298850417137146,
-0.9285339713096619,
-0.7487396597862244,
0.12431658804416656,
-0.902099072933197,
1.130395531654358,
0.6895737648010254,
0.36860132217407227,
0.20259366929531097,
1.5824801921844482,
0.7269153594970703,
-0.4535524845123291,
0.5803003311157227,
0.4690524637699127,
-0.11768174916505814,
-2.0830559730529785,
-0.9730139374732971,
0.34312790632247925,
-0.366370290517807,
-1.5562635660171509,
1.330164909362793,
-1.1540919542312622,
-0.9812217950820923,
0.5206158757209778,
0.10811688750982285,
1.4288722276687622,
0.36608561873435974,
1.6444567441940308,
2.150678873062134,
0.9133062362670898,
0.2801154851913452,
1.237135648727417,
-0.11873719841241837,
-0.4847700595855713,
1.8297356367111206,
-0.4800776243209839,
0.5195631384849548,
1.0618311166763306,
-0.3405071794986725,
-1.052426815032959,
-0.8439233303070068,
-1.1450340747833252,
-0.6678059697151184,
1.1552212238311768,
0.12710312008857727,
-1.2194374799728394,
0.2582300901412964,
1.5545369386672974,
0.1543097198009491,
-0.22860950231552124,
0.6601303219795227,
0.3644070029258728,
-0.7845331430435181,
-0.09692972153425217,
-0.8735353350639343,
0.43150636553764343,
-0.19066351652145386,
-0.30623289942741394,
0.2271261066198349,
0.5726096034049988,
1.2929388284683228,
-0.07162633538246155,
0.024216756224632263,
1.1975769996643066,
-1.454452395439148,
1.510317087173462,
-0.6592196226119995,
0.31169459223747253,
-2.388334274291992,
1.4107471704483032,
-0.8357357978820801,
1.8286961317062378,
-2.634979486465454,
0.3752976357936859,
-0.5417857766151428,
-0.48155999183654785,
0.2566426396369934,
-0.3703153729438782,
0.16529659926891327,
-0.188480943441391,
-1.013573408126831,
-0.1682310402393341,
-0.7394644618034363,
0.6530424356460571,
1.0746451616287231,
1.346523642539978,
-1.1406933069229126,
-0.34748944640159607,
-1.7432204484939575,
-0.2526768445968628,
-0.7143016457557678,
0.34992173314094543,
-1.9305070638656616,
-0.21130608022212982,
-2.0183868408203125,
-2.3586933612823486,
-1.358266830444336,
-0.8189138174057007,
1.0420145988464355,
0.16698923707008362,
-0.9193757176399231,
1.0346778631210327,
-0.3684466481208801,
-1.8442034721374512,
1.1765406131744385,
-2.161062717437744
] |
https://github.com/huggingface/datasets/issues/5123 | datasets freezes with streaming mode in multiple-gpu | Hi @lhoestq
thanks for the response. I added the line suggested right before calling `with accelerator.main_process_first():` in the code above and I confirm this also freezes. to reproduce it please run "accelerate launch code.py". I was wondering if you could have more suggestions for me? I do not have an idea how to fix this or debug this freezing. many thanks. | ## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
| 472 | 61 | datasets freezes with streaming mode in multiple-gpu
## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
Hi @lhoestq
thanks for the response. I added the line suggested right before calling `with accelerator.main_process_first():` in the code above and I confirm this also freezes. to reproduce it please run "accelerate launch code.py". I was wondering if you could have more suggestions for me? I do not have an idea how to fix this or debug this freezing. many thanks. | [
-1.2196941375732422,
-0.9265390634536743,
-0.7154155969619751,
1.4646788835525513,
-0.1441868543624878,
-1.2404600381851196,
0.09818949550390244,
-1.0889145135879517,
1.561210036277771,
-0.766279399394989,
0.27157339453697205,
-1.6538593769073486,
-0.031017590314149857,
-0.48414796590805054,
-0.753449022769928,
-0.8564292192459106,
-0.43187132477760315,
-0.9085370302200317,
1.0544241666793823,
2.541456460952759,
1.238066554069519,
-1.3789085149765015,
2.707625150680542,
0.6183651089668274,
-0.28375476598739624,
-1.0562281608581543,
0.4914971888065338,
0.05265944451093674,
-1.3426010608673096,
-0.4690755605697632,
-0.9343588948249817,
-0.021768631413578987,
-0.513971745967865,
-0.5481430292129517,
0.1315504014492035,
0.3927555978298187,
-0.19097450375556946,
-0.39653557538986206,
-0.4776310622692108,
-0.674271285533905,
0.45003896951675415,
-0.34303489327430725,
0.9542774558067322,
-0.29673346877098083,
1.7764742374420166,
-0.5822340250015259,
0.4204208552837372,
0.7471269965171814,
1.3177675008773804,
0.1977892965078354,
0.00911825243383646,
0.2995719015598297,
0.3690434694290161,
-0.027073003351688385,
0.5006393194198608,
1.2133288383483887,
0.6470579504966736,
0.4258016347885132,
0.6730741858482361,
-2.206968069076538,
1.32177734375,
-0.8521214723587036,
0.3151848018169403,
1.3639508485794067,
-0.948898196220398,
0.33002108335494995,
-1.8636839389801025,
-0.0408516488969326,
0.5247939229011536,
-2.209108591079712,
0.2663412094116211,
-1.3120408058166504,
-0.5187820196151733,
1.0780906677246094,
0.22621382772922516,
-1.2553026676177979,
0.22724923491477966,
-0.5109614729881287,
1.0825048685073853,
0.502551794052124,
1.2045079469680786,
-1.6525177955627441,
-0.053055305033922195,
-0.22096458077430725,
0.1501053422689438,
-1.269885778427124,
-1.5829702615737915,
0.5515368580818176,
0.622783362865448,
0.6200190186500549,
-0.1245521530508995,
0.9918457865715027,
-1.0412336587905884,
0.8439581394195557,
-0.9657367467880249,
-1.702380895614624,
-1.3975653648376465,
-2.2875359058380127,
-2.3538496494293213,
0.7833411693572998,
-0.49098339676856995,
-0.48595762252807617,
2.043440818786621,
-1.0940463542938232,
-1.8045988082885742,
1.0968130826950073,
0.31212225556373596,
0.03665555268526077,
2.3266162872314453,
0.27054035663604736,
-0.7715662121772766,
0.4353873133659363,
-0.7007548213005066,
0.7579501867294312,
-0.29536670446395874,
1.3403102159500122,
0.49578747153282166,
-0.9768232703208923,
1.5886470079421997,
-0.3369218707084656,
0.5592484474182129,
-0.678779661655426,
-0.5001794695854187,
-0.7466428279876709,
0.28943055868148804,
1.8903740644454956,
-0.3424609899520874,
1.557119607925415,
-0.35824042558670044,
-1.6710333824157715,
-1.553488850593567,
0.783078670501709,
0.5672897100448608,
-0.8038462996482849,
0.08542395383119583,
-0.45937302708625793,
0.04574445262551308,
-0.024679530411958694,
1.0531243085861206,
1.2256052494049072,
0.764526903629303,
-0.3791036903858185,
-0.8700701594352722,
0.22228902578353882,
-0.024389881640672684,
-0.6564667820930481,
-1.7730416059494019,
-0.3114410936832428,
0.19685357809066772,
0.7159045338630676,
-1.2066057920455933,
1.728532314300537,
0.9023963809013367,
1.9766522645950317,
0.9846182465553284,
-0.36182960867881775,
1.5362764596939087,
0.051193155348300934,
1.822758674621582,
-0.48359543085098267,
0.6152960658073425,
-0.3046688437461853,
-1.1953858137130737,
0.8193591833114624,
-0.3840271532535553,
-2.0460617542266846,
-0.7889803051948547,
-0.8046810030937195,
-0.1774633824825287,
-0.765680193901062,
0.9259167909622192,
-0.24395380914211273,
-1.5002785921096802,
0.18586590886116028,
-0.7031571269035339,
0.21713046729564667,
-1.2631146907806396,
0.2876998782157898,
0.7585954666137695,
-0.6546574831008911,
0.03635474294424057,
-0.2847440540790558,
-1.3299492597579956,
-0.482089638710022,
0.2555885314941406,
1.935956597328186,
-0.7466676831245422,
0.9977244734764099,
1.0288703441619873,
-0.6965973377227783,
0.11828635632991791,
0.2761755883693695,
-0.3382411301136017,
0.833848774433136,
-1.1520915031433105,
-0.315114289522171,
1.1405011415481567,
-0.14047589898109436,
-0.5562839508056641,
1.471627116203308,
0.8417165875434875,
-1.0451849699020386,
-0.3005620241165161,
-0.12290839850902557,
-0.7805737853050232,
-0.03752228990197182,
-1.568975567817688,
-0.12197384983301163,
0.3518800139427185,
-1.4865142107009888,
-0.3980593681335449,
-0.24516715109348297,
1.3649996519088745,
-0.20235849916934967,
1.4160126447677612,
-0.23609648644924164,
-0.16662970185279846,
-0.2959860861301422,
-0.41663509607315063,
0.19382227957248688,
-0.23418529331684113,
-0.6433618068695068,
0.318690687417984,
-0.7788034081459045,
0.3863050639629364,
1.5006078481674194,
0.3884235918521881,
-0.00019022077322006226,
0.47417497634887695,
1.1080034971237183,
0.37883907556533813,
-0.002778146415948868,
-0.8164379000663757,
-1.6140708923339844,
2.0191421508789062,
-1.4656296968460083,
1.939512848854065,
0.8449747562408447,
-0.046081412583589554,
-1.7433342933654785,
-1.848331093788147,
1.3511232137680054,
1.1672942638397217,
2.4696943759918213,
0.5762004852294922,
0.42126747965812683,
-0.7756940126419067,
-0.6782505512237549,
0.3392564654350281,
-0.9890856146812439,
-0.6823289394378662,
0.20723594725131989,
2.3987951278686523,
1.7446309328079224,
-0.4842599630355835,
-0.2373860478401184,
-0.8973423838615417,
1.2812271118164062,
-0.15210215747356415,
0.2147456407546997,
2.0669326782226562,
-0.2068791687488556,
-1.0644787549972534,
1.3586879968643188,
-2.3524374961853027,
0.2507283091545105,
2.0961709022521973,
0.23586231470108032,
0.029642552137374878,
-1.4289990663528442,
-0.6397950649261475,
-0.30462199449539185,
-0.4333078861236572,
-1.1869637966156006,
0.587566077709198,
-0.2887362241744995,
-0.8351829648017883,
-1.5269949436187744,
0.11956657469272614,
-1.155600905418396,
-1.7167274951934814,
0.32368239760398865,
1.849785327911377,
2.0171334743499756,
-0.7661897540092468,
1.425772786140442,
-0.30981558561325073,
0.1503465175628662,
1.2077202796936035,
1.297251582145691,
3.0895423889160156,
1.801468849182129,
-1.2655190229415894,
0.7652720212936401,
-0.19671571254730225,
-0.539990246295929,
1.0875061750411987,
-1.1737041473388672,
1.1934410333633423,
-0.18639099597930908,
-1.225818395614624,
-1.2079122066497803,
1.0307289361953735,
0.49156299233436584,
0.11513937264680862,
-0.48870187997817993,
1.25287926197052,
0.13206298649311066,
1.3606230020523071,
0.5472378134727478,
-0.33754125237464905,
0.5767080783843994,
-0.42384764552116394,
-0.5459473729133606,
1.548958659172058,
0.17662404477596283,
-1.4700467586517334,
-2.2897047996520996,
-0.2891959846019745,
-0.83060622215271,
-0.06987574696540833,
-0.6241534948348999,
-1.031946063041687,
1.6046165227890015,
0.4489043653011322,
-1.2942005395889282,
-0.2761368155479431,
-0.2938218116760254,
-0.5316752195358276,
2.5729079246520996,
-1.3579460382461548,
-0.15288743376731873,
-0.9766233563423157,
-0.5494853854179382,
1.6470723152160645,
-1.136026382446289,
-0.24366657435894012,
-1.0180833339691162,
-0.6197898387908936,
-1.290596842765808,
-0.6515306234359741,
0.014519116841256618,
-0.898371696472168,
0.7493624687194824,
0.10976632684469223,
-1.1049569845199585,
-0.2543349862098694,
-0.8716477751731873,
0.9739378690719604,
-0.10408321022987366,
0.21624097228050232,
1.8497835397720337,
0.42586252093315125,
-0.41084054112434387,
0.7086337804794312,
1.1682676076889038,
0.6527948975563049,
-0.7188342809677124,
0.08778499811887741,
-0.7523595690727234,
0.27312031388282776,
-1.3963708877563477,
0.27732372283935547,
-2.920530080795288,
0.6473391652107239,
-0.03915109112858772,
-0.10190664231777191,
-0.01194615289568901,
-1.354688048362732,
1.150322675704956,
2.604787588119507,
-1.1559698581695557,
0.45400241017341614,
0.4082641303539276,
1.1024219989776611,
-1.561321496963501,
0.2809440493583679,
-0.40414464473724365,
2.0925590991973877,
0.1753041297197342,
1.3182090520858765,
-0.4970410168170929,
-2.244457483291626,
0.6311855316162109,
-1.3103537559509277,
-1.1318570375442505,
0.8182228207588196,
-0.9041734337806702,
0.1373426616191864,
-1.402640461921692,
-0.22787636518478394,
-0.874118447303772,
-1.2131516933441162,
0.735505998134613,
0.09235156327486038,
0.4400927424430847,
-0.5481333136558533,
0.40668684244155884,
-2.171538829803467,
-1.3483706712722778,
-0.243732750415802,
-0.9873079657554626,
0.468234121799469,
-0.34478795528411865,
0.6460316181182861,
-0.12398447841405869,
0.10691895335912704,
0.3336278796195984,
1.3938778638839722,
3.356300115585327,
0.26448503136634827,
0.31335100531578064,
-0.07852749526500702,
-0.9935678243637085,
1.4641997814178467,
0.9334990382194519,
-0.09758613258600235,
-0.6031655669212341,
-0.9990250468254089,
1.1396456956863403,
2.052079200744629,
1.1207813024520874,
-0.006237646099179983,
-0.905368447303772,
-0.8131141066551208,
0.025303009897470474,
0.1922958791255951,
0.4902430772781372,
0.9256752133369446,
-0.00039423536509275436,
0.12187507748603821,
1.471239686012268,
1.1707947254180908,
-0.43878719210624695,
0.42896193265914917,
-0.9041079878807068,
-0.4822046160697937,
0.4004333019256592,
0.296958327293396,
0.05653358995914459,
0.4317501485347748,
-1.1210416555404663,
-0.1530856490135193,
-0.3772937059402466,
-0.9523237347602844,
-0.7993472814559937,
-0.46154555678367615,
-0.3354898989200592,
1.592426061630249,
0.03188944607973099,
-0.4231318235397339,
-0.023643802851438522,
-0.7166863083839417,
-0.1101628988981247,
-1.1042165756225586,
0.26067405939102173,
-0.09152278304100037,
-0.059500668197870255,
-0.13640739023685455,
1.7569867372512817,
-0.9890809059143066,
-2.0471696853637695,
0.25865548849105835,
0.2427690327167511,
-0.39798101782798767,
0.12420280277729034,
1.6489001512527466,
0.5068750381469727,
1.3894144296646118,
1.327484130859375,
1.0175814628601074,
-0.6459847092628479,
-1.2752317190170288,
0.7207511067390442,
0.9678804278373718,
-1.300871729850769,
0.8165826797485352,
-0.11118783056735992,
-0.5508304834365845,
0.6469881534576416,
1.3411006927490234,
0.45485082268714905,
-2.0625720024108887,
0.823930561542511,
-0.8976891040802002,
0.6816296577453613,
0.6471803784370422,
0.7939374446868896,
0.1646786481142044,
0.8232812285423279,
-1.2386083602905273,
-1.1066597700119019,
-0.6955675482749939,
-0.6255927085876465,
1.8918193578720093,
-0.2414528876543045,
0.5784627199172974,
-0.1486203968524933,
-1.2790189981460571,
-0.145253986120224,
0.7584624886512756,
0.3545883595943451,
-0.4690890610218048,
0.8293514251708984,
-0.6006035208702087,
-1.0724514722824097,
-1.3015717267990112,
-0.4464477002620697,
-1.0006465911865234,
-0.8824666738510132,
1.025266408920288,
0.70685213804245,
0.3753829896450043,
1.9114933013916016,
0.6000938415527344,
0.29863283038139343,
-2.7106900215148926,
0.8057000637054443,
0.2375808209180832,
-0.05415402725338936,
0.9706848859786987,
0.2624855637550354,
1.0838196277618408,
0.01351988036185503,
0.49397388100624084,
-2.428398609161377,
2.1844253540039062,
-0.17958612740039825,
0.6687203645706177,
-0.013192619197070599,
-0.22652117908000946,
1.1370424032211304,
0.5322349667549133,
0.5769769549369812,
-1.130793809890747,
0.7605836391448975,
-0.5691848993301392,
1.1377058029174805,
0.8039891123771667,
-0.867215096950531,
0.03022468090057373,
1.3170307874679565,
0.43901240825653076,
-0.4231123626232147,
-0.9110164046287537,
-0.9066488742828369,
0.9603777527809143,
1.7261966466903687,
-0.09707985073328018,
0.01699872314929962,
0.8202066421508789,
0.7248592376708984,
-1.2786717414855957,
-0.02794082835316658,
-0.7057914137840271,
-0.7477854490280151,
1.7095874547958374,
2.0935585498809814,
-0.06351744383573532,
-0.27786919474601746,
-0.7600245475769043,
-1.148963451385498,
0.7606449723243713,
-0.08941537886857986,
0.10329741984605789,
0.6662474274635315,
-0.6407580375671387,
1.1971540451049805,
0.7253331542015076,
0.9833413362503052,
0.1105804294347763,
0.3084678649902344,
0.3044417202472687,
-0.26742637157440186,
-1.1745692491531372,
-0.3157472312450409,
-1.055521845817566,
-2.5313963890075684,
0.4662782549858093,
-0.19151100516319275,
-1.45058012008667,
0.059001654386520386,
-1.0368480682373047,
0.8048184514045715,
-0.6094637513160706,
-1.1177098751068115,
-1.5219165086746216,
0.3157980144023895,
-0.15662401914596558,
0.920346200466156,
-1.6107361316680908,
-0.1411217451095581,
1.200111746788025,
0.9329019784927368,
-0.6209761500358582,
0.9791308045387268,
0.23964087665081024,
0.9473481178283691,
0.8147612810134888,
-0.33332934975624084,
0.4917972981929779,
0.2095366269350052,
-1.329925298690796,
0.42729970812797546,
1.2449049949645996,
0.19945387542247772,
1.439924955368042,
-0.5421908497810364,
0.09676084667444229,
0.45800334215164185,
-0.549057126045227,
-0.4840928614139557,
-0.5361000299453735,
0.78970867395401,
0.011676338501274586,
-0.9862543344497681,
0.03036605194211006,
-0.17264914512634277,
-0.2391441911458969,
0.22841103374958038,
-1.543778657913208,
-0.2517963647842407,
-0.3719506859779358,
-0.59010910987854,
-1.24989652633667,
0.047456301748752594,
1.3877105712890625,
-0.8705412745475769,
-0.1880919337272644,
0.4236986041069031,
0.3818496763706207,
0.49899986386299133,
0.6076264381408691,
-0.6488073468208313,
-0.3576003909111023,
-0.268405556678772,
-0.31560778617858887,
0.29020458459854126,
1.2710829973220825,
-0.07541612535715103,
-1.0201566219329834,
0.7526609301567078,
-0.39846861362457275,
0.055150002241134644,
1.9806333780288696,
0.09971404820680618,
-0.7420483231544495,
0.3380867540836334,
-0.6433494687080383,
1.89082670211792,
1.6995576620101929,
1.3766683340072632,
-0.13688240945339203,
-0.9615724682807922,
0.5847254395484924,
-0.23065632581710815,
-0.34625834226608276,
1.0050840377807617,
0.4827395975589752,
-0.16587024927139282,
-1.4012162685394287,
0.57035893201828,
1.298850417137146,
-0.9285339713096619,
-0.7487396597862244,
0.12431658804416656,
-0.902099072933197,
1.130395531654358,
0.6895737648010254,
0.36860132217407227,
0.20259366929531097,
1.5824801921844482,
0.7269153594970703,
-0.4535524845123291,
0.5803003311157227,
0.4690524637699127,
-0.11768174916505814,
-2.0830559730529785,
-0.9730139374732971,
0.34312790632247925,
-0.366370290517807,
-1.5562635660171509,
1.330164909362793,
-1.1540919542312622,
-0.9812217950820923,
0.5206158757209778,
0.10811688750982285,
1.4288722276687622,
0.36608561873435974,
1.6444567441940308,
2.150678873062134,
0.9133062362670898,
0.2801154851913452,
1.237135648727417,
-0.11873719841241837,
-0.4847700595855713,
1.8297356367111206,
-0.4800776243209839,
0.5195631384849548,
1.0618311166763306,
-0.3405071794986725,
-1.052426815032959,
-0.8439233303070068,
-1.1450340747833252,
-0.6678059697151184,
1.1552212238311768,
0.12710312008857727,
-1.2194374799728394,
0.2582300901412964,
1.5545369386672974,
0.1543097198009491,
-0.22860950231552124,
0.6601303219795227,
0.3644070029258728,
-0.7845331430435181,
-0.09692972153425217,
-0.8735353350639343,
0.43150636553764343,
-0.19066351652145386,
-0.30623289942741394,
0.2271261066198349,
0.5726096034049988,
1.2929388284683228,
-0.07162633538246155,
0.024216756224632263,
1.1975769996643066,
-1.454452395439148,
1.510317087173462,
-0.6592196226119995,
0.31169459223747253,
-2.388334274291992,
1.4107471704483032,
-0.8357357978820801,
1.8286961317062378,
-2.634979486465454,
0.3752976357936859,
-0.5417857766151428,
-0.48155999183654785,
0.2566426396369934,
-0.3703153729438782,
0.16529659926891327,
-0.188480943441391,
-1.013573408126831,
-0.1682310402393341,
-0.7394644618034363,
0.6530424356460571,
1.0746451616287231,
1.346523642539978,
-1.1406933069229126,
-0.34748944640159607,
-1.7432204484939575,
-0.2526768445968628,
-0.7143016457557678,
0.34992173314094543,
-1.9305070638656616,
-0.21130608022212982,
-2.0183868408203125,
-2.3586933612823486,
-1.358266830444336,
-0.8189138174057007,
1.0420145988464355,
0.16698923707008362,
-0.9193757176399231,
1.0346778631210327,
-0.3684466481208801,
-1.8442034721374512,
1.1765406131744385,
-2.161062717437744
] |
https://github.com/huggingface/datasets/issues/5123 | datasets freezes with streaming mode in multiple-gpu | Maybe the `fsspec` stuff need to be clearer even before - can you try to run this function at the very beginning of your script ?
```python
import fsspec
def _set_fsspec_for_multiprocess() -> None:
"""
Clear reference to the loop and thread.
This is necessary otherwise HTTPFileSystem hangs in the ML training loop.
Only required for fsspec >= 0.9.0
See https://github.com/fsspec/gcsfs/issues/379
"""
fsspec.asyn.iothread[0] = None
fsspec.asyn.loop[0] = None
_set_fsspec_for_multiprocess()
``` | ## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
| 472 | 69 | datasets freezes with streaming mode in multiple-gpu
## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
Maybe the `fsspec` stuff need to be clearer even before - can you try to run this function at the very beginning of your script ?
```python
import fsspec
def _set_fsspec_for_multiprocess() -> None:
"""
Clear reference to the loop and thread.
This is necessary otherwise HTTPFileSystem hangs in the ML training loop.
Only required for fsspec >= 0.9.0
See https://github.com/fsspec/gcsfs/issues/379
"""
fsspec.asyn.iothread[0] = None
fsspec.asyn.loop[0] = None
_set_fsspec_for_multiprocess()
``` | [
-1.2196941375732422,
-0.9265390634536743,
-0.7154155969619751,
1.4646788835525513,
-0.1441868543624878,
-1.2404600381851196,
0.09818949550390244,
-1.0889145135879517,
1.561210036277771,
-0.766279399394989,
0.27157339453697205,
-1.6538593769073486,
-0.031017590314149857,
-0.48414796590805054,
-0.753449022769928,
-0.8564292192459106,
-0.43187132477760315,
-0.9085370302200317,
1.0544241666793823,
2.541456460952759,
1.238066554069519,
-1.3789085149765015,
2.707625150680542,
0.6183651089668274,
-0.28375476598739624,
-1.0562281608581543,
0.4914971888065338,
0.05265944451093674,
-1.3426010608673096,
-0.4690755605697632,
-0.9343588948249817,
-0.021768631413578987,
-0.513971745967865,
-0.5481430292129517,
0.1315504014492035,
0.3927555978298187,
-0.19097450375556946,
-0.39653557538986206,
-0.4776310622692108,
-0.674271285533905,
0.45003896951675415,
-0.34303489327430725,
0.9542774558067322,
-0.29673346877098083,
1.7764742374420166,
-0.5822340250015259,
0.4204208552837372,
0.7471269965171814,
1.3177675008773804,
0.1977892965078354,
0.00911825243383646,
0.2995719015598297,
0.3690434694290161,
-0.027073003351688385,
0.5006393194198608,
1.2133288383483887,
0.6470579504966736,
0.4258016347885132,
0.6730741858482361,
-2.206968069076538,
1.32177734375,
-0.8521214723587036,
0.3151848018169403,
1.3639508485794067,
-0.948898196220398,
0.33002108335494995,
-1.8636839389801025,
-0.0408516488969326,
0.5247939229011536,
-2.209108591079712,
0.2663412094116211,
-1.3120408058166504,
-0.5187820196151733,
1.0780906677246094,
0.22621382772922516,
-1.2553026676177979,
0.22724923491477966,
-0.5109614729881287,
1.0825048685073853,
0.502551794052124,
1.2045079469680786,
-1.6525177955627441,
-0.053055305033922195,
-0.22096458077430725,
0.1501053422689438,
-1.269885778427124,
-1.5829702615737915,
0.5515368580818176,
0.622783362865448,
0.6200190186500549,
-0.1245521530508995,
0.9918457865715027,
-1.0412336587905884,
0.8439581394195557,
-0.9657367467880249,
-1.702380895614624,
-1.3975653648376465,
-2.2875359058380127,
-2.3538496494293213,
0.7833411693572998,
-0.49098339676856995,
-0.48595762252807617,
2.043440818786621,
-1.0940463542938232,
-1.8045988082885742,
1.0968130826950073,
0.31212225556373596,
0.03665555268526077,
2.3266162872314453,
0.27054035663604736,
-0.7715662121772766,
0.4353873133659363,
-0.7007548213005066,
0.7579501867294312,
-0.29536670446395874,
1.3403102159500122,
0.49578747153282166,
-0.9768232703208923,
1.5886470079421997,
-0.3369218707084656,
0.5592484474182129,
-0.678779661655426,
-0.5001794695854187,
-0.7466428279876709,
0.28943055868148804,
1.8903740644454956,
-0.3424609899520874,
1.557119607925415,
-0.35824042558670044,
-1.6710333824157715,
-1.553488850593567,
0.783078670501709,
0.5672897100448608,
-0.8038462996482849,
0.08542395383119583,
-0.45937302708625793,
0.04574445262551308,
-0.024679530411958694,
1.0531243085861206,
1.2256052494049072,
0.764526903629303,
-0.3791036903858185,
-0.8700701594352722,
0.22228902578353882,
-0.024389881640672684,
-0.6564667820930481,
-1.7730416059494019,
-0.3114410936832428,
0.19685357809066772,
0.7159045338630676,
-1.2066057920455933,
1.728532314300537,
0.9023963809013367,
1.9766522645950317,
0.9846182465553284,
-0.36182960867881775,
1.5362764596939087,
0.051193155348300934,
1.822758674621582,
-0.48359543085098267,
0.6152960658073425,
-0.3046688437461853,
-1.1953858137130737,
0.8193591833114624,
-0.3840271532535553,
-2.0460617542266846,
-0.7889803051948547,
-0.8046810030937195,
-0.1774633824825287,
-0.765680193901062,
0.9259167909622192,
-0.24395380914211273,
-1.5002785921096802,
0.18586590886116028,
-0.7031571269035339,
0.21713046729564667,
-1.2631146907806396,
0.2876998782157898,
0.7585954666137695,
-0.6546574831008911,
0.03635474294424057,
-0.2847440540790558,
-1.3299492597579956,
-0.482089638710022,
0.2555885314941406,
1.935956597328186,
-0.7466676831245422,
0.9977244734764099,
1.0288703441619873,
-0.6965973377227783,
0.11828635632991791,
0.2761755883693695,
-0.3382411301136017,
0.833848774433136,
-1.1520915031433105,
-0.315114289522171,
1.1405011415481567,
-0.14047589898109436,
-0.5562839508056641,
1.471627116203308,
0.8417165875434875,
-1.0451849699020386,
-0.3005620241165161,
-0.12290839850902557,
-0.7805737853050232,
-0.03752228990197182,
-1.568975567817688,
-0.12197384983301163,
0.3518800139427185,
-1.4865142107009888,
-0.3980593681335449,
-0.24516715109348297,
1.3649996519088745,
-0.20235849916934967,
1.4160126447677612,
-0.23609648644924164,
-0.16662970185279846,
-0.2959860861301422,
-0.41663509607315063,
0.19382227957248688,
-0.23418529331684113,
-0.6433618068695068,
0.318690687417984,
-0.7788034081459045,
0.3863050639629364,
1.5006078481674194,
0.3884235918521881,
-0.00019022077322006226,
0.47417497634887695,
1.1080034971237183,
0.37883907556533813,
-0.002778146415948868,
-0.8164379000663757,
-1.6140708923339844,
2.0191421508789062,
-1.4656296968460083,
1.939512848854065,
0.8449747562408447,
-0.046081412583589554,
-1.7433342933654785,
-1.848331093788147,
1.3511232137680054,
1.1672942638397217,
2.4696943759918213,
0.5762004852294922,
0.42126747965812683,
-0.7756940126419067,
-0.6782505512237549,
0.3392564654350281,
-0.9890856146812439,
-0.6823289394378662,
0.20723594725131989,
2.3987951278686523,
1.7446309328079224,
-0.4842599630355835,
-0.2373860478401184,
-0.8973423838615417,
1.2812271118164062,
-0.15210215747356415,
0.2147456407546997,
2.0669326782226562,
-0.2068791687488556,
-1.0644787549972534,
1.3586879968643188,
-2.3524374961853027,
0.2507283091545105,
2.0961709022521973,
0.23586231470108032,
0.029642552137374878,
-1.4289990663528442,
-0.6397950649261475,
-0.30462199449539185,
-0.4333078861236572,
-1.1869637966156006,
0.587566077709198,
-0.2887362241744995,
-0.8351829648017883,
-1.5269949436187744,
0.11956657469272614,
-1.155600905418396,
-1.7167274951934814,
0.32368239760398865,
1.849785327911377,
2.0171334743499756,
-0.7661897540092468,
1.425772786140442,
-0.30981558561325073,
0.1503465175628662,
1.2077202796936035,
1.297251582145691,
3.0895423889160156,
1.801468849182129,
-1.2655190229415894,
0.7652720212936401,
-0.19671571254730225,
-0.539990246295929,
1.0875061750411987,
-1.1737041473388672,
1.1934410333633423,
-0.18639099597930908,
-1.225818395614624,
-1.2079122066497803,
1.0307289361953735,
0.49156299233436584,
0.11513937264680862,
-0.48870187997817993,
1.25287926197052,
0.13206298649311066,
1.3606230020523071,
0.5472378134727478,
-0.33754125237464905,
0.5767080783843994,
-0.42384764552116394,
-0.5459473729133606,
1.548958659172058,
0.17662404477596283,
-1.4700467586517334,
-2.2897047996520996,
-0.2891959846019745,
-0.83060622215271,
-0.06987574696540833,
-0.6241534948348999,
-1.031946063041687,
1.6046165227890015,
0.4489043653011322,
-1.2942005395889282,
-0.2761368155479431,
-0.2938218116760254,
-0.5316752195358276,
2.5729079246520996,
-1.3579460382461548,
-0.15288743376731873,
-0.9766233563423157,
-0.5494853854179382,
1.6470723152160645,
-1.136026382446289,
-0.24366657435894012,
-1.0180833339691162,
-0.6197898387908936,
-1.290596842765808,
-0.6515306234359741,
0.014519116841256618,
-0.898371696472168,
0.7493624687194824,
0.10976632684469223,
-1.1049569845199585,
-0.2543349862098694,
-0.8716477751731873,
0.9739378690719604,
-0.10408321022987366,
0.21624097228050232,
1.8497835397720337,
0.42586252093315125,
-0.41084054112434387,
0.7086337804794312,
1.1682676076889038,
0.6527948975563049,
-0.7188342809677124,
0.08778499811887741,
-0.7523595690727234,
0.27312031388282776,
-1.3963708877563477,
0.27732372283935547,
-2.920530080795288,
0.6473391652107239,
-0.03915109112858772,
-0.10190664231777191,
-0.01194615289568901,
-1.354688048362732,
1.150322675704956,
2.604787588119507,
-1.1559698581695557,
0.45400241017341614,
0.4082641303539276,
1.1024219989776611,
-1.561321496963501,
0.2809440493583679,
-0.40414464473724365,
2.0925590991973877,
0.1753041297197342,
1.3182090520858765,
-0.4970410168170929,
-2.244457483291626,
0.6311855316162109,
-1.3103537559509277,
-1.1318570375442505,
0.8182228207588196,
-0.9041734337806702,
0.1373426616191864,
-1.402640461921692,
-0.22787636518478394,
-0.874118447303772,
-1.2131516933441162,
0.735505998134613,
0.09235156327486038,
0.4400927424430847,
-0.5481333136558533,
0.40668684244155884,
-2.171538829803467,
-1.3483706712722778,
-0.243732750415802,
-0.9873079657554626,
0.468234121799469,
-0.34478795528411865,
0.6460316181182861,
-0.12398447841405869,
0.10691895335912704,
0.3336278796195984,
1.3938778638839722,
3.356300115585327,
0.26448503136634827,
0.31335100531578064,
-0.07852749526500702,
-0.9935678243637085,
1.4641997814178467,
0.9334990382194519,
-0.09758613258600235,
-0.6031655669212341,
-0.9990250468254089,
1.1396456956863403,
2.052079200744629,
1.1207813024520874,
-0.006237646099179983,
-0.905368447303772,
-0.8131141066551208,
0.025303009897470474,
0.1922958791255951,
0.4902430772781372,
0.9256752133369446,
-0.00039423536509275436,
0.12187507748603821,
1.471239686012268,
1.1707947254180908,
-0.43878719210624695,
0.42896193265914917,
-0.9041079878807068,
-0.4822046160697937,
0.4004333019256592,
0.296958327293396,
0.05653358995914459,
0.4317501485347748,
-1.1210416555404663,
-0.1530856490135193,
-0.3772937059402466,
-0.9523237347602844,
-0.7993472814559937,
-0.46154555678367615,
-0.3354898989200592,
1.592426061630249,
0.03188944607973099,
-0.4231318235397339,
-0.023643802851438522,
-0.7166863083839417,
-0.1101628988981247,
-1.1042165756225586,
0.26067405939102173,
-0.09152278304100037,
-0.059500668197870255,
-0.13640739023685455,
1.7569867372512817,
-0.9890809059143066,
-2.0471696853637695,
0.25865548849105835,
0.2427690327167511,
-0.39798101782798767,
0.12420280277729034,
1.6489001512527466,
0.5068750381469727,
1.3894144296646118,
1.327484130859375,
1.0175814628601074,
-0.6459847092628479,
-1.2752317190170288,
0.7207511067390442,
0.9678804278373718,
-1.300871729850769,
0.8165826797485352,
-0.11118783056735992,
-0.5508304834365845,
0.6469881534576416,
1.3411006927490234,
0.45485082268714905,
-2.0625720024108887,
0.823930561542511,
-0.8976891040802002,
0.6816296577453613,
0.6471803784370422,
0.7939374446868896,
0.1646786481142044,
0.8232812285423279,
-1.2386083602905273,
-1.1066597700119019,
-0.6955675482749939,
-0.6255927085876465,
1.8918193578720093,
-0.2414528876543045,
0.5784627199172974,
-0.1486203968524933,
-1.2790189981460571,
-0.145253986120224,
0.7584624886512756,
0.3545883595943451,
-0.4690890610218048,
0.8293514251708984,
-0.6006035208702087,
-1.0724514722824097,
-1.3015717267990112,
-0.4464477002620697,
-1.0006465911865234,
-0.8824666738510132,
1.025266408920288,
0.70685213804245,
0.3753829896450043,
1.9114933013916016,
0.6000938415527344,
0.29863283038139343,
-2.7106900215148926,
0.8057000637054443,
0.2375808209180832,
-0.05415402725338936,
0.9706848859786987,
0.2624855637550354,
1.0838196277618408,
0.01351988036185503,
0.49397388100624084,
-2.428398609161377,
2.1844253540039062,
-0.17958612740039825,
0.6687203645706177,
-0.013192619197070599,
-0.22652117908000946,
1.1370424032211304,
0.5322349667549133,
0.5769769549369812,
-1.130793809890747,
0.7605836391448975,
-0.5691848993301392,
1.1377058029174805,
0.8039891123771667,
-0.867215096950531,
0.03022468090057373,
1.3170307874679565,
0.43901240825653076,
-0.4231123626232147,
-0.9110164046287537,
-0.9066488742828369,
0.9603777527809143,
1.7261966466903687,
-0.09707985073328018,
0.01699872314929962,
0.8202066421508789,
0.7248592376708984,
-1.2786717414855957,
-0.02794082835316658,
-0.7057914137840271,
-0.7477854490280151,
1.7095874547958374,
2.0935585498809814,
-0.06351744383573532,
-0.27786919474601746,
-0.7600245475769043,
-1.148963451385498,
0.7606449723243713,
-0.08941537886857986,
0.10329741984605789,
0.6662474274635315,
-0.6407580375671387,
1.1971540451049805,
0.7253331542015076,
0.9833413362503052,
0.1105804294347763,
0.3084678649902344,
0.3044417202472687,
-0.26742637157440186,
-1.1745692491531372,
-0.3157472312450409,
-1.055521845817566,
-2.5313963890075684,
0.4662782549858093,
-0.19151100516319275,
-1.45058012008667,
0.059001654386520386,
-1.0368480682373047,
0.8048184514045715,
-0.6094637513160706,
-1.1177098751068115,
-1.5219165086746216,
0.3157980144023895,
-0.15662401914596558,
0.920346200466156,
-1.6107361316680908,
-0.1411217451095581,
1.200111746788025,
0.9329019784927368,
-0.6209761500358582,
0.9791308045387268,
0.23964087665081024,
0.9473481178283691,
0.8147612810134888,
-0.33332934975624084,
0.4917972981929779,
0.2095366269350052,
-1.329925298690796,
0.42729970812797546,
1.2449049949645996,
0.19945387542247772,
1.439924955368042,
-0.5421908497810364,
0.09676084667444229,
0.45800334215164185,
-0.549057126045227,
-0.4840928614139557,
-0.5361000299453735,
0.78970867395401,
0.011676338501274586,
-0.9862543344497681,
0.03036605194211006,
-0.17264914512634277,
-0.2391441911458969,
0.22841103374958038,
-1.543778657913208,
-0.2517963647842407,
-0.3719506859779358,
-0.59010910987854,
-1.24989652633667,
0.047456301748752594,
1.3877105712890625,
-0.8705412745475769,
-0.1880919337272644,
0.4236986041069031,
0.3818496763706207,
0.49899986386299133,
0.6076264381408691,
-0.6488073468208313,
-0.3576003909111023,
-0.268405556678772,
-0.31560778617858887,
0.29020458459854126,
1.2710829973220825,
-0.07541612535715103,
-1.0201566219329834,
0.7526609301567078,
-0.39846861362457275,
0.055150002241134644,
1.9806333780288696,
0.09971404820680618,
-0.7420483231544495,
0.3380867540836334,
-0.6433494687080383,
1.89082670211792,
1.6995576620101929,
1.3766683340072632,
-0.13688240945339203,
-0.9615724682807922,
0.5847254395484924,
-0.23065632581710815,
-0.34625834226608276,
1.0050840377807617,
0.4827395975589752,
-0.16587024927139282,
-1.4012162685394287,
0.57035893201828,
1.298850417137146,
-0.9285339713096619,
-0.7487396597862244,
0.12431658804416656,
-0.902099072933197,
1.130395531654358,
0.6895737648010254,
0.36860132217407227,
0.20259366929531097,
1.5824801921844482,
0.7269153594970703,
-0.4535524845123291,
0.5803003311157227,
0.4690524637699127,
-0.11768174916505814,
-2.0830559730529785,
-0.9730139374732971,
0.34312790632247925,
-0.366370290517807,
-1.5562635660171509,
1.330164909362793,
-1.1540919542312622,
-0.9812217950820923,
0.5206158757209778,
0.10811688750982285,
1.4288722276687622,
0.36608561873435974,
1.6444567441940308,
2.150678873062134,
0.9133062362670898,
0.2801154851913452,
1.237135648727417,
-0.11873719841241837,
-0.4847700595855713,
1.8297356367111206,
-0.4800776243209839,
0.5195631384849548,
1.0618311166763306,
-0.3405071794986725,
-1.052426815032959,
-0.8439233303070068,
-1.1450340747833252,
-0.6678059697151184,
1.1552212238311768,
0.12710312008857727,
-1.2194374799728394,
0.2582300901412964,
1.5545369386672974,
0.1543097198009491,
-0.22860950231552124,
0.6601303219795227,
0.3644070029258728,
-0.7845331430435181,
-0.09692972153425217,
-0.8735353350639343,
0.43150636553764343,
-0.19066351652145386,
-0.30623289942741394,
0.2271261066198349,
0.5726096034049988,
1.2929388284683228,
-0.07162633538246155,
0.024216756224632263,
1.1975769996643066,
-1.454452395439148,
1.510317087173462,
-0.6592196226119995,
0.31169459223747253,
-2.388334274291992,
1.4107471704483032,
-0.8357357978820801,
1.8286961317062378,
-2.634979486465454,
0.3752976357936859,
-0.5417857766151428,
-0.48155999183654785,
0.2566426396369934,
-0.3703153729438782,
0.16529659926891327,
-0.188480943441391,
-1.013573408126831,
-0.1682310402393341,
-0.7394644618034363,
0.6530424356460571,
1.0746451616287231,
1.346523642539978,
-1.1406933069229126,
-0.34748944640159607,
-1.7432204484939575,
-0.2526768445968628,
-0.7143016457557678,
0.34992173314094543,
-1.9305070638656616,
-0.21130608022212982,
-2.0183868408203125,
-2.3586933612823486,
-1.358266830444336,
-0.8189138174057007,
1.0420145988464355,
0.16698923707008362,
-0.9193757176399231,
1.0346778631210327,
-0.3684466481208801,
-1.8442034721374512,
1.1765406131744385,
-2.161062717437744
] |
https://github.com/huggingface/datasets/issues/5123 | datasets freezes with streaming mode in multiple-gpu | Hi @lhoestq
thank you. I tried it, I am getting `AttributeError: module 'fsspec' has no attribute 'asyn'`. which version of fsspect do you use?
I am using
```fsspec 2022.8.2 pypi_0 pypi```
thank you. | ## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
| 472 | 33 | datasets freezes with streaming mode in multiple-gpu
## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
Hi @lhoestq
thank you. I tried it, I am getting `AttributeError: module 'fsspec' has no attribute 'asyn'`. which version of fsspect do you use?
I am using
```fsspec 2022.8.2 pypi_0 pypi```
thank you. | [
-1.2196941375732422,
-0.9265390634536743,
-0.7154155969619751,
1.4646788835525513,
-0.1441868543624878,
-1.2404600381851196,
0.09818949550390244,
-1.0889145135879517,
1.561210036277771,
-0.766279399394989,
0.27157339453697205,
-1.6538593769073486,
-0.031017590314149857,
-0.48414796590805054,
-0.753449022769928,
-0.8564292192459106,
-0.43187132477760315,
-0.9085370302200317,
1.0544241666793823,
2.541456460952759,
1.238066554069519,
-1.3789085149765015,
2.707625150680542,
0.6183651089668274,
-0.28375476598739624,
-1.0562281608581543,
0.4914971888065338,
0.05265944451093674,
-1.3426010608673096,
-0.4690755605697632,
-0.9343588948249817,
-0.021768631413578987,
-0.513971745967865,
-0.5481430292129517,
0.1315504014492035,
0.3927555978298187,
-0.19097450375556946,
-0.39653557538986206,
-0.4776310622692108,
-0.674271285533905,
0.45003896951675415,
-0.34303489327430725,
0.9542774558067322,
-0.29673346877098083,
1.7764742374420166,
-0.5822340250015259,
0.4204208552837372,
0.7471269965171814,
1.3177675008773804,
0.1977892965078354,
0.00911825243383646,
0.2995719015598297,
0.3690434694290161,
-0.027073003351688385,
0.5006393194198608,
1.2133288383483887,
0.6470579504966736,
0.4258016347885132,
0.6730741858482361,
-2.206968069076538,
1.32177734375,
-0.8521214723587036,
0.3151848018169403,
1.3639508485794067,
-0.948898196220398,
0.33002108335494995,
-1.8636839389801025,
-0.0408516488969326,
0.5247939229011536,
-2.209108591079712,
0.2663412094116211,
-1.3120408058166504,
-0.5187820196151733,
1.0780906677246094,
0.22621382772922516,
-1.2553026676177979,
0.22724923491477966,
-0.5109614729881287,
1.0825048685073853,
0.502551794052124,
1.2045079469680786,
-1.6525177955627441,
-0.053055305033922195,
-0.22096458077430725,
0.1501053422689438,
-1.269885778427124,
-1.5829702615737915,
0.5515368580818176,
0.622783362865448,
0.6200190186500549,
-0.1245521530508995,
0.9918457865715027,
-1.0412336587905884,
0.8439581394195557,
-0.9657367467880249,
-1.702380895614624,
-1.3975653648376465,
-2.2875359058380127,
-2.3538496494293213,
0.7833411693572998,
-0.49098339676856995,
-0.48595762252807617,
2.043440818786621,
-1.0940463542938232,
-1.8045988082885742,
1.0968130826950073,
0.31212225556373596,
0.03665555268526077,
2.3266162872314453,
0.27054035663604736,
-0.7715662121772766,
0.4353873133659363,
-0.7007548213005066,
0.7579501867294312,
-0.29536670446395874,
1.3403102159500122,
0.49578747153282166,
-0.9768232703208923,
1.5886470079421997,
-0.3369218707084656,
0.5592484474182129,
-0.678779661655426,
-0.5001794695854187,
-0.7466428279876709,
0.28943055868148804,
1.8903740644454956,
-0.3424609899520874,
1.557119607925415,
-0.35824042558670044,
-1.6710333824157715,
-1.553488850593567,
0.783078670501709,
0.5672897100448608,
-0.8038462996482849,
0.08542395383119583,
-0.45937302708625793,
0.04574445262551308,
-0.024679530411958694,
1.0531243085861206,
1.2256052494049072,
0.764526903629303,
-0.3791036903858185,
-0.8700701594352722,
0.22228902578353882,
-0.024389881640672684,
-0.6564667820930481,
-1.7730416059494019,
-0.3114410936832428,
0.19685357809066772,
0.7159045338630676,
-1.2066057920455933,
1.728532314300537,
0.9023963809013367,
1.9766522645950317,
0.9846182465553284,
-0.36182960867881775,
1.5362764596939087,
0.051193155348300934,
1.822758674621582,
-0.48359543085098267,
0.6152960658073425,
-0.3046688437461853,
-1.1953858137130737,
0.8193591833114624,
-0.3840271532535553,
-2.0460617542266846,
-0.7889803051948547,
-0.8046810030937195,
-0.1774633824825287,
-0.765680193901062,
0.9259167909622192,
-0.24395380914211273,
-1.5002785921096802,
0.18586590886116028,
-0.7031571269035339,
0.21713046729564667,
-1.2631146907806396,
0.2876998782157898,
0.7585954666137695,
-0.6546574831008911,
0.03635474294424057,
-0.2847440540790558,
-1.3299492597579956,
-0.482089638710022,
0.2555885314941406,
1.935956597328186,
-0.7466676831245422,
0.9977244734764099,
1.0288703441619873,
-0.6965973377227783,
0.11828635632991791,
0.2761755883693695,
-0.3382411301136017,
0.833848774433136,
-1.1520915031433105,
-0.315114289522171,
1.1405011415481567,
-0.14047589898109436,
-0.5562839508056641,
1.471627116203308,
0.8417165875434875,
-1.0451849699020386,
-0.3005620241165161,
-0.12290839850902557,
-0.7805737853050232,
-0.03752228990197182,
-1.568975567817688,
-0.12197384983301163,
0.3518800139427185,
-1.4865142107009888,
-0.3980593681335449,
-0.24516715109348297,
1.3649996519088745,
-0.20235849916934967,
1.4160126447677612,
-0.23609648644924164,
-0.16662970185279846,
-0.2959860861301422,
-0.41663509607315063,
0.19382227957248688,
-0.23418529331684113,
-0.6433618068695068,
0.318690687417984,
-0.7788034081459045,
0.3863050639629364,
1.5006078481674194,
0.3884235918521881,
-0.00019022077322006226,
0.47417497634887695,
1.1080034971237183,
0.37883907556533813,
-0.002778146415948868,
-0.8164379000663757,
-1.6140708923339844,
2.0191421508789062,
-1.4656296968460083,
1.939512848854065,
0.8449747562408447,
-0.046081412583589554,
-1.7433342933654785,
-1.848331093788147,
1.3511232137680054,
1.1672942638397217,
2.4696943759918213,
0.5762004852294922,
0.42126747965812683,
-0.7756940126419067,
-0.6782505512237549,
0.3392564654350281,
-0.9890856146812439,
-0.6823289394378662,
0.20723594725131989,
2.3987951278686523,
1.7446309328079224,
-0.4842599630355835,
-0.2373860478401184,
-0.8973423838615417,
1.2812271118164062,
-0.15210215747356415,
0.2147456407546997,
2.0669326782226562,
-0.2068791687488556,
-1.0644787549972534,
1.3586879968643188,
-2.3524374961853027,
0.2507283091545105,
2.0961709022521973,
0.23586231470108032,
0.029642552137374878,
-1.4289990663528442,
-0.6397950649261475,
-0.30462199449539185,
-0.4333078861236572,
-1.1869637966156006,
0.587566077709198,
-0.2887362241744995,
-0.8351829648017883,
-1.5269949436187744,
0.11956657469272614,
-1.155600905418396,
-1.7167274951934814,
0.32368239760398865,
1.849785327911377,
2.0171334743499756,
-0.7661897540092468,
1.425772786140442,
-0.30981558561325073,
0.1503465175628662,
1.2077202796936035,
1.297251582145691,
3.0895423889160156,
1.801468849182129,
-1.2655190229415894,
0.7652720212936401,
-0.19671571254730225,
-0.539990246295929,
1.0875061750411987,
-1.1737041473388672,
1.1934410333633423,
-0.18639099597930908,
-1.225818395614624,
-1.2079122066497803,
1.0307289361953735,
0.49156299233436584,
0.11513937264680862,
-0.48870187997817993,
1.25287926197052,
0.13206298649311066,
1.3606230020523071,
0.5472378134727478,
-0.33754125237464905,
0.5767080783843994,
-0.42384764552116394,
-0.5459473729133606,
1.548958659172058,
0.17662404477596283,
-1.4700467586517334,
-2.2897047996520996,
-0.2891959846019745,
-0.83060622215271,
-0.06987574696540833,
-0.6241534948348999,
-1.031946063041687,
1.6046165227890015,
0.4489043653011322,
-1.2942005395889282,
-0.2761368155479431,
-0.2938218116760254,
-0.5316752195358276,
2.5729079246520996,
-1.3579460382461548,
-0.15288743376731873,
-0.9766233563423157,
-0.5494853854179382,
1.6470723152160645,
-1.136026382446289,
-0.24366657435894012,
-1.0180833339691162,
-0.6197898387908936,
-1.290596842765808,
-0.6515306234359741,
0.014519116841256618,
-0.898371696472168,
0.7493624687194824,
0.10976632684469223,
-1.1049569845199585,
-0.2543349862098694,
-0.8716477751731873,
0.9739378690719604,
-0.10408321022987366,
0.21624097228050232,
1.8497835397720337,
0.42586252093315125,
-0.41084054112434387,
0.7086337804794312,
1.1682676076889038,
0.6527948975563049,
-0.7188342809677124,
0.08778499811887741,
-0.7523595690727234,
0.27312031388282776,
-1.3963708877563477,
0.27732372283935547,
-2.920530080795288,
0.6473391652107239,
-0.03915109112858772,
-0.10190664231777191,
-0.01194615289568901,
-1.354688048362732,
1.150322675704956,
2.604787588119507,
-1.1559698581695557,
0.45400241017341614,
0.4082641303539276,
1.1024219989776611,
-1.561321496963501,
0.2809440493583679,
-0.40414464473724365,
2.0925590991973877,
0.1753041297197342,
1.3182090520858765,
-0.4970410168170929,
-2.244457483291626,
0.6311855316162109,
-1.3103537559509277,
-1.1318570375442505,
0.8182228207588196,
-0.9041734337806702,
0.1373426616191864,
-1.402640461921692,
-0.22787636518478394,
-0.874118447303772,
-1.2131516933441162,
0.735505998134613,
0.09235156327486038,
0.4400927424430847,
-0.5481333136558533,
0.40668684244155884,
-2.171538829803467,
-1.3483706712722778,
-0.243732750415802,
-0.9873079657554626,
0.468234121799469,
-0.34478795528411865,
0.6460316181182861,
-0.12398447841405869,
0.10691895335912704,
0.3336278796195984,
1.3938778638839722,
3.356300115585327,
0.26448503136634827,
0.31335100531578064,
-0.07852749526500702,
-0.9935678243637085,
1.4641997814178467,
0.9334990382194519,
-0.09758613258600235,
-0.6031655669212341,
-0.9990250468254089,
1.1396456956863403,
2.052079200744629,
1.1207813024520874,
-0.006237646099179983,
-0.905368447303772,
-0.8131141066551208,
0.025303009897470474,
0.1922958791255951,
0.4902430772781372,
0.9256752133369446,
-0.00039423536509275436,
0.12187507748603821,
1.471239686012268,
1.1707947254180908,
-0.43878719210624695,
0.42896193265914917,
-0.9041079878807068,
-0.4822046160697937,
0.4004333019256592,
0.296958327293396,
0.05653358995914459,
0.4317501485347748,
-1.1210416555404663,
-0.1530856490135193,
-0.3772937059402466,
-0.9523237347602844,
-0.7993472814559937,
-0.46154555678367615,
-0.3354898989200592,
1.592426061630249,
0.03188944607973099,
-0.4231318235397339,
-0.023643802851438522,
-0.7166863083839417,
-0.1101628988981247,
-1.1042165756225586,
0.26067405939102173,
-0.09152278304100037,
-0.059500668197870255,
-0.13640739023685455,
1.7569867372512817,
-0.9890809059143066,
-2.0471696853637695,
0.25865548849105835,
0.2427690327167511,
-0.39798101782798767,
0.12420280277729034,
1.6489001512527466,
0.5068750381469727,
1.3894144296646118,
1.327484130859375,
1.0175814628601074,
-0.6459847092628479,
-1.2752317190170288,
0.7207511067390442,
0.9678804278373718,
-1.300871729850769,
0.8165826797485352,
-0.11118783056735992,
-0.5508304834365845,
0.6469881534576416,
1.3411006927490234,
0.45485082268714905,
-2.0625720024108887,
0.823930561542511,
-0.8976891040802002,
0.6816296577453613,
0.6471803784370422,
0.7939374446868896,
0.1646786481142044,
0.8232812285423279,
-1.2386083602905273,
-1.1066597700119019,
-0.6955675482749939,
-0.6255927085876465,
1.8918193578720093,
-0.2414528876543045,
0.5784627199172974,
-0.1486203968524933,
-1.2790189981460571,
-0.145253986120224,
0.7584624886512756,
0.3545883595943451,
-0.4690890610218048,
0.8293514251708984,
-0.6006035208702087,
-1.0724514722824097,
-1.3015717267990112,
-0.4464477002620697,
-1.0006465911865234,
-0.8824666738510132,
1.025266408920288,
0.70685213804245,
0.3753829896450043,
1.9114933013916016,
0.6000938415527344,
0.29863283038139343,
-2.7106900215148926,
0.8057000637054443,
0.2375808209180832,
-0.05415402725338936,
0.9706848859786987,
0.2624855637550354,
1.0838196277618408,
0.01351988036185503,
0.49397388100624084,
-2.428398609161377,
2.1844253540039062,
-0.17958612740039825,
0.6687203645706177,
-0.013192619197070599,
-0.22652117908000946,
1.1370424032211304,
0.5322349667549133,
0.5769769549369812,
-1.130793809890747,
0.7605836391448975,
-0.5691848993301392,
1.1377058029174805,
0.8039891123771667,
-0.867215096950531,
0.03022468090057373,
1.3170307874679565,
0.43901240825653076,
-0.4231123626232147,
-0.9110164046287537,
-0.9066488742828369,
0.9603777527809143,
1.7261966466903687,
-0.09707985073328018,
0.01699872314929962,
0.8202066421508789,
0.7248592376708984,
-1.2786717414855957,
-0.02794082835316658,
-0.7057914137840271,
-0.7477854490280151,
1.7095874547958374,
2.0935585498809814,
-0.06351744383573532,
-0.27786919474601746,
-0.7600245475769043,
-1.148963451385498,
0.7606449723243713,
-0.08941537886857986,
0.10329741984605789,
0.6662474274635315,
-0.6407580375671387,
1.1971540451049805,
0.7253331542015076,
0.9833413362503052,
0.1105804294347763,
0.3084678649902344,
0.3044417202472687,
-0.26742637157440186,
-1.1745692491531372,
-0.3157472312450409,
-1.055521845817566,
-2.5313963890075684,
0.4662782549858093,
-0.19151100516319275,
-1.45058012008667,
0.059001654386520386,
-1.0368480682373047,
0.8048184514045715,
-0.6094637513160706,
-1.1177098751068115,
-1.5219165086746216,
0.3157980144023895,
-0.15662401914596558,
0.920346200466156,
-1.6107361316680908,
-0.1411217451095581,
1.200111746788025,
0.9329019784927368,
-0.6209761500358582,
0.9791308045387268,
0.23964087665081024,
0.9473481178283691,
0.8147612810134888,
-0.33332934975624084,
0.4917972981929779,
0.2095366269350052,
-1.329925298690796,
0.42729970812797546,
1.2449049949645996,
0.19945387542247772,
1.439924955368042,
-0.5421908497810364,
0.09676084667444229,
0.45800334215164185,
-0.549057126045227,
-0.4840928614139557,
-0.5361000299453735,
0.78970867395401,
0.011676338501274586,
-0.9862543344497681,
0.03036605194211006,
-0.17264914512634277,
-0.2391441911458969,
0.22841103374958038,
-1.543778657913208,
-0.2517963647842407,
-0.3719506859779358,
-0.59010910987854,
-1.24989652633667,
0.047456301748752594,
1.3877105712890625,
-0.8705412745475769,
-0.1880919337272644,
0.4236986041069031,
0.3818496763706207,
0.49899986386299133,
0.6076264381408691,
-0.6488073468208313,
-0.3576003909111023,
-0.268405556678772,
-0.31560778617858887,
0.29020458459854126,
1.2710829973220825,
-0.07541612535715103,
-1.0201566219329834,
0.7526609301567078,
-0.39846861362457275,
0.055150002241134644,
1.9806333780288696,
0.09971404820680618,
-0.7420483231544495,
0.3380867540836334,
-0.6433494687080383,
1.89082670211792,
1.6995576620101929,
1.3766683340072632,
-0.13688240945339203,
-0.9615724682807922,
0.5847254395484924,
-0.23065632581710815,
-0.34625834226608276,
1.0050840377807617,
0.4827395975589752,
-0.16587024927139282,
-1.4012162685394287,
0.57035893201828,
1.298850417137146,
-0.9285339713096619,
-0.7487396597862244,
0.12431658804416656,
-0.902099072933197,
1.130395531654358,
0.6895737648010254,
0.36860132217407227,
0.20259366929531097,
1.5824801921844482,
0.7269153594970703,
-0.4535524845123291,
0.5803003311157227,
0.4690524637699127,
-0.11768174916505814,
-2.0830559730529785,
-0.9730139374732971,
0.34312790632247925,
-0.366370290517807,
-1.5562635660171509,
1.330164909362793,
-1.1540919542312622,
-0.9812217950820923,
0.5206158757209778,
0.10811688750982285,
1.4288722276687622,
0.36608561873435974,
1.6444567441940308,
2.150678873062134,
0.9133062362670898,
0.2801154851913452,
1.237135648727417,
-0.11873719841241837,
-0.4847700595855713,
1.8297356367111206,
-0.4800776243209839,
0.5195631384849548,
1.0618311166763306,
-0.3405071794986725,
-1.052426815032959,
-0.8439233303070068,
-1.1450340747833252,
-0.6678059697151184,
1.1552212238311768,
0.12710312008857727,
-1.2194374799728394,
0.2582300901412964,
1.5545369386672974,
0.1543097198009491,
-0.22860950231552124,
0.6601303219795227,
0.3644070029258728,
-0.7845331430435181,
-0.09692972153425217,
-0.8735353350639343,
0.43150636553764343,
-0.19066351652145386,
-0.30623289942741394,
0.2271261066198349,
0.5726096034049988,
1.2929388284683228,
-0.07162633538246155,
0.024216756224632263,
1.1975769996643066,
-1.454452395439148,
1.510317087173462,
-0.6592196226119995,
0.31169459223747253,
-2.388334274291992,
1.4107471704483032,
-0.8357357978820801,
1.8286961317062378,
-2.634979486465454,
0.3752976357936859,
-0.5417857766151428,
-0.48155999183654785,
0.2566426396369934,
-0.3703153729438782,
0.16529659926891327,
-0.188480943441391,
-1.013573408126831,
-0.1682310402393341,
-0.7394644618034363,
0.6530424356460571,
1.0746451616287231,
1.346523642539978,
-1.1406933069229126,
-0.34748944640159607,
-1.7432204484939575,
-0.2526768445968628,
-0.7143016457557678,
0.34992173314094543,
-1.9305070638656616,
-0.21130608022212982,
-2.0183868408203125,
-2.3586933612823486,
-1.358266830444336,
-0.8189138174057007,
1.0420145988464355,
0.16698923707008362,
-0.9193757176399231,
1.0346778631210327,
-0.3684466481208801,
-1.8442034721374512,
1.1765406131744385,
-2.161062717437744
] |
https://github.com/huggingface/datasets/issues/5123 | datasets freezes with streaming mode in multiple-gpu | Hi @lhoestq
I solved `fsspec` error with this hack for now https://discuss.huggingface.co/t/attributeerror-module-fsspec-has-no-attribute-asyn/19255 but this is still freezing, I greatly appreciate if you could run this script on your side. Many thanks.
```
import fsspec
def _set_fsspec_for_multiprocess() -> None:
"""
Clear reference to the loop and thread.
This is necessary otherwise HTTPFileSystem hangs in the ML training loop.
Only required for fsspec >= 0.9.0
See https://github.com/fsspec/gcsfs/issues/379
"""
fsspec.asyn.iothread[0] = None
fsspec.asyn.loop[0] = None
_set_fsspec_for_multiprocess()
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
``` | ## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
| 472 | 472 | datasets freezes with streaming mode in multiple-gpu
## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
Hi @lhoestq
I solved `fsspec` error with this hack for now https://discuss.huggingface.co/t/attributeerror-module-fsspec-has-no-attribute-asyn/19255 but this is still freezing, I greatly appreciate if you could run this script on your side. Many thanks.
```
import fsspec
def _set_fsspec_for_multiprocess() -> None:
"""
Clear reference to the loop and thread.
This is necessary otherwise HTTPFileSystem hangs in the ML training loop.
Only required for fsspec >= 0.9.0
See https://github.com/fsspec/gcsfs/issues/379
"""
fsspec.asyn.iothread[0] = None
fsspec.asyn.loop[0] = None
_set_fsspec_for_multiprocess()
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
``` | [
-1.2196941375732422,
-0.9265390634536743,
-0.7154155969619751,
1.4646788835525513,
-0.1441868543624878,
-1.2404600381851196,
0.09818949550390244,
-1.0889145135879517,
1.561210036277771,
-0.766279399394989,
0.27157339453697205,
-1.6538593769073486,
-0.031017590314149857,
-0.48414796590805054,
-0.753449022769928,
-0.8564292192459106,
-0.43187132477760315,
-0.9085370302200317,
1.0544241666793823,
2.541456460952759,
1.238066554069519,
-1.3789085149765015,
2.707625150680542,
0.6183651089668274,
-0.28375476598739624,
-1.0562281608581543,
0.4914971888065338,
0.05265944451093674,
-1.3426010608673096,
-0.4690755605697632,
-0.9343588948249817,
-0.021768631413578987,
-0.513971745967865,
-0.5481430292129517,
0.1315504014492035,
0.3927555978298187,
-0.19097450375556946,
-0.39653557538986206,
-0.4776310622692108,
-0.674271285533905,
0.45003896951675415,
-0.34303489327430725,
0.9542774558067322,
-0.29673346877098083,
1.7764742374420166,
-0.5822340250015259,
0.4204208552837372,
0.7471269965171814,
1.3177675008773804,
0.1977892965078354,
0.00911825243383646,
0.2995719015598297,
0.3690434694290161,
-0.027073003351688385,
0.5006393194198608,
1.2133288383483887,
0.6470579504966736,
0.4258016347885132,
0.6730741858482361,
-2.206968069076538,
1.32177734375,
-0.8521214723587036,
0.3151848018169403,
1.3639508485794067,
-0.948898196220398,
0.33002108335494995,
-1.8636839389801025,
-0.0408516488969326,
0.5247939229011536,
-2.209108591079712,
0.2663412094116211,
-1.3120408058166504,
-0.5187820196151733,
1.0780906677246094,
0.22621382772922516,
-1.2553026676177979,
0.22724923491477966,
-0.5109614729881287,
1.0825048685073853,
0.502551794052124,
1.2045079469680786,
-1.6525177955627441,
-0.053055305033922195,
-0.22096458077430725,
0.1501053422689438,
-1.269885778427124,
-1.5829702615737915,
0.5515368580818176,
0.622783362865448,
0.6200190186500549,
-0.1245521530508995,
0.9918457865715027,
-1.0412336587905884,
0.8439581394195557,
-0.9657367467880249,
-1.702380895614624,
-1.3975653648376465,
-2.2875359058380127,
-2.3538496494293213,
0.7833411693572998,
-0.49098339676856995,
-0.48595762252807617,
2.043440818786621,
-1.0940463542938232,
-1.8045988082885742,
1.0968130826950073,
0.31212225556373596,
0.03665555268526077,
2.3266162872314453,
0.27054035663604736,
-0.7715662121772766,
0.4353873133659363,
-0.7007548213005066,
0.7579501867294312,
-0.29536670446395874,
1.3403102159500122,
0.49578747153282166,
-0.9768232703208923,
1.5886470079421997,
-0.3369218707084656,
0.5592484474182129,
-0.678779661655426,
-0.5001794695854187,
-0.7466428279876709,
0.28943055868148804,
1.8903740644454956,
-0.3424609899520874,
1.557119607925415,
-0.35824042558670044,
-1.6710333824157715,
-1.553488850593567,
0.783078670501709,
0.5672897100448608,
-0.8038462996482849,
0.08542395383119583,
-0.45937302708625793,
0.04574445262551308,
-0.024679530411958694,
1.0531243085861206,
1.2256052494049072,
0.764526903629303,
-0.3791036903858185,
-0.8700701594352722,
0.22228902578353882,
-0.024389881640672684,
-0.6564667820930481,
-1.7730416059494019,
-0.3114410936832428,
0.19685357809066772,
0.7159045338630676,
-1.2066057920455933,
1.728532314300537,
0.9023963809013367,
1.9766522645950317,
0.9846182465553284,
-0.36182960867881775,
1.5362764596939087,
0.051193155348300934,
1.822758674621582,
-0.48359543085098267,
0.6152960658073425,
-0.3046688437461853,
-1.1953858137130737,
0.8193591833114624,
-0.3840271532535553,
-2.0460617542266846,
-0.7889803051948547,
-0.8046810030937195,
-0.1774633824825287,
-0.765680193901062,
0.9259167909622192,
-0.24395380914211273,
-1.5002785921096802,
0.18586590886116028,
-0.7031571269035339,
0.21713046729564667,
-1.2631146907806396,
0.2876998782157898,
0.7585954666137695,
-0.6546574831008911,
0.03635474294424057,
-0.2847440540790558,
-1.3299492597579956,
-0.482089638710022,
0.2555885314941406,
1.935956597328186,
-0.7466676831245422,
0.9977244734764099,
1.0288703441619873,
-0.6965973377227783,
0.11828635632991791,
0.2761755883693695,
-0.3382411301136017,
0.833848774433136,
-1.1520915031433105,
-0.315114289522171,
1.1405011415481567,
-0.14047589898109436,
-0.5562839508056641,
1.471627116203308,
0.8417165875434875,
-1.0451849699020386,
-0.3005620241165161,
-0.12290839850902557,
-0.7805737853050232,
-0.03752228990197182,
-1.568975567817688,
-0.12197384983301163,
0.3518800139427185,
-1.4865142107009888,
-0.3980593681335449,
-0.24516715109348297,
1.3649996519088745,
-0.20235849916934967,
1.4160126447677612,
-0.23609648644924164,
-0.16662970185279846,
-0.2959860861301422,
-0.41663509607315063,
0.19382227957248688,
-0.23418529331684113,
-0.6433618068695068,
0.318690687417984,
-0.7788034081459045,
0.3863050639629364,
1.5006078481674194,
0.3884235918521881,
-0.00019022077322006226,
0.47417497634887695,
1.1080034971237183,
0.37883907556533813,
-0.002778146415948868,
-0.8164379000663757,
-1.6140708923339844,
2.0191421508789062,
-1.4656296968460083,
1.939512848854065,
0.8449747562408447,
-0.046081412583589554,
-1.7433342933654785,
-1.848331093788147,
1.3511232137680054,
1.1672942638397217,
2.4696943759918213,
0.5762004852294922,
0.42126747965812683,
-0.7756940126419067,
-0.6782505512237549,
0.3392564654350281,
-0.9890856146812439,
-0.6823289394378662,
0.20723594725131989,
2.3987951278686523,
1.7446309328079224,
-0.4842599630355835,
-0.2373860478401184,
-0.8973423838615417,
1.2812271118164062,
-0.15210215747356415,
0.2147456407546997,
2.0669326782226562,
-0.2068791687488556,
-1.0644787549972534,
1.3586879968643188,
-2.3524374961853027,
0.2507283091545105,
2.0961709022521973,
0.23586231470108032,
0.029642552137374878,
-1.4289990663528442,
-0.6397950649261475,
-0.30462199449539185,
-0.4333078861236572,
-1.1869637966156006,
0.587566077709198,
-0.2887362241744995,
-0.8351829648017883,
-1.5269949436187744,
0.11956657469272614,
-1.155600905418396,
-1.7167274951934814,
0.32368239760398865,
1.849785327911377,
2.0171334743499756,
-0.7661897540092468,
1.425772786140442,
-0.30981558561325073,
0.1503465175628662,
1.2077202796936035,
1.297251582145691,
3.0895423889160156,
1.801468849182129,
-1.2655190229415894,
0.7652720212936401,
-0.19671571254730225,
-0.539990246295929,
1.0875061750411987,
-1.1737041473388672,
1.1934410333633423,
-0.18639099597930908,
-1.225818395614624,
-1.2079122066497803,
1.0307289361953735,
0.49156299233436584,
0.11513937264680862,
-0.48870187997817993,
1.25287926197052,
0.13206298649311066,
1.3606230020523071,
0.5472378134727478,
-0.33754125237464905,
0.5767080783843994,
-0.42384764552116394,
-0.5459473729133606,
1.548958659172058,
0.17662404477596283,
-1.4700467586517334,
-2.2897047996520996,
-0.2891959846019745,
-0.83060622215271,
-0.06987574696540833,
-0.6241534948348999,
-1.031946063041687,
1.6046165227890015,
0.4489043653011322,
-1.2942005395889282,
-0.2761368155479431,
-0.2938218116760254,
-0.5316752195358276,
2.5729079246520996,
-1.3579460382461548,
-0.15288743376731873,
-0.9766233563423157,
-0.5494853854179382,
1.6470723152160645,
-1.136026382446289,
-0.24366657435894012,
-1.0180833339691162,
-0.6197898387908936,
-1.290596842765808,
-0.6515306234359741,
0.014519116841256618,
-0.898371696472168,
0.7493624687194824,
0.10976632684469223,
-1.1049569845199585,
-0.2543349862098694,
-0.8716477751731873,
0.9739378690719604,
-0.10408321022987366,
0.21624097228050232,
1.8497835397720337,
0.42586252093315125,
-0.41084054112434387,
0.7086337804794312,
1.1682676076889038,
0.6527948975563049,
-0.7188342809677124,
0.08778499811887741,
-0.7523595690727234,
0.27312031388282776,
-1.3963708877563477,
0.27732372283935547,
-2.920530080795288,
0.6473391652107239,
-0.03915109112858772,
-0.10190664231777191,
-0.01194615289568901,
-1.354688048362732,
1.150322675704956,
2.604787588119507,
-1.1559698581695557,
0.45400241017341614,
0.4082641303539276,
1.1024219989776611,
-1.561321496963501,
0.2809440493583679,
-0.40414464473724365,
2.0925590991973877,
0.1753041297197342,
1.3182090520858765,
-0.4970410168170929,
-2.244457483291626,
0.6311855316162109,
-1.3103537559509277,
-1.1318570375442505,
0.8182228207588196,
-0.9041734337806702,
0.1373426616191864,
-1.402640461921692,
-0.22787636518478394,
-0.874118447303772,
-1.2131516933441162,
0.735505998134613,
0.09235156327486038,
0.4400927424430847,
-0.5481333136558533,
0.40668684244155884,
-2.171538829803467,
-1.3483706712722778,
-0.243732750415802,
-0.9873079657554626,
0.468234121799469,
-0.34478795528411865,
0.6460316181182861,
-0.12398447841405869,
0.10691895335912704,
0.3336278796195984,
1.3938778638839722,
3.356300115585327,
0.26448503136634827,
0.31335100531578064,
-0.07852749526500702,
-0.9935678243637085,
1.4641997814178467,
0.9334990382194519,
-0.09758613258600235,
-0.6031655669212341,
-0.9990250468254089,
1.1396456956863403,
2.052079200744629,
1.1207813024520874,
-0.006237646099179983,
-0.905368447303772,
-0.8131141066551208,
0.025303009897470474,
0.1922958791255951,
0.4902430772781372,
0.9256752133369446,
-0.00039423536509275436,
0.12187507748603821,
1.471239686012268,
1.1707947254180908,
-0.43878719210624695,
0.42896193265914917,
-0.9041079878807068,
-0.4822046160697937,
0.4004333019256592,
0.296958327293396,
0.05653358995914459,
0.4317501485347748,
-1.1210416555404663,
-0.1530856490135193,
-0.3772937059402466,
-0.9523237347602844,
-0.7993472814559937,
-0.46154555678367615,
-0.3354898989200592,
1.592426061630249,
0.03188944607973099,
-0.4231318235397339,
-0.023643802851438522,
-0.7166863083839417,
-0.1101628988981247,
-1.1042165756225586,
0.26067405939102173,
-0.09152278304100037,
-0.059500668197870255,
-0.13640739023685455,
1.7569867372512817,
-0.9890809059143066,
-2.0471696853637695,
0.25865548849105835,
0.2427690327167511,
-0.39798101782798767,
0.12420280277729034,
1.6489001512527466,
0.5068750381469727,
1.3894144296646118,
1.327484130859375,
1.0175814628601074,
-0.6459847092628479,
-1.2752317190170288,
0.7207511067390442,
0.9678804278373718,
-1.300871729850769,
0.8165826797485352,
-0.11118783056735992,
-0.5508304834365845,
0.6469881534576416,
1.3411006927490234,
0.45485082268714905,
-2.0625720024108887,
0.823930561542511,
-0.8976891040802002,
0.6816296577453613,
0.6471803784370422,
0.7939374446868896,
0.1646786481142044,
0.8232812285423279,
-1.2386083602905273,
-1.1066597700119019,
-0.6955675482749939,
-0.6255927085876465,
1.8918193578720093,
-0.2414528876543045,
0.5784627199172974,
-0.1486203968524933,
-1.2790189981460571,
-0.145253986120224,
0.7584624886512756,
0.3545883595943451,
-0.4690890610218048,
0.8293514251708984,
-0.6006035208702087,
-1.0724514722824097,
-1.3015717267990112,
-0.4464477002620697,
-1.0006465911865234,
-0.8824666738510132,
1.025266408920288,
0.70685213804245,
0.3753829896450043,
1.9114933013916016,
0.6000938415527344,
0.29863283038139343,
-2.7106900215148926,
0.8057000637054443,
0.2375808209180832,
-0.05415402725338936,
0.9706848859786987,
0.2624855637550354,
1.0838196277618408,
0.01351988036185503,
0.49397388100624084,
-2.428398609161377,
2.1844253540039062,
-0.17958612740039825,
0.6687203645706177,
-0.013192619197070599,
-0.22652117908000946,
1.1370424032211304,
0.5322349667549133,
0.5769769549369812,
-1.130793809890747,
0.7605836391448975,
-0.5691848993301392,
1.1377058029174805,
0.8039891123771667,
-0.867215096950531,
0.03022468090057373,
1.3170307874679565,
0.43901240825653076,
-0.4231123626232147,
-0.9110164046287537,
-0.9066488742828369,
0.9603777527809143,
1.7261966466903687,
-0.09707985073328018,
0.01699872314929962,
0.8202066421508789,
0.7248592376708984,
-1.2786717414855957,
-0.02794082835316658,
-0.7057914137840271,
-0.7477854490280151,
1.7095874547958374,
2.0935585498809814,
-0.06351744383573532,
-0.27786919474601746,
-0.7600245475769043,
-1.148963451385498,
0.7606449723243713,
-0.08941537886857986,
0.10329741984605789,
0.6662474274635315,
-0.6407580375671387,
1.1971540451049805,
0.7253331542015076,
0.9833413362503052,
0.1105804294347763,
0.3084678649902344,
0.3044417202472687,
-0.26742637157440186,
-1.1745692491531372,
-0.3157472312450409,
-1.055521845817566,
-2.5313963890075684,
0.4662782549858093,
-0.19151100516319275,
-1.45058012008667,
0.059001654386520386,
-1.0368480682373047,
0.8048184514045715,
-0.6094637513160706,
-1.1177098751068115,
-1.5219165086746216,
0.3157980144023895,
-0.15662401914596558,
0.920346200466156,
-1.6107361316680908,
-0.1411217451095581,
1.200111746788025,
0.9329019784927368,
-0.6209761500358582,
0.9791308045387268,
0.23964087665081024,
0.9473481178283691,
0.8147612810134888,
-0.33332934975624084,
0.4917972981929779,
0.2095366269350052,
-1.329925298690796,
0.42729970812797546,
1.2449049949645996,
0.19945387542247772,
1.439924955368042,
-0.5421908497810364,
0.09676084667444229,
0.45800334215164185,
-0.549057126045227,
-0.4840928614139557,
-0.5361000299453735,
0.78970867395401,
0.011676338501274586,
-0.9862543344497681,
0.03036605194211006,
-0.17264914512634277,
-0.2391441911458969,
0.22841103374958038,
-1.543778657913208,
-0.2517963647842407,
-0.3719506859779358,
-0.59010910987854,
-1.24989652633667,
0.047456301748752594,
1.3877105712890625,
-0.8705412745475769,
-0.1880919337272644,
0.4236986041069031,
0.3818496763706207,
0.49899986386299133,
0.6076264381408691,
-0.6488073468208313,
-0.3576003909111023,
-0.268405556678772,
-0.31560778617858887,
0.29020458459854126,
1.2710829973220825,
-0.07541612535715103,
-1.0201566219329834,
0.7526609301567078,
-0.39846861362457275,
0.055150002241134644,
1.9806333780288696,
0.09971404820680618,
-0.7420483231544495,
0.3380867540836334,
-0.6433494687080383,
1.89082670211792,
1.6995576620101929,
1.3766683340072632,
-0.13688240945339203,
-0.9615724682807922,
0.5847254395484924,
-0.23065632581710815,
-0.34625834226608276,
1.0050840377807617,
0.4827395975589752,
-0.16587024927139282,
-1.4012162685394287,
0.57035893201828,
1.298850417137146,
-0.9285339713096619,
-0.7487396597862244,
0.12431658804416656,
-0.902099072933197,
1.130395531654358,
0.6895737648010254,
0.36860132217407227,
0.20259366929531097,
1.5824801921844482,
0.7269153594970703,
-0.4535524845123291,
0.5803003311157227,
0.4690524637699127,
-0.11768174916505814,
-2.0830559730529785,
-0.9730139374732971,
0.34312790632247925,
-0.366370290517807,
-1.5562635660171509,
1.330164909362793,
-1.1540919542312622,
-0.9812217950820923,
0.5206158757209778,
0.10811688750982285,
1.4288722276687622,
0.36608561873435974,
1.6444567441940308,
2.150678873062134,
0.9133062362670898,
0.2801154851913452,
1.237135648727417,
-0.11873719841241837,
-0.4847700595855713,
1.8297356367111206,
-0.4800776243209839,
0.5195631384849548,
1.0618311166763306,
-0.3405071794986725,
-1.052426815032959,
-0.8439233303070068,
-1.1450340747833252,
-0.6678059697151184,
1.1552212238311768,
0.12710312008857727,
-1.2194374799728394,
0.2582300901412964,
1.5545369386672974,
0.1543097198009491,
-0.22860950231552124,
0.6601303219795227,
0.3644070029258728,
-0.7845331430435181,
-0.09692972153425217,
-0.8735353350639343,
0.43150636553764343,
-0.19066351652145386,
-0.30623289942741394,
0.2271261066198349,
0.5726096034049988,
1.2929388284683228,
-0.07162633538246155,
0.024216756224632263,
1.1975769996643066,
-1.454452395439148,
1.510317087173462,
-0.6592196226119995,
0.31169459223747253,
-2.388334274291992,
1.4107471704483032,
-0.8357357978820801,
1.8286961317062378,
-2.634979486465454,
0.3752976357936859,
-0.5417857766151428,
-0.48155999183654785,
0.2566426396369934,
-0.3703153729438782,
0.16529659926891327,
-0.188480943441391,
-1.013573408126831,
-0.1682310402393341,
-0.7394644618034363,
0.6530424356460571,
1.0746451616287231,
1.346523642539978,
-1.1406933069229126,
-0.34748944640159607,
-1.7432204484939575,
-0.2526768445968628,
-0.7143016457557678,
0.34992173314094543,
-1.9305070638656616,
-0.21130608022212982,
-2.0183868408203125,
-2.3586933612823486,
-1.358266830444336,
-0.8189138174057007,
1.0420145988464355,
0.16698923707008362,
-0.9193757176399231,
1.0346778631210327,
-0.3684466481208801,
-1.8442034721374512,
1.1765406131744385,
-2.161062717437744
] |
https://github.com/huggingface/datasets/issues/5123 | datasets freezes with streaming mode in multiple-gpu | Are you using `Pytorch 1.11`? Otherwise the script freezes because of the shuffling in this line:
```
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
```
`ShufflerIterDataPipe` behavior must have changed for newer Pytorch versions. But this doesn't change whether you're using streaming or not in `datasets`, so probably not the same issue, but something to try. | ## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
| 472 | 52 | datasets freezes with streaming mode in multiple-gpu
## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
Are you using `Pytorch 1.11`? Otherwise the script freezes because of the shuffling in this line:
```
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
```
`ShufflerIterDataPipe` behavior must have changed for newer Pytorch versions. But this doesn't change whether you're using streaming or not in `datasets`, so probably not the same issue, but something to try. | [
-1.2196941375732422,
-0.9265390634536743,
-0.7154155969619751,
1.4646788835525513,
-0.1441868543624878,
-1.2404600381851196,
0.09818949550390244,
-1.0889145135879517,
1.561210036277771,
-0.766279399394989,
0.27157339453697205,
-1.6538593769073486,
-0.031017590314149857,
-0.48414796590805054,
-0.753449022769928,
-0.8564292192459106,
-0.43187132477760315,
-0.9085370302200317,
1.0544241666793823,
2.541456460952759,
1.238066554069519,
-1.3789085149765015,
2.707625150680542,
0.6183651089668274,
-0.28375476598739624,
-1.0562281608581543,
0.4914971888065338,
0.05265944451093674,
-1.3426010608673096,
-0.4690755605697632,
-0.9343588948249817,
-0.021768631413578987,
-0.513971745967865,
-0.5481430292129517,
0.1315504014492035,
0.3927555978298187,
-0.19097450375556946,
-0.39653557538986206,
-0.4776310622692108,
-0.674271285533905,
0.45003896951675415,
-0.34303489327430725,
0.9542774558067322,
-0.29673346877098083,
1.7764742374420166,
-0.5822340250015259,
0.4204208552837372,
0.7471269965171814,
1.3177675008773804,
0.1977892965078354,
0.00911825243383646,
0.2995719015598297,
0.3690434694290161,
-0.027073003351688385,
0.5006393194198608,
1.2133288383483887,
0.6470579504966736,
0.4258016347885132,
0.6730741858482361,
-2.206968069076538,
1.32177734375,
-0.8521214723587036,
0.3151848018169403,
1.3639508485794067,
-0.948898196220398,
0.33002108335494995,
-1.8636839389801025,
-0.0408516488969326,
0.5247939229011536,
-2.209108591079712,
0.2663412094116211,
-1.3120408058166504,
-0.5187820196151733,
1.0780906677246094,
0.22621382772922516,
-1.2553026676177979,
0.22724923491477966,
-0.5109614729881287,
1.0825048685073853,
0.502551794052124,
1.2045079469680786,
-1.6525177955627441,
-0.053055305033922195,
-0.22096458077430725,
0.1501053422689438,
-1.269885778427124,
-1.5829702615737915,
0.5515368580818176,
0.622783362865448,
0.6200190186500549,
-0.1245521530508995,
0.9918457865715027,
-1.0412336587905884,
0.8439581394195557,
-0.9657367467880249,
-1.702380895614624,
-1.3975653648376465,
-2.2875359058380127,
-2.3538496494293213,
0.7833411693572998,
-0.49098339676856995,
-0.48595762252807617,
2.043440818786621,
-1.0940463542938232,
-1.8045988082885742,
1.0968130826950073,
0.31212225556373596,
0.03665555268526077,
2.3266162872314453,
0.27054035663604736,
-0.7715662121772766,
0.4353873133659363,
-0.7007548213005066,
0.7579501867294312,
-0.29536670446395874,
1.3403102159500122,
0.49578747153282166,
-0.9768232703208923,
1.5886470079421997,
-0.3369218707084656,
0.5592484474182129,
-0.678779661655426,
-0.5001794695854187,
-0.7466428279876709,
0.28943055868148804,
1.8903740644454956,
-0.3424609899520874,
1.557119607925415,
-0.35824042558670044,
-1.6710333824157715,
-1.553488850593567,
0.783078670501709,
0.5672897100448608,
-0.8038462996482849,
0.08542395383119583,
-0.45937302708625793,
0.04574445262551308,
-0.024679530411958694,
1.0531243085861206,
1.2256052494049072,
0.764526903629303,
-0.3791036903858185,
-0.8700701594352722,
0.22228902578353882,
-0.024389881640672684,
-0.6564667820930481,
-1.7730416059494019,
-0.3114410936832428,
0.19685357809066772,
0.7159045338630676,
-1.2066057920455933,
1.728532314300537,
0.9023963809013367,
1.9766522645950317,
0.9846182465553284,
-0.36182960867881775,
1.5362764596939087,
0.051193155348300934,
1.822758674621582,
-0.48359543085098267,
0.6152960658073425,
-0.3046688437461853,
-1.1953858137130737,
0.8193591833114624,
-0.3840271532535553,
-2.0460617542266846,
-0.7889803051948547,
-0.8046810030937195,
-0.1774633824825287,
-0.765680193901062,
0.9259167909622192,
-0.24395380914211273,
-1.5002785921096802,
0.18586590886116028,
-0.7031571269035339,
0.21713046729564667,
-1.2631146907806396,
0.2876998782157898,
0.7585954666137695,
-0.6546574831008911,
0.03635474294424057,
-0.2847440540790558,
-1.3299492597579956,
-0.482089638710022,
0.2555885314941406,
1.935956597328186,
-0.7466676831245422,
0.9977244734764099,
1.0288703441619873,
-0.6965973377227783,
0.11828635632991791,
0.2761755883693695,
-0.3382411301136017,
0.833848774433136,
-1.1520915031433105,
-0.315114289522171,
1.1405011415481567,
-0.14047589898109436,
-0.5562839508056641,
1.471627116203308,
0.8417165875434875,
-1.0451849699020386,
-0.3005620241165161,
-0.12290839850902557,
-0.7805737853050232,
-0.03752228990197182,
-1.568975567817688,
-0.12197384983301163,
0.3518800139427185,
-1.4865142107009888,
-0.3980593681335449,
-0.24516715109348297,
1.3649996519088745,
-0.20235849916934967,
1.4160126447677612,
-0.23609648644924164,
-0.16662970185279846,
-0.2959860861301422,
-0.41663509607315063,
0.19382227957248688,
-0.23418529331684113,
-0.6433618068695068,
0.318690687417984,
-0.7788034081459045,
0.3863050639629364,
1.5006078481674194,
0.3884235918521881,
-0.00019022077322006226,
0.47417497634887695,
1.1080034971237183,
0.37883907556533813,
-0.002778146415948868,
-0.8164379000663757,
-1.6140708923339844,
2.0191421508789062,
-1.4656296968460083,
1.939512848854065,
0.8449747562408447,
-0.046081412583589554,
-1.7433342933654785,
-1.848331093788147,
1.3511232137680054,
1.1672942638397217,
2.4696943759918213,
0.5762004852294922,
0.42126747965812683,
-0.7756940126419067,
-0.6782505512237549,
0.3392564654350281,
-0.9890856146812439,
-0.6823289394378662,
0.20723594725131989,
2.3987951278686523,
1.7446309328079224,
-0.4842599630355835,
-0.2373860478401184,
-0.8973423838615417,
1.2812271118164062,
-0.15210215747356415,
0.2147456407546997,
2.0669326782226562,
-0.2068791687488556,
-1.0644787549972534,
1.3586879968643188,
-2.3524374961853027,
0.2507283091545105,
2.0961709022521973,
0.23586231470108032,
0.029642552137374878,
-1.4289990663528442,
-0.6397950649261475,
-0.30462199449539185,
-0.4333078861236572,
-1.1869637966156006,
0.587566077709198,
-0.2887362241744995,
-0.8351829648017883,
-1.5269949436187744,
0.11956657469272614,
-1.155600905418396,
-1.7167274951934814,
0.32368239760398865,
1.849785327911377,
2.0171334743499756,
-0.7661897540092468,
1.425772786140442,
-0.30981558561325073,
0.1503465175628662,
1.2077202796936035,
1.297251582145691,
3.0895423889160156,
1.801468849182129,
-1.2655190229415894,
0.7652720212936401,
-0.19671571254730225,
-0.539990246295929,
1.0875061750411987,
-1.1737041473388672,
1.1934410333633423,
-0.18639099597930908,
-1.225818395614624,
-1.2079122066497803,
1.0307289361953735,
0.49156299233436584,
0.11513937264680862,
-0.48870187997817993,
1.25287926197052,
0.13206298649311066,
1.3606230020523071,
0.5472378134727478,
-0.33754125237464905,
0.5767080783843994,
-0.42384764552116394,
-0.5459473729133606,
1.548958659172058,
0.17662404477596283,
-1.4700467586517334,
-2.2897047996520996,
-0.2891959846019745,
-0.83060622215271,
-0.06987574696540833,
-0.6241534948348999,
-1.031946063041687,
1.6046165227890015,
0.4489043653011322,
-1.2942005395889282,
-0.2761368155479431,
-0.2938218116760254,
-0.5316752195358276,
2.5729079246520996,
-1.3579460382461548,
-0.15288743376731873,
-0.9766233563423157,
-0.5494853854179382,
1.6470723152160645,
-1.136026382446289,
-0.24366657435894012,
-1.0180833339691162,
-0.6197898387908936,
-1.290596842765808,
-0.6515306234359741,
0.014519116841256618,
-0.898371696472168,
0.7493624687194824,
0.10976632684469223,
-1.1049569845199585,
-0.2543349862098694,
-0.8716477751731873,
0.9739378690719604,
-0.10408321022987366,
0.21624097228050232,
1.8497835397720337,
0.42586252093315125,
-0.41084054112434387,
0.7086337804794312,
1.1682676076889038,
0.6527948975563049,
-0.7188342809677124,
0.08778499811887741,
-0.7523595690727234,
0.27312031388282776,
-1.3963708877563477,
0.27732372283935547,
-2.920530080795288,
0.6473391652107239,
-0.03915109112858772,
-0.10190664231777191,
-0.01194615289568901,
-1.354688048362732,
1.150322675704956,
2.604787588119507,
-1.1559698581695557,
0.45400241017341614,
0.4082641303539276,
1.1024219989776611,
-1.561321496963501,
0.2809440493583679,
-0.40414464473724365,
2.0925590991973877,
0.1753041297197342,
1.3182090520858765,
-0.4970410168170929,
-2.244457483291626,
0.6311855316162109,
-1.3103537559509277,
-1.1318570375442505,
0.8182228207588196,
-0.9041734337806702,
0.1373426616191864,
-1.402640461921692,
-0.22787636518478394,
-0.874118447303772,
-1.2131516933441162,
0.735505998134613,
0.09235156327486038,
0.4400927424430847,
-0.5481333136558533,
0.40668684244155884,
-2.171538829803467,
-1.3483706712722778,
-0.243732750415802,
-0.9873079657554626,
0.468234121799469,
-0.34478795528411865,
0.6460316181182861,
-0.12398447841405869,
0.10691895335912704,
0.3336278796195984,
1.3938778638839722,
3.356300115585327,
0.26448503136634827,
0.31335100531578064,
-0.07852749526500702,
-0.9935678243637085,
1.4641997814178467,
0.9334990382194519,
-0.09758613258600235,
-0.6031655669212341,
-0.9990250468254089,
1.1396456956863403,
2.052079200744629,
1.1207813024520874,
-0.006237646099179983,
-0.905368447303772,
-0.8131141066551208,
0.025303009897470474,
0.1922958791255951,
0.4902430772781372,
0.9256752133369446,
-0.00039423536509275436,
0.12187507748603821,
1.471239686012268,
1.1707947254180908,
-0.43878719210624695,
0.42896193265914917,
-0.9041079878807068,
-0.4822046160697937,
0.4004333019256592,
0.296958327293396,
0.05653358995914459,
0.4317501485347748,
-1.1210416555404663,
-0.1530856490135193,
-0.3772937059402466,
-0.9523237347602844,
-0.7993472814559937,
-0.46154555678367615,
-0.3354898989200592,
1.592426061630249,
0.03188944607973099,
-0.4231318235397339,
-0.023643802851438522,
-0.7166863083839417,
-0.1101628988981247,
-1.1042165756225586,
0.26067405939102173,
-0.09152278304100037,
-0.059500668197870255,
-0.13640739023685455,
1.7569867372512817,
-0.9890809059143066,
-2.0471696853637695,
0.25865548849105835,
0.2427690327167511,
-0.39798101782798767,
0.12420280277729034,
1.6489001512527466,
0.5068750381469727,
1.3894144296646118,
1.327484130859375,
1.0175814628601074,
-0.6459847092628479,
-1.2752317190170288,
0.7207511067390442,
0.9678804278373718,
-1.300871729850769,
0.8165826797485352,
-0.11118783056735992,
-0.5508304834365845,
0.6469881534576416,
1.3411006927490234,
0.45485082268714905,
-2.0625720024108887,
0.823930561542511,
-0.8976891040802002,
0.6816296577453613,
0.6471803784370422,
0.7939374446868896,
0.1646786481142044,
0.8232812285423279,
-1.2386083602905273,
-1.1066597700119019,
-0.6955675482749939,
-0.6255927085876465,
1.8918193578720093,
-0.2414528876543045,
0.5784627199172974,
-0.1486203968524933,
-1.2790189981460571,
-0.145253986120224,
0.7584624886512756,
0.3545883595943451,
-0.4690890610218048,
0.8293514251708984,
-0.6006035208702087,
-1.0724514722824097,
-1.3015717267990112,
-0.4464477002620697,
-1.0006465911865234,
-0.8824666738510132,
1.025266408920288,
0.70685213804245,
0.3753829896450043,
1.9114933013916016,
0.6000938415527344,
0.29863283038139343,
-2.7106900215148926,
0.8057000637054443,
0.2375808209180832,
-0.05415402725338936,
0.9706848859786987,
0.2624855637550354,
1.0838196277618408,
0.01351988036185503,
0.49397388100624084,
-2.428398609161377,
2.1844253540039062,
-0.17958612740039825,
0.6687203645706177,
-0.013192619197070599,
-0.22652117908000946,
1.1370424032211304,
0.5322349667549133,
0.5769769549369812,
-1.130793809890747,
0.7605836391448975,
-0.5691848993301392,
1.1377058029174805,
0.8039891123771667,
-0.867215096950531,
0.03022468090057373,
1.3170307874679565,
0.43901240825653076,
-0.4231123626232147,
-0.9110164046287537,
-0.9066488742828369,
0.9603777527809143,
1.7261966466903687,
-0.09707985073328018,
0.01699872314929962,
0.8202066421508789,
0.7248592376708984,
-1.2786717414855957,
-0.02794082835316658,
-0.7057914137840271,
-0.7477854490280151,
1.7095874547958374,
2.0935585498809814,
-0.06351744383573532,
-0.27786919474601746,
-0.7600245475769043,
-1.148963451385498,
0.7606449723243713,
-0.08941537886857986,
0.10329741984605789,
0.6662474274635315,
-0.6407580375671387,
1.1971540451049805,
0.7253331542015076,
0.9833413362503052,
0.1105804294347763,
0.3084678649902344,
0.3044417202472687,
-0.26742637157440186,
-1.1745692491531372,
-0.3157472312450409,
-1.055521845817566,
-2.5313963890075684,
0.4662782549858093,
-0.19151100516319275,
-1.45058012008667,
0.059001654386520386,
-1.0368480682373047,
0.8048184514045715,
-0.6094637513160706,
-1.1177098751068115,
-1.5219165086746216,
0.3157980144023895,
-0.15662401914596558,
0.920346200466156,
-1.6107361316680908,
-0.1411217451095581,
1.200111746788025,
0.9329019784927368,
-0.6209761500358582,
0.9791308045387268,
0.23964087665081024,
0.9473481178283691,
0.8147612810134888,
-0.33332934975624084,
0.4917972981929779,
0.2095366269350052,
-1.329925298690796,
0.42729970812797546,
1.2449049949645996,
0.19945387542247772,
1.439924955368042,
-0.5421908497810364,
0.09676084667444229,
0.45800334215164185,
-0.549057126045227,
-0.4840928614139557,
-0.5361000299453735,
0.78970867395401,
0.011676338501274586,
-0.9862543344497681,
0.03036605194211006,
-0.17264914512634277,
-0.2391441911458969,
0.22841103374958038,
-1.543778657913208,
-0.2517963647842407,
-0.3719506859779358,
-0.59010910987854,
-1.24989652633667,
0.047456301748752594,
1.3877105712890625,
-0.8705412745475769,
-0.1880919337272644,
0.4236986041069031,
0.3818496763706207,
0.49899986386299133,
0.6076264381408691,
-0.6488073468208313,
-0.3576003909111023,
-0.268405556678772,
-0.31560778617858887,
0.29020458459854126,
1.2710829973220825,
-0.07541612535715103,
-1.0201566219329834,
0.7526609301567078,
-0.39846861362457275,
0.055150002241134644,
1.9806333780288696,
0.09971404820680618,
-0.7420483231544495,
0.3380867540836334,
-0.6433494687080383,
1.89082670211792,
1.6995576620101929,
1.3766683340072632,
-0.13688240945339203,
-0.9615724682807922,
0.5847254395484924,
-0.23065632581710815,
-0.34625834226608276,
1.0050840377807617,
0.4827395975589752,
-0.16587024927139282,
-1.4012162685394287,
0.57035893201828,
1.298850417137146,
-0.9285339713096619,
-0.7487396597862244,
0.12431658804416656,
-0.902099072933197,
1.130395531654358,
0.6895737648010254,
0.36860132217407227,
0.20259366929531097,
1.5824801921844482,
0.7269153594970703,
-0.4535524845123291,
0.5803003311157227,
0.4690524637699127,
-0.11768174916505814,
-2.0830559730529785,
-0.9730139374732971,
0.34312790632247925,
-0.366370290517807,
-1.5562635660171509,
1.330164909362793,
-1.1540919542312622,
-0.9812217950820923,
0.5206158757209778,
0.10811688750982285,
1.4288722276687622,
0.36608561873435974,
1.6444567441940308,
2.150678873062134,
0.9133062362670898,
0.2801154851913452,
1.237135648727417,
-0.11873719841241837,
-0.4847700595855713,
1.8297356367111206,
-0.4800776243209839,
0.5195631384849548,
1.0618311166763306,
-0.3405071794986725,
-1.052426815032959,
-0.8439233303070068,
-1.1450340747833252,
-0.6678059697151184,
1.1552212238311768,
0.12710312008857727,
-1.2194374799728394,
0.2582300901412964,
1.5545369386672974,
0.1543097198009491,
-0.22860950231552124,
0.6601303219795227,
0.3644070029258728,
-0.7845331430435181,
-0.09692972153425217,
-0.8735353350639343,
0.43150636553764343,
-0.19066351652145386,
-0.30623289942741394,
0.2271261066198349,
0.5726096034049988,
1.2929388284683228,
-0.07162633538246155,
0.024216756224632263,
1.1975769996643066,
-1.454452395439148,
1.510317087173462,
-0.6592196226119995,
0.31169459223747253,
-2.388334274291992,
1.4107471704483032,
-0.8357357978820801,
1.8286961317062378,
-2.634979486465454,
0.3752976357936859,
-0.5417857766151428,
-0.48155999183654785,
0.2566426396369934,
-0.3703153729438782,
0.16529659926891327,
-0.188480943441391,
-1.013573408126831,
-0.1682310402393341,
-0.7394644618034363,
0.6530424356460571,
1.0746451616287231,
1.346523642539978,
-1.1406933069229126,
-0.34748944640159607,
-1.7432204484939575,
-0.2526768445968628,
-0.7143016457557678,
0.34992173314094543,
-1.9305070638656616,
-0.21130608022212982,
-2.0183868408203125,
-2.3586933612823486,
-1.358266830444336,
-0.8189138174057007,
1.0420145988464355,
0.16698923707008362,
-0.9193757176399231,
1.0346778631210327,
-0.3684466481208801,
-1.8442034721374512,
1.1765406131744385,
-2.161062717437744
] |
https://github.com/huggingface/datasets/issues/5123 | datasets freezes with streaming mode in multiple-gpu | > Are you using `Pytorch 1.11`? Otherwise the script freezes because of the shuffling in this line:
>
> ```
> return ShufflerIterDataPipe(self, buffer_size=buffer_size)
> ```
>
> `ShufflerIterDataPipe` behavior must have changed for newer Pytorch versions. But this doesn't change whether you're using streaming or not in `datasets`, so probably not the same issue, but something to try.
I met the same issue for pytorch 1.12 and 1.13, is there a way to work around for this function for newer pytorch versions? | ## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
| 472 | 83 | datasets freezes with streaming mode in multiple-gpu
## Describe the bug
Hi. I am using this dataloader, which is for processing large datasets in streaming mode mentioned in one of examples of huggingface. I am using it to read c4: https://github.com/huggingface/transformers/blob/b48ac1a094e572d6076b46a9e4ed3e0ebe978afc/examples/research_projects/codeparrot/scripts/codeparrot_training.py#L22
During using multi-gpu in accelerator in one node, the code freezes, but works for 1 GPU:
```
10/16/2022 14:18:46 - INFO - datasets.info - Loading Dataset Infos from /home/jack/.cache/huggingface/modules/datasets_modules/datasets/c4/df532b158939272d032cc63ef19cd5b83e9b4d00c922b833e4cb18b2e9869b01
Steps: 0%| | 0/400000 [00:00<?, ?it/s]10/16/2022 14:18:47 - INFO - torch.utils.data.dataloader - Shared seed (135290893754684706) sent to store on rank 0
```
# Code to reproduce
please run this code with `accelerate launch code.py`
```
from accelerate import Accelerator
from accelerate.logging import get_logger
from datasets import load_dataset
from torch.utils.data.dataloader import DataLoader
import torch
from datasets import load_dataset
from transformers import AutoTokenizer
import torch
from accelerate.logging import get_logger
from torch.utils.data import IterableDataset
from torch.utils.data.datapipes.iter.combinatorics import ShufflerIterDataPipe
logger = get_logger(__name__)
class ConstantLengthDataset(IterableDataset):
"""
Iterable dataset that returns constant length chunks of tokens from stream of text files.
Args:
tokenizer (Tokenizer): The processor used for proccessing the data.
dataset (dataset.Dataset): Dataset with text files.
infinite (bool): If True the iterator is reset after dataset reaches end else stops.
max_seq_length (int): Length of token sequences to return.
num_of_sequences (int): Number of token sequences to keep in buffer.
chars_per_token (int): Number of characters per token used to estimate number of tokens in text buffer.
"""
def __init__(
self,
tokenizer,
dataset,
infinite=False,
max_seq_length=1024,
num_of_sequences=1024,
chars_per_token=3.6,
):
self.tokenizer = tokenizer
# self.concat_token_id = tokenizer.bos_token_id
self.dataset = dataset
self.max_seq_length = max_seq_length
self.epoch = 0
self.infinite = infinite
self.current_size = 0
self.max_buffer_size = max_seq_length * chars_per_token * num_of_sequences
self.content_field = "text"
def __iter__(self):
iterator = iter(self.dataset)
more_examples = True
while more_examples:
buffer, buffer_len = [], 0
while True:
if buffer_len >= self.max_buffer_size:
break
try:
buffer.append(next(iterator)[self.content_field])
buffer_len += len(buffer[-1])
except StopIteration:
if self.infinite:
iterator = iter(self.dataset)
self.epoch += 1
logger.info(f"Dataset epoch: {self.epoch}")
else:
more_examples = False
break
tokenized_inputs = self.tokenizer(buffer, truncation=False)["input_ids"]
all_token_ids = []
for tokenized_input in tokenized_inputs:
all_token_ids.extend(tokenized_input)
for i in range(0, len(all_token_ids), self.max_seq_length):
input_ids = all_token_ids[i : i + self.max_seq_length]
if len(input_ids) == self.max_seq_length:
self.current_size += 1
yield torch.tensor(input_ids)
def shuffle(self, buffer_size=1000):
return ShufflerIterDataPipe(self, buffer_size=buffer_size)
def create_dataloaders(tokenizer, accelerator):
ds_kwargs = {"streaming": True}
# In distributed training, the load_dataset function gaurantees that only one process
# can concurrently download the dataset.
datasets = load_dataset(
"c4",
"en",
cache_dir="cache_dir",
**ds_kwargs,
)
train_data, valid_data = datasets["train"], datasets["validation"]
with accelerator.main_process_first():
train_data = train_data.shuffle(buffer_size=10000, seed=None)
train_dataset = ConstantLengthDataset(
tokenizer,
train_data,
infinite=True,
max_seq_length=256,
)
valid_dataset = ConstantLengthDataset(
tokenizer,
valid_data,
infinite=False,
max_seq_length=256,
)
train_dataset = train_dataset.shuffle(buffer_size=10000)
train_dataloader = DataLoader(train_dataset, batch_size=160, shuffle=True)
eval_dataloader = DataLoader(valid_dataset, batch_size=160)
return train_dataloader, eval_dataloader
def main():
# Accelerator.
logging_dir = "data_save_dir/log"
accelerator = Accelerator(
gradient_accumulation_steps=1,
mixed_precision="bf16",
log_with="tensorboard",
logging_dir=logging_dir,
)
# We need to initialize the trackers we use, and also store our configuration.
# The trackers initializes automatically on the main process.
if accelerator.is_main_process:
accelerator.init_trackers("test")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
# Load datasets and create dataloaders.
train_dataloader, _ = create_dataloaders(tokenizer, accelerator)
train_dataloader = accelerator.prepare(train_dataloader)
for step, batch in enumerate(train_dataloader, start=1):
print(step)
accelerator.end_training()
if __name__ == "__main__":
main()
```
## Results expected
Being able to run the code for streamining datasets with multi-gpu
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: linux
- Python version: 3.9.12
- PyArrow version: 9.0.0
@lhoestq I do not have any idea why this freezing happens, and I removed the streaming mode and this was working fine, so I know this is caused by streaming mode of the dataloader part not working well with multi-gpu setting. Since datasets are large, I hope to keep the streamining mode. I very much appreciate your help.
> Are you using `Pytorch 1.11`? Otherwise the script freezes because of the shuffling in this line:
>
> ```
> return ShufflerIterDataPipe(self, buffer_size=buffer_size)
> ```
>
> `ShufflerIterDataPipe` behavior must have changed for newer Pytorch versions. But this doesn't change whether you're using streaming or not in `datasets`, so probably not the same issue, but something to try.
I met the same issue for pytorch 1.12 and 1.13, is there a way to work around for this function for newer pytorch versions? | [
-1.2196941375732422,
-0.9265390634536743,
-0.7154155969619751,
1.4646788835525513,
-0.1441868543624878,
-1.2404600381851196,
0.09818949550390244,
-1.0889145135879517,
1.561210036277771,
-0.766279399394989,
0.27157339453697205,
-1.6538593769073486,
-0.031017590314149857,
-0.48414796590805054,
-0.753449022769928,
-0.8564292192459106,
-0.43187132477760315,
-0.9085370302200317,
1.0544241666793823,
2.541456460952759,
1.238066554069519,
-1.3789085149765015,
2.707625150680542,
0.6183651089668274,
-0.28375476598739624,
-1.0562281608581543,
0.4914971888065338,
0.05265944451093674,
-1.3426010608673096,
-0.4690755605697632,
-0.9343588948249817,
-0.021768631413578987,
-0.513971745967865,
-0.5481430292129517,
0.1315504014492035,
0.3927555978298187,
-0.19097450375556946,
-0.39653557538986206,
-0.4776310622692108,
-0.674271285533905,
0.45003896951675415,
-0.34303489327430725,
0.9542774558067322,
-0.29673346877098083,
1.7764742374420166,
-0.5822340250015259,
0.4204208552837372,
0.7471269965171814,
1.3177675008773804,
0.1977892965078354,
0.00911825243383646,
0.2995719015598297,
0.3690434694290161,
-0.027073003351688385,
0.5006393194198608,
1.2133288383483887,
0.6470579504966736,
0.4258016347885132,
0.6730741858482361,
-2.206968069076538,
1.32177734375,
-0.8521214723587036,
0.3151848018169403,
1.3639508485794067,
-0.948898196220398,
0.33002108335494995,
-1.8636839389801025,
-0.0408516488969326,
0.5247939229011536,
-2.209108591079712,
0.2663412094116211,
-1.3120408058166504,
-0.5187820196151733,
1.0780906677246094,
0.22621382772922516,
-1.2553026676177979,
0.22724923491477966,
-0.5109614729881287,
1.0825048685073853,
0.502551794052124,
1.2045079469680786,
-1.6525177955627441,
-0.053055305033922195,
-0.22096458077430725,
0.1501053422689438,
-1.269885778427124,
-1.5829702615737915,
0.5515368580818176,
0.622783362865448,
0.6200190186500549,
-0.1245521530508995,
0.9918457865715027,
-1.0412336587905884,
0.8439581394195557,
-0.9657367467880249,
-1.702380895614624,
-1.3975653648376465,
-2.2875359058380127,
-2.3538496494293213,
0.7833411693572998,
-0.49098339676856995,
-0.48595762252807617,
2.043440818786621,
-1.0940463542938232,
-1.8045988082885742,
1.0968130826950073,
0.31212225556373596,
0.03665555268526077,
2.3266162872314453,
0.27054035663604736,
-0.7715662121772766,
0.4353873133659363,
-0.7007548213005066,
0.7579501867294312,
-0.29536670446395874,
1.3403102159500122,
0.49578747153282166,
-0.9768232703208923,
1.5886470079421997,
-0.3369218707084656,
0.5592484474182129,
-0.678779661655426,
-0.5001794695854187,
-0.7466428279876709,
0.28943055868148804,
1.8903740644454956,
-0.3424609899520874,
1.557119607925415,
-0.35824042558670044,
-1.6710333824157715,
-1.553488850593567,
0.783078670501709,
0.5672897100448608,
-0.8038462996482849,
0.08542395383119583,
-0.45937302708625793,
0.04574445262551308,
-0.024679530411958694,
1.0531243085861206,
1.2256052494049072,
0.764526903629303,
-0.3791036903858185,
-0.8700701594352722,
0.22228902578353882,
-0.024389881640672684,
-0.6564667820930481,
-1.7730416059494019,
-0.3114410936832428,
0.19685357809066772,
0.7159045338630676,
-1.2066057920455933,
1.728532314300537,
0.9023963809013367,
1.9766522645950317,
0.9846182465553284,
-0.36182960867881775,
1.5362764596939087,
0.051193155348300934,
1.822758674621582,
-0.48359543085098267,
0.6152960658073425,
-0.3046688437461853,
-1.1953858137130737,
0.8193591833114624,
-0.3840271532535553,
-2.0460617542266846,
-0.7889803051948547,
-0.8046810030937195,
-0.1774633824825287,
-0.765680193901062,
0.9259167909622192,
-0.24395380914211273,
-1.5002785921096802,
0.18586590886116028,
-0.7031571269035339,
0.21713046729564667,
-1.2631146907806396,
0.2876998782157898,
0.7585954666137695,
-0.6546574831008911,
0.03635474294424057,
-0.2847440540790558,
-1.3299492597579956,
-0.482089638710022,
0.2555885314941406,
1.935956597328186,
-0.7466676831245422,
0.9977244734764099,
1.0288703441619873,
-0.6965973377227783,
0.11828635632991791,
0.2761755883693695,
-0.3382411301136017,
0.833848774433136,
-1.1520915031433105,
-0.315114289522171,
1.1405011415481567,
-0.14047589898109436,
-0.5562839508056641,
1.471627116203308,
0.8417165875434875,
-1.0451849699020386,
-0.3005620241165161,
-0.12290839850902557,
-0.7805737853050232,
-0.03752228990197182,
-1.568975567817688,
-0.12197384983301163,
0.3518800139427185,
-1.4865142107009888,
-0.3980593681335449,
-0.24516715109348297,
1.3649996519088745,
-0.20235849916934967,
1.4160126447677612,
-0.23609648644924164,
-0.16662970185279846,
-0.2959860861301422,
-0.41663509607315063,
0.19382227957248688,
-0.23418529331684113,
-0.6433618068695068,
0.318690687417984,
-0.7788034081459045,
0.3863050639629364,
1.5006078481674194,
0.3884235918521881,
-0.00019022077322006226,
0.47417497634887695,
1.1080034971237183,
0.37883907556533813,
-0.002778146415948868,
-0.8164379000663757,
-1.6140708923339844,
2.0191421508789062,
-1.4656296968460083,
1.939512848854065,
0.8449747562408447,
-0.046081412583589554,
-1.7433342933654785,
-1.848331093788147,
1.3511232137680054,
1.1672942638397217,
2.4696943759918213,
0.5762004852294922,
0.42126747965812683,
-0.7756940126419067,
-0.6782505512237549,
0.3392564654350281,
-0.9890856146812439,
-0.6823289394378662,
0.20723594725131989,
2.3987951278686523,
1.7446309328079224,
-0.4842599630355835,
-0.2373860478401184,
-0.8973423838615417,
1.2812271118164062,
-0.15210215747356415,
0.2147456407546997,
2.0669326782226562,
-0.2068791687488556,
-1.0644787549972534,
1.3586879968643188,
-2.3524374961853027,
0.2507283091545105,
2.0961709022521973,
0.23586231470108032,
0.029642552137374878,
-1.4289990663528442,
-0.6397950649261475,
-0.30462199449539185,
-0.4333078861236572,
-1.1869637966156006,
0.587566077709198,
-0.2887362241744995,
-0.8351829648017883,
-1.5269949436187744,
0.11956657469272614,
-1.155600905418396,
-1.7167274951934814,
0.32368239760398865,
1.849785327911377,
2.0171334743499756,
-0.7661897540092468,
1.425772786140442,
-0.30981558561325073,
0.1503465175628662,
1.2077202796936035,
1.297251582145691,
3.0895423889160156,
1.801468849182129,
-1.2655190229415894,
0.7652720212936401,
-0.19671571254730225,
-0.539990246295929,
1.0875061750411987,
-1.1737041473388672,
1.1934410333633423,
-0.18639099597930908,
-1.225818395614624,
-1.2079122066497803,
1.0307289361953735,
0.49156299233436584,
0.11513937264680862,
-0.48870187997817993,
1.25287926197052,
0.13206298649311066,
1.3606230020523071,
0.5472378134727478,
-0.33754125237464905,
0.5767080783843994,
-0.42384764552116394,
-0.5459473729133606,
1.548958659172058,
0.17662404477596283,
-1.4700467586517334,
-2.2897047996520996,
-0.2891959846019745,
-0.83060622215271,
-0.06987574696540833,
-0.6241534948348999,
-1.031946063041687,
1.6046165227890015,
0.4489043653011322,
-1.2942005395889282,
-0.2761368155479431,
-0.2938218116760254,
-0.5316752195358276,
2.5729079246520996,
-1.3579460382461548,
-0.15288743376731873,
-0.9766233563423157,
-0.5494853854179382,
1.6470723152160645,
-1.136026382446289,
-0.24366657435894012,
-1.0180833339691162,
-0.6197898387908936,
-1.290596842765808,
-0.6515306234359741,
0.014519116841256618,
-0.898371696472168,
0.7493624687194824,
0.10976632684469223,
-1.1049569845199585,
-0.2543349862098694,
-0.8716477751731873,
0.9739378690719604,
-0.10408321022987366,
0.21624097228050232,
1.8497835397720337,
0.42586252093315125,
-0.41084054112434387,
0.7086337804794312,
1.1682676076889038,
0.6527948975563049,
-0.7188342809677124,
0.08778499811887741,
-0.7523595690727234,
0.27312031388282776,
-1.3963708877563477,
0.27732372283935547,
-2.920530080795288,
0.6473391652107239,
-0.03915109112858772,
-0.10190664231777191,
-0.01194615289568901,
-1.354688048362732,
1.150322675704956,
2.604787588119507,
-1.1559698581695557,
0.45400241017341614,
0.4082641303539276,
1.1024219989776611,
-1.561321496963501,
0.2809440493583679,
-0.40414464473724365,
2.0925590991973877,
0.1753041297197342,
1.3182090520858765,
-0.4970410168170929,
-2.244457483291626,
0.6311855316162109,
-1.3103537559509277,
-1.1318570375442505,
0.8182228207588196,
-0.9041734337806702,
0.1373426616191864,
-1.402640461921692,
-0.22787636518478394,
-0.874118447303772,
-1.2131516933441162,
0.735505998134613,
0.09235156327486038,
0.4400927424430847,
-0.5481333136558533,
0.40668684244155884,
-2.171538829803467,
-1.3483706712722778,
-0.243732750415802,
-0.9873079657554626,
0.468234121799469,
-0.34478795528411865,
0.6460316181182861,
-0.12398447841405869,
0.10691895335912704,
0.3336278796195984,
1.3938778638839722,
3.356300115585327,
0.26448503136634827,
0.31335100531578064,
-0.07852749526500702,
-0.9935678243637085,
1.4641997814178467,
0.9334990382194519,
-0.09758613258600235,
-0.6031655669212341,
-0.9990250468254089,
1.1396456956863403,
2.052079200744629,
1.1207813024520874,
-0.006237646099179983,
-0.905368447303772,
-0.8131141066551208,
0.025303009897470474,
0.1922958791255951,
0.4902430772781372,
0.9256752133369446,
-0.00039423536509275436,
0.12187507748603821,
1.471239686012268,
1.1707947254180908,
-0.43878719210624695,
0.42896193265914917,
-0.9041079878807068,
-0.4822046160697937,
0.4004333019256592,
0.296958327293396,
0.05653358995914459,
0.4317501485347748,
-1.1210416555404663,
-0.1530856490135193,
-0.3772937059402466,
-0.9523237347602844,
-0.7993472814559937,
-0.46154555678367615,
-0.3354898989200592,
1.592426061630249,
0.03188944607973099,
-0.4231318235397339,
-0.023643802851438522,
-0.7166863083839417,
-0.1101628988981247,
-1.1042165756225586,
0.26067405939102173,
-0.09152278304100037,
-0.059500668197870255,
-0.13640739023685455,
1.7569867372512817,
-0.9890809059143066,
-2.0471696853637695,
0.25865548849105835,
0.2427690327167511,
-0.39798101782798767,
0.12420280277729034,
1.6489001512527466,
0.5068750381469727,
1.3894144296646118,
1.327484130859375,
1.0175814628601074,
-0.6459847092628479,
-1.2752317190170288,
0.7207511067390442,
0.9678804278373718,
-1.300871729850769,
0.8165826797485352,
-0.11118783056735992,
-0.5508304834365845,
0.6469881534576416,
1.3411006927490234,
0.45485082268714905,
-2.0625720024108887,
0.823930561542511,
-0.8976891040802002,
0.6816296577453613,
0.6471803784370422,
0.7939374446868896,
0.1646786481142044,
0.8232812285423279,
-1.2386083602905273,
-1.1066597700119019,
-0.6955675482749939,
-0.6255927085876465,
1.8918193578720093,
-0.2414528876543045,
0.5784627199172974,
-0.1486203968524933,
-1.2790189981460571,
-0.145253986120224,
0.7584624886512756,
0.3545883595943451,
-0.4690890610218048,
0.8293514251708984,
-0.6006035208702087,
-1.0724514722824097,
-1.3015717267990112,
-0.4464477002620697,
-1.0006465911865234,
-0.8824666738510132,
1.025266408920288,
0.70685213804245,
0.3753829896450043,
1.9114933013916016,
0.6000938415527344,
0.29863283038139343,
-2.7106900215148926,
0.8057000637054443,
0.2375808209180832,
-0.05415402725338936,
0.9706848859786987,
0.2624855637550354,
1.0838196277618408,
0.01351988036185503,
0.49397388100624084,
-2.428398609161377,
2.1844253540039062,
-0.17958612740039825,
0.6687203645706177,
-0.013192619197070599,
-0.22652117908000946,
1.1370424032211304,
0.5322349667549133,
0.5769769549369812,
-1.130793809890747,
0.7605836391448975,
-0.5691848993301392,
1.1377058029174805,
0.8039891123771667,
-0.867215096950531,
0.03022468090057373,
1.3170307874679565,
0.43901240825653076,
-0.4231123626232147,
-0.9110164046287537,
-0.9066488742828369,
0.9603777527809143,
1.7261966466903687,
-0.09707985073328018,
0.01699872314929962,
0.8202066421508789,
0.7248592376708984,
-1.2786717414855957,
-0.02794082835316658,
-0.7057914137840271,
-0.7477854490280151,
1.7095874547958374,
2.0935585498809814,
-0.06351744383573532,
-0.27786919474601746,
-0.7600245475769043,
-1.148963451385498,
0.7606449723243713,
-0.08941537886857986,
0.10329741984605789,
0.6662474274635315,
-0.6407580375671387,
1.1971540451049805,
0.7253331542015076,
0.9833413362503052,
0.1105804294347763,
0.3084678649902344,
0.3044417202472687,
-0.26742637157440186,
-1.1745692491531372,
-0.3157472312450409,
-1.055521845817566,
-2.5313963890075684,
0.4662782549858093,
-0.19151100516319275,
-1.45058012008667,
0.059001654386520386,
-1.0368480682373047,
0.8048184514045715,
-0.6094637513160706,
-1.1177098751068115,
-1.5219165086746216,
0.3157980144023895,
-0.15662401914596558,
0.920346200466156,
-1.6107361316680908,
-0.1411217451095581,
1.200111746788025,
0.9329019784927368,
-0.6209761500358582,
0.9791308045387268,
0.23964087665081024,
0.9473481178283691,
0.8147612810134888,
-0.33332934975624084,
0.4917972981929779,
0.2095366269350052,
-1.329925298690796,
0.42729970812797546,
1.2449049949645996,
0.19945387542247772,
1.439924955368042,
-0.5421908497810364,
0.09676084667444229,
0.45800334215164185,
-0.549057126045227,
-0.4840928614139557,
-0.5361000299453735,
0.78970867395401,
0.011676338501274586,
-0.9862543344497681,
0.03036605194211006,
-0.17264914512634277,
-0.2391441911458969,
0.22841103374958038,
-1.543778657913208,
-0.2517963647842407,
-0.3719506859779358,
-0.59010910987854,
-1.24989652633667,
0.047456301748752594,
1.3877105712890625,
-0.8705412745475769,
-0.1880919337272644,
0.4236986041069031,
0.3818496763706207,
0.49899986386299133,
0.6076264381408691,
-0.6488073468208313,
-0.3576003909111023,
-0.268405556678772,
-0.31560778617858887,
0.29020458459854126,
1.2710829973220825,
-0.07541612535715103,
-1.0201566219329834,
0.7526609301567078,
-0.39846861362457275,
0.055150002241134644,
1.9806333780288696,
0.09971404820680618,
-0.7420483231544495,
0.3380867540836334,
-0.6433494687080383,
1.89082670211792,
1.6995576620101929,
1.3766683340072632,
-0.13688240945339203,
-0.9615724682807922,
0.5847254395484924,
-0.23065632581710815,
-0.34625834226608276,
1.0050840377807617,
0.4827395975589752,
-0.16587024927139282,
-1.4012162685394287,
0.57035893201828,
1.298850417137146,
-0.9285339713096619,
-0.7487396597862244,
0.12431658804416656,
-0.902099072933197,
1.130395531654358,
0.6895737648010254,
0.36860132217407227,
0.20259366929531097,
1.5824801921844482,
0.7269153594970703,
-0.4535524845123291,
0.5803003311157227,
0.4690524637699127,
-0.11768174916505814,
-2.0830559730529785,
-0.9730139374732971,
0.34312790632247925,
-0.366370290517807,
-1.5562635660171509,
1.330164909362793,
-1.1540919542312622,
-0.9812217950820923,
0.5206158757209778,
0.10811688750982285,
1.4288722276687622,
0.36608561873435974,
1.6444567441940308,
2.150678873062134,
0.9133062362670898,
0.2801154851913452,
1.237135648727417,
-0.11873719841241837,
-0.4847700595855713,
1.8297356367111206,
-0.4800776243209839,
0.5195631384849548,
1.0618311166763306,
-0.3405071794986725,
-1.052426815032959,
-0.8439233303070068,
-1.1450340747833252,
-0.6678059697151184,
1.1552212238311768,
0.12710312008857727,
-1.2194374799728394,
0.2582300901412964,
1.5545369386672974,
0.1543097198009491,
-0.22860950231552124,
0.6601303219795227,
0.3644070029258728,
-0.7845331430435181,
-0.09692972153425217,
-0.8735353350639343,
0.43150636553764343,
-0.19066351652145386,
-0.30623289942741394,
0.2271261066198349,
0.5726096034049988,
1.2929388284683228,
-0.07162633538246155,
0.024216756224632263,
1.1975769996643066,
-1.454452395439148,
1.510317087173462,
-0.6592196226119995,
0.31169459223747253,
-2.388334274291992,
1.4107471704483032,
-0.8357357978820801,
1.8286961317062378,
-2.634979486465454,
0.3752976357936859,
-0.5417857766151428,
-0.48155999183654785,
0.2566426396369934,
-0.3703153729438782,
0.16529659926891327,
-0.188480943441391,
-1.013573408126831,
-0.1682310402393341,
-0.7394644618034363,
0.6530424356460571,
1.0746451616287231,
1.346523642539978,
-1.1406933069229126,
-0.34748944640159607,
-1.7432204484939575,
-0.2526768445968628,
-0.7143016457557678,
0.34992173314094543,
-1.9305070638656616,
-0.21130608022212982,
-2.0183868408203125,
-2.3586933612823486,
-1.358266830444336,
-0.8189138174057007,
1.0420145988464355,
0.16698923707008362,
-0.9193757176399231,
1.0346778631210327,
-0.3684466481208801,
-1.8442034721374512,
1.1765406131744385,
-2.161062717437744
] |
https://github.com/huggingface/datasets/issues/5117 | Progress bars have color red and never completed to 100% | Hi @echatzikyriakidis, thanks for submitting the issue.
Which shell are you using exactly? I tried to run the command you sent, but I don't see colors at all 🧐
I tried from bash and zsh as well. | ## Describe the bug
Progress bars after transformative operations turn in red and never be completed to 100%
## Steps to reproduce the bug
```python
from datasets import load_dataset
load_dataset('rotten_tomatoes', split='test').filter(lambda o: True)
```
## Expected results
Progress bar should be 100% and green
## Actual results
Progress bar turn in red and never completed to 100%
## Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.10.133+-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.7.14
- PyArrow version: 6.0.1
- Pandas version: 1.3.5 | 474 | 37 | Progress bars have color red and never completed to 100%
## Describe the bug
Progress bars after transformative operations turn in red and never be completed to 100%
## Steps to reproduce the bug
```python
from datasets import load_dataset
load_dataset('rotten_tomatoes', split='test').filter(lambda o: True)
```
## Expected results
Progress bar should be 100% and green
## Actual results
Progress bar turn in red and never completed to 100%
## Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.10.133+-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.7.14
- PyArrow version: 6.0.1
- Pandas version: 1.3.5
Hi @echatzikyriakidis, thanks for submitting the issue.
Which shell are you using exactly? I tried to run the command you sent, but I don't see colors at all 🧐
I tried from bash and zsh as well. | [
-1.2071129083633423,
-0.93877774477005,
-0.758715033531189,
1.4548556804656982,
-0.1795056015253067,
-1.1404662132263184,
0.07645215839147568,
-1.0797004699707031,
1.6213955879211426,
-0.7553938627243042,
0.24876627326011658,
-1.6022437810897827,
0.028729695826768875,
-0.48906099796295166,
-0.7346202731132507,
-0.9119278192520142,
-0.43013831973075867,
-0.6861488223075867,
1.0467230081558228,
2.524219274520874,
1.156152606010437,
-1.3966162204742432,
2.7149016857147217,
0.738283634185791,
-0.18080361187458038,
-0.9968553781509399,
0.5650722980499268,
0.11329767107963562,
-1.378259301185608,
-0.30553558468818665,
-0.9144995808601379,
0.009379283525049686,
-0.5351504683494568,
-0.5262022018432617,
0.04448560252785683,
0.33947792649269104,
-0.2660718858242035,
-0.5299962759017944,
-0.40901973843574524,
-0.8667894005775452,
0.49173641204833984,
-0.3617407977581024,
0.8721100687980652,
-0.4060879349708557,
1.7971996068954468,
-0.5406048893928528,
0.49571335315704346,
0.7708090543746948,
1.2905808687210083,
0.10814613103866577,
-0.006523393094539642,
0.3464464545249939,
0.36745133996009827,
0.006141619756817818,
0.3456989824771881,
1.080200433731079,
0.6006426811218262,
0.46308305859565735,
0.713312566280365,
-2.148015022277832,
1.3131556510925293,
-0.9786127805709839,
0.23878447711467743,
1.302488088607788,
-1.0321193933486938,
0.44037461280822754,
-1.7179204225540161,
-0.08070731908082962,
0.5458247661590576,
-2.2550652027130127,
0.30145570635795593,
-1.2951555252075195,
-0.5630050301551819,
1.0084161758422852,
0.4404119551181793,
-1.222743272781372,
-0.00414799340069294,
-0.5080856084823608,
1.0086555480957031,
0.4627062678337097,
1.093782663345337,
-1.6163431406021118,
0.05206821486353874,
-0.32770809531211853,
0.009432484395802021,
-1.3651421070098877,
-1.4225608110427856,
0.494456946849823,
0.7184953689575195,
0.5892720818519592,
-0.04802846536040306,
0.8753281235694885,
-1.0027557611465454,
0.7464456558227539,
-0.8665260076522827,
-1.686205506324768,
-1.3459815979003906,
-2.3052194118499756,
-2.236970901489258,
0.7859731912612915,
-0.4291186034679413,
-0.5454661846160889,
2.0938448905944824,
-1.0231324434280396,
-1.8630393743515015,
1.2775405645370483,
0.1274707168340683,
0.019514068961143494,
2.3603737354278564,
0.29124951362609863,
-0.7668356895446777,
0.5871607661247253,
-0.7908472418785095,
0.6921945214271545,
-0.5698496103286743,
1.3508999347686768,
0.39530226588249207,
-1.0291163921356201,
1.6114305257797241,
-0.4154911935329437,
0.6405652761459351,
-0.648468017578125,
-0.5479317307472229,
-0.8890681266784668,
0.3057027757167816,
1.929710030555725,
-0.2402305006980896,
1.4485572576522827,
-0.3193545937538147,
-1.5716203451156616,
-1.6166023015975952,
0.8320370316505432,
0.48637306690216064,
-0.6410549283027649,
0.20998285710811615,
-0.2296793907880783,
0.023417841643095016,
-0.029097966849803925,
1.078613519668579,
1.3508292436599731,
0.7194041013717651,
-0.27180108428001404,
-0.9706919193267822,
0.2518972158432007,
-0.10654351860284805,
-0.6385295391082764,
-1.8332594633102417,
-0.29178717732429504,
0.11387521773576736,
0.6664391756057739,
-1.2215205430984497,
1.6795092821121216,
0.8699130415916443,
1.961563229560852,
0.9906201362609863,
-0.25001534819602966,
1.4524211883544922,
0.12900424003601074,
1.8823953866958618,
-0.47595909237861633,
0.7550933957099915,
-0.426343709230423,
-1.0583029985427856,
0.773951530456543,
-0.3842536211013794,
-2.0224173069000244,
-0.700355052947998,
-0.9532188177108765,
-0.20567822456359863,
-0.7277293801307678,
1.024546504020691,
-0.27775222063064575,
-1.3366460800170898,
0.33198919892311096,
-0.7595493793487549,
0.16217941045761108,
-1.226623773574829,
0.30966097116470337,
0.7301443219184875,
-0.5552572011947632,
0.0479603186249733,
-0.28588590025901794,
-1.3065381050109863,
-0.4707494378089905,
0.4046952724456787,
1.8292189836502075,
-0.8575288653373718,
1.0548917055130005,
0.9566919207572937,
-0.7541655898094177,
-0.07611684501171112,
0.38157936930656433,
-0.2931326627731323,
0.8946616649627686,
-1.120570421218872,
-0.31536880135536194,
1.2129961252212524,
-0.27346399426460266,
-0.5030093789100647,
1.4872887134552002,
0.7012515664100647,
-0.9386544227600098,
-0.1496337503194809,
-0.18161047995090485,
-0.779143750667572,
-0.024997849017381668,
-1.6495417356491089,
-0.04851452261209488,
0.2781367897987366,
-1.5354108810424805,
-0.437063992023468,
-0.17649799585342407,
1.2586758136749268,
-0.13714070618152618,
1.3530462980270386,
-0.24757331609725952,
-0.21468383073806763,
-0.4172702133655548,
-0.4562518894672394,
0.13628260791301727,
-0.21624989807605743,
-0.5796517729759216,
0.23774920403957367,
-0.8376652598381042,
0.3461326062679291,
1.4319396018981934,
0.35913699865341187,
0.06811221688985825,
0.546454668045044,
1.0115512609481812,
0.3110661208629608,
-0.16194304823875427,
-0.8301193714141846,
-1.6453946828842163,
2.0252115726470947,
-1.454071044921875,
2.0397753715515137,
0.7143064737319946,
-0.11324251443147659,
-1.835202693939209,
-1.9071698188781738,
1.3523011207580566,
1.1469097137451172,
2.344045639038086,
0.6146795749664307,
0.39077648520469666,
-0.9091615676879883,
-0.7295081615447998,
0.31697186827659607,
-1.1090190410614014,
-0.752926230430603,
0.07007303833961487,
2.340968132019043,
1.6823914051055908,
-0.3948531448841095,
-0.10839560627937317,
-1.1508160829544067,
1.4667167663574219,
-0.10213831812143326,
0.18475580215454102,
1.9583547115325928,
-0.22573542594909668,
-1.0696526765823364,
1.1918262243270874,
-2.3125345706939697,
0.1734141856431961,
1.9527316093444824,
0.2481033205986023,
0.12120535969734192,
-1.3826371431350708,
-0.7114002704620361,
-0.2968021035194397,
-0.3222757875919342,
-1.177207112312317,
0.6459596157073975,
-0.30341580510139465,
-0.7660017609596252,
-1.4655396938323975,
0.1377543807029724,
-1.127411961555481,
-1.6797107458114624,
0.296593576669693,
1.8442569971084595,
2.125166893005371,
-0.7285430431365967,
1.5953789949417114,
-0.1724901646375656,
0.18073347210884094,
1.2588151693344116,
1.143988847732544,
3.098565101623535,
1.9523987770080566,
-1.2187702655792236,
0.6720711588859558,
-0.03739278018474579,
-0.39802947640419006,
1.1871471405029297,
-1.1418291330337524,
1.336893916130066,
-0.14164143800735474,
-1.166675090789795,
-1.2144855260849,
0.8739138245582581,
0.43626731634140015,
0.055226195603609085,
-0.4758374094963074,
1.2604093551635742,
0.04144403338432312,
1.3610224723815918,
0.5515963435173035,
-0.2627578675746918,
0.659440815448761,
-0.49134641885757446,
-0.5073084831237793,
1.5941153764724731,
0.22930532693862915,
-1.4965187311172485,
-2.249640464782715,
-0.2880619168281555,
-0.7715772390365601,
0.004700636491179466,
-0.6428154110908508,
-1.0316063165664673,
1.5294581651687622,
0.4639970660209656,
-1.2226709127426147,
-0.2608763873577118,
-0.27422913908958435,
-0.6311242580413818,
2.7110848426818848,
-1.5548884868621826,
-0.304521381855011,
-0.9365160465240479,
-0.5790542960166931,
1.5131454467773438,
-1.3140759468078613,
-0.2045983523130417,
-1.0098657608032227,
-0.5574459433555603,
-1.2562536001205444,
-0.5920703411102295,
-0.037843864411115646,
-0.9264407157897949,
0.8063540458679199,
0.24711671471595764,
-1.1912356615066528,
-0.24202226102352142,
-0.9492513537406921,
0.7632341980934143,
-0.09138693660497665,
0.31737545132637024,
1.7925209999084473,
0.35719412565231323,
-0.2496393620967865,
0.68201744556427,
1.2339732646942139,
0.5800550580024719,
-0.7067304849624634,
0.23195232450962067,
-0.7541239857673645,
0.28792351484298706,
-1.254281759262085,
0.30327630043029785,
-2.924861431121826,
0.6129575371742249,
-0.05003976821899414,
-0.11607090383768082,
-0.02753441035747528,
-1.2929019927978516,
1.1418014764785767,
2.5637998580932617,
-1.2161489725112915,
0.47105666995048523,
0.18376383185386658,
1.1932175159454346,
-1.5511877536773682,
0.33610472083091736,
-0.3925436735153198,
2.174217700958252,
0.1771612912416458,
1.2039538621902466,
-0.48408061265945435,
-2.2795183658599854,
0.6282444000244141,
-1.2007436752319336,
-1.1673741340637207,
0.619278073310852,
-0.7914015650749207,
0.08361316472291946,
-1.3815473318099976,
-0.1833202838897705,
-0.8240488767623901,
-1.236859679222107,
0.6808833479881287,
0.12828360497951508,
0.5335330963134766,
-0.5275128483772278,
0.3697381317615509,
-2.1997547149658203,
-1.3446564674377441,
-0.22977200150489807,
-0.7860245108604431,
0.4428374469280243,
-0.26935169100761414,
0.7493412494659424,
-0.2745476961135864,
-0.007185501046478748,
0.29857730865478516,
1.3420482873916626,
3.3833513259887695,
0.0724654570221901,
0.3852980434894562,
-0.12888674437999725,
-0.9493887424468994,
1.3952183723449707,
1.0472168922424316,
-0.18378877639770508,
-0.534876823425293,
-1.0620113611221313,
1.3174248933792114,
1.920661449432373,
0.9607534408569336,
0.11375449597835541,
-0.7769458889961243,
-0.6743716597557068,
-0.0022406629286706448,
0.08071586489677429,
0.4962904453277588,
0.9444010853767395,
0.11688338220119476,
0.08177302777767181,
1.5411664247512817,
1.3214939832687378,
-0.36561062932014465,
0.3094009459018707,
-0.8997771143913269,
-0.44074684381484985,
0.5664246082305908,
0.4462912380695343,
-0.024998895823955536,
0.23846447467803955,
-0.9947437047958374,
-0.17444854974746704,
-0.34683287143707275,
-0.9480760097503662,
-0.7014604210853577,
-0.46624955534935,
-0.3925449252128601,
1.6899322271347046,
0.11618456244468689,
-0.5034888982772827,
-0.07095840573310852,
-0.7818275094032288,
-0.0082748057320714,
-1.0491842031478882,
0.3422166109085083,
-0.2038295567035675,
0.000878618098795414,
-0.09412416070699692,
1.8701235055923462,
-0.9636479020118713,
-2.160263776779175,
0.35235586762428284,
0.22859060764312744,
-0.39801889657974243,
0.18047356605529785,
1.5837403535842896,
0.5760568380355835,
1.499459147453308,
1.3515212535858154,
0.9609710574150085,
-0.6818434000015259,
-1.2672195434570312,
0.6392615437507629,
0.9905248880386353,
-1.5720582008361816,
0.6778762340545654,
0.003191869705915451,
-0.5710532069206238,
0.6286229491233826,
1.2483787536621094,
0.45631176233291626,
-1.990350604057312,
0.7361149787902832,
-0.8862264752388,
0.8184831738471985,
0.8053940534591675,
0.7605592608451843,
0.21951286494731903,
0.8294934034347534,
-1.3123888969421387,
-1.064347743988037,
-0.8482943177223206,
-0.6623865365982056,
1.9460995197296143,
-0.28053179383277893,
0.5025689005851746,
-0.2502704858779907,
-1.3190929889678955,
-0.04565214365720749,
0.6028481125831604,
0.29106518626213074,
-0.39498981833457947,
0.7474809885025024,
-0.6822448372840881,
-1.1595795154571533,
-1.4437249898910522,
-0.4975348114967346,
-1.027937650680542,
-0.9238184094429016,
1.0478214025497437,
0.7566754221916199,
0.36634546518325806,
1.8419806957244873,
0.6208982467651367,
0.2715989351272583,
-2.657313585281372,
0.9051822423934937,
0.2213493138551712,
0.030524294823408127,
0.8641455769538879,
0.29135385155677795,
1.0519843101501465,
-0.1371229588985443,
0.5163829922676086,
-2.3872601985931396,
2.265775680541992,
-0.3068251609802246,
0.6576489210128784,
0.0021431120112538338,
-0.035965628921985626,
1.1092737913131714,
0.6173953413963318,
0.6001871824264526,
-1.1261177062988281,
0.7474578022956848,
-0.6470739841461182,
1.2813386917114258,
0.9012925624847412,
-0.8657397627830505,
-0.04644092917442322,
1.27945077419281,
0.4458859860897064,
-0.5305246710777283,
-0.8191074132919312,
-0.9097931385040283,
0.8883414268493652,
1.7742807865142822,
-0.08894357830286026,
-0.00337239820510149,
0.8058474063873291,
0.6135925054550171,
-1.3803361654281616,
0.026666637510061264,
-0.7667688131332397,
-0.6790833473205566,
1.6776630878448486,
2.0194473266601562,
-0.10948494076728821,
-0.1627175509929657,
-0.7295770645141602,
-1.350606918334961,
0.7918739914894104,
0.05302906036376953,
0.10266443341970444,
0.6321514844894409,
-0.5499099493026733,
1.062827706336975,
0.9002096652984619,
0.9213988184928894,
0.16858845949172974,
0.29018285870552063,
0.3418447971343994,
-0.2887459695339203,
-1.2252131700515747,
-0.24698343873023987,
-1.0250258445739746,
-2.4463021755218506,
0.5188354253768921,
-0.2595676779747009,
-1.4288365840911865,
0.056012917309999466,
-1.0448719263076782,
0.9526248574256897,
-0.4920966327190399,
-1.14643394947052,
-1.5541671514511108,
0.10171876102685928,
-0.18157602846622467,
0.9301300644874573,
-1.510707974433899,
-0.135456845164299,
1.2757376432418823,
0.9517521858215332,
-0.6868816018104553,
1.1494009494781494,
0.26034015417099,
1.081697702407837,
0.8388053178787231,
-0.451180100440979,
0.5172734260559082,
0.20339179039001465,
-1.3449302911758423,
0.48243647813796997,
1.2310903072357178,
0.19211281836032867,
1.4284549951553345,
-0.669085681438446,
-0.0475815124809742,
0.3755614459514618,
-0.46794596314430237,
-0.42104455828666687,
-0.571765661239624,
0.7169613242149353,
0.09129220247268677,
-0.9414970874786377,
0.012879935093224049,
-0.0354277677834034,
-0.18761803209781647,
0.2092869132757187,
-1.6072806119918823,
-0.17702797055244446,
-0.3358042240142822,
-0.5870490074157715,
-1.2156354188919067,
-0.031170014292001724,
1.4021506309509277,
-0.7179414629936218,
-0.13052012026309967,
0.4403834939002991,
0.4078321158885956,
0.5714371800422668,
0.7798276543617249,
-0.6632670760154724,
-0.37822142243385315,
-0.1863740235567093,
-0.3734813928604126,
0.30399107933044434,
1.3224523067474365,
-0.10861314833164215,
-1.0398950576782227,
0.6898051500320435,
-0.392622172832489,
0.10115207731723785,
1.886942982673645,
0.07053184509277344,
-0.8910636305809021,
0.27436113357543945,
-0.7625541687011719,
2.0499415397644043,
1.6264647245407104,
1.3434064388275146,
-0.0960872620344162,
-0.9604111909866333,
0.5768120884895325,
-0.21158446371555328,
-0.3394186198711395,
0.9322723746299744,
0.6410913467407227,
-0.31308111548423767,
-1.3178247213363647,
0.6526473760604858,
1.2334723472595215,
-0.9535887837409973,
-0.8719998598098755,
0.12778723239898682,
-0.7477867007255554,
1.0460551977157593,
0.782701313495636,
0.522161066532135,
0.26822537183761597,
1.6692248582839966,
0.7752556204795837,
-0.6224532127380371,
0.5840994119644165,
0.47801756858825684,
-0.15836749970912933,
-1.9971871376037598,
-1.124640941619873,
0.3343861401081085,
-0.5360045433044434,
-1.5552080869674683,
1.3829435110092163,
-1.0906224250793457,
-0.8135161995887756,
0.5678544640541077,
0.161241352558136,
1.4180701971054077,
0.24474993348121643,
1.528589129447937,
1.9889618158340454,
0.8905928730964661,
0.3249897360801697,
1.3738455772399902,
-0.17157310247421265,
-0.5123161673545837,
1.7909961938858032,
-0.4740760326385498,
0.5451645851135254,
1.1586003303527832,
-0.35513460636138916,
-1.077652931213379,
-0.7774763107299805,
-1.1391607522964478,
-0.659520149230957,
1.1130915880203247,
0.13786739110946655,
-1.1698042154312134,
0.15131476521492004,
1.5881984233856201,
0.1521996110677719,
-0.37323614954948425,
0.639272153377533,
0.3482154607772827,
-0.7801913022994995,
-0.07443604618310928,
-1.0391125679016113,
0.5238402485847473,
-0.18564502894878387,
-0.377157062292099,
0.2956821918487549,
0.3491625189781189,
1.2664554119110107,
0.03976956382393837,
0.10368723422288895,
1.224798560142517,
-1.4620846509933472,
1.445864200592041,
-0.7154608964920044,
0.2442357838153839,
-2.331557273864746,
1.3735204935073853,
-0.7670531272888184,
1.9003018140792847,
-2.74401593208313,
0.36259332299232483,
-0.6375699639320374,
-0.5031978487968445,
0.24313482642173767,
-0.33300483226776123,
0.1403992921113968,
-0.1987428218126297,
-1.1672837734222412,
-0.12387500703334808,
-0.7862033843994141,
0.5941460728645325,
1.1871769428253174,
1.286998987197876,
-1.0384379625320435,
-0.2319478541612625,
-1.745409607887268,
-0.1722935289144516,
-0.7450884580612183,
0.3843972682952881,
-2.0101606845855713,
-0.16192753612995148,
-1.7964234352111816,
-2.371741533279419,
-1.372645616531372,
-0.8512487411499023,
1.131300687789917,
0.0938650444149971,
-0.8917680382728577,
1.1597282886505127,
-0.3376518785953522,
-1.828726887702942,
1.1736066341400146,
-2.2500431537628174
] |
https://github.com/huggingface/datasets/issues/5117 | Progress bars have color red and never completed to 100% | Got it. I [created a PR](https://github.com/huggingface/datasets/pull/5120) that fixes this issue. Turns out that the wrapping logic for the inner loop was slightly incorrect. | ## Describe the bug
Progress bars after transformative operations turn in red and never be completed to 100%
## Steps to reproduce the bug
```python
from datasets import load_dataset
load_dataset('rotten_tomatoes', split='test').filter(lambda o: True)
```
## Expected results
Progress bar should be 100% and green
## Actual results
Progress bar turn in red and never completed to 100%
## Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.10.133+-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.7.14
- PyArrow version: 6.0.1
- Pandas version: 1.3.5 | 474 | 23 | Progress bars have color red and never completed to 100%
## Describe the bug
Progress bars after transformative operations turn in red and never be completed to 100%
## Steps to reproduce the bug
```python
from datasets import load_dataset
load_dataset('rotten_tomatoes', split='test').filter(lambda o: True)
```
## Expected results
Progress bar should be 100% and green
## Actual results
Progress bar turn in red and never completed to 100%
## Environment info
- `datasets` version: 2.6.1
- Platform: Linux-5.10.133+-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.7.14
- PyArrow version: 6.0.1
- Pandas version: 1.3.5
Got it. I [created a PR](https://github.com/huggingface/datasets/pull/5120) that fixes this issue. Turns out that the wrapping logic for the inner loop was slightly incorrect. | [
-1.2090085744857788,
-0.9399325847625732,
-0.771874725818634,
1.4745635986328125,
-0.12585453689098358,
-1.1853830814361572,
0.09942492842674255,
-1.0549882650375366,
1.625089406967163,
-0.7205018401145935,
0.2550731599330902,
-1.6748902797698975,
0.015511153265833855,
-0.4750787317752838,
-0.7115551233291626,
-0.9094026684761047,
-0.3935855031013489,
-0.7269690036773682,
1.0503485202789307,
2.4923267364501953,
1.1896214485168457,
-1.386779546737671,
2.7078638076782227,
0.708196222782135,
-0.1867947280406952,
-1.017763614654541,
0.5469072461128235,
0.1415000855922699,
-1.3859505653381348,
-0.307311475276947,
-0.9065681099891663,
-0.014723577536642551,
-0.5232142806053162,
-0.5237076282501221,
0.0679730474948883,
0.31506702303886414,
-0.2580125629901886,
-0.48277145624160767,
-0.4605211913585663,
-0.8725776672363281,
0.4266357719898224,
-0.32088860869407654,
0.8561568260192871,
-0.39903804659843445,
1.796249508857727,
-0.5620452761650085,
0.4568515419960022,
0.7190725207328796,
1.304916501045227,
0.09829996526241302,
0.0162067674100399,
0.34426775574684143,
0.36289265751838684,
0.04374093562364578,
0.3909503221511841,
1.0896178483963013,
0.6119176149368286,
0.44915077090263367,
0.6985732913017273,
-2.1608853340148926,
1.2996236085891724,
-0.9286659359931946,
0.26494070887565613,
1.351625919342041,
-1.0359938144683838,
0.3859846293926239,
-1.7001190185546875,
-0.06559792906045914,
0.5800121426582336,
-2.2787742614746094,
0.25980496406555176,
-1.296614170074463,
-0.5476837158203125,
1.0002535581588745,
0.4097202718257904,
-1.1946449279785156,
0.01354387030005455,
-0.5422324538230896,
1.0296941995620728,
0.4443805515766144,
1.1424579620361328,
-1.5873035192489624,
0.04082614183425903,
-0.2837182581424713,
-0.012341842986643314,
-1.3744747638702393,
-1.4548900127410889,
0.5187260508537292,
0.7338746190071106,
0.6164073348045349,
-0.06563813239336014,
0.8856116533279419,
-0.9423812627792358,
0.7552974820137024,
-0.8536838293075562,
-1.7646549940109253,
-1.3383923768997192,
-2.3320765495300293,
-2.2443413734436035,
0.8170103430747986,
-0.39349618554115295,
-0.5487815737724304,
2.0801920890808105,
-0.9974445104598999,
-1.9111515283584595,
1.20267653465271,
0.14971467852592468,
-0.01269376277923584,
2.377148389816284,
0.28788378834724426,
-0.7758828997612,
0.509788990020752,
-0.7685175538063049,
0.6761373281478882,
-0.5336670875549316,
1.3343641757965088,
0.45404544472694397,
-1.0195517539978027,
1.5948904752731323,
-0.4082481265068054,
0.6005012392997742,
-0.6735591888427734,
-0.5034652948379517,
-0.8380808234214783,
0.24616655707359314,
1.9279532432556152,
-0.2585313022136688,
1.4801377058029175,
-0.31888312101364136,
-1.5758882761001587,
-1.6054134368896484,
0.7721352577209473,
0.4895395040512085,
-0.6535138487815857,
0.16600099205970764,
-0.24344360828399658,
0.05418003350496292,
-0.023390578106045723,
1.1024214029312134,
1.3099877834320068,
0.7204821109771729,
-0.2724193036556244,
-0.9766677618026733,
0.20939600467681885,
-0.034647002816200256,
-0.6207206845283508,
-1.8463976383209229,
-0.2702462375164032,
0.17197008430957794,
0.660578191280365,
-1.2546151876449585,
1.7058924436569214,
0.850432813167572,
1.95851731300354,
0.9720637202262878,
-0.2740004360675812,
1.501448631286621,
0.06302009522914886,
1.8830060958862305,
-0.45991024374961853,
0.7062738537788391,
-0.36668017506599426,
-1.0812734365463257,
0.7699680924415588,
-0.3598136305809021,
-1.9776840209960938,
-0.7047252655029297,
-0.9667162895202637,
-0.18891684710979462,
-0.7319546341896057,
0.9856224656105042,
-0.2832871675491333,
-1.3169488906860352,
0.28469204902648926,
-0.727386474609375,
0.1467181295156479,
-1.217421293258667,
0.25488153100013733,
0.7306957244873047,
-0.563999354839325,
0.02901817299425602,
-0.3063220679759979,
-1.330324411392212,
-0.45678818225860596,
0.3783624768257141,
1.8273088932037354,
-0.8383651375770569,
1.0735020637512207,
0.965514063835144,
-0.7599297165870667,
-0.0002707419916987419,
0.3485533595085144,
-0.2475879192352295,
0.9288936853408813,
-1.0879427194595337,
-0.32439693808555603,
1.1930657625198364,
-0.25735920667648315,
-0.5626268982887268,
1.508139967918396,
0.7309515476226807,
-0.8961836099624634,
-0.12155723571777344,
-0.19136346876621246,
-0.7969442009925842,
-0.019885651767253876,
-1.6616827249526978,
-0.061459556221961975,
0.2954425513744354,
-1.4511016607284546,
-0.42965513467788696,
-0.16503995656967163,
1.2842838764190674,
-0.08086463063955307,
1.3407169580459595,
-0.2444400191307068,
-0.22783732414245605,
-0.44446977972984314,
-0.42442789673805237,
0.07467082887887955,
-0.23438481986522675,
-0.626140832901001,
0.26495933532714844,
-0.8361373543739319,
0.32304269075393677,
1.4181981086730957,
0.376390278339386,
0.126630038022995,
0.5908670425415039,
1.0398920774459839,
0.30441978573799133,
-0.15005846321582794,
-0.8341487646102905,
-1.6657518148422241,
2.0404648780822754,
-1.4231544733047485,
2.0017333030700684,
0.7118431329727173,
-0.12434700131416321,
-1.8356717824935913,
-1.9303028583526611,
1.347329020500183,
1.141331434249878,
2.408298969268799,
0.6109738349914551,
0.41828545928001404,
-0.8599401712417603,
-0.7309277653694153,
0.2694667875766754,
-1.0492236614227295,
-0.7879053354263306,
0.10605992376804352,
2.367220878601074,
1.7022130489349365,
-0.43976229429244995,
-0.11764634400606155,
-1.1446589231491089,
1.4317800998687744,
-0.10259151458740234,
0.19708822667598724,
1.9634090662002563,
-0.21999382972717285,
-1.0595170259475708,
1.1758173704147339,
-2.3377835750579834,
0.18982413411140442,
2.0022151470184326,
0.26786211133003235,
0.11419549584388733,
-1.4072004556655884,
-0.7118680477142334,
-0.3119872212409973,
-0.3070662021636963,
-1.1960041522979736,
0.6303462982177734,
-0.29495882987976074,
-0.7870363593101501,
-1.4302762746810913,
0.12303322553634644,
-1.1038703918457031,
-1.7346243858337402,
0.3058284521102905,
1.8703800439834595,
2.100587844848633,
-0.7349281311035156,
1.5414588451385498,
-0.20892494916915894,
0.1660245805978775,
1.3042606115341187,
1.1458797454833984,
3.1373326778411865,
1.974074125289917,
-1.2252296209335327,
0.728768527507782,
-0.06373783200979233,
-0.3717341423034668,
1.2001532316207886,
-1.1518656015396118,
1.2692362070083618,
-0.1837117075920105,
-1.213810682296753,
-1.2435334920883179,
0.9329701066017151,
0.44860392808914185,
0.018300049006938934,
-0.5135281682014465,
1.2937216758728027,
0.04185423254966736,
1.314281940460205,
0.5316923260688782,
-0.28421255946159363,
0.6408848166465759,
-0.4547376334667206,
-0.4812066853046417,
1.630218267440796,
0.22934339940547943,
-1.4859391450881958,
-2.2676753997802734,
-0.2855898439884186,
-0.81767737865448,
-0.042756348848342896,
-0.6333612203598022,
-1.0090970993041992,
1.5731924772262573,
0.4888525903224945,
-1.251679539680481,
-0.22824369370937347,
-0.2899913787841797,
-0.6851092576980591,
2.706956386566162,
-1.5424574613571167,
-0.28679895401000977,
-0.96703040599823,
-0.5257999300956726,
1.5436158180236816,
-1.2714582681655884,
-0.2146034836769104,
-0.9732185006141663,
-0.5633371472358704,
-1.274134635925293,
-0.524899423122406,
-0.03969815373420715,
-0.8947874307632446,
0.7823827266693115,
0.1581069976091385,
-1.1704035997390747,
-0.23987630009651184,
-0.93848717212677,
0.8182041645050049,
-0.11512985080480576,
0.2741899788379669,
1.8253958225250244,
0.4410729706287384,
-0.2978343367576599,
0.6897258162498474,
1.1952518224716187,
0.590177595615387,
-0.7435747385025024,
0.2443734109401703,
-0.7265223264694214,
0.3109440207481384,
-1.2907679080963135,
0.2973148822784424,
-2.92986798286438,
0.6379820108413696,
-0.09206370264291763,
-0.05413836985826492,
-0.027938522398471832,
-1.2418878078460693,
1.1286453008651733,
2.565882682800293,
-1.2110315561294556,
0.4660892188549042,
0.2074863463640213,
1.192442536354065,
-1.578942060470581,
0.3141694962978363,
-0.4399939477443695,
2.136610746383667,
0.14419063925743103,
1.1808269023895264,
-0.49727728962898254,
-2.2388134002685547,
0.6151402592658997,
-1.2180473804473877,
-1.0869719982147217,
0.6874793171882629,
-0.7841748595237732,
0.10567370802164078,
-1.3387736082077026,
-0.17399001121520996,
-0.7901387810707092,
-1.2450428009033203,
0.7006219625473022,
0.08735679090023041,
0.4987263083457947,
-0.5576617121696472,
0.36838391423225403,
-2.161228895187378,
-1.3271963596343994,
-0.2093764692544937,
-0.8477198481559753,
0.47506406903266907,
-0.3235430121421814,
0.7603853344917297,
-0.27898117899894714,
0.03001551143825054,
0.27933165431022644,
1.325263261795044,
3.3649888038635254,
0.08508811891078949,
0.3587966561317444,
-0.14483247697353363,
-0.9434894919395447,
1.3780457973480225,
1.007002353668213,
-0.17888516187667847,
-0.521049976348877,
-1.0545436143875122,
1.2871257066726685,
1.910601258277893,
0.976504921913147,
0.1524570882320404,
-0.8327381610870361,
-0.7286983728408813,
0.02601013146340847,
0.09577946364879608,
0.5279912948608398,
0.8902983665466309,
0.09124989807605743,
0.12189340591430664,
1.5100494623184204,
1.3103926181793213,
-0.3163517117500305,
0.3584878742694855,
-0.9489513635635376,
-0.43963623046875,
0.5782836079597473,
0.4087325632572174,
0.009033989161252975,
0.2722046971321106,
-1.0775933265686035,
-0.1964539885520935,
-0.32404273748397827,
-0.9584159851074219,
-0.7331885099411011,
-0.456472247838974,
-0.37144604325294495,
1.6809968948364258,
0.07563024759292603,
-0.5182358622550964,
-0.046401381492614746,
-0.7943689227104187,
-0.022851867601275444,
-1.0359455347061157,
0.36623939871788025,
-0.17553594708442688,
0.013810398057103157,
-0.08924596011638641,
1.8206660747528076,
-1.0266655683517456,
-2.1903419494628906,
0.3669680655002594,
0.21736480295658112,
-0.45094361901283264,
0.15937456488609314,
1.6427994966506958,
0.5957180857658386,
1.470258355140686,
1.3810784816741943,
0.9917393326759338,
-0.6530728340148926,
-1.290809154510498,
0.6507306098937988,
0.9650816321372986,
-1.5959923267364502,
0.7105468511581421,
-0.04221823066473007,
-0.5547963976860046,
0.6308043599128723,
1.2766458988189697,
0.4151410758495331,
-2.013160228729248,
0.7597830891609192,
-0.8608461618423462,
0.801644504070282,
0.808776319026947,
0.7993937134742737,
0.19746696949005127,
0.8690946102142334,
-1.3243459463119507,
-1.1074707508087158,
-0.8272293210029602,
-0.6418958902359009,
1.9023489952087402,
-0.19771529734134674,
0.4696815013885498,
-0.23588842153549194,
-1.3100391626358032,
-0.06721682846546173,
0.6163151860237122,
0.25238898396492004,
-0.4413876533508301,
0.8046165704727173,
-0.705352246761322,
-1.1141891479492188,
-1.403438925743103,
-0.515223503112793,
-1.0371136665344238,
-0.9281157851219177,
1.0322588682174683,
0.8060137033462524,
0.4020461142063141,
1.869791865348816,
0.594501256942749,
0.25262752175331116,
-2.675860643386841,
0.8643454909324646,
0.2218664139509201,
0.055501312017440796,
0.850911021232605,
0.26766279339790344,
1.0801584720611572,
-0.11497755348682404,
0.5224742293357849,
-2.351438045501709,
2.2608683109283447,
-0.32328569889068604,
0.6228416562080383,
0.0048375120386481285,
-0.03051188960671425,
1.086275339126587,
0.6074224710464478,
0.620727002620697,
-1.1092199087142944,
0.7774720788002014,
-0.6353273987770081,
1.2543259859085083,
0.8757635354995728,
-0.8764554262161255,
-0.05367588251829147,
1.275295376777649,
0.4670250117778778,
-0.4958118200302124,
-0.8354671597480774,
-0.9190521836280823,
0.8829734325408936,
1.7552073001861572,
-0.02761327661573887,
0.03887689858675003,
0.8208531737327576,
0.5951676964759827,
-1.4025956392288208,
0.01305309683084488,
-0.7270398736000061,
-0.6243056058883667,
1.7251520156860352,
2.0362625122070312,
-0.10944637656211853,
-0.17984016239643097,
-0.7272867560386658,
-1.318429708480835,
0.738056480884552,
0.06877778470516205,
0.02237391285598278,
0.7295547723770142,
-0.6029545664787292,
1.083134651184082,
0.8534958362579346,
0.903188169002533,
0.13994356989860535,
0.2748052179813385,
0.2935853898525238,
-0.29578423500061035,
-1.2736722230911255,
-0.24801978468894958,
-1.0287978649139404,
-2.414003849029541,
0.46412134170532227,
-0.24935497343540192,
-1.4114007949829102,
0.019664684310555458,
-1.0995426177978516,
0.9198455810546875,
-0.49016237258911133,
-1.1123852729797363,
-1.4640041589736938,
0.14038342237472534,
-0.19756855070590973,
0.9153974056243896,
-1.5517336130142212,
-0.07583688944578171,
1.290468692779541,
0.9747260808944702,
-0.6675574779510498,
1.1173052787780762,
0.2682543694972992,
1.0853227376937866,
0.8810567259788513,
-0.4035324156284332,
0.5022080540657043,
0.17258957028388977,
-1.3340214490890503,
0.4535175859928131,
1.175565481185913,
0.2276858240365982,
1.461032509803772,
-0.6652888655662537,
-0.0037410776130855083,
0.39275842905044556,
-0.46887630224227905,
-0.4100179076194763,
-0.6017938852310181,
0.7244306206703186,
0.08944699168205261,
-0.9652274250984192,
0.03574550896883011,
-0.023591935634613037,
-0.17570051550865173,
0.2574484050273895,
-1.5649136304855347,
-0.160668283700943,
-0.3170970678329468,
-0.5351746082305908,
-1.2558616399765015,
0.018332477658987045,
1.3584835529327393,
-0.7346776723861694,
-0.1723341941833496,
0.45016881823539734,
0.3509489893913269,
0.5553186535835266,
0.7811932563781738,
-0.6329013109207153,
-0.34572914242744446,
-0.21783144772052765,
-0.36595049500465393,
0.32234781980514526,
1.2766051292419434,
-0.15669195353984833,
-1.052929401397705,
0.7360644340515137,
-0.3819243311882019,
0.08220353722572327,
1.9159756898880005,
0.03098060004413128,
-0.8823347091674805,
0.26117393374443054,
-0.7832967638969421,
2.017925977706909,
1.6226072311401367,
1.3441084623336792,
-0.10307975113391876,
-0.9487121105194092,
0.5675402283668518,
-0.21245209872722626,
-0.3598845303058624,
0.8985042572021484,
0.6412478685379028,
-0.30271345376968384,
-1.3456881046295166,
0.594536542892456,
1.2442821264266968,
-0.9149394035339355,
-0.850047767162323,
0.13837242126464844,
-0.7717445492744446,
1.0517933368682861,
0.8035081028938293,
0.49712592363357544,
0.25578513741493225,
1.6250966787338257,
0.7180904150009155,
-0.5820956230163574,
0.5272130370140076,
0.4270685613155365,
-0.11408297717571259,
-2.0184695720672607,
-1.066932201385498,
0.3401890993118286,
-0.49516695737838745,
-1.5957539081573486,
1.3590936660766602,
-1.1451905965805054,
-0.8246553540229797,
0.5221987962722778,
0.1855282187461853,
1.4035890102386475,
0.23979656398296356,
1.597677230834961,
2.003380298614502,
0.9191774129867554,
0.29009518027305603,
1.3372218608856201,
-0.1333359330892563,
-0.4732244908809662,
1.786142349243164,
-0.44416919350624084,
0.5338601469993591,
1.0997449159622192,
-0.3858497440814972,
-1.098259687423706,
-0.8070663213729858,
-1.1519215106964111,
-0.6379477381706238,
1.0840964317321777,
0.17093916237354279,
-1.1767730712890625,
0.1733749508857727,
1.5332093238830566,
0.08723530173301697,
-0.299389123916626,
0.6402379274368286,
0.3478529751300812,
-0.7937554717063904,
-0.04404932260513306,
-0.9931629300117493,
0.5480216145515442,
-0.14640572667121887,
-0.3660489320755005,
0.2844648063182831,
0.37966620922088623,
1.2817208766937256,
0.04921913892030716,
0.11458207666873932,
1.3150253295898438,
-1.4286137819290161,
1.418630838394165,
-0.6904134750366211,
0.289896696805954,
-2.342237710952759,
1.4161224365234375,
-0.811802864074707,
1.9124059677124023,
-2.718353509902954,
0.394328236579895,
-0.6151184439659119,
-0.47341278195381165,
0.23357893526554108,
-0.36268872022628784,
0.14287813007831573,
-0.2108457088470459,
-1.1416881084442139,
-0.087129607796669,
-0.8485379815101624,
0.5455424785614014,
1.224341869354248,
1.3250936269760132,
-1.0497114658355713,
-0.2570711374282837,
-1.7991074323654175,
-0.18208268284797668,
-0.7571538686752319,
0.39785054326057434,
-1.9993162155151367,
-0.18420065939426422,
-1.836445689201355,
-2.395430326461792,
-1.393707036972046,
-0.8389666080474854,
1.068465232849121,
0.12185455858707428,
-0.9062800407409668,
1.1143242120742798,
-0.34681448340415955,
-1.8192765712738037,
1.1558979749679565,
-2.2497432231903076
] |
https://github.com/huggingface/datasets/issues/5114 | load_from_disk with remote filesystem fails due to a wrong temporary local folder path | Hi Hubert! Could you please probably create a publicly available `gs://` dataset link? I think this would be easier for others to directly start to debug. | ## Describe the bug
The function load_from_disk fails when using a remote filesystem because of a wrong temporary path generation in the load_from_disk method of arrow_dataset.py:
```python
if is_remote_filesystem(fs):
src_dataset_path = extract_path_from_uri(dataset_path)
dataset_path = Dataset._build_local_temp_path(src_dataset_path)
fs.download(src_dataset_path, dataset_path.as_posix(), recursive=True)
```
If _dataset_path_ is `gs://speech/mydataset/train`, then _src_dataset_path_ will be `speech/mydataset/train` and _dataset_path_ will be something like `/var/folders/9s/gf0b/T/tmp6t/speech/mydataset/train`
Then, after downloading the **folder** _src_dataset_path_, you will get a path like `/var/folders/9s/gf0b/T/tmp6t/speech/mydataset/train/train/state.json` (notice we have train twice)
Instead of downloading the remote folder we should be downloading all the files in the folder for the path to be right:
```python
fs.download(os.path.join(src_dataset_path,*), dataset_path.as_posix(), recursive=True)
```
## Steps to reproduce the bug
```python
fs = gcsfs.GCSFileSystem(**storage_options)
dataset = load_from_disk("common_voice_processed") # loading local dataset previously saved locally, works fine
dataset.save_to_disk(output_dir, fs=fs) #works fine
dataset = load_from_disk(output_dir, fs=fs) # crashes
```
## Expected results
The dataset is loaded
## Actual results
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/9s/gf0b9jz15d517yrf7m3nvlxr0000gn/T/tmp6t5e221_/speech/datasets/tests/common_voice_processed/train/state.json'
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets-2.6.1.dev0
- Platform: mac os monterey 12.5.1
- Python version: 3.8.13
- PyArrow version:pyarrow==9.0.0
| 475 | 26 | load_from_disk with remote filesystem fails due to a wrong temporary local folder path
## Describe the bug
The function load_from_disk fails when using a remote filesystem because of a wrong temporary path generation in the load_from_disk method of arrow_dataset.py:
```python
if is_remote_filesystem(fs):
src_dataset_path = extract_path_from_uri(dataset_path)
dataset_path = Dataset._build_local_temp_path(src_dataset_path)
fs.download(src_dataset_path, dataset_path.as_posix(), recursive=True)
```
If _dataset_path_ is `gs://speech/mydataset/train`, then _src_dataset_path_ will be `speech/mydataset/train` and _dataset_path_ will be something like `/var/folders/9s/gf0b/T/tmp6t/speech/mydataset/train`
Then, after downloading the **folder** _src_dataset_path_, you will get a path like `/var/folders/9s/gf0b/T/tmp6t/speech/mydataset/train/train/state.json` (notice we have train twice)
Instead of downloading the remote folder we should be downloading all the files in the folder for the path to be right:
```python
fs.download(os.path.join(src_dataset_path,*), dataset_path.as_posix(), recursive=True)
```
## Steps to reproduce the bug
```python
fs = gcsfs.GCSFileSystem(**storage_options)
dataset = load_from_disk("common_voice_processed") # loading local dataset previously saved locally, works fine
dataset.save_to_disk(output_dir, fs=fs) #works fine
dataset = load_from_disk(output_dir, fs=fs) # crashes
```
## Expected results
The dataset is loaded
## Actual results
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/9s/gf0b9jz15d517yrf7m3nvlxr0000gn/T/tmp6t5e221_/speech/datasets/tests/common_voice_processed/train/state.json'
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets-2.6.1.dev0
- Platform: mac os monterey 12.5.1
- Python version: 3.8.13
- PyArrow version:pyarrow==9.0.0
Hi Hubert! Could you please probably create a publicly available `gs://` dataset link? I think this would be easier for others to directly start to debug. | [
-1.1897833347320557,
-0.8982626795768738,
-0.6392756700515747,
1.4643101692199707,
-0.1270674765110016,
-1.3473259210586548,
0.1290508508682251,
-1.0700193643569946,
1.6215804815292358,
-0.8579851388931274,
0.2541983127593994,
-1.7131235599517822,
-0.02047405205667019,
-0.6565519571304321,
-0.6903502345085144,
-0.8473140001296997,
-0.3771462142467499,
-0.8324254751205444,
1.1023114919662476,
2.3178606033325195,
1.356597661972046,
-1.2975903749465942,
2.780097007751465,
0.750053882598877,
-0.29997676610946655,
-0.9365530610084534,
0.4000147879123688,
-0.08800234645605087,
-1.1991212368011475,
-0.5990021228790283,
-0.8376687169075012,
-0.1318720430135727,
-0.519965648651123,
-0.4745965003967285,
0.003144307993352413,
0.5200499892234802,
-0.3598400950431824,
-0.2926561236381531,
-0.6445115804672241,
-0.8543083071708679,
0.4239715039730072,
-0.28731831908226013,
0.9653244614601135,
-0.36279380321502686,
1.773107647895813,
-0.6477035284042358,
0.3859724998474121,
0.6814631223678589,
1.3259706497192383,
0.13155116140842438,
0.0075566815212368965,
0.28896307945251465,
0.2997139096260071,
0.07243261486291885,
0.5979100465774536,
1.235331654548645,
0.6640204787254333,
0.613919198513031,
0.6206380724906921,
-2.230271816253662,
1.3329565525054932,
-1.007527470588684,
0.2701049745082855,
1.3579316139221191,
-0.9666174054145813,
0.3429543972015381,
-1.6503409147262573,
-0.11379247903823853,
0.5692398548126221,
-2.304917573928833,
0.2813013195991516,
-1.2950512170791626,
-0.49276867508888245,
0.9833129048347473,
0.4005310833454132,
-1.1712384223937988,
0.14746756851673126,
-0.5169809460639954,
1.1524509191513062,
0.5070644617080688,
0.9752787351608276,
-1.6559910774230957,
-0.14962264895439148,
-0.22655552625656128,
0.009054544381797314,
-1.3675072193145752,
-1.6247392892837524,
0.5925824642181396,
0.6388513445854187,
0.6505225896835327,
-0.20169873535633087,
1.1802650690078735,
-1.0319072008132935,
0.7485378980636597,
-1.060868263244629,
-1.6073567867279053,
-1.5064451694488525,
-2.3477184772491455,
-2.2534749507904053,
0.7538635730743408,
-0.5246336460113525,
-0.5764288902282715,
2.0071074962615967,
-1.0025222301483154,
-1.7391108274459839,
1.0408823490142822,
0.21679383516311646,
0.019942395389080048,
2.323450803756714,
0.20614860951900482,
-0.6891646385192871,
0.30304232239723206,
-0.6819291710853577,
0.8656368255615234,
-0.30075740814208984,
1.3902478218078613,
0.540350615978241,
-1.1330668926239014,
1.5843502283096313,
-0.4160960614681244,
0.6191957592964172,
-0.6427805423736572,
-0.5225278735160828,
-0.8354018330574036,
0.26577410101890564,
1.7984192371368408,
-0.376961886882782,
1.5814110040664673,
-0.3983950614929199,
-1.5008611679077148,
-1.5851805210113525,
0.9189983606338501,
0.34795525670051575,
-0.8704366683959961,
0.165318563580513,
-0.575419008731842,
0.15014410018920898,
-0.1098768413066864,
1.2760579586029053,
1.2246485948562622,
0.6080112457275391,
-0.46612805128097534,
-0.7222568392753601,
0.23424051702022552,
-0.046607498079538345,
-0.6260823011398315,
-1.8270543813705444,
-0.35850921273231506,
0.1950160264968872,
0.5714674592018127,
-1.0286999940872192,
1.7886735200881958,
0.8790138363838196,
1.912581205368042,
1.0497722625732422,
-0.3583020865917206,
1.4170795679092407,
0.005040343850851059,
1.8737144470214844,
-0.6076639890670776,
0.5679574012756348,
-0.27648767828941345,
-1.1694363355636597,
0.9708088636398315,
-0.31688371300697327,
-2.091653347015381,
-0.7814050912857056,
-0.6738839149475098,
-0.17297518253326416,
-0.7969124913215637,
0.8888936638832092,
-0.3022212088108063,
-1.4949214458465576,
0.16423450410366058,
-0.6971274614334106,
0.3024443984031677,
-1.1791383028030396,
0.25723502039909363,
0.7668468952178955,
-0.6759592294692993,
-0.03202585503458977,
-0.1897919774055481,
-1.248420000076294,
-0.5053162574768066,
0.4273609220981598,
1.903861165046692,
-0.6189954876899719,
0.839227557182312,
1.0764163732528687,
-0.6211826801300049,
0.11062208563089371,
0.19252313673496246,
-0.22021619975566864,
0.8245269060134888,
-1.060506820678711,
-0.43831583857536316,
1.238480567932129,
-0.41288164258003235,
-0.6981615424156189,
1.448643445968628,
0.8241131901741028,
-1.1114625930786133,
-0.16059650480747223,
-0.21565091609954834,
-0.929107129573822,
0.01766875386238098,
-1.482144832611084,
-0.19084453582763672,
0.5978680849075317,
-1.5431088209152222,
-0.37976470589637756,
-0.14611104130744934,
1.4177201986312866,
-0.24206411838531494,
1.397657871246338,
-0.40252718329429626,
-0.2089458853006363,
-0.290486216545105,
-0.43144312500953674,
0.21386170387268066,
-0.11800011247396469,
-0.48061707615852356,
0.08549097925424576,
-0.75390625,
0.32692304253578186,
1.4516133069992065,
0.32327282428741455,
0.00213569775223732,
0.47317633032798767,
1.225892424583435,
0.34364721179008484,
-0.215650275349617,
-0.8344382047653198,
-1.5539195537567139,
1.9768110513687134,
-1.3933780193328857,
1.9352935552597046,
0.6451016068458557,
-0.017093965783715248,
-1.7570887804031372,
-1.770415186882019,
1.1707441806793213,
1.1555336713790894,
2.2001423835754395,
0.512066662311554,
0.37798601388931274,
-0.8163599371910095,
-0.7893155217170715,
0.4205276072025299,
-1.0557798147201538,
-0.5530365705490112,
0.12384127825498581,
2.3667144775390625,
1.8818947076797485,
-0.49195167422294617,
-0.2637217342853546,
-0.8960237503051758,
1.3439010381698608,
-0.34157001972198486,
0.2719487249851227,
1.9982531070709229,
-0.31621262431144714,
-0.991888701915741,
1.3678672313690186,
-2.4665892124176025,
0.2997765839099884,
2.0811526775360107,
0.31616994738578796,
0.12609407305717468,
-1.3380104303359985,
-0.5828456282615662,
-0.38682129979133606,
-0.3477090001106262,
-1.3171638250350952,
0.5094581842422485,
-0.3349350690841675,
-0.7457241415977478,
-1.3754328489303589,
0.2097519040107727,
-1.061712384223938,
-1.715989589691162,
0.29865917563438416,
1.954490065574646,
2.0121800899505615,
-0.6397926211357117,
1.5206836462020874,
-0.3868083357810974,
0.12184108048677444,
1.335084080696106,
1.3726810216903687,
3.1454176902770996,
1.8690252304077148,
-1.3159152269363403,
0.6930086612701416,
-0.16413819789886475,
-0.543566107749939,
1.1878870725631714,
-1.1946707963943481,
1.2620692253112793,
-0.17175301909446716,
-1.2957223653793335,
-1.3579175472259521,
1.0767723321914673,
0.5530703067779541,
0.040355704724788666,
-0.5135061144828796,
1.220263957977295,
0.11504355818033218,
1.3269646167755127,
0.6320947408676147,
-0.5481309294700623,
0.5058755874633789,
-0.33797135949134827,
-0.5127286911010742,
1.5333904027938843,
0.2515701651573181,
-1.4527472257614136,
-2.162259578704834,
-0.2848798334598541,
-0.8425987958908081,
0.034522105008363724,
-0.6160294413566589,
-0.9799809455871582,
1.6181144714355469,
0.3954928517341614,
-1.2702635526657104,
-0.27489665150642395,
-0.3015671968460083,
-0.40964895486831665,
2.7310752868652344,
-1.2258086204528809,
-0.14006850123405457,
-0.9767425060272217,
-0.6539817452430725,
1.7552160024642944,
-1.2428380250930786,
-0.35023412108421326,
-0.9925503730773926,
-0.6125431060791016,
-1.2133301496505737,
-0.46848738193511963,
0.013403424061834812,
-0.9259620904922485,
0.770439863204956,
0.07842070609331131,
-1.2152094841003418,
-0.35344699025154114,
-0.869699239730835,
1.051635503768921,
-0.2445542812347412,
0.19633132219314575,
1.8297020196914673,
0.32216426730155945,
-0.5429869890213013,
0.8407003879547119,
1.1575628519058228,
0.6537886261940002,
-0.6087773442268372,
0.11949493736028671,
-0.6419937610626221,
0.30657699704170227,
-1.3775718212127686,
0.2708180546760559,
-3.0070040225982666,
0.6729143261909485,
-0.11735571175813675,
-0.09075406938791275,
-0.16344709694385529,
-1.4348920583724976,
1.0261633396148682,
2.576939344406128,
-1.3012803792953491,
0.4513191878795624,
0.40285131335258484,
1.1219817399978638,
-1.6537631750106812,
0.30221784114837646,
-0.4482231140136719,
2.0618112087249756,
0.24475204944610596,
1.3809597492218018,
-0.39788469672203064,
-2.277507781982422,
0.57999587059021,
-1.1551634073257446,
-1.0802654027938843,
0.8878634572029114,
-0.9135227203369141,
0.21194523572921753,
-1.4589561223983765,
-0.23377157747745514,
-0.8519212007522583,
-1.2964657545089722,
0.7053405046463013,
0.1535346955060959,
0.386650949716568,
-0.6153812408447266,
0.2840867340564728,
-2.106208086013794,
-1.2146795988082886,
-0.17684952914714813,
-0.935285210609436,
0.5357351303100586,
-0.46470731496810913,
0.5568198561668396,
-0.0264446958899498,
0.007682164199650288,
0.3744245171546936,
1.6488323211669922,
3.3791379928588867,
0.22589901089668274,
0.16411711275577545,
-0.14638377726078033,
-0.8802242279052734,
1.3647218942642212,
0.832182765007019,
-0.09043166041374207,
-0.49370431900024414,
-0.9258748888969421,
1.3082239627838135,
1.935939073562622,
1.0152045488357544,
0.008340270258486271,
-0.8776469826698303,
-0.7871416211128235,
-0.09500580281019211,
0.19619007408618927,
0.4977736473083496,
0.9065502285957336,
0.059714507311582565,
0.017696399241685867,
1.375231385231018,
1.0844401121139526,
-0.421347051858902,
0.30158865451812744,
-0.9697427749633789,
-0.403897225856781,
0.364419549703598,
0.2103218138217926,
-0.05067545175552368,
0.41697144508361816,
-0.9884480237960815,
-0.19937770068645477,
-0.42907261848449707,
-0.7684725522994995,
-0.7840819954872131,
-0.41618436574935913,
-0.49443864822387695,
1.5620784759521484,
0.0847940593957901,
-0.6082960963249207,
-0.06046026945114136,
-0.6930135488510132,
-0.281556636095047,
-1.1160989999771118,
0.2622694671154022,
-0.04352748021483421,
-0.15156878530979156,
-0.1301094889640808,
1.5453617572784424,
-1.0031520128250122,
-2.0307414531707764,
0.2046021819114685,
0.231697678565979,
-0.33156636357307434,
0.16344238817691803,
1.7135298252105713,
0.44384437799453735,
1.3656113147735596,
1.287828803062439,
1.0008947849273682,
-0.6886820793151855,
-1.2483221292495728,
0.8541832566261292,
0.9450598955154419,
-1.4526102542877197,
0.9279365539550781,
-0.1175825446844101,
-0.5101026296615601,
0.6767817139625549,
1.2759146690368652,
0.5361179113388062,
-2.065001964569092,
0.90522301197052,
-1.1164764165878296,
0.7255370020866394,
0.7955596446990967,
0.683038055896759,
0.30782198905944824,
0.9659894108772278,
-1.2117505073547363,
-1.1720720529556274,
-0.6309786438941956,
-0.6997823715209961,
1.8641021251678467,
-0.32400086522102356,
0.6490746140480042,
-0.10166396200656891,
-1.3151562213897705,
-0.11937908083200455,
0.8810831904411316,
0.33813855051994324,
-0.5518243312835693,
0.8500946760177612,
-0.7151246666908264,
-0.9935318827629089,
-1.29630446434021,
-0.4650864601135254,
-1.1263185739517212,
-1.0231056213378906,
0.9395588040351868,
0.7707195281982422,
0.3396686613559723,
1.8761851787567139,
0.6089832782745361,
0.39915403723716736,
-2.600823402404785,
0.917784571647644,
0.24228015542030334,
-0.011543783359229565,
0.8704822659492493,
0.3036113977432251,
1.0367424488067627,
0.08211968094110489,
0.6236464977264404,
-2.422783374786377,
2.2714130878448486,
-0.248543843626976,
0.5776848793029785,
-0.020096994936466217,
-0.23706835508346558,
1.2135618925094604,
0.595126211643219,
0.515260636806488,
-1.139883041381836,
0.8217732906341553,
-0.512531042098999,
1.041053056716919,
0.8850218653678894,
-0.9084873795509338,
-0.0355655699968338,
1.4438477754592896,
0.4254564046859741,
-0.5422633290290833,
-1.0008615255355835,
-0.9641298651695251,
0.9134135842323303,
1.5728942155838013,
0.05055229365825653,
-0.08833982050418854,
0.8379116058349609,
0.755263090133667,
-1.12732994556427,
0.23615537583827972,
-0.5564959645271301,
-0.646509051322937,
1.5915729999542236,
1.9583760499954224,
-0.2216642051935196,
-0.11285870522260666,
-0.6731024980545044,
-1.166907548904419,
0.7480219602584839,
-0.09130308777093887,
-0.033025939017534256,
0.6240546107292175,
-0.681191623210907,
1.0311635732650757,
0.7113670110702515,
0.9213640093803406,
0.09348362684249878,
0.30394667387008667,
0.49151843786239624,
-0.3344496488571167,
-1.160348892211914,
-0.3435937762260437,
-1.0834308862686157,
-2.6264941692352295,
0.3699234426021576,
-0.28651562333106995,
-1.4451181888580322,
0.061938803642988205,
-1.1015866994857788,
0.9057836532592773,
-0.6436859965324402,
-1.1440192461013794,
-1.5364083051681519,
0.36782151460647583,
-0.04388966038823128,
0.8809253573417664,
-1.555344581604004,
-0.11405891180038452,
1.2055917978286743,
0.7282530665397644,
-0.5652393698692322,
1.0152819156646729,
0.21366536617279053,
1.0901066064834595,
0.8316506147384644,
-0.38657233119010925,
0.5948954820632935,
0.0236799456179142,
-1.3862662315368652,
0.5703404545783997,
1.2262908220291138,
0.10032261162996292,
1.5101715326309204,
-0.44361424446105957,
0.15576313436031342,
0.41596728563308716,
-0.7803120613098145,
-0.5209790468215942,
-0.3325847089290619,
0.7195529341697693,
-0.008496729657053947,
-0.9170316457748413,
-0.1123613566160202,
-0.15674351155757904,
-0.3498789966106415,
0.11434651166200638,
-1.4905242919921875,
-0.2469789832830429,
-0.3922517001628876,
-0.5228352546691895,
-1.2398508787155151,
-0.07369758188724518,
1.402498722076416,
-0.6295777559280396,
-0.3160521984100342,
0.5093932151794434,
0.41922295093536377,
0.5669295787811279,
0.6254339814186096,
-0.6990386247634888,
-0.08650624006986618,
-0.32943713665008545,
-0.26895275712013245,
0.3631167411804199,
1.2461434602737427,
-0.013710705563426018,
-0.8410435318946838,
0.7607229948043823,
-0.3833368718624115,
0.05620075389742851,
1.9838303327560425,
0.1422477662563324,
-0.7029516100883484,
0.31822267174720764,
-0.7462542057037354,
1.8918651342391968,
1.7813125848770142,
1.2612072229385376,
-0.048276375979185104,
-0.9261728525161743,
0.6209415793418884,
-0.33754339814186096,
-0.3477368950843811,
0.8462965488433838,
0.33069464564323425,
-0.2613389492034912,
-1.3705040216445923,
0.8238032460212708,
1.2731420993804932,
-0.7615160942077637,
-0.8058493137359619,
0.1666107475757599,
-0.7938353419303894,
1.1427326202392578,
0.5265350341796875,
0.3113389015197754,
0.3018016517162323,
1.6335842609405518,
0.7293448448181152,
-0.3434482216835022,
0.5017992258071899,
0.5336331725120544,
-0.23255254328250885,
-2.1990928649902344,
-1.1205086708068848,
0.38769298791885376,
-0.5608195066452026,
-1.5948442220687866,
1.3308895826339722,
-1.2054742574691772,
-1.036197543144226,
0.5437890887260437,
0.19212400913238525,
1.3579095602035522,
0.38374191522598267,
1.6168941259384155,
2.142209768295288,
0.7860945463180542,
0.464775025844574,
1.2323806285858154,
-0.06672684103250504,
-0.4361381530761719,
1.7920845746994019,
-0.4142904579639435,
0.5087248086929321,
1.0865123271942139,
-0.3832840323448181,
-1.1053686141967773,
-0.7935505509376526,
-1.1442800760269165,
-0.6728710532188416,
1.1504610776901245,
0.0848342701792717,
-1.0087941884994507,
0.3164912164211273,
1.5031368732452393,
0.1983744353055954,
-0.2236979901790619,
0.6403327584266663,
0.39525479078292847,
-0.694794774055481,
-0.07545704394578934,
-0.9083744883537292,
0.5646385550498962,
-0.28910741209983826,
-0.30033940076828003,
0.3417348265647888,
0.5598030090332031,
1.3152854442596436,
-0.053458914160728455,
0.13110630214214325,
1.0623987913131714,
-1.486350417137146,
1.4992823600769043,
-0.5817423462867737,
0.24279558658599854,
-2.425050973892212,
1.380290150642395,
-0.701992392539978,
2.0689139366149902,
-2.5728039741516113,
0.4089665114879608,
-0.5418558716773987,
-0.45787230134010315,
0.36128121614456177,
-0.35632213950157166,
0.08766455948352814,
-0.1086382046341896,
-1.1265681982040405,
0.08460040390491486,
-0.6666853427886963,
0.6570069789886475,
1.2120403051376343,
1.4097278118133545,
-1.1621508598327637,
-0.29496926069259644,
-1.669005274772644,
-0.12759968638420105,
-0.818705141544342,
0.376686155796051,
-1.9482134580612183,
-0.11736740171909332,
-1.9624778032302856,
-2.4680564403533936,
-1.1876481771469116,
-0.7333622574806213,
0.9441054463386536,
0.24913668632507324,
-0.8020197749137878,
1.3714996576309204,
-0.38819634914398193,
-1.8452671766281128,
1.029817819595337,
-2.138763427734375
] |
https://github.com/huggingface/datasets/issues/5112 | Bug with filtered indices | Thanks a lot for the swift response! For a brief moment yesterday I thought I had gone insane 🤣On 14 Oct 2022, at 15:44, Albert Villanova del Moral ***@***.***> wrote:
@PartiallyTyped, @Muennighoff: the issue is fixed.
We are planning to make a patch release today.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***> | ## Describe the bug
As reported by @PartiallyTyped (and by @Muennighoff):
- https://github.com/huggingface/datasets/issues/5111#issuecomment-1278652524
There is an issue with the indices of a filtered dataset.
## Steps to reproduce the bug
```python
ds = Dataset.from_dict({"num": [0, 1, 2, 3]})
ds = ds.filter(lambda num: num % 2 == 0, input_columns="num", batch_size=2)
assert all(item["num"] % 2 == 0 for item in ds)
```
## Expected results
The indices of the filtered dataset should correspond to the examples with "language" equals to "english".
## Actual results
Indices to items with other languages are included in the filtered dataset indices
## Preliminar investigation
It seems a bug introduced by:
- #5030
| 476 | 65 | Bug with filtered indices
## Describe the bug
As reported by @PartiallyTyped (and by @Muennighoff):
- https://github.com/huggingface/datasets/issues/5111#issuecomment-1278652524
There is an issue with the indices of a filtered dataset.
## Steps to reproduce the bug
```python
ds = Dataset.from_dict({"num": [0, 1, 2, 3]})
ds = ds.filter(lambda num: num % 2 == 0, input_columns="num", batch_size=2)
assert all(item["num"] % 2 == 0 for item in ds)
```
## Expected results
The indices of the filtered dataset should correspond to the examples with "language" equals to "english".
## Actual results
Indices to items with other languages are included in the filtered dataset indices
## Preliminar investigation
It seems a bug introduced by:
- #5030
Thanks a lot for the swift response! For a brief moment yesterday I thought I had gone insane 🤣On 14 Oct 2022, at 15:44, Albert Villanova del Moral ***@***.***> wrote:
@PartiallyTyped, @Muennighoff: the issue is fixed.
We are planning to make a patch release today.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***> | [
-1.2503101825714111,
-0.9322541952133179,
-0.7087873220443726,
1.3917686939239502,
-0.27282947301864624,
-1.167340636253357,
0.1988043338060379,
-1.056523323059082,
1.6513571739196777,
-0.661774218082428,
0.31688183546066284,
-1.6941313743591309,
0.02901352383196354,
-0.6219926476478577,
-0.7735264301300049,
-0.8363234400749207,
-0.4901895523071289,
-0.6808345317840576,
0.9689709544181824,
2.5637624263763428,
1.2331585884094238,
-1.435062289237976,
2.6045238971710205,
0.7778690457344055,
-0.1593412607908249,
-0.9427466988563538,
0.573153018951416,
0.055010244250297546,
-1.2666425704956055,
-0.5109689831733704,
-0.8449691534042358,
-0.14931847155094147,
-0.4129480719566345,
-0.4320675730705261,
-0.011572044342756271,
0.3987537622451782,
-0.19010284543037415,
-0.4442158043384552,
-0.5589079856872559,
-0.72988361120224,
0.5130933523178101,
-0.42266222834587097,
0.9342401623725891,
-0.4186442792415619,
1.8407056331634521,
-0.6674178242683411,
0.487093061208725,
0.7064351439476013,
1.3689299821853638,
0.24323566257953644,
-0.0007307641208171844,
0.42108064889907837,
0.39298832416534424,
-0.041141606867313385,
0.4347865581512451,
1.1284600496292114,
0.7218331694602966,
0.4548235237598419,
0.6978130340576172,
-2.1466410160064697,
1.3053890466690063,
-1.0466444492340088,
0.3688623905181885,
1.4791017770767212,
-0.924015998840332,
0.45514339208602905,
-1.7547014951705933,
-0.1256919801235199,
0.5860591530799866,
-2.3098511695861816,
0.24611710011959076,
-1.2937625646591187,
-0.5910513401031494,
0.9641541242599487,
0.3236337900161743,
-1.2884666919708252,
0.09882830083370209,
-0.47957441210746765,
0.9737949967384338,
0.34865328669548035,
1.1546658277511597,
-1.6612430810928345,
-0.16425251960754395,
-0.29724228382110596,
0.015201982110738754,
-1.3628615140914917,
-1.4940235614776611,
0.6411635875701904,
0.5176747441291809,
0.619837760925293,
-0.08872988820075989,
0.9101942777633667,
-0.9770763516426086,
0.9092457294464111,
-0.9890956878662109,
-1.6579835414886475,
-1.4482322931289673,
-2.2560157775878906,
-2.243659496307373,
0.8633148074150085,
-0.39520928263664246,
-0.5427451729774475,
1.96790611743927,
-0.9219388365745544,
-1.6485722064971924,
1.092589259147644,
0.24583758413791656,
-0.04715102165937424,
2.432445526123047,
0.1698889434337616,
-0.6419135928153992,
0.39989563822746277,
-0.8079352378845215,
0.7948010563850403,
-0.46980738639831543,
1.333850383758545,
0.3917630612850189,
-1.0438165664672852,
1.5837786197662354,
-0.4684336483478546,
0.5509200692176819,
-0.7016698718070984,
-0.5416619181632996,
-0.814691424369812,
0.32534554600715637,
1.9385628700256348,
-0.32773590087890625,
1.5996652841567993,
-0.3513248860836029,
-1.5793834924697876,
-1.600840449333191,
0.9154335260391235,
0.4745091199874878,
-0.7589389085769653,
0.17130538821220398,
-0.399871826171875,
0.09564289450645447,
-0.11476161330938339,
1.064935326576233,
1.243808627128601,
0.6289915442466736,
-0.3889228403568268,
-0.8411322236061096,
0.2487638145685196,
-0.12685608863830566,
-0.8116182088851929,
-1.7693870067596436,
-0.35957205295562744,
0.09778734296560287,
0.5897856950759888,
-1.282478928565979,
1.7386503219604492,
0.8622382879257202,
1.941519856452942,
1.0421981811523438,
-0.39057421684265137,
1.4432119131088257,
0.12002906203269958,
1.8069159984588623,
-0.5829122066497803,
0.7516321539878845,
-0.3988267779350281,
-1.0780357122421265,
0.8540772795677185,
-0.3681640028953552,
-2.131699562072754,
-0.7962543964385986,
-0.827319324016571,
-0.20063503086566925,
-0.8445364236831665,
1.0150253772735596,
-0.29595616459846497,
-1.3741484880447388,
0.31317782402038574,
-0.7552680969238281,
0.15090009570121765,
-1.3043404817581177,
0.3803497552871704,
0.7599192261695862,
-0.49032169580459595,
0.02856784127652645,
-0.2030448615550995,
-1.26645028591156,
-0.46898138523101807,
0.18346403539180756,
1.936977505683899,
-0.7122021317481995,
0.9625775218009949,
0.9940250515937805,
-0.6942175030708313,
0.00043210573494434357,
0.3994741439819336,
-0.3444006145000458,
0.8829534649848938,
-1.0759581327438354,
-0.4242294728755951,
1.104682445526123,
-0.16963666677474976,
-0.4489760100841522,
1.561675786972046,
0.7401377558708191,
-0.9415904879570007,
-0.23226115107536316,
-0.1466231495141983,
-0.8431158065795898,
0.037135668098926544,
-1.5811102390289307,
-0.0972885861992836,
0.2925591766834259,
-1.5044465065002441,
-0.5663130283355713,
-0.1938285380601883,
1.2399452924728394,
-0.2532287538051605,
1.4209691286087036,
-0.3753318786621094,
-0.2620967626571655,
-0.40338513255119324,
-0.2953217327594757,
0.09497375786304474,
-0.20027120411396027,
-0.6473722457885742,
0.20930887758731842,
-0.7897318005561829,
0.34110790491104126,
1.4268152713775635,
0.4244824945926666,
-0.005192006006836891,
0.5238349437713623,
1.0168513059616089,
0.27322012186050415,
-0.10744897276163101,
-0.8395294547080994,
-1.501728892326355,
1.9696403741836548,
-1.4791858196258545,
1.9580761194229126,
0.822150707244873,
-0.08056731522083282,
-1.710418701171875,
-1.933038592338562,
1.2987022399902344,
1.2420610189437866,
2.3579819202423096,
0.5428603291511536,
0.4728298783302307,
-0.8427914381027222,
-0.6560353636741638,
0.1967049092054367,
-1.1067044734954834,
-0.8017681241035461,
0.1099218875169754,
2.41064190864563,
1.7932043075561523,
-0.578654408454895,
-0.1430795043706894,
-1.0463368892669678,
1.4135069847106934,
-0.14839138090610504,
0.1466086357831955,
2.0014398097991943,
-0.214595228433609,
-1.0779720544815063,
1.2508727312088013,
-2.326767921447754,
0.09945761412382126,
1.9537277221679688,
0.3549617528915405,
0.09252296388149261,
-1.3128443956375122,
-0.5782989263534546,
-0.39189156889915466,
-0.45851367712020874,
-1.125177264213562,
0.5106744170188904,
-0.18792568147182465,
-0.7918001413345337,
-1.4400453567504883,
0.1569504588842392,
-1.1623278856277466,
-1.6239615678787231,
0.2661643326282501,
1.792203664779663,
1.979525089263916,
-0.7258314490318298,
1.5144107341766357,
-0.3297893702983856,
0.1501675695180893,
1.180846929550171,
1.2254692316055298,
3.1408448219299316,
1.9942212104797363,
-1.2836135625839233,
0.6566098928451538,
-0.18081693351268768,
-0.458279550075531,
1.0958024263381958,
-1.1956515312194824,
1.2677894830703735,
-0.1173592060804367,
-1.1784428358078003,
-1.2179272174835205,
0.9079862236976624,
0.47272247076034546,
0.13498221337795258,
-0.5148871541023254,
1.1467431783676147,
0.0982673242688179,
1.4226874113082886,
0.5632438659667969,
-0.2919867932796478,
0.5566271543502808,
-0.42842215299606323,
-0.4436366856098175,
1.6275591850280762,
0.25068575143814087,
-1.4466092586517334,
-2.3352391719818115,
-0.2383880913257599,
-0.9047428369522095,
0.04304792732000351,
-0.6146549582481384,
-1.1343169212341309,
1.6595613956451416,
0.4386610686779022,
-1.2183244228363037,
-0.3743129372596741,
-0.3062759041786194,
-0.6239174008369446,
2.6889636516571045,
-1.5122588872909546,
-0.2662507891654968,
-0.986879825592041,
-0.6397386789321899,
1.7159065008163452,
-1.1868327856063843,
-0.19363608956336975,
-1.040150761604309,
-0.6217992305755615,
-1.269322156906128,
-0.5195158123970032,
-0.057822056114673615,
-1.0371606349945068,
0.8478587865829468,
0.1557837724685669,
-1.1427263021469116,
-0.2880232334136963,
-0.857318639755249,
0.8032667636871338,
-0.06385929137468338,
0.2612375020980835,
1.871545433998108,
0.3828790485858917,
-0.36829400062561035,
0.7152179479598999,
1.2103185653686523,
0.6122826933860779,
-0.7377590537071228,
0.13272756338119507,
-0.6683263778686523,
0.33389875292778015,
-1.3183902502059937,
0.23856419324874878,
-2.7642760276794434,
0.6097410321235657,
-0.11239928752183914,
-0.06674474477767944,
-0.07391130179166794,
-1.2527194023132324,
1.224562644958496,
2.5748233795166016,
-1.1624213457107544,
0.48788270354270935,
0.3058679699897766,
1.2194234132766724,
-1.6585651636123657,
0.3615246117115021,
-0.39921894669532776,
2.1316282749176025,
0.18327383697032928,
1.175419569015503,
-0.536331295967102,
-2.323028564453125,
0.5953472256660461,
-1.191514492034912,
-1.2274218797683716,
0.6895466446876526,
-0.8452107310295105,
0.04178493469953537,
-1.5015604496002197,
-0.27349206805229187,
-0.8699435591697693,
-1.2313810586929321,
0.6835740804672241,
0.0636080875992775,
0.4303877651691437,
-0.7012231945991516,
0.3563254177570343,
-2.3162953853607178,
-1.3392422199249268,
-0.24462589621543884,
-0.8916940689086914,
0.4561270773410797,
-0.360347718000412,
0.7786895632743835,
-0.10140717029571533,
0.039564236998558044,
0.33368557691574097,
1.4121618270874023,
3.340186357498169,
0.2299989014863968,
0.3668723702430725,
-0.13145293295383453,
-0.9100603461265564,
1.3721492290496826,
0.9458946585655212,
-0.024790920317173004,
-0.5952216386795044,
-1.0327411890029907,
1.3654345273971558,
1.879975438117981,
0.9799368381500244,
0.03903059661388397,
-0.7662785649299622,
-0.5700961947441101,
-0.05875329673290253,
0.2477365881204605,
0.37144020199775696,
0.9908213019371033,
0.029592951759696007,
0.11429887264966965,
1.4201847314834595,
1.2681708335876465,
-0.4356617331504822,
0.3614315390586853,
-0.8659278154373169,
-0.4907146096229553,
0.5340811014175415,
0.32788795232772827,
0.0128270722925663,
0.35777828097343445,
-1.0131137371063232,
-0.308181494474411,
-0.30193936824798584,
-0.9575099349021912,
-0.737723708152771,
-0.4315059185028076,
-0.3691314160823822,
1.6619371175765991,
0.14780116081237793,
-0.4953300356864929,
-0.04241549223661423,
-0.8010201454162598,
-0.09816686809062958,
-1.1717289686203003,
0.23443137109279633,
-0.06647736579179764,
-0.08583131432533264,
-0.1437629759311676,
1.8379625082015991,
-0.8673868775367737,
-2.1213483810424805,
0.22817470133304596,
0.3041394352912903,
-0.37428024411201477,
0.15468552708625793,
1.6189075708389282,
0.577803909778595,
1.485303282737732,
1.2068357467651367,
0.9718848466873169,
-0.6641901135444641,
-1.321874737739563,
0.6616390347480774,
1.0495655536651611,
-1.346678376197815,
0.7458339929580688,
0.07086601108312607,
-0.4648555815219879,
0.5594450831413269,
1.2558467388153076,
0.40726715326309204,
-1.9995743036270142,
0.829121470451355,
-1.0092521905899048,
0.8422960638999939,
0.6814758777618408,
0.6580535173416138,
0.291098415851593,
0.8048018217086792,
-1.3537629842758179,
-1.0419120788574219,
-0.8190507292747498,
-0.5948110222816467,
2.0296518802642822,
-0.22993265092372894,
0.5795344710350037,
-0.15707363188266754,
-1.2255115509033203,
0.00207485631108284,
0.6743903756141663,
0.4121246933937073,
-0.3914787769317627,
0.8299206495285034,
-0.5865804553031921,
-1.189599871635437,
-1.430605173110962,
-0.3887919783592224,
-0.9345862865447998,
-0.8949965834617615,
1.0708119869232178,
0.8418664336204529,
0.28750208020210266,
1.9028782844543457,
0.6681848168373108,
0.22463010251522064,
-2.577854633331299,
0.922309160232544,
0.2930058538913727,
-0.10156199336051941,
0.9315397143363953,
0.29134130477905273,
1.001825213432312,
0.05441773682832718,
0.5047525763511658,
-2.484586238861084,
2.2385780811309814,
-0.15875427424907684,
0.7040947079658508,
0.02338874526321888,
-0.17316293716430664,
1.1200865507125854,
0.6450659036636353,
0.4691539704799652,
-1.035707950592041,
0.586556077003479,
-0.5696926712989807,
1.2976652383804321,
0.8529766798019409,
-0.710182249546051,
-0.05163734406232834,
1.28213369846344,
0.4752061069011688,
-0.4476335942745209,
-0.9709134697914124,
-0.8468219637870789,
0.9436257481575012,
1.8241333961486816,
-0.07432800531387329,
0.05704382807016373,
0.7804893851280212,
0.7001006007194519,
-1.2214070558547974,
0.11467164754867554,
-0.8012949824333191,
-0.7505244612693787,
1.639916181564331,
2.127758502960205,
-0.043614551424980164,
-0.2134937196969986,
-0.7067676782608032,
-1.3045603036880493,
0.8928064703941345,
-0.04845687747001648,
0.2678709328174591,
0.7114704251289368,
-0.6750723123550415,
1.0183085203170776,
0.9517714977264404,
0.9921577572822571,
0.19563999772071838,
0.3225330114364624,
0.3662267327308655,
-0.31447410583496094,
-1.0941367149353027,
-0.17081189155578613,
-1.188400387763977,
-2.5759308338165283,
0.4898584187030792,
-0.27188175916671753,
-1.3757693767547607,
-0.004165877588093281,
-1.0821478366851807,
0.9791881442070007,
-0.6171289086341858,
-1.130857229232788,
-1.5653376579284668,
0.17205168306827545,
-0.019347116351127625,
0.9994761347770691,
-1.6005545854568481,
-0.16807137429714203,
1.20957350730896,
0.8135251998901367,
-0.5664355754852295,
1.019388198852539,
0.2555263042449951,
1.047909140586853,
0.7510555386543274,
-0.3806000351905823,
0.4531175494194031,
0.03866223990917206,
-1.3753799200057983,
0.5375474691390991,
1.231532096862793,
0.21766212582588196,
1.463370442390442,
-0.6301817297935486,
0.058055222034454346,
0.3560575842857361,
-0.48725801706314087,
-0.4436001181602478,
-0.5222017168998718,
0.6296323537826538,
0.12086313962936401,
-1.031164526939392,
-0.04024697095155716,
-0.0930367112159729,
-0.2053893506526947,
0.10072170943021774,
-1.4015445709228516,
-0.1746259331703186,
-0.3798334300518036,
-0.6309846043586731,
-1.1828055381774902,
-0.10918617248535156,
1.3999627828598022,
-0.7723112106323242,
-0.14268480241298676,
0.5427480340003967,
0.4240802824497223,
0.5606444478034973,
0.7303853631019592,
-0.6755877137184143,
-0.3952571749687195,
-0.20232470333576202,
-0.2621569335460663,
0.2311459630727768,
1.357328176498413,
-0.13329318165779114,
-0.9549539685249329,
0.6741832494735718,
-0.3602343201637268,
0.08161663264036179,
1.9433460235595703,
0.16095277667045593,
-0.7690169215202332,
0.34915220737457275,
-0.7108868956565857,
2.01904296875,
1.6648238897323608,
1.3072919845581055,
-0.1474696695804596,
-0.9832882881164551,
0.4975859224796295,
-0.3403574824333191,
-0.4167020916938782,
0.8292425870895386,
0.4570656418800354,
-0.1792978197336197,
-1.4949363470077515,
0.6060962080955505,
1.3198752403259277,
-0.9323408603668213,
-0.8461636900901794,
0.18584200739860535,
-0.8116635680198669,
1.1013017892837524,
0.6336961984634399,
0.434434175491333,
0.20675234496593475,
1.6101253032684326,
0.7799845933914185,
-0.4875440299510956,
0.46304750442504883,
0.5646201372146606,
-0.06290370970964432,
-2.086486339569092,
-1.2239456176757812,
0.28337520360946655,
-0.5392485857009888,
-1.4944067001342773,
1.391801357269287,
-1.0679292678833008,
-0.8796333074569702,
0.5032162070274353,
0.1744103580713272,
1.4104139804840088,
0.38113605976104736,
1.6070866584777832,
2.017249584197998,
0.8886716961860657,
0.2567065358161926,
1.3001497983932495,
-0.0424773246049881,
-0.5364714860916138,
1.7931345701217651,
-0.4295003116130829,
0.5082593560218811,
1.1079031229019165,
-0.359978586435318,
-1.1152973175048828,
-0.7491127848625183,
-1.280892252922058,
-0.7278597950935364,
1.1564040184020996,
0.13118769228458405,
-1.0035552978515625,
0.18359822034835815,
1.601464867591858,
0.0642455518245697,
-0.39376822113990784,
0.5001443028450012,
0.4149312973022461,
-0.8411105275154114,
-0.04399517923593521,
-0.9489696621894836,
0.5834960341453552,
-0.1161031499505043,
-0.387997567653656,
0.29387542605400085,
0.5782241225242615,
1.3234684467315674,
-0.09822725504636765,
0.10987599194049835,
1.1735975742340088,
-1.460363745689392,
1.560652256011963,
-0.6434507369995117,
0.13174021244049072,
-2.3683249950408936,
1.4426690340042114,
-0.7090259790420532,
1.88351309299469,
-2.7038187980651855,
0.4085977375507355,
-0.5755969285964966,
-0.3565342128276825,
0.31616106629371643,
-0.36061179637908936,
0.1870528608560562,
-0.10539696365594864,
-1.1622458696365356,
-0.07580085843801498,
-0.6195701360702515,
0.5080472826957703,
1.1062995195388794,
1.3287898302078247,
-1.1628389358520508,
-0.23942124843597412,
-1.7121264934539795,
-0.0893462523818016,
-0.6790822744369507,
0.28757157921791077,
-1.9858238697052002,
-0.11574045568704605,
-1.8662551641464233,
-2.2370872497558594,
-1.347023367881775,
-0.8071281909942627,
1.0713207721710205,
0.14753298461437225,
-0.8792734146118164,
1.1692571640014648,
-0.38890862464904785,
-1.762653112411499,
1.0590063333511353,
-2.225829839706421
] |
https://github.com/huggingface/datasets/issues/5111 | map and filter not working properly in multiprocessing with the new release 2.6.0 | Thanks for reporting, @loubnabnl and for the additional information, @PartiallyTyped.
However, I'm not able to reproduce this issue, neither locally nor on Colab:
```
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
CC: @huggingface/datasets can anybody reproduce this? | ## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2 | 477 | 63 | map and filter not working properly in multiprocessing with the new release 2.6.0
## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2
Thanks for reporting, @loubnabnl and for the additional information, @PartiallyTyped.
However, I'm not able to reproduce this issue, neither locally nor on Colab:
```
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
CC: @huggingface/datasets can anybody reproduce this? | [
-1.352843999862671,
-0.9489383101463318,
-0.7380266189575195,
1.3653239011764526,
-0.2156757116317749,
-1.1626625061035156,
0.19859008491039276,
-1.193071961402893,
1.6733355522155762,
-0.7513960599899292,
0.31026315689086914,
-1.72084379196167,
0.007246973924338818,
-0.7082626223564148,
-0.7887933254241943,
-0.8437585234642029,
-0.4116605222225189,
-0.7523932456970215,
1.1017882823944092,
2.4730443954467773,
1.2084859609603882,
-1.4340589046478271,
2.697086811065674,
0.7607104182243347,
-0.20602354407310486,
-1.000741720199585,
0.5457071661949158,
-0.05817698687314987,
-1.2278823852539062,
-0.4593156576156616,
-1.0296601057052612,
0.03622161224484444,
-0.5640300512313843,
-0.4410548508167267,
-0.08515094965696335,
0.36792615056037903,
-0.38905006647109985,
-0.3640885353088379,
-0.5134558081626892,
-0.8171752095222473,
0.5125590562820435,
-0.3884046971797943,
1.0048593282699585,
-0.34680455923080444,
1.793594479560852,
-0.5570852160453796,
0.5095599889755249,
0.6792799830436707,
1.336542010307312,
0.24689161777496338,
0.006785108707845211,
0.4661327600479126,
0.33547261357307434,
-0.039084721356630325,
0.5615963935852051,
1.2524054050445557,
0.6978742480278015,
0.47188377380371094,
0.8196986317634583,
-2.156207799911499,
1.2528531551361084,
-1.1066406965255737,
0.33222082257270813,
1.4115351438522339,
-0.8493854999542236,
0.33210253715515137,
-1.7599397897720337,
-0.04425366595387459,
0.6521478891372681,
-2.3162789344787598,
0.2995977997779846,
-1.27919340133667,
-0.5048683881759644,
1.078323245048523,
0.45950576663017273,
-1.2588427066802979,
0.10946755856275558,
-0.37329718470573425,
0.9714365005493164,
0.35684603452682495,
1.1564955711364746,
-1.6376603841781616,
-0.04867835342884064,
-0.3635140359401703,
0.05492449924349785,
-1.3257859945297241,
-1.4307327270507812,
0.5169233083724976,
0.5634656548500061,
0.6576090455055237,
-0.1427420675754547,
1.0496206283569336,
-1.0976380109786987,
0.7090063095092773,
-0.9661166071891785,
-1.6119598150253296,
-1.4128257036209106,
-2.291623115539551,
-2.273634433746338,
0.8197525143623352,
-0.41872870922088623,
-0.5719591379165649,
2.021575927734375,
-0.9523361921310425,
-1.7182625532150269,
1.1999105215072632,
0.36988332867622375,
0.0004202015697956085,
2.4817044734954834,
0.18493850529193878,
-0.8106722831726074,
0.6008914113044739,
-0.7502665519714355,
0.8027536869049072,
-0.34925419092178345,
1.327896237373352,
0.4561380445957184,
-1.0612645149230957,
1.628460168838501,
-0.39423635601997375,
0.5187291502952576,
-0.6074494123458862,
-0.5249357223510742,
-0.8257798552513123,
0.3605669438838959,
1.8437187671661377,
-0.2546614408493042,
1.5616862773895264,
-0.36114975810050964,
-1.57076096534729,
-1.644235610961914,
0.8591213822364807,
0.5475424528121948,
-0.7222733497619629,
0.12655296921730042,
-0.4101954400539398,
0.15647009015083313,
-0.09552298486232758,
1.159052848815918,
1.2761552333831787,
0.6186755299568176,
-0.32532963156700134,
-0.8480733633041382,
0.20687732100486755,
-0.09794370085000992,
-0.8096684813499451,
-1.7095060348510742,
-0.3229031264781952,
0.08813325315713882,
0.6513823866844177,
-1.200533390045166,
1.7762179374694824,
0.8353346586227417,
1.8862431049346924,
1.067116379737854,
-0.33585047721862793,
1.4812729358673096,
0.14742086827754974,
1.7066727876663208,
-0.5229436159133911,
0.6215577721595764,
-0.3223905563354492,
-1.1065716743469238,
0.8702681064605713,
-0.3996455669403076,
-2.044123888015747,
-0.7283399701118469,
-0.7253296971321106,
-0.12067362666130066,
-0.8233163356781006,
0.9613419771194458,
-0.3409569561481476,
-1.42781662940979,
0.35036900639533997,
-0.658052384853363,
0.11745937913656235,
-1.2482538223266602,
0.2546139061450958,
0.5985851287841797,
-0.6337411999702454,
-0.001809737179428339,
-0.15700726211071014,
-1.2436459064483643,
-0.3544852137565613,
0.17339321970939636,
1.8323628902435303,
-0.7161698937416077,
0.8825073838233948,
1.132197380065918,
-0.6953890919685364,
0.024699818342924118,
0.3942883312702179,
-0.2893776595592499,
0.7942770719528198,
-0.9977194666862488,
-0.4950154423713684,
1.1875135898590088,
-0.1709742695093155,
-0.4858299791812897,
1.4413151741027832,
0.6624630689620972,
-1.0681079626083374,
-0.1626148223876953,
-0.04255552589893341,
-0.8441759347915649,
0.0005662087351083755,
-1.535001277923584,
-0.13696789741516113,
0.45653510093688965,
-1.5621756315231323,
-0.5100254416465759,
-0.13009627163410187,
1.3108726739883423,
-0.25033432245254517,
1.423515796661377,
-0.38030102849006653,
-0.09034518897533417,
-0.2796098589897156,
-0.4299139082431793,
0.01708785444498062,
-0.0839274525642395,
-0.6643987894058228,
0.23706480860710144,
-0.7502977848052979,
0.37443214654922485,
1.38765549659729,
0.39412400126457214,
-0.003828566987067461,
0.4832402467727661,
1.0732358694076538,
0.3888905644416809,
-0.03001384437084198,
-0.8360363841056824,
-1.5617207288742065,
1.983630895614624,
-1.4796925783157349,
1.9793988466262817,
0.775019109249115,
-0.06505832076072693,
-1.695220947265625,
-1.7991671562194824,
1.4485450983047485,
1.1590040922164917,
2.3528950214385986,
0.5508567690849304,
0.41987383365631104,
-0.8208760619163513,
-0.7443094253540039,
0.31133773922920227,
-1.0313268899917603,
-0.7301105260848999,
0.07630030810832977,
2.4081532955169678,
1.7988923788070679,
-0.42698219418525696,
-0.1863911747932434,
-0.9899306893348694,
1.4028830528259277,
-0.2349306344985962,
0.26231423020362854,
1.9904849529266357,
-0.28220874071121216,
-1.142384648323059,
1.3960716724395752,
-2.3221797943115234,
0.0447310209274292,
1.9977569580078125,
0.30103397369384766,
0.09090276062488556,
-1.3771135807037354,
-0.49492645263671875,
-0.331441730260849,
-0.5523610711097717,
-1.2608861923217773,
0.5357611179351807,
-0.3041812777519226,
-0.8175384402275085,
-1.2733650207519531,
0.22175228595733643,
-1.2209690809249878,
-1.565248727798462,
0.3227149248123169,
1.8107928037643433,
2.123690128326416,
-0.8011602759361267,
1.5874642133712769,
-0.2909051179885864,
0.24637815356254578,
1.1586476564407349,
1.2416718006134033,
3.110504627227783,
1.8755992650985718,
-1.3669167757034302,
0.655765950679779,
-0.1908571571111679,
-0.5018966197967529,
1.1857972145080566,
-1.2210932970046997,
1.3433812856674194,
-0.061903029680252075,
-1.234751582145691,
-1.1753593683242798,
0.8742913603782654,
0.49568235874176025,
0.07559602707624435,
-0.5248870849609375,
1.179282546043396,
0.014901830814778805,
1.2154346704483032,
0.4900110363960266,
-0.28928473591804504,
0.5582860112190247,
-0.39514753222465515,
-0.5557770133018494,
1.553432583808899,
0.03435596451163292,
-1.4839650392532349,
-2.1559338569641113,
-0.1260356605052948,
-0.8027786612510681,
0.17490032315254211,
-0.7238632440567017,
-1.016738772392273,
1.6374210119247437,
0.3465195596218109,
-1.2611714601516724,
-0.2574252188205719,
-0.4282146990299225,
-0.6071368455886841,
2.6187610626220703,
-1.3952144384384155,
-0.2371700555086136,
-1.0277968645095825,
-0.6649593710899353,
1.6580921411514282,
-1.1364266872406006,
-0.21336692571640015,
-0.951311469078064,
-0.6637430787086487,
-1.292916178703308,
-0.5564977526664734,
0.0077466173097491264,
-0.9504511952400208,
0.742119550704956,
0.2722775936126709,
-1.0542643070220947,
-0.3482115864753723,
-0.8063483238220215,
0.9140456914901733,
-0.15540120005607605,
0.18437643349170685,
1.8741427659988403,
0.2666875123977661,
-0.2889736592769623,
0.731098473072052,
1.216781497001648,
0.5726482272148132,
-0.6049782633781433,
0.10222222656011581,
-0.7135103344917297,
0.45156368613243103,
-1.3268308639526367,
0.23948723077774048,
-2.8180761337280273,
0.6419659852981567,
-0.017636079341173172,
-0.007279344368726015,
-0.004086786415427923,
-1.253089189529419,
1.1025699377059937,
2.6280109882354736,
-1.1376124620437622,
0.4524666666984558,
0.31024977564811707,
1.1842352151870728,
-1.6642428636550903,
0.13249927759170532,
-0.5423892140388489,
2.1645026206970215,
0.16787037253379822,
1.1557540893554688,
-0.4540040194988251,
-2.3912434577941895,
0.6820730566978455,
-1.1910542249679565,
-1.1874547004699707,
0.8611146807670593,
-0.9098837375640869,
0.19467948377132416,
-1.492958426475525,
-0.23916681110858917,
-0.8900787234306335,
-1.0601303577423096,
0.7021640539169312,
0.16460129618644714,
0.4878041744232178,
-0.6335223317146301,
0.3417249321937561,
-2.232370615005493,
-1.3560826778411865,
-0.14507611095905304,
-0.9469844102859497,
0.5473050475120544,
-0.3101058602333069,
0.6931146383285522,
-0.16004320979118347,
-0.05999945104122162,
0.39408475160598755,
1.4535225629806519,
3.360382318496704,
0.12939833104610443,
0.36583980917930603,
-0.1527254432439804,
-0.8759079575538635,
1.3659929037094116,
0.9409795999526978,
-0.1779569536447525,
-0.6304442882537842,
-1.1271629333496094,
1.348219871520996,
1.9111262559890747,
1.0133330821990967,
0.07795850932598114,
-0.8557611703872681,
-0.710820734500885,
-0.0030904491432011127,
0.1625552922487259,
0.46008771657943726,
0.895862340927124,
0.05518816038966179,
0.06036972627043724,
1.4112592935562134,
1.164651870727539,
-0.3956789970397949,
0.35540127754211426,
-0.8529433012008667,
-0.4635494351387024,
0.5882209539413452,
0.26365765929222107,
-0.04530327394604683,
0.4310956299304962,
-0.891121506690979,
-0.16506318747997284,
-0.32724541425704956,
-0.8987978100776672,
-0.6869591474533081,
-0.32895296812057495,
-0.2943706214427948,
1.656821370124817,
0.0886165127158165,
-0.572130024433136,
0.016022849828004837,
-0.9148297905921936,
-0.209905743598938,
-1.0779117345809937,
0.20231640338897705,
-0.09923326224088669,
-0.16712836921215057,
-0.1455838680267334,
1.6554466485977173,
-0.8948386907577515,
-2.0234293937683105,
0.11941210180521011,
0.2864963710308075,
-0.23282557725906372,
0.2243698239326477,
1.6920591592788696,
0.5473124384880066,
1.4238855838775635,
1.2995887994766235,
0.915253221988678,
-0.6527360677719116,
-1.2476170063018799,
0.6657904982566833,
1.0366777181625366,
-1.352869987487793,
0.8531225919723511,
-0.05772101506590843,
-0.5229977965354919,
0.5777467489242554,
1.2999303340911865,
0.4764743149280548,
-1.9456743001937866,
0.8796243071556091,
-1.0466121435165405,
0.7997974157333374,
0.6567378044128418,
0.6350302696228027,
0.2660275995731354,
0.8911247849464417,
-1.235562801361084,
-1.1697279214859009,
-0.760753870010376,
-0.7488093972206116,
2.018808364868164,
-0.20905597507953644,
0.6347901225090027,
-0.22344841063022614,
-1.2952947616577148,
-0.12106344848871231,
0.6511560678482056,
0.3459177315235138,
-0.37168893218040466,
0.7681452035903931,
-0.6986016035079956,
-1.0484375953674316,
-1.525109887123108,
-0.35719016194343567,
-1.0954183340072632,
-0.8409464955329895,
1.1188147068023682,
0.7919401526451111,
0.25647974014282227,
1.894824743270874,
0.7183055877685547,
0.258539617061615,
-2.4437203407287598,
0.844420313835144,
0.4085065722465515,
-0.13393595814704895,
0.9314306378364563,
0.3869825005531311,
1.0625985860824585,
0.01904981955885887,
0.5382217764854431,
-2.374877691268921,
2.1903738975524902,
-0.22166168689727783,
0.6688701510429382,
-0.005186804570257664,
-0.1760694980621338,
1.0659552812576294,
0.6418696641921997,
0.49213868379592896,
-1.1228981018066406,
0.584804892539978,
-0.5494658946990967,
1.2753336429595947,
1.0675774812698364,
-0.8527571558952332,
-0.051426686346530914,
1.3581863641738892,
0.3301854133605957,
-0.5314280390739441,
-0.9450830221176147,
-0.9743315577507019,
0.8931750655174255,
1.7217029333114624,
-0.10658532381057739,
-0.01538261491805315,
0.7675034999847412,
0.7746050357818604,
-1.3633453845977783,
0.0868171826004982,
-0.7363263964653015,
-0.7641669511795044,
1.7431671619415283,
2.1377151012420654,
-0.16762635111808777,
-0.12013321369886398,
-0.7418760657310486,
-1.2674833536148071,
0.8302239179611206,
-0.14852993190288544,
0.15459497272968292,
0.6361611485481262,
-0.7751073837280273,
1.0675251483917236,
1.0603207349777222,
0.747060239315033,
0.24068410694599152,
0.208685502409935,
0.36574673652648926,
-0.24202995002269745,
-1.175158143043518,
-0.316668838262558,
-1.0509452819824219,
-2.6592228412628174,
0.36408284306526184,
-0.2135932743549347,
-1.3718891143798828,
-0.00916301179677248,
-1.068444848060608,
0.9414942264556885,
-0.566517174243927,
-1.0452936887741089,
-1.5147794485092163,
0.2795720398426056,
0.06134048476815224,
0.9615294933319092,
-1.5560575723648071,
-0.21939152479171753,
1.1915570497512817,
0.8745578527450562,
-0.6153393983840942,
1.0416154861450195,
0.33449527621269226,
1.0751947164535522,
0.8196992874145508,
-0.4833395779132843,
0.5968950986862183,
0.008883579634130001,
-1.316942572593689,
0.5585237741470337,
1.1433601379394531,
0.21117042005062103,
1.5058234930038452,
-0.481172114610672,
0.01979086548089981,
0.3488268554210663,
-0.6223403215408325,
-0.4098179340362549,
-0.5806086659431458,
0.609577476978302,
0.03656207025051117,
-0.9033235907554626,
-0.1107715293765068,
-0.04403461143374443,
-0.3255966305732727,
0.19006557762622833,
-1.4721750020980835,
-0.11168469488620758,
-0.33968108892440796,
-0.5704721212387085,
-1.2460225820541382,
-0.06051511690020561,
1.4336400032043457,
-0.8955585956573486,
-0.16400933265686035,
0.40855079889297485,
0.30240294337272644,
0.4924176335334778,
0.710416316986084,
-0.7622431516647339,
-0.34232640266418457,
-0.22104868292808533,
-0.33992305397987366,
0.289645254611969,
1.2953866720199585,
-0.12105327099561691,
-0.9850965738296509,
0.5932890176773071,
-0.29273706674575806,
0.07486826181411743,
1.8280748128890991,
0.09544162452220917,
-0.8026280999183655,
0.32181665301322937,
-0.6986579298973083,
1.982555866241455,
1.7433909177780151,
1.3236198425292969,
-0.18479810655117035,
-0.9514570236206055,
0.5961427688598633,
-0.37779268622398376,
-0.3550875782966614,
0.9252227544784546,
0.2947911322116852,
-0.23734647035598755,
-1.5153212547302246,
0.6624361872673035,
1.2899051904678345,
-0.9129298329353333,
-0.731997549533844,
0.029841378331184387,
-0.7764636874198914,
1.056974172592163,
0.6825543642044067,
0.3367267847061157,
0.3575996458530426,
1.663863182067871,
0.7565373778343201,
-0.4806693196296692,
0.5380176901817322,
0.5159711241722107,
-0.07335152477025986,
-2.187666177749634,
-1.105055809020996,
0.2530314028263092,
-0.5017623901367188,
-1.5451282262802124,
1.3842507600784302,
-1.072147011756897,
-0.9950253963470459,
0.5319123864173889,
0.01197656150907278,
1.3578959703445435,
0.2538418471813202,
1.521762490272522,
2.0222184658050537,
0.8633520007133484,
0.2941129505634308,
1.2510145902633667,
-0.16922393441200256,
-0.4051722586154938,
1.753936767578125,
-0.4390742778778076,
0.4591558277606964,
1.1201082468032837,
-0.3404683768749237,
-1.027348279953003,
-0.7522260546684265,
-1.2485402822494507,
-0.7470186352729797,
1.1354743242263794,
0.03174611181020737,
-1.080340027809143,
0.21950045228004456,
1.6040778160095215,
0.07819212973117828,
-0.26678863167762756,
0.6241464614868164,
0.5341216325759888,
-0.9077156782150269,
-0.09818152338266373,
-0.8736677169799805,
0.5397403240203857,
-0.1829221546649933,
-0.3162173330783844,
0.28740784525871277,
0.48566243052482605,
1.4278072118759155,
-0.13712112605571747,
0.14966705441474915,
1.1077477931976318,
-1.4714453220367432,
1.4290574789047241,
-0.780772864818573,
0.29234108328819275,
-2.3378474712371826,
1.333397626876831,
-0.7560499310493469,
2.0092618465423584,
-2.68290638923645,
0.5947133898735046,
-0.6653397679328918,
-0.49545004963874817,
0.2931648790836334,
-0.36907827854156494,
0.17161716520786285,
-0.036618608981370926,
-1.1581841707229614,
-0.018261054530739784,
-0.6764445900917053,
0.6357938647270203,
1.1383684873580933,
1.4243524074554443,
-1.0985175371170044,
-0.31130486726760864,
-1.6747170686721802,
-0.19837456941604614,
-0.665216326713562,
0.21557992696762085,
-2.025118589401245,
-0.1402670294046402,
-1.9882651567459106,
-2.3787989616394043,
-1.3930752277374268,
-0.8067795038223267,
1.2297288179397583,
0.06829382479190826,
-0.9661176204681396,
1.2934590578079224,
-0.3962615132331848,
-1.8310800790786743,
1.1039860248565674,
-2.1388890743255615
] |
https://github.com/huggingface/datasets/issues/5111 | map and filter not working properly in multiprocessing with the new release 2.6.0 | This is the minimum reproducible example. I ran this on the premium instances of colab.
```
# !pip install datasets
import datasets
from datasets import load_dataset
ds = load_dataset("copenlu/answerable_tydiqa").filter("english".__eq__, input_columns="language")
assert all(map("english".__eq__, ds["train"]["language"]))
```
In my case, the number of samples is correct, however, the samples selected when indexing are wrong.
```python
DatasetDict({
validation: Dataset({
features: ['question_text', 'document_title', 'language', 'annotations', 'document_plaintext', 'document_url'],
num_rows: 990
})
train: Dataset({
features: ['question_text', 'document_title', 'language', 'annotations', 'document_plaintext', 'document_url'],
num_rows: 7389
})
})
```
The number of rows is indeed correct, and i have checked it with a version that works. | ## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2 | 477 | 96 | map and filter not working properly in multiprocessing with the new release 2.6.0
## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2
This is the minimum reproducible example. I ran this on the premium instances of colab.
```
# !pip install datasets
import datasets
from datasets import load_dataset
ds = load_dataset("copenlu/answerable_tydiqa").filter("english".__eq__, input_columns="language")
assert all(map("english".__eq__, ds["train"]["language"]))
```
In my case, the number of samples is correct, however, the samples selected when indexing are wrong.
```python
DatasetDict({
validation: Dataset({
features: ['question_text', 'document_title', 'language', 'annotations', 'document_plaintext', 'document_url'],
num_rows: 990
})
train: Dataset({
features: ['question_text', 'document_title', 'language', 'annotations', 'document_plaintext', 'document_url'],
num_rows: 7389
})
})
```
The number of rows is indeed correct, and i have checked it with a version that works. | [
-1.352843999862671,
-0.9489383101463318,
-0.7380266189575195,
1.3653239011764526,
-0.2156757116317749,
-1.1626625061035156,
0.19859008491039276,
-1.193071961402893,
1.6733355522155762,
-0.7513960599899292,
0.31026315689086914,
-1.72084379196167,
0.007246973924338818,
-0.7082626223564148,
-0.7887933254241943,
-0.8437585234642029,
-0.4116605222225189,
-0.7523932456970215,
1.1017882823944092,
2.4730443954467773,
1.2084859609603882,
-1.4340589046478271,
2.697086811065674,
0.7607104182243347,
-0.20602354407310486,
-1.000741720199585,
0.5457071661949158,
-0.05817698687314987,
-1.2278823852539062,
-0.4593156576156616,
-1.0296601057052612,
0.03622161224484444,
-0.5640300512313843,
-0.4410548508167267,
-0.08515094965696335,
0.36792615056037903,
-0.38905006647109985,
-0.3640885353088379,
-0.5134558081626892,
-0.8171752095222473,
0.5125590562820435,
-0.3884046971797943,
1.0048593282699585,
-0.34680455923080444,
1.793594479560852,
-0.5570852160453796,
0.5095599889755249,
0.6792799830436707,
1.336542010307312,
0.24689161777496338,
0.006785108707845211,
0.4661327600479126,
0.33547261357307434,
-0.039084721356630325,
0.5615963935852051,
1.2524054050445557,
0.6978742480278015,
0.47188377380371094,
0.8196986317634583,
-2.156207799911499,
1.2528531551361084,
-1.1066406965255737,
0.33222082257270813,
1.4115351438522339,
-0.8493854999542236,
0.33210253715515137,
-1.7599397897720337,
-0.04425366595387459,
0.6521478891372681,
-2.3162789344787598,
0.2995977997779846,
-1.27919340133667,
-0.5048683881759644,
1.078323245048523,
0.45950576663017273,
-1.2588427066802979,
0.10946755856275558,
-0.37329718470573425,
0.9714365005493164,
0.35684603452682495,
1.1564955711364746,
-1.6376603841781616,
-0.04867835342884064,
-0.3635140359401703,
0.05492449924349785,
-1.3257859945297241,
-1.4307327270507812,
0.5169233083724976,
0.5634656548500061,
0.6576090455055237,
-0.1427420675754547,
1.0496206283569336,
-1.0976380109786987,
0.7090063095092773,
-0.9661166071891785,
-1.6119598150253296,
-1.4128257036209106,
-2.291623115539551,
-2.273634433746338,
0.8197525143623352,
-0.41872870922088623,
-0.5719591379165649,
2.021575927734375,
-0.9523361921310425,
-1.7182625532150269,
1.1999105215072632,
0.36988332867622375,
0.0004202015697956085,
2.4817044734954834,
0.18493850529193878,
-0.8106722831726074,
0.6008914113044739,
-0.7502665519714355,
0.8027536869049072,
-0.34925419092178345,
1.327896237373352,
0.4561380445957184,
-1.0612645149230957,
1.628460168838501,
-0.39423635601997375,
0.5187291502952576,
-0.6074494123458862,
-0.5249357223510742,
-0.8257798552513123,
0.3605669438838959,
1.8437187671661377,
-0.2546614408493042,
1.5616862773895264,
-0.36114975810050964,
-1.57076096534729,
-1.644235610961914,
0.8591213822364807,
0.5475424528121948,
-0.7222733497619629,
0.12655296921730042,
-0.4101954400539398,
0.15647009015083313,
-0.09552298486232758,
1.159052848815918,
1.2761552333831787,
0.6186755299568176,
-0.32532963156700134,
-0.8480733633041382,
0.20687732100486755,
-0.09794370085000992,
-0.8096684813499451,
-1.7095060348510742,
-0.3229031264781952,
0.08813325315713882,
0.6513823866844177,
-1.200533390045166,
1.7762179374694824,
0.8353346586227417,
1.8862431049346924,
1.067116379737854,
-0.33585047721862793,
1.4812729358673096,
0.14742086827754974,
1.7066727876663208,
-0.5229436159133911,
0.6215577721595764,
-0.3223905563354492,
-1.1065716743469238,
0.8702681064605713,
-0.3996455669403076,
-2.044123888015747,
-0.7283399701118469,
-0.7253296971321106,
-0.12067362666130066,
-0.8233163356781006,
0.9613419771194458,
-0.3409569561481476,
-1.42781662940979,
0.35036900639533997,
-0.658052384853363,
0.11745937913656235,
-1.2482538223266602,
0.2546139061450958,
0.5985851287841797,
-0.6337411999702454,
-0.001809737179428339,
-0.15700726211071014,
-1.2436459064483643,
-0.3544852137565613,
0.17339321970939636,
1.8323628902435303,
-0.7161698937416077,
0.8825073838233948,
1.132197380065918,
-0.6953890919685364,
0.024699818342924118,
0.3942883312702179,
-0.2893776595592499,
0.7942770719528198,
-0.9977194666862488,
-0.4950154423713684,
1.1875135898590088,
-0.1709742695093155,
-0.4858299791812897,
1.4413151741027832,
0.6624630689620972,
-1.0681079626083374,
-0.1626148223876953,
-0.04255552589893341,
-0.8441759347915649,
0.0005662087351083755,
-1.535001277923584,
-0.13696789741516113,
0.45653510093688965,
-1.5621756315231323,
-0.5100254416465759,
-0.13009627163410187,
1.3108726739883423,
-0.25033432245254517,
1.423515796661377,
-0.38030102849006653,
-0.09034518897533417,
-0.2796098589897156,
-0.4299139082431793,
0.01708785444498062,
-0.0839274525642395,
-0.6643987894058228,
0.23706480860710144,
-0.7502977848052979,
0.37443214654922485,
1.38765549659729,
0.39412400126457214,
-0.003828566987067461,
0.4832402467727661,
1.0732358694076538,
0.3888905644416809,
-0.03001384437084198,
-0.8360363841056824,
-1.5617207288742065,
1.983630895614624,
-1.4796925783157349,
1.9793988466262817,
0.775019109249115,
-0.06505832076072693,
-1.695220947265625,
-1.7991671562194824,
1.4485450983047485,
1.1590040922164917,
2.3528950214385986,
0.5508567690849304,
0.41987383365631104,
-0.8208760619163513,
-0.7443094253540039,
0.31133773922920227,
-1.0313268899917603,
-0.7301105260848999,
0.07630030810832977,
2.4081532955169678,
1.7988923788070679,
-0.42698219418525696,
-0.1863911747932434,
-0.9899306893348694,
1.4028830528259277,
-0.2349306344985962,
0.26231423020362854,
1.9904849529266357,
-0.28220874071121216,
-1.142384648323059,
1.3960716724395752,
-2.3221797943115234,
0.0447310209274292,
1.9977569580078125,
0.30103397369384766,
0.09090276062488556,
-1.3771135807037354,
-0.49492645263671875,
-0.331441730260849,
-0.5523610711097717,
-1.2608861923217773,
0.5357611179351807,
-0.3041812777519226,
-0.8175384402275085,
-1.2733650207519531,
0.22175228595733643,
-1.2209690809249878,
-1.565248727798462,
0.3227149248123169,
1.8107928037643433,
2.123690128326416,
-0.8011602759361267,
1.5874642133712769,
-0.2909051179885864,
0.24637815356254578,
1.1586476564407349,
1.2416718006134033,
3.110504627227783,
1.8755992650985718,
-1.3669167757034302,
0.655765950679779,
-0.1908571571111679,
-0.5018966197967529,
1.1857972145080566,
-1.2210932970046997,
1.3433812856674194,
-0.061903029680252075,
-1.234751582145691,
-1.1753593683242798,
0.8742913603782654,
0.49568235874176025,
0.07559602707624435,
-0.5248870849609375,
1.179282546043396,
0.014901830814778805,
1.2154346704483032,
0.4900110363960266,
-0.28928473591804504,
0.5582860112190247,
-0.39514753222465515,
-0.5557770133018494,
1.553432583808899,
0.03435596451163292,
-1.4839650392532349,
-2.1559338569641113,
-0.1260356605052948,
-0.8027786612510681,
0.17490032315254211,
-0.7238632440567017,
-1.016738772392273,
1.6374210119247437,
0.3465195596218109,
-1.2611714601516724,
-0.2574252188205719,
-0.4282146990299225,
-0.6071368455886841,
2.6187610626220703,
-1.3952144384384155,
-0.2371700555086136,
-1.0277968645095825,
-0.6649593710899353,
1.6580921411514282,
-1.1364266872406006,
-0.21336692571640015,
-0.951311469078064,
-0.6637430787086487,
-1.292916178703308,
-0.5564977526664734,
0.0077466173097491264,
-0.9504511952400208,
0.742119550704956,
0.2722775936126709,
-1.0542643070220947,
-0.3482115864753723,
-0.8063483238220215,
0.9140456914901733,
-0.15540120005607605,
0.18437643349170685,
1.8741427659988403,
0.2666875123977661,
-0.2889736592769623,
0.731098473072052,
1.216781497001648,
0.5726482272148132,
-0.6049782633781433,
0.10222222656011581,
-0.7135103344917297,
0.45156368613243103,
-1.3268308639526367,
0.23948723077774048,
-2.8180761337280273,
0.6419659852981567,
-0.017636079341173172,
-0.007279344368726015,
-0.004086786415427923,
-1.253089189529419,
1.1025699377059937,
2.6280109882354736,
-1.1376124620437622,
0.4524666666984558,
0.31024977564811707,
1.1842352151870728,
-1.6642428636550903,
0.13249927759170532,
-0.5423892140388489,
2.1645026206970215,
0.16787037253379822,
1.1557540893554688,
-0.4540040194988251,
-2.3912434577941895,
0.6820730566978455,
-1.1910542249679565,
-1.1874547004699707,
0.8611146807670593,
-0.9098837375640869,
0.19467948377132416,
-1.492958426475525,
-0.23916681110858917,
-0.8900787234306335,
-1.0601303577423096,
0.7021640539169312,
0.16460129618644714,
0.4878041744232178,
-0.6335223317146301,
0.3417249321937561,
-2.232370615005493,
-1.3560826778411865,
-0.14507611095905304,
-0.9469844102859497,
0.5473050475120544,
-0.3101058602333069,
0.6931146383285522,
-0.16004320979118347,
-0.05999945104122162,
0.39408475160598755,
1.4535225629806519,
3.360382318496704,
0.12939833104610443,
0.36583980917930603,
-0.1527254432439804,
-0.8759079575538635,
1.3659929037094116,
0.9409795999526978,
-0.1779569536447525,
-0.6304442882537842,
-1.1271629333496094,
1.348219871520996,
1.9111262559890747,
1.0133330821990967,
0.07795850932598114,
-0.8557611703872681,
-0.710820734500885,
-0.0030904491432011127,
0.1625552922487259,
0.46008771657943726,
0.895862340927124,
0.05518816038966179,
0.06036972627043724,
1.4112592935562134,
1.164651870727539,
-0.3956789970397949,
0.35540127754211426,
-0.8529433012008667,
-0.4635494351387024,
0.5882209539413452,
0.26365765929222107,
-0.04530327394604683,
0.4310956299304962,
-0.891121506690979,
-0.16506318747997284,
-0.32724541425704956,
-0.8987978100776672,
-0.6869591474533081,
-0.32895296812057495,
-0.2943706214427948,
1.656821370124817,
0.0886165127158165,
-0.572130024433136,
0.016022849828004837,
-0.9148297905921936,
-0.209905743598938,
-1.0779117345809937,
0.20231640338897705,
-0.09923326224088669,
-0.16712836921215057,
-0.1455838680267334,
1.6554466485977173,
-0.8948386907577515,
-2.0234293937683105,
0.11941210180521011,
0.2864963710308075,
-0.23282557725906372,
0.2243698239326477,
1.6920591592788696,
0.5473124384880066,
1.4238855838775635,
1.2995887994766235,
0.915253221988678,
-0.6527360677719116,
-1.2476170063018799,
0.6657904982566833,
1.0366777181625366,
-1.352869987487793,
0.8531225919723511,
-0.05772101506590843,
-0.5229977965354919,
0.5777467489242554,
1.2999303340911865,
0.4764743149280548,
-1.9456743001937866,
0.8796243071556091,
-1.0466121435165405,
0.7997974157333374,
0.6567378044128418,
0.6350302696228027,
0.2660275995731354,
0.8911247849464417,
-1.235562801361084,
-1.1697279214859009,
-0.760753870010376,
-0.7488093972206116,
2.018808364868164,
-0.20905597507953644,
0.6347901225090027,
-0.22344841063022614,
-1.2952947616577148,
-0.12106344848871231,
0.6511560678482056,
0.3459177315235138,
-0.37168893218040466,
0.7681452035903931,
-0.6986016035079956,
-1.0484375953674316,
-1.525109887123108,
-0.35719016194343567,
-1.0954183340072632,
-0.8409464955329895,
1.1188147068023682,
0.7919401526451111,
0.25647974014282227,
1.894824743270874,
0.7183055877685547,
0.258539617061615,
-2.4437203407287598,
0.844420313835144,
0.4085065722465515,
-0.13393595814704895,
0.9314306378364563,
0.3869825005531311,
1.0625985860824585,
0.01904981955885887,
0.5382217764854431,
-2.374877691268921,
2.1903738975524902,
-0.22166168689727783,
0.6688701510429382,
-0.005186804570257664,
-0.1760694980621338,
1.0659552812576294,
0.6418696641921997,
0.49213868379592896,
-1.1228981018066406,
0.584804892539978,
-0.5494658946990967,
1.2753336429595947,
1.0675774812698364,
-0.8527571558952332,
-0.051426686346530914,
1.3581863641738892,
0.3301854133605957,
-0.5314280390739441,
-0.9450830221176147,
-0.9743315577507019,
0.8931750655174255,
1.7217029333114624,
-0.10658532381057739,
-0.01538261491805315,
0.7675034999847412,
0.7746050357818604,
-1.3633453845977783,
0.0868171826004982,
-0.7363263964653015,
-0.7641669511795044,
1.7431671619415283,
2.1377151012420654,
-0.16762635111808777,
-0.12013321369886398,
-0.7418760657310486,
-1.2674833536148071,
0.8302239179611206,
-0.14852993190288544,
0.15459497272968292,
0.6361611485481262,
-0.7751073837280273,
1.0675251483917236,
1.0603207349777222,
0.747060239315033,
0.24068410694599152,
0.208685502409935,
0.36574673652648926,
-0.24202995002269745,
-1.175158143043518,
-0.316668838262558,
-1.0509452819824219,
-2.6592228412628174,
0.36408284306526184,
-0.2135932743549347,
-1.3718891143798828,
-0.00916301179677248,
-1.068444848060608,
0.9414942264556885,
-0.566517174243927,
-1.0452936887741089,
-1.5147794485092163,
0.2795720398426056,
0.06134048476815224,
0.9615294933319092,
-1.5560575723648071,
-0.21939152479171753,
1.1915570497512817,
0.8745578527450562,
-0.6153393983840942,
1.0416154861450195,
0.33449527621269226,
1.0751947164535522,
0.8196992874145508,
-0.4833395779132843,
0.5968950986862183,
0.008883579634130001,
-1.316942572593689,
0.5585237741470337,
1.1433601379394531,
0.21117042005062103,
1.5058234930038452,
-0.481172114610672,
0.01979086548089981,
0.3488268554210663,
-0.6223403215408325,
-0.4098179340362549,
-0.5806086659431458,
0.609577476978302,
0.03656207025051117,
-0.9033235907554626,
-0.1107715293765068,
-0.04403461143374443,
-0.3255966305732727,
0.19006557762622833,
-1.4721750020980835,
-0.11168469488620758,
-0.33968108892440796,
-0.5704721212387085,
-1.2460225820541382,
-0.06051511690020561,
1.4336400032043457,
-0.8955585956573486,
-0.16400933265686035,
0.40855079889297485,
0.30240294337272644,
0.4924176335334778,
0.710416316986084,
-0.7622431516647339,
-0.34232640266418457,
-0.22104868292808533,
-0.33992305397987366,
0.289645254611969,
1.2953866720199585,
-0.12105327099561691,
-0.9850965738296509,
0.5932890176773071,
-0.29273706674575806,
0.07486826181411743,
1.8280748128890991,
0.09544162452220917,
-0.8026280999183655,
0.32181665301322937,
-0.6986579298973083,
1.982555866241455,
1.7433909177780151,
1.3236198425292969,
-0.18479810655117035,
-0.9514570236206055,
0.5961427688598633,
-0.37779268622398376,
-0.3550875782966614,
0.9252227544784546,
0.2947911322116852,
-0.23734647035598755,
-1.5153212547302246,
0.6624361872673035,
1.2899051904678345,
-0.9129298329353333,
-0.731997549533844,
0.029841378331184387,
-0.7764636874198914,
1.056974172592163,
0.6825543642044067,
0.3367267847061157,
0.3575996458530426,
1.663863182067871,
0.7565373778343201,
-0.4806693196296692,
0.5380176901817322,
0.5159711241722107,
-0.07335152477025986,
-2.187666177749634,
-1.105055809020996,
0.2530314028263092,
-0.5017623901367188,
-1.5451282262802124,
1.3842507600784302,
-1.072147011756897,
-0.9950253963470459,
0.5319123864173889,
0.01197656150907278,
1.3578959703445435,
0.2538418471813202,
1.521762490272522,
2.0222184658050537,
0.8633520007133484,
0.2941129505634308,
1.2510145902633667,
-0.16922393441200256,
-0.4051722586154938,
1.753936767578125,
-0.4390742778778076,
0.4591558277606964,
1.1201082468032837,
-0.3404683768749237,
-1.027348279953003,
-0.7522260546684265,
-1.2485402822494507,
-0.7470186352729797,
1.1354743242263794,
0.03174611181020737,
-1.080340027809143,
0.21950045228004456,
1.6040778160095215,
0.07819212973117828,
-0.26678863167762756,
0.6241464614868164,
0.5341216325759888,
-0.9077156782150269,
-0.09818152338266373,
-0.8736677169799805,
0.5397403240203857,
-0.1829221546649933,
-0.3162173330783844,
0.28740784525871277,
0.48566243052482605,
1.4278072118759155,
-0.13712112605571747,
0.14966705441474915,
1.1077477931976318,
-1.4714453220367432,
1.4290574789047241,
-0.780772864818573,
0.29234108328819275,
-2.3378474712371826,
1.333397626876831,
-0.7560499310493469,
2.0092618465423584,
-2.68290638923645,
0.5947133898735046,
-0.6653397679328918,
-0.49545004963874817,
0.2931648790836334,
-0.36907827854156494,
0.17161716520786285,
-0.036618608981370926,
-1.1581841707229614,
-0.018261054530739784,
-0.6764445900917053,
0.6357938647270203,
1.1383684873580933,
1.4243524074554443,
-1.0985175371170044,
-0.31130486726760864,
-1.6747170686721802,
-0.19837456941604614,
-0.665216326713562,
0.21557992696762085,
-2.025118589401245,
-0.1402670294046402,
-1.9882651567459106,
-2.3787989616394043,
-1.3930752277374268,
-0.8067795038223267,
1.2297288179397583,
0.06829382479190826,
-0.9661176204681396,
1.2934590578079224,
-0.3962615132331848,
-1.8310800790786743,
1.1039860248565674,
-2.1388890743255615
] |
https://github.com/huggingface/datasets/issues/5111 | map and filter not working properly in multiprocessing with the new release 2.6.0 | I can reproduce the issue on my mac too
```
- `datasets` version: 2.6.0
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
```
But not on Colab with python 3.7, maybe related to python version? (didn't manage to install python 3.9)
```
- `datasets` version: 2.6.0
- Platform: Linux-5.10.133+-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.7.14
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
``` | ## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2 | 477 | 69 | map and filter not working properly in multiprocessing with the new release 2.6.0
## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2
I can reproduce the issue on my mac too
```
- `datasets` version: 2.6.0
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
```
But not on Colab with python 3.7, maybe related to python version? (didn't manage to install python 3.9)
```
- `datasets` version: 2.6.0
- Platform: Linux-5.10.133+-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.7.14
- PyArrow version: 9.0.0
- Pandas version: 1.3.5
``` | [
-1.352843999862671,
-0.9489383101463318,
-0.7380266189575195,
1.3653239011764526,
-0.2156757116317749,
-1.1626625061035156,
0.19859008491039276,
-1.193071961402893,
1.6733355522155762,
-0.7513960599899292,
0.31026315689086914,
-1.72084379196167,
0.007246973924338818,
-0.7082626223564148,
-0.7887933254241943,
-0.8437585234642029,
-0.4116605222225189,
-0.7523932456970215,
1.1017882823944092,
2.4730443954467773,
1.2084859609603882,
-1.4340589046478271,
2.697086811065674,
0.7607104182243347,
-0.20602354407310486,
-1.000741720199585,
0.5457071661949158,
-0.05817698687314987,
-1.2278823852539062,
-0.4593156576156616,
-1.0296601057052612,
0.03622161224484444,
-0.5640300512313843,
-0.4410548508167267,
-0.08515094965696335,
0.36792615056037903,
-0.38905006647109985,
-0.3640885353088379,
-0.5134558081626892,
-0.8171752095222473,
0.5125590562820435,
-0.3884046971797943,
1.0048593282699585,
-0.34680455923080444,
1.793594479560852,
-0.5570852160453796,
0.5095599889755249,
0.6792799830436707,
1.336542010307312,
0.24689161777496338,
0.006785108707845211,
0.4661327600479126,
0.33547261357307434,
-0.039084721356630325,
0.5615963935852051,
1.2524054050445557,
0.6978742480278015,
0.47188377380371094,
0.8196986317634583,
-2.156207799911499,
1.2528531551361084,
-1.1066406965255737,
0.33222082257270813,
1.4115351438522339,
-0.8493854999542236,
0.33210253715515137,
-1.7599397897720337,
-0.04425366595387459,
0.6521478891372681,
-2.3162789344787598,
0.2995977997779846,
-1.27919340133667,
-0.5048683881759644,
1.078323245048523,
0.45950576663017273,
-1.2588427066802979,
0.10946755856275558,
-0.37329718470573425,
0.9714365005493164,
0.35684603452682495,
1.1564955711364746,
-1.6376603841781616,
-0.04867835342884064,
-0.3635140359401703,
0.05492449924349785,
-1.3257859945297241,
-1.4307327270507812,
0.5169233083724976,
0.5634656548500061,
0.6576090455055237,
-0.1427420675754547,
1.0496206283569336,
-1.0976380109786987,
0.7090063095092773,
-0.9661166071891785,
-1.6119598150253296,
-1.4128257036209106,
-2.291623115539551,
-2.273634433746338,
0.8197525143623352,
-0.41872870922088623,
-0.5719591379165649,
2.021575927734375,
-0.9523361921310425,
-1.7182625532150269,
1.1999105215072632,
0.36988332867622375,
0.0004202015697956085,
2.4817044734954834,
0.18493850529193878,
-0.8106722831726074,
0.6008914113044739,
-0.7502665519714355,
0.8027536869049072,
-0.34925419092178345,
1.327896237373352,
0.4561380445957184,
-1.0612645149230957,
1.628460168838501,
-0.39423635601997375,
0.5187291502952576,
-0.6074494123458862,
-0.5249357223510742,
-0.8257798552513123,
0.3605669438838959,
1.8437187671661377,
-0.2546614408493042,
1.5616862773895264,
-0.36114975810050964,
-1.57076096534729,
-1.644235610961914,
0.8591213822364807,
0.5475424528121948,
-0.7222733497619629,
0.12655296921730042,
-0.4101954400539398,
0.15647009015083313,
-0.09552298486232758,
1.159052848815918,
1.2761552333831787,
0.6186755299568176,
-0.32532963156700134,
-0.8480733633041382,
0.20687732100486755,
-0.09794370085000992,
-0.8096684813499451,
-1.7095060348510742,
-0.3229031264781952,
0.08813325315713882,
0.6513823866844177,
-1.200533390045166,
1.7762179374694824,
0.8353346586227417,
1.8862431049346924,
1.067116379737854,
-0.33585047721862793,
1.4812729358673096,
0.14742086827754974,
1.7066727876663208,
-0.5229436159133911,
0.6215577721595764,
-0.3223905563354492,
-1.1065716743469238,
0.8702681064605713,
-0.3996455669403076,
-2.044123888015747,
-0.7283399701118469,
-0.7253296971321106,
-0.12067362666130066,
-0.8233163356781006,
0.9613419771194458,
-0.3409569561481476,
-1.42781662940979,
0.35036900639533997,
-0.658052384853363,
0.11745937913656235,
-1.2482538223266602,
0.2546139061450958,
0.5985851287841797,
-0.6337411999702454,
-0.001809737179428339,
-0.15700726211071014,
-1.2436459064483643,
-0.3544852137565613,
0.17339321970939636,
1.8323628902435303,
-0.7161698937416077,
0.8825073838233948,
1.132197380065918,
-0.6953890919685364,
0.024699818342924118,
0.3942883312702179,
-0.2893776595592499,
0.7942770719528198,
-0.9977194666862488,
-0.4950154423713684,
1.1875135898590088,
-0.1709742695093155,
-0.4858299791812897,
1.4413151741027832,
0.6624630689620972,
-1.0681079626083374,
-0.1626148223876953,
-0.04255552589893341,
-0.8441759347915649,
0.0005662087351083755,
-1.535001277923584,
-0.13696789741516113,
0.45653510093688965,
-1.5621756315231323,
-0.5100254416465759,
-0.13009627163410187,
1.3108726739883423,
-0.25033432245254517,
1.423515796661377,
-0.38030102849006653,
-0.09034518897533417,
-0.2796098589897156,
-0.4299139082431793,
0.01708785444498062,
-0.0839274525642395,
-0.6643987894058228,
0.23706480860710144,
-0.7502977848052979,
0.37443214654922485,
1.38765549659729,
0.39412400126457214,
-0.003828566987067461,
0.4832402467727661,
1.0732358694076538,
0.3888905644416809,
-0.03001384437084198,
-0.8360363841056824,
-1.5617207288742065,
1.983630895614624,
-1.4796925783157349,
1.9793988466262817,
0.775019109249115,
-0.06505832076072693,
-1.695220947265625,
-1.7991671562194824,
1.4485450983047485,
1.1590040922164917,
2.3528950214385986,
0.5508567690849304,
0.41987383365631104,
-0.8208760619163513,
-0.7443094253540039,
0.31133773922920227,
-1.0313268899917603,
-0.7301105260848999,
0.07630030810832977,
2.4081532955169678,
1.7988923788070679,
-0.42698219418525696,
-0.1863911747932434,
-0.9899306893348694,
1.4028830528259277,
-0.2349306344985962,
0.26231423020362854,
1.9904849529266357,
-0.28220874071121216,
-1.142384648323059,
1.3960716724395752,
-2.3221797943115234,
0.0447310209274292,
1.9977569580078125,
0.30103397369384766,
0.09090276062488556,
-1.3771135807037354,
-0.49492645263671875,
-0.331441730260849,
-0.5523610711097717,
-1.2608861923217773,
0.5357611179351807,
-0.3041812777519226,
-0.8175384402275085,
-1.2733650207519531,
0.22175228595733643,
-1.2209690809249878,
-1.565248727798462,
0.3227149248123169,
1.8107928037643433,
2.123690128326416,
-0.8011602759361267,
1.5874642133712769,
-0.2909051179885864,
0.24637815356254578,
1.1586476564407349,
1.2416718006134033,
3.110504627227783,
1.8755992650985718,
-1.3669167757034302,
0.655765950679779,
-0.1908571571111679,
-0.5018966197967529,
1.1857972145080566,
-1.2210932970046997,
1.3433812856674194,
-0.061903029680252075,
-1.234751582145691,
-1.1753593683242798,
0.8742913603782654,
0.49568235874176025,
0.07559602707624435,
-0.5248870849609375,
1.179282546043396,
0.014901830814778805,
1.2154346704483032,
0.4900110363960266,
-0.28928473591804504,
0.5582860112190247,
-0.39514753222465515,
-0.5557770133018494,
1.553432583808899,
0.03435596451163292,
-1.4839650392532349,
-2.1559338569641113,
-0.1260356605052948,
-0.8027786612510681,
0.17490032315254211,
-0.7238632440567017,
-1.016738772392273,
1.6374210119247437,
0.3465195596218109,
-1.2611714601516724,
-0.2574252188205719,
-0.4282146990299225,
-0.6071368455886841,
2.6187610626220703,
-1.3952144384384155,
-0.2371700555086136,
-1.0277968645095825,
-0.6649593710899353,
1.6580921411514282,
-1.1364266872406006,
-0.21336692571640015,
-0.951311469078064,
-0.6637430787086487,
-1.292916178703308,
-0.5564977526664734,
0.0077466173097491264,
-0.9504511952400208,
0.742119550704956,
0.2722775936126709,
-1.0542643070220947,
-0.3482115864753723,
-0.8063483238220215,
0.9140456914901733,
-0.15540120005607605,
0.18437643349170685,
1.8741427659988403,
0.2666875123977661,
-0.2889736592769623,
0.731098473072052,
1.216781497001648,
0.5726482272148132,
-0.6049782633781433,
0.10222222656011581,
-0.7135103344917297,
0.45156368613243103,
-1.3268308639526367,
0.23948723077774048,
-2.8180761337280273,
0.6419659852981567,
-0.017636079341173172,
-0.007279344368726015,
-0.004086786415427923,
-1.253089189529419,
1.1025699377059937,
2.6280109882354736,
-1.1376124620437622,
0.4524666666984558,
0.31024977564811707,
1.1842352151870728,
-1.6642428636550903,
0.13249927759170532,
-0.5423892140388489,
2.1645026206970215,
0.16787037253379822,
1.1557540893554688,
-0.4540040194988251,
-2.3912434577941895,
0.6820730566978455,
-1.1910542249679565,
-1.1874547004699707,
0.8611146807670593,
-0.9098837375640869,
0.19467948377132416,
-1.492958426475525,
-0.23916681110858917,
-0.8900787234306335,
-1.0601303577423096,
0.7021640539169312,
0.16460129618644714,
0.4878041744232178,
-0.6335223317146301,
0.3417249321937561,
-2.232370615005493,
-1.3560826778411865,
-0.14507611095905304,
-0.9469844102859497,
0.5473050475120544,
-0.3101058602333069,
0.6931146383285522,
-0.16004320979118347,
-0.05999945104122162,
0.39408475160598755,
1.4535225629806519,
3.360382318496704,
0.12939833104610443,
0.36583980917930603,
-0.1527254432439804,
-0.8759079575538635,
1.3659929037094116,
0.9409795999526978,
-0.1779569536447525,
-0.6304442882537842,
-1.1271629333496094,
1.348219871520996,
1.9111262559890747,
1.0133330821990967,
0.07795850932598114,
-0.8557611703872681,
-0.710820734500885,
-0.0030904491432011127,
0.1625552922487259,
0.46008771657943726,
0.895862340927124,
0.05518816038966179,
0.06036972627043724,
1.4112592935562134,
1.164651870727539,
-0.3956789970397949,
0.35540127754211426,
-0.8529433012008667,
-0.4635494351387024,
0.5882209539413452,
0.26365765929222107,
-0.04530327394604683,
0.4310956299304962,
-0.891121506690979,
-0.16506318747997284,
-0.32724541425704956,
-0.8987978100776672,
-0.6869591474533081,
-0.32895296812057495,
-0.2943706214427948,
1.656821370124817,
0.0886165127158165,
-0.572130024433136,
0.016022849828004837,
-0.9148297905921936,
-0.209905743598938,
-1.0779117345809937,
0.20231640338897705,
-0.09923326224088669,
-0.16712836921215057,
-0.1455838680267334,
1.6554466485977173,
-0.8948386907577515,
-2.0234293937683105,
0.11941210180521011,
0.2864963710308075,
-0.23282557725906372,
0.2243698239326477,
1.6920591592788696,
0.5473124384880066,
1.4238855838775635,
1.2995887994766235,
0.915253221988678,
-0.6527360677719116,
-1.2476170063018799,
0.6657904982566833,
1.0366777181625366,
-1.352869987487793,
0.8531225919723511,
-0.05772101506590843,
-0.5229977965354919,
0.5777467489242554,
1.2999303340911865,
0.4764743149280548,
-1.9456743001937866,
0.8796243071556091,
-1.0466121435165405,
0.7997974157333374,
0.6567378044128418,
0.6350302696228027,
0.2660275995731354,
0.8911247849464417,
-1.235562801361084,
-1.1697279214859009,
-0.760753870010376,
-0.7488093972206116,
2.018808364868164,
-0.20905597507953644,
0.6347901225090027,
-0.22344841063022614,
-1.2952947616577148,
-0.12106344848871231,
0.6511560678482056,
0.3459177315235138,
-0.37168893218040466,
0.7681452035903931,
-0.6986016035079956,
-1.0484375953674316,
-1.525109887123108,
-0.35719016194343567,
-1.0954183340072632,
-0.8409464955329895,
1.1188147068023682,
0.7919401526451111,
0.25647974014282227,
1.894824743270874,
0.7183055877685547,
0.258539617061615,
-2.4437203407287598,
0.844420313835144,
0.4085065722465515,
-0.13393595814704895,
0.9314306378364563,
0.3869825005531311,
1.0625985860824585,
0.01904981955885887,
0.5382217764854431,
-2.374877691268921,
2.1903738975524902,
-0.22166168689727783,
0.6688701510429382,
-0.005186804570257664,
-0.1760694980621338,
1.0659552812576294,
0.6418696641921997,
0.49213868379592896,
-1.1228981018066406,
0.584804892539978,
-0.5494658946990967,
1.2753336429595947,
1.0675774812698364,
-0.8527571558952332,
-0.051426686346530914,
1.3581863641738892,
0.3301854133605957,
-0.5314280390739441,
-0.9450830221176147,
-0.9743315577507019,
0.8931750655174255,
1.7217029333114624,
-0.10658532381057739,
-0.01538261491805315,
0.7675034999847412,
0.7746050357818604,
-1.3633453845977783,
0.0868171826004982,
-0.7363263964653015,
-0.7641669511795044,
1.7431671619415283,
2.1377151012420654,
-0.16762635111808777,
-0.12013321369886398,
-0.7418760657310486,
-1.2674833536148071,
0.8302239179611206,
-0.14852993190288544,
0.15459497272968292,
0.6361611485481262,
-0.7751073837280273,
1.0675251483917236,
1.0603207349777222,
0.747060239315033,
0.24068410694599152,
0.208685502409935,
0.36574673652648926,
-0.24202995002269745,
-1.175158143043518,
-0.316668838262558,
-1.0509452819824219,
-2.6592228412628174,
0.36408284306526184,
-0.2135932743549347,
-1.3718891143798828,
-0.00916301179677248,
-1.068444848060608,
0.9414942264556885,
-0.566517174243927,
-1.0452936887741089,
-1.5147794485092163,
0.2795720398426056,
0.06134048476815224,
0.9615294933319092,
-1.5560575723648071,
-0.21939152479171753,
1.1915570497512817,
0.8745578527450562,
-0.6153393983840942,
1.0416154861450195,
0.33449527621269226,
1.0751947164535522,
0.8196992874145508,
-0.4833395779132843,
0.5968950986862183,
0.008883579634130001,
-1.316942572593689,
0.5585237741470337,
1.1433601379394531,
0.21117042005062103,
1.5058234930038452,
-0.481172114610672,
0.01979086548089981,
0.3488268554210663,
-0.6223403215408325,
-0.4098179340362549,
-0.5806086659431458,
0.609577476978302,
0.03656207025051117,
-0.9033235907554626,
-0.1107715293765068,
-0.04403461143374443,
-0.3255966305732727,
0.19006557762622833,
-1.4721750020980835,
-0.11168469488620758,
-0.33968108892440796,
-0.5704721212387085,
-1.2460225820541382,
-0.06051511690020561,
1.4336400032043457,
-0.8955585956573486,
-0.16400933265686035,
0.40855079889297485,
0.30240294337272644,
0.4924176335334778,
0.710416316986084,
-0.7622431516647339,
-0.34232640266418457,
-0.22104868292808533,
-0.33992305397987366,
0.289645254611969,
1.2953866720199585,
-0.12105327099561691,
-0.9850965738296509,
0.5932890176773071,
-0.29273706674575806,
0.07486826181411743,
1.8280748128890991,
0.09544162452220917,
-0.8026280999183655,
0.32181665301322937,
-0.6986579298973083,
1.982555866241455,
1.7433909177780151,
1.3236198425292969,
-0.18479810655117035,
-0.9514570236206055,
0.5961427688598633,
-0.37779268622398376,
-0.3550875782966614,
0.9252227544784546,
0.2947911322116852,
-0.23734647035598755,
-1.5153212547302246,
0.6624361872673035,
1.2899051904678345,
-0.9129298329353333,
-0.731997549533844,
0.029841378331184387,
-0.7764636874198914,
1.056974172592163,
0.6825543642044067,
0.3367267847061157,
0.3575996458530426,
1.663863182067871,
0.7565373778343201,
-0.4806693196296692,
0.5380176901817322,
0.5159711241722107,
-0.07335152477025986,
-2.187666177749634,
-1.105055809020996,
0.2530314028263092,
-0.5017623901367188,
-1.5451282262802124,
1.3842507600784302,
-1.072147011756897,
-0.9950253963470459,
0.5319123864173889,
0.01197656150907278,
1.3578959703445435,
0.2538418471813202,
1.521762490272522,
2.0222184658050537,
0.8633520007133484,
0.2941129505634308,
1.2510145902633667,
-0.16922393441200256,
-0.4051722586154938,
1.753936767578125,
-0.4390742778778076,
0.4591558277606964,
1.1201082468032837,
-0.3404683768749237,
-1.027348279953003,
-0.7522260546684265,
-1.2485402822494507,
-0.7470186352729797,
1.1354743242263794,
0.03174611181020737,
-1.080340027809143,
0.21950045228004456,
1.6040778160095215,
0.07819212973117828,
-0.26678863167762756,
0.6241464614868164,
0.5341216325759888,
-0.9077156782150269,
-0.09818152338266373,
-0.8736677169799805,
0.5397403240203857,
-0.1829221546649933,
-0.3162173330783844,
0.28740784525871277,
0.48566243052482605,
1.4278072118759155,
-0.13712112605571747,
0.14966705441474915,
1.1077477931976318,
-1.4714453220367432,
1.4290574789047241,
-0.780772864818573,
0.29234108328819275,
-2.3378474712371826,
1.333397626876831,
-0.7560499310493469,
2.0092618465423584,
-2.68290638923645,
0.5947133898735046,
-0.6653397679328918,
-0.49545004963874817,
0.2931648790836334,
-0.36907827854156494,
0.17161716520786285,
-0.036618608981370926,
-1.1581841707229614,
-0.018261054530739784,
-0.6764445900917053,
0.6357938647270203,
1.1383684873580933,
1.4243524074554443,
-1.0985175371170044,
-0.31130486726760864,
-1.6747170686721802,
-0.19837456941604614,
-0.665216326713562,
0.21557992696762085,
-2.025118589401245,
-0.1402670294046402,
-1.9882651567459106,
-2.3787989616394043,
-1.3930752277374268,
-0.8067795038223267,
1.2297288179397583,
0.06829382479190826,
-0.9661176204681396,
1.2934590578079224,
-0.3962615132331848,
-1.8310800790786743,
1.1039860248565674,
-2.1388890743255615
] |
https://github.com/huggingface/datasets/issues/5111 | map and filter not working properly in multiprocessing with the new release 2.6.0 | I think there are 2 different issues here:
- the one reported by @loubnabnl is related to multiprocessing in map and then filter; we should reproduce it first: I have tried with Python version 3.9.7 and I can't reproduce it either; maybe it is related to the version of PyArrow? To be checked.
- the issue reported by @PartiallyTyped is related just to "filter" (without multiprocessing) and I can reproduce it. | ## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2 | 477 | 71 | map and filter not working properly in multiprocessing with the new release 2.6.0
## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2
I think there are 2 different issues here:
- the one reported by @loubnabnl is related to multiprocessing in map and then filter; we should reproduce it first: I have tried with Python version 3.9.7 and I can't reproduce it either; maybe it is related to the version of PyArrow? To be checked.
- the issue reported by @PartiallyTyped is related just to "filter" (without multiprocessing) and I can reproduce it. | [
-1.352843999862671,
-0.9489383101463318,
-0.7380266189575195,
1.3653239011764526,
-0.2156757116317749,
-1.1626625061035156,
0.19859008491039276,
-1.193071961402893,
1.6733355522155762,
-0.7513960599899292,
0.31026315689086914,
-1.72084379196167,
0.007246973924338818,
-0.7082626223564148,
-0.7887933254241943,
-0.8437585234642029,
-0.4116605222225189,
-0.7523932456970215,
1.1017882823944092,
2.4730443954467773,
1.2084859609603882,
-1.4340589046478271,
2.697086811065674,
0.7607104182243347,
-0.20602354407310486,
-1.000741720199585,
0.5457071661949158,
-0.05817698687314987,
-1.2278823852539062,
-0.4593156576156616,
-1.0296601057052612,
0.03622161224484444,
-0.5640300512313843,
-0.4410548508167267,
-0.08515094965696335,
0.36792615056037903,
-0.38905006647109985,
-0.3640885353088379,
-0.5134558081626892,
-0.8171752095222473,
0.5125590562820435,
-0.3884046971797943,
1.0048593282699585,
-0.34680455923080444,
1.793594479560852,
-0.5570852160453796,
0.5095599889755249,
0.6792799830436707,
1.336542010307312,
0.24689161777496338,
0.006785108707845211,
0.4661327600479126,
0.33547261357307434,
-0.039084721356630325,
0.5615963935852051,
1.2524054050445557,
0.6978742480278015,
0.47188377380371094,
0.8196986317634583,
-2.156207799911499,
1.2528531551361084,
-1.1066406965255737,
0.33222082257270813,
1.4115351438522339,
-0.8493854999542236,
0.33210253715515137,
-1.7599397897720337,
-0.04425366595387459,
0.6521478891372681,
-2.3162789344787598,
0.2995977997779846,
-1.27919340133667,
-0.5048683881759644,
1.078323245048523,
0.45950576663017273,
-1.2588427066802979,
0.10946755856275558,
-0.37329718470573425,
0.9714365005493164,
0.35684603452682495,
1.1564955711364746,
-1.6376603841781616,
-0.04867835342884064,
-0.3635140359401703,
0.05492449924349785,
-1.3257859945297241,
-1.4307327270507812,
0.5169233083724976,
0.5634656548500061,
0.6576090455055237,
-0.1427420675754547,
1.0496206283569336,
-1.0976380109786987,
0.7090063095092773,
-0.9661166071891785,
-1.6119598150253296,
-1.4128257036209106,
-2.291623115539551,
-2.273634433746338,
0.8197525143623352,
-0.41872870922088623,
-0.5719591379165649,
2.021575927734375,
-0.9523361921310425,
-1.7182625532150269,
1.1999105215072632,
0.36988332867622375,
0.0004202015697956085,
2.4817044734954834,
0.18493850529193878,
-0.8106722831726074,
0.6008914113044739,
-0.7502665519714355,
0.8027536869049072,
-0.34925419092178345,
1.327896237373352,
0.4561380445957184,
-1.0612645149230957,
1.628460168838501,
-0.39423635601997375,
0.5187291502952576,
-0.6074494123458862,
-0.5249357223510742,
-0.8257798552513123,
0.3605669438838959,
1.8437187671661377,
-0.2546614408493042,
1.5616862773895264,
-0.36114975810050964,
-1.57076096534729,
-1.644235610961914,
0.8591213822364807,
0.5475424528121948,
-0.7222733497619629,
0.12655296921730042,
-0.4101954400539398,
0.15647009015083313,
-0.09552298486232758,
1.159052848815918,
1.2761552333831787,
0.6186755299568176,
-0.32532963156700134,
-0.8480733633041382,
0.20687732100486755,
-0.09794370085000992,
-0.8096684813499451,
-1.7095060348510742,
-0.3229031264781952,
0.08813325315713882,
0.6513823866844177,
-1.200533390045166,
1.7762179374694824,
0.8353346586227417,
1.8862431049346924,
1.067116379737854,
-0.33585047721862793,
1.4812729358673096,
0.14742086827754974,
1.7066727876663208,
-0.5229436159133911,
0.6215577721595764,
-0.3223905563354492,
-1.1065716743469238,
0.8702681064605713,
-0.3996455669403076,
-2.044123888015747,
-0.7283399701118469,
-0.7253296971321106,
-0.12067362666130066,
-0.8233163356781006,
0.9613419771194458,
-0.3409569561481476,
-1.42781662940979,
0.35036900639533997,
-0.658052384853363,
0.11745937913656235,
-1.2482538223266602,
0.2546139061450958,
0.5985851287841797,
-0.6337411999702454,
-0.001809737179428339,
-0.15700726211071014,
-1.2436459064483643,
-0.3544852137565613,
0.17339321970939636,
1.8323628902435303,
-0.7161698937416077,
0.8825073838233948,
1.132197380065918,
-0.6953890919685364,
0.024699818342924118,
0.3942883312702179,
-0.2893776595592499,
0.7942770719528198,
-0.9977194666862488,
-0.4950154423713684,
1.1875135898590088,
-0.1709742695093155,
-0.4858299791812897,
1.4413151741027832,
0.6624630689620972,
-1.0681079626083374,
-0.1626148223876953,
-0.04255552589893341,
-0.8441759347915649,
0.0005662087351083755,
-1.535001277923584,
-0.13696789741516113,
0.45653510093688965,
-1.5621756315231323,
-0.5100254416465759,
-0.13009627163410187,
1.3108726739883423,
-0.25033432245254517,
1.423515796661377,
-0.38030102849006653,
-0.09034518897533417,
-0.2796098589897156,
-0.4299139082431793,
0.01708785444498062,
-0.0839274525642395,
-0.6643987894058228,
0.23706480860710144,
-0.7502977848052979,
0.37443214654922485,
1.38765549659729,
0.39412400126457214,
-0.003828566987067461,
0.4832402467727661,
1.0732358694076538,
0.3888905644416809,
-0.03001384437084198,
-0.8360363841056824,
-1.5617207288742065,
1.983630895614624,
-1.4796925783157349,
1.9793988466262817,
0.775019109249115,
-0.06505832076072693,
-1.695220947265625,
-1.7991671562194824,
1.4485450983047485,
1.1590040922164917,
2.3528950214385986,
0.5508567690849304,
0.41987383365631104,
-0.8208760619163513,
-0.7443094253540039,
0.31133773922920227,
-1.0313268899917603,
-0.7301105260848999,
0.07630030810832977,
2.4081532955169678,
1.7988923788070679,
-0.42698219418525696,
-0.1863911747932434,
-0.9899306893348694,
1.4028830528259277,
-0.2349306344985962,
0.26231423020362854,
1.9904849529266357,
-0.28220874071121216,
-1.142384648323059,
1.3960716724395752,
-2.3221797943115234,
0.0447310209274292,
1.9977569580078125,
0.30103397369384766,
0.09090276062488556,
-1.3771135807037354,
-0.49492645263671875,
-0.331441730260849,
-0.5523610711097717,
-1.2608861923217773,
0.5357611179351807,
-0.3041812777519226,
-0.8175384402275085,
-1.2733650207519531,
0.22175228595733643,
-1.2209690809249878,
-1.565248727798462,
0.3227149248123169,
1.8107928037643433,
2.123690128326416,
-0.8011602759361267,
1.5874642133712769,
-0.2909051179885864,
0.24637815356254578,
1.1586476564407349,
1.2416718006134033,
3.110504627227783,
1.8755992650985718,
-1.3669167757034302,
0.655765950679779,
-0.1908571571111679,
-0.5018966197967529,
1.1857972145080566,
-1.2210932970046997,
1.3433812856674194,
-0.061903029680252075,
-1.234751582145691,
-1.1753593683242798,
0.8742913603782654,
0.49568235874176025,
0.07559602707624435,
-0.5248870849609375,
1.179282546043396,
0.014901830814778805,
1.2154346704483032,
0.4900110363960266,
-0.28928473591804504,
0.5582860112190247,
-0.39514753222465515,
-0.5557770133018494,
1.553432583808899,
0.03435596451163292,
-1.4839650392532349,
-2.1559338569641113,
-0.1260356605052948,
-0.8027786612510681,
0.17490032315254211,
-0.7238632440567017,
-1.016738772392273,
1.6374210119247437,
0.3465195596218109,
-1.2611714601516724,
-0.2574252188205719,
-0.4282146990299225,
-0.6071368455886841,
2.6187610626220703,
-1.3952144384384155,
-0.2371700555086136,
-1.0277968645095825,
-0.6649593710899353,
1.6580921411514282,
-1.1364266872406006,
-0.21336692571640015,
-0.951311469078064,
-0.6637430787086487,
-1.292916178703308,
-0.5564977526664734,
0.0077466173097491264,
-0.9504511952400208,
0.742119550704956,
0.2722775936126709,
-1.0542643070220947,
-0.3482115864753723,
-0.8063483238220215,
0.9140456914901733,
-0.15540120005607605,
0.18437643349170685,
1.8741427659988403,
0.2666875123977661,
-0.2889736592769623,
0.731098473072052,
1.216781497001648,
0.5726482272148132,
-0.6049782633781433,
0.10222222656011581,
-0.7135103344917297,
0.45156368613243103,
-1.3268308639526367,
0.23948723077774048,
-2.8180761337280273,
0.6419659852981567,
-0.017636079341173172,
-0.007279344368726015,
-0.004086786415427923,
-1.253089189529419,
1.1025699377059937,
2.6280109882354736,
-1.1376124620437622,
0.4524666666984558,
0.31024977564811707,
1.1842352151870728,
-1.6642428636550903,
0.13249927759170532,
-0.5423892140388489,
2.1645026206970215,
0.16787037253379822,
1.1557540893554688,
-0.4540040194988251,
-2.3912434577941895,
0.6820730566978455,
-1.1910542249679565,
-1.1874547004699707,
0.8611146807670593,
-0.9098837375640869,
0.19467948377132416,
-1.492958426475525,
-0.23916681110858917,
-0.8900787234306335,
-1.0601303577423096,
0.7021640539169312,
0.16460129618644714,
0.4878041744232178,
-0.6335223317146301,
0.3417249321937561,
-2.232370615005493,
-1.3560826778411865,
-0.14507611095905304,
-0.9469844102859497,
0.5473050475120544,
-0.3101058602333069,
0.6931146383285522,
-0.16004320979118347,
-0.05999945104122162,
0.39408475160598755,
1.4535225629806519,
3.360382318496704,
0.12939833104610443,
0.36583980917930603,
-0.1527254432439804,
-0.8759079575538635,
1.3659929037094116,
0.9409795999526978,
-0.1779569536447525,
-0.6304442882537842,
-1.1271629333496094,
1.348219871520996,
1.9111262559890747,
1.0133330821990967,
0.07795850932598114,
-0.8557611703872681,
-0.710820734500885,
-0.0030904491432011127,
0.1625552922487259,
0.46008771657943726,
0.895862340927124,
0.05518816038966179,
0.06036972627043724,
1.4112592935562134,
1.164651870727539,
-0.3956789970397949,
0.35540127754211426,
-0.8529433012008667,
-0.4635494351387024,
0.5882209539413452,
0.26365765929222107,
-0.04530327394604683,
0.4310956299304962,
-0.891121506690979,
-0.16506318747997284,
-0.32724541425704956,
-0.8987978100776672,
-0.6869591474533081,
-0.32895296812057495,
-0.2943706214427948,
1.656821370124817,
0.0886165127158165,
-0.572130024433136,
0.016022849828004837,
-0.9148297905921936,
-0.209905743598938,
-1.0779117345809937,
0.20231640338897705,
-0.09923326224088669,
-0.16712836921215057,
-0.1455838680267334,
1.6554466485977173,
-0.8948386907577515,
-2.0234293937683105,
0.11941210180521011,
0.2864963710308075,
-0.23282557725906372,
0.2243698239326477,
1.6920591592788696,
0.5473124384880066,
1.4238855838775635,
1.2995887994766235,
0.915253221988678,
-0.6527360677719116,
-1.2476170063018799,
0.6657904982566833,
1.0366777181625366,
-1.352869987487793,
0.8531225919723511,
-0.05772101506590843,
-0.5229977965354919,
0.5777467489242554,
1.2999303340911865,
0.4764743149280548,
-1.9456743001937866,
0.8796243071556091,
-1.0466121435165405,
0.7997974157333374,
0.6567378044128418,
0.6350302696228027,
0.2660275995731354,
0.8911247849464417,
-1.235562801361084,
-1.1697279214859009,
-0.760753870010376,
-0.7488093972206116,
2.018808364868164,
-0.20905597507953644,
0.6347901225090027,
-0.22344841063022614,
-1.2952947616577148,
-0.12106344848871231,
0.6511560678482056,
0.3459177315235138,
-0.37168893218040466,
0.7681452035903931,
-0.6986016035079956,
-1.0484375953674316,
-1.525109887123108,
-0.35719016194343567,
-1.0954183340072632,
-0.8409464955329895,
1.1188147068023682,
0.7919401526451111,
0.25647974014282227,
1.894824743270874,
0.7183055877685547,
0.258539617061615,
-2.4437203407287598,
0.844420313835144,
0.4085065722465515,
-0.13393595814704895,
0.9314306378364563,
0.3869825005531311,
1.0625985860824585,
0.01904981955885887,
0.5382217764854431,
-2.374877691268921,
2.1903738975524902,
-0.22166168689727783,
0.6688701510429382,
-0.005186804570257664,
-0.1760694980621338,
1.0659552812576294,
0.6418696641921997,
0.49213868379592896,
-1.1228981018066406,
0.584804892539978,
-0.5494658946990967,
1.2753336429595947,
1.0675774812698364,
-0.8527571558952332,
-0.051426686346530914,
1.3581863641738892,
0.3301854133605957,
-0.5314280390739441,
-0.9450830221176147,
-0.9743315577507019,
0.8931750655174255,
1.7217029333114624,
-0.10658532381057739,
-0.01538261491805315,
0.7675034999847412,
0.7746050357818604,
-1.3633453845977783,
0.0868171826004982,
-0.7363263964653015,
-0.7641669511795044,
1.7431671619415283,
2.1377151012420654,
-0.16762635111808777,
-0.12013321369886398,
-0.7418760657310486,
-1.2674833536148071,
0.8302239179611206,
-0.14852993190288544,
0.15459497272968292,
0.6361611485481262,
-0.7751073837280273,
1.0675251483917236,
1.0603207349777222,
0.747060239315033,
0.24068410694599152,
0.208685502409935,
0.36574673652648926,
-0.24202995002269745,
-1.175158143043518,
-0.316668838262558,
-1.0509452819824219,
-2.6592228412628174,
0.36408284306526184,
-0.2135932743549347,
-1.3718891143798828,
-0.00916301179677248,
-1.068444848060608,
0.9414942264556885,
-0.566517174243927,
-1.0452936887741089,
-1.5147794485092163,
0.2795720398426056,
0.06134048476815224,
0.9615294933319092,
-1.5560575723648071,
-0.21939152479171753,
1.1915570497512817,
0.8745578527450562,
-0.6153393983840942,
1.0416154861450195,
0.33449527621269226,
1.0751947164535522,
0.8196992874145508,
-0.4833395779132843,
0.5968950986862183,
0.008883579634130001,
-1.316942572593689,
0.5585237741470337,
1.1433601379394531,
0.21117042005062103,
1.5058234930038452,
-0.481172114610672,
0.01979086548089981,
0.3488268554210663,
-0.6223403215408325,
-0.4098179340362549,
-0.5806086659431458,
0.609577476978302,
0.03656207025051117,
-0.9033235907554626,
-0.1107715293765068,
-0.04403461143374443,
-0.3255966305732727,
0.19006557762622833,
-1.4721750020980835,
-0.11168469488620758,
-0.33968108892440796,
-0.5704721212387085,
-1.2460225820541382,
-0.06051511690020561,
1.4336400032043457,
-0.8955585956573486,
-0.16400933265686035,
0.40855079889297485,
0.30240294337272644,
0.4924176335334778,
0.710416316986084,
-0.7622431516647339,
-0.34232640266418457,
-0.22104868292808533,
-0.33992305397987366,
0.289645254611969,
1.2953866720199585,
-0.12105327099561691,
-0.9850965738296509,
0.5932890176773071,
-0.29273706674575806,
0.07486826181411743,
1.8280748128890991,
0.09544162452220917,
-0.8026280999183655,
0.32181665301322937,
-0.6986579298973083,
1.982555866241455,
1.7433909177780151,
1.3236198425292969,
-0.18479810655117035,
-0.9514570236206055,
0.5961427688598633,
-0.37779268622398376,
-0.3550875782966614,
0.9252227544784546,
0.2947911322116852,
-0.23734647035598755,
-1.5153212547302246,
0.6624361872673035,
1.2899051904678345,
-0.9129298329353333,
-0.731997549533844,
0.029841378331184387,
-0.7764636874198914,
1.056974172592163,
0.6825543642044067,
0.3367267847061157,
0.3575996458530426,
1.663863182067871,
0.7565373778343201,
-0.4806693196296692,
0.5380176901817322,
0.5159711241722107,
-0.07335152477025986,
-2.187666177749634,
-1.105055809020996,
0.2530314028263092,
-0.5017623901367188,
-1.5451282262802124,
1.3842507600784302,
-1.072147011756897,
-0.9950253963470459,
0.5319123864173889,
0.01197656150907278,
1.3578959703445435,
0.2538418471813202,
1.521762490272522,
2.0222184658050537,
0.8633520007133484,
0.2941129505634308,
1.2510145902633667,
-0.16922393441200256,
-0.4051722586154938,
1.753936767578125,
-0.4390742778778076,
0.4591558277606964,
1.1201082468032837,
-0.3404683768749237,
-1.027348279953003,
-0.7522260546684265,
-1.2485402822494507,
-0.7470186352729797,
1.1354743242263794,
0.03174611181020737,
-1.080340027809143,
0.21950045228004456,
1.6040778160095215,
0.07819212973117828,
-0.26678863167762756,
0.6241464614868164,
0.5341216325759888,
-0.9077156782150269,
-0.09818152338266373,
-0.8736677169799805,
0.5397403240203857,
-0.1829221546649933,
-0.3162173330783844,
0.28740784525871277,
0.48566243052482605,
1.4278072118759155,
-0.13712112605571747,
0.14966705441474915,
1.1077477931976318,
-1.4714453220367432,
1.4290574789047241,
-0.780772864818573,
0.29234108328819275,
-2.3378474712371826,
1.333397626876831,
-0.7560499310493469,
2.0092618465423584,
-2.68290638923645,
0.5947133898735046,
-0.6653397679328918,
-0.49545004963874817,
0.2931648790836334,
-0.36907827854156494,
0.17161716520786285,
-0.036618608981370926,
-1.1581841707229614,
-0.018261054530739784,
-0.6764445900917053,
0.6357938647270203,
1.1383684873580933,
1.4243524074554443,
-1.0985175371170044,
-0.31130486726760864,
-1.6747170686721802,
-0.19837456941604614,
-0.665216326713562,
0.21557992696762085,
-2.025118589401245,
-0.1402670294046402,
-1.9882651567459106,
-2.3787989616394043,
-1.3930752277374268,
-0.8067795038223267,
1.2297288179397583,
0.06829382479190826,
-0.9661176204681396,
1.2934590578079224,
-0.3962615132331848,
-1.8310800790786743,
1.1039860248565674,
-2.1388890743255615
] |
https://github.com/huggingface/datasets/issues/5111 | map and filter not working properly in multiprocessing with the new release 2.6.0 | Could you create another issue for the @PartiallyTyped one please ?
Regarding the OP issue, I also tried on colab or locally on py3.7 or py3.10 but didn't reproduce | ## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2 | 477 | 29 | map and filter not working properly in multiprocessing with the new release 2.6.0
## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2
Could you create another issue for the @PartiallyTyped one please ?
Regarding the OP issue, I also tried on colab or locally on py3.7 or py3.10 but didn't reproduce | [
-1.352843999862671,
-0.9489383101463318,
-0.7380266189575195,
1.3653239011764526,
-0.2156757116317749,
-1.1626625061035156,
0.19859008491039276,
-1.193071961402893,
1.6733355522155762,
-0.7513960599899292,
0.31026315689086914,
-1.72084379196167,
0.007246973924338818,
-0.7082626223564148,
-0.7887933254241943,
-0.8437585234642029,
-0.4116605222225189,
-0.7523932456970215,
1.1017882823944092,
2.4730443954467773,
1.2084859609603882,
-1.4340589046478271,
2.697086811065674,
0.7607104182243347,
-0.20602354407310486,
-1.000741720199585,
0.5457071661949158,
-0.05817698687314987,
-1.2278823852539062,
-0.4593156576156616,
-1.0296601057052612,
0.03622161224484444,
-0.5640300512313843,
-0.4410548508167267,
-0.08515094965696335,
0.36792615056037903,
-0.38905006647109985,
-0.3640885353088379,
-0.5134558081626892,
-0.8171752095222473,
0.5125590562820435,
-0.3884046971797943,
1.0048593282699585,
-0.34680455923080444,
1.793594479560852,
-0.5570852160453796,
0.5095599889755249,
0.6792799830436707,
1.336542010307312,
0.24689161777496338,
0.006785108707845211,
0.4661327600479126,
0.33547261357307434,
-0.039084721356630325,
0.5615963935852051,
1.2524054050445557,
0.6978742480278015,
0.47188377380371094,
0.8196986317634583,
-2.156207799911499,
1.2528531551361084,
-1.1066406965255737,
0.33222082257270813,
1.4115351438522339,
-0.8493854999542236,
0.33210253715515137,
-1.7599397897720337,
-0.04425366595387459,
0.6521478891372681,
-2.3162789344787598,
0.2995977997779846,
-1.27919340133667,
-0.5048683881759644,
1.078323245048523,
0.45950576663017273,
-1.2588427066802979,
0.10946755856275558,
-0.37329718470573425,
0.9714365005493164,
0.35684603452682495,
1.1564955711364746,
-1.6376603841781616,
-0.04867835342884064,
-0.3635140359401703,
0.05492449924349785,
-1.3257859945297241,
-1.4307327270507812,
0.5169233083724976,
0.5634656548500061,
0.6576090455055237,
-0.1427420675754547,
1.0496206283569336,
-1.0976380109786987,
0.7090063095092773,
-0.9661166071891785,
-1.6119598150253296,
-1.4128257036209106,
-2.291623115539551,
-2.273634433746338,
0.8197525143623352,
-0.41872870922088623,
-0.5719591379165649,
2.021575927734375,
-0.9523361921310425,
-1.7182625532150269,
1.1999105215072632,
0.36988332867622375,
0.0004202015697956085,
2.4817044734954834,
0.18493850529193878,
-0.8106722831726074,
0.6008914113044739,
-0.7502665519714355,
0.8027536869049072,
-0.34925419092178345,
1.327896237373352,
0.4561380445957184,
-1.0612645149230957,
1.628460168838501,
-0.39423635601997375,
0.5187291502952576,
-0.6074494123458862,
-0.5249357223510742,
-0.8257798552513123,
0.3605669438838959,
1.8437187671661377,
-0.2546614408493042,
1.5616862773895264,
-0.36114975810050964,
-1.57076096534729,
-1.644235610961914,
0.8591213822364807,
0.5475424528121948,
-0.7222733497619629,
0.12655296921730042,
-0.4101954400539398,
0.15647009015083313,
-0.09552298486232758,
1.159052848815918,
1.2761552333831787,
0.6186755299568176,
-0.32532963156700134,
-0.8480733633041382,
0.20687732100486755,
-0.09794370085000992,
-0.8096684813499451,
-1.7095060348510742,
-0.3229031264781952,
0.08813325315713882,
0.6513823866844177,
-1.200533390045166,
1.7762179374694824,
0.8353346586227417,
1.8862431049346924,
1.067116379737854,
-0.33585047721862793,
1.4812729358673096,
0.14742086827754974,
1.7066727876663208,
-0.5229436159133911,
0.6215577721595764,
-0.3223905563354492,
-1.1065716743469238,
0.8702681064605713,
-0.3996455669403076,
-2.044123888015747,
-0.7283399701118469,
-0.7253296971321106,
-0.12067362666130066,
-0.8233163356781006,
0.9613419771194458,
-0.3409569561481476,
-1.42781662940979,
0.35036900639533997,
-0.658052384853363,
0.11745937913656235,
-1.2482538223266602,
0.2546139061450958,
0.5985851287841797,
-0.6337411999702454,
-0.001809737179428339,
-0.15700726211071014,
-1.2436459064483643,
-0.3544852137565613,
0.17339321970939636,
1.8323628902435303,
-0.7161698937416077,
0.8825073838233948,
1.132197380065918,
-0.6953890919685364,
0.024699818342924118,
0.3942883312702179,
-0.2893776595592499,
0.7942770719528198,
-0.9977194666862488,
-0.4950154423713684,
1.1875135898590088,
-0.1709742695093155,
-0.4858299791812897,
1.4413151741027832,
0.6624630689620972,
-1.0681079626083374,
-0.1626148223876953,
-0.04255552589893341,
-0.8441759347915649,
0.0005662087351083755,
-1.535001277923584,
-0.13696789741516113,
0.45653510093688965,
-1.5621756315231323,
-0.5100254416465759,
-0.13009627163410187,
1.3108726739883423,
-0.25033432245254517,
1.423515796661377,
-0.38030102849006653,
-0.09034518897533417,
-0.2796098589897156,
-0.4299139082431793,
0.01708785444498062,
-0.0839274525642395,
-0.6643987894058228,
0.23706480860710144,
-0.7502977848052979,
0.37443214654922485,
1.38765549659729,
0.39412400126457214,
-0.003828566987067461,
0.4832402467727661,
1.0732358694076538,
0.3888905644416809,
-0.03001384437084198,
-0.8360363841056824,
-1.5617207288742065,
1.983630895614624,
-1.4796925783157349,
1.9793988466262817,
0.775019109249115,
-0.06505832076072693,
-1.695220947265625,
-1.7991671562194824,
1.4485450983047485,
1.1590040922164917,
2.3528950214385986,
0.5508567690849304,
0.41987383365631104,
-0.8208760619163513,
-0.7443094253540039,
0.31133773922920227,
-1.0313268899917603,
-0.7301105260848999,
0.07630030810832977,
2.4081532955169678,
1.7988923788070679,
-0.42698219418525696,
-0.1863911747932434,
-0.9899306893348694,
1.4028830528259277,
-0.2349306344985962,
0.26231423020362854,
1.9904849529266357,
-0.28220874071121216,
-1.142384648323059,
1.3960716724395752,
-2.3221797943115234,
0.0447310209274292,
1.9977569580078125,
0.30103397369384766,
0.09090276062488556,
-1.3771135807037354,
-0.49492645263671875,
-0.331441730260849,
-0.5523610711097717,
-1.2608861923217773,
0.5357611179351807,
-0.3041812777519226,
-0.8175384402275085,
-1.2733650207519531,
0.22175228595733643,
-1.2209690809249878,
-1.565248727798462,
0.3227149248123169,
1.8107928037643433,
2.123690128326416,
-0.8011602759361267,
1.5874642133712769,
-0.2909051179885864,
0.24637815356254578,
1.1586476564407349,
1.2416718006134033,
3.110504627227783,
1.8755992650985718,
-1.3669167757034302,
0.655765950679779,
-0.1908571571111679,
-0.5018966197967529,
1.1857972145080566,
-1.2210932970046997,
1.3433812856674194,
-0.061903029680252075,
-1.234751582145691,
-1.1753593683242798,
0.8742913603782654,
0.49568235874176025,
0.07559602707624435,
-0.5248870849609375,
1.179282546043396,
0.014901830814778805,
1.2154346704483032,
0.4900110363960266,
-0.28928473591804504,
0.5582860112190247,
-0.39514753222465515,
-0.5557770133018494,
1.553432583808899,
0.03435596451163292,
-1.4839650392532349,
-2.1559338569641113,
-0.1260356605052948,
-0.8027786612510681,
0.17490032315254211,
-0.7238632440567017,
-1.016738772392273,
1.6374210119247437,
0.3465195596218109,
-1.2611714601516724,
-0.2574252188205719,
-0.4282146990299225,
-0.6071368455886841,
2.6187610626220703,
-1.3952144384384155,
-0.2371700555086136,
-1.0277968645095825,
-0.6649593710899353,
1.6580921411514282,
-1.1364266872406006,
-0.21336692571640015,
-0.951311469078064,
-0.6637430787086487,
-1.292916178703308,
-0.5564977526664734,
0.0077466173097491264,
-0.9504511952400208,
0.742119550704956,
0.2722775936126709,
-1.0542643070220947,
-0.3482115864753723,
-0.8063483238220215,
0.9140456914901733,
-0.15540120005607605,
0.18437643349170685,
1.8741427659988403,
0.2666875123977661,
-0.2889736592769623,
0.731098473072052,
1.216781497001648,
0.5726482272148132,
-0.6049782633781433,
0.10222222656011581,
-0.7135103344917297,
0.45156368613243103,
-1.3268308639526367,
0.23948723077774048,
-2.8180761337280273,
0.6419659852981567,
-0.017636079341173172,
-0.007279344368726015,
-0.004086786415427923,
-1.253089189529419,
1.1025699377059937,
2.6280109882354736,
-1.1376124620437622,
0.4524666666984558,
0.31024977564811707,
1.1842352151870728,
-1.6642428636550903,
0.13249927759170532,
-0.5423892140388489,
2.1645026206970215,
0.16787037253379822,
1.1557540893554688,
-0.4540040194988251,
-2.3912434577941895,
0.6820730566978455,
-1.1910542249679565,
-1.1874547004699707,
0.8611146807670593,
-0.9098837375640869,
0.19467948377132416,
-1.492958426475525,
-0.23916681110858917,
-0.8900787234306335,
-1.0601303577423096,
0.7021640539169312,
0.16460129618644714,
0.4878041744232178,
-0.6335223317146301,
0.3417249321937561,
-2.232370615005493,
-1.3560826778411865,
-0.14507611095905304,
-0.9469844102859497,
0.5473050475120544,
-0.3101058602333069,
0.6931146383285522,
-0.16004320979118347,
-0.05999945104122162,
0.39408475160598755,
1.4535225629806519,
3.360382318496704,
0.12939833104610443,
0.36583980917930603,
-0.1527254432439804,
-0.8759079575538635,
1.3659929037094116,
0.9409795999526978,
-0.1779569536447525,
-0.6304442882537842,
-1.1271629333496094,
1.348219871520996,
1.9111262559890747,
1.0133330821990967,
0.07795850932598114,
-0.8557611703872681,
-0.710820734500885,
-0.0030904491432011127,
0.1625552922487259,
0.46008771657943726,
0.895862340927124,
0.05518816038966179,
0.06036972627043724,
1.4112592935562134,
1.164651870727539,
-0.3956789970397949,
0.35540127754211426,
-0.8529433012008667,
-0.4635494351387024,
0.5882209539413452,
0.26365765929222107,
-0.04530327394604683,
0.4310956299304962,
-0.891121506690979,
-0.16506318747997284,
-0.32724541425704956,
-0.8987978100776672,
-0.6869591474533081,
-0.32895296812057495,
-0.2943706214427948,
1.656821370124817,
0.0886165127158165,
-0.572130024433136,
0.016022849828004837,
-0.9148297905921936,
-0.209905743598938,
-1.0779117345809937,
0.20231640338897705,
-0.09923326224088669,
-0.16712836921215057,
-0.1455838680267334,
1.6554466485977173,
-0.8948386907577515,
-2.0234293937683105,
0.11941210180521011,
0.2864963710308075,
-0.23282557725906372,
0.2243698239326477,
1.6920591592788696,
0.5473124384880066,
1.4238855838775635,
1.2995887994766235,
0.915253221988678,
-0.6527360677719116,
-1.2476170063018799,
0.6657904982566833,
1.0366777181625366,
-1.352869987487793,
0.8531225919723511,
-0.05772101506590843,
-0.5229977965354919,
0.5777467489242554,
1.2999303340911865,
0.4764743149280548,
-1.9456743001937866,
0.8796243071556091,
-1.0466121435165405,
0.7997974157333374,
0.6567378044128418,
0.6350302696228027,
0.2660275995731354,
0.8911247849464417,
-1.235562801361084,
-1.1697279214859009,
-0.760753870010376,
-0.7488093972206116,
2.018808364868164,
-0.20905597507953644,
0.6347901225090027,
-0.22344841063022614,
-1.2952947616577148,
-0.12106344848871231,
0.6511560678482056,
0.3459177315235138,
-0.37168893218040466,
0.7681452035903931,
-0.6986016035079956,
-1.0484375953674316,
-1.525109887123108,
-0.35719016194343567,
-1.0954183340072632,
-0.8409464955329895,
1.1188147068023682,
0.7919401526451111,
0.25647974014282227,
1.894824743270874,
0.7183055877685547,
0.258539617061615,
-2.4437203407287598,
0.844420313835144,
0.4085065722465515,
-0.13393595814704895,
0.9314306378364563,
0.3869825005531311,
1.0625985860824585,
0.01904981955885887,
0.5382217764854431,
-2.374877691268921,
2.1903738975524902,
-0.22166168689727783,
0.6688701510429382,
-0.005186804570257664,
-0.1760694980621338,
1.0659552812576294,
0.6418696641921997,
0.49213868379592896,
-1.1228981018066406,
0.584804892539978,
-0.5494658946990967,
1.2753336429595947,
1.0675774812698364,
-0.8527571558952332,
-0.051426686346530914,
1.3581863641738892,
0.3301854133605957,
-0.5314280390739441,
-0.9450830221176147,
-0.9743315577507019,
0.8931750655174255,
1.7217029333114624,
-0.10658532381057739,
-0.01538261491805315,
0.7675034999847412,
0.7746050357818604,
-1.3633453845977783,
0.0868171826004982,
-0.7363263964653015,
-0.7641669511795044,
1.7431671619415283,
2.1377151012420654,
-0.16762635111808777,
-0.12013321369886398,
-0.7418760657310486,
-1.2674833536148071,
0.8302239179611206,
-0.14852993190288544,
0.15459497272968292,
0.6361611485481262,
-0.7751073837280273,
1.0675251483917236,
1.0603207349777222,
0.747060239315033,
0.24068410694599152,
0.208685502409935,
0.36574673652648926,
-0.24202995002269745,
-1.175158143043518,
-0.316668838262558,
-1.0509452819824219,
-2.6592228412628174,
0.36408284306526184,
-0.2135932743549347,
-1.3718891143798828,
-0.00916301179677248,
-1.068444848060608,
0.9414942264556885,
-0.566517174243927,
-1.0452936887741089,
-1.5147794485092163,
0.2795720398426056,
0.06134048476815224,
0.9615294933319092,
-1.5560575723648071,
-0.21939152479171753,
1.1915570497512817,
0.8745578527450562,
-0.6153393983840942,
1.0416154861450195,
0.33449527621269226,
1.0751947164535522,
0.8196992874145508,
-0.4833395779132843,
0.5968950986862183,
0.008883579634130001,
-1.316942572593689,
0.5585237741470337,
1.1433601379394531,
0.21117042005062103,
1.5058234930038452,
-0.481172114610672,
0.01979086548089981,
0.3488268554210663,
-0.6223403215408325,
-0.4098179340362549,
-0.5806086659431458,
0.609577476978302,
0.03656207025051117,
-0.9033235907554626,
-0.1107715293765068,
-0.04403461143374443,
-0.3255966305732727,
0.19006557762622833,
-1.4721750020980835,
-0.11168469488620758,
-0.33968108892440796,
-0.5704721212387085,
-1.2460225820541382,
-0.06051511690020561,
1.4336400032043457,
-0.8955585956573486,
-0.16400933265686035,
0.40855079889297485,
0.30240294337272644,
0.4924176335334778,
0.710416316986084,
-0.7622431516647339,
-0.34232640266418457,
-0.22104868292808533,
-0.33992305397987366,
0.289645254611969,
1.2953866720199585,
-0.12105327099561691,
-0.9850965738296509,
0.5932890176773071,
-0.29273706674575806,
0.07486826181411743,
1.8280748128890991,
0.09544162452220917,
-0.8026280999183655,
0.32181665301322937,
-0.6986579298973083,
1.982555866241455,
1.7433909177780151,
1.3236198425292969,
-0.18479810655117035,
-0.9514570236206055,
0.5961427688598633,
-0.37779268622398376,
-0.3550875782966614,
0.9252227544784546,
0.2947911322116852,
-0.23734647035598755,
-1.5153212547302246,
0.6624361872673035,
1.2899051904678345,
-0.9129298329353333,
-0.731997549533844,
0.029841378331184387,
-0.7764636874198914,
1.056974172592163,
0.6825543642044067,
0.3367267847061157,
0.3575996458530426,
1.663863182067871,
0.7565373778343201,
-0.4806693196296692,
0.5380176901817322,
0.5159711241722107,
-0.07335152477025986,
-2.187666177749634,
-1.105055809020996,
0.2530314028263092,
-0.5017623901367188,
-1.5451282262802124,
1.3842507600784302,
-1.072147011756897,
-0.9950253963470459,
0.5319123864173889,
0.01197656150907278,
1.3578959703445435,
0.2538418471813202,
1.521762490272522,
2.0222184658050537,
0.8633520007133484,
0.2941129505634308,
1.2510145902633667,
-0.16922393441200256,
-0.4051722586154938,
1.753936767578125,
-0.4390742778778076,
0.4591558277606964,
1.1201082468032837,
-0.3404683768749237,
-1.027348279953003,
-0.7522260546684265,
-1.2485402822494507,
-0.7470186352729797,
1.1354743242263794,
0.03174611181020737,
-1.080340027809143,
0.21950045228004456,
1.6040778160095215,
0.07819212973117828,
-0.26678863167762756,
0.6241464614868164,
0.5341216325759888,
-0.9077156782150269,
-0.09818152338266373,
-0.8736677169799805,
0.5397403240203857,
-0.1829221546649933,
-0.3162173330783844,
0.28740784525871277,
0.48566243052482605,
1.4278072118759155,
-0.13712112605571747,
0.14966705441474915,
1.1077477931976318,
-1.4714453220367432,
1.4290574789047241,
-0.780772864818573,
0.29234108328819275,
-2.3378474712371826,
1.333397626876831,
-0.7560499310493469,
2.0092618465423584,
-2.68290638923645,
0.5947133898735046,
-0.6653397679328918,
-0.49545004963874817,
0.2931648790836334,
-0.36907827854156494,
0.17161716520786285,
-0.036618608981370926,
-1.1581841707229614,
-0.018261054530739784,
-0.6764445900917053,
0.6357938647270203,
1.1383684873580933,
1.4243524074554443,
-1.0985175371170044,
-0.31130486726760864,
-1.6747170686721802,
-0.19837456941604614,
-0.665216326713562,
0.21557992696762085,
-2.025118589401245,
-0.1402670294046402,
-1.9882651567459106,
-2.3787989616394043,
-1.3930752277374268,
-0.8067795038223267,
1.2297288179397583,
0.06829382479190826,
-0.9661176204681396,
1.2934590578079224,
-0.3962615132331848,
-1.8310800790786743,
1.1039860248565674,
-2.1388890743255615
] |
https://github.com/huggingface/datasets/issues/5111 | map and filter not working properly in multiprocessing with the new release 2.6.0 | I managed to reproduce your issue @loubnabnl on colab by upgrading pyarrow to 9.0.0 instead of 6.0.1 | ## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2 | 477 | 17 | map and filter not working properly in multiprocessing with the new release 2.6.0
## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2
I managed to reproduce your issue @loubnabnl on colab by upgrading pyarrow to 9.0.0 instead of 6.0.1 | [
-1.352843999862671,
-0.9489383101463318,
-0.7380266189575195,
1.3653239011764526,
-0.2156757116317749,
-1.1626625061035156,
0.19859008491039276,
-1.193071961402893,
1.6733355522155762,
-0.7513960599899292,
0.31026315689086914,
-1.72084379196167,
0.007246973924338818,
-0.7082626223564148,
-0.7887933254241943,
-0.8437585234642029,
-0.4116605222225189,
-0.7523932456970215,
1.1017882823944092,
2.4730443954467773,
1.2084859609603882,
-1.4340589046478271,
2.697086811065674,
0.7607104182243347,
-0.20602354407310486,
-1.000741720199585,
0.5457071661949158,
-0.05817698687314987,
-1.2278823852539062,
-0.4593156576156616,
-1.0296601057052612,
0.03622161224484444,
-0.5640300512313843,
-0.4410548508167267,
-0.08515094965696335,
0.36792615056037903,
-0.38905006647109985,
-0.3640885353088379,
-0.5134558081626892,
-0.8171752095222473,
0.5125590562820435,
-0.3884046971797943,
1.0048593282699585,
-0.34680455923080444,
1.793594479560852,
-0.5570852160453796,
0.5095599889755249,
0.6792799830436707,
1.336542010307312,
0.24689161777496338,
0.006785108707845211,
0.4661327600479126,
0.33547261357307434,
-0.039084721356630325,
0.5615963935852051,
1.2524054050445557,
0.6978742480278015,
0.47188377380371094,
0.8196986317634583,
-2.156207799911499,
1.2528531551361084,
-1.1066406965255737,
0.33222082257270813,
1.4115351438522339,
-0.8493854999542236,
0.33210253715515137,
-1.7599397897720337,
-0.04425366595387459,
0.6521478891372681,
-2.3162789344787598,
0.2995977997779846,
-1.27919340133667,
-0.5048683881759644,
1.078323245048523,
0.45950576663017273,
-1.2588427066802979,
0.10946755856275558,
-0.37329718470573425,
0.9714365005493164,
0.35684603452682495,
1.1564955711364746,
-1.6376603841781616,
-0.04867835342884064,
-0.3635140359401703,
0.05492449924349785,
-1.3257859945297241,
-1.4307327270507812,
0.5169233083724976,
0.5634656548500061,
0.6576090455055237,
-0.1427420675754547,
1.0496206283569336,
-1.0976380109786987,
0.7090063095092773,
-0.9661166071891785,
-1.6119598150253296,
-1.4128257036209106,
-2.291623115539551,
-2.273634433746338,
0.8197525143623352,
-0.41872870922088623,
-0.5719591379165649,
2.021575927734375,
-0.9523361921310425,
-1.7182625532150269,
1.1999105215072632,
0.36988332867622375,
0.0004202015697956085,
2.4817044734954834,
0.18493850529193878,
-0.8106722831726074,
0.6008914113044739,
-0.7502665519714355,
0.8027536869049072,
-0.34925419092178345,
1.327896237373352,
0.4561380445957184,
-1.0612645149230957,
1.628460168838501,
-0.39423635601997375,
0.5187291502952576,
-0.6074494123458862,
-0.5249357223510742,
-0.8257798552513123,
0.3605669438838959,
1.8437187671661377,
-0.2546614408493042,
1.5616862773895264,
-0.36114975810050964,
-1.57076096534729,
-1.644235610961914,
0.8591213822364807,
0.5475424528121948,
-0.7222733497619629,
0.12655296921730042,
-0.4101954400539398,
0.15647009015083313,
-0.09552298486232758,
1.159052848815918,
1.2761552333831787,
0.6186755299568176,
-0.32532963156700134,
-0.8480733633041382,
0.20687732100486755,
-0.09794370085000992,
-0.8096684813499451,
-1.7095060348510742,
-0.3229031264781952,
0.08813325315713882,
0.6513823866844177,
-1.200533390045166,
1.7762179374694824,
0.8353346586227417,
1.8862431049346924,
1.067116379737854,
-0.33585047721862793,
1.4812729358673096,
0.14742086827754974,
1.7066727876663208,
-0.5229436159133911,
0.6215577721595764,
-0.3223905563354492,
-1.1065716743469238,
0.8702681064605713,
-0.3996455669403076,
-2.044123888015747,
-0.7283399701118469,
-0.7253296971321106,
-0.12067362666130066,
-0.8233163356781006,
0.9613419771194458,
-0.3409569561481476,
-1.42781662940979,
0.35036900639533997,
-0.658052384853363,
0.11745937913656235,
-1.2482538223266602,
0.2546139061450958,
0.5985851287841797,
-0.6337411999702454,
-0.001809737179428339,
-0.15700726211071014,
-1.2436459064483643,
-0.3544852137565613,
0.17339321970939636,
1.8323628902435303,
-0.7161698937416077,
0.8825073838233948,
1.132197380065918,
-0.6953890919685364,
0.024699818342924118,
0.3942883312702179,
-0.2893776595592499,
0.7942770719528198,
-0.9977194666862488,
-0.4950154423713684,
1.1875135898590088,
-0.1709742695093155,
-0.4858299791812897,
1.4413151741027832,
0.6624630689620972,
-1.0681079626083374,
-0.1626148223876953,
-0.04255552589893341,
-0.8441759347915649,
0.0005662087351083755,
-1.535001277923584,
-0.13696789741516113,
0.45653510093688965,
-1.5621756315231323,
-0.5100254416465759,
-0.13009627163410187,
1.3108726739883423,
-0.25033432245254517,
1.423515796661377,
-0.38030102849006653,
-0.09034518897533417,
-0.2796098589897156,
-0.4299139082431793,
0.01708785444498062,
-0.0839274525642395,
-0.6643987894058228,
0.23706480860710144,
-0.7502977848052979,
0.37443214654922485,
1.38765549659729,
0.39412400126457214,
-0.003828566987067461,
0.4832402467727661,
1.0732358694076538,
0.3888905644416809,
-0.03001384437084198,
-0.8360363841056824,
-1.5617207288742065,
1.983630895614624,
-1.4796925783157349,
1.9793988466262817,
0.775019109249115,
-0.06505832076072693,
-1.695220947265625,
-1.7991671562194824,
1.4485450983047485,
1.1590040922164917,
2.3528950214385986,
0.5508567690849304,
0.41987383365631104,
-0.8208760619163513,
-0.7443094253540039,
0.31133773922920227,
-1.0313268899917603,
-0.7301105260848999,
0.07630030810832977,
2.4081532955169678,
1.7988923788070679,
-0.42698219418525696,
-0.1863911747932434,
-0.9899306893348694,
1.4028830528259277,
-0.2349306344985962,
0.26231423020362854,
1.9904849529266357,
-0.28220874071121216,
-1.142384648323059,
1.3960716724395752,
-2.3221797943115234,
0.0447310209274292,
1.9977569580078125,
0.30103397369384766,
0.09090276062488556,
-1.3771135807037354,
-0.49492645263671875,
-0.331441730260849,
-0.5523610711097717,
-1.2608861923217773,
0.5357611179351807,
-0.3041812777519226,
-0.8175384402275085,
-1.2733650207519531,
0.22175228595733643,
-1.2209690809249878,
-1.565248727798462,
0.3227149248123169,
1.8107928037643433,
2.123690128326416,
-0.8011602759361267,
1.5874642133712769,
-0.2909051179885864,
0.24637815356254578,
1.1586476564407349,
1.2416718006134033,
3.110504627227783,
1.8755992650985718,
-1.3669167757034302,
0.655765950679779,
-0.1908571571111679,
-0.5018966197967529,
1.1857972145080566,
-1.2210932970046997,
1.3433812856674194,
-0.061903029680252075,
-1.234751582145691,
-1.1753593683242798,
0.8742913603782654,
0.49568235874176025,
0.07559602707624435,
-0.5248870849609375,
1.179282546043396,
0.014901830814778805,
1.2154346704483032,
0.4900110363960266,
-0.28928473591804504,
0.5582860112190247,
-0.39514753222465515,
-0.5557770133018494,
1.553432583808899,
0.03435596451163292,
-1.4839650392532349,
-2.1559338569641113,
-0.1260356605052948,
-0.8027786612510681,
0.17490032315254211,
-0.7238632440567017,
-1.016738772392273,
1.6374210119247437,
0.3465195596218109,
-1.2611714601516724,
-0.2574252188205719,
-0.4282146990299225,
-0.6071368455886841,
2.6187610626220703,
-1.3952144384384155,
-0.2371700555086136,
-1.0277968645095825,
-0.6649593710899353,
1.6580921411514282,
-1.1364266872406006,
-0.21336692571640015,
-0.951311469078064,
-0.6637430787086487,
-1.292916178703308,
-0.5564977526664734,
0.0077466173097491264,
-0.9504511952400208,
0.742119550704956,
0.2722775936126709,
-1.0542643070220947,
-0.3482115864753723,
-0.8063483238220215,
0.9140456914901733,
-0.15540120005607605,
0.18437643349170685,
1.8741427659988403,
0.2666875123977661,
-0.2889736592769623,
0.731098473072052,
1.216781497001648,
0.5726482272148132,
-0.6049782633781433,
0.10222222656011581,
-0.7135103344917297,
0.45156368613243103,
-1.3268308639526367,
0.23948723077774048,
-2.8180761337280273,
0.6419659852981567,
-0.017636079341173172,
-0.007279344368726015,
-0.004086786415427923,
-1.253089189529419,
1.1025699377059937,
2.6280109882354736,
-1.1376124620437622,
0.4524666666984558,
0.31024977564811707,
1.1842352151870728,
-1.6642428636550903,
0.13249927759170532,
-0.5423892140388489,
2.1645026206970215,
0.16787037253379822,
1.1557540893554688,
-0.4540040194988251,
-2.3912434577941895,
0.6820730566978455,
-1.1910542249679565,
-1.1874547004699707,
0.8611146807670593,
-0.9098837375640869,
0.19467948377132416,
-1.492958426475525,
-0.23916681110858917,
-0.8900787234306335,
-1.0601303577423096,
0.7021640539169312,
0.16460129618644714,
0.4878041744232178,
-0.6335223317146301,
0.3417249321937561,
-2.232370615005493,
-1.3560826778411865,
-0.14507611095905304,
-0.9469844102859497,
0.5473050475120544,
-0.3101058602333069,
0.6931146383285522,
-0.16004320979118347,
-0.05999945104122162,
0.39408475160598755,
1.4535225629806519,
3.360382318496704,
0.12939833104610443,
0.36583980917930603,
-0.1527254432439804,
-0.8759079575538635,
1.3659929037094116,
0.9409795999526978,
-0.1779569536447525,
-0.6304442882537842,
-1.1271629333496094,
1.348219871520996,
1.9111262559890747,
1.0133330821990967,
0.07795850932598114,
-0.8557611703872681,
-0.710820734500885,
-0.0030904491432011127,
0.1625552922487259,
0.46008771657943726,
0.895862340927124,
0.05518816038966179,
0.06036972627043724,
1.4112592935562134,
1.164651870727539,
-0.3956789970397949,
0.35540127754211426,
-0.8529433012008667,
-0.4635494351387024,
0.5882209539413452,
0.26365765929222107,
-0.04530327394604683,
0.4310956299304962,
-0.891121506690979,
-0.16506318747997284,
-0.32724541425704956,
-0.8987978100776672,
-0.6869591474533081,
-0.32895296812057495,
-0.2943706214427948,
1.656821370124817,
0.0886165127158165,
-0.572130024433136,
0.016022849828004837,
-0.9148297905921936,
-0.209905743598938,
-1.0779117345809937,
0.20231640338897705,
-0.09923326224088669,
-0.16712836921215057,
-0.1455838680267334,
1.6554466485977173,
-0.8948386907577515,
-2.0234293937683105,
0.11941210180521011,
0.2864963710308075,
-0.23282557725906372,
0.2243698239326477,
1.6920591592788696,
0.5473124384880066,
1.4238855838775635,
1.2995887994766235,
0.915253221988678,
-0.6527360677719116,
-1.2476170063018799,
0.6657904982566833,
1.0366777181625366,
-1.352869987487793,
0.8531225919723511,
-0.05772101506590843,
-0.5229977965354919,
0.5777467489242554,
1.2999303340911865,
0.4764743149280548,
-1.9456743001937866,
0.8796243071556091,
-1.0466121435165405,
0.7997974157333374,
0.6567378044128418,
0.6350302696228027,
0.2660275995731354,
0.8911247849464417,
-1.235562801361084,
-1.1697279214859009,
-0.760753870010376,
-0.7488093972206116,
2.018808364868164,
-0.20905597507953644,
0.6347901225090027,
-0.22344841063022614,
-1.2952947616577148,
-0.12106344848871231,
0.6511560678482056,
0.3459177315235138,
-0.37168893218040466,
0.7681452035903931,
-0.6986016035079956,
-1.0484375953674316,
-1.525109887123108,
-0.35719016194343567,
-1.0954183340072632,
-0.8409464955329895,
1.1188147068023682,
0.7919401526451111,
0.25647974014282227,
1.894824743270874,
0.7183055877685547,
0.258539617061615,
-2.4437203407287598,
0.844420313835144,
0.4085065722465515,
-0.13393595814704895,
0.9314306378364563,
0.3869825005531311,
1.0625985860824585,
0.01904981955885887,
0.5382217764854431,
-2.374877691268921,
2.1903738975524902,
-0.22166168689727783,
0.6688701510429382,
-0.005186804570257664,
-0.1760694980621338,
1.0659552812576294,
0.6418696641921997,
0.49213868379592896,
-1.1228981018066406,
0.584804892539978,
-0.5494658946990967,
1.2753336429595947,
1.0675774812698364,
-0.8527571558952332,
-0.051426686346530914,
1.3581863641738892,
0.3301854133605957,
-0.5314280390739441,
-0.9450830221176147,
-0.9743315577507019,
0.8931750655174255,
1.7217029333114624,
-0.10658532381057739,
-0.01538261491805315,
0.7675034999847412,
0.7746050357818604,
-1.3633453845977783,
0.0868171826004982,
-0.7363263964653015,
-0.7641669511795044,
1.7431671619415283,
2.1377151012420654,
-0.16762635111808777,
-0.12013321369886398,
-0.7418760657310486,
-1.2674833536148071,
0.8302239179611206,
-0.14852993190288544,
0.15459497272968292,
0.6361611485481262,
-0.7751073837280273,
1.0675251483917236,
1.0603207349777222,
0.747060239315033,
0.24068410694599152,
0.208685502409935,
0.36574673652648926,
-0.24202995002269745,
-1.175158143043518,
-0.316668838262558,
-1.0509452819824219,
-2.6592228412628174,
0.36408284306526184,
-0.2135932743549347,
-1.3718891143798828,
-0.00916301179677248,
-1.068444848060608,
0.9414942264556885,
-0.566517174243927,
-1.0452936887741089,
-1.5147794485092163,
0.2795720398426056,
0.06134048476815224,
0.9615294933319092,
-1.5560575723648071,
-0.21939152479171753,
1.1915570497512817,
0.8745578527450562,
-0.6153393983840942,
1.0416154861450195,
0.33449527621269226,
1.0751947164535522,
0.8196992874145508,
-0.4833395779132843,
0.5968950986862183,
0.008883579634130001,
-1.316942572593689,
0.5585237741470337,
1.1433601379394531,
0.21117042005062103,
1.5058234930038452,
-0.481172114610672,
0.01979086548089981,
0.3488268554210663,
-0.6223403215408325,
-0.4098179340362549,
-0.5806086659431458,
0.609577476978302,
0.03656207025051117,
-0.9033235907554626,
-0.1107715293765068,
-0.04403461143374443,
-0.3255966305732727,
0.19006557762622833,
-1.4721750020980835,
-0.11168469488620758,
-0.33968108892440796,
-0.5704721212387085,
-1.2460225820541382,
-0.06051511690020561,
1.4336400032043457,
-0.8955585956573486,
-0.16400933265686035,
0.40855079889297485,
0.30240294337272644,
0.4924176335334778,
0.710416316986084,
-0.7622431516647339,
-0.34232640266418457,
-0.22104868292808533,
-0.33992305397987366,
0.289645254611969,
1.2953866720199585,
-0.12105327099561691,
-0.9850965738296509,
0.5932890176773071,
-0.29273706674575806,
0.07486826181411743,
1.8280748128890991,
0.09544162452220917,
-0.8026280999183655,
0.32181665301322937,
-0.6986579298973083,
1.982555866241455,
1.7433909177780151,
1.3236198425292969,
-0.18479810655117035,
-0.9514570236206055,
0.5961427688598633,
-0.37779268622398376,
-0.3550875782966614,
0.9252227544784546,
0.2947911322116852,
-0.23734647035598755,
-1.5153212547302246,
0.6624361872673035,
1.2899051904678345,
-0.9129298329353333,
-0.731997549533844,
0.029841378331184387,
-0.7764636874198914,
1.056974172592163,
0.6825543642044067,
0.3367267847061157,
0.3575996458530426,
1.663863182067871,
0.7565373778343201,
-0.4806693196296692,
0.5380176901817322,
0.5159711241722107,
-0.07335152477025986,
-2.187666177749634,
-1.105055809020996,
0.2530314028263092,
-0.5017623901367188,
-1.5451282262802124,
1.3842507600784302,
-1.072147011756897,
-0.9950253963470459,
0.5319123864173889,
0.01197656150907278,
1.3578959703445435,
0.2538418471813202,
1.521762490272522,
2.0222184658050537,
0.8633520007133484,
0.2941129505634308,
1.2510145902633667,
-0.16922393441200256,
-0.4051722586154938,
1.753936767578125,
-0.4390742778778076,
0.4591558277606964,
1.1201082468032837,
-0.3404683768749237,
-1.027348279953003,
-0.7522260546684265,
-1.2485402822494507,
-0.7470186352729797,
1.1354743242263794,
0.03174611181020737,
-1.080340027809143,
0.21950045228004456,
1.6040778160095215,
0.07819212973117828,
-0.26678863167762756,
0.6241464614868164,
0.5341216325759888,
-0.9077156782150269,
-0.09818152338266373,
-0.8736677169799805,
0.5397403240203857,
-0.1829221546649933,
-0.3162173330783844,
0.28740784525871277,
0.48566243052482605,
1.4278072118759155,
-0.13712112605571747,
0.14966705441474915,
1.1077477931976318,
-1.4714453220367432,
1.4290574789047241,
-0.780772864818573,
0.29234108328819275,
-2.3378474712371826,
1.333397626876831,
-0.7560499310493469,
2.0092618465423584,
-2.68290638923645,
0.5947133898735046,
-0.6653397679328918,
-0.49545004963874817,
0.2931648790836334,
-0.36907827854156494,
0.17161716520786285,
-0.036618608981370926,
-1.1581841707229614,
-0.018261054530739784,
-0.6764445900917053,
0.6357938647270203,
1.1383684873580933,
1.4243524074554443,
-1.0985175371170044,
-0.31130486726760864,
-1.6747170686721802,
-0.19837456941604614,
-0.665216326713562,
0.21557992696762085,
-2.025118589401245,
-0.1402670294046402,
-1.9882651567459106,
-2.3787989616394043,
-1.3930752277374268,
-0.8067795038223267,
1.2297288179397583,
0.06829382479190826,
-0.9661176204681396,
1.2934590578079224,
-0.3962615132331848,
-1.8310800790786743,
1.1039860248565674,
-2.1388890743255615
] |
https://github.com/huggingface/datasets/issues/5111 | map and filter not working properly in multiprocessing with the new release 2.6.0 | I managed to have a _super_ minimal reproducible example:
```python
from datasets import Dataset, concatenate_datasets
ds = concatenate_datasets([Dataset.from_dict({"a": [i]}) for i in range(10)])
ds2 = ds.map(lambda _: {}, batched=True)
assert list(ds2) == list(ds)
```
(filter uses a batched `map` under the hood) | ## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2 | 477 | 42 | map and filter not working properly in multiprocessing with the new release 2.6.0
## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2
I managed to have a _super_ minimal reproducible example:
```python
from datasets import Dataset, concatenate_datasets
ds = concatenate_datasets([Dataset.from_dict({"a": [i]}) for i in range(10)])
ds2 = ds.map(lambda _: {}, batched=True)
assert list(ds2) == list(ds)
```
(filter uses a batched `map` under the hood) | [
-1.352843999862671,
-0.9489383101463318,
-0.7380266189575195,
1.3653239011764526,
-0.2156757116317749,
-1.1626625061035156,
0.19859008491039276,
-1.193071961402893,
1.6733355522155762,
-0.7513960599899292,
0.31026315689086914,
-1.72084379196167,
0.007246973924338818,
-0.7082626223564148,
-0.7887933254241943,
-0.8437585234642029,
-0.4116605222225189,
-0.7523932456970215,
1.1017882823944092,
2.4730443954467773,
1.2084859609603882,
-1.4340589046478271,
2.697086811065674,
0.7607104182243347,
-0.20602354407310486,
-1.000741720199585,
0.5457071661949158,
-0.05817698687314987,
-1.2278823852539062,
-0.4593156576156616,
-1.0296601057052612,
0.03622161224484444,
-0.5640300512313843,
-0.4410548508167267,
-0.08515094965696335,
0.36792615056037903,
-0.38905006647109985,
-0.3640885353088379,
-0.5134558081626892,
-0.8171752095222473,
0.5125590562820435,
-0.3884046971797943,
1.0048593282699585,
-0.34680455923080444,
1.793594479560852,
-0.5570852160453796,
0.5095599889755249,
0.6792799830436707,
1.336542010307312,
0.24689161777496338,
0.006785108707845211,
0.4661327600479126,
0.33547261357307434,
-0.039084721356630325,
0.5615963935852051,
1.2524054050445557,
0.6978742480278015,
0.47188377380371094,
0.8196986317634583,
-2.156207799911499,
1.2528531551361084,
-1.1066406965255737,
0.33222082257270813,
1.4115351438522339,
-0.8493854999542236,
0.33210253715515137,
-1.7599397897720337,
-0.04425366595387459,
0.6521478891372681,
-2.3162789344787598,
0.2995977997779846,
-1.27919340133667,
-0.5048683881759644,
1.078323245048523,
0.45950576663017273,
-1.2588427066802979,
0.10946755856275558,
-0.37329718470573425,
0.9714365005493164,
0.35684603452682495,
1.1564955711364746,
-1.6376603841781616,
-0.04867835342884064,
-0.3635140359401703,
0.05492449924349785,
-1.3257859945297241,
-1.4307327270507812,
0.5169233083724976,
0.5634656548500061,
0.6576090455055237,
-0.1427420675754547,
1.0496206283569336,
-1.0976380109786987,
0.7090063095092773,
-0.9661166071891785,
-1.6119598150253296,
-1.4128257036209106,
-2.291623115539551,
-2.273634433746338,
0.8197525143623352,
-0.41872870922088623,
-0.5719591379165649,
2.021575927734375,
-0.9523361921310425,
-1.7182625532150269,
1.1999105215072632,
0.36988332867622375,
0.0004202015697956085,
2.4817044734954834,
0.18493850529193878,
-0.8106722831726074,
0.6008914113044739,
-0.7502665519714355,
0.8027536869049072,
-0.34925419092178345,
1.327896237373352,
0.4561380445957184,
-1.0612645149230957,
1.628460168838501,
-0.39423635601997375,
0.5187291502952576,
-0.6074494123458862,
-0.5249357223510742,
-0.8257798552513123,
0.3605669438838959,
1.8437187671661377,
-0.2546614408493042,
1.5616862773895264,
-0.36114975810050964,
-1.57076096534729,
-1.644235610961914,
0.8591213822364807,
0.5475424528121948,
-0.7222733497619629,
0.12655296921730042,
-0.4101954400539398,
0.15647009015083313,
-0.09552298486232758,
1.159052848815918,
1.2761552333831787,
0.6186755299568176,
-0.32532963156700134,
-0.8480733633041382,
0.20687732100486755,
-0.09794370085000992,
-0.8096684813499451,
-1.7095060348510742,
-0.3229031264781952,
0.08813325315713882,
0.6513823866844177,
-1.200533390045166,
1.7762179374694824,
0.8353346586227417,
1.8862431049346924,
1.067116379737854,
-0.33585047721862793,
1.4812729358673096,
0.14742086827754974,
1.7066727876663208,
-0.5229436159133911,
0.6215577721595764,
-0.3223905563354492,
-1.1065716743469238,
0.8702681064605713,
-0.3996455669403076,
-2.044123888015747,
-0.7283399701118469,
-0.7253296971321106,
-0.12067362666130066,
-0.8233163356781006,
0.9613419771194458,
-0.3409569561481476,
-1.42781662940979,
0.35036900639533997,
-0.658052384853363,
0.11745937913656235,
-1.2482538223266602,
0.2546139061450958,
0.5985851287841797,
-0.6337411999702454,
-0.001809737179428339,
-0.15700726211071014,
-1.2436459064483643,
-0.3544852137565613,
0.17339321970939636,
1.8323628902435303,
-0.7161698937416077,
0.8825073838233948,
1.132197380065918,
-0.6953890919685364,
0.024699818342924118,
0.3942883312702179,
-0.2893776595592499,
0.7942770719528198,
-0.9977194666862488,
-0.4950154423713684,
1.1875135898590088,
-0.1709742695093155,
-0.4858299791812897,
1.4413151741027832,
0.6624630689620972,
-1.0681079626083374,
-0.1626148223876953,
-0.04255552589893341,
-0.8441759347915649,
0.0005662087351083755,
-1.535001277923584,
-0.13696789741516113,
0.45653510093688965,
-1.5621756315231323,
-0.5100254416465759,
-0.13009627163410187,
1.3108726739883423,
-0.25033432245254517,
1.423515796661377,
-0.38030102849006653,
-0.09034518897533417,
-0.2796098589897156,
-0.4299139082431793,
0.01708785444498062,
-0.0839274525642395,
-0.6643987894058228,
0.23706480860710144,
-0.7502977848052979,
0.37443214654922485,
1.38765549659729,
0.39412400126457214,
-0.003828566987067461,
0.4832402467727661,
1.0732358694076538,
0.3888905644416809,
-0.03001384437084198,
-0.8360363841056824,
-1.5617207288742065,
1.983630895614624,
-1.4796925783157349,
1.9793988466262817,
0.775019109249115,
-0.06505832076072693,
-1.695220947265625,
-1.7991671562194824,
1.4485450983047485,
1.1590040922164917,
2.3528950214385986,
0.5508567690849304,
0.41987383365631104,
-0.8208760619163513,
-0.7443094253540039,
0.31133773922920227,
-1.0313268899917603,
-0.7301105260848999,
0.07630030810832977,
2.4081532955169678,
1.7988923788070679,
-0.42698219418525696,
-0.1863911747932434,
-0.9899306893348694,
1.4028830528259277,
-0.2349306344985962,
0.26231423020362854,
1.9904849529266357,
-0.28220874071121216,
-1.142384648323059,
1.3960716724395752,
-2.3221797943115234,
0.0447310209274292,
1.9977569580078125,
0.30103397369384766,
0.09090276062488556,
-1.3771135807037354,
-0.49492645263671875,
-0.331441730260849,
-0.5523610711097717,
-1.2608861923217773,
0.5357611179351807,
-0.3041812777519226,
-0.8175384402275085,
-1.2733650207519531,
0.22175228595733643,
-1.2209690809249878,
-1.565248727798462,
0.3227149248123169,
1.8107928037643433,
2.123690128326416,
-0.8011602759361267,
1.5874642133712769,
-0.2909051179885864,
0.24637815356254578,
1.1586476564407349,
1.2416718006134033,
3.110504627227783,
1.8755992650985718,
-1.3669167757034302,
0.655765950679779,
-0.1908571571111679,
-0.5018966197967529,
1.1857972145080566,
-1.2210932970046997,
1.3433812856674194,
-0.061903029680252075,
-1.234751582145691,
-1.1753593683242798,
0.8742913603782654,
0.49568235874176025,
0.07559602707624435,
-0.5248870849609375,
1.179282546043396,
0.014901830814778805,
1.2154346704483032,
0.4900110363960266,
-0.28928473591804504,
0.5582860112190247,
-0.39514753222465515,
-0.5557770133018494,
1.553432583808899,
0.03435596451163292,
-1.4839650392532349,
-2.1559338569641113,
-0.1260356605052948,
-0.8027786612510681,
0.17490032315254211,
-0.7238632440567017,
-1.016738772392273,
1.6374210119247437,
0.3465195596218109,
-1.2611714601516724,
-0.2574252188205719,
-0.4282146990299225,
-0.6071368455886841,
2.6187610626220703,
-1.3952144384384155,
-0.2371700555086136,
-1.0277968645095825,
-0.6649593710899353,
1.6580921411514282,
-1.1364266872406006,
-0.21336692571640015,
-0.951311469078064,
-0.6637430787086487,
-1.292916178703308,
-0.5564977526664734,
0.0077466173097491264,
-0.9504511952400208,
0.742119550704956,
0.2722775936126709,
-1.0542643070220947,
-0.3482115864753723,
-0.8063483238220215,
0.9140456914901733,
-0.15540120005607605,
0.18437643349170685,
1.8741427659988403,
0.2666875123977661,
-0.2889736592769623,
0.731098473072052,
1.216781497001648,
0.5726482272148132,
-0.6049782633781433,
0.10222222656011581,
-0.7135103344917297,
0.45156368613243103,
-1.3268308639526367,
0.23948723077774048,
-2.8180761337280273,
0.6419659852981567,
-0.017636079341173172,
-0.007279344368726015,
-0.004086786415427923,
-1.253089189529419,
1.1025699377059937,
2.6280109882354736,
-1.1376124620437622,
0.4524666666984558,
0.31024977564811707,
1.1842352151870728,
-1.6642428636550903,
0.13249927759170532,
-0.5423892140388489,
2.1645026206970215,
0.16787037253379822,
1.1557540893554688,
-0.4540040194988251,
-2.3912434577941895,
0.6820730566978455,
-1.1910542249679565,
-1.1874547004699707,
0.8611146807670593,
-0.9098837375640869,
0.19467948377132416,
-1.492958426475525,
-0.23916681110858917,
-0.8900787234306335,
-1.0601303577423096,
0.7021640539169312,
0.16460129618644714,
0.4878041744232178,
-0.6335223317146301,
0.3417249321937561,
-2.232370615005493,
-1.3560826778411865,
-0.14507611095905304,
-0.9469844102859497,
0.5473050475120544,
-0.3101058602333069,
0.6931146383285522,
-0.16004320979118347,
-0.05999945104122162,
0.39408475160598755,
1.4535225629806519,
3.360382318496704,
0.12939833104610443,
0.36583980917930603,
-0.1527254432439804,
-0.8759079575538635,
1.3659929037094116,
0.9409795999526978,
-0.1779569536447525,
-0.6304442882537842,
-1.1271629333496094,
1.348219871520996,
1.9111262559890747,
1.0133330821990967,
0.07795850932598114,
-0.8557611703872681,
-0.710820734500885,
-0.0030904491432011127,
0.1625552922487259,
0.46008771657943726,
0.895862340927124,
0.05518816038966179,
0.06036972627043724,
1.4112592935562134,
1.164651870727539,
-0.3956789970397949,
0.35540127754211426,
-0.8529433012008667,
-0.4635494351387024,
0.5882209539413452,
0.26365765929222107,
-0.04530327394604683,
0.4310956299304962,
-0.891121506690979,
-0.16506318747997284,
-0.32724541425704956,
-0.8987978100776672,
-0.6869591474533081,
-0.32895296812057495,
-0.2943706214427948,
1.656821370124817,
0.0886165127158165,
-0.572130024433136,
0.016022849828004837,
-0.9148297905921936,
-0.209905743598938,
-1.0779117345809937,
0.20231640338897705,
-0.09923326224088669,
-0.16712836921215057,
-0.1455838680267334,
1.6554466485977173,
-0.8948386907577515,
-2.0234293937683105,
0.11941210180521011,
0.2864963710308075,
-0.23282557725906372,
0.2243698239326477,
1.6920591592788696,
0.5473124384880066,
1.4238855838775635,
1.2995887994766235,
0.915253221988678,
-0.6527360677719116,
-1.2476170063018799,
0.6657904982566833,
1.0366777181625366,
-1.352869987487793,
0.8531225919723511,
-0.05772101506590843,
-0.5229977965354919,
0.5777467489242554,
1.2999303340911865,
0.4764743149280548,
-1.9456743001937866,
0.8796243071556091,
-1.0466121435165405,
0.7997974157333374,
0.6567378044128418,
0.6350302696228027,
0.2660275995731354,
0.8911247849464417,
-1.235562801361084,
-1.1697279214859009,
-0.760753870010376,
-0.7488093972206116,
2.018808364868164,
-0.20905597507953644,
0.6347901225090027,
-0.22344841063022614,
-1.2952947616577148,
-0.12106344848871231,
0.6511560678482056,
0.3459177315235138,
-0.37168893218040466,
0.7681452035903931,
-0.6986016035079956,
-1.0484375953674316,
-1.525109887123108,
-0.35719016194343567,
-1.0954183340072632,
-0.8409464955329895,
1.1188147068023682,
0.7919401526451111,
0.25647974014282227,
1.894824743270874,
0.7183055877685547,
0.258539617061615,
-2.4437203407287598,
0.844420313835144,
0.4085065722465515,
-0.13393595814704895,
0.9314306378364563,
0.3869825005531311,
1.0625985860824585,
0.01904981955885887,
0.5382217764854431,
-2.374877691268921,
2.1903738975524902,
-0.22166168689727783,
0.6688701510429382,
-0.005186804570257664,
-0.1760694980621338,
1.0659552812576294,
0.6418696641921997,
0.49213868379592896,
-1.1228981018066406,
0.584804892539978,
-0.5494658946990967,
1.2753336429595947,
1.0675774812698364,
-0.8527571558952332,
-0.051426686346530914,
1.3581863641738892,
0.3301854133605957,
-0.5314280390739441,
-0.9450830221176147,
-0.9743315577507019,
0.8931750655174255,
1.7217029333114624,
-0.10658532381057739,
-0.01538261491805315,
0.7675034999847412,
0.7746050357818604,
-1.3633453845977783,
0.0868171826004982,
-0.7363263964653015,
-0.7641669511795044,
1.7431671619415283,
2.1377151012420654,
-0.16762635111808777,
-0.12013321369886398,
-0.7418760657310486,
-1.2674833536148071,
0.8302239179611206,
-0.14852993190288544,
0.15459497272968292,
0.6361611485481262,
-0.7751073837280273,
1.0675251483917236,
1.0603207349777222,
0.747060239315033,
0.24068410694599152,
0.208685502409935,
0.36574673652648926,
-0.24202995002269745,
-1.175158143043518,
-0.316668838262558,
-1.0509452819824219,
-2.6592228412628174,
0.36408284306526184,
-0.2135932743549347,
-1.3718891143798828,
-0.00916301179677248,
-1.068444848060608,
0.9414942264556885,
-0.566517174243927,
-1.0452936887741089,
-1.5147794485092163,
0.2795720398426056,
0.06134048476815224,
0.9615294933319092,
-1.5560575723648071,
-0.21939152479171753,
1.1915570497512817,
0.8745578527450562,
-0.6153393983840942,
1.0416154861450195,
0.33449527621269226,
1.0751947164535522,
0.8196992874145508,
-0.4833395779132843,
0.5968950986862183,
0.008883579634130001,
-1.316942572593689,
0.5585237741470337,
1.1433601379394531,
0.21117042005062103,
1.5058234930038452,
-0.481172114610672,
0.01979086548089981,
0.3488268554210663,
-0.6223403215408325,
-0.4098179340362549,
-0.5806086659431458,
0.609577476978302,
0.03656207025051117,
-0.9033235907554626,
-0.1107715293765068,
-0.04403461143374443,
-0.3255966305732727,
0.19006557762622833,
-1.4721750020980835,
-0.11168469488620758,
-0.33968108892440796,
-0.5704721212387085,
-1.2460225820541382,
-0.06051511690020561,
1.4336400032043457,
-0.8955585956573486,
-0.16400933265686035,
0.40855079889297485,
0.30240294337272644,
0.4924176335334778,
0.710416316986084,
-0.7622431516647339,
-0.34232640266418457,
-0.22104868292808533,
-0.33992305397987366,
0.289645254611969,
1.2953866720199585,
-0.12105327099561691,
-0.9850965738296509,
0.5932890176773071,
-0.29273706674575806,
0.07486826181411743,
1.8280748128890991,
0.09544162452220917,
-0.8026280999183655,
0.32181665301322937,
-0.6986579298973083,
1.982555866241455,
1.7433909177780151,
1.3236198425292969,
-0.18479810655117035,
-0.9514570236206055,
0.5961427688598633,
-0.37779268622398376,
-0.3550875782966614,
0.9252227544784546,
0.2947911322116852,
-0.23734647035598755,
-1.5153212547302246,
0.6624361872673035,
1.2899051904678345,
-0.9129298329353333,
-0.731997549533844,
0.029841378331184387,
-0.7764636874198914,
1.056974172592163,
0.6825543642044067,
0.3367267847061157,
0.3575996458530426,
1.663863182067871,
0.7565373778343201,
-0.4806693196296692,
0.5380176901817322,
0.5159711241722107,
-0.07335152477025986,
-2.187666177749634,
-1.105055809020996,
0.2530314028263092,
-0.5017623901367188,
-1.5451282262802124,
1.3842507600784302,
-1.072147011756897,
-0.9950253963470459,
0.5319123864173889,
0.01197656150907278,
1.3578959703445435,
0.2538418471813202,
1.521762490272522,
2.0222184658050537,
0.8633520007133484,
0.2941129505634308,
1.2510145902633667,
-0.16922393441200256,
-0.4051722586154938,
1.753936767578125,
-0.4390742778778076,
0.4591558277606964,
1.1201082468032837,
-0.3404683768749237,
-1.027348279953003,
-0.7522260546684265,
-1.2485402822494507,
-0.7470186352729797,
1.1354743242263794,
0.03174611181020737,
-1.080340027809143,
0.21950045228004456,
1.6040778160095215,
0.07819212973117828,
-0.26678863167762756,
0.6241464614868164,
0.5341216325759888,
-0.9077156782150269,
-0.09818152338266373,
-0.8736677169799805,
0.5397403240203857,
-0.1829221546649933,
-0.3162173330783844,
0.28740784525871277,
0.48566243052482605,
1.4278072118759155,
-0.13712112605571747,
0.14966705441474915,
1.1077477931976318,
-1.4714453220367432,
1.4290574789047241,
-0.780772864818573,
0.29234108328819275,
-2.3378474712371826,
1.333397626876831,
-0.7560499310493469,
2.0092618465423584,
-2.68290638923645,
0.5947133898735046,
-0.6653397679328918,
-0.49545004963874817,
0.2931648790836334,
-0.36907827854156494,
0.17161716520786285,
-0.036618608981370926,
-1.1581841707229614,
-0.018261054530739784,
-0.6764445900917053,
0.6357938647270203,
1.1383684873580933,
1.4243524074554443,
-1.0985175371170044,
-0.31130486726760864,
-1.6747170686721802,
-0.19837456941604614,
-0.665216326713562,
0.21557992696762085,
-2.025118589401245,
-0.1402670294046402,
-1.9882651567459106,
-2.3787989616394043,
-1.3930752277374268,
-0.8067795038223267,
1.2297288179397583,
0.06829382479190826,
-0.9661176204681396,
1.2934590578079224,
-0.3962615132331848,
-1.8310800790786743,
1.1039860248565674,
-2.1388890743255615
] |
https://github.com/huggingface/datasets/issues/5111 | map and filter not working properly in multiprocessing with the new release 2.6.0 | > the one reported by @loubnabnl is related to multiprocessing in map and then filter; we should reproduce it first: I have tried with Python version 3.9.7 and I can't reproduce it either; maybe it is related to the version of PyArrow? To be checked.
So finally it was related to PyArrow version! :+1: | ## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2 | 477 | 54 | map and filter not working properly in multiprocessing with the new release 2.6.0
## Describe the bug
When mapping is used on a dataset with more than one process, there is a weird behavior when trying to use `filter` , it's like only the samples from one worker are retrieved, one needs to specify the same `num_proc` in filter for it to work properly. This doesn't happen with `datasets` version 2.5.2
In the code below the data is filtered differently when we increase `num_proc` used in `map` although the datsets before and after mapping have identical elements.
## Steps to reproduce the bug
```python
import datasets
from datasets import load_dataset
def preprocess(example):
return example
ds = load_dataset("codeparrot/codeparrot-clean-valid", split="train").select([i for i in range(10)])
ds1 = ds.map(preprocess, num_proc=2)
ds2 = ds.map(preprocess)
# the datasets elements are the same
for i in range(len(ds1)):
assert ds1[i]==ds2[i]
print(f'Target column before filtering {ds1["autogenerated"]}')
print(f'Target column before filtering {ds2["autogenerated"]}')
print(f"datasets version {datasets.__version__}")
ds_filtered_1 = ds1.filter(lambda x: not x["autogenerated"])
ds_filtered_2 = ds2.filter(lambda x: not x["autogenerated"])
# all elements in Target column are false so they should all be kept, but for ds2 only the first 5=num_samples/num_proc are kept
print(ds_filtered_1)
print(ds_filtered_2)
```
```
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Target column before filtering [False, False, False, False, False, False, False, False, False, False]
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 5
})
Dataset({
features: ['repo_name', 'path', 'copies', 'size', 'content', 'license', 'hash', 'line_mean', 'line_max', 'alpha_frac', 'autogenerated'],
num_rows: 10
})
```
## Expected results
Increasing `num_proc` in mapping shouldn't alter filtering. With the previous version 2.5.2 this doesn't happen
## Actual results
Filtering doesn't work properly when we increase `num_proc` in mapping but not when calling `filter`
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.6.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.28
- Python version: 3.9.13
- PyArrow version: 8.0.0
- Pandas version: 1.4.2
> the one reported by @loubnabnl is related to multiprocessing in map and then filter; we should reproduce it first: I have tried with Python version 3.9.7 and I can't reproduce it either; maybe it is related to the version of PyArrow? To be checked.
So finally it was related to PyArrow version! :+1: | [
-1.352843999862671,
-0.9489383101463318,
-0.7380266189575195,
1.3653239011764526,
-0.2156757116317749,
-1.1626625061035156,
0.19859008491039276,
-1.193071961402893,
1.6733355522155762,
-0.7513960599899292,
0.31026315689086914,
-1.72084379196167,
0.007246973924338818,
-0.7082626223564148,
-0.7887933254241943,
-0.8437585234642029,
-0.4116605222225189,
-0.7523932456970215,
1.1017882823944092,
2.4730443954467773,
1.2084859609603882,
-1.4340589046478271,
2.697086811065674,
0.7607104182243347,
-0.20602354407310486,
-1.000741720199585,
0.5457071661949158,
-0.05817698687314987,
-1.2278823852539062,
-0.4593156576156616,
-1.0296601057052612,
0.03622161224484444,
-0.5640300512313843,
-0.4410548508167267,
-0.08515094965696335,
0.36792615056037903,
-0.38905006647109985,
-0.3640885353088379,
-0.5134558081626892,
-0.8171752095222473,
0.5125590562820435,
-0.3884046971797943,
1.0048593282699585,
-0.34680455923080444,
1.793594479560852,
-0.5570852160453796,
0.5095599889755249,
0.6792799830436707,
1.336542010307312,
0.24689161777496338,
0.006785108707845211,
0.4661327600479126,
0.33547261357307434,
-0.039084721356630325,
0.5615963935852051,
1.2524054050445557,
0.6978742480278015,
0.47188377380371094,
0.8196986317634583,
-2.156207799911499,
1.2528531551361084,
-1.1066406965255737,
0.33222082257270813,
1.4115351438522339,
-0.8493854999542236,
0.33210253715515137,
-1.7599397897720337,
-0.04425366595387459,
0.6521478891372681,
-2.3162789344787598,
0.2995977997779846,
-1.27919340133667,
-0.5048683881759644,
1.078323245048523,
0.45950576663017273,
-1.2588427066802979,
0.10946755856275558,
-0.37329718470573425,
0.9714365005493164,
0.35684603452682495,
1.1564955711364746,
-1.6376603841781616,
-0.04867835342884064,
-0.3635140359401703,
0.05492449924349785,
-1.3257859945297241,
-1.4307327270507812,
0.5169233083724976,
0.5634656548500061,
0.6576090455055237,
-0.1427420675754547,
1.0496206283569336,
-1.0976380109786987,
0.7090063095092773,
-0.9661166071891785,
-1.6119598150253296,
-1.4128257036209106,
-2.291623115539551,
-2.273634433746338,
0.8197525143623352,
-0.41872870922088623,
-0.5719591379165649,
2.021575927734375,
-0.9523361921310425,
-1.7182625532150269,
1.1999105215072632,
0.36988332867622375,
0.0004202015697956085,
2.4817044734954834,
0.18493850529193878,
-0.8106722831726074,
0.6008914113044739,
-0.7502665519714355,
0.8027536869049072,
-0.34925419092178345,
1.327896237373352,
0.4561380445957184,
-1.0612645149230957,
1.628460168838501,
-0.39423635601997375,
0.5187291502952576,
-0.6074494123458862,
-0.5249357223510742,
-0.8257798552513123,
0.3605669438838959,
1.8437187671661377,
-0.2546614408493042,
1.5616862773895264,
-0.36114975810050964,
-1.57076096534729,
-1.644235610961914,
0.8591213822364807,
0.5475424528121948,
-0.7222733497619629,
0.12655296921730042,
-0.4101954400539398,
0.15647009015083313,
-0.09552298486232758,
1.159052848815918,
1.2761552333831787,
0.6186755299568176,
-0.32532963156700134,
-0.8480733633041382,
0.20687732100486755,
-0.09794370085000992,
-0.8096684813499451,
-1.7095060348510742,
-0.3229031264781952,
0.08813325315713882,
0.6513823866844177,
-1.200533390045166,
1.7762179374694824,
0.8353346586227417,
1.8862431049346924,
1.067116379737854,
-0.33585047721862793,
1.4812729358673096,
0.14742086827754974,
1.7066727876663208,
-0.5229436159133911,
0.6215577721595764,
-0.3223905563354492,
-1.1065716743469238,
0.8702681064605713,
-0.3996455669403076,
-2.044123888015747,
-0.7283399701118469,
-0.7253296971321106,
-0.12067362666130066,
-0.8233163356781006,
0.9613419771194458,
-0.3409569561481476,
-1.42781662940979,
0.35036900639533997,
-0.658052384853363,
0.11745937913656235,
-1.2482538223266602,
0.2546139061450958,
0.5985851287841797,
-0.6337411999702454,
-0.001809737179428339,
-0.15700726211071014,
-1.2436459064483643,
-0.3544852137565613,
0.17339321970939636,
1.8323628902435303,
-0.7161698937416077,
0.8825073838233948,
1.132197380065918,
-0.6953890919685364,
0.024699818342924118,
0.3942883312702179,
-0.2893776595592499,
0.7942770719528198,
-0.9977194666862488,
-0.4950154423713684,
1.1875135898590088,
-0.1709742695093155,
-0.4858299791812897,
1.4413151741027832,
0.6624630689620972,
-1.0681079626083374,
-0.1626148223876953,
-0.04255552589893341,
-0.8441759347915649,
0.0005662087351083755,
-1.535001277923584,
-0.13696789741516113,
0.45653510093688965,
-1.5621756315231323,
-0.5100254416465759,
-0.13009627163410187,
1.3108726739883423,
-0.25033432245254517,
1.423515796661377,
-0.38030102849006653,
-0.09034518897533417,
-0.2796098589897156,
-0.4299139082431793,
0.01708785444498062,
-0.0839274525642395,
-0.6643987894058228,
0.23706480860710144,
-0.7502977848052979,
0.37443214654922485,
1.38765549659729,
0.39412400126457214,
-0.003828566987067461,
0.4832402467727661,
1.0732358694076538,
0.3888905644416809,
-0.03001384437084198,
-0.8360363841056824,
-1.5617207288742065,
1.983630895614624,
-1.4796925783157349,
1.9793988466262817,
0.775019109249115,
-0.06505832076072693,
-1.695220947265625,
-1.7991671562194824,
1.4485450983047485,
1.1590040922164917,
2.3528950214385986,
0.5508567690849304,
0.41987383365631104,
-0.8208760619163513,
-0.7443094253540039,
0.31133773922920227,
-1.0313268899917603,
-0.7301105260848999,
0.07630030810832977,
2.4081532955169678,
1.7988923788070679,
-0.42698219418525696,
-0.1863911747932434,
-0.9899306893348694,
1.4028830528259277,
-0.2349306344985962,
0.26231423020362854,
1.9904849529266357,
-0.28220874071121216,
-1.142384648323059,
1.3960716724395752,
-2.3221797943115234,
0.0447310209274292,
1.9977569580078125,
0.30103397369384766,
0.09090276062488556,
-1.3771135807037354,
-0.49492645263671875,
-0.331441730260849,
-0.5523610711097717,
-1.2608861923217773,
0.5357611179351807,
-0.3041812777519226,
-0.8175384402275085,
-1.2733650207519531,
0.22175228595733643,
-1.2209690809249878,
-1.565248727798462,
0.3227149248123169,
1.8107928037643433,
2.123690128326416,
-0.8011602759361267,
1.5874642133712769,
-0.2909051179885864,
0.24637815356254578,
1.1586476564407349,
1.2416718006134033,
3.110504627227783,
1.8755992650985718,
-1.3669167757034302,
0.655765950679779,
-0.1908571571111679,
-0.5018966197967529,
1.1857972145080566,
-1.2210932970046997,
1.3433812856674194,
-0.061903029680252075,
-1.234751582145691,
-1.1753593683242798,
0.8742913603782654,
0.49568235874176025,
0.07559602707624435,
-0.5248870849609375,
1.179282546043396,
0.014901830814778805,
1.2154346704483032,
0.4900110363960266,
-0.28928473591804504,
0.5582860112190247,
-0.39514753222465515,
-0.5557770133018494,
1.553432583808899,
0.03435596451163292,
-1.4839650392532349,
-2.1559338569641113,
-0.1260356605052948,
-0.8027786612510681,
0.17490032315254211,
-0.7238632440567017,
-1.016738772392273,
1.6374210119247437,
0.3465195596218109,
-1.2611714601516724,
-0.2574252188205719,
-0.4282146990299225,
-0.6071368455886841,
2.6187610626220703,
-1.3952144384384155,
-0.2371700555086136,
-1.0277968645095825,
-0.6649593710899353,
1.6580921411514282,
-1.1364266872406006,
-0.21336692571640015,
-0.951311469078064,
-0.6637430787086487,
-1.292916178703308,
-0.5564977526664734,
0.0077466173097491264,
-0.9504511952400208,
0.742119550704956,
0.2722775936126709,
-1.0542643070220947,
-0.3482115864753723,
-0.8063483238220215,
0.9140456914901733,
-0.15540120005607605,
0.18437643349170685,
1.8741427659988403,
0.2666875123977661,
-0.2889736592769623,
0.731098473072052,
1.216781497001648,
0.5726482272148132,
-0.6049782633781433,
0.10222222656011581,
-0.7135103344917297,
0.45156368613243103,
-1.3268308639526367,
0.23948723077774048,
-2.8180761337280273,
0.6419659852981567,
-0.017636079341173172,
-0.007279344368726015,
-0.004086786415427923,
-1.253089189529419,
1.1025699377059937,
2.6280109882354736,
-1.1376124620437622,
0.4524666666984558,
0.31024977564811707,
1.1842352151870728,
-1.6642428636550903,
0.13249927759170532,
-0.5423892140388489,
2.1645026206970215,
0.16787037253379822,
1.1557540893554688,
-0.4540040194988251,
-2.3912434577941895,
0.6820730566978455,
-1.1910542249679565,
-1.1874547004699707,
0.8611146807670593,
-0.9098837375640869,
0.19467948377132416,
-1.492958426475525,
-0.23916681110858917,
-0.8900787234306335,
-1.0601303577423096,
0.7021640539169312,
0.16460129618644714,
0.4878041744232178,
-0.6335223317146301,
0.3417249321937561,
-2.232370615005493,
-1.3560826778411865,
-0.14507611095905304,
-0.9469844102859497,
0.5473050475120544,
-0.3101058602333069,
0.6931146383285522,
-0.16004320979118347,
-0.05999945104122162,
0.39408475160598755,
1.4535225629806519,
3.360382318496704,
0.12939833104610443,
0.36583980917930603,
-0.1527254432439804,
-0.8759079575538635,
1.3659929037094116,
0.9409795999526978,
-0.1779569536447525,
-0.6304442882537842,
-1.1271629333496094,
1.348219871520996,
1.9111262559890747,
1.0133330821990967,
0.07795850932598114,
-0.8557611703872681,
-0.710820734500885,
-0.0030904491432011127,
0.1625552922487259,
0.46008771657943726,
0.895862340927124,
0.05518816038966179,
0.06036972627043724,
1.4112592935562134,
1.164651870727539,
-0.3956789970397949,
0.35540127754211426,
-0.8529433012008667,
-0.4635494351387024,
0.5882209539413452,
0.26365765929222107,
-0.04530327394604683,
0.4310956299304962,
-0.891121506690979,
-0.16506318747997284,
-0.32724541425704956,
-0.8987978100776672,
-0.6869591474533081,
-0.32895296812057495,
-0.2943706214427948,
1.656821370124817,
0.0886165127158165,
-0.572130024433136,
0.016022849828004837,
-0.9148297905921936,
-0.209905743598938,
-1.0779117345809937,
0.20231640338897705,
-0.09923326224088669,
-0.16712836921215057,
-0.1455838680267334,
1.6554466485977173,
-0.8948386907577515,
-2.0234293937683105,
0.11941210180521011,
0.2864963710308075,
-0.23282557725906372,
0.2243698239326477,
1.6920591592788696,
0.5473124384880066,
1.4238855838775635,
1.2995887994766235,
0.915253221988678,
-0.6527360677719116,
-1.2476170063018799,
0.6657904982566833,
1.0366777181625366,
-1.352869987487793,
0.8531225919723511,
-0.05772101506590843,
-0.5229977965354919,
0.5777467489242554,
1.2999303340911865,
0.4764743149280548,
-1.9456743001937866,
0.8796243071556091,
-1.0466121435165405,
0.7997974157333374,
0.6567378044128418,
0.6350302696228027,
0.2660275995731354,
0.8911247849464417,
-1.235562801361084,
-1.1697279214859009,
-0.760753870010376,
-0.7488093972206116,
2.018808364868164,
-0.20905597507953644,
0.6347901225090027,
-0.22344841063022614,
-1.2952947616577148,
-0.12106344848871231,
0.6511560678482056,
0.3459177315235138,
-0.37168893218040466,
0.7681452035903931,
-0.6986016035079956,
-1.0484375953674316,
-1.525109887123108,
-0.35719016194343567,
-1.0954183340072632,
-0.8409464955329895,
1.1188147068023682,
0.7919401526451111,
0.25647974014282227,
1.894824743270874,
0.7183055877685547,
0.258539617061615,
-2.4437203407287598,
0.844420313835144,
0.4085065722465515,
-0.13393595814704895,
0.9314306378364563,
0.3869825005531311,
1.0625985860824585,
0.01904981955885887,
0.5382217764854431,
-2.374877691268921,
2.1903738975524902,
-0.22166168689727783,
0.6688701510429382,
-0.005186804570257664,
-0.1760694980621338,
1.0659552812576294,
0.6418696641921997,
0.49213868379592896,
-1.1228981018066406,
0.584804892539978,
-0.5494658946990967,
1.2753336429595947,
1.0675774812698364,
-0.8527571558952332,
-0.051426686346530914,
1.3581863641738892,
0.3301854133605957,
-0.5314280390739441,
-0.9450830221176147,
-0.9743315577507019,
0.8931750655174255,
1.7217029333114624,
-0.10658532381057739,
-0.01538261491805315,
0.7675034999847412,
0.7746050357818604,
-1.3633453845977783,
0.0868171826004982,
-0.7363263964653015,
-0.7641669511795044,
1.7431671619415283,
2.1377151012420654,
-0.16762635111808777,
-0.12013321369886398,
-0.7418760657310486,
-1.2674833536148071,
0.8302239179611206,
-0.14852993190288544,
0.15459497272968292,
0.6361611485481262,
-0.7751073837280273,
1.0675251483917236,
1.0603207349777222,
0.747060239315033,
0.24068410694599152,
0.208685502409935,
0.36574673652648926,
-0.24202995002269745,
-1.175158143043518,
-0.316668838262558,
-1.0509452819824219,
-2.6592228412628174,
0.36408284306526184,
-0.2135932743549347,
-1.3718891143798828,
-0.00916301179677248,
-1.068444848060608,
0.9414942264556885,
-0.566517174243927,
-1.0452936887741089,
-1.5147794485092163,
0.2795720398426056,
0.06134048476815224,
0.9615294933319092,
-1.5560575723648071,
-0.21939152479171753,
1.1915570497512817,
0.8745578527450562,
-0.6153393983840942,
1.0416154861450195,
0.33449527621269226,
1.0751947164535522,
0.8196992874145508,
-0.4833395779132843,
0.5968950986862183,
0.008883579634130001,
-1.316942572593689,
0.5585237741470337,
1.1433601379394531,
0.21117042005062103,
1.5058234930038452,
-0.481172114610672,
0.01979086548089981,
0.3488268554210663,
-0.6223403215408325,
-0.4098179340362549,
-0.5806086659431458,
0.609577476978302,
0.03656207025051117,
-0.9033235907554626,
-0.1107715293765068,
-0.04403461143374443,
-0.3255966305732727,
0.19006557762622833,
-1.4721750020980835,
-0.11168469488620758,
-0.33968108892440796,
-0.5704721212387085,
-1.2460225820541382,
-0.06051511690020561,
1.4336400032043457,
-0.8955585956573486,
-0.16400933265686035,
0.40855079889297485,
0.30240294337272644,
0.4924176335334778,
0.710416316986084,
-0.7622431516647339,
-0.34232640266418457,
-0.22104868292808533,
-0.33992305397987366,
0.289645254611969,
1.2953866720199585,
-0.12105327099561691,
-0.9850965738296509,
0.5932890176773071,
-0.29273706674575806,
0.07486826181411743,
1.8280748128890991,
0.09544162452220917,
-0.8026280999183655,
0.32181665301322937,
-0.6986579298973083,
1.982555866241455,
1.7433909177780151,
1.3236198425292969,
-0.18479810655117035,
-0.9514570236206055,
0.5961427688598633,
-0.37779268622398376,
-0.3550875782966614,
0.9252227544784546,
0.2947911322116852,
-0.23734647035598755,
-1.5153212547302246,
0.6624361872673035,
1.2899051904678345,
-0.9129298329353333,
-0.731997549533844,
0.029841378331184387,
-0.7764636874198914,
1.056974172592163,
0.6825543642044067,
0.3367267847061157,
0.3575996458530426,
1.663863182067871,
0.7565373778343201,
-0.4806693196296692,
0.5380176901817322,
0.5159711241722107,
-0.07335152477025986,
-2.187666177749634,
-1.105055809020996,
0.2530314028263092,
-0.5017623901367188,
-1.5451282262802124,
1.3842507600784302,
-1.072147011756897,
-0.9950253963470459,
0.5319123864173889,
0.01197656150907278,
1.3578959703445435,
0.2538418471813202,
1.521762490272522,
2.0222184658050537,
0.8633520007133484,
0.2941129505634308,
1.2510145902633667,
-0.16922393441200256,
-0.4051722586154938,
1.753936767578125,
-0.4390742778778076,
0.4591558277606964,
1.1201082468032837,
-0.3404683768749237,
-1.027348279953003,
-0.7522260546684265,
-1.2485402822494507,
-0.7470186352729797,
1.1354743242263794,
0.03174611181020737,
-1.080340027809143,
0.21950045228004456,
1.6040778160095215,
0.07819212973117828,
-0.26678863167762756,
0.6241464614868164,
0.5341216325759888,
-0.9077156782150269,
-0.09818152338266373,
-0.8736677169799805,
0.5397403240203857,
-0.1829221546649933,
-0.3162173330783844,
0.28740784525871277,
0.48566243052482605,
1.4278072118759155,
-0.13712112605571747,
0.14966705441474915,
1.1077477931976318,
-1.4714453220367432,
1.4290574789047241,
-0.780772864818573,
0.29234108328819275,
-2.3378474712371826,
1.333397626876831,
-0.7560499310493469,
2.0092618465423584,
-2.68290638923645,
0.5947133898735046,
-0.6653397679328918,
-0.49545004963874817,
0.2931648790836334,
-0.36907827854156494,
0.17161716520786285,
-0.036618608981370926,
-1.1581841707229614,
-0.018261054530739784,
-0.6764445900917053,
0.6357938647270203,
1.1383684873580933,
1.4243524074554443,
-1.0985175371170044,
-0.31130486726760864,
-1.6747170686721802,
-0.19837456941604614,
-0.665216326713562,
0.21557992696762085,
-2.025118589401245,
-0.1402670294046402,
-1.9882651567459106,
-2.3787989616394043,
-1.3930752277374268,
-0.8067795038223267,
1.2297288179397583,
0.06829382479190826,
-0.9661176204681396,
1.2934590578079224,
-0.3962615132331848,
-1.8310800790786743,
1.1039860248565674,
-2.1388890743255615
] |
https://github.com/huggingface/datasets/issues/5109 | Map caching not working for some class methods | The hash used for caching is computed by pickling recursively the function passed to `map`. Maybe some objects don't have the same hash across sessions. In particular you can check the hash of your model using
```python
from datasets.fingerprint import Hasher
obj = AutoModel.from_config(config=config, add_pooling_layer=False)
print(Hasher.hash(obj))
```
You can find mode info here: https://huggingface.co/docs/datasets/about_cache
You can also provide your own unique hash in `map` if you want, with the `new_fingerprint` argument | ## Describe the bug
The cache loading is not working as expected for some class methods with a model stored in an attribute.
The new fingerprint for `_map_single` is not the same at each run. The hasher generate a different hash for the class method.
This comes from `dumps` function in `datasets.utils.py_utils` which generates a different dump at each run.
## Steps to reproduce the bug
```python
from datasets import load_dataset
from transformers import AutoConfig, AutoModel, AutoTokenizer
dataset = load_dataset("ethos", "binary")
BASE_MODELNAME = "sentence-transformers/all-MiniLM-L6-v2"
class Object:
def __init__(self):
config = AutoConfig.from_pretrained(BASE_MODELNAME)
self.bert = AutoModel.from_config(config=config, add_pooling_layer=False)
self.tok = AutoTokenizer.from_pretrained(BASE_MODELNAME)
def tokenize(self, examples):
tokenized_texts = self.tok(
examples["text"],
padding="max_length",
truncation=True,
max_length=256,
)
return tokenized_texts
instance = Object()
result = dict()
for phase in ["train"]:
result[phase] = dataset[phase].map(instance.tokenize, batched=True, load_from_cache_file=True, num_proc=2)
```
## Expected results
Load cache instead of recompute result.
## Actual results
Result recomputed from scratch at each run.
The cache works fine when deleting `bert` attribute.
## Environment info
- `datasets` version: 2.5.3.dev0
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.13
- PyArrow version: 7.0.0
- Pandas version: 1.5.0
| 478 | 71 | Map caching not working for some class methods
## Describe the bug
The cache loading is not working as expected for some class methods with a model stored in an attribute.
The new fingerprint for `_map_single` is not the same at each run. The hasher generate a different hash for the class method.
This comes from `dumps` function in `datasets.utils.py_utils` which generates a different dump at each run.
## Steps to reproduce the bug
```python
from datasets import load_dataset
from transformers import AutoConfig, AutoModel, AutoTokenizer
dataset = load_dataset("ethos", "binary")
BASE_MODELNAME = "sentence-transformers/all-MiniLM-L6-v2"
class Object:
def __init__(self):
config = AutoConfig.from_pretrained(BASE_MODELNAME)
self.bert = AutoModel.from_config(config=config, add_pooling_layer=False)
self.tok = AutoTokenizer.from_pretrained(BASE_MODELNAME)
def tokenize(self, examples):
tokenized_texts = self.tok(
examples["text"],
padding="max_length",
truncation=True,
max_length=256,
)
return tokenized_texts
instance = Object()
result = dict()
for phase in ["train"]:
result[phase] = dataset[phase].map(instance.tokenize, batched=True, load_from_cache_file=True, num_proc=2)
```
## Expected results
Load cache instead of recompute result.
## Actual results
Result recomputed from scratch at each run.
The cache works fine when deleting `bert` attribute.
## Environment info
- `datasets` version: 2.5.3.dev0
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.13
- PyArrow version: 7.0.0
- Pandas version: 1.5.0
The hash used for caching is computed by pickling recursively the function passed to `map`. Maybe some objects don't have the same hash across sessions. In particular you can check the hash of your model using
```python
from datasets.fingerprint import Hasher
obj = AutoModel.from_config(config=config, add_pooling_layer=False)
print(Hasher.hash(obj))
```
You can find mode info here: https://huggingface.co/docs/datasets/about_cache
You can also provide your own unique hash in `map` if you want, with the `new_fingerprint` argument | [
-1.2287007570266724,
-0.8935288190841675,
-0.6418910026550293,
1.496227502822876,
-0.1624547243118286,
-1.222113847732544,
0.23424871265888214,
-1.111129879951477,
1.641094446182251,
-0.8428345322608948,
0.33404481410980225,
-1.6356860399246216,
0.03107941895723343,
-0.580826997756958,
-0.7342216372489929,
-0.8236911296844482,
-0.462751567363739,
-0.6911619305610657,
1.1318153142929077,
2.3998477458953857,
1.2237855195999146,
-1.3701746463775635,
2.6843690872192383,
0.7481212019920349,
-0.20629163086414337,
-0.9625731110572815,
0.5607544183731079,
0.03926749899983406,
-1.3566194772720337,
-0.44198328256607056,
-1.030225157737732,
-0.09134608507156372,
-0.6018310785293579,
-0.46031010150909424,
-0.03029707260429859,
0.38115811347961426,
-0.2996874451637268,
-0.43221592903137207,
-0.5590705871582031,
-0.782136082649231,
0.4431114196777344,
-0.3581138849258423,
0.9122877717018127,
-0.31087031960487366,
1.821462631225586,
-0.5964218974113464,
0.5187110900878906,
0.7727075219154358,
1.3441063165664673,
0.19209516048431396,
-0.07024092972278595,
0.3287336826324463,
0.4051799774169922,
-0.05611046403646469,
0.5427348017692566,
1.15418541431427,
0.704781711101532,
0.50545334815979,
0.7329968214035034,
-2.163585901260376,
1.3252928256988525,
-0.9985229969024658,
0.31384897232055664,
1.3114639520645142,
-0.9364779591560364,
0.4007616341114044,
-1.7341893911361694,
-0.05144111067056656,
0.5305891633033752,
-2.2035725116729736,
0.3285060524940491,
-1.31304931640625,
-0.5121113657951355,
1.0871599912643433,
0.4126226603984833,
-1.2314728498458862,
0.03585394099354744,
-0.4088467061519623,
1.027331829071045,
0.3652433156967163,
1.0507571697235107,
-1.7065625190734863,
-0.029732946306467056,
-0.3536263704299927,
0.1582181304693222,
-1.2208853960037231,
-1.5397584438323975,
0.5637845993041992,
0.6161249876022339,
0.5593514442443848,
-0.17570018768310547,
1.0723906755447388,
-1.0465556383132935,
0.7774431705474854,
-1.007865309715271,
-1.7094666957855225,
-1.4214978218078613,
-2.282322883605957,
-2.23555326461792,
0.6926205158233643,
-0.44913625717163086,
-0.5679975152015686,
2.1488265991210938,
-1.0097181797027588,
-1.6592340469360352,
1.1122944355010986,
0.19890007376670837,
0.05223624035716057,
2.373703718185425,
0.22106695175170898,
-0.701552152633667,
0.43236243724823,
-0.7933072447776794,
0.7422492504119873,
-0.36926746368408203,
1.3223378658294678,
0.4216175377368927,
-1.097314715385437,
1.5448963642120361,
-0.35238006711006165,
0.5372801423072815,
-0.642267107963562,
-0.4459059238433838,
-0.6815207004547119,
0.22684119641780853,
1.8952082395553589,
-0.2320835441350937,
1.467390775680542,
-0.3450978696346283,
-1.5551761388778687,
-1.6126798391342163,
0.8342326283454895,
0.5349863767623901,
-0.6821989417076111,
0.08527344465255737,
-0.33734965324401855,
0.09019534289836884,
-0.0534563809633255,
1.1507866382598877,
1.3366813659667969,
0.7829133868217468,
-0.35004138946533203,
-0.827353835105896,
0.09344939887523651,
-0.10512875020503998,
-0.7869992852210999,
-1.7636048793792725,
-0.3313753306865692,
0.07376247644424438,
0.6495661735534668,
-1.2140886783599854,
1.7872427701950073,
0.9066367149353027,
1.8819806575775146,
1.0100330114364624,
-0.39989957213401794,
1.4973498582839966,
0.10087701678276062,
1.792856216430664,
-0.5002170205116272,
0.6762112379074097,
-0.3367752432823181,
-1.1871131658554077,
0.7996696829795837,
-0.31649157404899597,
-2.0475549697875977,
-0.7886543273925781,
-0.6666082739830017,
-0.14305271208286285,
-0.7891350984573364,
0.9650883078575134,
-0.26895248889923096,
-1.4507561922073364,
0.2380366325378418,
-0.7478860020637512,
0.15915478765964508,
-1.1702015399932861,
0.32545962929725647,
0.7303667068481445,
-0.6582903861999512,
0.08741980791091919,
-0.24504365026950836,
-1.2599811553955078,
-0.47841039299964905,
0.3038206100463867,
1.858572006225586,
-0.7567523121833801,
0.9259446263313293,
1.0347172021865845,
-0.7100824117660522,
-0.033203259110450745,
0.3644368052482605,
-0.3262098729610443,
0.9173666834831238,
-1.0683859586715698,
-0.5073211193084717,
1.2506887912750244,
-0.19781877100467682,
-0.6045249700546265,
1.4407721757888794,
0.7028624415397644,
-1.005039095878601,
-0.20971104502677917,
-0.10513846576213837,
-0.8592119812965393,
0.08842411637306213,
-1.607854962348938,
-0.14257462322711945,
0.41477885842323303,
-1.5629892349243164,
-0.4395779073238373,
-0.17384468019008636,
1.3471531867980957,
-0.19697128236293793,
1.4216678142547607,
-0.30259403586387634,
-0.12519079446792603,
-0.3796416223049164,
-0.3627158999443054,
0.1193748414516449,
-0.16462673246860504,
-0.560846209526062,
0.22170262038707733,
-0.8012883067131042,
0.36366578936576843,
1.4246059656143188,
0.3022252321243286,
0.027419667690992355,
0.47983860969543457,
1.0450078248977661,
0.3904452919960022,
-0.14545714855194092,
-0.9136140942573547,
-1.5943557024002075,
1.956998586654663,
-1.419594407081604,
2.004875421524048,
0.8454718589782715,
-0.009121987968683243,
-1.8154133558273315,
-1.8164100646972656,
1.3189796209335327,
1.147660255432129,
2.3683056831359863,
0.517292320728302,
0.38546428084373474,
-0.8138720989227295,
-0.692234992980957,
0.37432941794395447,
-1.0274096727371216,
-0.7047781348228455,
0.2062358260154724,
2.3994174003601074,
1.7717278003692627,
-0.3265449106693268,
-0.2410164773464203,
-1.0469473600387573,
1.4371709823608398,
-0.1847078502178192,
0.18483959138393402,
1.972893476486206,
-0.20377817749977112,
-1.035520315170288,
1.2899324893951416,
-2.3119258880615234,
0.19314739108085632,
1.9940677881240845,
0.25991931557655334,
0.1321580708026886,
-1.4193294048309326,
-0.7045764327049255,
-0.2664680480957031,
-0.45696118474006653,
-1.2038533687591553,
0.5367372035980225,
-0.21831463277339935,
-0.762080729007721,
-1.442858099937439,
0.2065025120973587,
-1.151474118232727,
-1.7159253358840942,
0.22937627136707306,
1.8418223857879639,
2.058366298675537,
-0.7628540396690369,
1.5450217723846436,
-0.3451444208621979,
0.1385945826768875,
1.2142207622528076,
1.248400092124939,
3.1544196605682373,
1.921417474746704,
-1.3541769981384277,
0.644934892654419,
-0.1451168656349182,
-0.4690718650817871,
1.0897756814956665,
-1.246559500694275,
1.3473889827728271,
-0.12239918112754822,
-1.1658717393875122,
-1.22231924533844,
0.9732388854026794,
0.46536678075790405,
0.0542447604238987,
-0.4698573052883148,
1.2077492475509644,
0.11639618873596191,
1.4076639413833618,
0.5597668886184692,
-0.28403767943382263,
0.6266759037971497,
-0.3810463845729828,
-0.5138145089149475,
1.5820817947387695,
0.2072446346282959,
-1.4049222469329834,
-2.291743040084839,
-0.24039427936077118,
-0.8677248954772949,
0.08937130868434906,
-0.6347506642341614,
-1.0036159753799438,
1.6361403465270996,
0.37176141142845154,
-1.3244253396987915,
-0.2824012041091919,
-0.30303093791007996,
-0.5505517721176147,
2.7170140743255615,
-1.3824238777160645,
-0.1697588711977005,
-0.9932992458343506,
-0.6616383790969849,
1.5934760570526123,
-1.2259974479675293,
-0.23381173610687256,
-1.0732512474060059,
-0.5773624777793884,
-1.2616028785705566,
-0.5596981048583984,
0.034593526273965836,
-0.9529695510864258,
0.7868180274963379,
0.19712384045124054,
-1.2162342071533203,
-0.39935216307640076,
-0.8733152747154236,
0.9655359387397766,
-0.07543009519577026,
0.13550874590873718,
1.783931851387024,
0.34721457958221436,
-0.37811100482940674,
0.7383140325546265,
1.1497164964675903,
0.6125490665435791,
-0.6129056811332703,
0.235550194978714,
-0.6790771484375,
0.3785399794578552,
-1.318800449371338,
0.3285526633262634,
-2.893792152404785,
0.6488531827926636,
-0.07363371551036835,
-0.06825469434261322,
-0.06903181970119476,
-1.3324171304702759,
1.0771242380142212,
2.6152243614196777,
-1.1753897666931152,
0.4869286119937897,
0.3317848742008209,
1.0633224248886108,
-1.589241623878479,
0.31161049008369446,
-0.45145851373672485,
2.009653091430664,
0.23763637244701385,
1.2437371015548706,
-0.49334415793418884,
-2.368483066558838,
0.6710609197616577,
-1.278562068939209,
-1.1392009258270264,
0.8372623324394226,
-0.8280799984931946,
0.13496781885623932,
-1.3024210929870605,
-0.3005969524383545,
-0.7686390280723572,
-1.2147712707519531,
0.6260865926742554,
0.14073094725608826,
0.46296003460884094,
-0.6069512367248535,
0.3240306079387665,
-2.1869778633117676,
-1.2835439443588257,
-0.19775862991809845,
-0.9269221425056458,
0.45218804478645325,
-0.3667912781238556,
0.659266471862793,
-0.17938920855522156,
0.02787608653306961,
0.3572463095188141,
1.4293609857559204,
3.4047365188598633,
0.18176597356796265,
0.2810278832912445,
-0.18244005739688873,
-0.9649490118026733,
1.379886269569397,
0.8926876187324524,
-0.10686059296131134,
-0.5872176885604858,
-1.1028482913970947,
1.1870436668395996,
1.9196767807006836,
0.9254463315010071,
-0.03488284349441528,
-0.8900214433670044,
-0.7348818778991699,
0.0073050521314144135,
0.19595474004745483,
0.44627645611763,
0.9303301572799683,
0.18233239650726318,
0.06264439225196838,
1.5060174465179443,
1.2082051038742065,
-0.4104858934879303,
0.30293965339660645,
-0.8747389316558838,
-0.4866251051425934,
0.5131639838218689,
0.3427823483943939,
-0.06924896687269211,
0.2795132100582123,
-1.0285124778747559,
-0.19078107178211212,
-0.4213804006576538,
-0.9396380186080933,
-0.7773850560188293,
-0.3339639902114868,
-0.3551359474658966,
1.6284583806991577,
0.10374376177787781,
-0.46378037333488464,
0.01673762872815132,
-0.7871401906013489,
-0.10026009380817413,
-1.0630155801773071,
0.32144179940223694,
-0.12524008750915527,
-0.08554592728614807,
-0.18421518802642822,
1.7919341325759888,
-0.9117418527603149,
-2.0100793838500977,
0.24666623771190643,
0.17483066022396088,
-0.25069642066955566,
0.21264392137527466,
1.7022699117660522,
0.5729947686195374,
1.4122425317764282,
1.307866096496582,
0.9440872073173523,
-0.6427516937255859,
-1.3376023769378662,
0.6755814552307129,
0.9928157329559326,
-1.386025309562683,
0.7539526224136353,
-0.05701391026377678,
-0.5012086033821106,
0.627159833908081,
1.3115365505218506,
0.5478358864784241,
-1.9947112798690796,
0.7721489667892456,
-1.014244556427002,
0.7823829650878906,
0.7501171827316284,
0.6481890082359314,
0.1485561579465866,
0.7958725690841675,
-1.2511261701583862,
-1.0771784782409668,
-0.6475357413291931,
-0.6543685793876648,
1.9947282075881958,
-0.43208667635917664,
0.6102385520935059,
-0.20904132723808289,
-1.3750027418136597,
-0.07683961093425751,
0.6874873042106628,
0.29878875613212585,
-0.5589868426322937,
0.8056396842002869,
-0.6275301575660706,
-1.0957250595092773,
-1.3450992107391357,
-0.42469310760498047,
-1.0432921648025513,
-0.9416512250900269,
1.0520602464675903,
0.7298210263252258,
0.3339795768260956,
1.9314086437225342,
0.6516861319541931,
0.26857608556747437,
-2.6290652751922607,
0.8575726747512817,
0.2733021378517151,
-0.0753842145204544,
0.883422315120697,
0.3257555365562439,
1.0197794437408447,
-0.025668175891041756,
0.5626324415206909,
-2.4607796669006348,
2.354558229446411,
-0.1473531872034073,
0.6620789170265198,
-0.034963458776474,
-0.18237948417663574,
1.1640698909759521,
0.6577290296554565,
0.5678743124008179,
-1.0474084615707397,
0.6473489999771118,
-0.5623791813850403,
1.261986494064331,
0.7994662523269653,
-0.7997769117355347,
-0.1061534583568573,
1.338991403579712,
0.46666812896728516,
-0.5066878199577332,
-0.8968310952186584,
-1.0640833377838135,
0.9168757796287537,
1.7825663089752197,
-0.028280798345804214,
-0.02462937869131565,
0.7740517854690552,
0.6910008192062378,
-1.3250218629837036,
0.04535819962620735,
-0.7082041501998901,
-0.7725745439529419,
1.6674752235412598,
2.0954408645629883,
-0.15819266438484192,
-0.2723701298236847,
-0.7162017226219177,
-1.2591086626052856,
0.8364166021347046,
-0.05061209201812744,
0.09604281187057495,
0.61147540807724,
-0.6104455590248108,
1.1079078912734985,
0.8828467130661011,
0.9489598870277405,
0.28022629022598267,
0.2949599623680115,
0.3600810766220093,
-0.3201907277107239,
-1.312860131263733,
-0.22451427578926086,
-1.040454387664795,
-2.5822839736938477,
0.42125263810157776,
-0.18432177603244781,
-1.4419574737548828,
0.06592875719070435,
-1.0628074407577515,
0.7923029065132141,
-0.545383632183075,
-1.1684051752090454,
-1.522149682044983,
0.18782693147659302,
-0.03873657435178757,
0.9678657650947571,
-1.545290470123291,
-0.07095062732696533,
1.1989002227783203,
0.9100054502487183,
-0.664626955986023,
1.012500286102295,
0.18460148572921753,
1.0786445140838623,
0.873944103717804,
-0.35291725397109985,
0.5122331976890564,
0.09084351360797882,
-1.2826378345489502,
0.4143303632736206,
1.2214547395706177,
0.20687222480773926,
1.519036889076233,
-0.6014078259468079,
0.03072553128004074,
0.4158339500427246,
-0.5587643980979919,
-0.48231300711631775,
-0.5231908559799194,
0.6476463079452515,
0.05135326832532883,
-0.8535711765289307,
-0.05611220747232437,
-0.041134241968393326,
-0.25912049412727356,
0.19771568477153778,
-1.5089807510375977,
-0.10816177725791931,
-0.35771721601486206,
-0.6005271077156067,
-1.220292091369629,
-0.0870717316865921,
1.411551833152771,
-0.70769864320755,
-0.21383251249790192,
0.4625844359397888,
0.26612281799316406,
0.5228140354156494,
0.7078663110733032,
-0.7469772696495056,
-0.3738217353820801,
-0.20431159436702728,
-0.37227270007133484,
0.4314028322696686,
1.4027117490768433,
-0.11183775961399078,
-0.9483428001403809,
0.642024576663971,
-0.3502776622772217,
0.14445480704307556,
1.9683085680007935,
0.08449900150299072,
-0.8236024975776672,
0.3162342607975006,
-0.782612681388855,
1.9545072317123413,
1.7244988679885864,
1.2957910299301147,
-0.12836572527885437,
-0.9256395101547241,
0.6476603746414185,
-0.37530815601348877,
-0.3816310465335846,
0.924615740776062,
0.38359782099723816,
-0.169500470161438,
-1.345781683921814,
0.6858893632888794,
1.248888611793518,
-0.8711729645729065,
-0.8520345091819763,
0.1653924137353897,
-0.8042604923248291,
1.0975823402404785,
0.6804742813110352,
0.3897054195404053,
0.27486351132392883,
1.6277977228164673,
0.8124639391899109,
-0.3966342508792877,
0.5593149662017822,
0.47821080684661865,
-0.19745281338691711,
-2.090237855911255,
-1.1342464685440063,
0.3343071937561035,
-0.6265610456466675,
-1.623130202293396,
1.4267113208770752,
-1.1663243770599365,
-1.0139567852020264,
0.5453140139579773,
0.04006002098321915,
1.384523868560791,
0.34488216042518616,
1.5568650960922241,
2.0261123180389404,
0.9226049780845642,
0.3861807882785797,
1.2604761123657227,
-0.14061789214611053,
-0.47101691365242004,
1.796520471572876,
-0.5122076869010925,
0.49967628717422485,
1.1427276134490967,
-0.26214107871055603,
-1.0424158573150635,
-0.7965967059135437,
-1.1772840023040771,
-0.7949025630950928,
1.1763943433761597,
0.11473076045513153,
-1.1208486557006836,
0.2841266095638275,
1.5610318183898926,
0.11795349419116974,
-0.24888768792152405,
0.6467695236206055,
0.37205180525779724,
-0.7510287761688232,
-0.10787370800971985,
-0.8905961513519287,
0.48649296164512634,
-0.2917622923851013,
-0.4081006944179535,
0.2487516552209854,
0.46698492765426636,
1.3215140104293823,
-0.07307383418083191,
0.14799864590168,
1.1191052198410034,
-1.4707913398742676,
1.5022246837615967,
-0.6823806166648865,
0.3643238842487335,
-2.4148435592651367,
1.3808674812316895,
-0.7548211812973022,
1.8977000713348389,
-2.699578285217285,
0.4730294644832611,
-0.5249580144882202,
-0.5372807383537292,
0.27068087458610535,
-0.34511399269104004,
0.16063718497753143,
-0.14439289271831512,
-1.1804791688919067,
-0.09431758522987366,
-0.6869162917137146,
0.5900416374206543,
1.112440824508667,
1.347495675086975,
-1.1327407360076904,
-0.25399500131607056,
-1.6937958002090454,
-0.16224224865436554,
-0.740182638168335,
0.3239092230796814,
-1.9302327632904053,
-0.17952851951122284,
-1.8905054330825806,
-2.398189067840576,
-1.273858666419983,
-0.7755867838859558,
1.1195673942565918,
0.11817769706249237,
-0.8163637518882751,
1.175683856010437,
-0.4261425733566284,
-1.8096015453338623,
1.109792709350586,
-2.1942005157470703
] |
https://github.com/huggingface/datasets/issues/5109 | Map caching not working for some class methods | Indeed, the hash is changing. The `dumps` function serialize the model object in different ways because the model object is not deterministic
```python
from datasets.utils.py_utils import dumps
obj1 = AutoModel.from_config(config=config, add_pooling_layer=False)
obj2 = AutoModel.from_config(config=config, add_pooling_layer=False)
dumps(bert) == dumps(bert2). # False
```
> You can find mode info here: https://huggingface.co/docs/datasets/about_cache
>
> You can also provide your own unique hash in map if you want, with the new_fingerprint argument
Thanks, the doc is so helpful. Indeed, we can fix the hash and get cache hit using `new_fingerprint`. Closing the issue. | ## Describe the bug
The cache loading is not working as expected for some class methods with a model stored in an attribute.
The new fingerprint for `_map_single` is not the same at each run. The hasher generate a different hash for the class method.
This comes from `dumps` function in `datasets.utils.py_utils` which generates a different dump at each run.
## Steps to reproduce the bug
```python
from datasets import load_dataset
from transformers import AutoConfig, AutoModel, AutoTokenizer
dataset = load_dataset("ethos", "binary")
BASE_MODELNAME = "sentence-transformers/all-MiniLM-L6-v2"
class Object:
def __init__(self):
config = AutoConfig.from_pretrained(BASE_MODELNAME)
self.bert = AutoModel.from_config(config=config, add_pooling_layer=False)
self.tok = AutoTokenizer.from_pretrained(BASE_MODELNAME)
def tokenize(self, examples):
tokenized_texts = self.tok(
examples["text"],
padding="max_length",
truncation=True,
max_length=256,
)
return tokenized_texts
instance = Object()
result = dict()
for phase in ["train"]:
result[phase] = dataset[phase].map(instance.tokenize, batched=True, load_from_cache_file=True, num_proc=2)
```
## Expected results
Load cache instead of recompute result.
## Actual results
Result recomputed from scratch at each run.
The cache works fine when deleting `bert` attribute.
## Environment info
- `datasets` version: 2.5.3.dev0
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.13
- PyArrow version: 7.0.0
- Pandas version: 1.5.0
| 478 | 89 | Map caching not working for some class methods
## Describe the bug
The cache loading is not working as expected for some class methods with a model stored in an attribute.
The new fingerprint for `_map_single` is not the same at each run. The hasher generate a different hash for the class method.
This comes from `dumps` function in `datasets.utils.py_utils` which generates a different dump at each run.
## Steps to reproduce the bug
```python
from datasets import load_dataset
from transformers import AutoConfig, AutoModel, AutoTokenizer
dataset = load_dataset("ethos", "binary")
BASE_MODELNAME = "sentence-transformers/all-MiniLM-L6-v2"
class Object:
def __init__(self):
config = AutoConfig.from_pretrained(BASE_MODELNAME)
self.bert = AutoModel.from_config(config=config, add_pooling_layer=False)
self.tok = AutoTokenizer.from_pretrained(BASE_MODELNAME)
def tokenize(self, examples):
tokenized_texts = self.tok(
examples["text"],
padding="max_length",
truncation=True,
max_length=256,
)
return tokenized_texts
instance = Object()
result = dict()
for phase in ["train"]:
result[phase] = dataset[phase].map(instance.tokenize, batched=True, load_from_cache_file=True, num_proc=2)
```
## Expected results
Load cache instead of recompute result.
## Actual results
Result recomputed from scratch at each run.
The cache works fine when deleting `bert` attribute.
## Environment info
- `datasets` version: 2.5.3.dev0
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.13
- PyArrow version: 7.0.0
- Pandas version: 1.5.0
Indeed, the hash is changing. The `dumps` function serialize the model object in different ways because the model object is not deterministic
```python
from datasets.utils.py_utils import dumps
obj1 = AutoModel.from_config(config=config, add_pooling_layer=False)
obj2 = AutoModel.from_config(config=config, add_pooling_layer=False)
dumps(bert) == dumps(bert2). # False
```
> You can find mode info here: https://huggingface.co/docs/datasets/about_cache
>
> You can also provide your own unique hash in map if you want, with the new_fingerprint argument
Thanks, the doc is so helpful. Indeed, we can fix the hash and get cache hit using `new_fingerprint`. Closing the issue. | [
-1.2216473817825317,
-0.894265353679657,
-0.6379267573356628,
1.4899107217788696,
-0.164685919880867,
-1.2260944843292236,
0.22662268579006195,
-1.1104931831359863,
1.6497002840042114,
-0.833239734172821,
0.33299684524536133,
-1.634371280670166,
0.027922021225094795,
-0.5912012457847595,
-0.7273872494697571,
-0.8212079405784607,
-0.457474023103714,
-0.7085169553756714,
1.1283761262893677,
2.3981270790100098,
1.2163418531417847,
-1.3734275102615356,
2.6802854537963867,
0.7375174164772034,
-0.19489721953868866,
-0.9499993324279785,
0.565446138381958,
0.03763844072818756,
-1.370089054107666,
-0.4594953656196594,
-1.0425044298171997,
-0.0803121030330658,
-0.6015430688858032,
-0.4505590796470642,
-0.02314385212957859,
0.3740687966346741,
-0.29717814922332764,
-0.416978120803833,
-0.5419463515281677,
-0.7990188002586365,
0.4285232722759247,
-0.34925729036331177,
0.9118990898132324,
-0.3237888216972351,
1.8171632289886475,
-0.5969303846359253,
0.5001710653305054,
0.7754413485527039,
1.3332934379577637,
0.1976420283317566,
-0.07919629663228989,
0.3257213830947876,
0.4055175483226776,
-0.05218787491321564,
0.5439795255661011,
1.1433418989181519,
0.6909579038619995,
0.505924642086029,
0.7302058935165405,
-2.172025203704834,
1.3147015571594238,
-0.9922521114349365,
0.30842462182044983,
1.3282021284103394,
-0.9382029175758362,
0.38455256819725037,
-1.730925440788269,
-0.04443049430847168,
0.5347498655319214,
-2.2139029502868652,
0.3321385681629181,
-1.322747826576233,
-0.5178883075714111,
1.0988452434539795,
0.4148135483264923,
-1.2393382787704468,
0.03762628138065338,
-0.40680989623069763,
1.015928030014038,
0.364896684885025,
1.042201042175293,
-1.7014133930206299,
-0.025450170040130615,
-0.33174222707748413,
0.15939712524414062,
-1.2247023582458496,
-1.5405497550964355,
0.5591049194335938,
0.6065597534179688,
0.5636183619499207,
-0.17043574154376984,
1.079735279083252,
-1.045075535774231,
0.789097785949707,
-1.003545880317688,
-1.7135196924209595,
-1.4291540384292603,
-2.2825510501861572,
-2.2473599910736084,
0.7006086111068726,
-0.4538590908050537,
-0.556117832660675,
2.1611404418945312,
-1.0086404085159302,
-1.6602948904037476,
1.1190516948699951,
0.19873540103435516,
0.0559610053896904,
2.369656562805176,
0.22161459922790527,
-0.7009901404380798,
0.4277295470237732,
-0.7992920279502869,
0.7280267477035522,
-0.36444389820098877,
1.3096888065338135,
0.4265963137149811,
-1.0965129137039185,
1.5352891683578491,
-0.36333873867988586,
0.5331443548202515,
-0.6258883476257324,
-0.45664313435554504,
-0.6845430135726929,
0.22550927102565765,
1.8980112075805664,
-0.2242148071527481,
1.4716705083847046,
-0.3326147198677063,
-1.572365403175354,
-1.6093759536743164,
0.8389175534248352,
0.5277700424194336,
-0.6898670196533203,
0.08821404725313187,
-0.3297751247882843,
0.09478537738323212,
-0.050749897956848145,
1.1524027585983276,
1.334571361541748,
0.7811147570610046,
-0.35265761613845825,
-0.8245086669921875,
0.10521470755338669,
-0.10229330509901047,
-0.7924056053161621,
-1.7625315189361572,
-0.3302150070667267,
0.07210550457239151,
0.6472019553184509,
-1.217505693435669,
1.7903469800949097,
0.9013309478759766,
1.8819776773452759,
1.0027071237564087,
-0.3983684480190277,
1.5019664764404297,
0.10138680785894394,
1.8051937818527222,
-0.5108041763305664,
0.6748226284980774,
-0.3435855507850647,
-1.1859710216522217,
0.8125293254852295,
-0.3143518269062042,
-2.0395383834838867,
-0.7879563570022583,
-0.6611068248748779,
-0.14131304621696472,
-0.7742357850074768,
0.9647952914237976,
-0.26269063353538513,
-1.4396791458129883,
0.2334156483411789,
-0.7365023493766785,
0.15834054350852966,
-1.1790049076080322,
0.33357253670692444,
0.7418471574783325,
-0.6586810350418091,
0.09947730600833893,
-0.24894995987415314,
-1.2570488452911377,
-0.4853823482990265,
0.3050597906112671,
1.859555959701538,
-0.7671418786048889,
0.9374218583106995,
1.0326387882232666,
-0.7217531800270081,
-0.02314183861017227,
0.36394432187080383,
-0.3323698043823242,
0.9178160429000854,
-1.0769999027252197,
-0.4998452663421631,
1.2590057849884033,
-0.20881223678588867,
-0.6001821756362915,
1.4349229335784912,
0.7265827059745789,
-1.0180730819702148,
-0.20696918666362762,
-0.10940303653478622,
-0.8505317568778992,
0.08160863816738129,
-1.5924946069717407,
-0.14494909346103668,
0.40837159752845764,
-1.5534101724624634,
-0.4426937401294708,
-0.1670929193496704,
1.352860450744629,
-0.20068517327308655,
1.425338864326477,
-0.3103564381599426,
-0.1260540932416916,
-0.3896157741546631,
-0.381312757730484,
0.11626731604337692,
-0.1674647480249405,
-0.566220760345459,
0.2304810881614685,
-0.7994038462638855,
0.3632104992866516,
1.4240529537200928,
0.30154067277908325,
0.012541314586997032,
0.47256362438201904,
1.057922601699829,
0.3843085765838623,
-0.1460810899734497,
-0.913383960723877,
-1.5920062065124512,
1.9628987312316895,
-1.4199795722961426,
2.0046069622039795,
0.8411909341812134,
-0.013393939472734928,
-1.8100485801696777,
-1.822911024093628,
1.3168810606002808,
1.1435703039169312,
2.3635361194610596,
0.5127371549606323,
0.39049893617630005,
-0.8266443610191345,
-0.6924319267272949,
0.3844819664955139,
-1.0348739624023438,
-0.6994279026985168,
0.21455778181552887,
2.401792049407959,
1.7671337127685547,
-0.32674509286880493,
-0.23535200953483582,
-1.051453948020935,
1.4331402778625488,
-0.1708301156759262,
0.1788375973701477,
1.9704551696777344,
-0.2061140090227127,
-1.03897225856781,
1.2884142398834229,
-2.3112075328826904,
0.19466257095336914,
2.0152084827423096,
0.2636370062828064,
0.1321249008178711,
-1.4206242561340332,
-0.7007154822349548,
-0.2538806200027466,
-0.47071927785873413,
-1.1793110370635986,
0.5451571345329285,
-0.2143993377685547,
-0.7553264498710632,
-1.4511446952819824,
0.2167106568813324,
-1.15464448928833,
-1.7345681190490723,
0.21503403782844543,
1.8477224111557007,
2.0626845359802246,
-0.7545307278633118,
1.5468765497207642,
-0.33762308955192566,
0.12626619637012482,
1.2135804891586304,
1.2676212787628174,
3.149515390396118,
1.9251927137374878,
-1.3377788066864014,
0.6489303708076477,
-0.14139527082443237,
-0.4640483260154724,
1.0880802869796753,
-1.2447491884231567,
1.339508295059204,
-0.135413259267807,
-1.1827412843704224,
-1.2243542671203613,
0.9616048336029053,
0.46555882692337036,
0.051305659115314484,
-0.4717751145362854,
1.2037914991378784,
0.11610885709524155,
1.406463384628296,
0.5587751269340515,
-0.28060173988342285,
0.6406819224357605,
-0.39745277166366577,
-0.5172632932662964,
1.5770440101623535,
0.19991034269332886,
-1.4013911485671997,
-2.299034833908081,
-0.23960493505001068,
-0.8667279481887817,
0.08767680078744888,
-0.6449544429779053,
-0.9997130632400513,
1.6365509033203125,
0.38291338086128235,
-1.3371566534042358,
-0.2840827405452728,
-0.309888631105423,
-0.5478657484054565,
2.709782361984253,
-1.3912006616592407,
-0.16572155058383942,
-0.9817784428596497,
-0.674645721912384,
1.599308967590332,
-1.2158265113830566,
-0.23265910148620605,
-1.079648494720459,
-0.587041437625885,
-1.268085241317749,
-0.5561638474464417,
0.03206566721200943,
-0.9475633502006531,
0.8041437268257141,
0.1920240819454193,
-1.2259242534637451,
-0.3922613561153412,
-0.8931326270103455,
0.961331307888031,
-0.07001480460166931,
0.12454020231962204,
1.7877014875411987,
0.34329134225845337,
-0.3857761323451996,
0.7422758936882019,
1.1501284837722778,
0.6193093657493591,
-0.6112651228904724,
0.23482665419578552,
-0.6766340136528015,
0.3827933967113495,
-1.3262603282928467,
0.33374959230422974,
-2.899411916732788,
0.6547117829322815,
-0.07730618119239807,
-0.07449036091566086,
-0.07680299133062363,
-1.3281641006469727,
1.0630996227264404,
2.610673666000366,
-1.1803960800170898,
0.4875720739364624,
0.33300474286079407,
1.0739420652389526,
-1.6000365018844604,
0.3062833547592163,
-0.4503324627876282,
2.019413709640503,
0.23504729568958282,
1.2447417974472046,
-0.47257184982299805,
-2.3525495529174805,
0.6675639748573303,
-1.2844724655151367,
-1.1179007291793823,
0.8393283486366272,
-0.8325494527816772,
0.12722963094711304,
-1.2914034128189087,
-0.3077940344810486,
-0.7531526684761047,
-1.2057363986968994,
0.6257293224334717,
0.13555428385734558,
0.4633556306362152,
-0.6061904430389404,
0.32132408022880554,
-2.1832869052886963,
-1.2683757543563843,
-0.20114411413669586,
-0.9225148558616638,
0.45194011926651,
-0.3660557270050049,
0.6588101983070374,
-0.19221939146518707,
0.015616269782185555,
0.36566460132598877,
1.4318956136703491,
3.4109725952148438,
0.1628381609916687,
0.28392940759658813,
-0.18543891608715057,
-0.9505099654197693,
1.3768668174743652,
0.9170037508010864,
-0.1124139353632927,
-0.5838509798049927,
-1.1069968938827515,
1.2022892236709595,
1.8962123394012451,
0.9156226515769958,
-0.021934982389211655,
-0.8890551328659058,
-0.7409135103225708,
0.00823373906314373,
0.1991572380065918,
0.4533783793449402,
0.9195806980133057,
0.17931507527828217,
0.06389731913805008,
1.510491132736206,
1.2036067247390747,
-0.4063795506954193,
0.29928165674209595,
-0.870655357837677,
-0.48150235414505005,
0.5140368342399597,
0.34581267833709717,
-0.07545636594295502,
0.2895762026309967,
-1.0135245323181152,
-0.17799066007137299,
-0.4118395745754242,
-0.9370570778846741,
-0.7784808278083801,
-0.34816062450408936,
-0.3618786931037903,
1.6417431831359863,
0.09348177909851074,
-0.45987755060195923,
0.01654224470257759,
-0.784336507320404,
-0.10332075506448746,
-1.0595835447311401,
0.3229635953903198,
-0.12591609358787537,
-0.08078812807798386,
-0.19911877810955048,
1.7913845777511597,
-0.9107732772827148,
-2.010021686553955,
0.24281609058380127,
0.17225788533687592,
-0.24426087737083435,
0.21834523975849152,
1.6971328258514404,
0.5545573830604553,
1.414654016494751,
1.2937123775482178,
0.9537748098373413,
-0.6450414061546326,
-1.3513684272766113,
0.6773141622543335,
0.9893548488616943,
-1.4066818952560425,
0.7555630207061768,
-0.07259347289800644,
-0.4978850185871124,
0.6248398423194885,
1.306456446647644,
0.5461180806159973,
-1.99738609790802,
0.7703568339347839,
-1.0165950059890747,
0.7688573598861694,
0.7487691044807434,
0.6463908553123474,
0.15017351508140564,
0.8075252175331116,
-1.2392044067382812,
-1.0856902599334717,
-0.6446634531021118,
-0.667419970035553,
1.998304843902588,
-0.41426223516464233,
0.6107355952262878,
-0.2127637416124344,
-1.377140998840332,
-0.07464428246021271,
0.6714410781860352,
0.29202643036842346,
-0.5384398698806763,
0.8187383413314819,
-0.619840145111084,
-1.092645287513733,
-1.356175422668457,
-0.4290761947631836,
-1.042594075202942,
-0.945466160774231,
1.0515453815460205,
0.7279942035675049,
0.33295097947120667,
1.9269771575927734,
0.6521689295768738,
0.27113577723503113,
-2.624349355697632,
0.8578264117240906,
0.2756475508213043,
-0.08160220086574554,
0.8820746541023254,
0.3290494382381439,
1.0454556941986084,
-0.03487155959010124,
0.5676062107086182,
-2.463773250579834,
2.3516557216644287,
-0.14918765425682068,
0.662539005279541,
-0.020837945863604546,
-0.17936576902866364,
1.148136019706726,
0.6517021656036377,
0.5624696016311646,
-1.0451960563659668,
0.6503536701202393,
-0.5828437209129333,
1.2602689266204834,
0.8070720434188843,
-0.7945282459259033,
-0.09389720857143402,
1.3246448040008545,
0.462209016084671,
-0.5049111843109131,
-0.8866827487945557,
-1.0622315406799316,
0.928326427936554,
1.7768793106079102,
-0.025395821779966354,
-0.019696339964866638,
0.7709611654281616,
0.6879521608352661,
-1.3132201433181763,
0.047057896852493286,
-0.7119720578193665,
-0.7759340405464172,
1.6438968181610107,
2.1013715267181396,
-0.15486109256744385,
-0.2703162133693695,
-0.715529203414917,
-1.2574357986450195,
0.8257506489753723,
-0.044969744980335236,
0.0883743092417717,
0.6177013516426086,
-0.6104335784912109,
1.1070234775543213,
0.8906384110450745,
0.9543036818504333,
0.2898520529270172,
0.29636725783348083,
0.3573099672794342,
-0.3187132775783539,
-1.3126963376998901,
-0.2285355031490326,
-1.039443850517273,
-2.586949348449707,
0.43121394515037537,
-0.1853293925523758,
-1.435614824295044,
0.06305745989084244,
-1.0725022554397583,
0.784357488155365,
-0.5445180535316467,
-1.185490608215332,
-1.5192041397094727,
0.18794241547584534,
-0.04582666605710983,
0.9661607146263123,
-1.5472707748413086,
-0.07823816686868668,
1.2019997835159302,
0.9150009751319885,
-0.668792724609375,
1.0166199207305908,
0.1823834925889969,
1.0884076356887817,
0.863308310508728,
-0.3540925085544586,
0.513302743434906,
0.09125349670648575,
-1.2902671098709106,
0.4068152904510498,
1.2222259044647217,
0.21680986881256104,
1.5210669040679932,
-0.5953250527381897,
0.02536076121032238,
0.4165511727333069,
-0.545172393321991,
-0.5008978247642517,
-0.5302542448043823,
0.6579968929290771,
0.05473119765520096,
-0.8464899659156799,
-0.04894549399614334,
-0.04796098917722702,
-0.2578350603580475,
0.20000961422920227,
-1.4969050884246826,
-0.10835205018520355,
-0.33504894375801086,
-0.5751938223838806,
-1.229663372039795,
-0.08922727406024933,
1.4002233743667603,
-0.7037370204925537,
-0.2125345766544342,
0.48517274856567383,
0.26805630326271057,
0.5158131122589111,
0.6945053339004517,
-0.7479882836341858,
-0.37585633993148804,
-0.19555869698524475,
-0.3740878105163574,
0.41105538606643677,
1.4105610847473145,
-0.09856142103672028,
-0.9485454559326172,
0.6443417072296143,
-0.3396357297897339,
0.1407458335161209,
1.9625688791275024,
0.07496772706508636,
-0.8212219476699829,
0.3114795982837677,
-0.7771164774894714,
1.9520721435546875,
1.7076820135116577,
1.2911726236343384,
-0.12996724247932434,
-0.9250871539115906,
0.6462994813919067,
-0.3651067912578583,
-0.3831680715084076,
0.9290285110473633,
0.3886067569255829,
-0.16709691286087036,
-1.3598088026046753,
0.6893795132637024,
1.2398070096969604,
-0.8721071481704712,
-0.8449402451515198,
0.16051238775253296,
-0.7881917953491211,
1.0729045867919922,
0.6785675287246704,
0.38875287771224976,
0.28488004207611084,
1.6240273714065552,
0.8280922174453735,
-0.40163901448249817,
0.5487576723098755,
0.4834836721420288,
-0.1858501136302948,
-2.0928380489349365,
-1.1459101438522339,
0.3295862078666687,
-0.6254884600639343,
-1.6295031309127808,
1.4244345426559448,
-1.1577149629592896,
-1.006463646888733,
0.5438740849494934,
0.03787121921777725,
1.3699800968170166,
0.3455096483230591,
1.5616353750228882,
2.033773899078369,
0.9218884110450745,
0.38816288113594055,
1.2637228965759277,
-0.14352965354919434,
-0.47757530212402344,
1.7984000444412231,
-0.5189440250396729,
0.49735695123672485,
1.125569224357605,
-0.26728102564811707,
-1.0434058904647827,
-0.7914147973060608,
-1.1713171005249023,
-0.7927390336990356,
1.1765546798706055,
0.10927508771419525,
-1.1101515293121338,
0.28653842210769653,
1.5505726337432861,
0.10432367771863937,
-0.24380651116371155,
0.6619942784309387,
0.3635297119617462,
-0.749884307384491,
-0.10144775360822678,
-0.8866435289382935,
0.4856228232383728,
-0.28994929790496826,
-0.41494250297546387,
0.25515690445899963,
0.4609001874923706,
1.333605170249939,
-0.06174136698246002,
0.14261740446090698,
1.1128062009811401,
-1.4649832248687744,
1.498054027557373,
-0.6958422660827637,
0.36808353662490845,
-2.4096672534942627,
1.3928883075714111,
-0.7753419876098633,
1.8936026096343994,
-2.6986618041992188,
0.47268906235694885,
-0.519950270652771,
-0.5316585898399353,
0.26527270674705505,
-0.3379780054092407,
0.16136452555656433,
-0.1360226571559906,
-1.1816781759262085,
-0.08645379543304443,
-0.6859307289123535,
0.5947805643081665,
1.1265537738800049,
1.3590824604034424,
-1.1328729391098022,
-0.25212886929512024,
-1.7099641561508179,
-0.15588295459747314,
-0.7302191853523254,
0.319527268409729,
-1.9336605072021484,
-0.16850422322750092,
-1.8893036842346191,
-2.3920273780822754,
-1.2875697612762451,
-0.777143120765686,
1.1139882802963257,
0.1279822438955307,
-0.8154812455177307,
1.185559630393982,
-0.4214682877063751,
-1.7887712717056274,
1.109170913696289,
-2.198173761367798
] |
https://github.com/huggingface/datasets/issues/5105 | Specifying an exisiting folder in download_and_prepare deletes everything in it | Thanks for reporting, @cakiki.
I would say the deletion of the dir is an expected behavior though... | ## Describe the bug
The builder correctly creates the `output_dir` folder if it doesn't exist, but if the folder exists everything within it is deleted. Specifying `"."` as the `output_dir` deletes everything in your current dir but also leads to **another bug** whose traceback is the following:
```
Traceback (most recent call last)
Input In [11], in <cell line: 1>()
----> 1 rotten_tomatoes_builder.download_and_prepare(output_dir=".", max_shard_size="200MB", file_format="parquet")
File ~/BIGSCIENCE/env/lib/python3.9/site-packages/datasets/builder.py:818, in download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
File /usr/lib/python3.9/contextlib.py:124, in _GeneratorContextManager.__exit__(self, type, value, traceback)
122 if type is None:
123 try:
--> 124 next(self.gen)
125 except StopIteration:
126 return False
File ~/BIGSCIENCE/env/lib/python3.9/site-packages/datasets/builder.py:760, in incomplete_dir(dirname)
File /usr/lib/python3.9/shutil.py:722, in rmtree(path, ignore_errors, onerror)
720 os.rmdir(path)
721 except OSError:
--> 722 onerror(os.rmdir, path, sys.exc_info())
723 else:
724 try:
725 # symlinks to directories are forbidden, see bug #1669
File /usr/lib/python3.9/shutil.py:720, in rmtree(path, ignore_errors, onerror)
718 _rmtree_safe_fd(fd, path, onerror)
719 try:
--> 720 os.rmdir(path)
721 except OSError:
722 onerror(os.rmdir, path, sys.exc_info())
OSError: [Errno 22] Invalid argument: '/home/christopher/BIGSCIENCE/.'
```
## Steps to reproduce the bug
```python
rotten_tomatoes_builder = load_dataset_builder("rotten_tomatoes")
rotten_tomatoes_builder.download_and_prepare(output_dir="./test_folder", max_shard_size="200MB", file_format="parquet")
```
If `test_folder` contains any files they will all be deleted
## Expected results
Either a warning that all files will be deleted, but preferably that they not be deleted at all.
## Actual results
N/A
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.3.2
- Platform: Linux-5.15.0-48-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 8.0.0
- Pandas version: 1.4.3
| 479 | 17 | Specifying an exisiting folder in download_and_prepare deletes everything in it
## Describe the bug
The builder correctly creates the `output_dir` folder if it doesn't exist, but if the folder exists everything within it is deleted. Specifying `"."` as the `output_dir` deletes everything in your current dir but also leads to **another bug** whose traceback is the following:
```
Traceback (most recent call last)
Input In [11], in <cell line: 1>()
----> 1 rotten_tomatoes_builder.download_and_prepare(output_dir=".", max_shard_size="200MB", file_format="parquet")
File ~/BIGSCIENCE/env/lib/python3.9/site-packages/datasets/builder.py:818, in download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
File /usr/lib/python3.9/contextlib.py:124, in _GeneratorContextManager.__exit__(self, type, value, traceback)
122 if type is None:
123 try:
--> 124 next(self.gen)
125 except StopIteration:
126 return False
File ~/BIGSCIENCE/env/lib/python3.9/site-packages/datasets/builder.py:760, in incomplete_dir(dirname)
File /usr/lib/python3.9/shutil.py:722, in rmtree(path, ignore_errors, onerror)
720 os.rmdir(path)
721 except OSError:
--> 722 onerror(os.rmdir, path, sys.exc_info())
723 else:
724 try:
725 # symlinks to directories are forbidden, see bug #1669
File /usr/lib/python3.9/shutil.py:720, in rmtree(path, ignore_errors, onerror)
718 _rmtree_safe_fd(fd, path, onerror)
719 try:
--> 720 os.rmdir(path)
721 except OSError:
722 onerror(os.rmdir, path, sys.exc_info())
OSError: [Errno 22] Invalid argument: '/home/christopher/BIGSCIENCE/.'
```
## Steps to reproduce the bug
```python
rotten_tomatoes_builder = load_dataset_builder("rotten_tomatoes")
rotten_tomatoes_builder.download_and_prepare(output_dir="./test_folder", max_shard_size="200MB", file_format="parquet")
```
If `test_folder` contains any files they will all be deleted
## Expected results
Either a warning that all files will be deleted, but preferably that they not be deleted at all.
## Actual results
N/A
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.3.2
- Platform: Linux-5.15.0-48-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 8.0.0
- Pandas version: 1.4.3
Thanks for reporting, @cakiki.
I would say the deletion of the dir is an expected behavior though... | [
-1.1838384866714478,
-0.9239553213119507,
-0.6494898200035095,
1.4688564538955688,
-0.17049850523471832,
-1.3017314672470093,
0.1391775906085968,
-1.071529507637024,
1.5710841417312622,
-0.7350806593894958,
0.2761646509170532,
-1.6417597532272339,
-0.058647096157073975,
-0.5824236869812012,
-0.7269818186759949,
-0.8007416129112244,
-0.37521207332611084,
-0.8904010057449341,
1.0731374025344849,
2.4656319618225098,
1.33272123336792,
-1.4096599817276,
2.7432456016540527,
0.6750703454017639,
-0.3284013569355011,
-1.0029054880142212,
0.5153489112854004,
-0.07273455709218979,
-1.2720221281051636,
-0.5569644570350647,
-0.8845781087875366,
-0.06442403793334961,
-0.6132723689079285,
-0.34617316722869873,
0.017245061695575714,
0.5149025917053223,
-0.2343466579914093,
-0.27660176157951355,
-0.5737878084182739,
-0.8065295219421387,
0.5226066708564758,
-0.3087317645549774,
1.0003986358642578,
-0.2876388430595398,
1.779464602470398,
-0.6363338232040405,
0.5060473680496216,
0.7154360413551331,
1.3128869533538818,
0.21554484963417053,
-0.05727935582399368,
0.29686975479125977,
0.3307598829269409,
-0.039701975882053375,
0.5265125632286072,
1.182150959968567,
0.639346182346344,
0.5254791378974915,
0.7012629508972168,
-2.177281141281128,
1.3796697854995728,
-1.032789945602417,
0.28607282042503357,
1.386358618736267,
-0.8649842143058777,
0.3375369608402252,
-1.7786058187484741,
-0.13383732736110687,
0.6087861657142639,
-2.2352359294891357,
0.35426732897758484,
-1.274768352508545,
-0.4962597191333771,
0.9146363139152527,
0.36478251218795776,
-1.2888169288635254,
0.12639513611793518,
-0.4606817066669464,
1.0481165647506714,
0.4029373824596405,
1.0336825847625732,
-1.693713903427124,
-0.051100216805934906,
-0.18661968410015106,
0.11324069648981094,
-1.2776083946228027,
-1.6506563425064087,
0.6381641626358032,
0.5310201644897461,
0.6326947212219238,
-0.09655801951885223,
1.0473694801330566,
-1.1029194593429565,
0.8086270093917847,
-0.9931223392486572,
-1.5747746229171753,
-1.4101775884628296,
-2.425567150115967,
-2.267930030822754,
0.7948934435844421,
-0.5505589842796326,
-0.5379467606544495,
2.12400484085083,
-1.0334316492080688,
-1.6245980262756348,
1.1058491468429565,
0.3016756772994995,
0.07342765480279922,
2.4199633598327637,
0.21435633301734924,
-0.7233937382698059,
0.45724228024482727,
-0.749714732170105,
0.8521260619163513,
-0.3267788290977478,
1.2949349880218506,
0.4704744219779968,
-1.0417124032974243,
1.5634374618530273,
-0.4577532112598419,
0.549647867679596,
-0.6161150932312012,
-0.5582131743431091,
-0.7396777272224426,
0.27448755502700806,
1.809531807899475,
-0.3033819794654846,
1.477134346961975,
-0.285309374332428,
-1.5358883142471313,
-1.573840856552124,
0.9275422096252441,
0.43724843859672546,
-0.9470968246459961,
0.06641583889722824,
-0.5185684561729431,
0.19951380789279938,
-0.014666545204818249,
1.1457486152648926,
1.3166108131408691,
0.6293591856956482,
-0.3849485516548157,
-0.8593653440475464,
0.13953302800655365,
-0.1267334222793579,
-0.7195174694061279,
-1.8067538738250732,
-0.2774827778339386,
0.14496606588363647,
0.6899216771125793,
-1.1482261419296265,
1.883305311203003,
0.9098127484321594,
2.01839280128479,
0.9298456311225891,
-0.40864789485931396,
1.4993654489517212,
-0.020271018147468567,
1.8144675493240356,
-0.5313409566879272,
0.6005221605300903,
-0.41403713822364807,
-1.1646672487258911,
0.982506513595581,
-0.31689122319221497,
-1.9792529344558716,
-0.7478322386741638,
-0.7062249779701233,
-0.2282526195049286,
-0.8124897480010986,
0.8769429326057434,
-0.3030552864074707,
-1.4759140014648438,
0.17016226053237915,
-0.7246971130371094,
0.16436760127544403,
-1.1889164447784424,
0.23764848709106445,
0.6792216300964355,
-0.6263391971588135,
0.01907898299396038,
-0.21532179415225983,
-1.2474775314331055,
-0.49389398097991943,
0.3456905484199524,
1.9002089500427246,
-0.6006840467453003,
0.9744650721549988,
0.9911410212516785,
-0.6319305300712585,
0.06196843832731247,
0.250568151473999,
-0.2930317521095276,
0.7874009013175964,
-1.0896806716918945,
-0.531862199306488,
1.1381840705871582,
-0.2990737557411194,
-0.6113218665122986,
1.4446303844451904,
0.6901978254318237,
-1.120004653930664,
-0.21137474477291107,
-0.15278707444667816,
-0.904092013835907,
0.08433376252651215,
-1.5503365993499756,
-0.17230255901813507,
0.5470076203346252,
-1.5169271230697632,
-0.30798107385635376,
-0.12029445171356201,
1.3946363925933838,
-0.1858707219362259,
1.485008955001831,
-0.42108607292175293,
-0.09610060602426529,
-0.26887527108192444,
-0.4225180149078369,
0.1904844045639038,
-0.14668285846710205,
-0.44026896357536316,
0.18425533175468445,
-0.8361753821372986,
0.30774492025375366,
1.4936729669570923,
0.2789578437805176,
0.09269954264163971,
0.4304504096508026,
1.1147264242172241,
0.45442238450050354,
-0.038981325924396515,
-0.8747683763504028,
-1.507975459098816,
2.085094928741455,
-1.5019317865371704,
2.021775007247925,
0.8068562746047974,
-0.06759470701217651,
-1.7595547437667847,
-1.8349275588989258,
1.2503790855407715,
1.1474331617355347,
2.2585511207580566,
0.4946897625923157,
0.4101441502571106,
-0.7702768445014954,
-0.6876917481422424,
0.41225388646125793,
-0.9976656436920166,
-0.6373636722564697,
0.19380994141101837,
2.4178383350372314,
1.807136058807373,
-0.4442414343357086,
-0.252434104681015,
-0.9033246636390686,
1.387669324874878,
-0.2322646826505661,
0.2522968053817749,
2.079005718231201,
-0.23227179050445557,
-1.0873196125030518,
1.343752384185791,
-2.375389814376831,
0.24818749725818634,
2.0988125801086426,
0.3071900010108948,
0.15150727331638336,
-1.3583797216415405,
-0.6042476296424866,
-0.3244924247264862,
-0.44587838649749756,
-1.1929247379302979,
0.5747281908988953,
-0.2555636763572693,
-0.8109915256500244,
-1.4110177755355835,
0.15043649077415466,
-1.1809414625167847,
-1.8482969999313354,
0.28270721435546875,
1.933732509613037,
2.1501197814941406,
-0.7844146490097046,
1.485774278640747,
-0.3085646629333496,
0.03970751911401749,
1.1789793968200684,
1.33871591091156,
3.03890061378479,
1.791577696800232,
-1.3193433284759521,
0.5773555636405945,
-0.22118225693702698,
-0.477101594209671,
1.0652624368667603,
-1.1809598207473755,
1.1836004257202148,
-0.16064420342445374,
-1.2513855695724487,
-1.2267684936523438,
1.058221697807312,
0.4427869915962219,
0.023109810426831245,
-0.4935338795185089,
1.1686158180236816,
0.15155364573001862,
1.3606911897659302,
0.6508598923683167,
-0.3342507481575012,
0.5220246911048889,
-0.33677569031715393,
-0.5727965235710144,
1.6234444379806519,
0.24423806369304657,
-1.4991706609725952,
-2.329171895980835,
-0.26848649978637695,
-0.8990103006362915,
0.10068037360906601,
-0.6453210115432739,
-0.9665603637695312,
1.5818127393722534,
0.35724547505378723,
-1.2123585939407349,
-0.27482056617736816,
-0.31367024779319763,
-0.46538394689559937,
2.6811037063598633,
-1.2538058757781982,
-0.07853066176176071,
-0.9444058537483215,
-0.6152112483978271,
1.6447194814682007,
-1.2875921726226807,
-0.33075374364852905,
-1.0789051055908203,
-0.5807677507400513,
-1.1693686246871948,
-0.4772220551967621,
0.0419696643948555,
-0.9678378105163574,
0.7108644247055054,
0.18239277601242065,
-1.183306097984314,
-0.36657315492630005,
-0.8789061903953552,
1.0051556825637817,
-0.11855487525463104,
0.16588421165943146,
1.7820603847503662,
0.31953901052474976,
-0.4472435414791107,
0.8417741656303406,
1.2107783555984497,
0.6435559988021851,
-0.6158301830291748,
0.022348375990986824,
-0.6227805018424988,
0.4282664656639099,
-1.283555507659912,
0.29975154995918274,
-2.9628171920776367,
0.7018944621086121,
-0.14918462932109833,
-0.1088910847902298,
-0.15055689215660095,
-1.3463261127471924,
1.1018403768539429,
2.5248894691467285,
-1.1387791633605957,
0.5606207847595215,
0.3747299611568451,
1.1450698375701904,
-1.727500557899475,
0.32064589858055115,
-0.48115599155426025,
2.160416603088379,
0.16965781152248383,
1.2409589290618896,
-0.49444204568862915,
-2.294823169708252,
0.6805481910705566,
-1.2318918704986572,
-1.1000897884368896,
0.7030507922172546,
-0.8964377641677856,
0.22682207822799683,
-1.4293254613876343,
-0.20750583708286285,
-0.8730200529098511,
-1.2381936311721802,
0.6342016458511353,
0.07747338712215424,
0.3814581632614136,
-0.5082581639289856,
0.2807161808013916,
-2.2158100605010986,
-1.3845055103302002,
-0.18421682715415955,
-1.0097010135650635,
0.5699268579483032,
-0.5098101496696472,
0.6470631957054138,
-0.09004074335098267,
0.06199904531240463,
0.3531460762023926,
1.4764800071716309,
3.4217398166656494,
0.1368418186903,
0.22583644092082977,
-0.2164440006017685,
-0.9643731713294983,
1.4275959730148315,
0.8627903461456299,
-0.1779090166091919,
-0.6658433675765991,
-0.9944540858268738,
1.3647655248641968,
2.0544722080230713,
0.9784930944442749,
0.03790385276079178,
-0.8278681635856628,
-0.7425413727760315,
-0.037837088108062744,
0.19964160025119781,
0.5385071039199829,
0.9273425340652466,
0.002693483605980873,
0.012960873544216156,
1.3946382999420166,
1.164916753768921,
-0.370983749628067,
0.3129788041114807,
-0.9019738435745239,
-0.4458223581314087,
0.4109875559806824,
0.18578675389289856,
-0.023381438106298447,
0.43132221698760986,
-0.9663074016571045,
-0.3233879804611206,
-0.2884801924228668,
-0.8210722208023071,
-0.7662665247917175,
-0.3599371016025543,
-0.44183817505836487,
1.663003921508789,
0.11204266548156738,
-0.4698452949523926,
0.07865193486213684,
-0.6457719802856445,
-0.1751570701599121,
-1.1657289266586304,
0.15677912533283234,
-0.06337179243564606,
-0.09556683897972107,
-0.22621865570545197,
1.6881054639816284,
-0.8895261883735657,
-2.111292839050293,
0.18821440637111664,
0.2758311927318573,
-0.2674563229084015,
0.18886300921440125,
1.7341302633285522,
0.5061355829238892,
1.3860710859298706,
1.3425980806350708,
0.9334522485733032,
-0.6660068035125732,
-1.247797966003418,
0.7867206931114197,
1.022141933441162,
-1.416741132736206,
0.8892419934272766,
-0.1779080629348755,
-0.4721754789352417,
0.6304643154144287,
1.3232818841934204,
0.47974133491516113,
-2.1028645038604736,
0.9584974050521851,
-1.0628573894500732,
0.8294017314910889,
0.7536405324935913,
0.7104532718658447,
0.26512449979782104,
0.804904043674469,
-1.2464176416397095,
-1.128162145614624,
-0.6662511229515076,
-0.7229490280151367,
1.9412717819213867,
-0.33668747544288635,
0.5596612095832825,
-0.12499479949474335,
-1.1922928094863892,
-0.18049924075603485,
0.7316098809242249,
0.33964818716049194,
-0.43132904171943665,
0.8400477170944214,
-0.6941145658493042,
-1.0490458011627197,
-1.3082128763198853,
-0.45600709319114685,
-1.0292632579803467,
-0.8957125544548035,
0.9836637377738953,
0.73992919921875,
0.4309697151184082,
1.9780476093292236,
0.6155653595924377,
0.32963111996650696,
-2.500885248184204,
0.8946207761764526,
0.36522766947746277,
-0.12161985039710999,
0.8699308037757874,
0.359774649143219,
1.1297364234924316,
0.006873223930597305,
0.6048558354377747,
-2.4251961708068848,
2.2828752994537354,
-0.17558766901493073,
0.6890212893486023,
0.08599089086055756,
-0.22294531762599945,
1.1568330526351929,
0.6069607734680176,
0.5090285539627075,
-1.090598702430725,
0.6938567161560059,
-0.5755974054336548,
1.1160414218902588,
0.8864150047302246,
-0.8472956418991089,
0.03692995756864548,
1.3905094861984253,
0.43704289197921753,
-0.5628283619880676,
-0.9863846898078918,
-0.8747689127922058,
0.9191943407058716,
1.6984467506408691,
-0.10688334703445435,
0.02661891095340252,
0.7359524369239807,
0.6942479014396667,
-1.1885839700698853,
0.017860937863588333,
-0.6366294026374817,
-0.7319049835205078,
1.6522928476333618,
2.0220510959625244,
-0.23908020555973053,
-0.14164163172245026,
-0.721557080745697,
-1.3322656154632568,
0.8788740634918213,
-0.18508945405483246,
0.11160347610712051,
0.5432503819465637,
-0.6215575337409973,
1.0039805173873901,
0.7034447193145752,
1.0259219408035278,
0.12170147150754929,
0.24046827852725983,
0.3380683958530426,
-0.33899083733558655,
-1.0840011835098267,
-0.33325257897377014,
-1.1042245626449585,
-2.61629581451416,
0.40318530797958374,
-0.28709667921066284,
-1.4241626262664795,
0.00831153616309166,
-1.0080347061157227,
0.8388581275939941,
-0.5924477577209473,
-1.0825520753860474,
-1.4420833587646484,
0.316201388835907,
-0.12290545552968979,
0.9761567711830139,
-1.6627198457717896,
-0.24608400464057922,
1.229180932044983,
0.7516000270843506,
-0.6548088192939758,
0.9799578189849854,
0.175032377243042,
1.0098097324371338,
0.7729865908622742,
-0.376670777797699,
0.6492750644683838,
0.0762077271938324,
-1.3635767698287964,
0.5018736124038696,
1.234493374824524,
0.08154971897602081,
1.4592291116714478,
-0.44217348098754883,
0.09792308509349823,
0.4016335606575012,
-0.633610725402832,
-0.5182284712791443,
-0.33891162276268005,
0.7172322273254395,
0.012660844251513481,
-1.0151513814926147,
-0.11857248097658157,
-0.19970816373825073,
-0.30587777495384216,
0.15269118547439575,
-1.5019621849060059,
-0.2650316059589386,
-0.414916068315506,
-0.45520979166030884,
-1.339674711227417,
-0.17333582043647766,
1.3488595485687256,
-0.6428349018096924,
-0.27849826216697693,
0.4370562434196472,
0.4315832257270813,
0.5579460263252258,
0.7114397883415222,
-0.6937063336372375,
-0.3263900578022003,
-0.3105708956718445,
-0.2904365062713623,
0.37624308466911316,
1.2880173921585083,
0.03367900848388672,
-0.8804170489311218,
0.6522223949432373,
-0.3083406090736389,
0.16267409920692444,
1.9854282140731812,
0.05046065151691437,
-0.6830514669418335,
0.3265146017074585,
-0.682329535484314,
1.8495107889175415,
1.6671119928359985,
1.1850289106369019,
-0.11233152449131012,
-0.9101283550262451,
0.6583483219146729,
-0.34513750672340393,
-0.35605624318122864,
0.8429661989212036,
0.3298960030078888,
-0.2930605113506317,
-1.5002014636993408,
0.7483749389648438,
1.217202067375183,
-0.7584007978439331,
-0.8314574360847473,
0.08771573752164841,
-0.8199427723884583,
1.1913917064666748,
0.5017756223678589,
0.3443431258201599,
0.274577260017395,
1.6284058094024658,
0.7917823195457458,
-0.4504988491535187,
0.5159415602684021,
0.48112547397613525,
-0.19914187490940094,
-2.1299424171447754,
-1.0993329286575317,
0.28626126050949097,
-0.46889492869377136,
-1.5560683012008667,
1.3907198905944824,
-1.1107935905456543,
-1.049742579460144,
0.5536259412765503,
0.04289689660072327,
1.2801392078399658,
0.4020984470844269,
1.6313470602035522,
2.0837602615356445,
0.8954869508743286,
0.47650066018104553,
1.2716938257217407,
-0.13995984196662903,
-0.4445714056491852,
1.8252042531967163,
-0.4039529860019684,
0.4888507127761841,
1.0856499671936035,
-0.4230654835700989,
-1.111000895500183,
-0.8216270804405212,
-1.2053755521774292,
-0.7467592358589172,
1.1421620845794678,
0.0967930406332016,
-1.0097750425338745,
0.31994080543518066,
1.6210371255874634,
0.13446982204914093,
-0.23552590608596802,
0.5835979580879211,
0.3703483045101166,
-0.7595475912094116,
-0.13221685588359833,
-0.9346759915351868,
0.5221937894821167,
-0.20146888494491577,
-0.3954786956310272,
0.36413130164146423,
0.5594331622123718,
1.3412114381790161,
-0.13097167015075684,
0.1206684485077858,
0.9963201880455017,
-1.517882227897644,
1.4376288652420044,
-0.6200416088104248,
0.28380709886550903,
-2.288468599319458,
1.2996571063995361,
-0.75339275598526,
2.069328784942627,
-2.637200355529785,
0.404283344745636,
-0.4929252564907074,
-0.5244695544242859,
0.2511223256587982,
-0.28736916184425354,
0.16243810951709747,
-0.15831342339515686,
-1.0283571481704712,
0.0013208789750933647,
-0.6252427101135254,
0.6114630699157715,
1.1446592807769775,
1.4035279750823975,
-1.0465134382247925,
-0.21657471358776093,
-1.6927369832992554,
-0.11837593466043472,
-0.710765540599823,
0.16554419696331024,
-1.936326503753662,
-0.1591547429561615,
-2.0057761669158936,
-2.2790377140045166,
-1.3135730028152466,
-0.844096302986145,
1.0919572114944458,
0.2206863909959793,
-0.9155547618865967,
1.2640641927719116,
-0.33812448382377625,
-1.809985876083374,
1.058547019958496,
-2.1400654315948486
] |
https://github.com/huggingface/datasets/issues/5105 | Specifying an exisiting folder in download_and_prepare deletes everything in it | Thank you both for your feedback!
@albertvillanova I think I might have have the wrong mental model of what the function was meant to do. I thought it would be an API similar to the pandas `to_XX` write methods (Like the one @lhoestq mentions) so I just assumed it would download the dataframe to whichever folder I specififed (`"./"` in my case) so I could load it into a dask dataframe. I absolutely did not expect it to delete everything in my local directory, including the script where I called it from :smile:
I think Quentin's proposed solution sounds like a reasonable feature! | ## Describe the bug
The builder correctly creates the `output_dir` folder if it doesn't exist, but if the folder exists everything within it is deleted. Specifying `"."` as the `output_dir` deletes everything in your current dir but also leads to **another bug** whose traceback is the following:
```
Traceback (most recent call last)
Input In [11], in <cell line: 1>()
----> 1 rotten_tomatoes_builder.download_and_prepare(output_dir=".", max_shard_size="200MB", file_format="parquet")
File ~/BIGSCIENCE/env/lib/python3.9/site-packages/datasets/builder.py:818, in download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
File /usr/lib/python3.9/contextlib.py:124, in _GeneratorContextManager.__exit__(self, type, value, traceback)
122 if type is None:
123 try:
--> 124 next(self.gen)
125 except StopIteration:
126 return False
File ~/BIGSCIENCE/env/lib/python3.9/site-packages/datasets/builder.py:760, in incomplete_dir(dirname)
File /usr/lib/python3.9/shutil.py:722, in rmtree(path, ignore_errors, onerror)
720 os.rmdir(path)
721 except OSError:
--> 722 onerror(os.rmdir, path, sys.exc_info())
723 else:
724 try:
725 # symlinks to directories are forbidden, see bug #1669
File /usr/lib/python3.9/shutil.py:720, in rmtree(path, ignore_errors, onerror)
718 _rmtree_safe_fd(fd, path, onerror)
719 try:
--> 720 os.rmdir(path)
721 except OSError:
722 onerror(os.rmdir, path, sys.exc_info())
OSError: [Errno 22] Invalid argument: '/home/christopher/BIGSCIENCE/.'
```
## Steps to reproduce the bug
```python
rotten_tomatoes_builder = load_dataset_builder("rotten_tomatoes")
rotten_tomatoes_builder.download_and_prepare(output_dir="./test_folder", max_shard_size="200MB", file_format="parquet")
```
If `test_folder` contains any files they will all be deleted
## Expected results
Either a warning that all files will be deleted, but preferably that they not be deleted at all.
## Actual results
N/A
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.3.2
- Platform: Linux-5.15.0-48-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 8.0.0
- Pandas version: 1.4.3
| 479 | 103 | Specifying an exisiting folder in download_and_prepare deletes everything in it
## Describe the bug
The builder correctly creates the `output_dir` folder if it doesn't exist, but if the folder exists everything within it is deleted. Specifying `"."` as the `output_dir` deletes everything in your current dir but also leads to **another bug** whose traceback is the following:
```
Traceback (most recent call last)
Input In [11], in <cell line: 1>()
----> 1 rotten_tomatoes_builder.download_and_prepare(output_dir=".", max_shard_size="200MB", file_format="parquet")
File ~/BIGSCIENCE/env/lib/python3.9/site-packages/datasets/builder.py:818, in download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
File /usr/lib/python3.9/contextlib.py:124, in _GeneratorContextManager.__exit__(self, type, value, traceback)
122 if type is None:
123 try:
--> 124 next(self.gen)
125 except StopIteration:
126 return False
File ~/BIGSCIENCE/env/lib/python3.9/site-packages/datasets/builder.py:760, in incomplete_dir(dirname)
File /usr/lib/python3.9/shutil.py:722, in rmtree(path, ignore_errors, onerror)
720 os.rmdir(path)
721 except OSError:
--> 722 onerror(os.rmdir, path, sys.exc_info())
723 else:
724 try:
725 # symlinks to directories are forbidden, see bug #1669
File /usr/lib/python3.9/shutil.py:720, in rmtree(path, ignore_errors, onerror)
718 _rmtree_safe_fd(fd, path, onerror)
719 try:
--> 720 os.rmdir(path)
721 except OSError:
722 onerror(os.rmdir, path, sys.exc_info())
OSError: [Errno 22] Invalid argument: '/home/christopher/BIGSCIENCE/.'
```
## Steps to reproduce the bug
```python
rotten_tomatoes_builder = load_dataset_builder("rotten_tomatoes")
rotten_tomatoes_builder.download_and_prepare(output_dir="./test_folder", max_shard_size="200MB", file_format="parquet")
```
If `test_folder` contains any files they will all be deleted
## Expected results
Either a warning that all files will be deleted, but preferably that they not be deleted at all.
## Actual results
N/A
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.3.2
- Platform: Linux-5.15.0-48-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 8.0.0
- Pandas version: 1.4.3
Thank you both for your feedback!
@albertvillanova I think I might have have the wrong mental model of what the function was meant to do. I thought it would be an API similar to the pandas `to_XX` write methods (Like the one @lhoestq mentions) so I just assumed it would download the dataframe to whichever folder I specififed (`"./"` in my case) so I could load it into a dask dataframe. I absolutely did not expect it to delete everything in my local directory, including the script where I called it from :smile:
I think Quentin's proposed solution sounds like a reasonable feature! | [
-1.1838384866714478,
-0.9239553213119507,
-0.6494898200035095,
1.4688564538955688,
-0.17049850523471832,
-1.3017314672470093,
0.1391775906085968,
-1.071529507637024,
1.5710841417312622,
-0.7350806593894958,
0.2761646509170532,
-1.6417597532272339,
-0.058647096157073975,
-0.5824236869812012,
-0.7269818186759949,
-0.8007416129112244,
-0.37521207332611084,
-0.8904010057449341,
1.0731374025344849,
2.4656319618225098,
1.33272123336792,
-1.4096599817276,
2.7432456016540527,
0.6750703454017639,
-0.3284013569355011,
-1.0029054880142212,
0.5153489112854004,
-0.07273455709218979,
-1.2720221281051636,
-0.5569644570350647,
-0.8845781087875366,
-0.06442403793334961,
-0.6132723689079285,
-0.34617316722869873,
0.017245061695575714,
0.5149025917053223,
-0.2343466579914093,
-0.27660176157951355,
-0.5737878084182739,
-0.8065295219421387,
0.5226066708564758,
-0.3087317645549774,
1.0003986358642578,
-0.2876388430595398,
1.779464602470398,
-0.6363338232040405,
0.5060473680496216,
0.7154360413551331,
1.3128869533538818,
0.21554484963417053,
-0.05727935582399368,
0.29686975479125977,
0.3307598829269409,
-0.039701975882053375,
0.5265125632286072,
1.182150959968567,
0.639346182346344,
0.5254791378974915,
0.7012629508972168,
-2.177281141281128,
1.3796697854995728,
-1.032789945602417,
0.28607282042503357,
1.386358618736267,
-0.8649842143058777,
0.3375369608402252,
-1.7786058187484741,
-0.13383732736110687,
0.6087861657142639,
-2.2352359294891357,
0.35426732897758484,
-1.274768352508545,
-0.4962597191333771,
0.9146363139152527,
0.36478251218795776,
-1.2888169288635254,
0.12639513611793518,
-0.4606817066669464,
1.0481165647506714,
0.4029373824596405,
1.0336825847625732,
-1.693713903427124,
-0.051100216805934906,
-0.18661968410015106,
0.11324069648981094,
-1.2776083946228027,
-1.6506563425064087,
0.6381641626358032,
0.5310201644897461,
0.6326947212219238,
-0.09655801951885223,
1.0473694801330566,
-1.1029194593429565,
0.8086270093917847,
-0.9931223392486572,
-1.5747746229171753,
-1.4101775884628296,
-2.425567150115967,
-2.267930030822754,
0.7948934435844421,
-0.5505589842796326,
-0.5379467606544495,
2.12400484085083,
-1.0334316492080688,
-1.6245980262756348,
1.1058491468429565,
0.3016756772994995,
0.07342765480279922,
2.4199633598327637,
0.21435633301734924,
-0.7233937382698059,
0.45724228024482727,
-0.749714732170105,
0.8521260619163513,
-0.3267788290977478,
1.2949349880218506,
0.4704744219779968,
-1.0417124032974243,
1.5634374618530273,
-0.4577532112598419,
0.549647867679596,
-0.6161150932312012,
-0.5582131743431091,
-0.7396777272224426,
0.27448755502700806,
1.809531807899475,
-0.3033819794654846,
1.477134346961975,
-0.285309374332428,
-1.5358883142471313,
-1.573840856552124,
0.9275422096252441,
0.43724843859672546,
-0.9470968246459961,
0.06641583889722824,
-0.5185684561729431,
0.19951380789279938,
-0.014666545204818249,
1.1457486152648926,
1.3166108131408691,
0.6293591856956482,
-0.3849485516548157,
-0.8593653440475464,
0.13953302800655365,
-0.1267334222793579,
-0.7195174694061279,
-1.8067538738250732,
-0.2774827778339386,
0.14496606588363647,
0.6899216771125793,
-1.1482261419296265,
1.883305311203003,
0.9098127484321594,
2.01839280128479,
0.9298456311225891,
-0.40864789485931396,
1.4993654489517212,
-0.020271018147468567,
1.8144675493240356,
-0.5313409566879272,
0.6005221605300903,
-0.41403713822364807,
-1.1646672487258911,
0.982506513595581,
-0.31689122319221497,
-1.9792529344558716,
-0.7478322386741638,
-0.7062249779701233,
-0.2282526195049286,
-0.8124897480010986,
0.8769429326057434,
-0.3030552864074707,
-1.4759140014648438,
0.17016226053237915,
-0.7246971130371094,
0.16436760127544403,
-1.1889164447784424,
0.23764848709106445,
0.6792216300964355,
-0.6263391971588135,
0.01907898299396038,
-0.21532179415225983,
-1.2474775314331055,
-0.49389398097991943,
0.3456905484199524,
1.9002089500427246,
-0.6006840467453003,
0.9744650721549988,
0.9911410212516785,
-0.6319305300712585,
0.06196843832731247,
0.250568151473999,
-0.2930317521095276,
0.7874009013175964,
-1.0896806716918945,
-0.531862199306488,
1.1381840705871582,
-0.2990737557411194,
-0.6113218665122986,
1.4446303844451904,
0.6901978254318237,
-1.120004653930664,
-0.21137474477291107,
-0.15278707444667816,
-0.904092013835907,
0.08433376252651215,
-1.5503365993499756,
-0.17230255901813507,
0.5470076203346252,
-1.5169271230697632,
-0.30798107385635376,
-0.12029445171356201,
1.3946363925933838,
-0.1858707219362259,
1.485008955001831,
-0.42108607292175293,
-0.09610060602426529,
-0.26887527108192444,
-0.4225180149078369,
0.1904844045639038,
-0.14668285846710205,
-0.44026896357536316,
0.18425533175468445,
-0.8361753821372986,
0.30774492025375366,
1.4936729669570923,
0.2789578437805176,
0.09269954264163971,
0.4304504096508026,
1.1147264242172241,
0.45442238450050354,
-0.038981325924396515,
-0.8747683763504028,
-1.507975459098816,
2.085094928741455,
-1.5019317865371704,
2.021775007247925,
0.8068562746047974,
-0.06759470701217651,
-1.7595547437667847,
-1.8349275588989258,
1.2503790855407715,
1.1474331617355347,
2.2585511207580566,
0.4946897625923157,
0.4101441502571106,
-0.7702768445014954,
-0.6876917481422424,
0.41225388646125793,
-0.9976656436920166,
-0.6373636722564697,
0.19380994141101837,
2.4178383350372314,
1.807136058807373,
-0.4442414343357086,
-0.252434104681015,
-0.9033246636390686,
1.387669324874878,
-0.2322646826505661,
0.2522968053817749,
2.079005718231201,
-0.23227179050445557,
-1.0873196125030518,
1.343752384185791,
-2.375389814376831,
0.24818749725818634,
2.0988125801086426,
0.3071900010108948,
0.15150727331638336,
-1.3583797216415405,
-0.6042476296424866,
-0.3244924247264862,
-0.44587838649749756,
-1.1929247379302979,
0.5747281908988953,
-0.2555636763572693,
-0.8109915256500244,
-1.4110177755355835,
0.15043649077415466,
-1.1809414625167847,
-1.8482969999313354,
0.28270721435546875,
1.933732509613037,
2.1501197814941406,
-0.7844146490097046,
1.485774278640747,
-0.3085646629333496,
0.03970751911401749,
1.1789793968200684,
1.33871591091156,
3.03890061378479,
1.791577696800232,
-1.3193433284759521,
0.5773555636405945,
-0.22118225693702698,
-0.477101594209671,
1.0652624368667603,
-1.1809598207473755,
1.1836004257202148,
-0.16064420342445374,
-1.2513855695724487,
-1.2267684936523438,
1.058221697807312,
0.4427869915962219,
0.023109810426831245,
-0.4935338795185089,
1.1686158180236816,
0.15155364573001862,
1.3606911897659302,
0.6508598923683167,
-0.3342507481575012,
0.5220246911048889,
-0.33677569031715393,
-0.5727965235710144,
1.6234444379806519,
0.24423806369304657,
-1.4991706609725952,
-2.329171895980835,
-0.26848649978637695,
-0.8990103006362915,
0.10068037360906601,
-0.6453210115432739,
-0.9665603637695312,
1.5818127393722534,
0.35724547505378723,
-1.2123585939407349,
-0.27482056617736816,
-0.31367024779319763,
-0.46538394689559937,
2.6811037063598633,
-1.2538058757781982,
-0.07853066176176071,
-0.9444058537483215,
-0.6152112483978271,
1.6447194814682007,
-1.2875921726226807,
-0.33075374364852905,
-1.0789051055908203,
-0.5807677507400513,
-1.1693686246871948,
-0.4772220551967621,
0.0419696643948555,
-0.9678378105163574,
0.7108644247055054,
0.18239277601242065,
-1.183306097984314,
-0.36657315492630005,
-0.8789061903953552,
1.0051556825637817,
-0.11855487525463104,
0.16588421165943146,
1.7820603847503662,
0.31953901052474976,
-0.4472435414791107,
0.8417741656303406,
1.2107783555984497,
0.6435559988021851,
-0.6158301830291748,
0.022348375990986824,
-0.6227805018424988,
0.4282664656639099,
-1.283555507659912,
0.29975154995918274,
-2.9628171920776367,
0.7018944621086121,
-0.14918462932109833,
-0.1088910847902298,
-0.15055689215660095,
-1.3463261127471924,
1.1018403768539429,
2.5248894691467285,
-1.1387791633605957,
0.5606207847595215,
0.3747299611568451,
1.1450698375701904,
-1.727500557899475,
0.32064589858055115,
-0.48115599155426025,
2.160416603088379,
0.16965781152248383,
1.2409589290618896,
-0.49444204568862915,
-2.294823169708252,
0.6805481910705566,
-1.2318918704986572,
-1.1000897884368896,
0.7030507922172546,
-0.8964377641677856,
0.22682207822799683,
-1.4293254613876343,
-0.20750583708286285,
-0.8730200529098511,
-1.2381936311721802,
0.6342016458511353,
0.07747338712215424,
0.3814581632614136,
-0.5082581639289856,
0.2807161808013916,
-2.2158100605010986,
-1.3845055103302002,
-0.18421682715415955,
-1.0097010135650635,
0.5699268579483032,
-0.5098101496696472,
0.6470631957054138,
-0.09004074335098267,
0.06199904531240463,
0.3531460762023926,
1.4764800071716309,
3.4217398166656494,
0.1368418186903,
0.22583644092082977,
-0.2164440006017685,
-0.9643731713294983,
1.4275959730148315,
0.8627903461456299,
-0.1779090166091919,
-0.6658433675765991,
-0.9944540858268738,
1.3647655248641968,
2.0544722080230713,
0.9784930944442749,
0.03790385276079178,
-0.8278681635856628,
-0.7425413727760315,
-0.037837088108062744,
0.19964160025119781,
0.5385071039199829,
0.9273425340652466,
0.002693483605980873,
0.012960873544216156,
1.3946382999420166,
1.164916753768921,
-0.370983749628067,
0.3129788041114807,
-0.9019738435745239,
-0.4458223581314087,
0.4109875559806824,
0.18578675389289856,
-0.023381438106298447,
0.43132221698760986,
-0.9663074016571045,
-0.3233879804611206,
-0.2884801924228668,
-0.8210722208023071,
-0.7662665247917175,
-0.3599371016025543,
-0.44183817505836487,
1.663003921508789,
0.11204266548156738,
-0.4698452949523926,
0.07865193486213684,
-0.6457719802856445,
-0.1751570701599121,
-1.1657289266586304,
0.15677912533283234,
-0.06337179243564606,
-0.09556683897972107,
-0.22621865570545197,
1.6881054639816284,
-0.8895261883735657,
-2.111292839050293,
0.18821440637111664,
0.2758311927318573,
-0.2674563229084015,
0.18886300921440125,
1.7341302633285522,
0.5061355829238892,
1.3860710859298706,
1.3425980806350708,
0.9334522485733032,
-0.6660068035125732,
-1.247797966003418,
0.7867206931114197,
1.022141933441162,
-1.416741132736206,
0.8892419934272766,
-0.1779080629348755,
-0.4721754789352417,
0.6304643154144287,
1.3232818841934204,
0.47974133491516113,
-2.1028645038604736,
0.9584974050521851,
-1.0628573894500732,
0.8294017314910889,
0.7536405324935913,
0.7104532718658447,
0.26512449979782104,
0.804904043674469,
-1.2464176416397095,
-1.128162145614624,
-0.6662511229515076,
-0.7229490280151367,
1.9412717819213867,
-0.33668747544288635,
0.5596612095832825,
-0.12499479949474335,
-1.1922928094863892,
-0.18049924075603485,
0.7316098809242249,
0.33964818716049194,
-0.43132904171943665,
0.8400477170944214,
-0.6941145658493042,
-1.0490458011627197,
-1.3082128763198853,
-0.45600709319114685,
-1.0292632579803467,
-0.8957125544548035,
0.9836637377738953,
0.73992919921875,
0.4309697151184082,
1.9780476093292236,
0.6155653595924377,
0.32963111996650696,
-2.500885248184204,
0.8946207761764526,
0.36522766947746277,
-0.12161985039710999,
0.8699308037757874,
0.359774649143219,
1.1297364234924316,
0.006873223930597305,
0.6048558354377747,
-2.4251961708068848,
2.2828752994537354,
-0.17558766901493073,
0.6890212893486023,
0.08599089086055756,
-0.22294531762599945,
1.1568330526351929,
0.6069607734680176,
0.5090285539627075,
-1.090598702430725,
0.6938567161560059,
-0.5755974054336548,
1.1160414218902588,
0.8864150047302246,
-0.8472956418991089,
0.03692995756864548,
1.3905094861984253,
0.43704289197921753,
-0.5628283619880676,
-0.9863846898078918,
-0.8747689127922058,
0.9191943407058716,
1.6984467506408691,
-0.10688334703445435,
0.02661891095340252,
0.7359524369239807,
0.6942479014396667,
-1.1885839700698853,
0.017860937863588333,
-0.6366294026374817,
-0.7319049835205078,
1.6522928476333618,
2.0220510959625244,
-0.23908020555973053,
-0.14164163172245026,
-0.721557080745697,
-1.3322656154632568,
0.8788740634918213,
-0.18508945405483246,
0.11160347610712051,
0.5432503819465637,
-0.6215575337409973,
1.0039805173873901,
0.7034447193145752,
1.0259219408035278,
0.12170147150754929,
0.24046827852725983,
0.3380683958530426,
-0.33899083733558655,
-1.0840011835098267,
-0.33325257897377014,
-1.1042245626449585,
-2.61629581451416,
0.40318530797958374,
-0.28709667921066284,
-1.4241626262664795,
0.00831153616309166,
-1.0080347061157227,
0.8388581275939941,
-0.5924477577209473,
-1.0825520753860474,
-1.4420833587646484,
0.316201388835907,
-0.12290545552968979,
0.9761567711830139,
-1.6627198457717896,
-0.24608400464057922,
1.229180932044983,
0.7516000270843506,
-0.6548088192939758,
0.9799578189849854,
0.175032377243042,
1.0098097324371338,
0.7729865908622742,
-0.376670777797699,
0.6492750644683838,
0.0762077271938324,
-1.3635767698287964,
0.5018736124038696,
1.234493374824524,
0.08154971897602081,
1.4592291116714478,
-0.44217348098754883,
0.09792308509349823,
0.4016335606575012,
-0.633610725402832,
-0.5182284712791443,
-0.33891162276268005,
0.7172322273254395,
0.012660844251513481,
-1.0151513814926147,
-0.11857248097658157,
-0.19970816373825073,
-0.30587777495384216,
0.15269118547439575,
-1.5019621849060059,
-0.2650316059589386,
-0.414916068315506,
-0.45520979166030884,
-1.339674711227417,
-0.17333582043647766,
1.3488595485687256,
-0.6428349018096924,
-0.27849826216697693,
0.4370562434196472,
0.4315832257270813,
0.5579460263252258,
0.7114397883415222,
-0.6937063336372375,
-0.3263900578022003,
-0.3105708956718445,
-0.2904365062713623,
0.37624308466911316,
1.2880173921585083,
0.03367900848388672,
-0.8804170489311218,
0.6522223949432373,
-0.3083406090736389,
0.16267409920692444,
1.9854282140731812,
0.05046065151691437,
-0.6830514669418335,
0.3265146017074585,
-0.682329535484314,
1.8495107889175415,
1.6671119928359985,
1.1850289106369019,
-0.11233152449131012,
-0.9101283550262451,
0.6583483219146729,
-0.34513750672340393,
-0.35605624318122864,
0.8429661989212036,
0.3298960030078888,
-0.2930605113506317,
-1.5002014636993408,
0.7483749389648438,
1.217202067375183,
-0.7584007978439331,
-0.8314574360847473,
0.08771573752164841,
-0.8199427723884583,
1.1913917064666748,
0.5017756223678589,
0.3443431258201599,
0.274577260017395,
1.6284058094024658,
0.7917823195457458,
-0.4504988491535187,
0.5159415602684021,
0.48112547397613525,
-0.19914187490940094,
-2.1299424171447754,
-1.0993329286575317,
0.28626126050949097,
-0.46889492869377136,
-1.5560683012008667,
1.3907198905944824,
-1.1107935905456543,
-1.049742579460144,
0.5536259412765503,
0.04289689660072327,
1.2801392078399658,
0.4020984470844269,
1.6313470602035522,
2.0837602615356445,
0.8954869508743286,
0.47650066018104553,
1.2716938257217407,
-0.13995984196662903,
-0.4445714056491852,
1.8252042531967163,
-0.4039529860019684,
0.4888507127761841,
1.0856499671936035,
-0.4230654835700989,
-1.111000895500183,
-0.8216270804405212,
-1.2053755521774292,
-0.7467592358589172,
1.1421620845794678,
0.0967930406332016,
-1.0097750425338745,
0.31994080543518066,
1.6210371255874634,
0.13446982204914093,
-0.23552590608596802,
0.5835979580879211,
0.3703483045101166,
-0.7595475912094116,
-0.13221685588359833,
-0.9346759915351868,
0.5221937894821167,
-0.20146888494491577,
-0.3954786956310272,
0.36413130164146423,
0.5594331622123718,
1.3412114381790161,
-0.13097167015075684,
0.1206684485077858,
0.9963201880455017,
-1.517882227897644,
1.4376288652420044,
-0.6200416088104248,
0.28380709886550903,
-2.288468599319458,
1.2996571063995361,
-0.75339275598526,
2.069328784942627,
-2.637200355529785,
0.404283344745636,
-0.4929252564907074,
-0.5244695544242859,
0.2511223256587982,
-0.28736916184425354,
0.16243810951709747,
-0.15831342339515686,
-1.0283571481704712,
0.0013208789750933647,
-0.6252427101135254,
0.6114630699157715,
1.1446592807769775,
1.4035279750823975,
-1.0465134382247925,
-0.21657471358776093,
-1.6927369832992554,
-0.11837593466043472,
-0.710765540599823,
0.16554419696331024,
-1.936326503753662,
-0.1591547429561615,
-2.0057761669158936,
-2.2790377140045166,
-1.3135730028152466,
-0.844096302986145,
1.0919572114944458,
0.2206863909959793,
-0.9155547618865967,
1.2640641927719116,
-0.33812448382377625,
-1.809985876083374,
1.058547019958496,
-2.1400654315948486
] |
https://github.com/huggingface/datasets/issues/5105 | Specifying an exisiting folder in download_and_prepare deletes everything in it | actually there's already a `download_mode` parameter that defaults to `REUSE_DATASET_IF_EXISTS` - so I guess it's just a matter of not deleting files unrelated to the dataset, and to overwrite existing dataset files if the download mode is `REUSE_CACHE_IF_EXISTS` or `FORCE_REDOWNLOAD` | ## Describe the bug
The builder correctly creates the `output_dir` folder if it doesn't exist, but if the folder exists everything within it is deleted. Specifying `"."` as the `output_dir` deletes everything in your current dir but also leads to **another bug** whose traceback is the following:
```
Traceback (most recent call last)
Input In [11], in <cell line: 1>()
----> 1 rotten_tomatoes_builder.download_and_prepare(output_dir=".", max_shard_size="200MB", file_format="parquet")
File ~/BIGSCIENCE/env/lib/python3.9/site-packages/datasets/builder.py:818, in download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
File /usr/lib/python3.9/contextlib.py:124, in _GeneratorContextManager.__exit__(self, type, value, traceback)
122 if type is None:
123 try:
--> 124 next(self.gen)
125 except StopIteration:
126 return False
File ~/BIGSCIENCE/env/lib/python3.9/site-packages/datasets/builder.py:760, in incomplete_dir(dirname)
File /usr/lib/python3.9/shutil.py:722, in rmtree(path, ignore_errors, onerror)
720 os.rmdir(path)
721 except OSError:
--> 722 onerror(os.rmdir, path, sys.exc_info())
723 else:
724 try:
725 # symlinks to directories are forbidden, see bug #1669
File /usr/lib/python3.9/shutil.py:720, in rmtree(path, ignore_errors, onerror)
718 _rmtree_safe_fd(fd, path, onerror)
719 try:
--> 720 os.rmdir(path)
721 except OSError:
722 onerror(os.rmdir, path, sys.exc_info())
OSError: [Errno 22] Invalid argument: '/home/christopher/BIGSCIENCE/.'
```
## Steps to reproduce the bug
```python
rotten_tomatoes_builder = load_dataset_builder("rotten_tomatoes")
rotten_tomatoes_builder.download_and_prepare(output_dir="./test_folder", max_shard_size="200MB", file_format="parquet")
```
If `test_folder` contains any files they will all be deleted
## Expected results
Either a warning that all files will be deleted, but preferably that they not be deleted at all.
## Actual results
N/A
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.3.2
- Platform: Linux-5.15.0-48-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 8.0.0
- Pandas version: 1.4.3
| 479 | 40 | Specifying an exisiting folder in download_and_prepare deletes everything in it
## Describe the bug
The builder correctly creates the `output_dir` folder if it doesn't exist, but if the folder exists everything within it is deleted. Specifying `"."` as the `output_dir` deletes everything in your current dir but also leads to **another bug** whose traceback is the following:
```
Traceback (most recent call last)
Input In [11], in <cell line: 1>()
----> 1 rotten_tomatoes_builder.download_and_prepare(output_dir=".", max_shard_size="200MB", file_format="parquet")
File ~/BIGSCIENCE/env/lib/python3.9/site-packages/datasets/builder.py:818, in download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
File /usr/lib/python3.9/contextlib.py:124, in _GeneratorContextManager.__exit__(self, type, value, traceback)
122 if type is None:
123 try:
--> 124 next(self.gen)
125 except StopIteration:
126 return False
File ~/BIGSCIENCE/env/lib/python3.9/site-packages/datasets/builder.py:760, in incomplete_dir(dirname)
File /usr/lib/python3.9/shutil.py:722, in rmtree(path, ignore_errors, onerror)
720 os.rmdir(path)
721 except OSError:
--> 722 onerror(os.rmdir, path, sys.exc_info())
723 else:
724 try:
725 # symlinks to directories are forbidden, see bug #1669
File /usr/lib/python3.9/shutil.py:720, in rmtree(path, ignore_errors, onerror)
718 _rmtree_safe_fd(fd, path, onerror)
719 try:
--> 720 os.rmdir(path)
721 except OSError:
722 onerror(os.rmdir, path, sys.exc_info())
OSError: [Errno 22] Invalid argument: '/home/christopher/BIGSCIENCE/.'
```
## Steps to reproduce the bug
```python
rotten_tomatoes_builder = load_dataset_builder("rotten_tomatoes")
rotten_tomatoes_builder.download_and_prepare(output_dir="./test_folder", max_shard_size="200MB", file_format="parquet")
```
If `test_folder` contains any files they will all be deleted
## Expected results
Either a warning that all files will be deleted, but preferably that they not be deleted at all.
## Actual results
N/A
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.3.2
- Platform: Linux-5.15.0-48-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 8.0.0
- Pandas version: 1.4.3
actually there's already a `download_mode` parameter that defaults to `REUSE_DATASET_IF_EXISTS` - so I guess it's just a matter of not deleting files unrelated to the dataset, and to overwrite existing dataset files if the download mode is `REUSE_CACHE_IF_EXISTS` or `FORCE_REDOWNLOAD` | [
-1.1838384866714478,
-0.9239553213119507,
-0.6494898200035095,
1.4688564538955688,
-0.17049850523471832,
-1.3017314672470093,
0.1391775906085968,
-1.071529507637024,
1.5710841417312622,
-0.7350806593894958,
0.2761646509170532,
-1.6417597532272339,
-0.058647096157073975,
-0.5824236869812012,
-0.7269818186759949,
-0.8007416129112244,
-0.37521207332611084,
-0.8904010057449341,
1.0731374025344849,
2.4656319618225098,
1.33272123336792,
-1.4096599817276,
2.7432456016540527,
0.6750703454017639,
-0.3284013569355011,
-1.0029054880142212,
0.5153489112854004,
-0.07273455709218979,
-1.2720221281051636,
-0.5569644570350647,
-0.8845781087875366,
-0.06442403793334961,
-0.6132723689079285,
-0.34617316722869873,
0.017245061695575714,
0.5149025917053223,
-0.2343466579914093,
-0.27660176157951355,
-0.5737878084182739,
-0.8065295219421387,
0.5226066708564758,
-0.3087317645549774,
1.0003986358642578,
-0.2876388430595398,
1.779464602470398,
-0.6363338232040405,
0.5060473680496216,
0.7154360413551331,
1.3128869533538818,
0.21554484963417053,
-0.05727935582399368,
0.29686975479125977,
0.3307598829269409,
-0.039701975882053375,
0.5265125632286072,
1.182150959968567,
0.639346182346344,
0.5254791378974915,
0.7012629508972168,
-2.177281141281128,
1.3796697854995728,
-1.032789945602417,
0.28607282042503357,
1.386358618736267,
-0.8649842143058777,
0.3375369608402252,
-1.7786058187484741,
-0.13383732736110687,
0.6087861657142639,
-2.2352359294891357,
0.35426732897758484,
-1.274768352508545,
-0.4962597191333771,
0.9146363139152527,
0.36478251218795776,
-1.2888169288635254,
0.12639513611793518,
-0.4606817066669464,
1.0481165647506714,
0.4029373824596405,
1.0336825847625732,
-1.693713903427124,
-0.051100216805934906,
-0.18661968410015106,
0.11324069648981094,
-1.2776083946228027,
-1.6506563425064087,
0.6381641626358032,
0.5310201644897461,
0.6326947212219238,
-0.09655801951885223,
1.0473694801330566,
-1.1029194593429565,
0.8086270093917847,
-0.9931223392486572,
-1.5747746229171753,
-1.4101775884628296,
-2.425567150115967,
-2.267930030822754,
0.7948934435844421,
-0.5505589842796326,
-0.5379467606544495,
2.12400484085083,
-1.0334316492080688,
-1.6245980262756348,
1.1058491468429565,
0.3016756772994995,
0.07342765480279922,
2.4199633598327637,
0.21435633301734924,
-0.7233937382698059,
0.45724228024482727,
-0.749714732170105,
0.8521260619163513,
-0.3267788290977478,
1.2949349880218506,
0.4704744219779968,
-1.0417124032974243,
1.5634374618530273,
-0.4577532112598419,
0.549647867679596,
-0.6161150932312012,
-0.5582131743431091,
-0.7396777272224426,
0.27448755502700806,
1.809531807899475,
-0.3033819794654846,
1.477134346961975,
-0.285309374332428,
-1.5358883142471313,
-1.573840856552124,
0.9275422096252441,
0.43724843859672546,
-0.9470968246459961,
0.06641583889722824,
-0.5185684561729431,
0.19951380789279938,
-0.014666545204818249,
1.1457486152648926,
1.3166108131408691,
0.6293591856956482,
-0.3849485516548157,
-0.8593653440475464,
0.13953302800655365,
-0.1267334222793579,
-0.7195174694061279,
-1.8067538738250732,
-0.2774827778339386,
0.14496606588363647,
0.6899216771125793,
-1.1482261419296265,
1.883305311203003,
0.9098127484321594,
2.01839280128479,
0.9298456311225891,
-0.40864789485931396,
1.4993654489517212,
-0.020271018147468567,
1.8144675493240356,
-0.5313409566879272,
0.6005221605300903,
-0.41403713822364807,
-1.1646672487258911,
0.982506513595581,
-0.31689122319221497,
-1.9792529344558716,
-0.7478322386741638,
-0.7062249779701233,
-0.2282526195049286,
-0.8124897480010986,
0.8769429326057434,
-0.3030552864074707,
-1.4759140014648438,
0.17016226053237915,
-0.7246971130371094,
0.16436760127544403,
-1.1889164447784424,
0.23764848709106445,
0.6792216300964355,
-0.6263391971588135,
0.01907898299396038,
-0.21532179415225983,
-1.2474775314331055,
-0.49389398097991943,
0.3456905484199524,
1.9002089500427246,
-0.6006840467453003,
0.9744650721549988,
0.9911410212516785,
-0.6319305300712585,
0.06196843832731247,
0.250568151473999,
-0.2930317521095276,
0.7874009013175964,
-1.0896806716918945,
-0.531862199306488,
1.1381840705871582,
-0.2990737557411194,
-0.6113218665122986,
1.4446303844451904,
0.6901978254318237,
-1.120004653930664,
-0.21137474477291107,
-0.15278707444667816,
-0.904092013835907,
0.08433376252651215,
-1.5503365993499756,
-0.17230255901813507,
0.5470076203346252,
-1.5169271230697632,
-0.30798107385635376,
-0.12029445171356201,
1.3946363925933838,
-0.1858707219362259,
1.485008955001831,
-0.42108607292175293,
-0.09610060602426529,
-0.26887527108192444,
-0.4225180149078369,
0.1904844045639038,
-0.14668285846710205,
-0.44026896357536316,
0.18425533175468445,
-0.8361753821372986,
0.30774492025375366,
1.4936729669570923,
0.2789578437805176,
0.09269954264163971,
0.4304504096508026,
1.1147264242172241,
0.45442238450050354,
-0.038981325924396515,
-0.8747683763504028,
-1.507975459098816,
2.085094928741455,
-1.5019317865371704,
2.021775007247925,
0.8068562746047974,
-0.06759470701217651,
-1.7595547437667847,
-1.8349275588989258,
1.2503790855407715,
1.1474331617355347,
2.2585511207580566,
0.4946897625923157,
0.4101441502571106,
-0.7702768445014954,
-0.6876917481422424,
0.41225388646125793,
-0.9976656436920166,
-0.6373636722564697,
0.19380994141101837,
2.4178383350372314,
1.807136058807373,
-0.4442414343357086,
-0.252434104681015,
-0.9033246636390686,
1.387669324874878,
-0.2322646826505661,
0.2522968053817749,
2.079005718231201,
-0.23227179050445557,
-1.0873196125030518,
1.343752384185791,
-2.375389814376831,
0.24818749725818634,
2.0988125801086426,
0.3071900010108948,
0.15150727331638336,
-1.3583797216415405,
-0.6042476296424866,
-0.3244924247264862,
-0.44587838649749756,
-1.1929247379302979,
0.5747281908988953,
-0.2555636763572693,
-0.8109915256500244,
-1.4110177755355835,
0.15043649077415466,
-1.1809414625167847,
-1.8482969999313354,
0.28270721435546875,
1.933732509613037,
2.1501197814941406,
-0.7844146490097046,
1.485774278640747,
-0.3085646629333496,
0.03970751911401749,
1.1789793968200684,
1.33871591091156,
3.03890061378479,
1.791577696800232,
-1.3193433284759521,
0.5773555636405945,
-0.22118225693702698,
-0.477101594209671,
1.0652624368667603,
-1.1809598207473755,
1.1836004257202148,
-0.16064420342445374,
-1.2513855695724487,
-1.2267684936523438,
1.058221697807312,
0.4427869915962219,
0.023109810426831245,
-0.4935338795185089,
1.1686158180236816,
0.15155364573001862,
1.3606911897659302,
0.6508598923683167,
-0.3342507481575012,
0.5220246911048889,
-0.33677569031715393,
-0.5727965235710144,
1.6234444379806519,
0.24423806369304657,
-1.4991706609725952,
-2.329171895980835,
-0.26848649978637695,
-0.8990103006362915,
0.10068037360906601,
-0.6453210115432739,
-0.9665603637695312,
1.5818127393722534,
0.35724547505378723,
-1.2123585939407349,
-0.27482056617736816,
-0.31367024779319763,
-0.46538394689559937,
2.6811037063598633,
-1.2538058757781982,
-0.07853066176176071,
-0.9444058537483215,
-0.6152112483978271,
1.6447194814682007,
-1.2875921726226807,
-0.33075374364852905,
-1.0789051055908203,
-0.5807677507400513,
-1.1693686246871948,
-0.4772220551967621,
0.0419696643948555,
-0.9678378105163574,
0.7108644247055054,
0.18239277601242065,
-1.183306097984314,
-0.36657315492630005,
-0.8789061903953552,
1.0051556825637817,
-0.11855487525463104,
0.16588421165943146,
1.7820603847503662,
0.31953901052474976,
-0.4472435414791107,
0.8417741656303406,
1.2107783555984497,
0.6435559988021851,
-0.6158301830291748,
0.022348375990986824,
-0.6227805018424988,
0.4282664656639099,
-1.283555507659912,
0.29975154995918274,
-2.9628171920776367,
0.7018944621086121,
-0.14918462932109833,
-0.1088910847902298,
-0.15055689215660095,
-1.3463261127471924,
1.1018403768539429,
2.5248894691467285,
-1.1387791633605957,
0.5606207847595215,
0.3747299611568451,
1.1450698375701904,
-1.727500557899475,
0.32064589858055115,
-0.48115599155426025,
2.160416603088379,
0.16965781152248383,
1.2409589290618896,
-0.49444204568862915,
-2.294823169708252,
0.6805481910705566,
-1.2318918704986572,
-1.1000897884368896,
0.7030507922172546,
-0.8964377641677856,
0.22682207822799683,
-1.4293254613876343,
-0.20750583708286285,
-0.8730200529098511,
-1.2381936311721802,
0.6342016458511353,
0.07747338712215424,
0.3814581632614136,
-0.5082581639289856,
0.2807161808013916,
-2.2158100605010986,
-1.3845055103302002,
-0.18421682715415955,
-1.0097010135650635,
0.5699268579483032,
-0.5098101496696472,
0.6470631957054138,
-0.09004074335098267,
0.06199904531240463,
0.3531460762023926,
1.4764800071716309,
3.4217398166656494,
0.1368418186903,
0.22583644092082977,
-0.2164440006017685,
-0.9643731713294983,
1.4275959730148315,
0.8627903461456299,
-0.1779090166091919,
-0.6658433675765991,
-0.9944540858268738,
1.3647655248641968,
2.0544722080230713,
0.9784930944442749,
0.03790385276079178,
-0.8278681635856628,
-0.7425413727760315,
-0.037837088108062744,
0.19964160025119781,
0.5385071039199829,
0.9273425340652466,
0.002693483605980873,
0.012960873544216156,
1.3946382999420166,
1.164916753768921,
-0.370983749628067,
0.3129788041114807,
-0.9019738435745239,
-0.4458223581314087,
0.4109875559806824,
0.18578675389289856,
-0.023381438106298447,
0.43132221698760986,
-0.9663074016571045,
-0.3233879804611206,
-0.2884801924228668,
-0.8210722208023071,
-0.7662665247917175,
-0.3599371016025543,
-0.44183817505836487,
1.663003921508789,
0.11204266548156738,
-0.4698452949523926,
0.07865193486213684,
-0.6457719802856445,
-0.1751570701599121,
-1.1657289266586304,
0.15677912533283234,
-0.06337179243564606,
-0.09556683897972107,
-0.22621865570545197,
1.6881054639816284,
-0.8895261883735657,
-2.111292839050293,
0.18821440637111664,
0.2758311927318573,
-0.2674563229084015,
0.18886300921440125,
1.7341302633285522,
0.5061355829238892,
1.3860710859298706,
1.3425980806350708,
0.9334522485733032,
-0.6660068035125732,
-1.247797966003418,
0.7867206931114197,
1.022141933441162,
-1.416741132736206,
0.8892419934272766,
-0.1779080629348755,
-0.4721754789352417,
0.6304643154144287,
1.3232818841934204,
0.47974133491516113,
-2.1028645038604736,
0.9584974050521851,
-1.0628573894500732,
0.8294017314910889,
0.7536405324935913,
0.7104532718658447,
0.26512449979782104,
0.804904043674469,
-1.2464176416397095,
-1.128162145614624,
-0.6662511229515076,
-0.7229490280151367,
1.9412717819213867,
-0.33668747544288635,
0.5596612095832825,
-0.12499479949474335,
-1.1922928094863892,
-0.18049924075603485,
0.7316098809242249,
0.33964818716049194,
-0.43132904171943665,
0.8400477170944214,
-0.6941145658493042,
-1.0490458011627197,
-1.3082128763198853,
-0.45600709319114685,
-1.0292632579803467,
-0.8957125544548035,
0.9836637377738953,
0.73992919921875,
0.4309697151184082,
1.9780476093292236,
0.6155653595924377,
0.32963111996650696,
-2.500885248184204,
0.8946207761764526,
0.36522766947746277,
-0.12161985039710999,
0.8699308037757874,
0.359774649143219,
1.1297364234924316,
0.006873223930597305,
0.6048558354377747,
-2.4251961708068848,
2.2828752994537354,
-0.17558766901493073,
0.6890212893486023,
0.08599089086055756,
-0.22294531762599945,
1.1568330526351929,
0.6069607734680176,
0.5090285539627075,
-1.090598702430725,
0.6938567161560059,
-0.5755974054336548,
1.1160414218902588,
0.8864150047302246,
-0.8472956418991089,
0.03692995756864548,
1.3905094861984253,
0.43704289197921753,
-0.5628283619880676,
-0.9863846898078918,
-0.8747689127922058,
0.9191943407058716,
1.6984467506408691,
-0.10688334703445435,
0.02661891095340252,
0.7359524369239807,
0.6942479014396667,
-1.1885839700698853,
0.017860937863588333,
-0.6366294026374817,
-0.7319049835205078,
1.6522928476333618,
2.0220510959625244,
-0.23908020555973053,
-0.14164163172245026,
-0.721557080745697,
-1.3322656154632568,
0.8788740634918213,
-0.18508945405483246,
0.11160347610712051,
0.5432503819465637,
-0.6215575337409973,
1.0039805173873901,
0.7034447193145752,
1.0259219408035278,
0.12170147150754929,
0.24046827852725983,
0.3380683958530426,
-0.33899083733558655,
-1.0840011835098267,
-0.33325257897377014,
-1.1042245626449585,
-2.61629581451416,
0.40318530797958374,
-0.28709667921066284,
-1.4241626262664795,
0.00831153616309166,
-1.0080347061157227,
0.8388581275939941,
-0.5924477577209473,
-1.0825520753860474,
-1.4420833587646484,
0.316201388835907,
-0.12290545552968979,
0.9761567711830139,
-1.6627198457717896,
-0.24608400464057922,
1.229180932044983,
0.7516000270843506,
-0.6548088192939758,
0.9799578189849854,
0.175032377243042,
1.0098097324371338,
0.7729865908622742,
-0.376670777797699,
0.6492750644683838,
0.0762077271938324,
-1.3635767698287964,
0.5018736124038696,
1.234493374824524,
0.08154971897602081,
1.4592291116714478,
-0.44217348098754883,
0.09792308509349823,
0.4016335606575012,
-0.633610725402832,
-0.5182284712791443,
-0.33891162276268005,
0.7172322273254395,
0.012660844251513481,
-1.0151513814926147,
-0.11857248097658157,
-0.19970816373825073,
-0.30587777495384216,
0.15269118547439575,
-1.5019621849060059,
-0.2650316059589386,
-0.414916068315506,
-0.45520979166030884,
-1.339674711227417,
-0.17333582043647766,
1.3488595485687256,
-0.6428349018096924,
-0.27849826216697693,
0.4370562434196472,
0.4315832257270813,
0.5579460263252258,
0.7114397883415222,
-0.6937063336372375,
-0.3263900578022003,
-0.3105708956718445,
-0.2904365062713623,
0.37624308466911316,
1.2880173921585083,
0.03367900848388672,
-0.8804170489311218,
0.6522223949432373,
-0.3083406090736389,
0.16267409920692444,
1.9854282140731812,
0.05046065151691437,
-0.6830514669418335,
0.3265146017074585,
-0.682329535484314,
1.8495107889175415,
1.6671119928359985,
1.1850289106369019,
-0.11233152449131012,
-0.9101283550262451,
0.6583483219146729,
-0.34513750672340393,
-0.35605624318122864,
0.8429661989212036,
0.3298960030078888,
-0.2930605113506317,
-1.5002014636993408,
0.7483749389648438,
1.217202067375183,
-0.7584007978439331,
-0.8314574360847473,
0.08771573752164841,
-0.8199427723884583,
1.1913917064666748,
0.5017756223678589,
0.3443431258201599,
0.274577260017395,
1.6284058094024658,
0.7917823195457458,
-0.4504988491535187,
0.5159415602684021,
0.48112547397613525,
-0.19914187490940094,
-2.1299424171447754,
-1.0993329286575317,
0.28626126050949097,
-0.46889492869377136,
-1.5560683012008667,
1.3907198905944824,
-1.1107935905456543,
-1.049742579460144,
0.5536259412765503,
0.04289689660072327,
1.2801392078399658,
0.4020984470844269,
1.6313470602035522,
2.0837602615356445,
0.8954869508743286,
0.47650066018104553,
1.2716938257217407,
-0.13995984196662903,
-0.4445714056491852,
1.8252042531967163,
-0.4039529860019684,
0.4888507127761841,
1.0856499671936035,
-0.4230654835700989,
-1.111000895500183,
-0.8216270804405212,
-1.2053755521774292,
-0.7467592358589172,
1.1421620845794678,
0.0967930406332016,
-1.0097750425338745,
0.31994080543518066,
1.6210371255874634,
0.13446982204914093,
-0.23552590608596802,
0.5835979580879211,
0.3703483045101166,
-0.7595475912094116,
-0.13221685588359833,
-0.9346759915351868,
0.5221937894821167,
-0.20146888494491577,
-0.3954786956310272,
0.36413130164146423,
0.5594331622123718,
1.3412114381790161,
-0.13097167015075684,
0.1206684485077858,
0.9963201880455017,
-1.517882227897644,
1.4376288652420044,
-0.6200416088104248,
0.28380709886550903,
-2.288468599319458,
1.2996571063995361,
-0.75339275598526,
2.069328784942627,
-2.637200355529785,
0.404283344745636,
-0.4929252564907074,
-0.5244695544242859,
0.2511223256587982,
-0.28736916184425354,
0.16243810951709747,
-0.15831342339515686,
-1.0283571481704712,
0.0013208789750933647,
-0.6252427101135254,
0.6114630699157715,
1.1446592807769775,
1.4035279750823975,
-1.0465134382247925,
-0.21657471358776093,
-1.6927369832992554,
-0.11837593466043472,
-0.710765540599823,
0.16554419696331024,
-1.936326503753662,
-0.1591547429561615,
-2.0057761669158936,
-2.2790377140045166,
-1.3135730028152466,
-0.844096302986145,
1.0919572114944458,
0.2206863909959793,
-0.9155547618865967,
1.2640641927719116,
-0.33812448382377625,
-1.809985876083374,
1.058547019958496,
-2.1400654315948486
] |
https://github.com/huggingface/datasets/issues/5099 | datasets doesn't support # in data paths | `datasets` doesn't seem to urlencode the directory names here
https://github.com/huggingface/datasets/blob/7feeb5648a63b6135a8259dedc3b1e19185ee4c7/src/datasets/utils/file_utils.py#L109-L111
for example we should have
```python
from datasets.utils.file_utils import hf_hub_url
url = hf_hub_url("loubnabnl/bigcode_csharp", "data/c#/data_0003.jsonl")
print(url)
# Currently returns
# https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/main/data/c#/data_0003.jsonl
# while it should be
# https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/main/data/c%23/data_0003.jsonl
``` | ## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.
## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
cc @lhoestq | 481 | 38 | datasets doesn't support # in data paths
## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.
## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
cc @lhoestq
`datasets` doesn't seem to urlencode the directory names here
https://github.com/huggingface/datasets/blob/7feeb5648a63b6135a8259dedc3b1e19185ee4c7/src/datasets/utils/file_utils.py#L109-L111
for example we should have
```python
from datasets.utils.file_utils import hf_hub_url
url = hf_hub_url("loubnabnl/bigcode_csharp", "data/c#/data_0003.jsonl")
print(url)
# Currently returns
# https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/main/data/c#/data_0003.jsonl
# while it should be
# https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/main/data/c%23/data_0003.jsonl
``` | [
-1.1222840547561646,
-0.8633701205253601,
-0.7356037497520447,
1.4952751398086548,
-0.09431442618370056,
-1.2968454360961914,
0.14688751101493835,
-0.9890904426574707,
1.6707854270935059,
-0.7388932108879089,
0.23922184109687805,
-1.710309624671936,
-0.06325735151767731,
-0.5682584643363953,
-0.6974329948425293,
-0.8263242840766907,
-0.29945459961891174,
-0.7963764667510986,
1.0466524362564087,
2.4782772064208984,
1.2052490711212158,
-1.271382451057434,
2.7693088054656982,
0.6958073377609253,
-0.2481556534767151,
-0.9326995015144348,
0.5006620287895203,
-0.03463273495435715,
-1.2918184995651245,
-0.38987040519714355,
-0.9281262159347534,
-0.04686138406395912,
-0.5108997225761414,
-0.5309336185455322,
0.05200624838471413,
0.4730542302131653,
-0.2734776437282562,
-0.4456660747528076,
-0.5827500224113464,
-0.7372039556503296,
0.44070538878440857,
-0.3299916684627533,
0.9112154245376587,
-0.3303292393684387,
1.8297878503799438,
-0.5904785394668579,
0.3665749728679657,
0.7440738677978516,
1.2410629987716675,
0.17697876691818237,
0.04015373811125755,
0.30803200602531433,
0.34408822655677795,
0.016182757914066315,
0.5375731587409973,
1.2606147527694702,
0.5750376582145691,
0.48756828904151917,
0.6802772283554077,
-2.2458128929138184,
1.3096075057983398,
-0.9260162115097046,
0.24176011979579926,
1.3061739206314087,
-0.9798344373703003,
0.36722248792648315,
-1.8385965824127197,
-0.0037870951928198338,
0.5478048324584961,
-2.2865490913391113,
0.25320857763290405,
-1.3801506757736206,
-0.5233235955238342,
1.0096410512924194,
0.30062609910964966,
-1.2282923460006714,
0.11055144667625427,
-0.49087047576904297,
1.0769672393798828,
0.4530113637447357,
1.1011390686035156,
-1.6969271898269653,
-0.05031450092792511,
-0.2027517855167389,
0.14188522100448608,
-1.3296656608581543,
-1.6293590068817139,
0.5444658398628235,
0.7109099626541138,
0.719054102897644,
-0.1355961263179779,
0.9712986946105957,
-0.9613890051841736,
0.7191206216812134,
-0.9164589643478394,
-1.784649133682251,
-1.3551827669143677,
-2.2795677185058594,
-2.250074625015259,
0.7536694407463074,
-0.4746786952018738,
-0.47147953510284424,
2.0257654190063477,
-1.0544689893722534,
-1.8230986595153809,
1.139682412147522,
0.2948950231075287,
-0.020198749378323555,
2.322310447692871,
0.33332768082618713,
-0.7877727150917053,
0.4987591803073883,
-0.7091498374938965,
0.6731776595115662,
-0.35366806387901306,
1.2783774137496948,
0.45436182618141174,
-1.082082986831665,
1.577762246131897,
-0.42625394463539124,
0.6653383374214172,
-0.7545567154884338,
-0.4809165596961975,
-0.7833792567253113,
0.27122384309768677,
1.9169193506240845,
-0.3479527533054352,
1.5238116979599,
-0.3395988345146179,
-1.596696138381958,
-1.5083526372909546,
0.7930330634117126,
0.4766376316547394,
-0.7718702554702759,
0.12713482975959778,
-0.40713444352149963,
0.10377752780914307,
-0.058445997536182404,
1.1096798181533813,
1.2045632600784302,
0.7426623702049255,
-0.26672038435935974,
-0.7795630097389221,
0.27236607670783997,
0.016684673726558685,
-0.6951647996902466,
-1.7906795740127563,
-0.2828204035758972,
0.27410241961479187,
0.6130062937736511,
-1.2670949697494507,
1.7464216947555542,
0.7896947860717773,
1.990142822265625,
1.010945439338684,
-0.336788147687912,
1.4855797290802002,
0.06801830232143402,
1.9491866827011108,
-0.4025424122810364,
0.5867074131965637,
-0.316744863986969,
-1.2099953889846802,
0.7933236956596375,
-0.3551657199859619,
-2.0134708881378174,
-0.7005383968353271,
-0.8479774594306946,
-0.1826079785823822,
-0.7854078412055969,
0.8942245841026306,
-0.2903895676136017,
-1.4592595100402832,
0.14681877195835114,
-0.7299624681472778,
0.18099169433116913,
-1.2817342281341553,
0.18103700876235962,
0.7865325808525085,
-0.7120143175125122,
0.07271601259708405,
-0.24964070320129395,
-1.3237109184265137,
-0.4916057586669922,
0.39310991764068604,
1.8892505168914795,
-0.6803863048553467,
0.935689389705658,
1.0546584129333496,
-0.7263327836990356,
0.023809868842363358,
0.28761446475982666,
-0.3610849380493164,
0.835209846496582,
-1.0937831401824951,
-0.36807000637054443,
1.1653019189834595,
-0.16530968248844147,
-0.6506300568580627,
1.4125311374664307,
0.7549794912338257,
-1.0761053562164307,
-0.2564210593700409,
-0.1959637552499771,
-0.8200749158859253,
-0.014125339686870575,
-1.6091649532318115,
-0.15654614567756653,
0.36045289039611816,
-1.4906837940216064,
-0.4620721936225891,
-0.25204241275787354,
1.3620232343673706,
-0.12731337547302246,
1.3658368587493896,
-0.22881455719470978,
-0.15461622178554535,
-0.39342719316482544,
-0.4964606463909149,
0.14579123258590698,
-0.2816683351993561,
-0.6430970430374146,
0.20280329883098602,
-0.715371310710907,
0.25695475935935974,
1.486039638519287,
0.3035966455936432,
0.08920633792877197,
0.6101287007331848,
1.1509754657745361,
0.43746232986450195,
-0.1508239358663559,
-0.8549590706825256,
-1.6141310930252075,
1.963410496711731,
-1.4339094161987305,
1.9456816911697388,
0.7586752772331238,
-0.044244956225156784,
-1.8582931756973267,
-1.9828301668167114,
1.3630489110946655,
1.1585910320281982,
2.4041783809661865,
0.5421677231788635,
0.4972971975803375,
-0.7527631521224976,
-0.6990960836410522,
0.30616408586502075,
-0.9846600890159607,
-0.6976706981658936,
0.18621283769607544,
2.3757314682006836,
1.7331626415252686,
-0.5535385012626648,
-0.25225433707237244,
-0.9861587882041931,
1.2717036008834839,
-0.2387576401233673,
0.23918375372886658,
2.0657026767730713,
-0.2502281367778778,
-0.9472456574440002,
1.296927809715271,
-2.3206992149353027,
0.2466428130865097,
1.953948736190796,
0.14752088487148285,
0.10497790575027466,
-1.4038023948669434,
-0.6761294603347778,
-0.2584611773490906,
-0.4657394289970398,
-1.2604014873504639,
0.5663312673568726,
-0.22917310893535614,
-0.8172458410263062,
-1.4311041831970215,
0.12420190870761871,
-1.0610002279281616,
-1.7165285348892212,
0.24422858655452728,
1.932541012763977,
2.004131555557251,
-0.8429173231124878,
1.4469081163406372,
-0.25306981801986694,
0.1670791357755661,
1.2883111238479614,
1.2706273794174194,
3.171929359436035,
1.8569886684417725,
-1.2750827074050903,
0.7673645615577698,
-0.1462828367948532,
-0.46498027443885803,
1.1992590427398682,
-1.107012152671814,
1.2163126468658447,
-0.23354072868824005,
-1.2733068466186523,
-1.235379695892334,
0.9404347538948059,
0.5653601884841919,
0.018506038933992386,
-0.46989646553993225,
1.2403968572616577,
0.1004415899515152,
1.3677504062652588,
0.5909830927848816,
-0.3953661620616913,
0.5976021885871887,
-0.36488085985183716,
-0.49388715624809265,
1.55903160572052,
0.19316887855529785,
-1.4160490036010742,
-2.313720941543579,
-0.1826612949371338,
-0.8598273992538452,
-0.0696793794631958,
-0.6584717631340027,
-1.0043697357177734,
1.5488425493240356,
0.4701040983200073,
-1.1680845022201538,
-0.24494023621082306,
-0.32784631848335266,
-0.5582190155982971,
2.675954818725586,
-1.3870550394058228,
-0.17998357117176056,
-1.0039145946502686,
-0.5360327363014221,
1.667231798171997,
-1.2040756940841675,
-0.2654043734073639,
-0.9839674234390259,
-0.6053853034973145,
-1.325675129890442,
-0.580098569393158,
0.03740612417459488,
-0.8615924715995789,
0.8214530348777771,
0.1365099549293518,
-1.2297616004943848,
-0.22390630841255188,
-0.957646906375885,
0.9787682294845581,
-0.1828654408454895,
0.19840013980865479,
1.892881989479065,
0.3482813835144043,
-0.4103473424911499,
0.7235304117202759,
1.1727491617202759,
0.6030056476593018,
-0.6416752338409424,
0.2696761190891266,
-0.7253900170326233,
0.2868482768535614,
-1.41864812374115,
0.2602701485157013,
-2.8963117599487305,
0.6659345030784607,
-0.06227599084377289,
-0.08486723899841309,
0.006100373342633247,
-1.342113733291626,
1.0432443618774414,
2.508458137512207,
-1.2074757814407349,
0.44308552145957947,
0.4039852023124695,
1.243370771408081,
-1.5699554681777954,
0.24070040881633759,
-0.44467973709106445,
2.059077501296997,
0.1264382153749466,
1.2234196662902832,
-0.39696136116981506,
-2.2320263385772705,
0.6276136636734009,
-1.215236783027649,
-1.0818171501159668,
0.8695611357688904,
-0.854051947593689,
0.16371037065982819,
-1.4165054559707642,
-0.18232941627502441,
-0.8648487329483032,
-1.2068419456481934,
0.7454719543457031,
0.10043595731258392,
0.4731493592262268,
-0.5802993178367615,
0.313677042722702,
-2.120032787322998,
-1.3518593311309814,
-0.19564320147037506,
-0.9622997641563416,
0.4662736654281616,
-0.29689696431159973,
0.6685786843299866,
-0.11662185192108154,
0.009443027898669243,
0.3329663872718811,
1.4188973903656006,
3.3763561248779297,
0.13645410537719727,
0.32644549012184143,
-0.1544683277606964,
-0.9861199259757996,
1.3993350267410278,
0.9262694716453552,
-0.1763506978750229,
-0.5779025554656982,
-1.0251771211624146,
1.2395012378692627,
1.9617784023284912,
1.1192564964294434,
0.09917734563350677,
-0.8840345740318298,
-0.8279778957366943,
0.0351150780916214,
0.1796523928642273,
0.510591983795166,
0.9315898418426514,
0.0800105631351471,
0.09078061580657959,
1.4474390745162964,
1.1067746877670288,
-0.3542060852050781,
0.4188806116580963,
-0.8821521997451782,
-0.4361586272716522,
0.4940517842769623,
0.2747787535190582,
0.05225108936429024,
0.32844898104667664,
-1.0885437726974487,
-0.306816428899765,
-0.33321434259414673,
-0.8875560164451599,
-0.7485705614089966,
-0.3845723867416382,
-0.34698817133903503,
1.6185494661331177,
0.021348368376493454,
-0.5029348134994507,
0.016019998118281364,
-0.6945457458496094,
-0.10286982357501984,
-1.0082263946533203,
0.2557915151119232,
-0.14755851030349731,
-0.08241322636604309,
-0.1318061351776123,
1.6295286417007446,
-0.9845535755157471,
-2.1186811923980713,
0.20978818833827972,
0.25799560546875,
-0.35752350091934204,
0.13605131208896637,
1.712423324584961,
0.5377187132835388,
1.3911181688308716,
1.3653699159622192,
1.0251654386520386,
-0.7081311941146851,
-1.2963167428970337,
0.6536856293678284,
0.9469621181488037,
-1.414221167564392,
0.8037289977073669,
-0.08889298141002655,
-0.564984917640686,
0.6145421266555786,
1.3420429229736328,
0.47987279295921326,
-1.9893929958343506,
0.7782961130142212,
-0.9480438232421875,
0.696934700012207,
0.7375297546386719,
0.8534704446792603,
0.2359287589788437,
0.8161901831626892,
-1.2450312376022339,
-1.1713351011276245,
-0.655063271522522,
-0.648248016834259,
1.901367425918579,
-0.20823484659194946,
0.5004974007606506,
-0.13772916793823242,
-1.3599568605422974,
-0.006863508839160204,
0.7649171948432922,
0.41149356961250305,
-0.505525529384613,
0.786682665348053,
-0.7009303569793701,
-0.9530101418495178,
-1.3045200109481812,
-0.495334655046463,
-1.0808005332946777,
-0.9188244938850403,
0.952215313911438,
0.846006453037262,
0.394236296415329,
1.8159774541854858,
0.6478849649429321,
0.332097589969635,
-2.6131107807159424,
0.9064741134643555,
0.321026086807251,
-0.049556177109479904,
0.8889086842536926,
0.2901788055896759,
1.133460521697998,
-0.05491652712225914,
0.595513641834259,
-2.3750927448272705,
2.262852430343628,
-0.21920239925384521,
0.577895998954773,
-0.029188264161348343,
-0.2114262729883194,
1.0556524991989136,
0.5223389863967896,
0.5812923908233643,
-1.0916744470596313,
0.7680654525756836,
-0.5785958766937256,
1.1152403354644775,
0.8642128109931946,
-0.8982799053192139,
-0.018162064254283905,
1.3080271482467651,
0.4915100038051605,
-0.5305970907211304,
-0.9115973711013794,
-0.9745237231254578,
0.9716486930847168,
1.6656602621078491,
-0.012328960001468658,
0.02112511917948723,
0.9071476459503174,
0.6251373887062073,
-1.317043423652649,
0.08849512040615082,
-0.68363356590271,
-0.6819636821746826,
1.6329855918884277,
2.0216996669769287,
-0.1096099317073822,
-0.19302520155906677,
-0.8141903877258301,
-1.1567524671554565,
0.8029292225837708,
0.009022628888487816,
0.04912083223462105,
0.6831539273262024,
-0.7178330421447754,
1.14456307888031,
0.758506178855896,
0.9681609272956848,
0.1544535607099533,
0.3082534968852997,
0.3391057252883911,
-0.3426804840564728,
-1.1991958618164062,
-0.3217095732688904,
-1.0676738023757935,
-2.481374502182007,
0.450323224067688,
-0.1875738948583603,
-1.394878625869751,
0.05339563265442848,
-1.0311270952224731,
0.8771988153457642,
-0.6380586624145508,
-1.1336113214492798,
-1.4971885681152344,
0.30143895745277405,
-0.19488000869750977,
0.8277824521064758,
-1.5998038053512573,
-0.16925515234470367,
1.267374873161316,
0.9926475286483765,
-0.6571983098983765,
0.9564896821975708,
0.24334605038166046,
1.0297316312789917,
0.888510525226593,
-0.3618588447570801,
0.49932101368904114,
0.1351153403520584,
-1.3453681468963623,
0.4694150388240814,
1.2598844766616821,
0.16140802204608917,
1.484470248222351,
-0.5743533968925476,
0.017409585416316986,
0.44948703050613403,
-0.5062401294708252,
-0.5244038701057434,
-0.63392573595047,
0.6761648058891296,
0.06339524686336517,
-0.9527024626731873,
-0.005200985353440046,
-0.07047241926193237,
-0.2130817025899887,
0.23122833669185638,
-1.5741055011749268,
-0.17678451538085938,
-0.30589649081230164,
-0.6274256706237793,
-1.2579981088638306,
-0.013670869171619415,
1.3082820177078247,
-0.8032862544059753,
-0.22524768114089966,
0.5010164380073547,
0.3219664394855499,
0.5075516104698181,
0.5634705424308777,
-0.7231793403625488,
-0.25408104062080383,
-0.2969447076320648,
-0.3735906481742859,
0.30825075507164,
1.3168587684631348,
-0.04712296649813652,
-0.9960501194000244,
0.6834526062011719,
-0.44436711072921753,
0.0736418068408966,
2.024540901184082,
0.038575686514377594,
-0.8860172629356384,
0.30655673146247864,
-0.7256777882575989,
1.8922369480133057,
1.7052929401397705,
1.3762503862380981,
-0.03246542066335678,
-0.8818296790122986,
0.5852351188659668,
-0.32287129759788513,
-0.385047972202301,
1.0154519081115723,
0.3985736668109894,
-0.29663336277008057,
-1.3524572849273682,
0.6806591153144836,
1.3137705326080322,
-0.885339081287384,
-0.7977240681648254,
0.11413414776325226,
-0.8503915667533875,
1.1445661783218384,
0.7246861457824707,
0.31910666823387146,
0.270746648311615,
1.5246176719665527,
0.7603399753570557,
-0.47100743651390076,
0.535489559173584,
0.5083080530166626,
-0.15604719519615173,
-2.039301633834839,
-1.0151557922363281,
0.36698102951049805,
-0.3365180194377899,
-1.5714409351348877,
1.4355844259262085,
-1.211924433708191,
-0.9403933882713318,
0.5394054651260376,
0.11219802498817444,
1.3803542852401733,
0.3600793182849884,
1.6357680559158325,
2.0948522090911865,
0.8871340155601501,
0.3259942829608917,
1.2879208326339722,
-0.16719013452529907,
-0.3997231721878052,
1.7553671598434448,
-0.493000328540802,
0.5535622835159302,
0.9942224025726318,
-0.3770114481449127,
-1.076578974723816,
-0.7926219701766968,
-1.222123622894287,
-0.6954531073570251,
1.162195086479187,
0.11586545407772064,
-1.092710256576538,
0.2980721890926361,
1.6137490272521973,
0.10690641403198242,
-0.28788524866104126,
0.7550441026687622,
0.3922528922557831,
-0.7734811902046204,
-0.0942077785730362,
-0.9002059698104858,
0.5111351609230042,
-0.14943183958530426,
-0.3097669184207916,
0.32396167516708374,
0.5288380980491638,
1.3032312393188477,
0.015255702659487724,
0.11362026631832123,
1.2346876859664917,
-1.3908933401107788,
1.5220239162445068,
-0.7577068209648132,
0.2778223752975464,
-2.4869704246520996,
1.414982795715332,
-0.8120240569114685,
1.9411916732788086,
-2.6035408973693848,
0.4629106819629669,
-0.47074320912361145,
-0.469693124294281,
0.22545020282268524,
-0.32478150725364685,
0.130876362323761,
-0.15130217373371124,
-1.1010394096374512,
-0.1448143720626831,
-0.8256224393844604,
0.6229900121688843,
1.2322602272033691,
1.416208028793335,
-1.0879491567611694,
-0.24870562553405762,
-1.7589908838272095,
-0.15148143470287323,
-0.7251930236816406,
0.3006930649280548,
-1.8975967168807983,
-0.20521143078804016,
-1.9189931154251099,
-2.455855369567871,
-1.2988266944885254,
-0.8176782131195068,
1.116265058517456,
0.14043015241622925,
-1.0218498706817627,
1.1777994632720947,
-0.40642550587654114,
-1.8160738945007324,
1.1178975105285645,
-2.1834144592285156
] |
https://github.com/huggingface/datasets/issues/5099 | datasets doesn't support # in data paths | @loubnabnl The dataset you linked in the description of the bug does not work and returns a 404. Where can I find the dataset to reproduce the bug? | ## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.
## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
cc @lhoestq | 481 | 28 | datasets doesn't support # in data paths
## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.
## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
cc @lhoestq
@loubnabnl The dataset you linked in the description of the bug does not work and returns a 404. Where can I find the dataset to reproduce the bug? | [
-1.109232783317566,
-0.8196495175361633,
-0.7909187078475952,
1.5139583349227905,
-0.09691902250051498,
-1.3175631761550903,
0.12305980920791626,
-0.9912744164466858,
1.6967222690582275,
-0.7532179951667786,
0.2576947808265686,
-1.7327409982681274,
-0.0438721738755703,
-0.6096151471138,
-0.7262455224990845,
-0.8953830003738403,
-0.28033503890037537,
-0.7255952954292297,
1.0251212120056152,
2.461740732192993,
1.1642509698867798,
-1.3223053216934204,
2.7251737117767334,
0.703390896320343,
-0.18613189458847046,
-0.9315491318702698,
0.5146441459655762,
0.002489033155143261,
-1.3082714080810547,
-0.3754253387451172,
-0.8845011591911316,
-0.09075877070426941,
-0.5411596894264221,
-0.5620129704475403,
0.020300891250371933,
0.4643516540527344,
-0.2880956530570984,
-0.45652222633361816,
-0.44848668575286865,
-0.7940121293067932,
0.41280946135520935,
-0.2994621694087982,
0.8669512271881104,
-0.3812699615955353,
1.841978669166565,
-0.5962796211242676,
0.3816915452480316,
0.7606565356254578,
1.2413833141326904,
0.19455896317958832,
0.017837025225162506,
0.3270827531814575,
0.34821900725364685,
0.020462386310100555,
0.5189823508262634,
1.1945528984069824,
0.5774316191673279,
0.49956265091896057,
0.6719081997871399,
-2.241685152053833,
1.325069785118103,
-0.9824298620223999,
0.25644639134407043,
1.340912938117981,
-1.0622031688690186,
0.3782960772514343,
-1.8283461332321167,
-0.06377831846475601,
0.5316851139068604,
-2.2540283203125,
0.20709924399852753,
-1.3406426906585693,
-0.5113436579704285,
1.0112046003341675,
0.3085480034351349,
-1.2289526462554932,
0.09298591315746307,
-0.41570231318473816,
1.074779748916626,
0.5022569298744202,
1.1346186399459839,
-1.6965388059616089,
-0.0013777194544672966,
-0.23966142535209656,
0.1632472276687622,
-1.3726935386657715,
-1.568155288696289,
0.48982423543930054,
0.7238821387290955,
0.6793920993804932,
-0.12017751485109329,
0.9366467595100403,
-0.9141338467597961,
0.7095139026641846,
-0.8782012462615967,
-1.7992347478866577,
-1.34298574924469,
-2.287419557571411,
-2.2899436950683594,
0.7932820320129395,
-0.49156567454338074,
-0.48376592993736267,
2.022311210632324,
-1.0460432767868042,
-1.7965439558029175,
1.0986137390136719,
0.30765601992607117,
-0.0286283977329731,
2.319748878479004,
0.31220370531082153,
-0.7873488664627075,
0.5166493058204651,
-0.7328660488128662,
0.5949034690856934,
-0.3853328227996826,
1.2916209697723389,
0.4994398057460785,
-1.1101094484329224,
1.5699928998947144,
-0.4260596036911011,
0.6502863168716431,
-0.8211768269538879,
-0.4607793092727661,
-0.7981522679328918,
0.2530389428138733,
1.9143685102462769,
-0.3063494563102722,
1.5408209562301636,
-0.27253079414367676,
-1.558157205581665,
-1.49971604347229,
0.8018915057182312,
0.41821661591529846,
-0.7726854681968689,
0.19326423108577728,
-0.35705339908599854,
0.11189056187868118,
-0.009251302108168602,
1.0900120735168457,
1.1872750520706177,
0.7205068469047546,
-0.24816009402275085,
-0.8097178339958191,
0.2757677137851715,
0.03373048081994057,
-0.6686980128288269,
-1.7840359210968018,
-0.2725614607334137,
0.24305911362171173,
0.6050398945808411,
-1.2791558504104614,
1.7142609357833862,
0.7672601342201233,
1.9195387363433838,
1.0357270240783691,
-0.3445030152797699,
1.5163021087646484,
0.041288524866104126,
1.9995396137237549,
-0.3721603453159332,
0.6238588690757751,
-0.3409149944782257,
-1.1875600814819336,
0.7875502109527588,
-0.35193106532096863,
-2.01969051361084,
-0.6697331070899963,
-0.9218670129776001,
-0.13274651765823364,
-0.8035957217216492,
0.9661662578582764,
-0.24220484495162964,
-1.449266791343689,
0.22907789051532745,
-0.7387886047363281,
0.1653449684381485,
-1.3051862716674805,
0.23691414296627045,
0.7968016862869263,
-0.6739364266395569,
0.06228896602988243,
-0.31192076206207275,
-1.3708865642547607,
-0.47910335659980774,
0.4000859260559082,
1.868102788925171,
-0.77555251121521,
0.9660559296607971,
1.026862382888794,
-0.7471690773963928,
-0.03492407128214836,
0.3427369296550751,
-0.3964928090572357,
0.8939725756645203,
-1.0587995052337646,
-0.39964988827705383,
1.1394968032836914,
-0.1509179323911667,
-0.6975536346435547,
1.4366424083709717,
0.7524771690368652,
-1.0502148866653442,
-0.20662152767181396,
-0.20059502124786377,
-0.8608847260475159,
-0.033278148621320724,
-1.6542335748672485,
-0.1503159999847412,
0.3106081485748291,
-1.4933843612670898,
-0.4892899990081787,
-0.18657679855823517,
1.359796404838562,
-0.16106638312339783,
1.3952040672302246,
-0.26875388622283936,
-0.15292537212371826,
-0.4833359122276306,
-0.47299501299858093,
0.14932532608509064,
-0.2794860899448395,
-0.6683422923088074,
0.2373601496219635,
-0.6764763593673706,
0.2500864565372467,
1.4001648426055908,
0.33258023858070374,
0.06871410459280014,
0.6554978489875793,
1.1397565603256226,
0.34665870666503906,
-0.15534693002700806,
-0.8494915962219238,
-1.628455638885498,
2.0060973167419434,
-1.4132055044174194,
1.9357787370681763,
0.6925410032272339,
-0.07691563665866852,
-1.8788806200027466,
-1.9721310138702393,
1.4225850105285645,
1.194555401802063,
2.366834878921509,
0.5634142756462097,
0.5087825059890747,
-0.7539703249931335,
-0.6692445874214172,
0.3164844214916229,
-0.9787891507148743,
-0.7528992891311646,
0.16457824409008026,
2.3784351348876953,
1.721602439880371,
-0.5157938003540039,
-0.2302141934633255,
-1.01091730594635,
1.2921111583709717,
-0.2561423182487488,
0.2249363362789154,
2.0806233882904053,
-0.22037382423877716,
-0.9976012110710144,
1.2632554769515991,
-2.326219320297241,
0.14217893779277802,
1.9896992444992065,
0.21523220837116241,
0.0742330476641655,
-1.4118503332138062,
-0.7052180171012878,
-0.24559111893177032,
-0.5217040777206421,
-1.2630252838134766,
0.5066654086112976,
-0.23857343196868896,
-0.7713288068771362,
-1.4277547597885132,
0.13183367252349854,
-1.0392016172409058,
-1.6959234476089478,
0.20842677354812622,
1.8661142587661743,
1.9952082633972168,
-0.788202166557312,
1.4885889291763306,
-0.19612258672714233,
0.26477622985839844,
1.2646204233169556,
1.237767219543457,
3.190369129180908,
1.8915424346923828,
-1.2865885496139526,
0.7451289296150208,
-0.07485910505056381,
-0.49290138483047485,
1.2410807609558105,
-1.140089750289917,
1.2065364122390747,
-0.2716321349143982,
-1.2996379137039185,
-1.264262318611145,
0.9139780402183533,
0.5166895389556885,
0.06070120260119438,
-0.4858705401420593,
1.2239664793014526,
0.057604361325502396,
1.3567707538604736,
0.5905769467353821,
-0.352847695350647,
0.548660159111023,
-0.4332776367664337,
-0.5045455694198608,
1.6015968322753906,
0.1964549571275711,
-1.381934404373169,
-2.325087547302246,
-0.15356263518333435,
-0.8618719577789307,
-0.10715219378471375,
-0.6499748229980469,
-0.971113920211792,
1.5407114028930664,
0.5321035385131836,
-1.1674094200134277,
-0.2729805111885071,
-0.3365722894668579,
-0.6511091589927673,
2.7229607105255127,
-1.4383679628372192,
-0.20793713629245758,
-1.0149821043014526,
-0.5748008489608765,
1.6693438291549683,
-1.207390308380127,
-0.24964888393878937,
-0.9574589133262634,
-0.6134960055351257,
-1.347931981086731,
-0.5687935948371887,
-0.0014927294105291367,
-0.8885199427604675,
0.8286100029945374,
0.12462674081325531,
-1.2578692436218262,
-0.21828965842723846,
-0.9785922765731812,
0.8984567523002625,
-0.18161088228225708,
0.26179739832878113,
1.8528392314910889,
0.3923332691192627,
-0.40399104356765747,
0.7218464612960815,
1.153734564781189,
0.6111325621604919,
-0.6167513132095337,
0.3245789408683777,
-0.7434061765670776,
0.2718340754508972,
-1.35442316532135,
0.24280764162540436,
-2.8997139930725098,
0.5987883806228638,
-0.02349056489765644,
-0.05652688816189766,
-0.03243837133049965,
-1.2894302606582642,
1.0621885061264038,
2.506951093673706,
-1.2262295484542847,
0.467803955078125,
0.34840118885040283,
1.275654673576355,
-1.602064609527588,
0.23781128227710724,
-0.4639112651348114,
2.1343302726745605,
0.11148794740438461,
1.1711634397506714,
-0.34791508316993713,
-2.2466537952423096,
0.6053378582000732,
-1.2335081100463867,
-1.0999066829681396,
0.8671847581863403,
-0.7987582683563232,
0.15062081813812256,
-1.3784785270690918,
-0.16523191332817078,
-0.8414070010185242,
-1.1915309429168701,
0.7901864051818848,
0.06836245208978653,
0.5117754340171814,
-0.5599856972694397,
0.28696247935295105,
-2.126704692840576,
-1.3091884851455688,
-0.18180367350578308,
-0.9723106026649475,
0.4322223663330078,
-0.2844623327255249,
0.713472306728363,
-0.12829750776290894,
0.018055684864521027,
0.32366514205932617,
1.3654128313064575,
3.3738112449645996,
0.16532650589942932,
0.3879784643650055,
-0.13077658414840698,
-0.959197461605072,
1.4176740646362305,
0.9446653127670288,
-0.21883344650268555,
-0.5763847827911377,
-1.0304620265960693,
1.2401202917099,
1.9453668594360352,
1.115591287612915,
0.1235416978597641,
-0.853205144405365,
-0.8157752752304077,
0.039441194385290146,
0.17399802803993225,
0.5256285667419434,
0.8950521945953369,
0.06841343641281128,
0.10428410023450851,
1.4807045459747314,
1.1152594089508057,
-0.3184111416339874,
0.3972654938697815,
-0.8642304539680481,
-0.3960537612438202,
0.5407372713088989,
0.31749558448791504,
0.07643121480941772,
0.3283272683620453,
-1.0310333967208862,
-0.3049868941307068,
-0.3040262460708618,
-0.9065634608268738,
-0.6976649761199951,
-0.4239465892314911,
-0.3365304172039032,
1.650323748588562,
0.05095835402607918,
-0.5294779539108276,
-0.04170648753643036,
-0.7518256306648254,
-0.052787646651268005,
-1.025648593902588,
0.30642151832580566,
-0.16010598838329315,
-0.037793710827827454,
-0.11434382945299149,
1.693663477897644,
-0.9814704656600952,
-2.142974615097046,
0.2207842767238617,
0.2939537763595581,
-0.3717748522758484,
0.11555211246013641,
1.6791279315948486,
0.54953932762146,
1.395124077796936,
1.3730660676956177,
1.042832851409912,
-0.7073178887367249,
-1.3565837144851685,
0.6235445737838745,
0.9658510088920593,
-1.4214726686477661,
0.7809265851974487,
-0.014354100450873375,
-0.5233129858970642,
0.5682751536369324,
1.2994505167007446,
0.44017088413238525,
-1.9818180799484253,
0.7107622623443604,
-0.9516748189926147,
0.6828792691230774,
0.700838029384613,
0.8327867984771729,
0.22328969836235046,
0.8089193105697632,
-1.2853463888168335,
-1.1541537046432495,
-0.6784290075302124,
-0.6404298543930054,
1.8654727935791016,
-0.19197973608970642,
0.47824546694755554,
-0.11669255048036575,
-1.379835844039917,
0.009510220028460026,
0.7433751821517944,
0.3881099224090576,
-0.446461021900177,
0.8071374893188477,
-0.7177086472511292,
-1.062503695487976,
-1.357974648475647,
-0.4527072012424469,
-1.0328387022018433,
-0.8724512457847595,
0.9666559100151062,
0.8513256311416626,
0.34237974882125854,
1.7777597904205322,
0.631400465965271,
0.2881186306476593,
-2.6300277709960938,
0.8793397545814514,
0.3101213276386261,
-0.0294160395860672,
0.8426961898803711,
0.2962414622306824,
1.1167389154434204,
-0.08910800516605377,
0.580199122428894,
-2.4072587490081787,
2.278897285461426,
-0.2690725028514862,
0.5808542966842651,
0.025509607046842575,
-0.18932780623435974,
1.0628433227539062,
0.5119069814682007,
0.6112127900123596,
-1.0945919752120972,
0.7949986457824707,
-0.6422767639160156,
1.1465907096862793,
0.8960435390472412,
-0.8466091156005859,
-0.028049714863300323,
1.272276759147644,
0.463137149810791,
-0.5061668157577515,
-0.9101579189300537,
-1.0033314228057861,
0.9956701993942261,
1.6905710697174072,
0.021230697631835938,
0.002958579920232296,
0.9418193101882935,
0.6313467025756836,
-1.3167791366577148,
0.13074834644794464,
-0.7619675397872925,
-0.674988865852356,
1.6619763374328613,
2.0250697135925293,
-0.1100866049528122,
-0.14297445118427277,
-0.8558763265609741,
-1.1558148860931396,
0.8062740564346313,
0.03641779348254204,
0.02635328844189644,
0.7316200733184814,
-0.6824960112571716,
1.1316015720367432,
0.8446736931800842,
0.9419373869895935,
0.22358611226081848,
0.2971910238265991,
0.3134065866470337,
-0.29386991262435913,
-1.1940836906433105,
-0.26992419362068176,
-1.0257315635681152,
-2.4641616344451904,
0.44489535689353943,
-0.2502245604991913,
-1.3413457870483398,
0.08665069192647934,
-1.0238373279571533,
0.870573103427887,
-0.5797698497772217,
-1.1418180465698242,
-1.460000991821289,
0.27275019884109497,
-0.17342215776443481,
0.8110091090202332,
-1.5663280487060547,
-0.11025240272283554,
1.319366693496704,
0.9888149499893188,
-0.6567755937576294,
0.9570383429527283,
0.23488204181194305,
1.0286104679107666,
0.9077146649360657,
-0.36972692608833313,
0.44817814230918884,
0.1859464943408966,
-1.3433870077133179,
0.5124567151069641,
1.2375047206878662,
0.13241732120513916,
1.4697333574295044,
-0.5844637155532837,
-0.010711552575230598,
0.3788596987724304,
-0.44536346197128296,
-0.5072118639945984,
-0.7216648459434509,
0.6858929991722107,
0.10943799465894699,
-0.9191693067550659,
0.0510832816362381,
-0.03373335301876068,
-0.16789178550243378,
0.23485001921653748,
-1.544431209564209,
-0.12171027809381485,
-0.24729537963867188,
-0.6747709512710571,
-1.248427152633667,
-0.014056597836315632,
1.287243127822876,
-0.8024596571922302,
-0.18628621101379395,
0.5215292572975159,
0.2963620722293854,
0.5423489809036255,
0.5457870960235596,
-0.6589328050613403,
-0.24780143797397614,
-0.2928730845451355,
-0.33197861909866333,
0.3116302192211151,
1.2981915473937988,
-0.07203426212072372,
-0.9478969573974609,
0.7035686373710632,
-0.4458368420600891,
0.039698828011751175,
2.0415287017822266,
0.05414490029215813,
-0.9322210550308228,
0.3108087182044983,
-0.7417511343955994,
1.9248669147491455,
1.751052737236023,
1.3744051456451416,
-0.011592024937272072,
-0.9469469785690308,
0.5199666619300842,
-0.3276204764842987,
-0.4122791886329651,
0.9837437272071838,
0.41593849658966064,
-0.28650766611099243,
-1.3013328313827515,
0.653485894203186,
1.285880446434021,
-0.8555752038955688,
-0.8335738778114319,
0.14725056290626526,
-0.8575019240379333,
1.0684549808502197,
0.7672044038772583,
0.3781105875968933,
0.2834395468235016,
1.5249154567718506,
0.724044919013977,
-0.5282830595970154,
0.5012267231941223,
0.5245363116264343,
-0.13071399927139282,
-1.9733809232711792,
-1.0512863397598267,
0.3862466812133789,
-0.37804868817329407,
-1.5818121433258057,
1.446014404296875,
-1.2238138914108276,
-0.9055804014205933,
0.569242537021637,
0.11827513575553894,
1.4056578874588013,
0.3138118386268616,
1.601495623588562,
2.0582141876220703,
0.8466302752494812,
0.3381614685058594,
1.3143973350524902,
-0.1685965210199356,
-0.4396829307079315,
1.7751408815383911,
-0.4894389808177948,
0.5571943521499634,
1.01641047000885,
-0.36406323313713074,
-1.063542127609253,
-0.8041472434997559,
-1.198512077331543,
-0.6926648616790771,
1.1282891035079956,
0.12277528643608093,
-1.1021232604980469,
0.2508678734302521,
1.6037627458572388,
0.07712310552597046,
-0.30353280901908875,
0.7125157713890076,
0.3808574378490448,
-0.8051531314849854,
-0.05087525397539139,
-1.0073496103286743,
0.5359392166137695,
-0.15222682058811188,
-0.2957456707954407,
0.3540094494819641,
0.4443522095680237,
1.274235486984253,
0.05915336683392525,
0.18168090283870697,
1.3139870166778564,
-1.3543572425842285,
1.5327361822128296,
-0.7650766372680664,
0.25163397192955017,
-2.461986541748047,
1.438739538192749,
-0.8097112774848938,
1.930116057395935,
-2.6155824661254883,
0.4241639971733093,
-0.4986879229545593,
-0.4505350589752197,
0.2712414860725403,
-0.3284846544265747,
0.11952228844165802,
-0.18133234977722168,
-1.1346302032470703,
-0.14424654841423035,
-0.8544567823410034,
0.5274218916893005,
1.212397813796997,
1.396116852760315,
-1.0565011501312256,
-0.27482205629348755,
-1.7745598554611206,
-0.14772751927375793,
-0.6355995535850525,
0.35454919934272766,
-1.8552755117416382,
-0.18199190497398376,
-1.9098516702651978,
-2.4958386421203613,
-1.3342763185501099,
-0.839241623878479,
1.120348334312439,
0.1090972051024437,
-1.059812307357788,
1.1571437120437622,
-0.40313369035720825,
-1.795884132385254,
1.113274097442627,
-2.1509885787963867
] |
https://github.com/huggingface/datasets/issues/5099 | datasets doesn't support # in data paths | I think you can create a dataset repository on the Hub with a dummy file containing a `#` | ## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.
## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
cc @lhoestq | 481 | 18 | datasets doesn't support # in data paths
## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.
## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
cc @lhoestq
I think you can create a dataset repository on the Hub with a dummy file containing a `#` | [
-1.0964490175247192,
-0.8176577687263489,
-0.7735906839370728,
1.520505666732788,
-0.0913139209151268,
-1.3267632722854614,
0.1186036467552185,
-0.97614985704422,
1.7100766897201538,
-0.7411120533943176,
0.262656569480896,
-1.7311254739761353,
-0.05810884013772011,
-0.6133785247802734,
-0.7132938504219055,
-0.878460705280304,
-0.26285481452941895,
-0.7177066206932068,
1.021578073501587,
2.4664223194122314,
1.172219157218933,
-1.3474247455596924,
2.708272695541382,
0.7148435711860657,
-0.20385098457336426,
-0.9306043982505798,
0.5121691823005676,
0.00902863685041666,
-1.2973021268844604,
-0.36952608823776245,
-0.88901686668396,
-0.10236646980047226,
-0.5392981767654419,
-0.5693771839141846,
0.015536251477897167,
0.4788244962692261,
-0.2803359627723694,
-0.4519970417022705,
-0.45134779810905457,
-0.7951120734214783,
0.4175446927547455,
-0.3046128749847412,
0.8896099328994751,
-0.3822394013404846,
1.8234928846359253,
-0.6102285385131836,
0.38809457421302795,
0.7417229413986206,
1.2452466487884521,
0.19716134667396545,
0.009542998857796192,
0.34096968173980713,
0.35078784823417664,
0.012296528555452824,
0.5326088666915894,
1.198635458946228,
0.5808045864105225,
0.5017409920692444,
0.6769806146621704,
-2.2428438663482666,
1.2973664999008179,
-0.9842233657836914,
0.25951096415519714,
1.3341618776321411,
-1.0448455810546875,
0.364512175321579,
-1.8113784790039062,
-0.061821822077035904,
0.5353368520736694,
-2.2486371994018555,
0.23049983382225037,
-1.3537631034851074,
-0.512696385383606,
1.014900803565979,
0.3190405070781708,
-1.2396448850631714,
0.08017582446336746,
-0.4005391299724579,
1.0592341423034668,
0.4707951247692108,
1.1026102304458618,
-1.7092382907867432,
0.014025320298969746,
-0.23010455071926117,
0.1638694554567337,
-1.3594882488250732,
-1.555515170097351,
0.47928565740585327,
0.7312039732933044,
0.7079805731773376,
-0.12520918250083923,
0.9233818054199219,
-0.921040952205658,
0.6994267106056213,
-0.9043443202972412,
-1.799417495727539,
-1.3320733308792114,
-2.272773265838623,
-2.3097450733184814,
0.796390175819397,
-0.5083476901054382,
-0.456335186958313,
2.0200917720794678,
-1.0444155931472778,
-1.792543649673462,
1.0988942384719849,
0.31217697262763977,
-0.03535902500152588,
2.3243186473846436,
0.321584552526474,
-0.7984327077865601,
0.5209099054336548,
-0.7675274014472961,
0.6117926239967346,
-0.41625872254371643,
1.2934476137161255,
0.48499569296836853,
-1.1246824264526367,
1.590132236480713,
-0.4497694671154022,
0.6493441462516785,
-0.8139041662216187,
-0.4695264399051666,
-0.8021653294563293,
0.28056246042251587,
1.8991141319274902,
-0.2986692786216736,
1.5358682870864868,
-0.2811455726623535,
-1.5596423149108887,
-1.47836434841156,
0.7889914512634277,
0.41324281692504883,
-0.7837641835212708,
0.19265082478523254,
-0.35083460807800293,
0.11677257716655731,
-0.024693407118320465,
1.078883171081543,
1.1621544361114502,
0.7363612651824951,
-0.24297891557216644,
-0.8089873194694519,
0.28464099764823914,
0.038089655339717865,
-0.6883190274238586,
-1.7795974016189575,
-0.29126161336898804,
0.23029454052448273,
0.6064322590827942,
-1.2822682857513428,
1.7703180313110352,
0.7547991871833801,
1.945534110069275,
0.9939480423927307,
-0.33515095710754395,
1.519230604171753,
0.03726964816451073,
2.0030295848846436,
-0.35043755173683167,
0.6400647163391113,
-0.34370243549346924,
-1.1940579414367676,
0.7881849408149719,
-0.35463348031044006,
-2.026223659515381,
-0.6546358466148376,
-0.8918020129203796,
-0.11666801571846008,
-0.7980645298957825,
0.9722260236740112,
-0.22992801666259766,
-1.4587948322296143,
0.2216707020998001,
-0.7310947775840759,
0.17564496397972107,
-1.3215057849884033,
0.22203181684017181,
0.7989794611930847,
-0.6629815101623535,
0.08028211444616318,
-0.30818670988082886,
-1.3502756357192993,
-0.48658284544944763,
0.3874874711036682,
1.876846432685852,
-0.7664613127708435,
0.9637691974639893,
1.0144463777542114,
-0.7402588129043579,
-0.04614195600152016,
0.3405584990978241,
-0.3987225592136383,
0.881542980670929,
-1.067444920539856,
-0.39357778429985046,
1.1506249904632568,
-0.1449304074048996,
-0.6916723251342773,
1.4259395599365234,
0.7675933241844177,
-1.041087031364441,
-0.18288172781467438,
-0.2295694500207901,
-0.8556364178657532,
-0.013478429988026619,
-1.6487631797790527,
-0.11096037924289703,
0.33396103978157043,
-1.4754698276519775,
-0.45451998710632324,
-0.17437289655208588,
1.3395596742630005,
-0.1267247498035431,
1.3562953472137451,
-0.2770129442214966,
-0.16574187576770782,
-0.48376086354255676,
-0.4790712594985962,
0.16409364342689514,
-0.3061210513114929,
-0.6795511245727539,
0.2403792291879654,
-0.6674260497093201,
0.24456201493740082,
1.4198219776153564,
0.3000943660736084,
0.0702618733048439,
0.6370016932487488,
1.141446590423584,
0.3465588092803955,
-0.14593730866909027,
-0.8513311147689819,
-1.6013834476470947,
1.9926553964614868,
-1.404279351234436,
1.935299277305603,
0.7102379202842712,
-0.06659900397062302,
-1.8785346746444702,
-1.9904946088790894,
1.4095858335494995,
1.208824634552002,
2.3712635040283203,
0.5812727808952332,
0.503014087677002,
-0.7742369174957275,
-0.6789444088935852,
0.31298407912254333,
-0.9819507002830505,
-0.7491356134414673,
0.18613258004188538,
2.3886170387268066,
1.715773105621338,
-0.5254066586494446,
-0.2145310640335083,
-1.020542860031128,
1.322404146194458,
-0.2579793334007263,
0.23206809163093567,
2.078587055206299,
-0.23488356173038483,
-0.9885309934616089,
1.2637548446655273,
-2.3320584297180176,
0.15687118470668793,
1.9800986051559448,
0.20047935843467712,
0.11053428798913956,
-1.4065696001052856,
-0.7282101511955261,
-0.24024972319602966,
-0.5040926933288574,
-1.2451655864715576,
0.5173326134681702,
-0.22212380170822144,
-0.7713506817817688,
-1.424546718597412,
0.14146454632282257,
-1.042421579360962,
-1.7220005989074707,
0.22785986959934235,
1.8597898483276367,
2.0164780616760254,
-0.8087498545646667,
1.486332893371582,
-0.20056694746017456,
0.24573664367198944,
1.289179801940918,
1.2504420280456543,
3.1719436645507812,
1.8714793920516968,
-1.2836195230484009,
0.7345591187477112,
-0.07505176216363907,
-0.4968383014202118,
1.2325581312179565,
-1.1449425220489502,
1.1870718002319336,
-0.2602395713329315,
-1.2691525220870972,
-1.2567031383514404,
0.8882309794425964,
0.507307231426239,
0.036023933440446854,
-0.48532846570014954,
1.2333667278289795,
0.07750619202852249,
1.3849846124649048,
0.6128556728363037,
-0.3543247878551483,
0.5527858734130859,
-0.4135412275791168,
-0.4923790395259857,
1.5905719995498657,
0.20189543068408966,
-1.3722469806671143,
-2.3596749305725098,
-0.16175201535224915,
-0.8871355652809143,
-0.10833995789289474,
-0.6496954560279846,
-0.972456693649292,
1.5486258268356323,
0.5395402312278748,
-1.1640257835388184,
-0.2538241147994995,
-0.32304900884628296,
-0.6239999532699585,
2.731031656265259,
-1.4350042343139648,
-0.2223845273256302,
-1.0020979642868042,
-0.5777797102928162,
1.679121494293213,
-1.1919283866882324,
-0.25647011399269104,
-0.9720252156257629,
-0.611102819442749,
-1.3638416528701782,
-0.5563842058181763,
-0.013455203734338284,
-0.8928218483924866,
0.8459144234657288,
0.14448100328445435,
-1.2681180238723755,
-0.23851177096366882,
-0.9768945574760437,
0.8869731426239014,
-0.17479921877384186,
0.28102341294288635,
1.8616083860397339,
0.3778473138809204,
-0.39611178636550903,
0.7222959399223328,
1.1614590883255005,
0.6190222501754761,
-0.6187165379524231,
0.3424612581729889,
-0.7154551148414612,
0.28580084443092346,
-1.357438087463379,
0.2223939150571823,
-2.902291774749756,
0.6178629398345947,
-0.040818970650434494,
-0.06660736352205276,
-0.04203639551997185,
-1.2984261512756348,
1.0706690549850464,
2.499197006225586,
-1.2068017721176147,
0.4587644040584564,
0.34935492277145386,
1.288337230682373,
-1.601428508758545,
0.2303715944290161,
-0.4473291039466858,
2.1308016777038574,
0.10449644923210144,
1.176329255104065,
-0.3361031413078308,
-2.2535157203674316,
0.5955193042755127,
-1.250548243522644,
-1.0885168313980103,
0.8814460039138794,
-0.8159260153770447,
0.12971866130828857,
-1.3852791786193848,
-0.16449439525604248,
-0.8352765440940857,
-1.1980785131454468,
0.775504469871521,
0.07713113725185394,
0.5086668729782104,
-0.5736520290374756,
0.30454811453819275,
-2.1116411685943604,
-1.3249303102493286,
-0.20716743171215057,
-0.970150351524353,
0.42881572246551514,
-0.27514705061912537,
0.7234201431274414,
-0.12806710600852966,
0.018638722598552704,
0.3387211561203003,
1.384488821029663,
3.3669965267181396,
0.1699746698141098,
0.38718584179878235,
-0.1387605220079422,
-0.9482019543647766,
1.3949345350265503,
0.9425073266029358,
-0.19908663630485535,
-0.5793629288673401,
-1.030135989189148,
1.250187635421753,
1.9269646406173706,
1.093791127204895,
0.12261323630809784,
-0.8337544798851013,
-0.8066868782043457,
0.03541294485330582,
0.15500812232494354,
0.5114908218383789,
0.8778970241546631,
0.08326975256204605,
0.09303382784128189,
1.4637000560760498,
1.108192801475525,
-0.31967446208000183,
0.39397621154785156,
-0.8732115626335144,
-0.41191375255584717,
0.5424751043319702,
0.3098170757293701,
0.08350669592618942,
0.308968186378479,
-1.058576226234436,
-0.3058887720108032,
-0.2825646698474884,
-0.9079662561416626,
-0.7020580172538757,
-0.4494938850402832,
-0.34409675002098083,
1.6490504741668701,
0.01637953892350197,
-0.5124508738517761,
-0.027552351355552673,
-0.7298482060432434,
-0.05016100034117699,
-1.017072319984436,
0.2852209210395813,
-0.15430192649364471,
-0.03878795728087425,
-0.1361464411020279,
1.6991362571716309,
-0.9687764644622803,
-2.1202304363250732,
0.22132490575313568,
0.29179272055625916,
-0.3578415811061859,
0.10701576620340347,
1.7001701593399048,
0.536920428276062,
1.4040203094482422,
1.3782250881195068,
1.0495532751083374,
-0.7128521203994751,
-1.3493456840515137,
0.6243682503700256,
0.9822472929954529,
-1.4129509925842285,
0.7771750688552856,
-0.010664885863661766,
-0.5001708269119263,
0.5561209321022034,
1.2890706062316895,
0.44541749358177185,
-1.9686459302902222,
0.7127202153205872,
-0.9464460611343384,
0.7141051292419434,
0.7227222919464111,
0.8409198522567749,
0.2220311313867569,
0.8007634878158569,
-1.2913877964019775,
-1.152849555015564,
-0.690980851650238,
-0.6318279504776001,
1.8748433589935303,
-0.1958600878715515,
0.5007469654083252,
-0.12048590183258057,
-1.3834433555603027,
0.012202697806060314,
0.758996844291687,
0.3745937943458557,
-0.4597703516483307,
0.8124013543128967,
-0.6848050355911255,
-1.02921462059021,
-1.3423101902008057,
-0.46504223346710205,
-1.0570183992385864,
-0.8837528228759766,
0.9566695690155029,
0.8531822562217712,
0.3373257517814636,
1.7773351669311523,
0.6657112240791321,
0.28022074699401855,
-2.63552188873291,
0.8958097100257874,
0.2965617775917053,
-0.03185620158910751,
0.83834308385849,
0.2972123920917511,
1.096181869506836,
-0.11282269656658173,
0.5854437947273254,
-2.405144691467285,
2.2792556285858154,
-0.27670979499816895,
0.5734301805496216,
0.03619018569588661,
-0.1926342397928238,
1.0605300664901733,
0.49453285336494446,
0.5768017172813416,
-1.0842782258987427,
0.7726722359657288,
-0.6355114579200745,
1.1568412780761719,
0.8689029812812805,
-0.8625689148902893,
-0.03186233341693878,
1.2698239088058472,
0.4492660462856293,
-0.5138081312179565,
-0.9129900932312012,
-1.0004431009292603,
1.0078344345092773,
1.6781237125396729,
0.014922997914254665,
-0.0030139260925352573,
0.9553036689758301,
0.6229988932609558,
-1.306041955947876,
0.10112138837575912,
-0.7522658109664917,
-0.6732290387153625,
1.6815142631530762,
2.025832176208496,
-0.10464052110910416,
-0.15866313874721527,
-0.8731765747070312,
-1.1407235860824585,
0.8183304071426392,
0.0422983318567276,
0.0003867391496896744,
0.7383707761764526,
-0.6954044103622437,
1.1342895030975342,
0.834597110748291,
0.9377983808517456,
0.24356351792812347,
0.28470227122306824,
0.30770763754844666,
-0.30597153306007385,
-1.216285228729248,
-0.2823956608772278,
-1.0508177280426025,
-2.467439651489258,
0.4620630145072937,
-0.2338295727968216,
-1.3689024448394775,
0.06590999662876129,
-1.0485013723373413,
0.8732673525810242,
-0.5917226076126099,
-1.1343834400177002,
-1.4742603302001953,
0.28210484981536865,
-0.199273481965065,
0.8098239302635193,
-1.5707324743270874,
-0.09278779476881027,
1.3101338148117065,
0.9901042580604553,
-0.6916012167930603,
0.949760913848877,
0.222977414727211,
1.050599217414856,
0.9297410845756531,
-0.3522513508796692,
0.4742507040500641,
0.16687524318695068,
-1.3467410802841187,
0.503042995929718,
1.2423990964889526,
0.13305991888046265,
1.4818636178970337,
-0.5887880921363831,
-0.010041041299700737,
0.36586880683898926,
-0.4483235776424408,
-0.5270026922225952,
-0.719575822353363,
0.7017370462417603,
0.13384659588336945,
-0.950008749961853,
0.03360048308968544,
-0.010526576079428196,
-0.17125320434570312,
0.24106673896312714,
-1.5501199960708618,
-0.11937835812568665,
-0.21569021046161652,
-0.6613697409629822,
-1.229885458946228,
-0.01903141662478447,
1.2805485725402832,
-0.7766022682189941,
-0.18291190266609192,
0.5476152300834656,
0.2769872546195984,
0.5341993570327759,
0.5528627038002014,
-0.6741324663162231,
-0.27539879083633423,
-0.2973262369632721,
-0.3226248025894165,
0.3215884268283844,
1.3075186014175415,
-0.05552361160516739,
-0.954433798789978,
0.7137729525566101,
-0.4526592195034027,
0.04370535537600517,
2.034668207168579,
0.061076488345861435,
-0.938270628452301,
0.32167157530784607,
-0.7445350289344788,
1.9248812198638916,
1.746855616569519,
1.3664876222610474,
0.015094940550625324,
-0.9525688290596008,
0.5514163374900818,
-0.3338836133480072,
-0.4140261709690094,
0.9682397246360779,
0.4108077585697174,
-0.28029054403305054,
-1.3013205528259277,
0.6636790633201599,
1.2716838121414185,
-0.8392935991287231,
-0.8494760394096375,
0.15376470983028412,
-0.8514629602432251,
1.0795319080352783,
0.7696806788444519,
0.3617739975452423,
0.2889825403690338,
1.5257164239883423,
0.7479769587516785,
-0.49553874135017395,
0.5182228088378906,
0.5103777050971985,
-0.14188386499881744,
-1.955518364906311,
-1.0883897542953491,
0.3886973559856415,
-0.3767019808292389,
-1.593767523765564,
1.4457218647003174,
-1.2207010984420776,
-0.9058412909507751,
0.5857461094856262,
0.12050694227218628,
1.3933488130569458,
0.3301919996738434,
1.5976556539535522,
2.0592517852783203,
0.8593099117279053,
0.3249426782131195,
1.3091003894805908,
-0.19233305752277374,
-0.4566842317581177,
1.7766767740249634,
-0.4916730523109436,
0.5606716275215149,
0.9937147498130798,
-0.34661343693733215,
-1.0614343881607056,
-0.7910824418067932,
-1.2117584943771362,
-0.7114414572715759,
1.1387293338775635,
0.1321413815021515,
-1.104872226715088,
0.2520787715911865,
1.6241294145584106,
0.0503946952521801,
-0.3161965608596802,
0.7224522233009338,
0.354571133852005,
-0.8176398873329163,
-0.041321493685245514,
-1.010149598121643,
0.5257184505462646,
-0.14332641661167145,
-0.28310471773147583,
0.3453863859176636,
0.4600086808204651,
1.268579125404358,
0.05859944596886635,
0.15235868096351624,
1.2652071714401245,
-1.3594627380371094,
1.530648112297058,
-0.7853398323059082,
0.28182291984558105,
-2.4429562091827393,
1.415513277053833,
-0.8238847255706787,
1.9213510751724243,
-2.628408908843994,
0.41326913237571716,
-0.4813743829727173,
-0.457394003868103,
0.24035735428333282,
-0.33330148458480835,
0.15061038732528687,
-0.16932491958141327,
-1.1383296251296997,
-0.14255087077617645,
-0.8677849769592285,
0.5255513191223145,
1.177521824836731,
1.4080969095230103,
-1.0816187858581543,
-0.28436800837516785,
-1.7697334289550781,
-0.13087618350982666,
-0.6326486468315125,
0.34990382194519043,
-1.8651444911956787,
-0.1728636771440506,
-1.910144567489624,
-2.462303400039673,
-1.343977451324463,
-0.8221613168716431,
1.1193161010742188,
0.10014908015727997,
-1.041208028793335,
1.1372981071472168,
-0.3977437913417816,
-1.8009953498840332,
1.106371283531189,
-2.177593469619751
] |
https://github.com/huggingface/datasets/issues/5099 | datasets doesn't support # in data paths | Ah sorry it was private I just made it public, I can also help with this if needed | ## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.
## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
cc @lhoestq | 481 | 18 | datasets doesn't support # in data paths
## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.
## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
cc @lhoestq
Ah sorry it was private I just made it public, I can also help with this if needed | [
-1.1189790964126587,
-0.8093051314353943,
-0.7660857439041138,
1.526092767715454,
-0.10088901221752167,
-1.283258318901062,
0.13878801465034485,
-0.9602802395820618,
1.677338719367981,
-0.7428243160247803,
0.2788020372390747,
-1.728833556175232,
-0.061178870499134064,
-0.6028916835784912,
-0.7106248736381531,
-0.8431087732315063,
-0.273372620344162,
-0.7238385677337646,
1.0356404781341553,
2.4597504138946533,
1.174337387084961,
-1.365627408027649,
2.707969903945923,
0.6661328673362732,
-0.19729508459568024,
-0.9535940885543823,
0.5062024593353271,
0.029606204479932785,
-1.2818268537521362,
-0.3824073076248169,
-0.8717879056930542,
-0.10308090597391129,
-0.5355605483055115,
-0.5613386034965515,
0.00535114761441946,
0.4815886914730072,
-0.25689056515693665,
-0.4441772401332855,
-0.444612592458725,
-0.7864571809768677,
0.42778828740119934,
-0.30106469988822937,
0.8815240859985352,
-0.3593748211860657,
1.8289275169372559,
-0.5828595757484436,
0.3975745439529419,
0.7375147938728333,
1.2292096614837646,
0.185563325881958,
0.01634082943201065,
0.3352361023426056,
0.35076913237571716,
0.020930372178554535,
0.5423757433891296,
1.1870757341384888,
0.5972263813018799,
0.48844200372695923,
0.6662054061889648,
-2.2474443912506104,
1.2880401611328125,
-0.9932063817977905,
0.23733770847320557,
1.353853702545166,
-1.04762601852417,
0.37050336599349976,
-1.8024919033050537,
-0.054032064974308014,
0.5507566928863525,
-2.231365203857422,
0.22627370059490204,
-1.3434606790542603,
-0.4997044801712036,
1.023668646812439,
0.32244089245796204,
-1.2478924989700317,
0.0840461254119873,
-0.41002601385116577,
1.0527795553207397,
0.4555562436580658,
1.1183282136917114,
-1.691263198852539,
0.03165141120553017,
-0.23348760604858398,
0.18390747904777527,
-1.3530329465866089,
-1.5571321249008179,
0.4756142199039459,
0.7249904870986938,
0.6932415962219238,
-0.13085153698921204,
0.9262952208518982,
-0.9268773198127747,
0.7151264548301697,
-0.9189397096633911,
-1.7896122932434082,
-1.3470003604888916,
-2.294232130050659,
-2.30649733543396,
0.8096522688865662,
-0.4786076843738556,
-0.4564102292060852,
2.0065577030181885,
-1.045028805732727,
-1.785474181175232,
1.110713005065918,
0.30357828736305237,
-0.02934420108795166,
2.331047534942627,
0.31171342730522156,
-0.8042301535606384,
0.5217058658599854,
-0.7696266770362854,
0.6248160600662231,
-0.380098819732666,
1.2880058288574219,
0.4938892424106598,
-1.1154266595840454,
1.5963395833969116,
-0.4256332218647003,
0.6358774900436401,
-0.784611701965332,
-0.48013707995414734,
-0.7973840236663818,
0.26912301778793335,
1.9094754457473755,
-0.2982008457183838,
1.5369794368743896,
-0.29822632670402527,
-1.5588287115097046,
-1.4750943183898926,
0.7885090112686157,
0.39581283926963806,
-0.7761834859848022,
0.17227868735790253,
-0.3698420524597168,
0.1281372308731079,
-0.03326459601521492,
1.0784759521484375,
1.1755136251449585,
0.7200766205787659,
-0.24304361641407013,
-0.8250738978385925,
0.288614422082901,
0.0307169109582901,
-0.6756495237350464,
-1.8103753328323364,
-0.2754361033439636,
0.2128836214542389,
0.6207305788993835,
-1.2880892753601074,
1.764143466949463,
0.764135479927063,
1.942903757095337,
1.0043017864227295,
-0.3369554281234741,
1.5338000059127808,
0.028427395969629288,
2.00288462638855,
-0.3482404053211212,
0.6153115630149841,
-0.33165812492370605,
-1.1816868782043457,
0.7915753722190857,
-0.33989217877388,
-2.0199484825134277,
-0.6817291975021362,
-0.892418622970581,
-0.12724721431732178,
-0.8099784255027771,
0.9823260307312012,
-0.2293507307767868,
-1.4627317190170288,
0.22796006500720978,
-0.717658519744873,
0.16905979812145233,
-1.3111647367477417,
0.2228311002254486,
0.8075841665267944,
-0.6702293753623962,
0.08034075051546097,
-0.30706003308296204,
-1.3614349365234375,
-0.46834123134613037,
0.3856144845485687,
1.8982864618301392,
-0.7567811608314514,
0.9764860272407532,
1.025780200958252,
-0.7376950979232788,
-0.03464280441403389,
0.33061861991882324,
-0.3960438072681427,
0.8717924952507019,
-1.0582187175750732,
-0.41645166277885437,
1.146496057510376,
-0.16173668205738068,
-0.6827048659324646,
1.4374048709869385,
0.7630310654640198,
-1.0460201501846313,
-0.19618864357471466,
-0.21337255835533142,
-0.8512392640113831,
-0.0022369599901139736,
-1.652396321296692,
-0.13337676227092743,
0.33854466676712036,
-1.4851473569869995,
-0.45251643657684326,
-0.1652550995349884,
1.3605014085769653,
-0.14128649234771729,
1.3948695659637451,
-0.24894727766513824,
-0.15316176414489746,
-0.4651592969894409,
-0.4806981086730957,
0.17008955776691437,
-0.2588537335395813,
-0.6770341992378235,
0.24965566396713257,
-0.6886519193649292,
0.2507685124874115,
1.407159686088562,
0.30870798230171204,
0.05913769081234932,
0.6333143711090088,
1.1464260816574097,
0.36612826585769653,
-0.11462912708520889,
-0.8549462556838989,
-1.6062442064285278,
2.0154480934143066,
-1.414084792137146,
1.951911211013794,
0.7185807824134827,
-0.09754548966884613,
-1.8545273542404175,
-1.9783987998962402,
1.4265480041503906,
1.2087379693984985,
2.3702852725982666,
0.5790674686431885,
0.49248751997947693,
-0.7554527521133423,
-0.6763843894004822,
0.31083059310913086,
-0.9849705100059509,
-0.755187451839447,
0.1908103972673416,
2.3886218070983887,
1.7064085006713867,
-0.5216776132583618,
-0.2242448478937149,
-1.0050779581069946,
1.2956074476242065,
-0.26389479637145996,
0.22799186408519745,
2.0868847370147705,
-0.2308400273323059,
-0.9960930347442627,
1.2654497623443604,
-2.3528826236724854,
0.18010172247886658,
1.9920237064361572,
0.2152761071920395,
0.10013143718242645,
-1.4043774604797363,
-0.6871042251586914,
-0.23923252522945404,
-0.4875567555427551,
-1.2413575649261475,
0.5485289096832275,
-0.21770089864730835,
-0.8047235012054443,
-1.4188294410705566,
0.14999939501285553,
-1.0513540506362915,
-1.7275357246398926,
0.2553720474243164,
1.8501851558685303,
2.035106658935547,
-0.8128536939620972,
1.4722095727920532,
-0.21000537276268005,
0.26075878739356995,
1.286206603050232,
1.2549619674682617,
3.15875506401062,
1.8695719242095947,
-1.270517349243164,
0.7103970050811768,
-0.09479816257953644,
-0.5031703114509583,
1.2211394309997559,
-1.1612629890441895,
1.1987398862838745,
-0.2542315125465393,
-1.2722514867782593,
-1.2739434242248535,
0.8981990218162537,
0.5052098035812378,
0.031492672860622406,
-0.4758134186267853,
1.243915319442749,
0.10069137811660767,
1.3741260766983032,
0.5981826186180115,
-0.32600751519203186,
0.5447829365730286,
-0.4357568919658661,
-0.47173982858657837,
1.57634699344635,
0.1805521547794342,
-1.4082401990890503,
-2.3484044075012207,
-0.15781745314598083,
-0.8925352692604065,
-0.10197906941175461,
-0.6483358144760132,
-0.9766309857368469,
1.5324970483779907,
0.523287296295166,
-1.166123628616333,
-0.2687496244907379,
-0.3443911373615265,
-0.6309789419174194,
2.7141811847686768,
-1.418218970298767,
-0.22570376098155975,
-1.0036073923110962,
-0.5948578715324402,
1.684748649597168,
-1.199054479598999,
-0.23930799961090088,
-0.9620832204818726,
-0.6365591883659363,
-1.3813749551773071,
-0.555530846118927,
0.014435439370572567,
-0.8936963081359863,
0.8211892247200012,
0.1374557614326477,
-1.2492533922195435,
-0.24374818801879883,
-0.9743707180023193,
0.8741949796676636,
-0.18133188784122467,
0.29593709111213684,
1.8338502645492554,
0.37879040837287903,
-0.4047240912914276,
0.7383471131324768,
1.1671490669250488,
0.6445654630661011,
-0.6211400628089905,
0.3244747519493103,
-0.7108089923858643,
0.29938846826553345,
-1.3670226335525513,
0.23281800746917725,
-2.8987133502960205,
0.6100004315376282,
-0.030801162123680115,
-0.05513715371489525,
-0.05628005042672157,
-1.296740174293518,
1.0976511240005493,
2.4832565784454346,
-1.2171581983566284,
0.4566027522087097,
0.36934778094291687,
1.2798688411712646,
-1.584162950515747,
0.23790128529071808,
-0.4581545889377594,
2.1269495487213135,
0.11179471760988235,
1.1723042726516724,
-0.3487108647823334,
-2.24869441986084,
0.6149125695228577,
-1.2614270448684692,
-1.0937073230743408,
0.8705631494522095,
-0.8328430652618408,
0.12479010969400406,
-1.387267827987671,
-0.1600053608417511,
-0.8385803699493408,
-1.1905962228775024,
0.7643675804138184,
0.06947369128465652,
0.4905184805393219,
-0.5720558762550354,
0.3120856285095215,
-2.1287715435028076,
-1.3466421365737915,
-0.1974869668483734,
-0.9933952689170837,
0.4285615086555481,
-0.30172210931777954,
0.7280740737915039,
-0.12765762209892273,
0.0015944838523864746,
0.33076170086860657,
1.3730554580688477,
3.3673040866851807,
0.18476904928684235,
0.3995649218559265,
-0.13461503386497498,
-0.958484947681427,
1.4309784173965454,
0.9364337921142578,
-0.1998874545097351,
-0.5568323731422424,
-1.010550856590271,
1.2678571939468384,
1.935374140739441,
1.0926395654678345,
0.10767091810703278,
-0.8466867804527283,
-0.8131330609321594,
0.03533809632062912,
0.16445767879486084,
0.5194189548492432,
0.8884589076042175,
0.05746189132332802,
0.08804206550121307,
1.449436068534851,
1.1107906103134155,
-0.342739075422287,
0.3923611342906952,
-0.884894609451294,
-0.39726272225379944,
0.558918297290802,
0.28892990946769714,
0.08865154534578323,
0.3392557203769684,
-1.067834734916687,
-0.31048181653022766,
-0.2620681822299957,
-0.9191948175430298,
-0.7337733507156372,
-0.42208003997802734,
-0.3467991054058075,
1.6310958862304688,
0.014886309392750263,
-0.5036762952804565,
-0.013191226869821548,
-0.7534653544425964,
-0.0708409994840622,
-1.010965347290039,
0.2514808475971222,
-0.15184704959392548,
-0.041452329605817795,
-0.15304061770439148,
1.712532639503479,
-0.9667680263519287,
-2.1142871379852295,
0.21415556967258453,
0.31070223450660706,
-0.35004231333732605,
0.11016624420881271,
1.706811547279358,
0.5408922433853149,
1.404499888420105,
1.3527745008468628,
1.053540825843811,
-0.6836749911308289,
-1.343765139579773,
0.6554291248321533,
0.974268913269043,
-1.4231003522872925,
0.7728211879730225,
-0.01724259927868843,
-0.5004248023033142,
0.566306471824646,
1.2796258926391602,
0.457168847322464,
-1.962719202041626,
0.7118645310401917,
-0.942429780960083,
0.7229803800582886,
0.7321740388870239,
0.8412692546844482,
0.2218054234981537,
0.802634060382843,
-1.2861119508743286,
-1.1353737115859985,
-0.6877457499504089,
-0.6221961379051208,
1.8945043087005615,
-0.18900571763515472,
0.49290814995765686,
-0.10280630737543106,
-1.3873939514160156,
0.007693086750805378,
0.7390868663787842,
0.3564557135105133,
-0.44556212425231934,
0.8136114478111267,
-0.6969865560531616,
-1.0304821729660034,
-1.359107494354248,
-0.45644500851631165,
-1.0304769277572632,
-0.8860534429550171,
0.9714070558547974,
0.83880215883255,
0.3382148742675781,
1.791111946105957,
0.6395048499107361,
0.27916061878204346,
-2.6432387828826904,
0.9170084595680237,
0.2965949773788452,
-0.05989592894911766,
0.8413321375846863,
0.28756970167160034,
1.1017907857894897,
-0.10008043050765991,
0.5974116325378418,
-2.420929431915283,
2.273966073989868,
-0.27682387828826904,
0.5865304470062256,
0.045560963451862335,
-0.2115960717201233,
1.0509042739868164,
0.5252273082733154,
0.5896522402763367,
-1.109531044960022,
0.7830542922019958,
-0.6537984013557434,
1.183098554611206,
0.8746312856674194,
-0.8403394222259521,
-0.03228822350502014,
1.266524076461792,
0.45461106300354004,
-0.5024926662445068,
-0.9053260684013367,
-0.9891093373298645,
0.9945232272148132,
1.6536074876785278,
0.014236507005989552,
-0.011158370412886143,
0.9385566115379333,
0.6325896382331848,
-1.3088099956512451,
0.08871570974588394,
-0.7501174807548523,
-0.6689529418945312,
1.6957411766052246,
2.0447967052459717,
-0.11583320796489716,
-0.18481303751468658,
-0.8523544669151306,
-1.145311951637268,
0.8054074048995972,
0.0317532941699028,
0.020773936063051224,
0.745120108127594,
-0.708703875541687,
1.136136770248413,
0.8089441657066345,
0.9212262034416199,
0.22906024754047394,
0.2734377980232239,
0.2963443994522095,
-0.2939628064632416,
-1.2032297849655151,
-0.2996388077735901,
-1.0557172298431396,
-2.498652935028076,
0.4439665973186493,
-0.25846564769744873,
-1.3432508707046509,
0.07429042458534241,
-1.0411344766616821,
0.868721067905426,
-0.5916853547096252,
-1.1315053701400757,
-1.4632902145385742,
0.27701058983802795,
-0.17670048773288727,
0.8283523917198181,
-1.5971484184265137,
-0.09898803383111954,
1.3090709447860718,
0.9805818796157837,
-0.6804764270782471,
0.9587204456329346,
0.2253636121749878,
1.050275444984436,
0.9061550498008728,
-0.3520861268043518,
0.4881211221218109,
0.17602255940437317,
-1.3445805311203003,
0.49837103486061096,
1.228254795074463,
0.12066944688558578,
1.4819568395614624,
-0.5842704176902771,
0.0002832971513271332,
0.37844744324684143,
-0.4701025187969208,
-0.5373634099960327,
-0.7158421874046326,
0.7092227339744568,
0.12075164169073105,
-0.9323975443840027,
0.03145604953169823,
-0.029392559081315994,
-0.15229730308055878,
0.22610747814178467,
-1.5701056718826294,
-0.11684178560972214,
-0.23401689529418945,
-0.6605020761489868,
-1.2506433725357056,
-0.006492246873676777,
1.2828683853149414,
-0.7923358678817749,
-0.18383900821208954,
0.5216295123100281,
0.27105605602264404,
0.525500476360321,
0.5623250007629395,
-0.6713627576828003,
-0.30200764536857605,
-0.3032904863357544,
-0.3021945059299469,
0.32951921224594116,
1.3018460273742676,
-0.05848841741681099,
-0.9710866808891296,
0.6996557712554932,
-0.45813173055648804,
0.04600479081273079,
2.01880145072937,
0.059861522167921066,
-0.9291768670082092,
0.33113303780555725,
-0.7472907304763794,
1.9126206636428833,
1.7137494087219238,
1.3663647174835205,
0.00044202059507369995,
-0.9236022233963013,
0.5553541779518127,
-0.3419190049171448,
-0.4332699477672577,
0.9512577056884766,
0.41273295879364014,
-0.2815266251564026,
-1.3049260377883911,
0.6625405550003052,
1.2994251251220703,
-0.8502156734466553,
-0.8414232730865479,
0.15411801636219025,
-0.8682863116264343,
1.0643692016601562,
0.7481938600540161,
0.38179388642311096,
0.29349055886268616,
1.5065093040466309,
0.7437141537666321,
-0.5091155171394348,
0.5129654407501221,
0.5115314722061157,
-0.12682294845581055,
-1.9767731428146362,
-1.075382947921753,
0.37391021847724915,
-0.38148239254951477,
-1.5762251615524292,
1.4565675258636475,
-1.2134534120559692,
-0.929349422454834,
0.58211749792099,
0.11200299113988876,
1.3802769184112549,
0.3358314633369446,
1.6112399101257324,
2.0390472412109375,
0.8681840896606445,
0.3357742130756378,
1.3048555850982666,
-0.202339306473732,
-0.4585956335067749,
1.7724356651306152,
-0.4953477084636688,
0.5645560622215271,
0.9967802166938782,
-0.34783899784088135,
-1.0507512092590332,
-0.8074444532394409,
-1.2346452474594116,
-0.7055559754371643,
1.1320066452026367,
0.14132970571517944,
-1.1243393421173096,
0.24971285462379456,
1.613554835319519,
0.06303153187036514,
-0.30354708433151245,
0.6996198296546936,
0.3549010753631592,
-0.808003306388855,
-0.05184394121170044,
-1.0065616369247437,
0.5437147617340088,
-0.15657636523246765,
-0.29324641823768616,
0.3219473659992218,
0.4627206027507782,
1.2857946157455444,
0.02991902455687523,
0.161652073264122,
1.2732456922531128,
-1.3704838752746582,
1.5343233346939087,
-0.7558161616325378,
0.2912673354148865,
-2.4282004833221436,
1.4080396890640259,
-0.8312097191810608,
1.9337825775146484,
-2.62904953956604,
0.40469077229499817,
-0.48950693011283875,
-0.457598477602005,
0.2620065212249756,
-0.3297024369239807,
0.15094734728336334,
-0.18077489733695984,
-1.1320620775222778,
-0.15904147922992706,
-0.8659182786941528,
0.5279850363731384,
1.1898831129074097,
1.4173319339752197,
-1.0607815980911255,
-0.29088354110717773,
-1.7675985097885132,
-0.13830454647541046,
-0.6225171089172363,
0.34853097796440125,
-1.8811407089233398,
-0.1959616094827652,
-1.9321328401565552,
-2.451606273651123,
-1.3304343223571777,
-0.8329212665557861,
1.1141129732131958,
0.10985710471868515,
-1.0353695154190063,
1.1264889240264893,
-0.3820246458053589,
-1.7893900871276855,
1.1013730764389038,
-2.157221794128418
] |
https://github.com/huggingface/datasets/issues/5099 | datasets doesn't support # in data paths | @lhoestq Should I url encode also repo_id and revision parameters? I'm not sure what are the valid characters there.
Personally, I would be cautious and only url encode the path parameter. | ## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.
## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
cc @lhoestq | 481 | 31 | datasets doesn't support # in data paths
## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.
## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
cc @lhoestq
@lhoestq Should I url encode also repo_id and revision parameters? I'm not sure what are the valid characters there.
Personally, I would be cautious and only url encode the path parameter. | [
-1.1231071949005127,
-0.8518598079681396,
-0.7667385935783386,
1.5217608213424683,
-0.0897216796875,
-1.2815446853637695,
0.1324215531349182,
-0.9849250912666321,
1.672986626625061,
-0.7423801422119141,
0.26164209842681885,
-1.7035304307937622,
-0.04162299633026123,
-0.5842176675796509,
-0.7175146341323853,
-0.8543565273284912,
-0.2712738811969757,
-0.7538353204727173,
1.0574973821640015,
2.474653482437134,
1.1932586431503296,
-1.3651103973388672,
2.7499916553497314,
0.6827473044395447,
-0.19353561103343964,
-0.9286195039749146,
0.5220275521278381,
-0.01028451044112444,
-1.2891417741775513,
-0.3835587799549103,
-0.8891329765319824,
-0.08525785058736801,
-0.5444052815437317,
-0.5622140169143677,
0.010203898884356022,
0.46660366654396057,
-0.2624821960926056,
-0.4819492697715759,
-0.4970804452896118,
-0.7819005846977234,
0.44220733642578125,
-0.2900090515613556,
0.8848195672035217,
-0.3480835258960724,
1.8474167585372925,
-0.5969287157058716,
0.3776572644710541,
0.7388756275177002,
1.2237377166748047,
0.17231516540050507,
-0.0011124759912490845,
0.3261950612068176,
0.3668704628944397,
0.038641251623630524,
0.5486618280410767,
1.1881333589553833,
0.6005405187606812,
0.4893133044242859,
0.6911404132843018,
-2.2383005619049072,
1.3132644891738892,
-1.0054528713226318,
0.26039808988571167,
1.3219029903411865,
-1.0492199659347534,
0.37907546758651733,
-1.8189088106155396,
-0.04831003397703171,
0.5403890609741211,
-2.2313058376312256,
0.2213495522737503,
-1.3457796573638916,
-0.5020533800125122,
1.0269253253936768,
0.32633092999458313,
-1.237987756729126,
0.05664930120110512,
-0.4297119379043579,
1.0484697818756104,
0.47019949555397034,
1.1092036962509155,
-1.7232723236083984,
0.02557479590177536,
-0.24553853273391724,
0.1910589039325714,
-1.3725875616073608,
-1.5644422769546509,
0.4759042263031006,
0.7337907552719116,
0.6719359755516052,
-0.13083398342132568,
0.9386094212532043,
-0.9440184235572815,
0.6933704018592834,
-0.9091773629188538,
-1.7668918371200562,
-1.3386439085006714,
-2.293133020401001,
-2.2843117713928223,
0.772256076335907,
-0.496726930141449,
-0.47993290424346924,
2.0374467372894287,
-1.0432100296020508,
-1.811861276626587,
1.115505337715149,
0.2848203778266907,
0.00609877984970808,
2.3372690677642822,
0.30350109934806824,
-0.7912709712982178,
0.5292319655418396,
-0.7898886203765869,
0.6199381351470947,
-0.3711807429790497,
1.2823811769485474,
0.4854135811328888,
-1.1030787229537964,
1.561707854270935,
-0.4092106223106384,
0.6534088253974915,
-0.7684933543205261,
-0.4630778133869171,
-0.7903627753257751,
0.25649744272232056,
1.8974272012710571,
-0.2830609679222107,
1.542925238609314,
-0.3000619113445282,
-1.5795155763626099,
-1.4954962730407715,
0.8130520582199097,
0.4124651551246643,
-0.7768605947494507,
0.17065027356147766,
-0.35456377267837524,
0.11851714551448822,
-0.022692009806632996,
1.102800965309143,
1.1897574663162231,
0.7371858358383179,
-0.2387615442276001,
-0.8243127465248108,
0.28055211901664734,
0.008961367420852184,
-0.6659320592880249,
-1.7860103845596313,
-0.27540943026542664,
0.21713460981845856,
0.6243414282798767,
-1.2711859941482544,
1.7146036624908447,
0.8055080771446228,
1.9217652082443237,
1.0135220289230347,
-0.32963845133781433,
1.526476263999939,
0.05340461805462837,
1.9968687295913696,
-0.37602752447128296,
0.5936778783798218,
-0.3403519093990326,
-1.190972089767456,
0.8162357211112976,
-0.34481126070022583,
-2.0215389728546143,
-0.6787007451057434,
-0.9155053496360779,
-0.14854811131954193,
-0.8224890828132629,
0.9517157673835754,
-0.24760682880878448,
-1.4418779611587524,
0.2340027093887329,
-0.7435120344161987,
0.18388038873672485,
-1.2923481464385986,
0.23564700782299042,
0.8108305335044861,
-0.6823809742927551,
0.08462732285261154,
-0.30096670985221863,
-1.3460712432861328,
-0.4942352771759033,
0.40928784012794495,
1.8786373138427734,
-0.7250210046768188,
0.9351755976676941,
1.0289349555969238,
-0.7558935880661011,
-0.05688610300421715,
0.31611552834510803,
-0.38143688440322876,
0.8783712983131409,
-1.0693446397781372,
-0.38748112320899963,
1.1228227615356445,
-0.17668147385120392,
-0.6796178221702576,
1.4432951211929321,
0.7397635579109192,
-1.0660569667816162,
-0.22327791154384613,
-0.20479443669319153,
-0.8473082184791565,
-0.020148394629359245,
-1.6176705360412598,
-0.1664930135011673,
0.33751562237739563,
-1.5149649381637573,
-0.4771290421485901,
-0.18302053213119507,
1.375535488128662,
-0.12175532430410385,
1.3865597248077393,
-0.2660444676876068,
-0.14850497245788574,
-0.4580961763858795,
-0.480428010225296,
0.16954731941223145,
-0.2711912989616394,
-0.6608155965805054,
0.23319832980632782,
-0.6884539723396301,
0.2639084756374359,
1.4192765951156616,
0.3115634620189667,
0.05306406691670418,
0.6291038990020752,
1.1186857223510742,
0.39094841480255127,
-0.11688461899757385,
-0.8436700105667114,
-1.6027839183807373,
2.0112698078155518,
-1.4346160888671875,
1.9400629997253418,
0.7049297094345093,
-0.07033883780241013,
-1.85531747341156,
-1.973950982093811,
1.4197025299072266,
1.1842607259750366,
2.3447365760803223,
0.5683773756027222,
0.5022035241127014,
-0.7582514882087708,
-0.6808581948280334,
0.3198905289173126,
-0.9633444547653198,
-0.7627034783363342,
0.18235929310321808,
2.3917531967163086,
1.7064027786254883,
-0.5208553671836853,
-0.21641279757022858,
-0.9965088367462158,
1.31722891330719,
-0.2269170880317688,
0.20979349315166473,
2.0660431385040283,
-0.23200620710849762,
-0.9974061250686646,
1.2744306325912476,
-2.327476739883423,
0.194919615983963,
1.9798226356506348,
0.21657292544841766,
0.11118581146001816,
-1.411059856414795,
-0.7001197338104248,
-0.25700604915618896,
-0.5043944120407104,
-1.2672905921936035,
0.5410757660865784,
-0.20860697329044342,
-0.7886528968811035,
-1.4350342750549316,
0.14338144659996033,
-1.0446220636367798,
-1.7245213985443115,
0.2384905219078064,
1.8790384531021118,
2.0489096641540527,
-0.8061234354972839,
1.505819320678711,
-0.21449173986911774,
0.2516353130340576,
1.2642490863800049,
1.2263588905334473,
3.1505510807037354,
1.898800253868103,
-1.2547895908355713,
0.7305867671966553,
-0.10114474594593048,
-0.5083109140396118,
1.2031059265136719,
-1.1517817974090576,
1.2006887197494507,
-0.25266435742378235,
-1.242665410041809,
-1.2676671743392944,
0.924985408782959,
0.5242418050765991,
0.03611413761973381,
-0.46525251865386963,
1.253955364227295,
0.09077607840299606,
1.3475756645202637,
0.5904324054718018,
-0.3205028772354126,
0.5735659599304199,
-0.4476836323738098,
-0.48692622780799866,
1.584833025932312,
0.19427801668643951,
-1.388221025466919,
-2.2995805740356445,
-0.16531914472579956,
-0.875912606716156,
-0.09623824059963226,
-0.6222338080406189,
-0.9696595668792725,
1.5292519330978394,
0.5154101252555847,
-1.1631935834884644,
-0.2538594603538513,
-0.3609867990016937,
-0.6420508027076721,
2.7089474201202393,
-1.4398728609085083,
-0.21125775575637817,
-0.9882568717002869,
-0.5891316533088684,
1.6617131233215332,
-1.2364416122436523,
-0.25336286425590515,
-0.9668459296226501,
-0.6237947940826416,
-1.336650013923645,
-0.5860974788665771,
-0.012849055230617523,
-0.8890441656112671,
0.8079904317855835,
0.15405842661857605,
-1.24228036403656,
-0.23369397222995758,
-0.9651347994804382,
0.8965613842010498,
-0.15414512157440186,
0.27422118186950684,
1.8495177030563354,
0.32352346181869507,
-0.4015439450740814,
0.712268590927124,
1.1570003032684326,
0.6275536417961121,
-0.613054633140564,
0.3134012520313263,
-0.7241185307502747,
0.2736314535140991,
-1.3551445007324219,
0.23526719212532043,
-2.900341749191284,
0.5951761603355408,
-0.038611624389886856,
-0.04950147867202759,
-0.04432827979326248,
-1.2922626733779907,
1.1006640195846558,
2.509910821914673,
-1.227233648300171,
0.4598681926727295,
0.3575911819934845,
1.2774766683578491,
-1.5915998220443726,
0.24263326823711395,
-0.4342544972896576,
2.134969472885132,
0.16017301380634308,
1.1887165307998657,
-0.3421328663825989,
-2.2760860919952393,
0.5858525037765503,
-1.2374297380447388,
-1.1020441055297852,
0.8424767255783081,
-0.8021402955055237,
0.12551766633987427,
-1.3904132843017578,
-0.17925651371479034,
-0.8273823857307434,
-1.2049044370651245,
0.7531308531761169,
0.09001942723989487,
0.5023674964904785,
-0.5821983814239502,
0.29748329520225525,
-2.106569290161133,
-1.3592990636825562,
-0.2040533721446991,
-0.9543962478637695,
0.4181376099586487,
-0.29365500807762146,
0.7385865449905396,
-0.15923887491226196,
0.005127319134771824,
0.342241495847702,
1.374625563621521,
3.400564193725586,
0.17058691382408142,
0.4250834882259369,
-0.14842383563518524,
-0.9736402034759521,
1.4325450658798218,
0.9339209198951721,
-0.2008148431777954,
-0.5488508939743042,
-1.0507303476333618,
1.2547101974487305,
1.9624037742614746,
1.07856023311615,
0.10104834288358688,
-0.8357858061790466,
-0.8145490884780884,
0.025924742221832275,
0.1747870147228241,
0.5200787782669067,
0.9029312133789062,
0.07474969327449799,
0.0892382487654686,
1.4748643636703491,
1.0974838733673096,
-0.33998897671699524,
0.3915287256240845,
-0.8695758581161499,
-0.39725908637046814,
0.5393824577331543,
0.30584412813186646,
0.05225502327084541,
0.3196115791797638,
-1.0466220378875732,
-0.2931814193725586,
-0.2905063331127167,
-0.9028715491294861,
-0.7151857018470764,
-0.4037170708179474,
-0.3352925181388855,
1.6371678113937378,
0.04362139478325844,
-0.5100553035736084,
-0.024534592404961586,
-0.7310417294502258,
-0.052508704364299774,
-1.0392354726791382,
0.25815966725349426,
-0.15355843305587769,
-0.04096676781773567,
-0.15016669034957886,
1.682701587677002,
-0.9620237946510315,
-2.120976448059082,
0.22203876078128815,
0.2937399446964264,
-0.3471405506134033,
0.13657863438129425,
1.7023202180862427,
0.547986626625061,
1.414010763168335,
1.3607133626937866,
1.0516772270202637,
-0.6925633549690247,
-1.3565646409988403,
0.6409873962402344,
0.9709001779556274,
-1.4306588172912598,
0.7541045546531677,
-0.032392553985118866,
-0.5049154758453369,
0.5760132670402527,
1.2996374368667603,
0.45147138833999634,
-1.9899736642837524,
0.7187688946723938,
-0.942585289478302,
0.7148356437683105,
0.6960077285766602,
0.8363986015319824,
0.21304753422737122,
0.8106783032417297,
-1.2623372077941895,
-1.1512556076049805,
-0.6628454923629761,
-0.6490938067436218,
1.8929647207260132,
-0.2269943505525589,
0.5045073628425598,
-0.12437240034341812,
-1.3974461555480957,
0.01725997030735016,
0.7386229038238525,
0.37035125494003296,
-0.4556124806404114,
0.8015632033348083,
-0.7212666869163513,
-1.0541518926620483,
-1.3287005424499512,
-0.4569830298423767,
-1.0664149522781372,
-0.8915622234344482,
0.9752551317214966,
0.812576174736023,
0.3458836078643799,
1.7850747108459473,
0.6458438634872437,
0.2945621907711029,
-2.632161855697632,
0.9021400213241577,
0.31642991304397583,
-0.032760750502347946,
0.8646113276481628,
0.29548025131225586,
1.1045572757720947,
-0.09060973674058914,
0.6014785170555115,
-2.383310079574585,
2.2823290824890137,
-0.25310245156288147,
0.5911213159561157,
0.03136250749230385,
-0.2043100744485855,
1.0418181419372559,
0.5495139956474304,
0.6168073415756226,
-1.1174397468566895,
0.7795071005821228,
-0.6470008492469788,
1.155289888381958,
0.8804857134819031,
-0.8551359176635742,
-0.05303173512220383,
1.269784688949585,
0.46007630228996277,
-0.5324742197990417,
-0.8983331322669983,
-1.0208308696746826,
0.9780586361885071,
1.6603400707244873,
-0.005380850750952959,
-0.01655356027185917,
0.9266706705093384,
0.64528888463974,
-1.3150900602340698,
0.1110997200012207,
-0.7548821568489075,
-0.6829662919044495,
1.6737581491470337,
2.0442402362823486,
-0.1230517327785492,
-0.19474029541015625,
-0.8546113967895508,
-1.1845989227294922,
0.8023674488067627,
0.030755888670682907,
0.02871522307395935,
0.6984243988990784,
-0.6833310127258301,
1.1215866804122925,
0.8467124700546265,
0.9343952536582947,
0.22444704174995422,
0.27495548129081726,
0.31279313564300537,
-0.29562222957611084,
-1.193329095840454,
-0.2868015170097351,
-1.0498133897781372,
-2.465500593185425,
0.4387800395488739,
-0.23674871027469635,
-1.3647301197052002,
0.062072206288576126,
-1.0287686586380005,
0.8876048922538757,
-0.5693540573120117,
-1.1432321071624756,
-1.4788910150527954,
0.27414143085479736,
-0.17774470150470734,
0.8218309879302979,
-1.5849488973617554,
-0.10770256817340851,
1.3156771659851074,
0.9811388850212097,
-0.6810526251792908,
0.9866305589675903,
0.24311654269695282,
1.0367531776428223,
0.8963552713394165,
-0.3630223572254181,
0.48697301745414734,
0.189057394862175,
-1.332921028137207,
0.49624451994895935,
1.2373621463775635,
0.13124766945838928,
1.4611905813217163,
-0.5962213277816772,
-0.0013605356216430664,
0.3857378661632538,
-0.4650803506374359,
-0.5145958662033081,
-0.6950162649154663,
0.6964757442474365,
0.1009063646197319,
-0.92574542760849,
0.04563051834702492,
-0.027121126651763916,
-0.17248977720737457,
0.24085666239261627,
-1.5802379846572876,
-0.1371125727891922,
-0.28360047936439514,
-0.6424957513809204,
-1.2716645002365112,
-0.02249530702829361,
1.3000797033309937,
-0.7875361442565918,
-0.17944195866584778,
0.5050802826881409,
0.30066612362861633,
0.5030473470687866,
0.5608442425727844,
-0.6607117056846619,
-0.27128124237060547,
-0.2947620451450348,
-0.3286123275756836,
0.3161242604255676,
1.3036534786224365,
-0.05618022754788399,
-0.9802038073539734,
0.7067712545394897,
-0.4394286870956421,
0.06550269573926926,
2.0155816078186035,
0.04606976360082626,
-0.9182654023170471,
0.322762131690979,
-0.7693390846252441,
1.9064701795578003,
1.7357103824615479,
1.3785983324050903,
-0.025666493922472,
-0.9272631406784058,
0.5697993040084839,
-0.3457336723804474,
-0.4187850058078766,
0.9653599858283997,
0.4135076701641083,
-0.3075512647628784,
-1.2983417510986328,
0.6547209620475769,
1.3016382455825806,
-0.8292654156684875,
-0.8426247239112854,
0.14696626365184784,
-0.8406438231468201,
1.0789083242416382,
0.7496955990791321,
0.38557982444763184,
0.2742953598499298,
1.524717092514038,
0.7523720264434814,
-0.5300091505050659,
0.5222043395042419,
0.5404253005981445,
-0.15005715191364288,
-1.9802788496017456,
-1.068899393081665,
0.3667698800563812,
-0.39332303404808044,
-1.5992443561553955,
1.4442179203033447,
-1.2157121896743774,
-0.9261928200721741,
0.5870871543884277,
0.10855069756507874,
1.3691831827163696,
0.3221811056137085,
1.6119168996810913,
2.0510852336883545,
0.8388043642044067,
0.35975760221481323,
1.2836514711380005,
-0.19526901841163635,
-0.4473075270652771,
1.7748914957046509,
-0.49257680773735046,
0.5713721513748169,
1.0500317811965942,
-0.35932353138923645,
-1.0426212549209595,
-0.8120269775390625,
-1.2182743549346924,
-0.6832841634750366,
1.1302268505096436,
0.12756764888763428,
-1.1373075246810913,
0.263013631105423,
1.624304175376892,
0.0989735946059227,
-0.3271362781524658,
0.6917620301246643,
0.3783610761165619,
-0.7968617677688599,
-0.06200466677546501,
-1.0101211071014404,
0.5215235352516174,
-0.17340943217277527,
-0.3143763542175293,
0.360982209444046,
0.4386928081512451,
1.2667691707611084,
0.03132152184844017,
0.15866611897945404,
1.2674977779388428,
-1.3719273805618286,
1.542006492614746,
-0.7387450337409973,
0.2769206166267395,
-2.4114291667938232,
1.4011160135269165,
-0.8129032254219055,
1.9515304565429688,
-2.6343326568603516,
0.4070529341697693,
-0.5110622644424438,
-0.45552921295166016,
0.2505950331687927,
-0.33321842551231384,
0.12014511227607727,
-0.1812124103307724,
-1.1034976243972778,
-0.1493140012025833,
-0.8434690237045288,
0.5495572090148926,
1.197167158126831,
1.4207459688186646,
-1.0396840572357178,
-0.2719629108905792,
-1.7392374277114868,
-0.14306724071502686,
-0.654499351978302,
0.3527226746082306,
-1.8765372037887573,
-0.20253384113311768,
-1.9466813802719116,
-2.459423065185547,
-1.3057401180267334,
-0.8291292190551758,
1.1209783554077148,
0.10860513895750046,
-1.0125837326049805,
1.1550750732421875,
-0.3966081738471985,
-1.807558536529541,
1.1274679899215698,
-2.1371572017669678
] |
https://github.com/huggingface/datasets/issues/5099 | datasets doesn't support # in data paths | These are possible solutions (assuming `from urllib.parse import quote`):
1) url encode only the path parameter:
```
# src/datasets/utils/file_utils.py
def hf_hub_url(repo_id: str, path: str, revision: Optional[str] = None) -> str:
revision = revision or config.HUB_DEFAULT_VERSION
return config.HUB_DATASETS_URL.format(repo_id=repo_id, path=quote(path), revision=revision)
```
2) url encode all parameters:
```
# src/datasets/utils/file_utils.py
def hf_hub_url(repo_id: str, path: str, revision: Optional[str] = None) -> str:
revision = revision or config.HUB_DEFAULT_VERSION
return config.HUB_DATASETS_URL.format(repo_id=quote(repo_id), path=quote(path), revision=quote(revision))
```
3) url encode the whole url:
```
# src/datasets/config.py
HUB_DATASETS_PATH = "/datasets/{repo_id}/resolve/{revision}/{path}"
HUB_DATASETS_URL = HF_ENDPOINT + HUB_DATASETS_PATH
```
```
# src/datasets/utils/file_utils.py
def hf_hub_url(repo_id: str, path: str, revision: Optional[str] = None) -> str:
revision = revision or config.HUB_DEFAULT_VERSION
return config.HF_ENDPOINT + quote(config.HUB_DATASETS_PATH.format(repo_id=repo_id, path=path, revision=revision))
``` | ## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.
## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
cc @lhoestq | 481 | 113 | datasets doesn't support # in data paths
## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.
## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
cc @lhoestq
These are possible solutions (assuming `from urllib.parse import quote`):
1) url encode only the path parameter:
```
# src/datasets/utils/file_utils.py
def hf_hub_url(repo_id: str, path: str, revision: Optional[str] = None) -> str:
revision = revision or config.HUB_DEFAULT_VERSION
return config.HUB_DATASETS_URL.format(repo_id=repo_id, path=quote(path), revision=revision)
```
2) url encode all parameters:
```
# src/datasets/utils/file_utils.py
def hf_hub_url(repo_id: str, path: str, revision: Optional[str] = None) -> str:
revision = revision or config.HUB_DEFAULT_VERSION
return config.HUB_DATASETS_URL.format(repo_id=quote(repo_id), path=quote(path), revision=quote(revision))
```
3) url encode the whole url:
```
# src/datasets/config.py
HUB_DATASETS_PATH = "/datasets/{repo_id}/resolve/{revision}/{path}"
HUB_DATASETS_URL = HF_ENDPOINT + HUB_DATASETS_PATH
```
```
# src/datasets/utils/file_utils.py
def hf_hub_url(repo_id: str, path: str, revision: Optional[str] = None) -> str:
revision = revision or config.HUB_DEFAULT_VERSION
return config.HF_ENDPOINT + quote(config.HUB_DATASETS_PATH.format(repo_id=repo_id, path=path, revision=revision))
``` | [
-1.133905291557312,
-0.858268141746521,
-0.7452660202980042,
1.5390942096710205,
-0.1015348732471466,
-1.279171347618103,
0.1591409146785736,
-0.9819536805152893,
1.6564134359359741,
-0.7440626621246338,
0.27757298946380615,
-1.7073490619659424,
-0.03718351945281029,
-0.6170570254325867,
-0.7401986122131348,
-0.8554680943489075,
-0.3020058274269104,
-0.7683565616607666,
1.0910719633102417,
2.4406681060791016,
1.2439371347427368,
-1.33830726146698,
2.7386603355407715,
0.7235725522041321,
-0.2014087289571762,
-0.9978093504905701,
0.4997163414955139,
-0.03481312468647957,
-1.3315078020095825,
-0.394729882478714,
-0.9125175476074219,
-0.11379754543304443,
-0.548379123210907,
-0.5343620181083679,
0.05523988604545593,
0.49164462089538574,
-0.27542757987976074,
-0.4778863787651062,
-0.5559868812561035,
-0.7712126970291138,
0.4545436501502991,
-0.33503884077072144,
0.8659734129905701,
-0.31665095686912537,
1.813307285308838,
-0.6129413843154907,
0.40457090735435486,
0.77254319190979,
1.2456412315368652,
0.16430772840976715,
-0.0008829962462186813,
0.3210296928882599,
0.3576897382736206,
0.03664945065975189,
0.5517573356628418,
1.2454593181610107,
0.6525259017944336,
0.49457424879074097,
0.6822740435600281,
-2.251934766769409,
1.3154351711273193,
-0.9843137264251709,
0.28717076778411865,
1.2860544919967651,
-1.0360158681869507,
0.34914129972457886,
-1.8209508657455444,
-0.02637592703104019,
0.5595147013664246,
-2.2123544216156006,
0.30338770151138306,
-1.3587757349014282,
-0.4916505515575409,
1.0552517175674438,
0.373357355594635,
-1.2261279821395874,
0.0722111165523529,
-0.43256527185440063,
1.0502421855926514,
0.3881354033946991,
1.0759634971618652,
-1.6958798170089722,
0.014286226592957973,
-0.2741709351539612,
0.12867462635040283,
-1.3028136491775513,
-1.5644030570983887,
0.5522639751434326,
0.7212595343589783,
0.6786223649978638,
-0.17894384264945984,
0.993323028087616,
-0.9417178630828857,
0.6713606715202332,
-0.9539722204208374,
-1.7603039741516113,
-1.388647198677063,
-2.293069362640381,
-2.241960048675537,
0.7399254441261292,
-0.47404026985168457,
-0.47709760069847107,
2.0885064601898193,
-1.0368062257766724,
-1.789814829826355,
1.0986000299453735,
0.27392318844795227,
0.015063668601214886,
2.295201301574707,
0.2906724214553833,
-0.8016741871833801,
0.5006821155548096,
-0.760251522064209,
0.6665588617324829,
-0.33432334661483765,
1.2956268787384033,
0.4464934468269348,
-1.1236680746078491,
1.5428725481033325,
-0.3916177451610565,
0.6594101190567017,
-0.7698383927345276,
-0.4598245322704315,
-0.745930552482605,
0.24278289079666138,
1.917412519454956,
-0.30108487606048584,
1.4777997732162476,
-0.2970062792301178,
-1.5532339811325073,
-1.4829248189926147,
0.7924593091011047,
0.4626266360282898,
-0.7349454760551453,
0.1527058333158493,
-0.3929934501647949,
0.14241521060466766,
-0.04578632861375809,
1.1311111450195312,
1.2204669713974,
0.7477827668190002,
-0.29042673110961914,
-0.7956068515777588,
0.23120591044425964,
0.05036723613739014,
-0.7300342917442322,
-1.7780581712722778,
-0.25533661246299744,
0.2049405723810196,
0.6111224293708801,
-1.2468321323394775,
1.792745590209961,
0.8107700347900391,
1.9681421518325806,
0.9852559566497803,
-0.35978835821151733,
1.5045586824417114,
0.042941708117723465,
1.963662028312683,
-0.40504440665245056,
0.5768283009529114,
-0.35045161843299866,
-1.1992281675338745,
0.8474944829940796,
-0.29000312089920044,
-2.059279203414917,
-0.6605629920959473,
-0.8168725967407227,
-0.16733397543430328,
-0.7906780242919922,
0.9408219456672668,
-0.26458853483200073,
-1.4675698280334473,
0.1837289035320282,
-0.7705582976341248,
0.19609671831130981,
-1.2575652599334717,
0.17322222888469696,
0.7471697330474854,
-0.6933276653289795,
0.07944980263710022,
-0.30031031370162964,
-1.3034486770629883,
-0.5060904622077942,
0.3973240256309509,
1.8394050598144531,
-0.7070591449737549,
0.9475927948951721,
1.0699516534805298,
-0.6946627497673035,
-0.026086658239364624,
0.28234341740608215,
-0.33957669138908386,
0.8857189416885376,
-1.0893173217773438,
-0.4044194519519806,
1.1818046569824219,
-0.15264086425304413,
-0.6884206533432007,
1.4161980152130127,
0.7196100354194641,
-1.0559262037277222,
-0.2449313849210739,
-0.18820880353450775,
-0.8564391732215881,
0.032383717596530914,
-1.612083911895752,
-0.12672241032123566,
0.43546029925346375,
-1.5257329940795898,
-0.4282790422439575,
-0.1920166015625,
1.3864296674728394,
-0.1170443519949913,
1.3735705614089966,
-0.2667924463748932,
-0.15502828359603882,
-0.37315917015075684,
-0.43714648485183716,
0.12753142416477203,
-0.2755081057548523,
-0.6087439656257629,
0.20166419446468353,
-0.7095688581466675,
0.258307546377182,
1.4693676233291626,
0.2959878742694855,
0.06421028822660446,
0.6058974266052246,
1.1395528316497803,
0.3910849988460541,
-0.1225615069270134,
-0.8409526944160461,
-1.6109869480133057,
1.9623368978500366,
-1.4011098146438599,
1.9756832122802734,
0.7617805600166321,
0.0025880374014377594,
-1.8338046073913574,
-1.95731520652771,
1.3893606662750244,
1.1459646224975586,
2.3866450786590576,
0.5659916996955872,
0.4732116460800171,
-0.805977463722229,
-0.6542938947677612,
0.3485051691532135,
-0.9719280004501343,
-0.7309563755989075,
0.2016471028327942,
2.411219358444214,
1.7656456232070923,
-0.477286159992218,
-0.26219290494918823,
-0.9810574054718018,
1.333145260810852,
-0.23420535027980804,
0.22069990634918213,
2.050004005432129,
-0.21296201646327972,
-0.981857180595398,
1.2734965085983276,
-2.3521063327789307,
0.21326348185539246,
1.9800423383712769,
0.19164128601551056,
0.13538570702075958,
-1.4105205535888672,
-0.6738981008529663,
-0.24172964692115784,
-0.5184723734855652,
-1.2670084238052368,
0.547016441822052,
-0.21690405905246735,
-0.751423716545105,
-1.383471965789795,
0.15381363034248352,
-1.0492764711380005,
-1.7574254274368286,
0.2200077921152115,
1.8932102918624878,
2.017275810241699,
-0.8056477308273315,
1.5150396823883057,
-0.3274413049221039,
0.1863204687833786,
1.2600212097167969,
1.261231780052185,
3.115889549255371,
1.890031337738037,
-1.3188539743423462,
0.7423451542854309,
-0.11245819181203842,
-0.47162216901779175,
1.1675046682357788,
-1.1416410207748413,
1.2115575075149536,
-0.21894621849060059,
-1.247964859008789,
-1.2166430950164795,
0.9239684343338013,
0.5333250164985657,
0.04231229051947594,
-0.46675777435302734,
1.2393895387649536,
0.0876309797167778,
1.3296009302139282,
0.6124860048294067,
-0.3712266683578491,
0.5939919352531433,
-0.3523959517478943,
-0.4710964858531952,
1.5335891246795654,
0.19555532932281494,
-1.372636318206787,
-2.2609763145446777,
-0.17599250376224518,
-0.8830568790435791,
-0.057238493114709854,
-0.6788280010223389,
-0.9732779860496521,
1.5704189538955688,
0.452894002199173,
-1.1900246143341064,
-0.21153613924980164,
-0.3358584940433502,
-0.5374950766563416,
2.698730707168579,
-1.393301248550415,
-0.18445736169815063,
-1.0214407444000244,
-0.5902977585792542,
1.6665092706680298,
-1.2081949710845947,
-0.2749418318271637,
-0.978467583656311,
-0.5924739241600037,
-1.2841160297393799,
-0.588406503200531,
0.06206458806991577,
-0.8477395176887512,
0.8353028893470764,
0.12802885472774506,
-1.3255994319915771,
-0.2547287344932556,
-0.9076469540596008,
0.9743542671203613,
-0.16222944855690002,
0.20272250473499298,
1.9097522497177124,
0.3277657926082611,
-0.4124104678630829,
0.7364843487739563,
1.1507633924484253,
0.6222823858261108,
-0.5759337544441223,
0.3218773901462555,
-0.6955114603042603,
0.2906113564968109,
-1.3570382595062256,
0.22917979955673218,
-2.907850742340088,
0.6558955311775208,
-0.03781752660870552,
-0.012692207470536232,
-0.007275611162185669,
-1.342568039894104,
1.0385582447052002,
2.5672097206115723,
-1.2154343128204346,
0.45148545503616333,
0.3760937750339508,
1.218092441558838,
-1.5796940326690674,
0.2246401160955429,
-0.42695704102516174,
2.0795185565948486,
0.12827977538108826,
1.237480640411377,
-0.371975302696228,
-2.285017490386963,
0.612122118473053,
-1.2502902746200562,
-1.0618244409561157,
0.853369414806366,
-0.7867832183837891,
0.12239351868629456,
-1.4159272909164429,
-0.21177959442138672,
-0.8575848937034607,
-1.1773682832717896,
0.7377164959907532,
0.12495830655097961,
0.47006604075431824,
-0.6135948896408081,
0.2722814083099365,
-2.1137876510620117,
-1.3309651613235474,
-0.18940295279026031,
-0.9501032829284668,
0.4462227523326874,
-0.3169930577278137,
0.6999390125274658,
-0.14294055104255676,
-0.026191890239715576,
0.37592214345932007,
1.4017781019210815,
3.3547284603118896,
0.1264088749885559,
0.3384281396865845,
-0.19656623899936676,
-0.9554332494735718,
1.3917158842086792,
0.8619629740715027,
-0.19490766525268555,
-0.5761712193489075,
-1.0647863149642944,
1.2362247705459595,
1.9703890085220337,
1.0796482563018799,
0.07307054102420807,
-0.8910176157951355,
-0.8261178135871887,
0.013388915918767452,
0.17416530847549438,
0.5145605206489563,
0.9155781269073486,
0.07711988687515259,
0.06575221568346024,
1.4312982559204102,
1.0732218027114868,
-0.34285274147987366,
0.3998076915740967,
-0.8826391100883484,
-0.4266035556793213,
0.5317364931106567,
0.28610822558403015,
0.049917399883270264,
0.28413209319114685,
-1.0720155239105225,
-0.313152939081192,
-0.30107563734054565,
-0.8805378079414368,
-0.724341094493866,
-0.39287033677101135,
-0.37034592032432556,
1.6248160600662231,
0.02582252398133278,
-0.5076060891151428,
-0.0038915821351110935,
-0.683578610420227,
-0.11244846880435944,
-1.0131011009216309,
0.2616737484931946,
-0.16198086738586426,
-0.052510522305965424,
-0.1459273099899292,
1.6264375448226929,
-0.9611334800720215,
-2.1033167839050293,
0.24389389157295227,
0.2546652555465698,
-0.3405136168003082,
0.16052423417568207,
1.758819580078125,
0.5809673070907593,
1.3974868059158325,
1.3661447763442993,
1.0314247608184814,
-0.6896055340766907,
-1.3295824527740479,
0.6839743256568909,
0.9789083003997803,
-1.4530625343322754,
0.8228709101676941,
-0.07840899378061295,
-0.524316132068634,
0.563603937625885,
1.3478426933288574,
0.49977225065231323,
-2.0561604499816895,
0.7402928471565247,
-0.9487525820732117,
0.6929142475128174,
0.7297130227088928,
0.8282051682472229,
0.19962552189826965,
0.8032927513122559,
-1.2344163656234741,
-1.1240917444229126,
-0.6363191604614258,
-0.6574127078056335,
1.9030916690826416,
-0.2405172884464264,
0.522815465927124,
-0.1692735254764557,
-1.436055302619934,
-0.0333014540374279,
0.7632182240486145,
0.35525158047676086,
-0.5487208366394043,
0.767119824886322,
-0.6928126811981201,
-1.0245071649551392,
-1.3064007759094238,
-0.5103451013565063,
-1.0954387187957764,
-0.8965265154838562,
0.9679222106933594,
0.8096422553062439,
0.3618003726005554,
1.8016165494918823,
0.6594353914260864,
0.24156033992767334,
-2.6175553798675537,
0.907656192779541,
0.29963022470474243,
-0.05196161940693855,
0.868149995803833,
0.32163742184638977,
1.080627202987671,
-0.057731032371520996,
0.6442581415176392,
-2.4329612255096436,
2.3333122730255127,
-0.23628850281238556,
0.5605220794677734,
-0.002403335180133581,
-0.23871876299381256,
1.0582828521728516,
0.5364670157432556,
0.579813539981842,
-1.069664478302002,
0.7469279766082764,
-0.6070647835731506,
1.1469074487686157,
0.8440902233123779,
-0.8696183562278748,
-0.06184191629290581,
1.2800012826919556,
0.4378972053527832,
-0.5479101538658142,
-0.9002031683921814,
-1.0046963691711426,
1.0049755573272705,
1.6958805322647095,
-0.004421495832502842,
0.022107060998678207,
0.9075175523757935,
0.6504930853843689,
-1.2602030038833618,
0.07762138545513153,
-0.7167738080024719,
-0.7060369253158569,
1.6335909366607666,
2.025803565979004,
-0.17384953796863556,
-0.1996517926454544,
-0.8537878394126892,
-1.1710156202316284,
0.8326461911201477,
-0.04116152226924896,
-0.007160468026995659,
0.6755226254463196,
-0.668529748916626,
1.1125767230987549,
0.8173088431358337,
0.9598230719566345,
0.19805185496807098,
0.2672608196735382,
0.31267496943473816,
-0.33297258615493774,
-1.2284997701644897,
-0.2645983099937439,
-1.0623323917388916,
-2.516409158706665,
0.44843629002571106,
-0.17707908153533936,
-1.378218173980713,
0.0574934184551239,
-1.0585778951644897,
0.8672211170196533,
-0.5966758131980896,
-1.1575638055801392,
-1.472061276435852,
0.2729189693927765,
-0.16544750332832336,
0.8447544574737549,
-1.6127196550369263,
-0.10044641047716141,
1.2621700763702393,
0.9808351993560791,
-0.7241206765174866,
0.9611926674842834,
0.1942012906074524,
1.0661649703979492,
0.9146215915679932,
-0.329523503780365,
0.5186722874641418,
0.17373256385326385,
-1.2983455657958984,
0.4798809587955475,
1.2364023923873901,
0.12365268170833588,
1.4676870107650757,
-0.569149374961853,
-0.012492735870182514,
0.4187052845954895,
-0.505250096321106,
-0.5047034025192261,
-0.6534155011177063,
0.6864403486251831,
0.06677225232124329,
-0.9600850343704224,
0.008271665312349796,
-0.03259183466434479,
-0.19074122607707977,
0.19739572703838348,
-1.5542744398117065,
-0.1346341222524643,
-0.27084386348724365,
-0.601340115070343,
-1.244874119758606,
-0.07561342418193817,
1.3409539461135864,
-0.7311394214630127,
-0.2412104606628418,
0.5243598222732544,
0.2605763077735901,
0.5424680709838867,
0.598061203956604,
-0.693874716758728,
-0.27075836062431335,
-0.23727816343307495,
-0.40419802069664,
0.35163259506225586,
1.3705720901489258,
-0.0225968100130558,
-0.9521002173423767,
0.7216731309890747,
-0.4417363703250885,
0.10255852341651917,
2.003774642944336,
0.047475870698690414,
-0.8847716450691223,
0.3416726887226105,
-0.734595775604248,
1.888229250907898,
1.7726569175720215,
1.3281599283218384,
-0.08455260843038559,
-0.9250105023384094,
0.6017902493476868,
-0.3594585657119751,
-0.4182193875312805,
0.9292582869529724,
0.3732992708683014,
-0.3084719777107239,
-1.3403536081314087,
0.7188335657119751,
1.2988635301589966,
-0.8226533532142639,
-0.8650088906288147,
0.11629690229892731,
-0.8024909496307373,
1.1043479442596436,
0.7279596924781799,
0.36093562841415405,
0.2822521924972534,
1.5027103424072266,
0.7523895502090454,
-0.4566316306591034,
0.5590111017227173,
0.48325595259666443,
-0.16779425740242004,
-2.0355401039123535,
-1.101914405822754,
0.3637821674346924,
-0.4015800654888153,
-1.6048465967178345,
1.4069514274597168,
-1.2472879886627197,
-0.9805848002433777,
0.5698986649513245,
0.0919249951839447,
1.4005050659179688,
0.35180243849754333,
1.5880498886108398,
2.065056800842285,
0.8650208115577698,
0.368556410074234,
1.287265658378601,
-0.18852658569812775,
-0.47067686915397644,
1.7692145109176636,
-0.48735925555229187,
0.5514130592346191,
1.0055749416351318,
-0.34972721338272095,
-1.0766711235046387,
-0.7877381443977356,
-1.2566468715667725,
-0.7458239197731018,
1.1833821535110474,
0.08749645203351974,
-1.0923113822937012,
0.3309974670410156,
1.6110650300979614,
0.09096259623765945,
-0.2934839427471161,
0.7472727298736572,
0.336285263299942,
-0.7963435053825378,
-0.07749003171920776,
-0.9206552505493164,
0.5008565783500671,
-0.18990956246852875,
-0.32251861691474915,
0.36127498745918274,
0.4757312536239624,
1.319628119468689,
0.04004327207803726,
0.11050395667552948,
1.16650390625,
-1.3924261331558228,
1.5242536067962646,
-0.7368428707122803,
0.3075021207332611,
-2.438087224960327,
1.3905198574066162,
-0.811646044254303,
1.952588438987732,
-2.642699956893921,
0.4576915204524994,
-0.462634801864624,
-0.48930296301841736,
0.2217206507921219,
-0.3240338861942291,
0.15459871292114258,
-0.1582058221101761,
-1.1241867542266846,
-0.1035585105419159,
-0.7890172600746155,
0.5978770852088928,
1.1938562393188477,
1.4095523357391357,
-1.1020867824554443,
-0.22941698133945465,
-1.757624864578247,
-0.1636049598455429,
-0.6853363513946533,
0.32265377044677734,
-1.8940272331237793,
-0.1826152503490448,
-1.9189832210540771,
-2.4391629695892334,
-1.2634520530700684,
-0.8348058462142944,
1.1155283451080322,
0.16115213930606842,
-0.9855598211288452,
1.1720083951950073,
-0.39420169591903687,
-1.8304413557052612,
1.0851596593856812,
-2.181697130203247
] |
https://github.com/huggingface/datasets/issues/5099 | datasets doesn't support # in data paths | repo_id can only contain alphanumeric characters and _- so it doesn't need to be encoded.
However I agree it's a good idea to also apply `quote` to the revision as well as in 2. ! | ## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.
## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
cc @lhoestq | 481 | 35 | datasets doesn't support # in data paths
## Describe the bug
dataset files with `#` symbol their paths aren't read correctly.
## Steps to reproduce the bug
The data in folder `c#`of this [dataset](https://huggingface.co/datasets/loubnabnl/bigcode_csharp) can't be loaded. While the folder `c_sharp` with the same data is loaded properly
```python
ds = load_dataset('loubnabnl/bigcode_csharp', split="train", data_files=["data/c#/*"])
```
```
FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/loubnabnl/bigcode_csharp/resolve/27a3166cff4bb18e11919cafa6f169c0f57483de/data/c#/data_0003.jsonl
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-12.2.1-arm64-arm-64bit
- Python version: 3.9.13
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
cc @lhoestq
repo_id can only contain alphanumeric characters and _- so it doesn't need to be encoded.
However I agree it's a good idea to also apply `quote` to the revision as well as in 2. ! | [
-1.114729404449463,
-0.841832160949707,
-0.7618284225463867,
1.5211181640625,
-0.068541020154953,
-1.306282639503479,
0.12439791858196259,
-0.9682672023773193,
1.7077616453170776,
-0.7482896447181702,
0.2681386172771454,
-1.710068702697754,
-0.052371855825185776,
-0.6215957403182983,
-0.7178797721862793,
-0.8408602476119995,
-0.287843257188797,
-0.7258608341217041,
1.0273221731185913,
2.475968360900879,
1.1888052225112915,
-1.3723220825195312,
2.719058036804199,
0.6914623379707336,
-0.19139280915260315,
-0.9202918410301208,
0.5050849318504333,
0.033779654651880264,
-1.309730887413025,
-0.3954083025455475,
-0.8690164089202881,
-0.07515913248062134,
-0.5446973443031311,
-0.5397607088088989,
0.025990009307861328,
0.4807038903236389,
-0.2663003206253052,
-0.4720761179924011,
-0.4751724302768707,
-0.7804215550422668,
0.42307502031326294,
-0.3138175308704376,
0.9016284346580505,
-0.3340076804161072,
1.826614499092102,
-0.5895708799362183,
0.3795612156391144,
0.7495766878128052,
1.240120530128479,
0.16694262623786926,
0.019114280119538307,
0.3168838620185852,
0.37526625394821167,
0.02386804297566414,
0.5355237722396851,
1.199974536895752,
0.6040636301040649,
0.5081980228424072,
0.6829192638397217,
-2.2556838989257812,
1.308050513267517,
-0.9880937337875366,
0.25259557366371155,
1.3116499185562134,
-1.031986951828003,
0.3987817168235779,
-1.824842095375061,
-0.04596957936882973,
0.5367127656936646,
-2.2410333156585693,
0.2142585813999176,
-1.3462228775024414,
-0.5038467049598694,
1.0154722929000854,
0.31085482239723206,
-1.2408480644226074,
0.09764531254768372,
-0.39096981287002563,
1.035726547241211,
0.4489235281944275,
1.09333336353302,
-1.7046334743499756,
0.03734865039587021,
-0.21663427352905273,
0.1789911389350891,
-1.3559181690216064,
-1.5737627744674683,
0.4694238305091858,
0.7213882803916931,
0.6848607659339905,
-0.12675288319587708,
0.9401876330375671,
-0.9450646638870239,
0.6938101053237915,
-0.9128261208534241,
-1.8014826774597168,
-1.3446736335754395,
-2.284470558166504,
-2.308995246887207,
0.7799443006515503,
-0.49105361104011536,
-0.4609277844429016,
2.0221996307373047,
-1.0281394720077515,
-1.8011665344238281,
1.0937483310699463,
0.30354124307632446,
-0.021713413298130035,
2.3290069103240967,
0.29659757018089294,
-0.7940966486930847,
0.5357996821403503,
-0.7722412943840027,
0.6174142360687256,
-0.40436577796936035,
1.2810249328613281,
0.4918786883354187,
-1.117954969406128,
1.5720775127410889,
-0.4367384910583496,
0.6552644371986389,
-0.8195422887802124,
-0.4708481431007385,
-0.7827980518341064,
0.2769853174686432,
1.9082168340682983,
-0.26994621753692627,
1.5252537727355957,
-0.288948655128479,
-1.567824363708496,
-1.4988903999328613,
0.7985730767250061,
0.42970409989356995,
-0.7589680552482605,
0.15523335337638855,
-0.3597978353500366,
0.13798390328884125,
-0.01809215359389782,
1.0997912883758545,
1.1855958700180054,
0.7171394228935242,
-0.24386334419250488,
-0.8271782994270325,
0.2699120342731476,
0.02473149076104164,
-0.6497384905815125,
-1.8039740324020386,
-0.27191388607025146,
0.23750105500221252,
0.6028425693511963,
-1.2643187046051025,
1.7304574251174927,
0.7879243493080139,
1.950480580329895,
1.0084890127182007,
-0.32767757773399353,
1.5428988933563232,
0.04455086216330528,
2.0010673999786377,
-0.3758660852909088,
0.6124610304832458,
-0.34601476788520813,
-1.1796404123306274,
0.8043760061264038,
-0.34880563616752625,
-2.00152587890625,
-0.6594101190567017,
-0.9023061990737915,
-0.1438068002462387,
-0.7848438024520874,
0.9522572755813599,
-0.21826444566249847,
-1.4396992921829224,
0.20782680809497833,
-0.7288499474525452,
0.16945968568325043,
-1.285592794418335,
0.23435577750205994,
0.8024135828018188,
-0.6600450277328491,
0.0923885703086853,
-0.30639731884002686,
-1.368996262550354,
-0.48265719413757324,
0.4187670946121216,
1.8972465991973877,
-0.7539323568344116,
0.9616739153862,
1.0344985723495483,
-0.7247818112373352,
-0.041970912367105484,
0.3372820317745209,
-0.4078231155872345,
0.8771596550941467,
-1.091286063194275,
-0.39220350980758667,
1.1368590593338013,
-0.16225188970565796,
-0.676976203918457,
1.4262391328811646,
0.7461512684822083,
-1.0516492128372192,
-0.215511292219162,
-0.19662393629550934,
-0.8391141891479492,
0.006945770233869553,
-1.6422690153121948,
-0.1546880453824997,
0.33321046829223633,
-1.4858547449111938,
-0.46657827496528625,
-0.20142056047916412,
1.3535614013671875,
-0.15546782314777374,
1.3867260217666626,
-0.2488040030002594,
-0.15901856124401093,
-0.47315025329589844,
-0.498089998960495,
0.1391606330871582,
-0.2788236439228058,
-0.6702757477760315,
0.22982600331306458,
-0.6823343634605408,
0.2870272397994995,
1.4134950637817383,
0.2980353534221649,
0.06275208294391632,
0.6093614101409912,
1.1461578607559204,
0.3817077875137329,
-0.11466307938098907,
-0.8602215051651001,
-1.6111576557159424,
2.0015852451324463,
-1.4225883483886719,
1.9457083940505981,
0.7162409424781799,
-0.058325786143541336,
-1.8581182956695557,
-1.9521875381469727,
1.4280728101730347,
1.1700719594955444,
2.377336025238037,
0.5798949599266052,
0.4679926037788391,
-0.767189085483551,
-0.661261796951294,
0.32084164023399353,
-0.9675886034965515,
-0.7551466226577759,
0.19616660475730896,
2.380983591079712,
1.7136038541793823,
-0.5139455199241638,
-0.22821961343288422,
-0.9890413880348206,
1.3337726593017578,
-0.2527626156806946,
0.2119702696800232,
2.099069833755493,
-0.20556046068668365,
-1.0018593072891235,
1.2555811405181885,
-2.343179225921631,
0.18993689119815826,
1.9689592123031616,
0.22869323194026947,
0.10300269722938538,
-1.40915846824646,
-0.7083051800727844,
-0.250168114900589,
-0.5050451755523682,
-1.2561674118041992,
0.5409944653511047,
-0.2299257069826126,
-0.7870062589645386,
-1.450139045715332,
0.17138104140758514,
-1.0564440488815308,
-1.7293847799301147,
0.20948046445846558,
1.881877064704895,
2.0284955501556396,
-0.7975025177001953,
1.497808814048767,
-0.19257675111293793,
0.23531952500343323,
1.2677291631698608,
1.2320834398269653,
3.1751515865325928,
1.887642502784729,
-1.2523176670074463,
0.7294774055480957,
-0.11142393946647644,
-0.49800026416778564,
1.2310734987258911,
-1.1504881381988525,
1.2021048069000244,
-0.25397157669067383,
-1.2672479152679443,
-1.266067385673523,
0.9015195369720459,
0.531734049320221,
0.04914390668272972,
-0.4712526202201843,
1.2234606742858887,
0.10038785636425018,
1.3555153608322144,
0.5868987441062927,
-0.34201690554618835,
0.5662960410118103,
-0.4318370223045349,
-0.5015202760696411,
1.5777676105499268,
0.17064543068408966,
-1.390924096107483,
-2.310789108276367,
-0.15950845181941986,
-0.8913738131523132,
-0.11979714035987854,
-0.6568613052368164,
-0.9847961664199829,
1.5448522567749023,
0.5077587962150574,
-1.1829760074615479,
-0.23528829216957092,
-0.3383559584617615,
-0.6492843627929688,
2.6990129947662354,
-1.4167081117630005,
-0.2268342226743698,
-1.0018458366394043,
-0.5927014946937561,
1.660319447517395,
-1.2048419713974,
-0.2674412131309509,
-0.9579959511756897,
-0.6087950468063354,
-1.3277887105941772,
-0.5600223541259766,
0.005923716351389885,
-0.8685893416404724,
0.8320414423942566,
0.13480006158351898,
-1.2590570449829102,
-0.24960489571094513,
-0.9802166819572449,
0.8752375245094299,
-0.15659670531749725,
0.26493993401527405,
1.8661649227142334,
0.35993310809135437,
-0.3937419056892395,
0.7425773739814758,
1.1405677795410156,
0.610171914100647,
-0.641490638256073,
0.32083332538604736,
-0.7176799774169922,
0.29157012701034546,
-1.3328505754470825,
0.2531241178512573,
-2.902765989303589,
0.5932512879371643,
-0.012877067551016808,
-0.06805519014596939,
-0.015556756407022476,
-1.2844631671905518,
1.0843291282653809,
2.528150796890259,
-1.2275450229644775,
0.490669310092926,
0.35269758105278015,
1.27842378616333,
-1.603977918624878,
0.2504691481590271,
-0.42640039324760437,
2.1263279914855957,
0.11259283125400543,
1.1801072359085083,
-0.3523099422454834,
-2.2879638671875,
0.5953592658042908,
-1.2450374364852905,
-1.1267828941345215,
0.8469628691673279,
-0.8220698833465576,
0.11635039746761322,
-1.3830281496047974,
-0.17995771765708923,
-0.8473559021949768,
-1.2097983360290527,
0.754385232925415,
0.07155260443687439,
0.5034335255622864,
-0.5708038806915283,
0.303455114364624,
-2.1163041591644287,
-1.3383699655532837,
-0.21409769356250763,
-0.9678078293800354,
0.43269604444503784,
-0.27888643741607666,
0.7134732604026794,
-0.15425099432468414,
0.01723424531519413,
0.3231106102466583,
1.380286693572998,
3.379453182220459,
0.17826521396636963,
0.4137279987335205,
-0.14990876615047455,
-0.9548479318618774,
1.395269513130188,
0.9467300176620483,
-0.2187965363264084,
-0.5638718008995056,
-1.0422650575637817,
1.255492091178894,
1.9497103691101074,
1.0870802402496338,
0.10970523953437805,
-0.8509371280670166,
-0.8289888501167297,
0.022887587547302246,
0.14652350544929504,
0.504796028137207,
0.9080831408500671,
0.07290825247764587,
0.08941808342933655,
1.4507358074188232,
1.120573878288269,
-0.3242042660713196,
0.36933785676956177,
-0.8651452660560608,
-0.3748326897621155,
0.5229167938232422,
0.311332643032074,
0.06704024970531464,
0.30796682834625244,
-1.0436410903930664,
-0.2785406708717346,
-0.3159604072570801,
-0.9125654697418213,
-0.7081913948059082,
-0.4306059777736664,
-0.3344022333621979,
1.6413562297821045,
0.044087477028369904,
-0.5074335932731628,
-0.03664246201515198,
-0.7385149002075195,
-0.04886132851243019,
-1.0068913698196411,
0.2689662277698517,
-0.15754228830337524,
-0.03991379588842392,
-0.12084066867828369,
1.711790680885315,
-0.9646724462509155,
-2.117715358734131,
0.2208309918642044,
0.2744778096675873,
-0.370329350233078,
0.13912715017795563,
1.7020879983901978,
0.56120765209198,
1.3853996992111206,
1.3682007789611816,
1.0605639219284058,
-0.6810594797134399,
-1.3548831939697266,
0.6347559690475464,
0.9649174809455872,
-1.4269968271255493,
0.7933071851730347,
-0.02664976194500923,
-0.4792080521583557,
0.5872109532356262,
1.300665259361267,
0.4431227445602417,
-2.000351667404175,
0.7008652091026306,
-0.9463613629341125,
0.7288606762886047,
0.7207317352294922,
0.8194409012794495,
0.20779329538345337,
0.7907243967056274,
-1.2596995830535889,
-1.148335337638855,
-0.677734911441803,
-0.6407046318054199,
1.8951276540756226,
-0.2004421502351761,
0.48784440755844116,
-0.12290738523006439,
-1.413374900817871,
0.017053401097655296,
0.7404825687408447,
0.38092342019081116,
-0.44538453221321106,
0.8005566596984863,
-0.7123056054115295,
-1.0568195581436157,
-1.3487406969070435,
-0.4474790394306183,
-1.03419029712677,
-0.8829526305198669,
0.9579876661300659,
0.8249703645706177,
0.33851948380470276,
1.7925459146499634,
0.6540946960449219,
0.29379984736442566,
-2.6528358459472656,
0.8952407240867615,
0.32924696803092957,
-0.041601091623306274,
0.8404573202133179,
0.3186248242855072,
1.0965521335601807,
-0.0984601378440857,
0.5980799794197083,
-2.4159226417541504,
2.287543535232544,
-0.26721909642219543,
0.6019006371498108,
0.029990460723638535,
-0.20736029744148254,
1.055515170097351,
0.5147953629493713,
0.6186445951461792,
-1.124666690826416,
0.7830836176872253,
-0.633823573589325,
1.1611982583999634,
0.8771162629127502,
-0.8535000681877136,
-0.03888941556215286,
1.2731493711471558,
0.44353970885276794,
-0.5181413888931274,
-0.8940927386283875,
-1.01022207736969,
0.9891930222511292,
1.6724286079406738,
0.0056037940084934235,
-0.01212529931217432,
0.9278410077095032,
0.6197811961174011,
-1.3121610879898071,
0.10186241567134857,
-0.7425024509429932,
-0.6793036460876465,
1.669800043106079,
2.0277955532073975,
-0.10264280438423157,
-0.18437649309635162,
-0.8510462641716003,
-1.1705939769744873,
0.7851084470748901,
0.055404599756002426,
-0.007313352078199387,
0.6958308219909668,
-0.6919756531715393,
1.1403425931930542,
0.8378686904907227,
0.9299401640892029,
0.2065306156873703,
0.28977903723716736,
0.331153005361557,
-0.3258359432220459,
-1.2127196788787842,
-0.3055334687232971,
-1.0452749729156494,
-2.4624602794647217,
0.430589497089386,
-0.2295069694519043,
-1.3523679971694946,
0.07065474987030029,
-1.0384844541549683,
0.871665358543396,
-0.5768387317657471,
-1.1534743309020996,
-1.4664366245269775,
0.27187836170196533,
-0.20314599573612213,
0.8101196885108948,
-1.5805623531341553,
-0.11562080681324005,
1.2898297309875488,
0.9960826635360718,
-0.6995821595191956,
0.9638327956199646,
0.2185586392879486,
1.0308133363723755,
0.9120616912841797,
-0.362204909324646,
0.4740539789199829,
0.1904129981994629,
-1.3419089317321777,
0.5008659958839417,
1.2367477416992188,
0.13989102840423584,
1.4354065656661987,
-0.5800256729125977,
-0.016141274943947792,
0.36038893461227417,
-0.46211180090904236,
-0.5072025060653687,
-0.6941021084785461,
0.712821364402771,
0.09238049387931824,
-0.9111460447311401,
0.050316933542490005,
-0.013579738326370716,
-0.14754359424114227,
0.22506225109100342,
-1.5911363363265991,
-0.12112340331077576,
-0.2382706254720688,
-0.6518255472183228,
-1.2396947145462036,
-0.026492804288864136,
1.2879494428634644,
-0.7792850136756897,
-0.19254927337169647,
0.5274561047554016,
0.28427374362945557,
0.5159392356872559,
0.557296097278595,
-0.6637003421783447,
-0.2732592225074768,
-0.30077892541885376,
-0.3316152095794678,
0.31791236996650696,
1.320880651473999,
-0.0673806220293045,
-0.9588332772254944,
0.6975591778755188,
-0.46513795852661133,
0.056740615516901016,
2.0206005573272705,
0.05038365349173546,
-0.9269355535507202,
0.33986881375312805,
-0.7535818815231323,
1.9004278182983398,
1.7610431909561157,
1.35316801071167,
0.004756988026201725,
-0.9428036212921143,
0.5540372133255005,
-0.3572533130645752,
-0.42590245604515076,
0.9765899777412415,
0.41172173619270325,
-0.2894064784049988,
-1.3078635931015015,
0.6473874449729919,
1.2935527563095093,
-0.8302231431007385,
-0.8553736805915833,
0.14889858663082123,
-0.8653259873390198,
1.0710551738739014,
0.7602993249893188,
0.38993123173713684,
0.28071457147598267,
1.523912787437439,
0.7351874113082886,
-0.5236308574676514,
0.5301967263221741,
0.5075761675834656,
-0.1611652821302414,
-1.9765924215316772,
-1.0904847383499146,
0.3736215829849243,
-0.390997976064682,
-1.5787816047668457,
1.453187346458435,
-1.2127903699874878,
-0.9387763738632202,
0.5829052925109863,
0.12305805087089539,
1.390440821647644,
0.32131335139274597,
1.5937399864196777,
2.0786056518554688,
0.8482221961021423,
0.3526512086391449,
1.2696155309677124,
-0.18144381046295166,
-0.46909138560295105,
1.7928773164749146,
-0.5015397071838379,
0.562816858291626,
1.0014766454696655,
-0.3501116633415222,
-1.0513440370559692,
-0.7999107241630554,
-1.2071419954299927,
-0.6991711854934692,
1.1472936868667603,
0.13095355033874512,
-1.1162902116775513,
0.26567259430885315,
1.6358321905136108,
0.07888305187225342,
-0.3017005920410156,
0.7122434377670288,
0.3652559220790863,
-0.8050166964530945,
-0.06827292591333389,
-1.0019285678863525,
0.5351714491844177,
-0.15482795238494873,
-0.2626253664493561,
0.3478439152240753,
0.4505060017108917,
1.2619609832763672,
0.06538237631320953,
0.14324556291103363,
1.276490569114685,
-1.3692271709442139,
1.5381202697753906,
-0.7548051476478577,
0.2813960015773773,
-2.4136900901794434,
1.4193862676620483,
-0.8067307472229004,
1.950345516204834,
-2.6275277137756348,
0.3860987424850464,
-0.5140885710716248,
-0.47270429134368896,
0.25387832522392273,
-0.3112607002258301,
0.1319536417722702,
-0.19090798497200012,
-1.1218847036361694,
-0.13483235239982605,
-0.8352463245391846,
0.5466036200523376,
1.1868932247161865,
1.4009913206100464,
-1.052118182182312,
-0.28420180082321167,
-1.7712711095809937,
-0.13429856300354004,
-0.6400869488716125,
0.34610283374786377,
-1.859865665435791,
-0.20019419491291046,
-1.911384105682373,
-2.440945625305176,
-1.3387162685394287,
-0.8343642354011536,
1.1163828372955322,
0.1017109602689743,
-1.012173056602478,
1.161396861076355,
-0.379933625459671,
-1.8167190551757812,
1.1059842109680176,
-2.1548891067504883
] |
https://github.com/huggingface/datasets/issues/5098 | Classes label error when loading symbolic links using imagefolder | Hi, thanks for reporting and suggesting a fix! We still need to account for `.`/`..` in the file path, so a more robust fix would be `Path(os.path.abspath(filepath))`. | **Is your feature request related to a problem? Please describe.**
Like this: #4015
When there are **symbolic links** to pictures in the data folder, the parent folder name of the **real file** will be used as the class name instead of the parent folder of the symbolic link itself. Can you give an option to decide whether to enable symbolic link tracking?
This is inconsistent with the `torchvision.datasets.ImageFolder` behavior.
For example:


It use `others` in green circle as class label but not `abnormal`, I wish `load_dataset` not use the real file parent as label.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context about the feature request here.
| 482 | 27 | Classes label error when loading symbolic links using imagefolder
**Is your feature request related to a problem? Please describe.**
Like this: #4015
When there are **symbolic links** to pictures in the data folder, the parent folder name of the **real file** will be used as the class name instead of the parent folder of the symbolic link itself. Can you give an option to decide whether to enable symbolic link tracking?
This is inconsistent with the `torchvision.datasets.ImageFolder` behavior.
For example:


It use `others` in green circle as class label but not `abnormal`, I wish `load_dataset` not use the real file parent as label.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context about the feature request here.
Hi, thanks for reporting and suggesting a fix! We still need to account for `.`/`..` in the file path, so a more robust fix would be `Path(os.path.abspath(filepath))`. | [
-1.2065273523330688,
-0.9500746130943298,
-0.6967935562133789,
1.3876570463180542,
-0.14884772896766663,
-1.2559999227523804,
0.12383659929037094,
-1.018693208694458,
1.7280601263046265,
-0.7091869115829468,
0.2843490242958069,
-1.6960093975067139,
0.03551967442035675,
-0.5601651072502136,
-0.8493162989616394,
-0.8237814903259277,
-0.4406949281692505,
-0.8715087175369263,
0.9760148525238037,
2.5465192794799805,
1.220272421836853,
-1.4844651222229004,
2.7300336360931396,
0.643241286277771,
-0.2063552886247635,
-0.9998511075973511,
0.3734600841999054,
0.06507859379053116,
-1.2740310430526733,
-0.4654456675052643,
-0.9191592931747437,
-0.04409007728099823,
-0.5447470545768738,
-0.5749448537826538,
0.07109010219573975,
0.32484379410743713,
-0.20186129212379456,
-0.3935709595680237,
-0.5531427264213562,
-0.7324147820472717,
0.5018477439880371,
-0.4679175317287445,
0.90828937292099,
-0.3931523859500885,
1.766680359840393,
-0.6830721497535706,
0.3574315011501312,
0.7138836979866028,
1.369641900062561,
0.21410997211933136,
-0.07860482484102249,
0.39839231967926025,
0.44428783655166626,
-0.06698203831911087,
0.421078622341156,
1.20761239528656,
0.6391693949699402,
0.489246129989624,
0.7508635520935059,
-2.2005419731140137,
1.392548680305481,
-1.0299408435821533,
0.20571982860565186,
1.4126510620117188,
-1.0540306568145752,
0.3883224129676819,
-1.91512131690979,
-0.05263371765613556,
0.49528077244758606,
-2.3443996906280518,
0.17352530360221863,
-1.321216106414795,
-0.5711029767990112,
0.9679378867149353,
0.2371165007352829,
-1.3569891452789307,
0.14869584143161774,
-0.46211233735084534,
0.9760553240776062,
0.37614956498146057,
1.1520850658416748,
-1.7848494052886963,
-0.1917348951101303,
-0.2522556483745575,
0.12358514219522476,
-1.2579545974731445,
-1.5280132293701172,
0.5498641729354858,
0.5952250957489014,
0.5450648069381714,
-0.14353246986865997,
0.9970647692680359,
-0.9652279615402222,
0.8624430298805237,
-1.0558836460113525,
-1.6912188529968262,
-1.3901357650756836,
-2.1690266132354736,
-2.184983015060425,
0.9121558666229248,
-0.4436868727207184,
-0.5278807878494263,
1.9589184522628784,
-1.0375498533248901,
-1.709436297416687,
1.1395200490951538,
0.28806647658348083,
-0.013761972077190876,
2.404939651489258,
0.19887775182724,
-0.7310171723365784,
0.4219761788845062,
-0.7512428164482117,
0.8421948552131653,
-0.4884645640850067,
1.4055540561676025,
0.46302178502082825,
-1.0392913818359375,
1.5709807872772217,
-0.4013456404209137,
0.5782762765884399,
-0.7096107602119446,
-0.5075920820236206,
-0.7716820240020752,
0.44076403975486755,
1.9318163394927979,
-0.28216907382011414,
1.5078864097595215,
-0.3167415261268616,
-1.6257851123809814,
-1.4359264373779297,
0.8973721861839294,
0.578848123550415,
-0.8554821014404297,
0.08750160038471222,
-0.3273261487483978,
0.1366088092327118,
-0.0050316681154072285,
0.9979872107505798,
1.2324738502502441,
0.7731232643127441,
-0.317807137966156,
-0.8755652904510498,
0.19273529946804047,
-0.11362705379724503,
-0.7090808153152466,
-1.867785930633545,
-0.3293091058731079,
0.16553419828414917,
0.6441274285316467,
-1.2833691835403442,
1.6564245223999023,
0.8876391649246216,
1.965621829032898,
0.9738826751708984,
-0.3845750391483307,
1.5386743545532227,
0.06333353370428085,
1.9268436431884766,
-0.5075893998146057,
0.7397890090942383,
-0.29150810837745667,
-1.111594557762146,
0.8326473236083984,
-0.3785164952278137,
-2.0664408206939697,
-0.6328345537185669,
-0.761805534362793,
-0.19600331783294678,
-0.7727299928665161,
0.8948949575424194,
-0.24464181065559387,
-1.3687944412231445,
0.2913668155670166,
-0.7101921439170837,
0.12407717853784561,
-1.2863036394119263,
0.3206266462802887,
0.7642706036567688,
-0.6319645047187805,
0.0244161244481802,
-0.29852378368377686,
-1.3346874713897705,
-0.5787534117698669,
0.25376954674720764,
1.876607060432434,
-0.7584280371665955,
0.9698737859725952,
0.9605887532234192,
-0.6826326251029968,
-0.019298331812024117,
0.41616877913475037,
-0.2940200865268707,
0.9037811756134033,
-1.1196191310882568,
-0.33984610438346863,
1.0763322114944458,
-0.14847809076309204,
-0.4680127501487732,
1.4288983345031738,
0.7260897159576416,
-0.9955776929855347,
-0.24886900186538696,
-0.24006319046020508,
-0.8054937124252319,
0.06326517462730408,
-1.6396877765655518,
-0.20043212175369263,
0.2701185643672943,
-1.5021758079528809,
-0.49117884039878845,
-0.18357999622821808,
1.3701573610305786,
-0.16999360918998718,
1.3584949970245361,
-0.34478679299354553,
-0.33080029487609863,
-0.40037795901298523,
-0.31851765513420105,
0.1638340950012207,
-0.25493595004081726,
-0.6565182209014893,
0.26958099007606506,
-0.7346315979957581,
0.35794997215270996,
1.447638750076294,
0.4513348340988159,
-0.023019693791866302,
0.48510536551475525,
1.1053903102874756,
0.25242799520492554,
-0.0841931700706482,
-0.8781741857528687,
-1.554822325706482,
2.040848731994629,
-1.5136351585388184,
1.949204921722412,
0.7906284332275391,
-0.044869691133499146,
-1.656752586364746,
-1.8777704238891602,
1.4064640998840332,
1.2327321767807007,
2.440276622772217,
0.6314128041267395,
0.4711499512195587,
-0.7760184407234192,
-0.6453260183334351,
0.32093778252601624,
-1.0315378904342651,
-0.759872555732727,
0.1358364075422287,
2.370302677154541,
1.7100605964660645,
-0.5383622050285339,
-0.20194774866104126,
-1.0796244144439697,
1.4008538722991943,
-0.12198919802904129,
0.1715511828660965,
2.0072743892669678,
-0.2476329803466797,
-1.1408823728561401,
1.2306276559829712,
-2.197758913040161,
0.1644705981016159,
1.9894769191741943,
0.34066617488861084,
0.05500173568725586,
-1.4063445329666138,
-0.6607731580734253,
-0.3136798143386841,
-0.39398398995399475,
-1.2837634086608887,
0.4847880005836487,
-0.3308977484703064,
-0.7840338945388794,
-1.5104433298110962,
0.09243188053369522,
-1.1356089115142822,
-1.6377424001693726,
0.2936006486415863,
1.9055248498916626,
1.9678887128829956,
-0.6979702711105347,
1.490057349205017,
-0.32435330748558044,
0.09055783599615097,
1.2502411603927612,
1.1635164022445679,
3.169281482696533,
1.8977504968643188,
-1.1930034160614014,
0.5991280674934387,
-0.24037490785121918,
-0.4079679250717163,
1.0592644214630127,
-1.107021450996399,
1.2213690280914307,
-0.1596451699733734,
-1.1971582174301147,
-1.187511920928955,
0.9564909934997559,
0.4706503450870514,
0.04008869826793671,
-0.5358560085296631,
1.1248785257339478,
0.0628751888871193,
1.3512718677520752,
0.5001897811889648,
-0.29906052350997925,
0.6809923648834229,
-0.45138174295425415,
-0.5002269744873047,
1.6718275547027588,
0.2343980371952057,
-1.42721426486969,
-2.3474791049957275,
-0.20761340856552124,
-0.8490856289863586,
0.08065296709537506,
-0.5997569561004639,
-1.0139044523239136,
1.7148278951644897,
0.45402970910072327,
-1.288071870803833,
-0.31278935074806213,
-0.3723653554916382,
-0.6573944687843323,
2.6456692218780518,
-1.4512088298797607,
-0.1959780901670456,
-0.896976113319397,
-0.5201084017753601,
1.6191436052322388,
-1.210048794746399,
-0.19186653196811676,
-0.9677159190177917,
-0.5328247547149658,
-1.212520718574524,
-0.610014021396637,
-0.12366198748350143,
-0.8693355917930603,
0.7699760794639587,
0.1555149257183075,
-1.2140028476715088,
-0.34973880648612976,
-0.8739355206489563,
0.6911149024963379,
-0.10321304202079773,
0.20970645546913147,
1.894547939300537,
0.4509311318397522,
-0.3848780691623688,
0.6985665559768677,
1.1355469226837158,
0.5919983386993408,
-0.5530970692634583,
0.19319342076778412,
-0.6459242701530457,
0.32052624225616455,
-1.222096562385559,
0.2706311047077179,
-2.9170703887939453,
0.6525937914848328,
-0.039464958012104034,
0.026021739467978477,
0.003240850754082203,
-1.2429019212722778,
1.1413742303848267,
2.604780912399292,
-1.1555845737457275,
0.5222362279891968,
0.2681567668914795,
1.1773955821990967,
-1.5937124490737915,
0.29428091645240784,
-0.30777010321617126,
2.1558890342712402,
0.2123246192932129,
1.1793363094329834,
-0.5705428123474121,
-2.291781187057495,
0.5199025273323059,
-1.1633108854293823,
-1.168152928352356,
0.647922158241272,
-0.7460669875144958,
0.01684407889842987,
-1.496642827987671,
-0.1760202795267105,
-0.8082284927368164,
-1.2008304595947266,
0.7667815089225769,
0.10676445811986923,
0.49876317381858826,
-0.6103465557098389,
0.3400265872478485,
-2.135596752166748,
-1.3872278928756714,
-0.31580227613449097,
-0.9327245950698853,
0.4883792996406555,
-0.27337464690208435,
0.7162649035453796,
-0.09897712618112564,
0.08391869813203812,
0.339904248714447,
1.4057623147964478,
3.3444485664367676,
0.1759403496980667,
0.4539045989513397,
-0.1476842314004898,
-0.8942018151283264,
1.4437519311904907,
0.9709586501121521,
-0.014117024838924408,
-0.6163142323493958,
-1.0437475442886353,
1.2846417427062988,
1.9316664934158325,
0.9618945121765137,
0.10036636143922806,
-0.7955899238586426,
-0.72221839427948,
0.007990937680006027,
0.15470948815345764,
0.4877259135246277,
0.9638529419898987,
0.07617209106683731,
0.023882417008280754,
1.433997392654419,
1.2392243146896362,
-0.5075114369392395,
0.4403291940689087,
-0.8141952753067017,
-0.4020571708679199,
0.42589813470840454,
0.3661876916885376,
-0.02366557903587818,
0.28098413348197937,
-0.977959156036377,
-0.24772851169109344,
-0.29851457476615906,
-1.0286036729812622,
-0.7462267875671387,
-0.41030481457710266,
-0.3931340277194977,
1.753895878791809,
0.13430768251419067,
-0.39341431856155396,
-0.09548905491828918,
-0.7624360918998718,
-0.07180184125900269,
-1.0411864519119263,
0.3832314610481262,
-0.10523109883069992,
-0.06695914268493652,
-0.08127725124359131,
1.7989665269851685,
-0.8744397759437561,
-2.0796220302581787,
0.26712021231651306,
0.23890265822410583,
-0.5289775133132935,
0.17014265060424805,
1.6684167385101318,
0.5935865640640259,
1.477399468421936,
1.3959885835647583,
1.0008459091186523,
-0.6643127202987671,
-1.3151124715805054,
0.6242250204086304,
0.9083784818649292,
-1.4284981489181519,
0.8029041290283203,
0.07807062566280365,
-0.434262752532959,
0.7143141627311707,
1.4352384805679321,
0.418652206659317,
-2.0278327465057373,
0.8391721248626709,
-0.8552997708320618,
0.7524086236953735,
0.7010995149612427,
0.6795288920402527,
0.17769649624824524,
0.8353400826454163,
-1.2901005744934082,
-1.1369335651397705,
-0.8250003457069397,
-0.6226345896720886,
2.023878335952759,
-0.23950323462486267,
0.4814777970314026,
-0.19593389332294464,
-1.309511661529541,
-0.08099731802940369,
0.6958175897598267,
0.4924894869327545,
-0.31197577714920044,
0.7161997556686401,
-0.6200999617576599,
-1.1450611352920532,
-1.420271635055542,
-0.5130939483642578,
-0.9467580914497375,
-0.9029492139816284,
0.9620007872581482,
0.893566370010376,
0.3631610870361328,
1.861473560333252,
0.6588349938392639,
0.1619998663663864,
-2.6098954677581787,
0.8715220093727112,
0.3392888009548187,
-0.06264466792345047,
1.0568747520446777,
0.2671408951282501,
0.9862847328186035,
-0.02116142213344574,
0.5019444823265076,
-2.428212881088257,
2.227245569229126,
-0.24885982275009155,
0.8153131604194641,
0.03434547781944275,
-0.17829659581184387,
1.1477105617523193,
0.4980759918689728,
0.5325115919113159,
-1.1451201438903809,
0.7350893616676331,
-0.6164353489875793,
1.2167823314666748,
0.8282911777496338,
-0.7404396533966064,
-0.024754900485277176,
1.2407132387161255,
0.4209311902523041,
-0.49055925011634827,
-0.9449612498283386,
-0.9829398393630981,
0.9015232920646667,
1.8332314491271973,
-0.11307256668806076,
0.046692587435245514,
0.7807740569114685,
0.6950810551643372,
-1.2824677228927612,
0.12680773437023163,
-0.7851055264472961,
-0.7493175268173218,
1.6751561164855957,
2.133549451828003,
-0.033421702682971954,
-0.2676500678062439,
-0.643431544303894,
-1.2581154108047485,
0.8102397918701172,
0.09703804552555084,
0.15471342206001282,
0.6747623682022095,
-0.662802517414093,
1.1951959133148193,
0.9165210723876953,
0.9471461176872253,
0.1812063604593277,
0.37217357754707336,
0.38541120290756226,
-0.3276083767414093,
-1.1432307958602905,
-0.290230393409729,
-1.1895486116409302,
-2.4736740589141846,
0.46089455485343933,
-0.23968636989593506,
-1.411000370979309,
0.06109311431646347,
-1.0036678314208984,
0.8333291411399841,
-0.5527557730674744,
-1.1584091186523438,
-1.5677895545959473,
0.20241321623325348,
-0.12151706218719482,
0.8896823525428772,
-1.5843290090560913,
-0.15718193352222443,
1.2565079927444458,
0.8969599008560181,
-0.5583212375640869,
0.9159427881240845,
0.22374020516872406,
1.0398916006088257,
0.9041228890419006,
-0.39992064237594604,
0.3584584593772888,
0.0894889310002327,
-1.2771003246307373,
0.5168726444244385,
1.2192269563674927,
0.19881077110767365,
1.4541301727294922,
-0.5628902316093445,
0.06418020278215408,
0.4039575755596161,
-0.4322889745235443,
-0.46422770619392395,
-0.5789002776145935,
0.7324735522270203,
0.01809508167207241,
-0.9800134301185608,
0.11133190989494324,
-0.08518920838832855,
-0.1258586198091507,
0.22743968665599823,
-1.4651035070419312,
-0.198564812541008,
-0.36451464891433716,
-0.4893926680088043,
-1.2560997009277344,
-0.1344757378101349,
1.2949533462524414,
-0.7715847492218018,
-0.18048688769340515,
0.5484639406204224,
0.45562270283699036,
0.5866930484771729,
0.6236947178840637,
-0.6365562677383423,
-0.4519003629684448,
-0.28947174549102783,
-0.40874508023262024,
0.26389986276626587,
1.227294683456421,
-0.09862212836742401,
-0.9184244275093079,
0.6686824560165405,
-0.4188564419746399,
0.03562208265066147,
1.9165418148040771,
0.027188723906874657,
-0.7841590046882629,
0.39973658323287964,
-0.7155497670173645,
1.8641847372055054,
1.7087607383728027,
1.2840138673782349,
-0.04643326252698898,
-1.0118393898010254,
0.5645376443862915,
-0.1962171047925949,
-0.44952911138534546,
0.9628376364707947,
0.4919884502887726,
-0.22009719908237457,
-1.407302737236023,
0.5718148946762085,
1.3042293787002563,
-0.8677546381950378,
-0.8064395785331726,
0.12720051407814026,
-0.8216216564178467,
1.074053406715393,
0.750408947467804,
0.44263526797294617,
0.24886299669742584,
1.7582894563674927,
0.6871851086616516,
-0.43279558420181274,
0.5106115341186523,
0.4831785559654236,
-0.23927900195121765,
-2.1592371463775635,
-1.247637152671814,
0.21123331785202026,
-0.3843722641468048,
-1.4688807725906372,
1.3241777420043945,
-1.1473135948181152,
-0.9334716200828552,
0.5335292816162109,
0.15957094728946686,
1.45771324634552,
0.22825665771961212,
1.630326747894287,
2.1151509284973145,
0.9128578305244446,
0.31356847286224365,
1.3103253841400146,
-0.07011894881725311,
-0.5079714059829712,
1.852967619895935,
-0.4584268629550934,
0.47827816009521484,
1.0906552076339722,
-0.33770251274108887,
-1.1478853225708008,
-0.7938204407691956,
-1.1501238346099854,
-0.728238582611084,
1.0956220626831055,
0.10694184899330139,
-1.2200356721878052,
0.12693926692008972,
1.5488024950027466,
0.19131793081760406,
-0.29876819252967834,
0.48477092385292053,
0.47260165214538574,
-0.7581920623779297,
-0.10488230735063553,
-1.0200223922729492,
0.42087695002555847,
-0.16748158633708954,
-0.3677171468734741,
0.2916114926338196,
0.5261640548706055,
1.2090189456939697,
-0.024221893399953842,
0.06918075680732727,
1.1822733879089355,
-1.445709228515625,
1.415476679801941,
-0.7089866399765015,
0.2545250356197357,
-2.3297502994537354,
1.4828441143035889,
-0.7992511987686157,
1.9636805057525635,
-2.665997266769409,
0.39137011766433716,
-0.5773070454597473,
-0.4200209379196167,
0.32982945442199707,
-0.31763726472854614,
0.2339315265417099,
-0.09111720323562622,
-1.1171681880950928,
-0.11333116143941879,
-0.7973222136497498,
0.567779541015625,
1.182175874710083,
1.4179749488830566,
-1.1153582334518433,
-0.21641938388347626,
-1.743735909461975,
-0.12672922015190125,
-0.6590285897254944,
0.3011372685432434,
-1.925242304801941,
-0.08935656398534775,
-1.9256062507629395,
-2.1908071041107178,
-1.4135819673538208,
-0.9272284507751465,
1.0096676349639893,
0.1357504427433014,
-0.8525135517120361,
1.0779420137405396,
-0.408937931060791,
-1.7833393812179565,
1.1416974067687988,
-2.195779323577881
] |
https://github.com/huggingface/datasets/issues/5098 | Classes label error when loading symbolic links using imagefolder | > Hi, thanks for reporting and suggesting a fix! We still need to account for `.`/`..` in the file path, so a more robust fix would be `Path(os.path.abspath(filepath))`.
Thanks for your reply! | **Is your feature request related to a problem? Please describe.**
Like this: #4015
When there are **symbolic links** to pictures in the data folder, the parent folder name of the **real file** will be used as the class name instead of the parent folder of the symbolic link itself. Can you give an option to decide whether to enable symbolic link tracking?
This is inconsistent with the `torchvision.datasets.ImageFolder` behavior.
For example:


It use `others` in green circle as class label but not `abnormal`, I wish `load_dataset` not use the real file parent as label.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context about the feature request here.
| 482 | 32 | Classes label error when loading symbolic links using imagefolder
**Is your feature request related to a problem? Please describe.**
Like this: #4015
When there are **symbolic links** to pictures in the data folder, the parent folder name of the **real file** will be used as the class name instead of the parent folder of the symbolic link itself. Can you give an option to decide whether to enable symbolic link tracking?
This is inconsistent with the `torchvision.datasets.ImageFolder` behavior.
For example:


It use `others` in green circle as class label but not `abnormal`, I wish `load_dataset` not use the real file parent as label.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context about the feature request here.
> Hi, thanks for reporting and suggesting a fix! We still need to account for `.`/`..` in the file path, so a more robust fix would be `Path(os.path.abspath(filepath))`.
Thanks for your reply! | [
-1.1994636058807373,
-0.9461085796356201,
-0.7003539204597473,
1.3860255479812622,
-0.15812063217163086,
-1.2589495182037354,
0.12090348452329636,
-1.023661494255066,
1.7250666618347168,
-0.7083863019943237,
0.2901284694671631,
-1.6932101249694824,
0.022511616349220276,
-0.5460893511772156,
-0.8352299332618713,
-0.8169980049133301,
-0.4446377754211426,
-0.8688057065010071,
0.9679054021835327,
2.5502359867095947,
1.2197281122207642,
-1.4844591617584229,
2.719712018966675,
0.6411543488502502,
-0.2224029302597046,
-1.0045284032821655,
0.36818957328796387,
0.06750661879777908,
-1.2742582559585571,
-0.46592238545417786,
-0.9214550256729126,
-0.04258985072374344,
-0.5526252388954163,
-0.5682979226112366,
0.07929228991270065,
0.3200586140155792,
-0.1954444944858551,
-0.4021773040294647,
-0.5604925155639648,
-0.7269324660301208,
0.49755987524986267,
-0.4615003764629364,
0.9040505290031433,
-0.39711183309555054,
1.7490112781524658,
-0.6766621470451355,
0.3499016761779785,
0.7249491810798645,
1.3621959686279297,
0.21789175271987915,
-0.0846923366189003,
0.3943134546279907,
0.4455612599849701,
-0.08513271808624268,
0.43205901980400085,
1.2090702056884766,
0.6504772901535034,
0.5001996159553528,
0.7436127662658691,
-2.199526071548462,
1.383991003036499,
-1.0274258852005005,
0.2062627673149109,
1.4200143814086914,
-1.056131362915039,
0.39197972416877747,
-1.9168885946273804,
-0.057594072073698044,
0.49936214089393616,
-2.3330953121185303,
0.16669780015945435,
-1.3196616172790527,
-0.5771312713623047,
0.9765534996986389,
0.22394347190856934,
-1.3568599224090576,
0.15997466444969177,
-0.4575578570365906,
0.9724481701850891,
0.38133278489112854,
1.1511576175689697,
-1.7884984016418457,
-0.18524307012557983,
-0.2586808502674103,
0.1302088499069214,
-1.2496095895767212,
-1.5288969278335571,
0.5523843765258789,
0.5992377996444702,
0.5443422794342041,
-0.14085140824317932,
0.9897084832191467,
-0.9629822969436646,
0.8687690496444702,
-1.053220510482788,
-1.6943247318267822,
-1.3897351026535034,
-2.17333722114563,
-2.1915454864501953,
0.9146711230278015,
-0.4429013133049011,
-0.5233404636383057,
1.9676135778427124,
-1.037947416305542,
-1.721850872039795,
1.1350889205932617,
0.27748024463653564,
-0.012187041342258453,
2.405121326446533,
0.19746112823486328,
-0.7204040884971619,
0.4198492467403412,
-0.7533562183380127,
0.8414275646209717,
-0.48279282450675964,
1.4087634086608887,
0.47166118025779724,
-1.0421446561813354,
1.5863769054412842,
-0.3974551260471344,
0.5676052570343018,
-0.6978563666343689,
-0.5157791376113892,
-0.7683097720146179,
0.4517327547073364,
1.9332243204116821,
-0.2911429703235626,
1.4999498128890991,
-0.33092403411865234,
-1.6196010112762451,
-1.4455535411834717,
0.8977423310279846,
0.5754829049110413,
-0.8568408489227295,
0.08514723181724548,
-0.32877418398857117,
0.13643750548362732,
-0.005573577247560024,
0.997107744216919,
1.2495754957199097,
0.7747412919998169,
-0.3160930871963501,
-0.8863377571105957,
0.18711739778518677,
-0.09713427722454071,
-0.7126227021217346,
-1.8573243618011475,
-0.3281709551811218,
0.1487717628479004,
0.6528021097183228,
-1.2690800428390503,
1.6597548723220825,
0.8910039067268372,
1.954940676689148,
0.9768693447113037,
-0.393318772315979,
1.5453746318817139,
0.06767246127128601,
1.919148325920105,
-0.5131106972694397,
0.7307655811309814,
-0.2911052703857422,
-1.1241812705993652,
0.8249861598014832,
-0.37873879075050354,
-2.0548768043518066,
-0.6200377345085144,
-0.7568020224571228,
-0.20206564664840698,
-0.7739771604537964,
0.8856338262557983,
-0.23032981157302856,
-1.354421615600586,
0.2976100742816925,
-0.7098637819290161,
0.1313195824623108,
-1.2702157497406006,
0.3280007839202881,
0.7668980360031128,
-0.6214771866798401,
0.03533805534243584,
-0.2941603660583496,
-1.3314740657806396,
-0.5838032960891724,
0.25029462575912476,
1.870448350906372,
-0.7586591243743896,
0.974273145198822,
0.953217625617981,
-0.6810833215713501,
-0.01641831547021866,
0.40505316853523254,
-0.28976601362228394,
0.9032632112503052,
-1.1187596321105957,
-0.3482644259929657,
1.0778682231903076,
-0.15807446837425232,
-0.46813568472862244,
1.4357727766036987,
0.7286895513534546,
-0.9922096133232117,
-0.26077044010162354,
-0.23891568183898926,
-0.8174440860748291,
0.054990507662296295,
-1.6402866840362549,
-0.19048628211021423,
0.27686530351638794,
-1.4910109043121338,
-0.4913385212421417,
-0.18588852882385254,
1.367380142211914,
-0.16931506991386414,
1.3579825162887573,
-0.3417595326900482,
-0.31975510716438293,
-0.404110312461853,
-0.30855387449264526,
0.16821032762527466,
-0.26232820749282837,
-0.6563659310340881,
0.2722218930721283,
-0.7415579557418823,
0.36262211203575134,
1.455694556236267,
0.43955349922180176,
-0.025691689923405647,
0.47538432478904724,
1.1040072441101074,
0.24924302101135254,
-0.09092153608798981,
-0.8870176076889038,
-1.5494801998138428,
2.0491061210632324,
-1.5148874521255493,
1.9544364213943481,
0.7935695052146912,
-0.04252559319138527,
-1.6677948236465454,
-1.8822904825210571,
1.4152839183807373,
1.2311158180236816,
2.4442248344421387,
0.645030677318573,
0.46093466877937317,
-0.7745273113250732,
-0.6463251709938049,
0.3264388144016266,
-1.0284614562988281,
-0.7701004147529602,
0.1480245590209961,
2.373908281326294,
1.7175471782684326,
-0.5338112711906433,
-0.20368850231170654,
-1.067833662033081,
1.4026641845703125,
-0.11920647323131561,
0.1723739206790924,
2.000377893447876,
-0.24816980957984924,
-1.1366544961929321,
1.2367607355117798,
-2.2094101905822754,
0.1666516661643982,
1.9990359544754028,
0.34995323419570923,
0.050810862332582474,
-1.4197752475738525,
-0.6672484278678894,
-0.3152029812335968,
-0.39345672726631165,
-1.2809946537017822,
0.4829750955104828,
-0.33210110664367676,
-0.7812780141830444,
-1.5271625518798828,
0.091588094830513,
-1.1415389776229858,
-1.6223392486572266,
0.29568907618522644,
1.8948131799697876,
1.9634333848953247,
-0.7130589485168457,
1.501119613647461,
-0.3221287131309509,
0.09279816597700119,
1.2544680833816528,
1.16470205783844,
3.173384428024292,
1.9031428098678589,
-1.1851359605789185,
0.5960613489151001,
-0.24177446961402893,
-0.4026135504245758,
1.069337248802185,
-1.1007708311080933,
1.2313939332962036,
-0.16375583410263062,
-1.1977533102035522,
-1.1873435974121094,
0.9579325914382935,
0.45541858673095703,
0.028595097362995148,
-0.5324628353118896,
1.1229832172393799,
0.07156970351934433,
1.3433806896209717,
0.4937908947467804,
-0.3104141056537628,
0.683656632900238,
-0.44866326451301575,
-0.494907408952713,
1.678365707397461,
0.24114853143692017,
-1.423149824142456,
-2.348860740661621,
-0.20847102999687195,
-0.8452358245849609,
0.07991642504930496,
-0.6008105874061584,
-1.0196704864501953,
1.7175240516662598,
0.4548814594745636,
-1.2922945022583008,
-0.3046600818634033,
-0.36850449442863464,
-0.6530217528343201,
2.6493051052093506,
-1.4622443914413452,
-0.1865815818309784,
-0.9031049609184265,
-0.5155211091041565,
1.6239351034164429,
-1.2077429294586182,
-0.182580828666687,
-0.9700396060943604,
-0.5379117727279663,
-1.2107497453689575,
-0.5962767004966736,
-0.11628259718418121,
-0.8675799369812012,
0.7694686055183411,
0.16506901383399963,
-1.214513897895813,
-0.3500642478466034,
-0.8670505881309509,
0.6855339407920837,
-0.1057291030883789,
0.21332523226737976,
1.8974394798278809,
0.45029884576797485,
-0.37525609135627747,
0.6996839046478271,
1.1400878429412842,
0.5942237377166748,
-0.5652425289154053,
0.19413357973098755,
-0.6506244540214539,
0.31658437848091125,
-1.2343087196350098,
0.26027804613113403,
-2.9177956581115723,
0.6428021788597107,
-0.035797830671072006,
0.0321139395236969,
0.010704440996050835,
-1.2480368614196777,
1.135278582572937,
2.5874862670898438,
-1.1502363681793213,
0.5164790749549866,
0.27146676182746887,
1.1733198165893555,
-1.573606252670288,
0.28516873717308044,
-0.31440889835357666,
2.1631646156311035,
0.208529531955719,
1.1787525415420532,
-0.5746796727180481,
-2.2905359268188477,
0.5191366076469421,
-1.1619361639022827,
-1.175731897354126,
0.6393489241600037,
-0.7509991526603699,
0.005026680417358875,
-1.5045756101608276,
-0.18952742218971252,
-0.8219059705734253,
-1.1919283866882324,
0.7744266390800476,
0.0983569473028183,
0.491531103849411,
-0.6163308620452881,
0.3476724624633789,
-2.1350595951080322,
-1.3856768608093262,
-0.30576083064079285,
-0.9401312470436096,
0.4976445138454437,
-0.27883774042129517,
0.7146583795547485,
-0.10059648007154465,
0.0763336569070816,
0.340318888425827,
1.402539849281311,
3.3456437587738037,
0.17783701419830322,
0.4523809552192688,
-0.15197962522506714,
-0.89267498254776,
1.4474577903747559,
0.9725735187530518,
0.0018309364095330238,
-0.6304044127464294,
-1.056562900543213,
1.285749077796936,
1.9229636192321777,
0.9320283532142639,
0.09782667458057404,
-0.8025034070014954,
-0.7200333476066589,
0.008761335164308548,
0.16090556979179382,
0.4889931082725525,
0.9583469033241272,
0.08145734667778015,
0.022154873237013817,
1.4304275512695312,
1.2435117959976196,
-0.5019580721855164,
0.44785699248313904,
-0.8152374029159546,
-0.4158993065357208,
0.43035003542900085,
0.35665932297706604,
-0.01988043822348118,
0.29264384508132935,
-0.9777039289474487,
-0.2413744032382965,
-0.29838326573371887,
-1.035876750946045,
-0.7537198066711426,
-0.409573495388031,
-0.3945467472076416,
1.7458723783493042,
0.1387653946876526,
-0.4099105894565582,
-0.09970980137586594,
-0.7828777432441711,
-0.07006581127643585,
-1.0384169816970825,
0.382544606924057,
-0.10949407517910004,
-0.06911148875951767,
-0.08394356071949005,
1.8060890436172485,
-0.8683041334152222,
-2.070863723754883,
0.26430049538612366,
0.23511067032814026,
-0.539286732673645,
0.16481143236160278,
1.6606104373931885,
0.5927963852882385,
1.4806686639785767,
1.397101640701294,
1.0010758638381958,
-0.6516879796981812,
-1.3173069953918457,
0.6175102591514587,
0.9021953344345093,
-1.4309955835342407,
0.8104657530784607,
0.07963783293962479,
-0.4296460747718811,
0.7136426568031311,
1.4270427227020264,
0.4195244312286377,
-2.0181307792663574,
0.8421580791473389,
-0.8565170168876648,
0.7582021355628967,
0.7103161811828613,
0.6852086186408997,
0.18019211292266846,
0.8248359560966492,
-1.2861443758010864,
-1.1349589824676514,
-0.8167425394058228,
-0.6123913526535034,
2.0111501216888428,
-0.24992963671684265,
0.490719735622406,
-0.1995205581188202,
-1.3071820735931396,
-0.09470568597316742,
0.6917268633842468,
0.48269081115722656,
-0.32110947370529175,
0.7174858450889587,
-0.6211764216423035,
-1.145612359046936,
-1.4077194929122925,
-0.5197133421897888,
-0.944940447807312,
-0.9058806300163269,
0.9620957374572754,
0.8906170725822449,
0.36896783113479614,
1.870302677154541,
0.6460033059120178,
0.1556372046470642,
-2.6214797496795654,
0.8695315718650818,
0.3443681001663208,
-0.06006360799074173,
1.0690542459487915,
0.2687430679798126,
0.9915704727172852,
-0.026798777282238007,
0.4884960651397705,
-2.4134435653686523,
2.2353017330169678,
-0.25297555327415466,
0.8154299259185791,
0.02744443342089653,
-0.17655599117279053,
1.1393303871154785,
0.498492032289505,
0.53280109167099,
-1.1383326053619385,
0.7481868863105774,
-0.6164442896842957,
1.22586190700531,
0.8236109018325806,
-0.7458782196044922,
-0.007376840803772211,
1.2256155014038086,
0.42589038610458374,
-0.48190584778785706,
-0.9507960081100464,
-0.9747860431671143,
0.8978380560874939,
1.8429741859436035,
-0.10456504672765732,
0.05050702393054962,
0.7780815362930298,
0.7020336985588074,
-1.2963913679122925,
0.12254638224840164,
-0.7870145440101624,
-0.7553519606590271,
1.6667048931121826,
2.115694999694824,
-0.026488641276955605,
-0.2706243395805359,
-0.6381433010101318,
-1.2553298473358154,
0.8056715726852417,
0.1051291897892952,
0.15958240628242493,
0.6644216775894165,
-0.6743107438087463,
1.1894863843917847,
0.9081164598464966,
0.9457417726516724,
0.1764357089996338,
0.38396838307380676,
0.3786793351173401,
-0.33683106303215027,
-1.150373101234436,
-0.2769528925418854,
-1.1875673532485962,
-2.4877939224243164,
0.459856778383255,
-0.2321707308292389,
-1.4056274890899658,
0.06444862484931946,
-1.0030920505523682,
0.8321740627288818,
-0.566306471824646,
-1.1691421270370483,
-1.5779218673706055,
0.19983616471290588,
-0.11590121686458588,
0.8970379829406738,
-1.5954004526138306,
-0.15364372730255127,
1.2469550371170044,
0.9157230854034424,
-0.560269832611084,
0.9111425876617432,
0.23497775197029114,
1.043495774269104,
0.9139847755432129,
-0.38491103053092957,
0.35444217920303345,
0.08056946843862534,
-1.2845938205718994,
0.5182939171791077,
1.2150205373764038,
0.2006739377975464,
1.4563615322113037,
-0.5725268125534058,
0.06216725707054138,
0.40760090947151184,
-0.424897700548172,
-0.4494742751121521,
-0.5631300210952759,
0.7358366847038269,
0.026515226811170578,
-0.9773553013801575,
0.09217160195112228,
-0.07842381298542023,
-0.12070358544588089,
0.2279784083366394,
-1.463697075843811,
-0.2003844976425171,
-0.3810277581214905,
-0.493289589881897,
-1.2661091089248657,
-0.12844741344451904,
1.295398473739624,
-0.7657557725906372,
-0.17489370703697205,
0.5380209684371948,
0.44618192315101624,
0.5857734084129333,
0.611412763595581,
-0.6225347518920898,
-0.4612219035625458,
-0.2953069508075714,
-0.4130612313747406,
0.26861533522605896,
1.2195565700531006,
-0.10501082986593246,
-0.9223557710647583,
0.6664802432060242,
-0.4074138402938843,
0.03383844345808029,
1.922536015510559,
0.025134727358818054,
-0.7873217463493347,
0.3980763256549835,
-0.7075760364532471,
1.8700867891311646,
1.6973546743392944,
1.2871222496032715,
-0.05234876275062561,
-1.015551209449768,
0.5733109712600708,
-0.1998940408229828,
-0.44811922311782837,
0.9507745504379272,
0.49288561940193176,
-0.21415674686431885,
-1.409484624862671,
0.5773928761482239,
1.3104095458984375,
-0.869605541229248,
-0.7978236675262451,
0.13358667492866516,
-0.8107789158821106,
1.0650845766067505,
0.7488592267036438,
0.436297744512558,
0.2534608244895935,
1.7504767179489136,
0.690315842628479,
-0.42361196875572205,
0.5310794115066528,
0.48450446128845215,
-0.2420896291732788,
-2.164618968963623,
-1.2442445755004883,
0.21606937050819397,
-0.37035903334617615,
-1.4873210191726685,
1.3302597999572754,
-1.161625623703003,
-0.9329922795295715,
0.5203151702880859,
0.15183022618293762,
1.4716956615447998,
0.2458702027797699,
1.6321865320205688,
2.1124985218048096,
0.9108680486679077,
0.30382871627807617,
1.3112711906433105,
-0.055828165262937546,
-0.5060446858406067,
1.867941975593567,
-0.46039098501205444,
0.4763122797012329,
1.1067394018173218,
-0.33524075150489807,
-1.1364003419876099,
-0.794608473777771,
-1.1503262519836426,
-0.7269455194473267,
1.08945894241333,
0.10396018624305725,
-1.2134284973144531,
0.1371166706085205,
1.5531446933746338,
0.16784149408340454,
-0.29167914390563965,
0.4809994101524353,
0.48211684823036194,
-0.7612003684043884,
-0.11141850054264069,
-1.0199073553085327,
0.43201497197151184,
-0.16140612959861755,
-0.3702666163444519,
0.29828885197639465,
0.5098493099212646,
1.199047565460205,
-0.012387829832732677,
0.06789366155862808,
1.1900696754455566,
-1.45416259765625,
1.4150499105453491,
-0.704858124256134,
0.2540909945964813,
-2.3241589069366455,
1.479324460029602,
-0.7916281223297119,
1.9596056938171387,
-2.6603543758392334,
0.3938198387622833,
-0.5804222226142883,
-0.4108372926712036,
0.32228100299835205,
-0.31873637437820435,
0.23883292078971863,
-0.10032321512699127,
-1.1115864515304565,
-0.11765310168266296,
-0.791391134262085,
0.5647978186607361,
1.179268717765808,
1.4172017574310303,
-1.1119040250778198,
-0.21184879541397095,
-1.7391583919525146,
-0.11504572629928589,
-0.6667072176933289,
0.30097225308418274,
-1.9253911972045898,
-0.09220488369464874,
-1.9316482543945312,
-2.1957521438598633,
-1.4173531532287598,
-0.9123097658157349,
1.0025352239608765,
0.13214918971061707,
-0.861740231513977,
1.0910831689834595,
-0.40148985385894775,
-1.776445746421814,
1.1342947483062744,
-2.192695140838623
] |
https://github.com/huggingface/datasets/issues/5097 | Fatal error with pyarrow/libarrow.so | Thanks for reporting, @catalys1.
This seems a duplicate of:
- #3310
The source of the problem is in PyArrow:
- [ARROW-15141: [C++] Fatal error condition occurred in aws_thread_launch](https://issues.apache.org/jira/browse/ARROW-15141)
- [ARROW-17501: [C++] Fatal error condition occurred in aws_thread_launch](https://issues.apache.org/jira/browse/ARROW-17501)
The bug in their dependency is still unresolved:
- https://github.com/aws/aws-sdk-cpp/issues/1809
Apparently, the `aws-sdk-cpp` PyArrow dependency needs to be pinned at version `1.8.186` if using conda. Have you updated it after installing PyArrow?
```shell
conda list aws-sdk-cpp
```
Maybe you should try to downgrade it to that version:
```shell
conda install -c conda-forge aws-sdk-cpp=1.8.186
``` | ## Describe the bug
When using datasets, at the very end of my jobs the program crashes (see trace below).
It doesn't seem to affect anything, as it appears to happen as the program is closing down. Just importing `datasets` is enough to cause the error.
## Steps to reproduce the bug
This is sufficient to reproduce the problem:
```bash
python -c "import datasets"
```
## Expected results
Program should run to completion without an error.
## Actual results
```bash
Fatal error condition occurred in /opt/vcpkg/buildtrees/aws-c-io/src/9e6648842a-364b708815.clean/source/event_loop.c:72: aws_thread_launch(&cleanup_thread, s_event_loop_destroy_async_thread_fn, el_group, &thread_options) == AWS_OP_SUCCESS
Exiting Application
################################################################################
Stack trace:
################################################################################
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x200af06) [0x150dff547f06]
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x20028e5) [0x150dff53f8e5]
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x1f27e09) [0x150dff464e09]
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x200ba3d) [0x150dff548a3d]
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x1f25948) [0x150dff462948]
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x200ba3d) [0x150dff548a3d]
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x1ee0b46) [0x150dff41db46]
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x194546a) [0x150dfee8246a]
/lib64/libc.so.6(+0x39b0c) [0x150e15eadb0c]
/lib64/libc.so.6(on_exit+0) [0x150e15eadc40]
/u/user/miniconda3/envs/env/bin/python(+0x28db18) [0x560ae370eb18]
/u/user/miniconda3/envs/env/bin/python(+0x28db4b) [0x560ae370eb4b]
/u/user/miniconda3/envs/env/bin/python(+0x28db90) [0x560ae370eb90]
/u/user/miniconda3/envs/env/bin/python(_PyRun_SimpleFileObject+0x1e6) [0x560ae37123e6]
/u/user/miniconda3/envs/env/bin/python(_PyRun_AnyFileObject+0x44) [0x560ae37124c4]
/u/user/miniconda3/envs/env/bin/python(Py_RunMain+0x35d) [0x560ae37135bd]
/u/user/miniconda3/envs/env/bin/python(Py_BytesMain+0x39) [0x560ae37137d9]
/lib64/libc.so.6(__libc_start_main+0xf3) [0x150e15e97493]
/u/user/miniconda3/envs/env/bin/python(+0x2125d4) [0x560ae36935d4]
Aborted (core dumped)
```
## Environment info
- `datasets` version: 2.5.1
- Platform: Linux-4.18.0-348.23.1.el8_5.x86_64-x86_64-with-glibc2.28
- Python version: 3.10.4
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
| 483 | 91 | Fatal error with pyarrow/libarrow.so
## Describe the bug
When using datasets, at the very end of my jobs the program crashes (see trace below).
It doesn't seem to affect anything, as it appears to happen as the program is closing down. Just importing `datasets` is enough to cause the error.
## Steps to reproduce the bug
This is sufficient to reproduce the problem:
```bash
python -c "import datasets"
```
## Expected results
Program should run to completion without an error.
## Actual results
```bash
Fatal error condition occurred in /opt/vcpkg/buildtrees/aws-c-io/src/9e6648842a-364b708815.clean/source/event_loop.c:72: aws_thread_launch(&cleanup_thread, s_event_loop_destroy_async_thread_fn, el_group, &thread_options) == AWS_OP_SUCCESS
Exiting Application
################################################################################
Stack trace:
################################################################################
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x200af06) [0x150dff547f06]
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x20028e5) [0x150dff53f8e5]
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x1f27e09) [0x150dff464e09]
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x200ba3d) [0x150dff548a3d]
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x1f25948) [0x150dff462948]
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x200ba3d) [0x150dff548a3d]
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x1ee0b46) [0x150dff41db46]
/u/user/miniconda3/envs/env/lib/python3.10/site-packages/pyarrow/libarrow.so.900(+0x194546a) [0x150dfee8246a]
/lib64/libc.so.6(+0x39b0c) [0x150e15eadb0c]
/lib64/libc.so.6(on_exit+0) [0x150e15eadc40]
/u/user/miniconda3/envs/env/bin/python(+0x28db18) [0x560ae370eb18]
/u/user/miniconda3/envs/env/bin/python(+0x28db4b) [0x560ae370eb4b]
/u/user/miniconda3/envs/env/bin/python(+0x28db90) [0x560ae370eb90]
/u/user/miniconda3/envs/env/bin/python(_PyRun_SimpleFileObject+0x1e6) [0x560ae37123e6]
/u/user/miniconda3/envs/env/bin/python(_PyRun_AnyFileObject+0x44) [0x560ae37124c4]
/u/user/miniconda3/envs/env/bin/python(Py_RunMain+0x35d) [0x560ae37135bd]
/u/user/miniconda3/envs/env/bin/python(Py_BytesMain+0x39) [0x560ae37137d9]
/lib64/libc.so.6(__libc_start_main+0xf3) [0x150e15e97493]
/u/user/miniconda3/envs/env/bin/python(+0x2125d4) [0x560ae36935d4]
Aborted (core dumped)
```
## Environment info
- `datasets` version: 2.5.1
- Platform: Linux-4.18.0-348.23.1.el8_5.x86_64-x86_64-with-glibc2.28
- Python version: 3.10.4
- PyArrow version: 9.0.0
- Pandas version: 1.4.3
Thanks for reporting, @catalys1.
This seems a duplicate of:
- #3310
The source of the problem is in PyArrow:
- [ARROW-15141: [C++] Fatal error condition occurred in aws_thread_launch](https://issues.apache.org/jira/browse/ARROW-15141)
- [ARROW-17501: [C++] Fatal error condition occurred in aws_thread_launch](https://issues.apache.org/jira/browse/ARROW-17501)
The bug in their dependency is still unresolved:
- https://github.com/aws/aws-sdk-cpp/issues/1809
Apparently, the `aws-sdk-cpp` PyArrow dependency needs to be pinned at version `1.8.186` if using conda. Have you updated it after installing PyArrow?
```shell
conda list aws-sdk-cpp
```
Maybe you should try to downgrade it to that version:
```shell
conda install -c conda-forge aws-sdk-cpp=1.8.186
``` | [
-0.7422078847885132,
-0.9154523015022278,
-0.8421630859375,
1.6223102807998657,
0.012581276707351208,
-1.357842206954956,
0.2809121012687683,
-0.8147431015968323,
1.480292797088623,
-0.6441372632980347,
-0.04173782840371132,
-1.669677734375,
-0.11438994854688644,
-0.6999331116676331,
-0.4060191810131073,
-0.8041210174560547,
-0.24764616787433624,
-0.4952978491783142,
1.1978673934936523,
2.817565441131592,
1.3446086645126343,
-0.9010075330734253,
2.719160556793213,
0.700105607509613,
-0.44399717450141907,
-0.6965538263320923,
0.5347270369529724,
-0.059775955975055695,
-1.3821367025375366,
-0.5609503984451294,
-0.9260749220848083,
-0.07658839225769043,
-0.16660034656524658,
-0.43842142820358276,
0.012214447371661663,
0.7165088653564453,
-0.2462463229894638,
-0.6584912538528442,
-0.6681610345840454,
-0.871679961681366,
0.21114803850650787,
-0.5851336717605591,
0.960451602935791,
-0.261648029088974,
1.9380862712860107,
-0.6751700043678284,
0.5102007985115051,
0.5283746123313904,
1.283349871635437,
0.045008864253759384,
-0.11475466191768646,
0.4336070716381073,
0.38211867213249207,
-0.09172073006629944,
0.4994376003742218,
1.0932859182357788,
0.6532454490661621,
0.5402387380599976,
0.5777064561843872,
-2.0204532146453857,
1.0725986957550049,
-0.5637314915657043,
0.3772417902946472,
1.2292661666870117,
-1.2065770626068115,
0.4686098098754883,
-1.382364273071289,
-0.023005664348602295,
0.5564988255500793,
-2.096238851547241,
0.3649689853191376,
-1.2414438724517822,
-0.6623904705047607,
0.9550307393074036,
0.43351370096206665,
-1.4201511144638062,
-0.37172746658325195,
-0.6825022101402283,
1.168695092201233,
0.4297292232513428,
0.9214525818824768,
-1.705234169960022,
-0.2924266755580902,
-0.09008729457855225,
-0.2797573506832123,
-1.2755664587020874,
-1.6371517181396484,
0.409837543964386,
0.9711113572120667,
0.7965603470802307,
0.045622628182172775,
0.8125553727149963,
-1.0034255981445312,
0.5658108592033386,
-0.7170333862304688,
-2.1274571418762207,
-1.338644027709961,
-2.506324052810669,
-2.2573583126068115,
0.6757214665412903,
-0.31304094195365906,
-0.5422513484954834,
2.0530059337615967,
-0.7891626358032227,
-1.900402545928955,
1.2661155462265015,
0.01950540766119957,
-0.28136715292930603,
2.375218391418457,
0.5717325806617737,
-0.6785327792167664,
0.28480789065361023,
-0.7483130097389221,
0.6887235045433044,
-1.1478300094604492,
1.1098192930221558,
-0.004276704043149948,
-1.0721317529678345,
1.5241029262542725,
-0.5253356695175171,
0.6877852082252502,
-0.9843064546585083,
-0.14634908735752106,
-0.8500258922576904,
0.3096623718738556,
2.046525001525879,
-0.48148313164711,
1.5845897197723389,
-0.22127753496170044,
-1.5546700954437256,
-1.6237571239471436,
0.6807585954666138,
0.15597793459892273,
-0.6063305139541626,
0.43074941635131836,
-0.355062335729599,
0.05841977149248123,
-0.05992330238223076,
0.8579519987106323,
1.3380752801895142,
0.3509393036365509,
-0.3159324824810028,
-0.7475212812423706,
0.5709058046340942,
-0.10611841082572937,
-0.654473602771759,
-1.493462085723877,
-0.24459540843963623,
0.13682542741298676,
0.507068395614624,
-1.2969825267791748,
1.6703473329544067,
0.4917580783367157,
2.136719226837158,
1.0180596113204956,
-0.2990717887878418,
1.3640844821929932,
0.32395482063293457,
1.8502395153045654,
-0.4340461790561676,
0.7323014140129089,
-0.3869565427303314,
-1.2260059118270874,
0.7493860721588135,
-0.6467969417572021,
-1.722622275352478,
-0.6866311430931091,
-0.8763217926025391,
-0.015441564843058586,
-0.7827604413032532,
0.8204978704452515,
-0.21823783218860626,
-1.1128596067428589,
0.1335446536540985,
-1.1022272109985352,
0.314668208360672,
-1.5833253860473633,
0.17259187996387482,
0.9024185538291931,
-0.30034542083740234,
0.3080405294895172,
-0.3886144161224365,
-1.2479766607284546,
-0.21511876583099365,
0.5781304240226746,
1.9088083505630493,
-0.6224367022514343,
0.9658875465393066,
0.8447049260139465,
-0.5843315720558167,
0.02386399731040001,
0.39091309905052185,
-0.46073073148727417,
0.9558961987495422,
-1.2797958850860596,
-0.13036616146564484,
1.3654078245162964,
-0.5063517689704895,
-0.6780139803886414,
1.2593623399734497,
0.7983689308166504,
-1.2523585557937622,
-0.23288686573505402,
0.024722479283809662,
-0.9555829763412476,
0.13662295043468475,
-1.8866151571273804,
-0.013336443342268467,
0.5198220610618591,
-1.4310460090637207,
-0.7305590510368347,
-0.3843647837638855,
1.195570707321167,
0.24161387979984283,
1.4855684041976929,
-0.34494784474372864,
-0.15212590992450714,
-0.3402402997016907,
-0.5693143010139465,
0.014361859299242496,
-0.5977864265441895,
-0.3982439339160919,
0.05717157572507858,
-0.4614794850349426,
0.1395946741104126,
1.460254192352295,
0.08713676035404205,
0.32625553011894226,
0.7779860496520996,
0.9474818110466003,
0.3730609118938446,
-0.6101399660110474,
-0.8273085951805115,
-1.6562315225601196,
1.8459482192993164,
-1.0884751081466675,
1.8980427980422974,
1.1187819242477417,
0.058486610651016235,
-1.9267908334732056,
-2.13570499420166,
1.2068936824798584,
1.1726205348968506,
2.1394786834716797,
0.5861044526100159,
0.7608898878097534,
-0.8594409227371216,
-0.7382538914680481,
-0.23837868869304657,
-1.0674924850463867,
-0.7792572975158691,
0.18075832724571228,
2.4482758045196533,
1.827696442604065,
-0.27560505270957947,
-0.14193928241729736,
-1.1707217693328857,
1.3031408786773682,
-0.296225905418396,
0.07138808816671371,
1.8878449201583862,
-0.1851586550474167,
-0.43394386768341064,
0.7366139888763428,
-2.1460747718811035,
0.1752784699201584,
1.9244426488876343,
-0.22313357889652252,
0.22364568710327148,
-1.31400465965271,
-0.8541784286499023,
-0.40349361300468445,
0.25946900248527527,
-1.0292755365371704,
0.5776619911193848,
-0.11452387273311615,
-0.5235178470611572,
-1.5599321126937866,
0.2771551012992859,
-0.7593098282814026,
-1.612956166267395,
-0.15681076049804688,
2.1500000953674316,
1.7788512706756592,
-1.0474636554718018,
1.6196407079696655,
-0.09441222250461578,
-0.009711779654026031,
1.341872215270996,
1.1896922588348389,
3.267338275909424,
2.211211919784546,
-1.2852184772491455,
0.8634893894195557,
0.21374917030334473,
-0.1705312728881836,
1.165399432182312,
-1.0925202369689941,
1.2849870920181274,
-0.283317506313324,
-1.4491910934448242,
-1.2528166770935059,
0.845440149307251,
0.6047673225402832,
-0.16906794905662537,
-0.37050169706344604,
1.4728142023086548,
-0.073775514960289,
1.456502914428711,
0.7623212933540344,
-0.5880891680717468,
0.7131531238555908,
-0.14404010772705078,
-0.13441549241542816,
1.4699980020523071,
0.5104565620422363,
-1.529936671257019,
-2.346543312072754,
-0.23991917073726654,
-0.9834135174751282,
-0.1576317399740219,
-0.8568429946899414,
-1.169944405555725,
1.4404692649841309,
0.7270963191986084,
-0.7629461884498596,
-0.6371627449989319,
-0.0013363808393478394,
-0.5902765989303589,
2.7934720516204834,
-1.6623165607452393,
-0.40681853890419006,
-1.1518455743789673,
-0.4043079614639282,
1.7563461065292358,
-1.360931396484375,
-0.4171469807624817,
-1.0960991382598877,
-0.6648333072662354,
-0.8261055946350098,
-0.6582533121109009,
-0.002389803994446993,
-0.926507830619812,
0.9563650488853455,
-0.016293000429868698,
-1.3586993217468262,
0.34188711643218994,
-1.1054046154022217,
1.042809009552002,
-0.19065991044044495,
0.1235855221748352,
1.857367992401123,
0.44593632221221924,
-0.5832688212394714,
0.9762759804725647,
1.272982120513916,
0.45801064372062683,
-1.0350936651229858,
0.06010810285806656,
-0.6837336421012878,
0.24310614168643951,
-1.2810943126678467,
0.1962885856628418,
-2.6885690689086914,
0.30651652812957764,
-0.3667469024658203,
-0.08063237369060516,
0.20641803741455078,
-1.2340753078460693,
1.020053505897522,
2.287696123123169,
-1.2553699016571045,
0.5247635841369629,
0.34755608439445496,
1.732816219329834,
-1.7889108657836914,
0.48123234510421753,
-0.3979630172252655,
1.8554953336715698,
0.1154775321483612,
1.2016541957855225,
-0.3016681969165802,
-2.0120413303375244,
0.5321599245071411,
-1.3000352382659912,
-1.0069990158081055,
0.8208701610565186,
-0.8442145586013794,
-0.16666267812252045,
-1.3213104009628296,
-0.15995845198631287,
-0.14035747945308685,
-1.5047962665557861,
0.34202709794044495,
-0.17521654069423676,
0.4355182945728302,
-0.41488003730773926,
0.20098048448562622,
-2.026252508163452,
-1.3265517950057983,
-0.30740833282470703,
-0.8145627379417419,
-0.027102932333946228,
-0.4912082552909851,
0.8225743770599365,
-0.511677086353302,
0.032816383987665176,
0.0851544588804245,
1.4150192737579346,
3.43074631690979,
0.2193583846092224,
0.18748916685581207,
-0.05077403411269188,
-0.8215451836585999,
1.1912922859191895,
0.7094483375549316,
-0.4530661702156067,
-0.6021158695220947,
-0.8524727821350098,
1.4543529748916626,
1.888700008392334,
1.142001748085022,
0.2515375018119812,
-0.7307064533233643,
-0.7885162234306335,
-0.26107752323150635,
0.1114468052983284,
0.21103881299495697,
0.7723362445831299,
0.23871856927871704,
0.07940308749675751,
1.4699689149856567,
1.1660406589508057,
-0.4712826609611511,
0.6486058235168457,
-0.8962054252624512,
-0.4708655774593353,
0.3141004741191864,
0.3536141812801361,
-0.008387892507016659,
-0.064997099339962,
-1.1167443990707397,
-0.3825482428073883,
-0.5863565802574158,
-0.7054876685142517,
-0.9420682191848755,
-0.10969622433185577,
-0.0999113991856575,
1.721365213394165,
0.08282946050167084,
-0.5241045355796814,
-0.026918362826108932,
-0.39178088307380676,
0.0712050125002861,
-0.9725412726402283,
0.14380018413066864,
-0.23586216568946838,
-0.136715829372406,
0.3481687307357788,
1.819908857345581,
-1.3051655292510986,
-2.417494297027588,
0.30715569853782654,
0.14553450047969818,
-0.06689166277647018,
-0.005135913845151663,
1.74222993850708,
0.6482083797454834,
1.41917884349823,
1.4054391384124756,
1.0980761051177979,
-1.2771669626235962,
-1.314698576927185,
0.7075799107551575,
1.174176573753357,
-1.3866535425186157,
0.4949549734592438,
-0.05765477195382118,
-0.6433916687965393,
0.4639001190662384,
1.2625839710235596,
0.5423566102981567,
-1.710943341255188,
0.8952828645706177,
-0.9644116759300232,
0.843055784702301,
1.0160688161849976,
0.8350350260734558,
0.38889190554618835,
0.42914244532585144,
-1.319959282875061,
-1.1980507373809814,
-0.7556638121604919,
-0.4355680048465729,
1.911607265472412,
-0.2528063952922821,
0.40612220764160156,
-0.07499279826879501,
-1.5686486959457397,
0.19589263200759888,
0.780850887298584,
0.22542273998260498,
-0.48000869154930115,
0.7267752289772034,
-0.5096067190170288,
-0.7775278687477112,
-1.3689582347869873,
-0.586296558380127,
-1.124682068824768,
-1.1927745342254639,
1.0715805292129517,
0.864903450012207,
0.33821913599967957,
1.7136403322219849,
0.7681548595428467,
0.4433983266353607,
-2.43501615524292,
1.1324905157089233,
0.3594213128089905,
0.05208404362201691,
0.7262532711029053,
0.35499125719070435,
1.0906102657318115,
0.1292005330324173,
0.24380247294902802,
-2.3507466316223145,
2.2204484939575195,
-0.172677144408226,
0.3970877528190613,
-0.0016572875902056694,
0.08119411021471024,
1.1433075666427612,
0.4487251937389374,
0.4196798801422119,
-0.7499630451202393,
0.7307180166244507,
-0.41927945613861084,
1.1247780323028564,
0.6796620488166809,
-1.0948240756988525,
0.08625326305627823,
1.4631102085113525,
0.54877108335495,
-0.8226271271705627,
-1.0363616943359375,
-0.9191727042198181,
1.076076865196228,
1.6379432678222656,
0.25515177845954895,
0.13265232741832733,
1.0025086402893066,
0.1771191507577896,
-1.2215522527694702,
0.13415837287902832,
-0.5538250803947449,
-0.4083864390850067,
1.5506079196929932,
2.0089383125305176,
-0.16746923327445984,
-0.3696124851703644,
-0.9592662453651428,
-1.3731828927993774,
0.7506164908409119,
-0.19890956580638885,
-0.14968813955783844,
1.1014704704284668,
-0.6152325868606567,
0.9060246348381042,
0.6033458709716797,
0.9337191581726074,
0.2874387502670288,
-0.131840780377388,
0.4902876317501068,
-0.39174675941467285,
-1.1855837106704712,
-0.10551819205284119,
-1.1508433818817139,
-2.192190408706665,
0.4101724922657013,
-0.23555947840213776,
-1.5270391702651978,
0.18769888579845428,
-1.1580473184585571,
1.3194116353988647,
-0.5289832353591919,
-0.9985319375991821,
-1.7010153532028198,
0.22221055626869202,
-0.46894627809524536,
0.7647182941436768,
-1.3396254777908325,
-0.46521851420402527,
1.1602587699890137,
0.728066623210907,
-0.7841185331344604,
1.0380401611328125,
0.016471989452838898,
1.0095860958099365,
0.8323196172714233,
-0.01192398276180029,
0.4346160590648651,
-0.17149628698825836,
-1.406288743019104,
0.6647501587867737,
1.380229115486145,
0.127883642911911,
1.6152592897415161,
-0.7446891665458679,
-0.2645200788974762,
0.395337849855423,
-0.056570328772068024,
-0.5101292729377747,
-0.32998722791671753,
0.5078957080841064,
0.15766744315624237,
-0.8355319499969482,
-0.15523859858512878,
-0.16234347224235535,
-0.3594741225242615,
0.1955547034740448,
-1.821958303451538,
0.13102544844150543,
-0.1369674652814865,
-0.9488181471824646,
-1.1844171285629272,
0.14468425512313843,
1.3669973611831665,
-0.7500380277633667,
-0.5908626317977905,
0.6635360717773438,
0.3013317584991455,
0.3546982407569885,
0.5091718435287476,
-0.6040093898773193,
0.09348241239786148,
-0.24970519542694092,
-0.2210261970758438,
0.40082454681396484,
1.541970133781433,
-0.0530322901904583,
-1.0276929140090942,
0.6183267831802368,
-0.5710494518280029,
0.31480371952056885,
2.0353200435638428,
0.5178666114807129,
-1.1678603887557983,
0.0022539542987942696,
-0.687988817691803,
2.2483716011047363,
1.4747531414031982,
1.4559975862503052,
0.14832144975662231,
-1.0010489225387573,
0.7427221536636353,
0.2071123719215393,
-0.31792235374450684,
0.9251965880393982,
0.41645723581314087,
-0.3193870782852173,
-1.4572737216949463,
0.631158709526062,
1.0258218050003052,
-0.7990873456001282,
-1.0440670251846313,
0.16862545907497406,
-0.9289851188659668,
1.1787636280059814,
0.7990425825119019,
0.263426810503006,
-0.02837209403514862,
1.5691447257995605,
0.8094779253005981,
-0.603423535823822,
0.5187917351722717,
0.29997366666793823,
0.05319962650537491,
-1.8027987480163574,
-0.7003493309020996,
0.5040754675865173,
-0.38168537616729736,
-1.712082028388977,
1.4582719802856445,
-1.137433409690857,
-0.7329639792442322,
0.43411967158317566,
0.38553768396377563,
1.4431252479553223,
0.16069503128528595,
1.4355777502059937,
2.010253667831421,
0.9892665147781372,
0.3223254382610321,
1.0122382640838623,
-0.29218894243240356,
-0.4423099160194397,
1.5048519372940063,
-0.32935842871665955,
0.41944241523742676,
0.8976483941078186,
-0.7487788200378418,
-1.3058470487594604,
-0.457431435585022,
-1.1609649658203125,
-0.601154088973999,
1.0869944095611572,
0.13130520284175873,
-0.9025028944015503,
0.26806971430778503,
1.2426763772964478,
0.08865713328123093,
-0.49491456151008606,
0.605297863483429,
0.46741634607315063,
-0.8958169221878052,
0.013100731186568737,
-0.620402455329895,
0.502041220664978,
0.1674753725528717,
-0.3045055866241455,
0.6101983785629272,
0.5333819389343262,
1.4480855464935303,
0.13735511898994446,
0.19869065284729004,
1.1798112392425537,
-1.323775291442871,
1.4835143089294434,
-0.7642232179641724,
0.002469707280397415,
-2.3373711109161377,
1.4376667737960815,
-0.6127337217330933,
1.4686006307601929,
-2.6404316425323486,
0.29641351103782654,
-0.6908902525901794,
-0.19791746139526367,
0.19992421567440033,
-0.2504906952381134,
0.14284372329711914,
-0.2455514669418335,
-1.4251102209091187,
-0.19642505049705505,
-0.7342028617858887,
0.8018778562545776,
1.2087715864181519,
1.3012021780014038,
-1.1020866632461548,
0.0990917906165123,
-1.703802227973938,
0.06518909335136414,
-0.8198405504226685,
0.24355147778987885,
-1.8029547929763794,
-0.05022713914513588,
-1.500380277633667,
-2.356966257095337,
-1.2393784523010254,
-0.5875112414360046,
0.9071576595306396,
0.3463181257247925,
-1.0008583068847656,
1.526224970817566,
-0.3093564510345459,
-1.6999739408493042,
1.0692819356918335,
-2.407710075378418
] |
https://github.com/huggingface/datasets/issues/5096 | Transfer some canonical datasets under an organization namespace | The transfer of the dummy dataset to the dummy org works as expected:
```python
In [1]: from datasets import load_dataset; ds = load_dataset("dummy_canonical_dataset", download_mode="force_redownload"); ds
Downloading builder script: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.98k/2.98k [00:00<00:00, 2.01MB/s]
Downloading and preparing dataset dummy_canonical_dataset/default (download: 411 bytes, generated: 385 bytes, post-processed: Unknown size, total: 796 bytes) to .../.cache/huggingface/datasets/dummy_canonical_dataset/default/1.0.0/100870c358637e269fee140585e61e1472d5075a9bf6f866719934c725e55fb4...
Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 411/411 [00:00<00:00, 293kB/s]
Dataset dummy_canonical_dataset downloaded and prepared to .../.cache/huggingface/datasets/dummy_canonical_dataset/default/1.0.0/100870c358637e269fee140585e61e1472d5075a9bf6f866719934c725e55fb4. Subsequent calls will reuse this data.
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 304.16it/s]
Out[1]:
DatasetDict({
train: Dataset({
features: ['langs', 'ner_tags', 'tokens'],
num_rows: 3
})
})
In [2]: from datasets import load_dataset; ds = load_dataset("dummy-canonical-org/dummy_canonical_dataset"); ds
Downloading builder script: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.98k/2.98k [00:00<00:00, 1.57MB/s]
Downloading and preparing dataset dummy_canonical_dataset/default to .../.cache/huggingface/datasets/dummy-canonical-org___dummy_canonical_dataset/default/1.0.0/100870c358637e269fee140585e61e1472d5075a9bf6f866719934c725e55fb4...
Dataset dummy_canonical_dataset downloaded and prepared to .../.cache/huggingface/datasets/dummy-canonical-org___dummy_canonical_dataset/default/1.0.0/100870c358637e269fee140585e61e1472d5075a9bf6f866719934c725e55fb4. Subsequent calls will reuse this data.
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 362.48it/s]
Out[2]:
DatasetDict({
train: Dataset({
features: ['langs', 'ner_tags', 'tokens'],
num_rows: 3
})
})
``` | As discussed during our @huggingface/datasets meeting, we are planning to move some "canonical" dataset scripts under their corresponding organization namespace (if this does not exist).
On the contrary, if the dataset already exists under the organization namespace, we are deprecating the canonical one (and eventually delete it).
First, we should test it using a dummy dataset/organization.
TODO:
- [x] Test with a dummy dataset
- [x] Create dummy canonical dataset: https://huggingface.co/datasets/dummy_canonical_dataset
- [x] Create dummy organization: https://huggingface.co/dummy-canonical-org
- [x] Transfer dummy canonical dataset to dummy organization
- [ ] Transfer datasets
- [x] babi_qa => facebook
- [x] cord19 => allenai
- [x] emotion => dair-ai
- [ ] gem => GEM
- [x] hendrycks_test => cais/mmlu
- [x] indonlu => indonlp
- [ ] multilingual_librispeech => facebook
- It already exists "facebook/multilingual_librispeech"
- [ ] oscar => oscar-corpus
- [x] peer_read => allenai
- [x] qasper => allenai
- [x] reddit => webis/tldr-17
- [x] russian_super_glue => russiannlp
- [x] rvl_cdip => aharley
- [x] s2orc => allenai
- [x] scicite => allenai
- [x] scifact => allenai
- [x] scitldr => allenai
- [x] swiss_judgment_prediction => rcds
- [x] the_pile => EleutherAI
- [ ] wmt14, wmt15, wmt16, wmt17, wmt18, wmt19,... => wmt
- [ ] Deprecate (and eventually remove) datasets that cannot be transferred because they already exist
- [x] banking77 => PolyAI
- [x] common_voice => mozilla-foundation
- [x] german_legal_entity_recognition => elenanereiss
- ...
EDIT: the list above is continuously being updated | 484 | 140 | Transfer some canonical datasets under an organization namespace
As discussed during our @huggingface/datasets meeting, we are planning to move some "canonical" dataset scripts under their corresponding organization namespace (if this does not exist).
On the contrary, if the dataset already exists under the organization namespace, we are deprecating the canonical one (and eventually delete it).
First, we should test it using a dummy dataset/organization.
TODO:
- [x] Test with a dummy dataset
- [x] Create dummy canonical dataset: https://huggingface.co/datasets/dummy_canonical_dataset
- [x] Create dummy organization: https://huggingface.co/dummy-canonical-org
- [x] Transfer dummy canonical dataset to dummy organization
- [ ] Transfer datasets
- [x] babi_qa => facebook
- [x] cord19 => allenai
- [x] emotion => dair-ai
- [ ] gem => GEM
- [x] hendrycks_test => cais/mmlu
- [x] indonlu => indonlp
- [ ] multilingual_librispeech => facebook
- It already exists "facebook/multilingual_librispeech"
- [ ] oscar => oscar-corpus
- [x] peer_read => allenai
- [x] qasper => allenai
- [x] reddit => webis/tldr-17
- [x] russian_super_glue => russiannlp
- [x] rvl_cdip => aharley
- [x] s2orc => allenai
- [x] scicite => allenai
- [x] scifact => allenai
- [x] scitldr => allenai
- [x] swiss_judgment_prediction => rcds
- [x] the_pile => EleutherAI
- [ ] wmt14, wmt15, wmt16, wmt17, wmt18, wmt19,... => wmt
- [ ] Deprecate (and eventually remove) datasets that cannot be transferred because they already exist
- [x] banking77 => PolyAI
- [x] common_voice => mozilla-foundation
- [x] german_legal_entity_recognition => elenanereiss
- ...
EDIT: the list above is continuously being updated
The transfer of the dummy dataset to the dummy org works as expected:
```python
In [1]: from datasets import load_dataset; ds = load_dataset("dummy_canonical_dataset", download_mode="force_redownload"); ds
Downloading builder script: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.98k/2.98k [00:00<00:00, 2.01MB/s]
Downloading and preparing dataset dummy_canonical_dataset/default (download: 411 bytes, generated: 385 bytes, post-processed: Unknown size, total: 796 bytes) to .../.cache/huggingface/datasets/dummy_canonical_dataset/default/1.0.0/100870c358637e269fee140585e61e1472d5075a9bf6f866719934c725e55fb4...
Downloading data: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 411/411 [00:00<00:00, 293kB/s]
Dataset dummy_canonical_dataset downloaded and prepared to .../.cache/huggingface/datasets/dummy_canonical_dataset/default/1.0.0/100870c358637e269fee140585e61e1472d5075a9bf6f866719934c725e55fb4. Subsequent calls will reuse this data.
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 304.16it/s]
Out[1]:
DatasetDict({
train: Dataset({
features: ['langs', 'ner_tags', 'tokens'],
num_rows: 3
})
})
In [2]: from datasets import load_dataset; ds = load_dataset("dummy-canonical-org/dummy_canonical_dataset"); ds
Downloading builder script: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.98k/2.98k [00:00<00:00, 1.57MB/s]
Downloading and preparing dataset dummy_canonical_dataset/default to .../.cache/huggingface/datasets/dummy-canonical-org___dummy_canonical_dataset/default/1.0.0/100870c358637e269fee140585e61e1472d5075a9bf6f866719934c725e55fb4...
Dataset dummy_canonical_dataset downloaded and prepared to .../.cache/huggingface/datasets/dummy-canonical-org___dummy_canonical_dataset/default/1.0.0/100870c358637e269fee140585e61e1472d5075a9bf6f866719934c725e55fb4. Subsequent calls will reuse this data.
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 362.48it/s]
Out[2]:
DatasetDict({
train: Dataset({
features: ['langs', 'ner_tags', 'tokens'],
num_rows: 3
})
})
``` | [
-1.2851574420928955,
-0.8373898863792419,
-0.763218879699707,
1.5717906951904297,
-0.16943402588367462,
-1.1598761081695557,
0.16421626508235931,
-1.0112797021865845,
1.7267673015594482,
-0.8397864103317261,
0.3277311623096466,
-1.620090126991272,
0.005179274827241898,
-0.6496759653091431,
-0.7369857430458069,
-0.9688195586204529,
-0.24918822944164276,
-0.7655749320983887,
1.113805890083313,
2.4310262203216553,
1.1799569129943848,
-1.4518576860427856,
2.77630352973938,
0.7728309035301208,
-0.2674272358417511,
-0.8911552429199219,
0.5160019993782043,
0.15634594857692719,
-1.3296183347702026,
-0.38184037804603577,
-1.004626989364624,
-0.10247823596000671,
-0.5969611406326294,
-0.31957903504371643,
-0.02424989640712738,
0.16622644662857056,
-0.23480118811130524,
-0.22237245738506317,
-0.4748091697692871,
-0.6577861309051514,
0.3866507411003113,
-0.27462923526763916,
0.8406661152839661,
-0.26054516434669495,
1.784659743309021,
-0.6779043674468994,
0.2733396887779236,
0.5357752442359924,
1.0831788778305054,
0.3916719853878021,
-0.0450962595641613,
0.25632813572883606,
0.28884997963905334,
-0.07658430188894272,
0.5757853984832764,
1.2908499240875244,
0.6688342690467834,
0.5821196436882019,
0.868115246295929,
-2.2145698070526123,
1.2306536436080933,
-1.0054770708084106,
0.32965826988220215,
1.3113012313842773,
-1.019469976425171,
0.5170417428016663,
-1.7763420343399048,
-0.1312597543001175,
0.6577987670898438,
-2.3619701862335205,
0.10410361737012863,
-1.3792916536331177,
-0.6851306557655334,
0.7938537001609802,
0.3094044327735901,
-1.2662004232406616,
0.08096501976251602,
-0.5191389918327332,
1.1803555488586426,
0.3813173770904541,
1.1189947128295898,
-1.811123251914978,
0.12950941920280457,
-0.25813695788383484,
0.4204334318637848,
-1.24665105342865,
-1.6030648946762085,
0.6499247550964355,
0.7189897298812866,
0.6028630137443542,
-0.07027360051870346,
1.011616587638855,
-1.1476554870605469,
0.7724733948707581,
-1.0128238201141357,
-1.7045265436172485,
-1.3687280416488647,
-2.3210670948028564,
-2.335383176803589,
0.7028422355651855,
-0.5054367780685425,
-0.5058748126029968,
2.0984046459198,
-1.0437504053115845,
-1.703608751296997,
1.0661414861679077,
0.3105024993419647,
0.02205328270792961,
2.588409662246704,
0.15750643610954285,
-0.8053627610206604,
0.5606322884559631,
-0.8184210062026978,
0.7584666609764099,
-0.18397732079029083,
1.229726791381836,
0.33673590421676636,
-0.9801876544952393,
1.6686437129974365,
-0.30743032693862915,
0.5425777435302734,
-0.7236563563346863,
-0.5532517433166504,
-0.6513668298721313,
0.15677297115325928,
2.054999351501465,
-0.21603423357009888,
1.6459910869598389,
-0.23715515434741974,
-1.4316020011901855,
-1.5994551181793213,
0.858997106552124,
0.5190800428390503,
-0.8862653970718384,
0.0642685666680336,
-0.4309527575969696,
0.13082411885261536,
0.09974083304405212,
1.2079874277114868,
1.3154281377792358,
0.7093632817268372,
-0.17985478043556213,
-0.817777693271637,
0.03252676874399185,
-0.12785334885120392,
-0.7099833488464355,
-1.7489947080612183,
-0.205520361661911,
0.05223292484879494,
0.7732985019683838,
-1.351650595664978,
1.6842011213302612,
0.752258837223053,
1.9401917457580566,
1.1397603750228882,
-0.4501054286956787,
1.5110172033309937,
0.10396434366703033,
1.7296481132507324,
-0.5177858471870422,
0.6512973308563232,
-0.4722548723220825,
-1.1628848314285278,
0.7527865767478943,
-0.43090710043907166,
-1.9271671772003174,
-0.5736495852470398,
-0.6727995276451111,
-0.18401874601840973,
-0.8826474547386169,
0.9151127338409424,
-0.27054762840270996,
-1.4776815176010132,
0.335299015045166,
-0.7214914560317993,
0.16105972230434418,
-1.241690754890442,
0.35709109902381897,
0.7857779264450073,
-0.609902560710907,
0.02381947636604309,
-0.32823553681373596,
-1.3468477725982666,
-0.575184166431427,
0.2855769395828247,
1.8678044080734253,
-0.5937507152557373,
0.8997638821601868,
1.090100884437561,
-0.6464122533798218,
-0.09910590201616287,
0.3750697374343872,
-0.21808801591396332,
0.8666092753410339,
-1.099146842956543,
-0.46726009249687195,
1.0484508275985718,
-0.12282941490411758,
-0.5424439907073975,
1.4048975706100464,
0.669828474521637,
-0.928547203540802,
-0.34517765045166016,
0.012578030116856098,
-0.7000840306282043,
0.029986999928951263,
-1.6314793825149536,
-0.22029399871826172,
0.34434959292411804,
-1.5744608640670776,
-0.5455423593521118,
-0.10898613929748535,
1.3221408128738403,
-0.27253293991088867,
1.3589049577713013,
-0.24369986355304718,
-0.12169768661260605,
-0.40067335963249207,
-0.4563535749912262,
0.07412593066692352,
-0.23982936143875122,
-0.596100389957428,
0.3134417235851288,
-0.7609548568725586,
0.22028081119060516,
1.497712254524231,
0.28396108746528625,
0.11189209669828415,
0.37980765104293823,
1.1556295156478882,
0.4155450761318207,
-0.17027704417705536,
-0.9324822425842285,
-1.6343903541564941,
1.9292980432510376,
-1.5698630809783936,
2.149892807006836,
0.8450614213943481,
-0.016074087470769882,
-1.79245924949646,
-1.9100688695907593,
1.4788832664489746,
1.1650328636169434,
2.4029057025909424,
0.5318177938461304,
0.3276502192020416,
-0.7697715759277344,
-0.5737765431404114,
0.28988757729530334,
-0.8590763211250305,
-0.7963262796401978,
0.21722637116909027,
2.4484951496124268,
1.5996185541152954,
-0.4181174337863922,
-0.04637704789638519,
-0.8222714066505432,
1.3225727081298828,
-0.17462003231048584,
0.23961074650287628,
1.8466436862945557,
-0.2785886526107788,
-1.224678874015808,
1.2257874011993408,
-2.394266366958618,
-0.005892801098525524,
1.9897406101226807,
0.3009849190711975,
0.010477892123162746,
-1.2869579792022705,
-0.6581448316574097,
-0.4153794050216675,
-0.5020743012428284,
-1.3703118562698364,
0.3588050603866577,
-0.2391357421875,
-0.785131573677063,
-1.4948821067810059,
0.03741048276424408,
-1.1079081296920776,
-1.5214892625808716,
0.26362884044647217,
1.8242586851119995,
2.064793109893799,
-0.7740766406059265,
1.447906732559204,
-0.48218438029289246,
-0.0006057173013687134,
1.0208104848861694,
1.1898525953292847,
3.174376964569092,
1.912211298942566,
-1.2771861553192139,
0.5730183124542236,
-0.16503234207630157,
-0.4345283806324005,
1.1131782531738281,
-1.12716805934906,
1.317097783088684,
-0.22639082372188568,
-1.4421472549438477,
-1.369706392288208,
1.0291212797164917,
0.4176672697067261,
-0.0825120210647583,
-0.6327525973320007,
1.2621883153915405,
0.07464825361967087,
1.3028578758239746,
0.49636855721473694,
-0.2071516066789627,
0.4957132637500763,
-0.46159473061561584,
-0.5566577911376953,
1.7344719171524048,
-0.023925719782710075,
-1.558772087097168,
-2.2990074157714844,
-0.09053326398134232,
-0.8906155824661255,
0.13073278963565826,
-0.7389413118362427,
-1.2547882795333862,
1.723623275756836,
0.3887346684932709,
-1.158078670501709,
-0.2177285999059677,
-0.374218612909317,
-0.6379431486129761,
2.686859130859375,
-1.416014313697815,
-0.23952874541282654,
-0.9602734446525574,
-0.5566114187240601,
1.4399653673171997,
-1.2206268310546875,
-0.1638946682214737,
-0.9244018793106079,
-0.5544467568397522,
-1.21115243434906,
-0.46986308693885803,
0.005139228887856007,
-0.8960282802581787,
0.6714069247245789,
0.0928739681839943,
-1.3548158407211304,
-0.25695255398750305,
-0.9432346820831299,
0.9206345081329346,
-0.15282656252384186,
0.23777782917022705,
1.923147201538086,
0.17044666409492493,
-0.4303288161754608,
0.794913113117218,
1.2922269105911255,
0.7852495312690735,
-0.6749147176742554,
0.23057487607002258,
-0.4451446831226349,
0.44440701603889465,
-1.2516131401062012,
0.22105127573013306,
-2.9451236724853516,
0.8211309313774109,
0.13200338184833527,
0.06118294224143028,
0.16677576303482056,
-1.2041751146316528,
1.0702388286590576,
2.5451667308807373,
-1.064460277557373,
0.41138213872909546,
0.3133017122745514,
1.2804678678512573,
-1.597322940826416,
0.14953583478927612,
-0.5775604248046875,
2.2066586017608643,
0.24397601187229156,
1.1165907382965088,
-0.5148571729660034,
-2.4152581691741943,
0.5438098907470703,
-1.2210546731948853,
-1.0404249429702759,
0.9204281568527222,
-0.9909340739250183,
0.14800938963890076,
-1.3999601602554321,
-0.14513427019119263,
-0.9599486589431763,
-1.1013798713684082,
0.5950917601585388,
0.05395186319947243,
0.4569986164569855,
-0.6330772042274475,
0.25629922747612,
-2.2219269275665283,
-1.3000463247299194,
0.0254809707403183,
-1.066493272781372,
0.49810299277305603,
-0.414466917514801,
0.7693616151809692,
-0.16396212577819824,
-0.037644028663635254,
0.3603181540966034,
1.4762362241744995,
3.276656150817871,
0.17323477566242218,
0.45926642417907715,
-0.3072717487812042,
-0.9521197080612183,
1.473520040512085,
0.9441902041435242,
-0.11337053030729294,
-0.5327748656272888,
-0.9832260608673096,
1.3904935121536255,
1.8925445079803467,
0.9942119717597961,
0.06856394559144974,
-0.8908412456512451,
-0.6125257611274719,
0.09447655826807022,
0.4040374159812927,
0.4289139211177826,
0.981400191783905,
0.03632565587759018,
0.2114013135433197,
1.3690972328186035,
1.0773558616638184,
-0.5124838948249817,
0.45191454887390137,
-0.9222103357315063,
-0.5479857921600342,
0.5855998992919922,
0.39460474252700806,
-0.0933518335223198,
0.3645282983779907,
-1.001683235168457,
-0.24820365011692047,
-0.2818061113357544,
-0.8181818127632141,
-0.58156818151474,
-0.18160071969032288,
-0.29790163040161133,
1.6350327730178833,
-0.052426788955926895,
-0.45324045419692993,
0.15235678851604462,
-0.8402742147445679,
-0.17373281717300415,
-1.1576626300811768,
0.40285879373550415,
-0.1929166316986084,
-0.05305389687418938,
-0.11886502802371979,
1.802410364151001,
-0.8363800644874573,
-2.0379388332366943,
0.14962053298950195,
0.24313093721866608,
-0.36889857053756714,
0.14246948063373566,
1.8758801221847534,
0.5095576643943787,
1.3843249082565308,
1.349021553993225,
0.9631955623626709,
-0.6508222222328186,
-1.3753085136413574,
0.640609622001648,
0.9937619566917419,
-1.1822446584701538,
0.9969912171363831,
-0.26582711935043335,
-0.5983206033706665,
0.5167579054832458,
1.2850685119628906,
0.46550074219703674,
-1.9524749517440796,
0.8150349855422974,
-1.0415228605270386,
0.8449427485466003,
0.7128520607948303,
0.7825345993041992,
0.197618767619133,
0.9697112441062927,
-1.2193711996078491,
-1.032044768333435,
-0.6649810671806335,
-0.5825604200363159,
1.7771847248077393,
-0.22336800396442413,
0.42922866344451904,
-0.31298866868019104,
-1.2779797315597534,
0.05902978405356407,
0.5342060923576355,
0.3084193170070648,
-0.3651173710823059,
0.9009578227996826,
-0.7418720722198486,
-1.0068198442459106,
-1.21587073802948,
-0.5110718607902527,
-0.9178913831710815,
-0.9521830677986145,
1.1336113214492798,
0.7560591697692871,
0.37846246361732483,
1.8912768363952637,
0.5359842777252197,
0.13646993041038513,
-2.591575860977173,
0.8613555431365967,
0.25061360001564026,
-0.13630551099777222,
0.9511709213256836,
0.4352094829082489,
1.1931729316711426,
0.01744525134563446,
0.48718127608299255,
-2.4142048358917236,
2.266127586364746,
-0.19081473350524902,
0.8294923305511475,
-0.01238027773797512,
0.002277079038321972,
0.9426068663597107,
0.684662401676178,
0.4079963266849518,
-0.9867086410522461,
0.6712531447410583,
-0.6405419707298279,
1.1983884572982788,
0.9109145998954773,
-0.7039416432380676,
-0.0026988349854946136,
1.2200963497161865,
0.35563769936561584,
-0.5621798634529114,
-0.9200482964515686,
-0.792738676071167,
0.8723509311676025,
1.7096837759017944,
0.1869989037513733,
0.018031608313322067,
0.7533411383628845,
0.6897702217102051,
-1.2826101779937744,
0.10375215113162994,
-0.6033389568328857,
-0.94492506980896,
1.6252628564834595,
1.9773324728012085,
-0.06783802062273026,
-0.016541827470064163,
-0.5523919463157654,
-1.3654674291610718,
0.8186327219009399,
-0.1514265537261963,
0.1326981484889984,
0.6834182739257812,
-0.61057448387146,
1.037593126296997,
0.8661798238754272,
0.9008165001869202,
0.2624867260456085,
0.3328458368778229,
0.456065833568573,
-0.29346057772636414,
-1.320381760597229,
-0.268791526556015,
-1.0156000852584839,
-2.459167242050171,
0.3429289758205414,
-0.38758039474487305,
-1.2915916442871094,
0.08967987447977066,
-0.9782992601394653,
0.7770519852638245,
-0.6273859143257141,
-0.9956599473953247,
-1.4698681831359863,
0.21612702310085297,
-0.03181014209985733,
0.9757212996482849,
-1.4647341966629028,
-0.13111232221126556,
1.1295535564422607,
0.9252536296844482,
-0.5865923762321472,
1.0584132671356201,
0.28586244583129883,
1.028802752494812,
0.91468346118927,
-0.4245820641517639,
0.4239872694015503,
0.21888065338134766,
-1.2735978364944458,
0.3211396634578705,
1.2443064451217651,
0.20096416771411896,
1.4922659397125244,
-0.48806336522102356,
-0.22775763273239136,
0.4375739097595215,
-0.45447176694869995,
-0.406244158744812,
-0.7535253763198853,
0.5788649916648865,
0.00004525110125541687,
-0.8678066730499268,
-0.16216687858104706,
-0.08993672579526901,
-0.2831312417984009,
0.223774716258049,
-1.5188339948654175,
-0.0012184223160147667,
-0.6162934303283691,
-0.5967127084732056,
-1.3888641595840454,
0.016293037682771683,
1.4110220670700073,
-0.8197699785232544,
-0.09519616514444351,
0.4129854440689087,
0.3581489622592926,
0.5222877860069275,
0.7896093726158142,
-0.5879811644554138,
-0.38240253925323486,
-0.2478513866662979,
-0.452993780374527,
0.28835222125053406,
1.2114462852478027,
-0.22700679302215576,
-1.0077265501022339,
0.5345665216445923,
-0.25758180022239685,
0.0574323870241642,
1.9559495449066162,
0.021067235618829727,
-0.8381892442703247,
0.25174129009246826,
-0.6366023421287537,
1.9347037076950073,
1.6917181015014648,
1.3777159452438354,
-0.27562007308006287,
-0.8281243443489075,
0.7950255274772644,
-0.3327828347682953,
-0.48148778080940247,
0.7953973412513733,
0.4372459053993225,
-0.26800021529197693,
-1.578810214996338,
0.6908483505249023,
1.3191680908203125,
-0.892242968082428,
-0.7401218414306641,
0.14811402559280396,
-0.7038467526435852,
1.0385900735855103,
0.6407235264778137,
0.2700667381286621,
0.4322398602962494,
1.5449827909469604,
0.7890095710754395,
-0.636838972568512,
0.3946642279624939,
0.5174853801727295,
-0.05949794501066208,
-2.0540432929992676,
-1.1271978616714478,
0.2260069102048874,
-0.3420347571372986,
-1.4792693853378296,
1.4607572555541992,
-1.181148648262024,
-0.9889976978302002,
0.5424349904060364,
-0.02707267552614212,
1.1183854341506958,
0.1676887720823288,
1.7745835781097412,
2.0764589309692383,
0.7586477398872375,
0.40179845690727234,
1.2954614162445068,
-0.2013620138168335,
-0.41095760464668274,
1.6165399551391602,
-0.5828699469566345,
0.6548635959625244,
1.1529734134674072,
-0.3330950438976288,
-1.047065258026123,
-0.8158047199249268,
-1.3116121292114258,
-0.7558038234710693,
1.1085362434387207,
0.18878181278705597,
-1.2228673696517944,
0.2729840874671936,
1.5655944347381592,
0.017968297004699707,
-0.3008022606372833,
0.6560499668121338,
0.4805854260921478,
-0.6481610536575317,
-0.20379064977169037,
-1.0852899551391602,
0.6364007592201233,
-0.31916937232017517,
-0.2873387932777405,
0.3383885622024536,
0.4134215712547302,
1.284894585609436,
0.16918525099754333,
0.08148311078548431,
1.3002325296401978,
-1.429297685623169,
1.3049895763397217,
-0.7717618346214294,
0.3880443274974823,
-2.394841432571411,
1.449162244796753,
-0.7081930637359619,
1.9398350715637207,
-2.6836788654327393,
0.5592682957649231,
-0.5741081237792969,
-0.4719778597354889,
0.32343167066574097,
-0.12366029620170593,
0.36939796805381775,
-0.14027239382266998,
-0.9956918358802795,
-0.159937784075737,
-0.8655030727386475,
0.4749612808227539,
1.1407570838928223,
1.2824273109436035,
-0.9823378920555115,
-0.27530160546302795,
-1.6317962408065796,
-0.1572807878255844,
-0.5689738988876343,
0.045301809906959534,
-1.9719809293746948,
-0.21086888015270233,
-1.9829133749008179,
-2.4832496643066406,
-1.305542230606079,
-0.8149537444114685,
1.166501760482788,
0.15084627270698547,
-0.9251091480255127,
1.3291401863098145,
-0.3617817461490631,
-1.683324933052063,
1.0646158456802368,
-2.028928756713867
] |
https://github.com/huggingface/datasets/issues/5094 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock | Hi ! Could it be an Out of Memory issue that could have killed one of the processes ? can you check your memory ? | ## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
| 485 | 25 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock
## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
Hi ! Could it be an Out of Memory issue that could have killed one of the processes ? can you check your memory ? | [
-1.2728172540664673,
-0.898106038570404,
-0.6675035357475281,
1.5078846216201782,
-0.15048755705356598,
-1.1838184595108032,
0.1676679104566574,
-1.037777066230774,
1.6529299020767212,
-0.8306827545166016,
0.33186355233192444,
-1.642417550086975,
0.025884125381708145,
-0.5294846892356873,
-0.7099189162254333,
-0.8553285002708435,
-0.3630971908569336,
-0.7704471349716187,
1.1102064847946167,
2.4790022373199463,
1.2116022109985352,
-1.3617780208587646,
2.721543312072754,
0.7294445633888245,
-0.27313902974128723,
-1.022451400756836,
0.5119602680206299,
0.02420932799577713,
-1.3098320960998535,
-0.4780839681625366,
-0.9773918986320496,
-0.06110548600554466,
-0.5749793648719788,
-0.530600368976593,
0.048546627163887024,
0.4360436201095581,
-0.34067589044570923,
-0.43972447514533997,
-0.5995767712593079,
-0.8195635676383972,
0.5065432786941528,
-0.3635629713535309,
0.8847498893737793,
-0.3069908618927002,
1.8620855808258057,
-0.5903087854385376,
0.46847742795944214,
0.7048625349998474,
1.3212766647338867,
0.2136135846376419,
-0.008978569880127907,
0.3795269727706909,
0.34761202335357666,
-0.03379765525460243,
0.528163492679596,
1.2579987049102783,
0.6583824753761292,
0.5207197666168213,
0.768476665019989,
-2.2253053188323975,
1.3710949420928955,
-0.9576165080070496,
0.33361122012138367,
1.3393239974975586,
-0.9172539114952087,
0.2899286150932312,
-1.7659608125686646,
-0.05864223465323448,
0.5995616912841797,
-2.2474288940429688,
0.306321382522583,
-1.3535258769989014,
-0.5243438482284546,
1.055833101272583,
0.3606233596801758,
-1.2128578424453735,
0.1498764455318451,
-0.42331913113594055,
1.1061313152313232,
0.3940792381763458,
1.0456103086471558,
-1.6636619567871094,
-0.07841675728559494,
-0.23848757147789001,
0.11999284476041794,
-1.2947020530700684,
-1.5918309688568115,
0.5457575917243958,
0.5756939053535461,
0.6724304556846619,
-0.101937435567379,
1.0468467473983765,
-1.0250275135040283,
0.7794437408447266,
-0.9785480499267578,
-1.6938483715057373,
-1.3979201316833496,
-2.259873151779175,
-2.243540048599243,
0.7791751623153687,
-0.452364057302475,
-0.57818603515625,
2.0768754482269287,
-1.0700881481170654,
-1.739996314048767,
1.0930438041687012,
0.281719833612442,
0.008906741626560688,
2.378340005874634,
0.2526441812515259,
-0.7203893661499023,
0.4843027889728546,
-0.7691013216972351,
0.7793152332305908,
-0.2793711721897125,
1.382179856300354,
0.4443669319152832,
-1.0933326482772827,
1.5655096769332886,
-0.44966769218444824,
0.5801029801368713,
-0.594494104385376,
-0.5421668887138367,
-0.7353447675704956,
0.24949699640274048,
1.8815587759017944,
-0.26052534580230713,
1.5427982807159424,
-0.35099196434020996,
-1.6580642461776733,
-1.6590973138809204,
0.8649615049362183,
0.4632969796657562,
-0.7855021953582764,
0.1131933182477951,
-0.47784918546676636,
0.1048925593495369,
0.041526518762111664,
1.2390646934509277,
1.3128716945648193,
0.6531018614768982,
-0.4030846655368805,
-0.8126692175865173,
0.15200407803058624,
-0.06470845639705658,
-0.7087991833686829,
-1.7899096012115479,
-0.35062190890312195,
0.20234523713588715,
0.6552833914756775,
-1.1839383840560913,
1.7916535139083862,
0.9244098663330078,
1.91371488571167,
0.982195258140564,
-0.35161951184272766,
1.4709739685058594,
0.06170543283224106,
1.8076668977737427,
-0.4967227578163147,
0.6924989223480225,
-0.37446480989456177,
-1.1475586891174316,
0.7904874086380005,
-0.352630078792572,
-2.0495922565460205,
-0.784993052482605,
-0.7339880466461182,
-0.1399894505739212,
-0.7832950353622437,
0.9168249368667603,
-0.3361148536205292,
-1.4943307638168335,
0.191568985581398,
-0.7171045541763306,
0.21077293157577515,
-1.1997804641723633,
0.329965740442276,
0.6984550952911377,
-0.6635046601295471,
0.11533772200345993,
-0.23885409533977509,
-1.2473503351211548,
-0.5146815180778503,
0.271866112947464,
1.8774033784866333,
-0.7064959406852722,
0.9217275977134705,
1.0683215856552124,
-0.7025314569473267,
0.05051765590906143,
0.3040471076965332,
-0.3278622627258301,
0.8830869793891907,
-1.1087406873703003,
-0.35644012689590454,
1.2247896194458008,
-0.15238086879253387,
-0.6067793965339661,
1.410730004310608,
0.7680283188819885,
-1.016308069229126,
-0.20380298793315887,
-0.1411990225315094,
-0.8540043234825134,
0.07481364160776138,
-1.522090196609497,
-0.12823514640331268,
0.48620402812957764,
-1.4924805164337158,
-0.43667176365852356,
-0.16383124887943268,
1.2791913747787476,
-0.19118830561637878,
1.390853762626648,
-0.4047609567642212,
-0.15612484514713287,
-0.29898351430892944,
-0.3792724609375,
0.1329495757818222,
-0.1946209818124771,
-0.6530145406723022,
0.16107803583145142,
-0.7985470294952393,
0.2982448935508728,
1.4837706089019775,
0.42787131667137146,
0.03449661284685135,
0.4591967761516571,
1.1969916820526123,
0.35998648405075073,
-0.1141214594244957,
-0.8239149451255798,
-1.6157222986221313,
2.0071966648101807,
-1.4026145935058594,
1.9802812337875366,
0.7921321392059326,
-0.042006488889455795,
-1.7863940000534058,
-1.8585829734802246,
1.290173888206482,
1.1519566774368286,
2.426870107650757,
0.5208056569099426,
0.4265890419483185,
-0.8329137563705444,
-0.6926795840263367,
0.36930882930755615,
-1.0225499868392944,
-0.6591797471046448,
0.16508892178535461,
2.368185043334961,
1.8095749616622925,
-0.4727384150028229,
-0.19467832148075104,
-0.9958896636962891,
1.3674784898757935,
-0.2620728015899658,
0.25467997789382935,
1.935243844985962,
-0.2206370085477829,
-1.0521881580352783,
1.3514591455459595,
-2.274789810180664,
0.19494320452213287,
2.045893907546997,
0.23365184664726257,
0.11794169992208481,
-1.3867226839065552,
-0.6197702288627625,
-0.3298516571521759,
-0.3724164068698883,
-1.2480944395065308,
0.4907134175300598,
-0.24311697483062744,
-0.8163476586341858,
-1.3926293849945068,
0.16817116737365723,
-1.1389451026916504,
-1.6686077117919922,
0.29410743713378906,
1.9241273403167725,
2.1020069122314453,
-0.76520836353302,
1.561436414718628,
-0.30712807178497314,
0.14966383576393127,
1.1844006776809692,
1.3334907293319702,
3.1288537979125977,
1.8098686933517456,
-1.3103693723678589,
0.6662647724151611,
-0.14498382806777954,
-0.5045926570892334,
1.1591272354125977,
-1.234257459640503,
1.2798235416412354,
-0.10849984735250473,
-1.1931463479995728,
-1.2401033639907837,
0.9765093922615051,
0.511813759803772,
0.06237350404262543,
-0.4576704204082489,
1.1577140092849731,
0.046737413853406906,
1.3566731214523315,
0.5614393353462219,
-0.3243753910064697,
0.5850516557693481,
-0.36106446385383606,
-0.5654187798500061,
1.4720606803894043,
0.1600532829761505,
-1.437113642692566,
-2.2325220108032227,
-0.18387371301651,
-0.7906442284584045,
0.06312064081430435,
-0.6861430406570435,
-0.9769694209098816,
1.6663440465927124,
0.34448111057281494,
-1.2562439441680908,
-0.24181528389453888,
-0.34916943311691284,
-0.535322904586792,
2.6424765586853027,
-1.3074086904525757,
-0.14765049517154694,
-0.9981063604354858,
-0.6666267514228821,
1.6126532554626465,
-1.1260654926300049,
-0.23927028477191925,
-1.0537796020507812,
-0.5630018711090088,
-1.2659841775894165,
-0.5261600613594055,
0.06710357964038849,
-0.9868696331977844,
0.7178747057914734,
0.13949893414974213,
-1.1362526416778564,
-0.36735913157463074,
-0.9010234475135803,
0.9559107422828674,
-0.1743820309638977,
0.11435312777757645,
1.8490453958511353,
0.34077098965644836,
-0.3901214003562927,
0.7669761180877686,
1.176772952079773,
0.6003429889678955,
-0.6447871923446655,
0.13952834904193878,
-0.6812017560005188,
0.31988880038261414,
-1.36051607131958,
0.3337946832180023,
-2.859066963195801,
0.6829373836517334,
-0.06656322628259659,
-0.14797593653202057,
0.001444750465452671,
-1.3506354093551636,
1.0840740203857422,
2.5894596576690674,
-1.1882277727127075,
0.4818987250328064,
0.32420283555984497,
1.1111310720443726,
-1.6795217990875244,
0.31720009446144104,
-0.4423635005950928,
2.0221872329711914,
0.23435740172863007,
1.2680177688598633,
-0.5199272036552429,
-2.2819950580596924,
0.621296226978302,
-1.254020094871521,
-1.0809417963027954,
0.8199553489685059,
-0.9331535696983337,
0.1540672481060028,
-1.3892176151275635,
-0.32730090618133545,
-0.8660197854042053,
-1.1246663331985474,
0.6168437004089355,
0.1613800972700119,
0.41987407207489014,
-0.5136435031890869,
0.3189338743686676,
-2.272322654724121,
-1.3186430931091309,
-0.17571108043193817,
-0.9592571258544922,
0.5857236981391907,
-0.3780722916126251,
0.650839626789093,
-0.16737212240695953,
0.0013154204934835434,
0.38767609000205994,
1.5025783777236938,
3.389970541000366,
0.20225213468074799,
0.24381813406944275,
-0.15255875885486603,
-0.9369668364524841,
1.41533362865448,
0.8609926700592041,
-0.19099688529968262,
-0.5756115317344666,
-1.0514761209487915,
1.28162682056427,
1.9142260551452637,
0.9662147760391235,
-0.028119679540395737,
-0.8893063068389893,
-0.7600444555282593,
-0.0347595177590847,
0.15274105966091156,
0.40866953134536743,
0.8677349090576172,
0.18397879600524902,
0.08664620667695999,
1.464106798171997,
1.212233304977417,
-0.4454899728298187,
0.353628009557724,
-0.8537306189537048,
-0.45114409923553467,
0.4397623538970947,
0.281556099653244,
-0.05764469504356384,
0.32415658235549927,
-1.033489465713501,
-0.2066495418548584,
-0.40679478645324707,
-0.9256564378738403,
-0.793274462223053,
-0.4112702012062073,
-0.3477209508419037,
1.6259478330612183,
0.1226087436079979,
-0.5532164573669434,
-0.050038378685712814,
-0.8062185049057007,
-0.1780952513217926,
-1.0363116264343262,
0.26823821663856506,
-0.06674559414386749,
-0.13193441927433014,
-0.19742664694786072,
1.6681761741638184,
-0.9554153084754944,
-2.0709786415100098,
0.1939898133277893,
0.23655007779598236,
-0.2969881594181061,
0.1353280246257782,
1.6935700178146362,
0.5369395017623901,
1.4587482213974,
1.2912410497665405,
0.9042574167251587,
-0.6973049640655518,
-1.2924975156784058,
0.7150086760520935,
0.9678940176963806,
-1.3956266641616821,
0.8214772939682007,
-0.11786721646785736,
-0.46477019786834717,
0.6022540330886841,
1.2856194972991943,
0.5307503342628479,
-1.992182731628418,
0.8495544195175171,
-1.006593108177185,
0.7702540755271912,
0.7664495706558228,
0.6361990571022034,
0.19016899168491364,
0.8413786292076111,
-1.2448914051055908,
-1.1749722957611084,
-0.6532060503959656,
-0.7146669626235962,
1.9340896606445312,
-0.31178018450737,
0.6239361763000488,
-0.21617260575294495,
-1.2158901691436768,
-0.09333990514278412,
0.7446455359458923,
0.31973448395729065,
-0.4713742434978485,
0.8087001442909241,
-0.6334474086761475,
-1.0231162309646606,
-1.3708226680755615,
-0.43711405992507935,
-1.048536777496338,
-0.9694881439208984,
0.9131231904029846,
0.7782614827156067,
0.3517824411392212,
1.8862236738204956,
0.6714057326316833,
0.306791216135025,
-2.6030285358428955,
0.8621639013290405,
0.2676733732223511,
-0.06808492541313171,
0.883309006690979,
0.362884521484375,
1.0252817869186401,
0.0020881323143839836,
0.5179023742675781,
-2.3862080574035645,
2.257603645324707,
-0.16850297152996063,
0.6480813026428223,
-0.0683922991156578,
-0.15334925055503845,
1.1617505550384521,
0.6016548275947571,
0.5385868549346924,
-1.0553938150405884,
0.6539948582649231,
-0.5602283477783203,
1.219348430633545,
0.8073272705078125,
-0.8498780131340027,
0.01812680810689926,
1.404471516609192,
0.40335601568222046,
-0.5699864029884338,
-0.9647572040557861,
-0.9221403002738953,
0.8996856808662415,
1.6903843879699707,
-0.03292599320411682,
-0.03700825572013855,
0.7453815937042236,
0.6980094909667969,
-1.318013072013855,
0.06005515158176422,
-0.6141734719276428,
-0.7575258016586304,
1.6861062049865723,
2.100870132446289,
-0.15646304190158844,
-0.21467837691307068,
-0.6671448349952698,
-1.2803055047988892,
0.8249780535697937,
-0.07361974567174911,
0.10443954914808273,
0.632321298122406,
-0.6942756772041321,
1.0874426364898682,
0.8532637357711792,
0.9378148913383484,
0.2387325018644333,
0.2664787471294403,
0.42157265543937683,
-0.3465708792209625,
-1.2244127988815308,
-0.28240054845809937,
-1.1089738607406616,
-2.598557472229004,
0.3991154134273529,
-0.18377608060836792,
-1.4373836517333984,
0.032505448907613754,
-1.0242246389389038,
0.9224293828010559,
-0.648020327091217,
-1.083065152168274,
-1.5118992328643799,
0.22164861857891083,
-0.06929201632738113,
0.9505371451377869,
-1.610608458518982,
-0.16076675057411194,
1.1655131578445435,
0.9485218524932861,
-0.6287582516670227,
1.017970323562622,
0.19189395010471344,
1.019376516342163,
0.881405234336853,
-0.3901577591896057,
0.5577489137649536,
0.0365796722471714,
-1.3785642385482788,
0.42650288343429565,
1.2448222637176514,
0.19750314950942993,
1.4672907590866089,
-0.48292994499206543,
0.0318870022892952,
0.414307564496994,
-0.6287082433700562,
-0.4888523817062378,
-0.43239471316337585,
0.6684964895248413,
0.08432838320732117,
-0.9175506830215454,
-0.09081211686134338,
-0.05782536789774895,
-0.26295435428619385,
0.24902477860450745,
-1.48149573802948,
-0.20921257138252258,
-0.38195598125457764,
-0.5876188278198242,
-1.2107875347137451,
-0.14657805860042572,
1.3973493576049805,
-0.8044940829277039,
-0.19253621995449066,
0.5131112337112427,
0.3424886167049408,
0.46737074851989746,
0.678922176361084,
-0.8116272687911987,
-0.28185075521469116,
-0.22640807926654816,
-0.31366875767707825,
0.3196541965007782,
1.342352032661438,
-0.032387085258960724,
-0.8783203363418579,
0.6310971975326538,
-0.29867228865623474,
0.12962423264980316,
1.9445734024047852,
0.07405976951122284,
-0.7987595796585083,
0.2566708028316498,
-0.7875290513038635,
1.9510339498519897,
1.745648741722107,
1.2961316108703613,
-0.12333840131759644,
-0.9219222664833069,
0.641269862651825,
-0.3431878387928009,
-0.3386867642402649,
0.9251767992973328,
0.40013203024864197,
-0.19691026210784912,
-1.3767236471176147,
0.7505810260772705,
1.2565701007843018,
-0.8602443933486938,
-0.79136061668396,
0.14068739116191864,
-0.8215237259864807,
1.1031270027160645,
0.6536604762077332,
0.31910353899002075,
0.29210594296455383,
1.628665566444397,
0.7785674929618835,
-0.4112801253795624,
0.5156480669975281,
0.5212418437004089,
-0.1201367899775505,
-2.134906530380249,
-1.1480786800384521,
0.34161150455474854,
-0.5448242425918579,
-1.6037064790725708,
1.3668931722640991,
-1.1114294528961182,
-0.9869399070739746,
0.6385155916213989,
0.07644679397344589,
1.36211359500885,
0.3642447590827942,
1.6231374740600586,
2.138058662414551,
0.8603616952896118,
0.33243289589881897,
1.2501112222671509,
-0.13480354845523834,
-0.4335775375366211,
1.7846237421035767,
-0.47297203540802,
0.5162733793258667,
1.0696066617965698,
-0.3468702435493469,
-1.109035849571228,
-0.8235945701599121,
-1.2255563735961914,
-0.726676344871521,
1.121450662612915,
0.16285693645477295,
-1.087782382965088,
0.2538735866546631,
1.6188344955444336,
0.06094513088464737,
-0.2887183427810669,
0.6261609792709351,
0.42095208168029785,
-0.7795237302780151,
-0.06686680018901825,
-0.9138645529747009,
0.5732158422470093,
-0.20531214773654938,
-0.38714298605918884,
0.2692232131958008,
0.4880647659301758,
1.2931008338928223,
-0.05807570368051529,
0.06021587550640106,
1.0877163410186768,
-1.3864737749099731,
1.4752006530761719,
-0.7385877370834351,
0.3225972354412079,
-2.360701560974121,
1.4418747425079346,
-0.7699537873268127,
1.9386522769927979,
-2.650287389755249,
0.5178802013397217,
-0.5528347492218018,
-0.5609498023986816,
0.27745458483695984,
-0.39704570174217224,
0.1605527251958847,
-0.08412831276655197,
-1.0984654426574707,
-0.05926140397787094,
-0.6679657697677612,
0.6155198812484741,
1.2103370428085327,
1.3707938194274902,
-1.2190546989440918,
-0.24441315233707428,
-1.7259461879730225,
-0.16987529397010803,
-0.7472811341285706,
0.27537378668785095,
-1.9482885599136353,
-0.2026057094335556,
-1.9212568998336792,
-2.4384162425994873,
-1.2924424409866333,
-0.7341731190681458,
1.0986510515213013,
0.14043542742729187,
-0.8292104601860046,
1.2580426931381226,
-0.3628932237625122,
-1.7947641611099243,
1.0949991941452026,
-2.1747941970825195
] |
https://github.com/huggingface/datasets/issues/5094 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock | Hi! I don't think it is a memory issue. I'm monitoring the main and spawn python processes and threads with `htop` and the memory does not peak. Besides, the example I've posted above should not be that demanding in terms of memory, right? (I have 32GB of RAM). | ## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
| 485 | 48 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock
## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
Hi! I don't think it is a memory issue. I'm monitoring the main and spawn python processes and threads with `htop` and the memory does not peak. Besides, the example I've posted above should not be that demanding in terms of memory, right? (I have 32GB of RAM). | [
-1.2728172540664673,
-0.898106038570404,
-0.6675035357475281,
1.5078846216201782,
-0.15048755705356598,
-1.1838184595108032,
0.1676679104566574,
-1.037777066230774,
1.6529299020767212,
-0.8306827545166016,
0.33186355233192444,
-1.642417550086975,
0.025884125381708145,
-0.5294846892356873,
-0.7099189162254333,
-0.8553285002708435,
-0.3630971908569336,
-0.7704471349716187,
1.1102064847946167,
2.4790022373199463,
1.2116022109985352,
-1.3617780208587646,
2.721543312072754,
0.7294445633888245,
-0.27313902974128723,
-1.022451400756836,
0.5119602680206299,
0.02420932799577713,
-1.3098320960998535,
-0.4780839681625366,
-0.9773918986320496,
-0.06110548600554466,
-0.5749793648719788,
-0.530600368976593,
0.048546627163887024,
0.4360436201095581,
-0.34067589044570923,
-0.43972447514533997,
-0.5995767712593079,
-0.8195635676383972,
0.5065432786941528,
-0.3635629713535309,
0.8847498893737793,
-0.3069908618927002,
1.8620855808258057,
-0.5903087854385376,
0.46847742795944214,
0.7048625349998474,
1.3212766647338867,
0.2136135846376419,
-0.008978569880127907,
0.3795269727706909,
0.34761202335357666,
-0.03379765525460243,
0.528163492679596,
1.2579987049102783,
0.6583824753761292,
0.5207197666168213,
0.768476665019989,
-2.2253053188323975,
1.3710949420928955,
-0.9576165080070496,
0.33361122012138367,
1.3393239974975586,
-0.9172539114952087,
0.2899286150932312,
-1.7659608125686646,
-0.05864223465323448,
0.5995616912841797,
-2.2474288940429688,
0.306321382522583,
-1.3535258769989014,
-0.5243438482284546,
1.055833101272583,
0.3606233596801758,
-1.2128578424453735,
0.1498764455318451,
-0.42331913113594055,
1.1061313152313232,
0.3940792381763458,
1.0456103086471558,
-1.6636619567871094,
-0.07841675728559494,
-0.23848757147789001,
0.11999284476041794,
-1.2947020530700684,
-1.5918309688568115,
0.5457575917243958,
0.5756939053535461,
0.6724304556846619,
-0.101937435567379,
1.0468467473983765,
-1.0250275135040283,
0.7794437408447266,
-0.9785480499267578,
-1.6938483715057373,
-1.3979201316833496,
-2.259873151779175,
-2.243540048599243,
0.7791751623153687,
-0.452364057302475,
-0.57818603515625,
2.0768754482269287,
-1.0700881481170654,
-1.739996314048767,
1.0930438041687012,
0.281719833612442,
0.008906741626560688,
2.378340005874634,
0.2526441812515259,
-0.7203893661499023,
0.4843027889728546,
-0.7691013216972351,
0.7793152332305908,
-0.2793711721897125,
1.382179856300354,
0.4443669319152832,
-1.0933326482772827,
1.5655096769332886,
-0.44966769218444824,
0.5801029801368713,
-0.594494104385376,
-0.5421668887138367,
-0.7353447675704956,
0.24949699640274048,
1.8815587759017944,
-0.26052534580230713,
1.5427982807159424,
-0.35099196434020996,
-1.6580642461776733,
-1.6590973138809204,
0.8649615049362183,
0.4632969796657562,
-0.7855021953582764,
0.1131933182477951,
-0.47784918546676636,
0.1048925593495369,
0.041526518762111664,
1.2390646934509277,
1.3128716945648193,
0.6531018614768982,
-0.4030846655368805,
-0.8126692175865173,
0.15200407803058624,
-0.06470845639705658,
-0.7087991833686829,
-1.7899096012115479,
-0.35062190890312195,
0.20234523713588715,
0.6552833914756775,
-1.1839383840560913,
1.7916535139083862,
0.9244098663330078,
1.91371488571167,
0.982195258140564,
-0.35161951184272766,
1.4709739685058594,
0.06170543283224106,
1.8076668977737427,
-0.4967227578163147,
0.6924989223480225,
-0.37446480989456177,
-1.1475586891174316,
0.7904874086380005,
-0.352630078792572,
-2.0495922565460205,
-0.784993052482605,
-0.7339880466461182,
-0.1399894505739212,
-0.7832950353622437,
0.9168249368667603,
-0.3361148536205292,
-1.4943307638168335,
0.191568985581398,
-0.7171045541763306,
0.21077293157577515,
-1.1997804641723633,
0.329965740442276,
0.6984550952911377,
-0.6635046601295471,
0.11533772200345993,
-0.23885409533977509,
-1.2473503351211548,
-0.5146815180778503,
0.271866112947464,
1.8774033784866333,
-0.7064959406852722,
0.9217275977134705,
1.0683215856552124,
-0.7025314569473267,
0.05051765590906143,
0.3040471076965332,
-0.3278622627258301,
0.8830869793891907,
-1.1087406873703003,
-0.35644012689590454,
1.2247896194458008,
-0.15238086879253387,
-0.6067793965339661,
1.410730004310608,
0.7680283188819885,
-1.016308069229126,
-0.20380298793315887,
-0.1411990225315094,
-0.8540043234825134,
0.07481364160776138,
-1.522090196609497,
-0.12823514640331268,
0.48620402812957764,
-1.4924805164337158,
-0.43667176365852356,
-0.16383124887943268,
1.2791913747787476,
-0.19118830561637878,
1.390853762626648,
-0.4047609567642212,
-0.15612484514713287,
-0.29898351430892944,
-0.3792724609375,
0.1329495757818222,
-0.1946209818124771,
-0.6530145406723022,
0.16107803583145142,
-0.7985470294952393,
0.2982448935508728,
1.4837706089019775,
0.42787131667137146,
0.03449661284685135,
0.4591967761516571,
1.1969916820526123,
0.35998648405075073,
-0.1141214594244957,
-0.8239149451255798,
-1.6157222986221313,
2.0071966648101807,
-1.4026145935058594,
1.9802812337875366,
0.7921321392059326,
-0.042006488889455795,
-1.7863940000534058,
-1.8585829734802246,
1.290173888206482,
1.1519566774368286,
2.426870107650757,
0.5208056569099426,
0.4265890419483185,
-0.8329137563705444,
-0.6926795840263367,
0.36930882930755615,
-1.0225499868392944,
-0.6591797471046448,
0.16508892178535461,
2.368185043334961,
1.8095749616622925,
-0.4727384150028229,
-0.19467832148075104,
-0.9958896636962891,
1.3674784898757935,
-0.2620728015899658,
0.25467997789382935,
1.935243844985962,
-0.2206370085477829,
-1.0521881580352783,
1.3514591455459595,
-2.274789810180664,
0.19494320452213287,
2.045893907546997,
0.23365184664726257,
0.11794169992208481,
-1.3867226839065552,
-0.6197702288627625,
-0.3298516571521759,
-0.3724164068698883,
-1.2480944395065308,
0.4907134175300598,
-0.24311697483062744,
-0.8163476586341858,
-1.3926293849945068,
0.16817116737365723,
-1.1389451026916504,
-1.6686077117919922,
0.29410743713378906,
1.9241273403167725,
2.1020069122314453,
-0.76520836353302,
1.561436414718628,
-0.30712807178497314,
0.14966383576393127,
1.1844006776809692,
1.3334907293319702,
3.1288537979125977,
1.8098686933517456,
-1.3103693723678589,
0.6662647724151611,
-0.14498382806777954,
-0.5045926570892334,
1.1591272354125977,
-1.234257459640503,
1.2798235416412354,
-0.10849984735250473,
-1.1931463479995728,
-1.2401033639907837,
0.9765093922615051,
0.511813759803772,
0.06237350404262543,
-0.4576704204082489,
1.1577140092849731,
0.046737413853406906,
1.3566731214523315,
0.5614393353462219,
-0.3243753910064697,
0.5850516557693481,
-0.36106446385383606,
-0.5654187798500061,
1.4720606803894043,
0.1600532829761505,
-1.437113642692566,
-2.2325220108032227,
-0.18387371301651,
-0.7906442284584045,
0.06312064081430435,
-0.6861430406570435,
-0.9769694209098816,
1.6663440465927124,
0.34448111057281494,
-1.2562439441680908,
-0.24181528389453888,
-0.34916943311691284,
-0.535322904586792,
2.6424765586853027,
-1.3074086904525757,
-0.14765049517154694,
-0.9981063604354858,
-0.6666267514228821,
1.6126532554626465,
-1.1260654926300049,
-0.23927028477191925,
-1.0537796020507812,
-0.5630018711090088,
-1.2659841775894165,
-0.5261600613594055,
0.06710357964038849,
-0.9868696331977844,
0.7178747057914734,
0.13949893414974213,
-1.1362526416778564,
-0.36735913157463074,
-0.9010234475135803,
0.9559107422828674,
-0.1743820309638977,
0.11435312777757645,
1.8490453958511353,
0.34077098965644836,
-0.3901214003562927,
0.7669761180877686,
1.176772952079773,
0.6003429889678955,
-0.6447871923446655,
0.13952834904193878,
-0.6812017560005188,
0.31988880038261414,
-1.36051607131958,
0.3337946832180023,
-2.859066963195801,
0.6829373836517334,
-0.06656322628259659,
-0.14797593653202057,
0.001444750465452671,
-1.3506354093551636,
1.0840740203857422,
2.5894596576690674,
-1.1882277727127075,
0.4818987250328064,
0.32420283555984497,
1.1111310720443726,
-1.6795217990875244,
0.31720009446144104,
-0.4423635005950928,
2.0221872329711914,
0.23435740172863007,
1.2680177688598633,
-0.5199272036552429,
-2.2819950580596924,
0.621296226978302,
-1.254020094871521,
-1.0809417963027954,
0.8199553489685059,
-0.9331535696983337,
0.1540672481060028,
-1.3892176151275635,
-0.32730090618133545,
-0.8660197854042053,
-1.1246663331985474,
0.6168437004089355,
0.1613800972700119,
0.41987407207489014,
-0.5136435031890869,
0.3189338743686676,
-2.272322654724121,
-1.3186430931091309,
-0.17571108043193817,
-0.9592571258544922,
0.5857236981391907,
-0.3780722916126251,
0.650839626789093,
-0.16737212240695953,
0.0013154204934835434,
0.38767609000205994,
1.5025783777236938,
3.389970541000366,
0.20225213468074799,
0.24381813406944275,
-0.15255875885486603,
-0.9369668364524841,
1.41533362865448,
0.8609926700592041,
-0.19099688529968262,
-0.5756115317344666,
-1.0514761209487915,
1.28162682056427,
1.9142260551452637,
0.9662147760391235,
-0.028119679540395737,
-0.8893063068389893,
-0.7600444555282593,
-0.0347595177590847,
0.15274105966091156,
0.40866953134536743,
0.8677349090576172,
0.18397879600524902,
0.08664620667695999,
1.464106798171997,
1.212233304977417,
-0.4454899728298187,
0.353628009557724,
-0.8537306189537048,
-0.45114409923553467,
0.4397623538970947,
0.281556099653244,
-0.05764469504356384,
0.32415658235549927,
-1.033489465713501,
-0.2066495418548584,
-0.40679478645324707,
-0.9256564378738403,
-0.793274462223053,
-0.4112702012062073,
-0.3477209508419037,
1.6259478330612183,
0.1226087436079979,
-0.5532164573669434,
-0.050038378685712814,
-0.8062185049057007,
-0.1780952513217926,
-1.0363116264343262,
0.26823821663856506,
-0.06674559414386749,
-0.13193441927433014,
-0.19742664694786072,
1.6681761741638184,
-0.9554153084754944,
-2.0709786415100098,
0.1939898133277893,
0.23655007779598236,
-0.2969881594181061,
0.1353280246257782,
1.6935700178146362,
0.5369395017623901,
1.4587482213974,
1.2912410497665405,
0.9042574167251587,
-0.6973049640655518,
-1.2924975156784058,
0.7150086760520935,
0.9678940176963806,
-1.3956266641616821,
0.8214772939682007,
-0.11786721646785736,
-0.46477019786834717,
0.6022540330886841,
1.2856194972991943,
0.5307503342628479,
-1.992182731628418,
0.8495544195175171,
-1.006593108177185,
0.7702540755271912,
0.7664495706558228,
0.6361990571022034,
0.19016899168491364,
0.8413786292076111,
-1.2448914051055908,
-1.1749722957611084,
-0.6532060503959656,
-0.7146669626235962,
1.9340896606445312,
-0.31178018450737,
0.6239361763000488,
-0.21617260575294495,
-1.2158901691436768,
-0.09333990514278412,
0.7446455359458923,
0.31973448395729065,
-0.4713742434978485,
0.8087001442909241,
-0.6334474086761475,
-1.0231162309646606,
-1.3708226680755615,
-0.43711405992507935,
-1.048536777496338,
-0.9694881439208984,
0.9131231904029846,
0.7782614827156067,
0.3517824411392212,
1.8862236738204956,
0.6714057326316833,
0.306791216135025,
-2.6030285358428955,
0.8621639013290405,
0.2676733732223511,
-0.06808492541313171,
0.883309006690979,
0.362884521484375,
1.0252817869186401,
0.0020881323143839836,
0.5179023742675781,
-2.3862080574035645,
2.257603645324707,
-0.16850297152996063,
0.6480813026428223,
-0.0683922991156578,
-0.15334925055503845,
1.1617505550384521,
0.6016548275947571,
0.5385868549346924,
-1.0553938150405884,
0.6539948582649231,
-0.5602283477783203,
1.219348430633545,
0.8073272705078125,
-0.8498780131340027,
0.01812680810689926,
1.404471516609192,
0.40335601568222046,
-0.5699864029884338,
-0.9647572040557861,
-0.9221403002738953,
0.8996856808662415,
1.6903843879699707,
-0.03292599320411682,
-0.03700825572013855,
0.7453815937042236,
0.6980094909667969,
-1.318013072013855,
0.06005515158176422,
-0.6141734719276428,
-0.7575258016586304,
1.6861062049865723,
2.100870132446289,
-0.15646304190158844,
-0.21467837691307068,
-0.6671448349952698,
-1.2803055047988892,
0.8249780535697937,
-0.07361974567174911,
0.10443954914808273,
0.632321298122406,
-0.6942756772041321,
1.0874426364898682,
0.8532637357711792,
0.9378148913383484,
0.2387325018644333,
0.2664787471294403,
0.42157265543937683,
-0.3465708792209625,
-1.2244127988815308,
-0.28240054845809937,
-1.1089738607406616,
-2.598557472229004,
0.3991154134273529,
-0.18377608060836792,
-1.4373836517333984,
0.032505448907613754,
-1.0242246389389038,
0.9224293828010559,
-0.648020327091217,
-1.083065152168274,
-1.5118992328643799,
0.22164861857891083,
-0.06929201632738113,
0.9505371451377869,
-1.610608458518982,
-0.16076675057411194,
1.1655131578445435,
0.9485218524932861,
-0.6287582516670227,
1.017970323562622,
0.19189395010471344,
1.019376516342163,
0.881405234336853,
-0.3901577591896057,
0.5577489137649536,
0.0365796722471714,
-1.3785642385482788,
0.42650288343429565,
1.2448222637176514,
0.19750314950942993,
1.4672907590866089,
-0.48292994499206543,
0.0318870022892952,
0.414307564496994,
-0.6287082433700562,
-0.4888523817062378,
-0.43239471316337585,
0.6684964895248413,
0.08432838320732117,
-0.9175506830215454,
-0.09081211686134338,
-0.05782536789774895,
-0.26295435428619385,
0.24902477860450745,
-1.48149573802948,
-0.20921257138252258,
-0.38195598125457764,
-0.5876188278198242,
-1.2107875347137451,
-0.14657805860042572,
1.3973493576049805,
-0.8044940829277039,
-0.19253621995449066,
0.5131112337112427,
0.3424886167049408,
0.46737074851989746,
0.678922176361084,
-0.8116272687911987,
-0.28185075521469116,
-0.22640807926654816,
-0.31366875767707825,
0.3196541965007782,
1.342352032661438,
-0.032387085258960724,
-0.8783203363418579,
0.6310971975326538,
-0.29867228865623474,
0.12962423264980316,
1.9445734024047852,
0.07405976951122284,
-0.7987595796585083,
0.2566708028316498,
-0.7875290513038635,
1.9510339498519897,
1.745648741722107,
1.2961316108703613,
-0.12333840131759644,
-0.9219222664833069,
0.641269862651825,
-0.3431878387928009,
-0.3386867642402649,
0.9251767992973328,
0.40013203024864197,
-0.19691026210784912,
-1.3767236471176147,
0.7505810260772705,
1.2565701007843018,
-0.8602443933486938,
-0.79136061668396,
0.14068739116191864,
-0.8215237259864807,
1.1031270027160645,
0.6536604762077332,
0.31910353899002075,
0.29210594296455383,
1.628665566444397,
0.7785674929618835,
-0.4112801253795624,
0.5156480669975281,
0.5212418437004089,
-0.1201367899775505,
-2.134906530380249,
-1.1480786800384521,
0.34161150455474854,
-0.5448242425918579,
-1.6037064790725708,
1.3668931722640991,
-1.1114294528961182,
-0.9869399070739746,
0.6385155916213989,
0.07644679397344589,
1.36211359500885,
0.3642447590827942,
1.6231374740600586,
2.138058662414551,
0.8603616952896118,
0.33243289589881897,
1.2501112222671509,
-0.13480354845523834,
-0.4335775375366211,
1.7846237421035767,
-0.47297203540802,
0.5162733793258667,
1.0696066617965698,
-0.3468702435493469,
-1.109035849571228,
-0.8235945701599121,
-1.2255563735961914,
-0.726676344871521,
1.121450662612915,
0.16285693645477295,
-1.087782382965088,
0.2538735866546631,
1.6188344955444336,
0.06094513088464737,
-0.2887183427810669,
0.6261609792709351,
0.42095208168029785,
-0.7795237302780151,
-0.06686680018901825,
-0.9138645529747009,
0.5732158422470093,
-0.20531214773654938,
-0.38714298605918884,
0.2692232131958008,
0.4880647659301758,
1.2931008338928223,
-0.05807570368051529,
0.06021587550640106,
1.0877163410186768,
-1.3864737749099731,
1.4752006530761719,
-0.7385877370834351,
0.3225972354412079,
-2.360701560974121,
1.4418747425079346,
-0.7699537873268127,
1.9386522769927979,
-2.650287389755249,
0.5178802013397217,
-0.5528347492218018,
-0.5609498023986816,
0.27745458483695984,
-0.39704570174217224,
0.1605527251958847,
-0.08412831276655197,
-1.0984654426574707,
-0.05926140397787094,
-0.6679657697677612,
0.6155198812484741,
1.2103370428085327,
1.3707938194274902,
-1.2190546989440918,
-0.24441315233707428,
-1.7259461879730225,
-0.16987529397010803,
-0.7472811341285706,
0.27537378668785095,
-1.9482885599136353,
-0.2026057094335556,
-1.9212568998336792,
-2.4384162425994873,
-1.2924424409866333,
-0.7341731190681458,
1.0986510515213013,
0.14043542742729187,
-0.8292104601860046,
1.2580426931381226,
-0.3628932237625122,
-1.7947641611099243,
1.0949991941452026,
-2.1747941970825195
] |
https://github.com/huggingface/datasets/issues/5094 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock | Indeed it should be fine. I couldn't reproduce the error though - I ran your script on my side and it works fine. What version of pytorch are you using ? | ## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
| 485 | 31 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock
## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
Indeed it should be fine. I couldn't reproduce the error though - I ran your script on my side and it works fine. What version of pytorch are you using ? | [
-1.2728172540664673,
-0.898106038570404,
-0.6675035357475281,
1.5078846216201782,
-0.15048755705356598,
-1.1838184595108032,
0.1676679104566574,
-1.037777066230774,
1.6529299020767212,
-0.8306827545166016,
0.33186355233192444,
-1.642417550086975,
0.025884125381708145,
-0.5294846892356873,
-0.7099189162254333,
-0.8553285002708435,
-0.3630971908569336,
-0.7704471349716187,
1.1102064847946167,
2.4790022373199463,
1.2116022109985352,
-1.3617780208587646,
2.721543312072754,
0.7294445633888245,
-0.27313902974128723,
-1.022451400756836,
0.5119602680206299,
0.02420932799577713,
-1.3098320960998535,
-0.4780839681625366,
-0.9773918986320496,
-0.06110548600554466,
-0.5749793648719788,
-0.530600368976593,
0.048546627163887024,
0.4360436201095581,
-0.34067589044570923,
-0.43972447514533997,
-0.5995767712593079,
-0.8195635676383972,
0.5065432786941528,
-0.3635629713535309,
0.8847498893737793,
-0.3069908618927002,
1.8620855808258057,
-0.5903087854385376,
0.46847742795944214,
0.7048625349998474,
1.3212766647338867,
0.2136135846376419,
-0.008978569880127907,
0.3795269727706909,
0.34761202335357666,
-0.03379765525460243,
0.528163492679596,
1.2579987049102783,
0.6583824753761292,
0.5207197666168213,
0.768476665019989,
-2.2253053188323975,
1.3710949420928955,
-0.9576165080070496,
0.33361122012138367,
1.3393239974975586,
-0.9172539114952087,
0.2899286150932312,
-1.7659608125686646,
-0.05864223465323448,
0.5995616912841797,
-2.2474288940429688,
0.306321382522583,
-1.3535258769989014,
-0.5243438482284546,
1.055833101272583,
0.3606233596801758,
-1.2128578424453735,
0.1498764455318451,
-0.42331913113594055,
1.1061313152313232,
0.3940792381763458,
1.0456103086471558,
-1.6636619567871094,
-0.07841675728559494,
-0.23848757147789001,
0.11999284476041794,
-1.2947020530700684,
-1.5918309688568115,
0.5457575917243958,
0.5756939053535461,
0.6724304556846619,
-0.101937435567379,
1.0468467473983765,
-1.0250275135040283,
0.7794437408447266,
-0.9785480499267578,
-1.6938483715057373,
-1.3979201316833496,
-2.259873151779175,
-2.243540048599243,
0.7791751623153687,
-0.452364057302475,
-0.57818603515625,
2.0768754482269287,
-1.0700881481170654,
-1.739996314048767,
1.0930438041687012,
0.281719833612442,
0.008906741626560688,
2.378340005874634,
0.2526441812515259,
-0.7203893661499023,
0.4843027889728546,
-0.7691013216972351,
0.7793152332305908,
-0.2793711721897125,
1.382179856300354,
0.4443669319152832,
-1.0933326482772827,
1.5655096769332886,
-0.44966769218444824,
0.5801029801368713,
-0.594494104385376,
-0.5421668887138367,
-0.7353447675704956,
0.24949699640274048,
1.8815587759017944,
-0.26052534580230713,
1.5427982807159424,
-0.35099196434020996,
-1.6580642461776733,
-1.6590973138809204,
0.8649615049362183,
0.4632969796657562,
-0.7855021953582764,
0.1131933182477951,
-0.47784918546676636,
0.1048925593495369,
0.041526518762111664,
1.2390646934509277,
1.3128716945648193,
0.6531018614768982,
-0.4030846655368805,
-0.8126692175865173,
0.15200407803058624,
-0.06470845639705658,
-0.7087991833686829,
-1.7899096012115479,
-0.35062190890312195,
0.20234523713588715,
0.6552833914756775,
-1.1839383840560913,
1.7916535139083862,
0.9244098663330078,
1.91371488571167,
0.982195258140564,
-0.35161951184272766,
1.4709739685058594,
0.06170543283224106,
1.8076668977737427,
-0.4967227578163147,
0.6924989223480225,
-0.37446480989456177,
-1.1475586891174316,
0.7904874086380005,
-0.352630078792572,
-2.0495922565460205,
-0.784993052482605,
-0.7339880466461182,
-0.1399894505739212,
-0.7832950353622437,
0.9168249368667603,
-0.3361148536205292,
-1.4943307638168335,
0.191568985581398,
-0.7171045541763306,
0.21077293157577515,
-1.1997804641723633,
0.329965740442276,
0.6984550952911377,
-0.6635046601295471,
0.11533772200345993,
-0.23885409533977509,
-1.2473503351211548,
-0.5146815180778503,
0.271866112947464,
1.8774033784866333,
-0.7064959406852722,
0.9217275977134705,
1.0683215856552124,
-0.7025314569473267,
0.05051765590906143,
0.3040471076965332,
-0.3278622627258301,
0.8830869793891907,
-1.1087406873703003,
-0.35644012689590454,
1.2247896194458008,
-0.15238086879253387,
-0.6067793965339661,
1.410730004310608,
0.7680283188819885,
-1.016308069229126,
-0.20380298793315887,
-0.1411990225315094,
-0.8540043234825134,
0.07481364160776138,
-1.522090196609497,
-0.12823514640331268,
0.48620402812957764,
-1.4924805164337158,
-0.43667176365852356,
-0.16383124887943268,
1.2791913747787476,
-0.19118830561637878,
1.390853762626648,
-0.4047609567642212,
-0.15612484514713287,
-0.29898351430892944,
-0.3792724609375,
0.1329495757818222,
-0.1946209818124771,
-0.6530145406723022,
0.16107803583145142,
-0.7985470294952393,
0.2982448935508728,
1.4837706089019775,
0.42787131667137146,
0.03449661284685135,
0.4591967761516571,
1.1969916820526123,
0.35998648405075073,
-0.1141214594244957,
-0.8239149451255798,
-1.6157222986221313,
2.0071966648101807,
-1.4026145935058594,
1.9802812337875366,
0.7921321392059326,
-0.042006488889455795,
-1.7863940000534058,
-1.8585829734802246,
1.290173888206482,
1.1519566774368286,
2.426870107650757,
0.5208056569099426,
0.4265890419483185,
-0.8329137563705444,
-0.6926795840263367,
0.36930882930755615,
-1.0225499868392944,
-0.6591797471046448,
0.16508892178535461,
2.368185043334961,
1.8095749616622925,
-0.4727384150028229,
-0.19467832148075104,
-0.9958896636962891,
1.3674784898757935,
-0.2620728015899658,
0.25467997789382935,
1.935243844985962,
-0.2206370085477829,
-1.0521881580352783,
1.3514591455459595,
-2.274789810180664,
0.19494320452213287,
2.045893907546997,
0.23365184664726257,
0.11794169992208481,
-1.3867226839065552,
-0.6197702288627625,
-0.3298516571521759,
-0.3724164068698883,
-1.2480944395065308,
0.4907134175300598,
-0.24311697483062744,
-0.8163476586341858,
-1.3926293849945068,
0.16817116737365723,
-1.1389451026916504,
-1.6686077117919922,
0.29410743713378906,
1.9241273403167725,
2.1020069122314453,
-0.76520836353302,
1.561436414718628,
-0.30712807178497314,
0.14966383576393127,
1.1844006776809692,
1.3334907293319702,
3.1288537979125977,
1.8098686933517456,
-1.3103693723678589,
0.6662647724151611,
-0.14498382806777954,
-0.5045926570892334,
1.1591272354125977,
-1.234257459640503,
1.2798235416412354,
-0.10849984735250473,
-1.1931463479995728,
-1.2401033639907837,
0.9765093922615051,
0.511813759803772,
0.06237350404262543,
-0.4576704204082489,
1.1577140092849731,
0.046737413853406906,
1.3566731214523315,
0.5614393353462219,
-0.3243753910064697,
0.5850516557693481,
-0.36106446385383606,
-0.5654187798500061,
1.4720606803894043,
0.1600532829761505,
-1.437113642692566,
-2.2325220108032227,
-0.18387371301651,
-0.7906442284584045,
0.06312064081430435,
-0.6861430406570435,
-0.9769694209098816,
1.6663440465927124,
0.34448111057281494,
-1.2562439441680908,
-0.24181528389453888,
-0.34916943311691284,
-0.535322904586792,
2.6424765586853027,
-1.3074086904525757,
-0.14765049517154694,
-0.9981063604354858,
-0.6666267514228821,
1.6126532554626465,
-1.1260654926300049,
-0.23927028477191925,
-1.0537796020507812,
-0.5630018711090088,
-1.2659841775894165,
-0.5261600613594055,
0.06710357964038849,
-0.9868696331977844,
0.7178747057914734,
0.13949893414974213,
-1.1362526416778564,
-0.36735913157463074,
-0.9010234475135803,
0.9559107422828674,
-0.1743820309638977,
0.11435312777757645,
1.8490453958511353,
0.34077098965644836,
-0.3901214003562927,
0.7669761180877686,
1.176772952079773,
0.6003429889678955,
-0.6447871923446655,
0.13952834904193878,
-0.6812017560005188,
0.31988880038261414,
-1.36051607131958,
0.3337946832180023,
-2.859066963195801,
0.6829373836517334,
-0.06656322628259659,
-0.14797593653202057,
0.001444750465452671,
-1.3506354093551636,
1.0840740203857422,
2.5894596576690674,
-1.1882277727127075,
0.4818987250328064,
0.32420283555984497,
1.1111310720443726,
-1.6795217990875244,
0.31720009446144104,
-0.4423635005950928,
2.0221872329711914,
0.23435740172863007,
1.2680177688598633,
-0.5199272036552429,
-2.2819950580596924,
0.621296226978302,
-1.254020094871521,
-1.0809417963027954,
0.8199553489685059,
-0.9331535696983337,
0.1540672481060028,
-1.3892176151275635,
-0.32730090618133545,
-0.8660197854042053,
-1.1246663331985474,
0.6168437004089355,
0.1613800972700119,
0.41987407207489014,
-0.5136435031890869,
0.3189338743686676,
-2.272322654724121,
-1.3186430931091309,
-0.17571108043193817,
-0.9592571258544922,
0.5857236981391907,
-0.3780722916126251,
0.650839626789093,
-0.16737212240695953,
0.0013154204934835434,
0.38767609000205994,
1.5025783777236938,
3.389970541000366,
0.20225213468074799,
0.24381813406944275,
-0.15255875885486603,
-0.9369668364524841,
1.41533362865448,
0.8609926700592041,
-0.19099688529968262,
-0.5756115317344666,
-1.0514761209487915,
1.28162682056427,
1.9142260551452637,
0.9662147760391235,
-0.028119679540395737,
-0.8893063068389893,
-0.7600444555282593,
-0.0347595177590847,
0.15274105966091156,
0.40866953134536743,
0.8677349090576172,
0.18397879600524902,
0.08664620667695999,
1.464106798171997,
1.212233304977417,
-0.4454899728298187,
0.353628009557724,
-0.8537306189537048,
-0.45114409923553467,
0.4397623538970947,
0.281556099653244,
-0.05764469504356384,
0.32415658235549927,
-1.033489465713501,
-0.2066495418548584,
-0.40679478645324707,
-0.9256564378738403,
-0.793274462223053,
-0.4112702012062073,
-0.3477209508419037,
1.6259478330612183,
0.1226087436079979,
-0.5532164573669434,
-0.050038378685712814,
-0.8062185049057007,
-0.1780952513217926,
-1.0363116264343262,
0.26823821663856506,
-0.06674559414386749,
-0.13193441927433014,
-0.19742664694786072,
1.6681761741638184,
-0.9554153084754944,
-2.0709786415100098,
0.1939898133277893,
0.23655007779598236,
-0.2969881594181061,
0.1353280246257782,
1.6935700178146362,
0.5369395017623901,
1.4587482213974,
1.2912410497665405,
0.9042574167251587,
-0.6973049640655518,
-1.2924975156784058,
0.7150086760520935,
0.9678940176963806,
-1.3956266641616821,
0.8214772939682007,
-0.11786721646785736,
-0.46477019786834717,
0.6022540330886841,
1.2856194972991943,
0.5307503342628479,
-1.992182731628418,
0.8495544195175171,
-1.006593108177185,
0.7702540755271912,
0.7664495706558228,
0.6361990571022034,
0.19016899168491364,
0.8413786292076111,
-1.2448914051055908,
-1.1749722957611084,
-0.6532060503959656,
-0.7146669626235962,
1.9340896606445312,
-0.31178018450737,
0.6239361763000488,
-0.21617260575294495,
-1.2158901691436768,
-0.09333990514278412,
0.7446455359458923,
0.31973448395729065,
-0.4713742434978485,
0.8087001442909241,
-0.6334474086761475,
-1.0231162309646606,
-1.3708226680755615,
-0.43711405992507935,
-1.048536777496338,
-0.9694881439208984,
0.9131231904029846,
0.7782614827156067,
0.3517824411392212,
1.8862236738204956,
0.6714057326316833,
0.306791216135025,
-2.6030285358428955,
0.8621639013290405,
0.2676733732223511,
-0.06808492541313171,
0.883309006690979,
0.362884521484375,
1.0252817869186401,
0.0020881323143839836,
0.5179023742675781,
-2.3862080574035645,
2.257603645324707,
-0.16850297152996063,
0.6480813026428223,
-0.0683922991156578,
-0.15334925055503845,
1.1617505550384521,
0.6016548275947571,
0.5385868549346924,
-1.0553938150405884,
0.6539948582649231,
-0.5602283477783203,
1.219348430633545,
0.8073272705078125,
-0.8498780131340027,
0.01812680810689926,
1.404471516609192,
0.40335601568222046,
-0.5699864029884338,
-0.9647572040557861,
-0.9221403002738953,
0.8996856808662415,
1.6903843879699707,
-0.03292599320411682,
-0.03700825572013855,
0.7453815937042236,
0.6980094909667969,
-1.318013072013855,
0.06005515158176422,
-0.6141734719276428,
-0.7575258016586304,
1.6861062049865723,
2.100870132446289,
-0.15646304190158844,
-0.21467837691307068,
-0.6671448349952698,
-1.2803055047988892,
0.8249780535697937,
-0.07361974567174911,
0.10443954914808273,
0.632321298122406,
-0.6942756772041321,
1.0874426364898682,
0.8532637357711792,
0.9378148913383484,
0.2387325018644333,
0.2664787471294403,
0.42157265543937683,
-0.3465708792209625,
-1.2244127988815308,
-0.28240054845809937,
-1.1089738607406616,
-2.598557472229004,
0.3991154134273529,
-0.18377608060836792,
-1.4373836517333984,
0.032505448907613754,
-1.0242246389389038,
0.9224293828010559,
-0.648020327091217,
-1.083065152168274,
-1.5118992328643799,
0.22164861857891083,
-0.06929201632738113,
0.9505371451377869,
-1.610608458518982,
-0.16076675057411194,
1.1655131578445435,
0.9485218524932861,
-0.6287582516670227,
1.017970323562622,
0.19189395010471344,
1.019376516342163,
0.881405234336853,
-0.3901577591896057,
0.5577489137649536,
0.0365796722471714,
-1.3785642385482788,
0.42650288343429565,
1.2448222637176514,
0.19750314950942993,
1.4672907590866089,
-0.48292994499206543,
0.0318870022892952,
0.414307564496994,
-0.6287082433700562,
-0.4888523817062378,
-0.43239471316337585,
0.6684964895248413,
0.08432838320732117,
-0.9175506830215454,
-0.09081211686134338,
-0.05782536789774895,
-0.26295435428619385,
0.24902477860450745,
-1.48149573802948,
-0.20921257138252258,
-0.38195598125457764,
-0.5876188278198242,
-1.2107875347137451,
-0.14657805860042572,
1.3973493576049805,
-0.8044940829277039,
-0.19253621995449066,
0.5131112337112427,
0.3424886167049408,
0.46737074851989746,
0.678922176361084,
-0.8116272687911987,
-0.28185075521469116,
-0.22640807926654816,
-0.31366875767707825,
0.3196541965007782,
1.342352032661438,
-0.032387085258960724,
-0.8783203363418579,
0.6310971975326538,
-0.29867228865623474,
0.12962423264980316,
1.9445734024047852,
0.07405976951122284,
-0.7987595796585083,
0.2566708028316498,
-0.7875290513038635,
1.9510339498519897,
1.745648741722107,
1.2961316108703613,
-0.12333840131759644,
-0.9219222664833069,
0.641269862651825,
-0.3431878387928009,
-0.3386867642402649,
0.9251767992973328,
0.40013203024864197,
-0.19691026210784912,
-1.3767236471176147,
0.7505810260772705,
1.2565701007843018,
-0.8602443933486938,
-0.79136061668396,
0.14068739116191864,
-0.8215237259864807,
1.1031270027160645,
0.6536604762077332,
0.31910353899002075,
0.29210594296455383,
1.628665566444397,
0.7785674929618835,
-0.4112801253795624,
0.5156480669975281,
0.5212418437004089,
-0.1201367899775505,
-2.134906530380249,
-1.1480786800384521,
0.34161150455474854,
-0.5448242425918579,
-1.6037064790725708,
1.3668931722640991,
-1.1114294528961182,
-0.9869399070739746,
0.6385155916213989,
0.07644679397344589,
1.36211359500885,
0.3642447590827942,
1.6231374740600586,
2.138058662414551,
0.8603616952896118,
0.33243289589881897,
1.2501112222671509,
-0.13480354845523834,
-0.4335775375366211,
1.7846237421035767,
-0.47297203540802,
0.5162733793258667,
1.0696066617965698,
-0.3468702435493469,
-1.109035849571228,
-0.8235945701599121,
-1.2255563735961914,
-0.726676344871521,
1.121450662612915,
0.16285693645477295,
-1.087782382965088,
0.2538735866546631,
1.6188344955444336,
0.06094513088464737,
-0.2887183427810669,
0.6261609792709351,
0.42095208168029785,
-0.7795237302780151,
-0.06686680018901825,
-0.9138645529747009,
0.5732158422470093,
-0.20531214773654938,
-0.38714298605918884,
0.2692232131958008,
0.4880647659301758,
1.2931008338928223,
-0.05807570368051529,
0.06021587550640106,
1.0877163410186768,
-1.3864737749099731,
1.4752006530761719,
-0.7385877370834351,
0.3225972354412079,
-2.360701560974121,
1.4418747425079346,
-0.7699537873268127,
1.9386522769927979,
-2.650287389755249,
0.5178802013397217,
-0.5528347492218018,
-0.5609498023986816,
0.27745458483695984,
-0.39704570174217224,
0.1605527251958847,
-0.08412831276655197,
-1.0984654426574707,
-0.05926140397787094,
-0.6679657697677612,
0.6155198812484741,
1.2103370428085327,
1.3707938194274902,
-1.2190546989440918,
-0.24441315233707428,
-1.7259461879730225,
-0.16987529397010803,
-0.7472811341285706,
0.27537378668785095,
-1.9482885599136353,
-0.2026057094335556,
-1.9212568998336792,
-2.4384162425994873,
-1.2924424409866333,
-0.7341731190681458,
1.0986510515213013,
0.14043542742729187,
-0.8292104601860046,
1.2580426931381226,
-0.3628932237625122,
-1.7947641611099243,
1.0949991941452026,
-2.1747941970825195
] |
https://github.com/huggingface/datasets/issues/5094 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock | I also tried on colab and it works fine 🤔
Maybe something is wrong with your installation of pytorch ? | ## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
| 485 | 20 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock
## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
I also tried on colab and it works fine 🤔
Maybe something is wrong with your installation of pytorch ? | [
-1.2728172540664673,
-0.898106038570404,
-0.6675035357475281,
1.5078846216201782,
-0.15048755705356598,
-1.1838184595108032,
0.1676679104566574,
-1.037777066230774,
1.6529299020767212,
-0.8306827545166016,
0.33186355233192444,
-1.642417550086975,
0.025884125381708145,
-0.5294846892356873,
-0.7099189162254333,
-0.8553285002708435,
-0.3630971908569336,
-0.7704471349716187,
1.1102064847946167,
2.4790022373199463,
1.2116022109985352,
-1.3617780208587646,
2.721543312072754,
0.7294445633888245,
-0.27313902974128723,
-1.022451400756836,
0.5119602680206299,
0.02420932799577713,
-1.3098320960998535,
-0.4780839681625366,
-0.9773918986320496,
-0.06110548600554466,
-0.5749793648719788,
-0.530600368976593,
0.048546627163887024,
0.4360436201095581,
-0.34067589044570923,
-0.43972447514533997,
-0.5995767712593079,
-0.8195635676383972,
0.5065432786941528,
-0.3635629713535309,
0.8847498893737793,
-0.3069908618927002,
1.8620855808258057,
-0.5903087854385376,
0.46847742795944214,
0.7048625349998474,
1.3212766647338867,
0.2136135846376419,
-0.008978569880127907,
0.3795269727706909,
0.34761202335357666,
-0.03379765525460243,
0.528163492679596,
1.2579987049102783,
0.6583824753761292,
0.5207197666168213,
0.768476665019989,
-2.2253053188323975,
1.3710949420928955,
-0.9576165080070496,
0.33361122012138367,
1.3393239974975586,
-0.9172539114952087,
0.2899286150932312,
-1.7659608125686646,
-0.05864223465323448,
0.5995616912841797,
-2.2474288940429688,
0.306321382522583,
-1.3535258769989014,
-0.5243438482284546,
1.055833101272583,
0.3606233596801758,
-1.2128578424453735,
0.1498764455318451,
-0.42331913113594055,
1.1061313152313232,
0.3940792381763458,
1.0456103086471558,
-1.6636619567871094,
-0.07841675728559494,
-0.23848757147789001,
0.11999284476041794,
-1.2947020530700684,
-1.5918309688568115,
0.5457575917243958,
0.5756939053535461,
0.6724304556846619,
-0.101937435567379,
1.0468467473983765,
-1.0250275135040283,
0.7794437408447266,
-0.9785480499267578,
-1.6938483715057373,
-1.3979201316833496,
-2.259873151779175,
-2.243540048599243,
0.7791751623153687,
-0.452364057302475,
-0.57818603515625,
2.0768754482269287,
-1.0700881481170654,
-1.739996314048767,
1.0930438041687012,
0.281719833612442,
0.008906741626560688,
2.378340005874634,
0.2526441812515259,
-0.7203893661499023,
0.4843027889728546,
-0.7691013216972351,
0.7793152332305908,
-0.2793711721897125,
1.382179856300354,
0.4443669319152832,
-1.0933326482772827,
1.5655096769332886,
-0.44966769218444824,
0.5801029801368713,
-0.594494104385376,
-0.5421668887138367,
-0.7353447675704956,
0.24949699640274048,
1.8815587759017944,
-0.26052534580230713,
1.5427982807159424,
-0.35099196434020996,
-1.6580642461776733,
-1.6590973138809204,
0.8649615049362183,
0.4632969796657562,
-0.7855021953582764,
0.1131933182477951,
-0.47784918546676636,
0.1048925593495369,
0.041526518762111664,
1.2390646934509277,
1.3128716945648193,
0.6531018614768982,
-0.4030846655368805,
-0.8126692175865173,
0.15200407803058624,
-0.06470845639705658,
-0.7087991833686829,
-1.7899096012115479,
-0.35062190890312195,
0.20234523713588715,
0.6552833914756775,
-1.1839383840560913,
1.7916535139083862,
0.9244098663330078,
1.91371488571167,
0.982195258140564,
-0.35161951184272766,
1.4709739685058594,
0.06170543283224106,
1.8076668977737427,
-0.4967227578163147,
0.6924989223480225,
-0.37446480989456177,
-1.1475586891174316,
0.7904874086380005,
-0.352630078792572,
-2.0495922565460205,
-0.784993052482605,
-0.7339880466461182,
-0.1399894505739212,
-0.7832950353622437,
0.9168249368667603,
-0.3361148536205292,
-1.4943307638168335,
0.191568985581398,
-0.7171045541763306,
0.21077293157577515,
-1.1997804641723633,
0.329965740442276,
0.6984550952911377,
-0.6635046601295471,
0.11533772200345993,
-0.23885409533977509,
-1.2473503351211548,
-0.5146815180778503,
0.271866112947464,
1.8774033784866333,
-0.7064959406852722,
0.9217275977134705,
1.0683215856552124,
-0.7025314569473267,
0.05051765590906143,
0.3040471076965332,
-0.3278622627258301,
0.8830869793891907,
-1.1087406873703003,
-0.35644012689590454,
1.2247896194458008,
-0.15238086879253387,
-0.6067793965339661,
1.410730004310608,
0.7680283188819885,
-1.016308069229126,
-0.20380298793315887,
-0.1411990225315094,
-0.8540043234825134,
0.07481364160776138,
-1.522090196609497,
-0.12823514640331268,
0.48620402812957764,
-1.4924805164337158,
-0.43667176365852356,
-0.16383124887943268,
1.2791913747787476,
-0.19118830561637878,
1.390853762626648,
-0.4047609567642212,
-0.15612484514713287,
-0.29898351430892944,
-0.3792724609375,
0.1329495757818222,
-0.1946209818124771,
-0.6530145406723022,
0.16107803583145142,
-0.7985470294952393,
0.2982448935508728,
1.4837706089019775,
0.42787131667137146,
0.03449661284685135,
0.4591967761516571,
1.1969916820526123,
0.35998648405075073,
-0.1141214594244957,
-0.8239149451255798,
-1.6157222986221313,
2.0071966648101807,
-1.4026145935058594,
1.9802812337875366,
0.7921321392059326,
-0.042006488889455795,
-1.7863940000534058,
-1.8585829734802246,
1.290173888206482,
1.1519566774368286,
2.426870107650757,
0.5208056569099426,
0.4265890419483185,
-0.8329137563705444,
-0.6926795840263367,
0.36930882930755615,
-1.0225499868392944,
-0.6591797471046448,
0.16508892178535461,
2.368185043334961,
1.8095749616622925,
-0.4727384150028229,
-0.19467832148075104,
-0.9958896636962891,
1.3674784898757935,
-0.2620728015899658,
0.25467997789382935,
1.935243844985962,
-0.2206370085477829,
-1.0521881580352783,
1.3514591455459595,
-2.274789810180664,
0.19494320452213287,
2.045893907546997,
0.23365184664726257,
0.11794169992208481,
-1.3867226839065552,
-0.6197702288627625,
-0.3298516571521759,
-0.3724164068698883,
-1.2480944395065308,
0.4907134175300598,
-0.24311697483062744,
-0.8163476586341858,
-1.3926293849945068,
0.16817116737365723,
-1.1389451026916504,
-1.6686077117919922,
0.29410743713378906,
1.9241273403167725,
2.1020069122314453,
-0.76520836353302,
1.561436414718628,
-0.30712807178497314,
0.14966383576393127,
1.1844006776809692,
1.3334907293319702,
3.1288537979125977,
1.8098686933517456,
-1.3103693723678589,
0.6662647724151611,
-0.14498382806777954,
-0.5045926570892334,
1.1591272354125977,
-1.234257459640503,
1.2798235416412354,
-0.10849984735250473,
-1.1931463479995728,
-1.2401033639907837,
0.9765093922615051,
0.511813759803772,
0.06237350404262543,
-0.4576704204082489,
1.1577140092849731,
0.046737413853406906,
1.3566731214523315,
0.5614393353462219,
-0.3243753910064697,
0.5850516557693481,
-0.36106446385383606,
-0.5654187798500061,
1.4720606803894043,
0.1600532829761505,
-1.437113642692566,
-2.2325220108032227,
-0.18387371301651,
-0.7906442284584045,
0.06312064081430435,
-0.6861430406570435,
-0.9769694209098816,
1.6663440465927124,
0.34448111057281494,
-1.2562439441680908,
-0.24181528389453888,
-0.34916943311691284,
-0.535322904586792,
2.6424765586853027,
-1.3074086904525757,
-0.14765049517154694,
-0.9981063604354858,
-0.6666267514228821,
1.6126532554626465,
-1.1260654926300049,
-0.23927028477191925,
-1.0537796020507812,
-0.5630018711090088,
-1.2659841775894165,
-0.5261600613594055,
0.06710357964038849,
-0.9868696331977844,
0.7178747057914734,
0.13949893414974213,
-1.1362526416778564,
-0.36735913157463074,
-0.9010234475135803,
0.9559107422828674,
-0.1743820309638977,
0.11435312777757645,
1.8490453958511353,
0.34077098965644836,
-0.3901214003562927,
0.7669761180877686,
1.176772952079773,
0.6003429889678955,
-0.6447871923446655,
0.13952834904193878,
-0.6812017560005188,
0.31988880038261414,
-1.36051607131958,
0.3337946832180023,
-2.859066963195801,
0.6829373836517334,
-0.06656322628259659,
-0.14797593653202057,
0.001444750465452671,
-1.3506354093551636,
1.0840740203857422,
2.5894596576690674,
-1.1882277727127075,
0.4818987250328064,
0.32420283555984497,
1.1111310720443726,
-1.6795217990875244,
0.31720009446144104,
-0.4423635005950928,
2.0221872329711914,
0.23435740172863007,
1.2680177688598633,
-0.5199272036552429,
-2.2819950580596924,
0.621296226978302,
-1.254020094871521,
-1.0809417963027954,
0.8199553489685059,
-0.9331535696983337,
0.1540672481060028,
-1.3892176151275635,
-0.32730090618133545,
-0.8660197854042053,
-1.1246663331985474,
0.6168437004089355,
0.1613800972700119,
0.41987407207489014,
-0.5136435031890869,
0.3189338743686676,
-2.272322654724121,
-1.3186430931091309,
-0.17571108043193817,
-0.9592571258544922,
0.5857236981391907,
-0.3780722916126251,
0.650839626789093,
-0.16737212240695953,
0.0013154204934835434,
0.38767609000205994,
1.5025783777236938,
3.389970541000366,
0.20225213468074799,
0.24381813406944275,
-0.15255875885486603,
-0.9369668364524841,
1.41533362865448,
0.8609926700592041,
-0.19099688529968262,
-0.5756115317344666,
-1.0514761209487915,
1.28162682056427,
1.9142260551452637,
0.9662147760391235,
-0.028119679540395737,
-0.8893063068389893,
-0.7600444555282593,
-0.0347595177590847,
0.15274105966091156,
0.40866953134536743,
0.8677349090576172,
0.18397879600524902,
0.08664620667695999,
1.464106798171997,
1.212233304977417,
-0.4454899728298187,
0.353628009557724,
-0.8537306189537048,
-0.45114409923553467,
0.4397623538970947,
0.281556099653244,
-0.05764469504356384,
0.32415658235549927,
-1.033489465713501,
-0.2066495418548584,
-0.40679478645324707,
-0.9256564378738403,
-0.793274462223053,
-0.4112702012062073,
-0.3477209508419037,
1.6259478330612183,
0.1226087436079979,
-0.5532164573669434,
-0.050038378685712814,
-0.8062185049057007,
-0.1780952513217926,
-1.0363116264343262,
0.26823821663856506,
-0.06674559414386749,
-0.13193441927433014,
-0.19742664694786072,
1.6681761741638184,
-0.9554153084754944,
-2.0709786415100098,
0.1939898133277893,
0.23655007779598236,
-0.2969881594181061,
0.1353280246257782,
1.6935700178146362,
0.5369395017623901,
1.4587482213974,
1.2912410497665405,
0.9042574167251587,
-0.6973049640655518,
-1.2924975156784058,
0.7150086760520935,
0.9678940176963806,
-1.3956266641616821,
0.8214772939682007,
-0.11786721646785736,
-0.46477019786834717,
0.6022540330886841,
1.2856194972991943,
0.5307503342628479,
-1.992182731628418,
0.8495544195175171,
-1.006593108177185,
0.7702540755271912,
0.7664495706558228,
0.6361990571022034,
0.19016899168491364,
0.8413786292076111,
-1.2448914051055908,
-1.1749722957611084,
-0.6532060503959656,
-0.7146669626235962,
1.9340896606445312,
-0.31178018450737,
0.6239361763000488,
-0.21617260575294495,
-1.2158901691436768,
-0.09333990514278412,
0.7446455359458923,
0.31973448395729065,
-0.4713742434978485,
0.8087001442909241,
-0.6334474086761475,
-1.0231162309646606,
-1.3708226680755615,
-0.43711405992507935,
-1.048536777496338,
-0.9694881439208984,
0.9131231904029846,
0.7782614827156067,
0.3517824411392212,
1.8862236738204956,
0.6714057326316833,
0.306791216135025,
-2.6030285358428955,
0.8621639013290405,
0.2676733732223511,
-0.06808492541313171,
0.883309006690979,
0.362884521484375,
1.0252817869186401,
0.0020881323143839836,
0.5179023742675781,
-2.3862080574035645,
2.257603645324707,
-0.16850297152996063,
0.6480813026428223,
-0.0683922991156578,
-0.15334925055503845,
1.1617505550384521,
0.6016548275947571,
0.5385868549346924,
-1.0553938150405884,
0.6539948582649231,
-0.5602283477783203,
1.219348430633545,
0.8073272705078125,
-0.8498780131340027,
0.01812680810689926,
1.404471516609192,
0.40335601568222046,
-0.5699864029884338,
-0.9647572040557861,
-0.9221403002738953,
0.8996856808662415,
1.6903843879699707,
-0.03292599320411682,
-0.03700825572013855,
0.7453815937042236,
0.6980094909667969,
-1.318013072013855,
0.06005515158176422,
-0.6141734719276428,
-0.7575258016586304,
1.6861062049865723,
2.100870132446289,
-0.15646304190158844,
-0.21467837691307068,
-0.6671448349952698,
-1.2803055047988892,
0.8249780535697937,
-0.07361974567174911,
0.10443954914808273,
0.632321298122406,
-0.6942756772041321,
1.0874426364898682,
0.8532637357711792,
0.9378148913383484,
0.2387325018644333,
0.2664787471294403,
0.42157265543937683,
-0.3465708792209625,
-1.2244127988815308,
-0.28240054845809937,
-1.1089738607406616,
-2.598557472229004,
0.3991154134273529,
-0.18377608060836792,
-1.4373836517333984,
0.032505448907613754,
-1.0242246389389038,
0.9224293828010559,
-0.648020327091217,
-1.083065152168274,
-1.5118992328643799,
0.22164861857891083,
-0.06929201632738113,
0.9505371451377869,
-1.610608458518982,
-0.16076675057411194,
1.1655131578445435,
0.9485218524932861,
-0.6287582516670227,
1.017970323562622,
0.19189395010471344,
1.019376516342163,
0.881405234336853,
-0.3901577591896057,
0.5577489137649536,
0.0365796722471714,
-1.3785642385482788,
0.42650288343429565,
1.2448222637176514,
0.19750314950942993,
1.4672907590866089,
-0.48292994499206543,
0.0318870022892952,
0.414307564496994,
-0.6287082433700562,
-0.4888523817062378,
-0.43239471316337585,
0.6684964895248413,
0.08432838320732117,
-0.9175506830215454,
-0.09081211686134338,
-0.05782536789774895,
-0.26295435428619385,
0.24902477860450745,
-1.48149573802948,
-0.20921257138252258,
-0.38195598125457764,
-0.5876188278198242,
-1.2107875347137451,
-0.14657805860042572,
1.3973493576049805,
-0.8044940829277039,
-0.19253621995449066,
0.5131112337112427,
0.3424886167049408,
0.46737074851989746,
0.678922176361084,
-0.8116272687911987,
-0.28185075521469116,
-0.22640807926654816,
-0.31366875767707825,
0.3196541965007782,
1.342352032661438,
-0.032387085258960724,
-0.8783203363418579,
0.6310971975326538,
-0.29867228865623474,
0.12962423264980316,
1.9445734024047852,
0.07405976951122284,
-0.7987595796585083,
0.2566708028316498,
-0.7875290513038635,
1.9510339498519897,
1.745648741722107,
1.2961316108703613,
-0.12333840131759644,
-0.9219222664833069,
0.641269862651825,
-0.3431878387928009,
-0.3386867642402649,
0.9251767992973328,
0.40013203024864197,
-0.19691026210784912,
-1.3767236471176147,
0.7505810260772705,
1.2565701007843018,
-0.8602443933486938,
-0.79136061668396,
0.14068739116191864,
-0.8215237259864807,
1.1031270027160645,
0.6536604762077332,
0.31910353899002075,
0.29210594296455383,
1.628665566444397,
0.7785674929618835,
-0.4112801253795624,
0.5156480669975281,
0.5212418437004089,
-0.1201367899775505,
-2.134906530380249,
-1.1480786800384521,
0.34161150455474854,
-0.5448242425918579,
-1.6037064790725708,
1.3668931722640991,
-1.1114294528961182,
-0.9869399070739746,
0.6385155916213989,
0.07644679397344589,
1.36211359500885,
0.3642447590827942,
1.6231374740600586,
2.138058662414551,
0.8603616952896118,
0.33243289589881897,
1.2501112222671509,
-0.13480354845523834,
-0.4335775375366211,
1.7846237421035767,
-0.47297203540802,
0.5162733793258667,
1.0696066617965698,
-0.3468702435493469,
-1.109035849571228,
-0.8235945701599121,
-1.2255563735961914,
-0.726676344871521,
1.121450662612915,
0.16285693645477295,
-1.087782382965088,
0.2538735866546631,
1.6188344955444336,
0.06094513088464737,
-0.2887183427810669,
0.6261609792709351,
0.42095208168029785,
-0.7795237302780151,
-0.06686680018901825,
-0.9138645529747009,
0.5732158422470093,
-0.20531214773654938,
-0.38714298605918884,
0.2692232131958008,
0.4880647659301758,
1.2931008338928223,
-0.05807570368051529,
0.06021587550640106,
1.0877163410186768,
-1.3864737749099731,
1.4752006530761719,
-0.7385877370834351,
0.3225972354412079,
-2.360701560974121,
1.4418747425079346,
-0.7699537873268127,
1.9386522769927979,
-2.650287389755249,
0.5178802013397217,
-0.5528347492218018,
-0.5609498023986816,
0.27745458483695984,
-0.39704570174217224,
0.1605527251958847,
-0.08412831276655197,
-1.0984654426574707,
-0.05926140397787094,
-0.6679657697677612,
0.6155198812484741,
1.2103370428085327,
1.3707938194274902,
-1.2190546989440918,
-0.24441315233707428,
-1.7259461879730225,
-0.16987529397010803,
-0.7472811341285706,
0.27537378668785095,
-1.9482885599136353,
-0.2026057094335556,
-1.9212568998336792,
-2.4384162425994873,
-1.2924424409866333,
-0.7341731190681458,
1.0986510515213013,
0.14043542742729187,
-0.8292104601860046,
1.2580426931381226,
-0.3628932237625122,
-1.7947641611099243,
1.0949991941452026,
-2.1747941970825195
] |
https://github.com/huggingface/datasets/issues/5094 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock | Oh actually I just saw that you're using python 3.9
This could be related to https://github.com/huggingface/datasets/issues/4113
We'll fix that as soon as we can, in the meantime you can try to use use single process, or use an older version of python maybe ? | ## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
| 485 | 44 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock
## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
Oh actually I just saw that you're using python 3.9
This could be related to https://github.com/huggingface/datasets/issues/4113
We'll fix that as soon as we can, in the meantime you can try to use use single process, or use an older version of python maybe ? | [
-1.2728172540664673,
-0.898106038570404,
-0.6675035357475281,
1.5078846216201782,
-0.15048755705356598,
-1.1838184595108032,
0.1676679104566574,
-1.037777066230774,
1.6529299020767212,
-0.8306827545166016,
0.33186355233192444,
-1.642417550086975,
0.025884125381708145,
-0.5294846892356873,
-0.7099189162254333,
-0.8553285002708435,
-0.3630971908569336,
-0.7704471349716187,
1.1102064847946167,
2.4790022373199463,
1.2116022109985352,
-1.3617780208587646,
2.721543312072754,
0.7294445633888245,
-0.27313902974128723,
-1.022451400756836,
0.5119602680206299,
0.02420932799577713,
-1.3098320960998535,
-0.4780839681625366,
-0.9773918986320496,
-0.06110548600554466,
-0.5749793648719788,
-0.530600368976593,
0.048546627163887024,
0.4360436201095581,
-0.34067589044570923,
-0.43972447514533997,
-0.5995767712593079,
-0.8195635676383972,
0.5065432786941528,
-0.3635629713535309,
0.8847498893737793,
-0.3069908618927002,
1.8620855808258057,
-0.5903087854385376,
0.46847742795944214,
0.7048625349998474,
1.3212766647338867,
0.2136135846376419,
-0.008978569880127907,
0.3795269727706909,
0.34761202335357666,
-0.03379765525460243,
0.528163492679596,
1.2579987049102783,
0.6583824753761292,
0.5207197666168213,
0.768476665019989,
-2.2253053188323975,
1.3710949420928955,
-0.9576165080070496,
0.33361122012138367,
1.3393239974975586,
-0.9172539114952087,
0.2899286150932312,
-1.7659608125686646,
-0.05864223465323448,
0.5995616912841797,
-2.2474288940429688,
0.306321382522583,
-1.3535258769989014,
-0.5243438482284546,
1.055833101272583,
0.3606233596801758,
-1.2128578424453735,
0.1498764455318451,
-0.42331913113594055,
1.1061313152313232,
0.3940792381763458,
1.0456103086471558,
-1.6636619567871094,
-0.07841675728559494,
-0.23848757147789001,
0.11999284476041794,
-1.2947020530700684,
-1.5918309688568115,
0.5457575917243958,
0.5756939053535461,
0.6724304556846619,
-0.101937435567379,
1.0468467473983765,
-1.0250275135040283,
0.7794437408447266,
-0.9785480499267578,
-1.6938483715057373,
-1.3979201316833496,
-2.259873151779175,
-2.243540048599243,
0.7791751623153687,
-0.452364057302475,
-0.57818603515625,
2.0768754482269287,
-1.0700881481170654,
-1.739996314048767,
1.0930438041687012,
0.281719833612442,
0.008906741626560688,
2.378340005874634,
0.2526441812515259,
-0.7203893661499023,
0.4843027889728546,
-0.7691013216972351,
0.7793152332305908,
-0.2793711721897125,
1.382179856300354,
0.4443669319152832,
-1.0933326482772827,
1.5655096769332886,
-0.44966769218444824,
0.5801029801368713,
-0.594494104385376,
-0.5421668887138367,
-0.7353447675704956,
0.24949699640274048,
1.8815587759017944,
-0.26052534580230713,
1.5427982807159424,
-0.35099196434020996,
-1.6580642461776733,
-1.6590973138809204,
0.8649615049362183,
0.4632969796657562,
-0.7855021953582764,
0.1131933182477951,
-0.47784918546676636,
0.1048925593495369,
0.041526518762111664,
1.2390646934509277,
1.3128716945648193,
0.6531018614768982,
-0.4030846655368805,
-0.8126692175865173,
0.15200407803058624,
-0.06470845639705658,
-0.7087991833686829,
-1.7899096012115479,
-0.35062190890312195,
0.20234523713588715,
0.6552833914756775,
-1.1839383840560913,
1.7916535139083862,
0.9244098663330078,
1.91371488571167,
0.982195258140564,
-0.35161951184272766,
1.4709739685058594,
0.06170543283224106,
1.8076668977737427,
-0.4967227578163147,
0.6924989223480225,
-0.37446480989456177,
-1.1475586891174316,
0.7904874086380005,
-0.352630078792572,
-2.0495922565460205,
-0.784993052482605,
-0.7339880466461182,
-0.1399894505739212,
-0.7832950353622437,
0.9168249368667603,
-0.3361148536205292,
-1.4943307638168335,
0.191568985581398,
-0.7171045541763306,
0.21077293157577515,
-1.1997804641723633,
0.329965740442276,
0.6984550952911377,
-0.6635046601295471,
0.11533772200345993,
-0.23885409533977509,
-1.2473503351211548,
-0.5146815180778503,
0.271866112947464,
1.8774033784866333,
-0.7064959406852722,
0.9217275977134705,
1.0683215856552124,
-0.7025314569473267,
0.05051765590906143,
0.3040471076965332,
-0.3278622627258301,
0.8830869793891907,
-1.1087406873703003,
-0.35644012689590454,
1.2247896194458008,
-0.15238086879253387,
-0.6067793965339661,
1.410730004310608,
0.7680283188819885,
-1.016308069229126,
-0.20380298793315887,
-0.1411990225315094,
-0.8540043234825134,
0.07481364160776138,
-1.522090196609497,
-0.12823514640331268,
0.48620402812957764,
-1.4924805164337158,
-0.43667176365852356,
-0.16383124887943268,
1.2791913747787476,
-0.19118830561637878,
1.390853762626648,
-0.4047609567642212,
-0.15612484514713287,
-0.29898351430892944,
-0.3792724609375,
0.1329495757818222,
-0.1946209818124771,
-0.6530145406723022,
0.16107803583145142,
-0.7985470294952393,
0.2982448935508728,
1.4837706089019775,
0.42787131667137146,
0.03449661284685135,
0.4591967761516571,
1.1969916820526123,
0.35998648405075073,
-0.1141214594244957,
-0.8239149451255798,
-1.6157222986221313,
2.0071966648101807,
-1.4026145935058594,
1.9802812337875366,
0.7921321392059326,
-0.042006488889455795,
-1.7863940000534058,
-1.8585829734802246,
1.290173888206482,
1.1519566774368286,
2.426870107650757,
0.5208056569099426,
0.4265890419483185,
-0.8329137563705444,
-0.6926795840263367,
0.36930882930755615,
-1.0225499868392944,
-0.6591797471046448,
0.16508892178535461,
2.368185043334961,
1.8095749616622925,
-0.4727384150028229,
-0.19467832148075104,
-0.9958896636962891,
1.3674784898757935,
-0.2620728015899658,
0.25467997789382935,
1.935243844985962,
-0.2206370085477829,
-1.0521881580352783,
1.3514591455459595,
-2.274789810180664,
0.19494320452213287,
2.045893907546997,
0.23365184664726257,
0.11794169992208481,
-1.3867226839065552,
-0.6197702288627625,
-0.3298516571521759,
-0.3724164068698883,
-1.2480944395065308,
0.4907134175300598,
-0.24311697483062744,
-0.8163476586341858,
-1.3926293849945068,
0.16817116737365723,
-1.1389451026916504,
-1.6686077117919922,
0.29410743713378906,
1.9241273403167725,
2.1020069122314453,
-0.76520836353302,
1.561436414718628,
-0.30712807178497314,
0.14966383576393127,
1.1844006776809692,
1.3334907293319702,
3.1288537979125977,
1.8098686933517456,
-1.3103693723678589,
0.6662647724151611,
-0.14498382806777954,
-0.5045926570892334,
1.1591272354125977,
-1.234257459640503,
1.2798235416412354,
-0.10849984735250473,
-1.1931463479995728,
-1.2401033639907837,
0.9765093922615051,
0.511813759803772,
0.06237350404262543,
-0.4576704204082489,
1.1577140092849731,
0.046737413853406906,
1.3566731214523315,
0.5614393353462219,
-0.3243753910064697,
0.5850516557693481,
-0.36106446385383606,
-0.5654187798500061,
1.4720606803894043,
0.1600532829761505,
-1.437113642692566,
-2.2325220108032227,
-0.18387371301651,
-0.7906442284584045,
0.06312064081430435,
-0.6861430406570435,
-0.9769694209098816,
1.6663440465927124,
0.34448111057281494,
-1.2562439441680908,
-0.24181528389453888,
-0.34916943311691284,
-0.535322904586792,
2.6424765586853027,
-1.3074086904525757,
-0.14765049517154694,
-0.9981063604354858,
-0.6666267514228821,
1.6126532554626465,
-1.1260654926300049,
-0.23927028477191925,
-1.0537796020507812,
-0.5630018711090088,
-1.2659841775894165,
-0.5261600613594055,
0.06710357964038849,
-0.9868696331977844,
0.7178747057914734,
0.13949893414974213,
-1.1362526416778564,
-0.36735913157463074,
-0.9010234475135803,
0.9559107422828674,
-0.1743820309638977,
0.11435312777757645,
1.8490453958511353,
0.34077098965644836,
-0.3901214003562927,
0.7669761180877686,
1.176772952079773,
0.6003429889678955,
-0.6447871923446655,
0.13952834904193878,
-0.6812017560005188,
0.31988880038261414,
-1.36051607131958,
0.3337946832180023,
-2.859066963195801,
0.6829373836517334,
-0.06656322628259659,
-0.14797593653202057,
0.001444750465452671,
-1.3506354093551636,
1.0840740203857422,
2.5894596576690674,
-1.1882277727127075,
0.4818987250328064,
0.32420283555984497,
1.1111310720443726,
-1.6795217990875244,
0.31720009446144104,
-0.4423635005950928,
2.0221872329711914,
0.23435740172863007,
1.2680177688598633,
-0.5199272036552429,
-2.2819950580596924,
0.621296226978302,
-1.254020094871521,
-1.0809417963027954,
0.8199553489685059,
-0.9331535696983337,
0.1540672481060028,
-1.3892176151275635,
-0.32730090618133545,
-0.8660197854042053,
-1.1246663331985474,
0.6168437004089355,
0.1613800972700119,
0.41987407207489014,
-0.5136435031890869,
0.3189338743686676,
-2.272322654724121,
-1.3186430931091309,
-0.17571108043193817,
-0.9592571258544922,
0.5857236981391907,
-0.3780722916126251,
0.650839626789093,
-0.16737212240695953,
0.0013154204934835434,
0.38767609000205994,
1.5025783777236938,
3.389970541000366,
0.20225213468074799,
0.24381813406944275,
-0.15255875885486603,
-0.9369668364524841,
1.41533362865448,
0.8609926700592041,
-0.19099688529968262,
-0.5756115317344666,
-1.0514761209487915,
1.28162682056427,
1.9142260551452637,
0.9662147760391235,
-0.028119679540395737,
-0.8893063068389893,
-0.7600444555282593,
-0.0347595177590847,
0.15274105966091156,
0.40866953134536743,
0.8677349090576172,
0.18397879600524902,
0.08664620667695999,
1.464106798171997,
1.212233304977417,
-0.4454899728298187,
0.353628009557724,
-0.8537306189537048,
-0.45114409923553467,
0.4397623538970947,
0.281556099653244,
-0.05764469504356384,
0.32415658235549927,
-1.033489465713501,
-0.2066495418548584,
-0.40679478645324707,
-0.9256564378738403,
-0.793274462223053,
-0.4112702012062073,
-0.3477209508419037,
1.6259478330612183,
0.1226087436079979,
-0.5532164573669434,
-0.050038378685712814,
-0.8062185049057007,
-0.1780952513217926,
-1.0363116264343262,
0.26823821663856506,
-0.06674559414386749,
-0.13193441927433014,
-0.19742664694786072,
1.6681761741638184,
-0.9554153084754944,
-2.0709786415100098,
0.1939898133277893,
0.23655007779598236,
-0.2969881594181061,
0.1353280246257782,
1.6935700178146362,
0.5369395017623901,
1.4587482213974,
1.2912410497665405,
0.9042574167251587,
-0.6973049640655518,
-1.2924975156784058,
0.7150086760520935,
0.9678940176963806,
-1.3956266641616821,
0.8214772939682007,
-0.11786721646785736,
-0.46477019786834717,
0.6022540330886841,
1.2856194972991943,
0.5307503342628479,
-1.992182731628418,
0.8495544195175171,
-1.006593108177185,
0.7702540755271912,
0.7664495706558228,
0.6361990571022034,
0.19016899168491364,
0.8413786292076111,
-1.2448914051055908,
-1.1749722957611084,
-0.6532060503959656,
-0.7146669626235962,
1.9340896606445312,
-0.31178018450737,
0.6239361763000488,
-0.21617260575294495,
-1.2158901691436768,
-0.09333990514278412,
0.7446455359458923,
0.31973448395729065,
-0.4713742434978485,
0.8087001442909241,
-0.6334474086761475,
-1.0231162309646606,
-1.3708226680755615,
-0.43711405992507935,
-1.048536777496338,
-0.9694881439208984,
0.9131231904029846,
0.7782614827156067,
0.3517824411392212,
1.8862236738204956,
0.6714057326316833,
0.306791216135025,
-2.6030285358428955,
0.8621639013290405,
0.2676733732223511,
-0.06808492541313171,
0.883309006690979,
0.362884521484375,
1.0252817869186401,
0.0020881323143839836,
0.5179023742675781,
-2.3862080574035645,
2.257603645324707,
-0.16850297152996063,
0.6480813026428223,
-0.0683922991156578,
-0.15334925055503845,
1.1617505550384521,
0.6016548275947571,
0.5385868549346924,
-1.0553938150405884,
0.6539948582649231,
-0.5602283477783203,
1.219348430633545,
0.8073272705078125,
-0.8498780131340027,
0.01812680810689926,
1.404471516609192,
0.40335601568222046,
-0.5699864029884338,
-0.9647572040557861,
-0.9221403002738953,
0.8996856808662415,
1.6903843879699707,
-0.03292599320411682,
-0.03700825572013855,
0.7453815937042236,
0.6980094909667969,
-1.318013072013855,
0.06005515158176422,
-0.6141734719276428,
-0.7575258016586304,
1.6861062049865723,
2.100870132446289,
-0.15646304190158844,
-0.21467837691307068,
-0.6671448349952698,
-1.2803055047988892,
0.8249780535697937,
-0.07361974567174911,
0.10443954914808273,
0.632321298122406,
-0.6942756772041321,
1.0874426364898682,
0.8532637357711792,
0.9378148913383484,
0.2387325018644333,
0.2664787471294403,
0.42157265543937683,
-0.3465708792209625,
-1.2244127988815308,
-0.28240054845809937,
-1.1089738607406616,
-2.598557472229004,
0.3991154134273529,
-0.18377608060836792,
-1.4373836517333984,
0.032505448907613754,
-1.0242246389389038,
0.9224293828010559,
-0.648020327091217,
-1.083065152168274,
-1.5118992328643799,
0.22164861857891083,
-0.06929201632738113,
0.9505371451377869,
-1.610608458518982,
-0.16076675057411194,
1.1655131578445435,
0.9485218524932861,
-0.6287582516670227,
1.017970323562622,
0.19189395010471344,
1.019376516342163,
0.881405234336853,
-0.3901577591896057,
0.5577489137649536,
0.0365796722471714,
-1.3785642385482788,
0.42650288343429565,
1.2448222637176514,
0.19750314950942993,
1.4672907590866089,
-0.48292994499206543,
0.0318870022892952,
0.414307564496994,
-0.6287082433700562,
-0.4888523817062378,
-0.43239471316337585,
0.6684964895248413,
0.08432838320732117,
-0.9175506830215454,
-0.09081211686134338,
-0.05782536789774895,
-0.26295435428619385,
0.24902477860450745,
-1.48149573802948,
-0.20921257138252258,
-0.38195598125457764,
-0.5876188278198242,
-1.2107875347137451,
-0.14657805860042572,
1.3973493576049805,
-0.8044940829277039,
-0.19253621995449066,
0.5131112337112427,
0.3424886167049408,
0.46737074851989746,
0.678922176361084,
-0.8116272687911987,
-0.28185075521469116,
-0.22640807926654816,
-0.31366875767707825,
0.3196541965007782,
1.342352032661438,
-0.032387085258960724,
-0.8783203363418579,
0.6310971975326538,
-0.29867228865623474,
0.12962423264980316,
1.9445734024047852,
0.07405976951122284,
-0.7987595796585083,
0.2566708028316498,
-0.7875290513038635,
1.9510339498519897,
1.745648741722107,
1.2961316108703613,
-0.12333840131759644,
-0.9219222664833069,
0.641269862651825,
-0.3431878387928009,
-0.3386867642402649,
0.9251767992973328,
0.40013203024864197,
-0.19691026210784912,
-1.3767236471176147,
0.7505810260772705,
1.2565701007843018,
-0.8602443933486938,
-0.79136061668396,
0.14068739116191864,
-0.8215237259864807,
1.1031270027160645,
0.6536604762077332,
0.31910353899002075,
0.29210594296455383,
1.628665566444397,
0.7785674929618835,
-0.4112801253795624,
0.5156480669975281,
0.5212418437004089,
-0.1201367899775505,
-2.134906530380249,
-1.1480786800384521,
0.34161150455474854,
-0.5448242425918579,
-1.6037064790725708,
1.3668931722640991,
-1.1114294528961182,
-0.9869399070739746,
0.6385155916213989,
0.07644679397344589,
1.36211359500885,
0.3642447590827942,
1.6231374740600586,
2.138058662414551,
0.8603616952896118,
0.33243289589881897,
1.2501112222671509,
-0.13480354845523834,
-0.4335775375366211,
1.7846237421035767,
-0.47297203540802,
0.5162733793258667,
1.0696066617965698,
-0.3468702435493469,
-1.109035849571228,
-0.8235945701599121,
-1.2255563735961914,
-0.726676344871521,
1.121450662612915,
0.16285693645477295,
-1.087782382965088,
0.2538735866546631,
1.6188344955444336,
0.06094513088464737,
-0.2887183427810669,
0.6261609792709351,
0.42095208168029785,
-0.7795237302780151,
-0.06686680018901825,
-0.9138645529747009,
0.5732158422470093,
-0.20531214773654938,
-0.38714298605918884,
0.2692232131958008,
0.4880647659301758,
1.2931008338928223,
-0.05807570368051529,
0.06021587550640106,
1.0877163410186768,
-1.3864737749099731,
1.4752006530761719,
-0.7385877370834351,
0.3225972354412079,
-2.360701560974121,
1.4418747425079346,
-0.7699537873268127,
1.9386522769927979,
-2.650287389755249,
0.5178802013397217,
-0.5528347492218018,
-0.5609498023986816,
0.27745458483695984,
-0.39704570174217224,
0.1605527251958847,
-0.08412831276655197,
-1.0984654426574707,
-0.05926140397787094,
-0.6679657697677612,
0.6155198812484741,
1.2103370428085327,
1.3707938194274902,
-1.2190546989440918,
-0.24441315233707428,
-1.7259461879730225,
-0.16987529397010803,
-0.7472811341285706,
0.27537378668785095,
-1.9482885599136353,
-0.2026057094335556,
-1.9212568998336792,
-2.4384162425994873,
-1.2924424409866333,
-0.7341731190681458,
1.0986510515213013,
0.14043542742729187,
-0.8292104601860046,
1.2580426931381226,
-0.3628932237625122,
-1.7947641611099243,
1.0949991941452026,
-2.1747941970825195
] |
https://github.com/huggingface/datasets/issues/5094 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock | I tried with python 3.7 and the issue persists. In collab, which also uses 3.7 I don't get the issue, so yes I guess is something on mu side... will post it here if I manage to fix it | ## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
| 485 | 39 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock
## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
I tried with python 3.7 and the issue persists. In collab, which also uses 3.7 I don't get the issue, so yes I guess is something on mu side... will post it here if I manage to fix it | [
-1.2728172540664673,
-0.898106038570404,
-0.6675035357475281,
1.5078846216201782,
-0.15048755705356598,
-1.1838184595108032,
0.1676679104566574,
-1.037777066230774,
1.6529299020767212,
-0.8306827545166016,
0.33186355233192444,
-1.642417550086975,
0.025884125381708145,
-0.5294846892356873,
-0.7099189162254333,
-0.8553285002708435,
-0.3630971908569336,
-0.7704471349716187,
1.1102064847946167,
2.4790022373199463,
1.2116022109985352,
-1.3617780208587646,
2.721543312072754,
0.7294445633888245,
-0.27313902974128723,
-1.022451400756836,
0.5119602680206299,
0.02420932799577713,
-1.3098320960998535,
-0.4780839681625366,
-0.9773918986320496,
-0.06110548600554466,
-0.5749793648719788,
-0.530600368976593,
0.048546627163887024,
0.4360436201095581,
-0.34067589044570923,
-0.43972447514533997,
-0.5995767712593079,
-0.8195635676383972,
0.5065432786941528,
-0.3635629713535309,
0.8847498893737793,
-0.3069908618927002,
1.8620855808258057,
-0.5903087854385376,
0.46847742795944214,
0.7048625349998474,
1.3212766647338867,
0.2136135846376419,
-0.008978569880127907,
0.3795269727706909,
0.34761202335357666,
-0.03379765525460243,
0.528163492679596,
1.2579987049102783,
0.6583824753761292,
0.5207197666168213,
0.768476665019989,
-2.2253053188323975,
1.3710949420928955,
-0.9576165080070496,
0.33361122012138367,
1.3393239974975586,
-0.9172539114952087,
0.2899286150932312,
-1.7659608125686646,
-0.05864223465323448,
0.5995616912841797,
-2.2474288940429688,
0.306321382522583,
-1.3535258769989014,
-0.5243438482284546,
1.055833101272583,
0.3606233596801758,
-1.2128578424453735,
0.1498764455318451,
-0.42331913113594055,
1.1061313152313232,
0.3940792381763458,
1.0456103086471558,
-1.6636619567871094,
-0.07841675728559494,
-0.23848757147789001,
0.11999284476041794,
-1.2947020530700684,
-1.5918309688568115,
0.5457575917243958,
0.5756939053535461,
0.6724304556846619,
-0.101937435567379,
1.0468467473983765,
-1.0250275135040283,
0.7794437408447266,
-0.9785480499267578,
-1.6938483715057373,
-1.3979201316833496,
-2.259873151779175,
-2.243540048599243,
0.7791751623153687,
-0.452364057302475,
-0.57818603515625,
2.0768754482269287,
-1.0700881481170654,
-1.739996314048767,
1.0930438041687012,
0.281719833612442,
0.008906741626560688,
2.378340005874634,
0.2526441812515259,
-0.7203893661499023,
0.4843027889728546,
-0.7691013216972351,
0.7793152332305908,
-0.2793711721897125,
1.382179856300354,
0.4443669319152832,
-1.0933326482772827,
1.5655096769332886,
-0.44966769218444824,
0.5801029801368713,
-0.594494104385376,
-0.5421668887138367,
-0.7353447675704956,
0.24949699640274048,
1.8815587759017944,
-0.26052534580230713,
1.5427982807159424,
-0.35099196434020996,
-1.6580642461776733,
-1.6590973138809204,
0.8649615049362183,
0.4632969796657562,
-0.7855021953582764,
0.1131933182477951,
-0.47784918546676636,
0.1048925593495369,
0.041526518762111664,
1.2390646934509277,
1.3128716945648193,
0.6531018614768982,
-0.4030846655368805,
-0.8126692175865173,
0.15200407803058624,
-0.06470845639705658,
-0.7087991833686829,
-1.7899096012115479,
-0.35062190890312195,
0.20234523713588715,
0.6552833914756775,
-1.1839383840560913,
1.7916535139083862,
0.9244098663330078,
1.91371488571167,
0.982195258140564,
-0.35161951184272766,
1.4709739685058594,
0.06170543283224106,
1.8076668977737427,
-0.4967227578163147,
0.6924989223480225,
-0.37446480989456177,
-1.1475586891174316,
0.7904874086380005,
-0.352630078792572,
-2.0495922565460205,
-0.784993052482605,
-0.7339880466461182,
-0.1399894505739212,
-0.7832950353622437,
0.9168249368667603,
-0.3361148536205292,
-1.4943307638168335,
0.191568985581398,
-0.7171045541763306,
0.21077293157577515,
-1.1997804641723633,
0.329965740442276,
0.6984550952911377,
-0.6635046601295471,
0.11533772200345993,
-0.23885409533977509,
-1.2473503351211548,
-0.5146815180778503,
0.271866112947464,
1.8774033784866333,
-0.7064959406852722,
0.9217275977134705,
1.0683215856552124,
-0.7025314569473267,
0.05051765590906143,
0.3040471076965332,
-0.3278622627258301,
0.8830869793891907,
-1.1087406873703003,
-0.35644012689590454,
1.2247896194458008,
-0.15238086879253387,
-0.6067793965339661,
1.410730004310608,
0.7680283188819885,
-1.016308069229126,
-0.20380298793315887,
-0.1411990225315094,
-0.8540043234825134,
0.07481364160776138,
-1.522090196609497,
-0.12823514640331268,
0.48620402812957764,
-1.4924805164337158,
-0.43667176365852356,
-0.16383124887943268,
1.2791913747787476,
-0.19118830561637878,
1.390853762626648,
-0.4047609567642212,
-0.15612484514713287,
-0.29898351430892944,
-0.3792724609375,
0.1329495757818222,
-0.1946209818124771,
-0.6530145406723022,
0.16107803583145142,
-0.7985470294952393,
0.2982448935508728,
1.4837706089019775,
0.42787131667137146,
0.03449661284685135,
0.4591967761516571,
1.1969916820526123,
0.35998648405075073,
-0.1141214594244957,
-0.8239149451255798,
-1.6157222986221313,
2.0071966648101807,
-1.4026145935058594,
1.9802812337875366,
0.7921321392059326,
-0.042006488889455795,
-1.7863940000534058,
-1.8585829734802246,
1.290173888206482,
1.1519566774368286,
2.426870107650757,
0.5208056569099426,
0.4265890419483185,
-0.8329137563705444,
-0.6926795840263367,
0.36930882930755615,
-1.0225499868392944,
-0.6591797471046448,
0.16508892178535461,
2.368185043334961,
1.8095749616622925,
-0.4727384150028229,
-0.19467832148075104,
-0.9958896636962891,
1.3674784898757935,
-0.2620728015899658,
0.25467997789382935,
1.935243844985962,
-0.2206370085477829,
-1.0521881580352783,
1.3514591455459595,
-2.274789810180664,
0.19494320452213287,
2.045893907546997,
0.23365184664726257,
0.11794169992208481,
-1.3867226839065552,
-0.6197702288627625,
-0.3298516571521759,
-0.3724164068698883,
-1.2480944395065308,
0.4907134175300598,
-0.24311697483062744,
-0.8163476586341858,
-1.3926293849945068,
0.16817116737365723,
-1.1389451026916504,
-1.6686077117919922,
0.29410743713378906,
1.9241273403167725,
2.1020069122314453,
-0.76520836353302,
1.561436414718628,
-0.30712807178497314,
0.14966383576393127,
1.1844006776809692,
1.3334907293319702,
3.1288537979125977,
1.8098686933517456,
-1.3103693723678589,
0.6662647724151611,
-0.14498382806777954,
-0.5045926570892334,
1.1591272354125977,
-1.234257459640503,
1.2798235416412354,
-0.10849984735250473,
-1.1931463479995728,
-1.2401033639907837,
0.9765093922615051,
0.511813759803772,
0.06237350404262543,
-0.4576704204082489,
1.1577140092849731,
0.046737413853406906,
1.3566731214523315,
0.5614393353462219,
-0.3243753910064697,
0.5850516557693481,
-0.36106446385383606,
-0.5654187798500061,
1.4720606803894043,
0.1600532829761505,
-1.437113642692566,
-2.2325220108032227,
-0.18387371301651,
-0.7906442284584045,
0.06312064081430435,
-0.6861430406570435,
-0.9769694209098816,
1.6663440465927124,
0.34448111057281494,
-1.2562439441680908,
-0.24181528389453888,
-0.34916943311691284,
-0.535322904586792,
2.6424765586853027,
-1.3074086904525757,
-0.14765049517154694,
-0.9981063604354858,
-0.6666267514228821,
1.6126532554626465,
-1.1260654926300049,
-0.23927028477191925,
-1.0537796020507812,
-0.5630018711090088,
-1.2659841775894165,
-0.5261600613594055,
0.06710357964038849,
-0.9868696331977844,
0.7178747057914734,
0.13949893414974213,
-1.1362526416778564,
-0.36735913157463074,
-0.9010234475135803,
0.9559107422828674,
-0.1743820309638977,
0.11435312777757645,
1.8490453958511353,
0.34077098965644836,
-0.3901214003562927,
0.7669761180877686,
1.176772952079773,
0.6003429889678955,
-0.6447871923446655,
0.13952834904193878,
-0.6812017560005188,
0.31988880038261414,
-1.36051607131958,
0.3337946832180023,
-2.859066963195801,
0.6829373836517334,
-0.06656322628259659,
-0.14797593653202057,
0.001444750465452671,
-1.3506354093551636,
1.0840740203857422,
2.5894596576690674,
-1.1882277727127075,
0.4818987250328064,
0.32420283555984497,
1.1111310720443726,
-1.6795217990875244,
0.31720009446144104,
-0.4423635005950928,
2.0221872329711914,
0.23435740172863007,
1.2680177688598633,
-0.5199272036552429,
-2.2819950580596924,
0.621296226978302,
-1.254020094871521,
-1.0809417963027954,
0.8199553489685059,
-0.9331535696983337,
0.1540672481060028,
-1.3892176151275635,
-0.32730090618133545,
-0.8660197854042053,
-1.1246663331985474,
0.6168437004089355,
0.1613800972700119,
0.41987407207489014,
-0.5136435031890869,
0.3189338743686676,
-2.272322654724121,
-1.3186430931091309,
-0.17571108043193817,
-0.9592571258544922,
0.5857236981391907,
-0.3780722916126251,
0.650839626789093,
-0.16737212240695953,
0.0013154204934835434,
0.38767609000205994,
1.5025783777236938,
3.389970541000366,
0.20225213468074799,
0.24381813406944275,
-0.15255875885486603,
-0.9369668364524841,
1.41533362865448,
0.8609926700592041,
-0.19099688529968262,
-0.5756115317344666,
-1.0514761209487915,
1.28162682056427,
1.9142260551452637,
0.9662147760391235,
-0.028119679540395737,
-0.8893063068389893,
-0.7600444555282593,
-0.0347595177590847,
0.15274105966091156,
0.40866953134536743,
0.8677349090576172,
0.18397879600524902,
0.08664620667695999,
1.464106798171997,
1.212233304977417,
-0.4454899728298187,
0.353628009557724,
-0.8537306189537048,
-0.45114409923553467,
0.4397623538970947,
0.281556099653244,
-0.05764469504356384,
0.32415658235549927,
-1.033489465713501,
-0.2066495418548584,
-0.40679478645324707,
-0.9256564378738403,
-0.793274462223053,
-0.4112702012062073,
-0.3477209508419037,
1.6259478330612183,
0.1226087436079979,
-0.5532164573669434,
-0.050038378685712814,
-0.8062185049057007,
-0.1780952513217926,
-1.0363116264343262,
0.26823821663856506,
-0.06674559414386749,
-0.13193441927433014,
-0.19742664694786072,
1.6681761741638184,
-0.9554153084754944,
-2.0709786415100098,
0.1939898133277893,
0.23655007779598236,
-0.2969881594181061,
0.1353280246257782,
1.6935700178146362,
0.5369395017623901,
1.4587482213974,
1.2912410497665405,
0.9042574167251587,
-0.6973049640655518,
-1.2924975156784058,
0.7150086760520935,
0.9678940176963806,
-1.3956266641616821,
0.8214772939682007,
-0.11786721646785736,
-0.46477019786834717,
0.6022540330886841,
1.2856194972991943,
0.5307503342628479,
-1.992182731628418,
0.8495544195175171,
-1.006593108177185,
0.7702540755271912,
0.7664495706558228,
0.6361990571022034,
0.19016899168491364,
0.8413786292076111,
-1.2448914051055908,
-1.1749722957611084,
-0.6532060503959656,
-0.7146669626235962,
1.9340896606445312,
-0.31178018450737,
0.6239361763000488,
-0.21617260575294495,
-1.2158901691436768,
-0.09333990514278412,
0.7446455359458923,
0.31973448395729065,
-0.4713742434978485,
0.8087001442909241,
-0.6334474086761475,
-1.0231162309646606,
-1.3708226680755615,
-0.43711405992507935,
-1.048536777496338,
-0.9694881439208984,
0.9131231904029846,
0.7782614827156067,
0.3517824411392212,
1.8862236738204956,
0.6714057326316833,
0.306791216135025,
-2.6030285358428955,
0.8621639013290405,
0.2676733732223511,
-0.06808492541313171,
0.883309006690979,
0.362884521484375,
1.0252817869186401,
0.0020881323143839836,
0.5179023742675781,
-2.3862080574035645,
2.257603645324707,
-0.16850297152996063,
0.6480813026428223,
-0.0683922991156578,
-0.15334925055503845,
1.1617505550384521,
0.6016548275947571,
0.5385868549346924,
-1.0553938150405884,
0.6539948582649231,
-0.5602283477783203,
1.219348430633545,
0.8073272705078125,
-0.8498780131340027,
0.01812680810689926,
1.404471516609192,
0.40335601568222046,
-0.5699864029884338,
-0.9647572040557861,
-0.9221403002738953,
0.8996856808662415,
1.6903843879699707,
-0.03292599320411682,
-0.03700825572013855,
0.7453815937042236,
0.6980094909667969,
-1.318013072013855,
0.06005515158176422,
-0.6141734719276428,
-0.7575258016586304,
1.6861062049865723,
2.100870132446289,
-0.15646304190158844,
-0.21467837691307068,
-0.6671448349952698,
-1.2803055047988892,
0.8249780535697937,
-0.07361974567174911,
0.10443954914808273,
0.632321298122406,
-0.6942756772041321,
1.0874426364898682,
0.8532637357711792,
0.9378148913383484,
0.2387325018644333,
0.2664787471294403,
0.42157265543937683,
-0.3465708792209625,
-1.2244127988815308,
-0.28240054845809937,
-1.1089738607406616,
-2.598557472229004,
0.3991154134273529,
-0.18377608060836792,
-1.4373836517333984,
0.032505448907613754,
-1.0242246389389038,
0.9224293828010559,
-0.648020327091217,
-1.083065152168274,
-1.5118992328643799,
0.22164861857891083,
-0.06929201632738113,
0.9505371451377869,
-1.610608458518982,
-0.16076675057411194,
1.1655131578445435,
0.9485218524932861,
-0.6287582516670227,
1.017970323562622,
0.19189395010471344,
1.019376516342163,
0.881405234336853,
-0.3901577591896057,
0.5577489137649536,
0.0365796722471714,
-1.3785642385482788,
0.42650288343429565,
1.2448222637176514,
0.19750314950942993,
1.4672907590866089,
-0.48292994499206543,
0.0318870022892952,
0.414307564496994,
-0.6287082433700562,
-0.4888523817062378,
-0.43239471316337585,
0.6684964895248413,
0.08432838320732117,
-0.9175506830215454,
-0.09081211686134338,
-0.05782536789774895,
-0.26295435428619385,
0.24902477860450745,
-1.48149573802948,
-0.20921257138252258,
-0.38195598125457764,
-0.5876188278198242,
-1.2107875347137451,
-0.14657805860042572,
1.3973493576049805,
-0.8044940829277039,
-0.19253621995449066,
0.5131112337112427,
0.3424886167049408,
0.46737074851989746,
0.678922176361084,
-0.8116272687911987,
-0.28185075521469116,
-0.22640807926654816,
-0.31366875767707825,
0.3196541965007782,
1.342352032661438,
-0.032387085258960724,
-0.8783203363418579,
0.6310971975326538,
-0.29867228865623474,
0.12962423264980316,
1.9445734024047852,
0.07405976951122284,
-0.7987595796585083,
0.2566708028316498,
-0.7875290513038635,
1.9510339498519897,
1.745648741722107,
1.2961316108703613,
-0.12333840131759644,
-0.9219222664833069,
0.641269862651825,
-0.3431878387928009,
-0.3386867642402649,
0.9251767992973328,
0.40013203024864197,
-0.19691026210784912,
-1.3767236471176147,
0.7505810260772705,
1.2565701007843018,
-0.8602443933486938,
-0.79136061668396,
0.14068739116191864,
-0.8215237259864807,
1.1031270027160645,
0.6536604762077332,
0.31910353899002075,
0.29210594296455383,
1.628665566444397,
0.7785674929618835,
-0.4112801253795624,
0.5156480669975281,
0.5212418437004089,
-0.1201367899775505,
-2.134906530380249,
-1.1480786800384521,
0.34161150455474854,
-0.5448242425918579,
-1.6037064790725708,
1.3668931722640991,
-1.1114294528961182,
-0.9869399070739746,
0.6385155916213989,
0.07644679397344589,
1.36211359500885,
0.3642447590827942,
1.6231374740600586,
2.138058662414551,
0.8603616952896118,
0.33243289589881897,
1.2501112222671509,
-0.13480354845523834,
-0.4335775375366211,
1.7846237421035767,
-0.47297203540802,
0.5162733793258667,
1.0696066617965698,
-0.3468702435493469,
-1.109035849571228,
-0.8235945701599121,
-1.2255563735961914,
-0.726676344871521,
1.121450662612915,
0.16285693645477295,
-1.087782382965088,
0.2538735866546631,
1.6188344955444336,
0.06094513088464737,
-0.2887183427810669,
0.6261609792709351,
0.42095208168029785,
-0.7795237302780151,
-0.06686680018901825,
-0.9138645529747009,
0.5732158422470093,
-0.20531214773654938,
-0.38714298605918884,
0.2692232131958008,
0.4880647659301758,
1.2931008338928223,
-0.05807570368051529,
0.06021587550640106,
1.0877163410186768,
-1.3864737749099731,
1.4752006530761719,
-0.7385877370834351,
0.3225972354412079,
-2.360701560974121,
1.4418747425079346,
-0.7699537873268127,
1.9386522769927979,
-2.650287389755249,
0.5178802013397217,
-0.5528347492218018,
-0.5609498023986816,
0.27745458483695984,
-0.39704570174217224,
0.1605527251958847,
-0.08412831276655197,
-1.0984654426574707,
-0.05926140397787094,
-0.6679657697677612,
0.6155198812484741,
1.2103370428085327,
1.3707938194274902,
-1.2190546989440918,
-0.24441315233707428,
-1.7259461879730225,
-0.16987529397010803,
-0.7472811341285706,
0.27537378668785095,
-1.9482885599136353,
-0.2026057094335556,
-1.9212568998336792,
-2.4384162425994873,
-1.2924424409866333,
-0.7341731190681458,
1.0986510515213013,
0.14043542742729187,
-0.8292104601860046,
1.2580426931381226,
-0.3628932237625122,
-1.7947641611099243,
1.0949991941452026,
-2.1747941970825195
] |
https://github.com/huggingface/datasets/issues/5094 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock | Hi! Which version of transformers are you using? I test the code on Colab (so python 3.7) with transformers 4.23.1, torch 1.12.1 and pyarrow 9.0.0 (also 6.x), it worked without stuck. | ## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
| 485 | 31 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock
## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
Hi! Which version of transformers are you using? I test the code on Colab (so python 3.7) with transformers 4.23.1, torch 1.12.1 and pyarrow 9.0.0 (also 6.x), it worked without stuck. | [
-1.2728172540664673,
-0.898106038570404,
-0.6675035357475281,
1.5078846216201782,
-0.15048755705356598,
-1.1838184595108032,
0.1676679104566574,
-1.037777066230774,
1.6529299020767212,
-0.8306827545166016,
0.33186355233192444,
-1.642417550086975,
0.025884125381708145,
-0.5294846892356873,
-0.7099189162254333,
-0.8553285002708435,
-0.3630971908569336,
-0.7704471349716187,
1.1102064847946167,
2.4790022373199463,
1.2116022109985352,
-1.3617780208587646,
2.721543312072754,
0.7294445633888245,
-0.27313902974128723,
-1.022451400756836,
0.5119602680206299,
0.02420932799577713,
-1.3098320960998535,
-0.4780839681625366,
-0.9773918986320496,
-0.06110548600554466,
-0.5749793648719788,
-0.530600368976593,
0.048546627163887024,
0.4360436201095581,
-0.34067589044570923,
-0.43972447514533997,
-0.5995767712593079,
-0.8195635676383972,
0.5065432786941528,
-0.3635629713535309,
0.8847498893737793,
-0.3069908618927002,
1.8620855808258057,
-0.5903087854385376,
0.46847742795944214,
0.7048625349998474,
1.3212766647338867,
0.2136135846376419,
-0.008978569880127907,
0.3795269727706909,
0.34761202335357666,
-0.03379765525460243,
0.528163492679596,
1.2579987049102783,
0.6583824753761292,
0.5207197666168213,
0.768476665019989,
-2.2253053188323975,
1.3710949420928955,
-0.9576165080070496,
0.33361122012138367,
1.3393239974975586,
-0.9172539114952087,
0.2899286150932312,
-1.7659608125686646,
-0.05864223465323448,
0.5995616912841797,
-2.2474288940429688,
0.306321382522583,
-1.3535258769989014,
-0.5243438482284546,
1.055833101272583,
0.3606233596801758,
-1.2128578424453735,
0.1498764455318451,
-0.42331913113594055,
1.1061313152313232,
0.3940792381763458,
1.0456103086471558,
-1.6636619567871094,
-0.07841675728559494,
-0.23848757147789001,
0.11999284476041794,
-1.2947020530700684,
-1.5918309688568115,
0.5457575917243958,
0.5756939053535461,
0.6724304556846619,
-0.101937435567379,
1.0468467473983765,
-1.0250275135040283,
0.7794437408447266,
-0.9785480499267578,
-1.6938483715057373,
-1.3979201316833496,
-2.259873151779175,
-2.243540048599243,
0.7791751623153687,
-0.452364057302475,
-0.57818603515625,
2.0768754482269287,
-1.0700881481170654,
-1.739996314048767,
1.0930438041687012,
0.281719833612442,
0.008906741626560688,
2.378340005874634,
0.2526441812515259,
-0.7203893661499023,
0.4843027889728546,
-0.7691013216972351,
0.7793152332305908,
-0.2793711721897125,
1.382179856300354,
0.4443669319152832,
-1.0933326482772827,
1.5655096769332886,
-0.44966769218444824,
0.5801029801368713,
-0.594494104385376,
-0.5421668887138367,
-0.7353447675704956,
0.24949699640274048,
1.8815587759017944,
-0.26052534580230713,
1.5427982807159424,
-0.35099196434020996,
-1.6580642461776733,
-1.6590973138809204,
0.8649615049362183,
0.4632969796657562,
-0.7855021953582764,
0.1131933182477951,
-0.47784918546676636,
0.1048925593495369,
0.041526518762111664,
1.2390646934509277,
1.3128716945648193,
0.6531018614768982,
-0.4030846655368805,
-0.8126692175865173,
0.15200407803058624,
-0.06470845639705658,
-0.7087991833686829,
-1.7899096012115479,
-0.35062190890312195,
0.20234523713588715,
0.6552833914756775,
-1.1839383840560913,
1.7916535139083862,
0.9244098663330078,
1.91371488571167,
0.982195258140564,
-0.35161951184272766,
1.4709739685058594,
0.06170543283224106,
1.8076668977737427,
-0.4967227578163147,
0.6924989223480225,
-0.37446480989456177,
-1.1475586891174316,
0.7904874086380005,
-0.352630078792572,
-2.0495922565460205,
-0.784993052482605,
-0.7339880466461182,
-0.1399894505739212,
-0.7832950353622437,
0.9168249368667603,
-0.3361148536205292,
-1.4943307638168335,
0.191568985581398,
-0.7171045541763306,
0.21077293157577515,
-1.1997804641723633,
0.329965740442276,
0.6984550952911377,
-0.6635046601295471,
0.11533772200345993,
-0.23885409533977509,
-1.2473503351211548,
-0.5146815180778503,
0.271866112947464,
1.8774033784866333,
-0.7064959406852722,
0.9217275977134705,
1.0683215856552124,
-0.7025314569473267,
0.05051765590906143,
0.3040471076965332,
-0.3278622627258301,
0.8830869793891907,
-1.1087406873703003,
-0.35644012689590454,
1.2247896194458008,
-0.15238086879253387,
-0.6067793965339661,
1.410730004310608,
0.7680283188819885,
-1.016308069229126,
-0.20380298793315887,
-0.1411990225315094,
-0.8540043234825134,
0.07481364160776138,
-1.522090196609497,
-0.12823514640331268,
0.48620402812957764,
-1.4924805164337158,
-0.43667176365852356,
-0.16383124887943268,
1.2791913747787476,
-0.19118830561637878,
1.390853762626648,
-0.4047609567642212,
-0.15612484514713287,
-0.29898351430892944,
-0.3792724609375,
0.1329495757818222,
-0.1946209818124771,
-0.6530145406723022,
0.16107803583145142,
-0.7985470294952393,
0.2982448935508728,
1.4837706089019775,
0.42787131667137146,
0.03449661284685135,
0.4591967761516571,
1.1969916820526123,
0.35998648405075073,
-0.1141214594244957,
-0.8239149451255798,
-1.6157222986221313,
2.0071966648101807,
-1.4026145935058594,
1.9802812337875366,
0.7921321392059326,
-0.042006488889455795,
-1.7863940000534058,
-1.8585829734802246,
1.290173888206482,
1.1519566774368286,
2.426870107650757,
0.5208056569099426,
0.4265890419483185,
-0.8329137563705444,
-0.6926795840263367,
0.36930882930755615,
-1.0225499868392944,
-0.6591797471046448,
0.16508892178535461,
2.368185043334961,
1.8095749616622925,
-0.4727384150028229,
-0.19467832148075104,
-0.9958896636962891,
1.3674784898757935,
-0.2620728015899658,
0.25467997789382935,
1.935243844985962,
-0.2206370085477829,
-1.0521881580352783,
1.3514591455459595,
-2.274789810180664,
0.19494320452213287,
2.045893907546997,
0.23365184664726257,
0.11794169992208481,
-1.3867226839065552,
-0.6197702288627625,
-0.3298516571521759,
-0.3724164068698883,
-1.2480944395065308,
0.4907134175300598,
-0.24311697483062744,
-0.8163476586341858,
-1.3926293849945068,
0.16817116737365723,
-1.1389451026916504,
-1.6686077117919922,
0.29410743713378906,
1.9241273403167725,
2.1020069122314453,
-0.76520836353302,
1.561436414718628,
-0.30712807178497314,
0.14966383576393127,
1.1844006776809692,
1.3334907293319702,
3.1288537979125977,
1.8098686933517456,
-1.3103693723678589,
0.6662647724151611,
-0.14498382806777954,
-0.5045926570892334,
1.1591272354125977,
-1.234257459640503,
1.2798235416412354,
-0.10849984735250473,
-1.1931463479995728,
-1.2401033639907837,
0.9765093922615051,
0.511813759803772,
0.06237350404262543,
-0.4576704204082489,
1.1577140092849731,
0.046737413853406906,
1.3566731214523315,
0.5614393353462219,
-0.3243753910064697,
0.5850516557693481,
-0.36106446385383606,
-0.5654187798500061,
1.4720606803894043,
0.1600532829761505,
-1.437113642692566,
-2.2325220108032227,
-0.18387371301651,
-0.7906442284584045,
0.06312064081430435,
-0.6861430406570435,
-0.9769694209098816,
1.6663440465927124,
0.34448111057281494,
-1.2562439441680908,
-0.24181528389453888,
-0.34916943311691284,
-0.535322904586792,
2.6424765586853027,
-1.3074086904525757,
-0.14765049517154694,
-0.9981063604354858,
-0.6666267514228821,
1.6126532554626465,
-1.1260654926300049,
-0.23927028477191925,
-1.0537796020507812,
-0.5630018711090088,
-1.2659841775894165,
-0.5261600613594055,
0.06710357964038849,
-0.9868696331977844,
0.7178747057914734,
0.13949893414974213,
-1.1362526416778564,
-0.36735913157463074,
-0.9010234475135803,
0.9559107422828674,
-0.1743820309638977,
0.11435312777757645,
1.8490453958511353,
0.34077098965644836,
-0.3901214003562927,
0.7669761180877686,
1.176772952079773,
0.6003429889678955,
-0.6447871923446655,
0.13952834904193878,
-0.6812017560005188,
0.31988880038261414,
-1.36051607131958,
0.3337946832180023,
-2.859066963195801,
0.6829373836517334,
-0.06656322628259659,
-0.14797593653202057,
0.001444750465452671,
-1.3506354093551636,
1.0840740203857422,
2.5894596576690674,
-1.1882277727127075,
0.4818987250328064,
0.32420283555984497,
1.1111310720443726,
-1.6795217990875244,
0.31720009446144104,
-0.4423635005950928,
2.0221872329711914,
0.23435740172863007,
1.2680177688598633,
-0.5199272036552429,
-2.2819950580596924,
0.621296226978302,
-1.254020094871521,
-1.0809417963027954,
0.8199553489685059,
-0.9331535696983337,
0.1540672481060028,
-1.3892176151275635,
-0.32730090618133545,
-0.8660197854042053,
-1.1246663331985474,
0.6168437004089355,
0.1613800972700119,
0.41987407207489014,
-0.5136435031890869,
0.3189338743686676,
-2.272322654724121,
-1.3186430931091309,
-0.17571108043193817,
-0.9592571258544922,
0.5857236981391907,
-0.3780722916126251,
0.650839626789093,
-0.16737212240695953,
0.0013154204934835434,
0.38767609000205994,
1.5025783777236938,
3.389970541000366,
0.20225213468074799,
0.24381813406944275,
-0.15255875885486603,
-0.9369668364524841,
1.41533362865448,
0.8609926700592041,
-0.19099688529968262,
-0.5756115317344666,
-1.0514761209487915,
1.28162682056427,
1.9142260551452637,
0.9662147760391235,
-0.028119679540395737,
-0.8893063068389893,
-0.7600444555282593,
-0.0347595177590847,
0.15274105966091156,
0.40866953134536743,
0.8677349090576172,
0.18397879600524902,
0.08664620667695999,
1.464106798171997,
1.212233304977417,
-0.4454899728298187,
0.353628009557724,
-0.8537306189537048,
-0.45114409923553467,
0.4397623538970947,
0.281556099653244,
-0.05764469504356384,
0.32415658235549927,
-1.033489465713501,
-0.2066495418548584,
-0.40679478645324707,
-0.9256564378738403,
-0.793274462223053,
-0.4112702012062073,
-0.3477209508419037,
1.6259478330612183,
0.1226087436079979,
-0.5532164573669434,
-0.050038378685712814,
-0.8062185049057007,
-0.1780952513217926,
-1.0363116264343262,
0.26823821663856506,
-0.06674559414386749,
-0.13193441927433014,
-0.19742664694786072,
1.6681761741638184,
-0.9554153084754944,
-2.0709786415100098,
0.1939898133277893,
0.23655007779598236,
-0.2969881594181061,
0.1353280246257782,
1.6935700178146362,
0.5369395017623901,
1.4587482213974,
1.2912410497665405,
0.9042574167251587,
-0.6973049640655518,
-1.2924975156784058,
0.7150086760520935,
0.9678940176963806,
-1.3956266641616821,
0.8214772939682007,
-0.11786721646785736,
-0.46477019786834717,
0.6022540330886841,
1.2856194972991943,
0.5307503342628479,
-1.992182731628418,
0.8495544195175171,
-1.006593108177185,
0.7702540755271912,
0.7664495706558228,
0.6361990571022034,
0.19016899168491364,
0.8413786292076111,
-1.2448914051055908,
-1.1749722957611084,
-0.6532060503959656,
-0.7146669626235962,
1.9340896606445312,
-0.31178018450737,
0.6239361763000488,
-0.21617260575294495,
-1.2158901691436768,
-0.09333990514278412,
0.7446455359458923,
0.31973448395729065,
-0.4713742434978485,
0.8087001442909241,
-0.6334474086761475,
-1.0231162309646606,
-1.3708226680755615,
-0.43711405992507935,
-1.048536777496338,
-0.9694881439208984,
0.9131231904029846,
0.7782614827156067,
0.3517824411392212,
1.8862236738204956,
0.6714057326316833,
0.306791216135025,
-2.6030285358428955,
0.8621639013290405,
0.2676733732223511,
-0.06808492541313171,
0.883309006690979,
0.362884521484375,
1.0252817869186401,
0.0020881323143839836,
0.5179023742675781,
-2.3862080574035645,
2.257603645324707,
-0.16850297152996063,
0.6480813026428223,
-0.0683922991156578,
-0.15334925055503845,
1.1617505550384521,
0.6016548275947571,
0.5385868549346924,
-1.0553938150405884,
0.6539948582649231,
-0.5602283477783203,
1.219348430633545,
0.8073272705078125,
-0.8498780131340027,
0.01812680810689926,
1.404471516609192,
0.40335601568222046,
-0.5699864029884338,
-0.9647572040557861,
-0.9221403002738953,
0.8996856808662415,
1.6903843879699707,
-0.03292599320411682,
-0.03700825572013855,
0.7453815937042236,
0.6980094909667969,
-1.318013072013855,
0.06005515158176422,
-0.6141734719276428,
-0.7575258016586304,
1.6861062049865723,
2.100870132446289,
-0.15646304190158844,
-0.21467837691307068,
-0.6671448349952698,
-1.2803055047988892,
0.8249780535697937,
-0.07361974567174911,
0.10443954914808273,
0.632321298122406,
-0.6942756772041321,
1.0874426364898682,
0.8532637357711792,
0.9378148913383484,
0.2387325018644333,
0.2664787471294403,
0.42157265543937683,
-0.3465708792209625,
-1.2244127988815308,
-0.28240054845809937,
-1.1089738607406616,
-2.598557472229004,
0.3991154134273529,
-0.18377608060836792,
-1.4373836517333984,
0.032505448907613754,
-1.0242246389389038,
0.9224293828010559,
-0.648020327091217,
-1.083065152168274,
-1.5118992328643799,
0.22164861857891083,
-0.06929201632738113,
0.9505371451377869,
-1.610608458518982,
-0.16076675057411194,
1.1655131578445435,
0.9485218524932861,
-0.6287582516670227,
1.017970323562622,
0.19189395010471344,
1.019376516342163,
0.881405234336853,
-0.3901577591896057,
0.5577489137649536,
0.0365796722471714,
-1.3785642385482788,
0.42650288343429565,
1.2448222637176514,
0.19750314950942993,
1.4672907590866089,
-0.48292994499206543,
0.0318870022892952,
0.414307564496994,
-0.6287082433700562,
-0.4888523817062378,
-0.43239471316337585,
0.6684964895248413,
0.08432838320732117,
-0.9175506830215454,
-0.09081211686134338,
-0.05782536789774895,
-0.26295435428619385,
0.24902477860450745,
-1.48149573802948,
-0.20921257138252258,
-0.38195598125457764,
-0.5876188278198242,
-1.2107875347137451,
-0.14657805860042572,
1.3973493576049805,
-0.8044940829277039,
-0.19253621995449066,
0.5131112337112427,
0.3424886167049408,
0.46737074851989746,
0.678922176361084,
-0.8116272687911987,
-0.28185075521469116,
-0.22640807926654816,
-0.31366875767707825,
0.3196541965007782,
1.342352032661438,
-0.032387085258960724,
-0.8783203363418579,
0.6310971975326538,
-0.29867228865623474,
0.12962423264980316,
1.9445734024047852,
0.07405976951122284,
-0.7987595796585083,
0.2566708028316498,
-0.7875290513038635,
1.9510339498519897,
1.745648741722107,
1.2961316108703613,
-0.12333840131759644,
-0.9219222664833069,
0.641269862651825,
-0.3431878387928009,
-0.3386867642402649,
0.9251767992973328,
0.40013203024864197,
-0.19691026210784912,
-1.3767236471176147,
0.7505810260772705,
1.2565701007843018,
-0.8602443933486938,
-0.79136061668396,
0.14068739116191864,
-0.8215237259864807,
1.1031270027160645,
0.6536604762077332,
0.31910353899002075,
0.29210594296455383,
1.628665566444397,
0.7785674929618835,
-0.4112801253795624,
0.5156480669975281,
0.5212418437004089,
-0.1201367899775505,
-2.134906530380249,
-1.1480786800384521,
0.34161150455474854,
-0.5448242425918579,
-1.6037064790725708,
1.3668931722640991,
-1.1114294528961182,
-0.9869399070739746,
0.6385155916213989,
0.07644679397344589,
1.36211359500885,
0.3642447590827942,
1.6231374740600586,
2.138058662414551,
0.8603616952896118,
0.33243289589881897,
1.2501112222671509,
-0.13480354845523834,
-0.4335775375366211,
1.7846237421035767,
-0.47297203540802,
0.5162733793258667,
1.0696066617965698,
-0.3468702435493469,
-1.109035849571228,
-0.8235945701599121,
-1.2255563735961914,
-0.726676344871521,
1.121450662612915,
0.16285693645477295,
-1.087782382965088,
0.2538735866546631,
1.6188344955444336,
0.06094513088464737,
-0.2887183427810669,
0.6261609792709351,
0.42095208168029785,
-0.7795237302780151,
-0.06686680018901825,
-0.9138645529747009,
0.5732158422470093,
-0.20531214773654938,
-0.38714298605918884,
0.2692232131958008,
0.4880647659301758,
1.2931008338928223,
-0.05807570368051529,
0.06021587550640106,
1.0877163410186768,
-1.3864737749099731,
1.4752006530761719,
-0.7385877370834351,
0.3225972354412079,
-2.360701560974121,
1.4418747425079346,
-0.7699537873268127,
1.9386522769927979,
-2.650287389755249,
0.5178802013397217,
-0.5528347492218018,
-0.5609498023986816,
0.27745458483695984,
-0.39704570174217224,
0.1605527251958847,
-0.08412831276655197,
-1.0984654426574707,
-0.05926140397787094,
-0.6679657697677612,
0.6155198812484741,
1.2103370428085327,
1.3707938194274902,
-1.2190546989440918,
-0.24441315233707428,
-1.7259461879730225,
-0.16987529397010803,
-0.7472811341285706,
0.27537378668785095,
-1.9482885599136353,
-0.2026057094335556,
-1.9212568998336792,
-2.4384162425994873,
-1.2924424409866333,
-0.7341731190681458,
1.0986510515213013,
0.14043542742729187,
-0.8292104601860046,
1.2580426931381226,
-0.3628932237625122,
-1.7947641611099243,
1.0949991941452026,
-2.1747941970825195
] |
https://github.com/huggingface/datasets/issues/5094 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock | Hi, I have the same problem in use **datasets.IterableDatasetDict.map()**
my pytorch is 2.0.0a0+gitc263bd4
my python is 3.8.16(default, Jun 12 2023, 17:37:21)
work on aarch64 in 16 node, each node with 4*nVidia-A100-40G
every node have 4 process execute code as ↓
```
from datasets import load_dataset, interleave_datasets, IterableDatasetDict, concatenate_datasets
```
...
```
model_args.cache_dir = '/home/scx/.cache'
for dataset_name in data_args.datasets_name:
train_datasets.append(
load_dataset(
dataset_name,
cache_dir=model_args.cache_dir,
use_auth_token=True if model_args.use_auth_token else None,
streaming=data_args.streaming,
split='train'
).select_columns('text')
)
valid_datasets.append(
load_dataset(
dataset_name,
cache_dir=model_args.cache_dir,
use_auth_token=True if model_args.use_auth_token else None,
streaming=data_args.streaming,
split='validation'
).select_columns('text')
)
train_dataset = interleave_datasets(train_datasets,
probabilities=data_args.datasets_probabilities,
seed=training_args.seed,
stopping_strategy='all_exhausted')
raw_datasets = IterableDatasetDict({'train': train_dataset, 'validation': valid_dataset})
```
...
```
tokenized_datasets = None
with training_args.main_process_first(desc="dataset map tokenization"):
if not data_args.streaming:
tokenized_datasets = raw_datasets.map(
tokenize_function,
batched=True,
num_proc=data_args.preprocessing_num_workers,
load_from_cache_file=not data_args.overwrite_cache,
desc="Running tokenizer on dataset",
remove_columns=column_names,
)
else:
#TODO 20230722
logger.info('{}: {}'.format(__file__, 'tokenized_datasets = raw_datasets.map('))
logger.info('len raw_datasets: {}'.format(len(raw_datasets.items())))
logger.info('raw_datasets:{}'.format(raw_datasets.items()))
tokenized_datasets = raw_datasets.map(
tokenize_function,
batched=True,
batch_size=1000,
remove_columns=column_names
)
logger.info('map ok!')
logger.info('show train: {}'.format(next(iter(tokenized_datasets['train']))))
logger.info('ok')
# ### RAW CODE ###
# tokenized_datasets = raw_datasets.map(
# tokenize_function,
# batched=True,
# batch_size=1000,
# remove_columns=column_names
# )
#TODO 20230722
logger.info("Finish tokenization")
```
the output of my code is
```
07/22/2023 21:57:09 - INFO - __main__ - /demo/run_blue_space.py: tokenized_datasets = raw_datasets.map(
07/22/2023 21:57:09 - INFO - __main__ - len raw_datasets: 2
07/22/2023 21:57:09 - INFO - __main__ - raw_datasets:dict_items([('train', <datasets.iterable_dataset.IterableDataset object at 0x4005ee301190>), ('validation', <datasets.iterable_dataset.IterableDataset object at 0x4005ee5427f0>)])
07/22/2023 21:57:09 - INFO - __main__ - map ok!
07/22/2023 22:01:07 - INFO - __main__ - show train: {'input_ids': [14608, 26797, 31891, 34260, 12227, 33207, 5, 5, 31632, 26797, 31891, 34260, 12227, 33207, 7398, 28561, 31236, 31177, 31253, 33558, 31556, 31377, 72, 20732, 32383, 32295, 14027, 31178, 53, 61, 53, 55, 31189, 31146, 31321, 31235, 53, 61, 56, 58, 31189, 31145, 72, 53, 61, 58, 54, 31189, 54, 31245, 53, 60, 31224, 31896, 31178, 28561, 29331, 20732, 31888, 32637, 4426, 2824, 72, 53, 61, 60, 55, 31189, 53, 54, 31245, 53, 31224, 31896, 31178, 28561, 29331, 26137, 20732, 4426, 2824, 73, 54, 52, 52, 52, 31189, 61, 31245, 59, 31224, 31896, 31178, 29331, 28561, 20732, 4426, 2824, 73, 5], 'attention_mask': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]}
07/22/2023 22:01:07 - INFO - __main__ - ok
```
| ## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
| 485 | 447 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock
## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
Hi, I have the same problem in use **datasets.IterableDatasetDict.map()**
my pytorch is 2.0.0a0+gitc263bd4
my python is 3.8.16(default, Jun 12 2023, 17:37:21)
work on aarch64 in 16 node, each node with 4*nVidia-A100-40G
every node have 4 process execute code as ↓
```
from datasets import load_dataset, interleave_datasets, IterableDatasetDict, concatenate_datasets
```
...
```
model_args.cache_dir = '/home/scx/.cache'
for dataset_name in data_args.datasets_name:
train_datasets.append(
load_dataset(
dataset_name,
cache_dir=model_args.cache_dir,
use_auth_token=True if model_args.use_auth_token else None,
streaming=data_args.streaming,
split='train'
).select_columns('text')
)
valid_datasets.append(
load_dataset(
dataset_name,
cache_dir=model_args.cache_dir,
use_auth_token=True if model_args.use_auth_token else None,
streaming=data_args.streaming,
split='validation'
).select_columns('text')
)
train_dataset = interleave_datasets(train_datasets,
probabilities=data_args.datasets_probabilities,
seed=training_args.seed,
stopping_strategy='all_exhausted')
raw_datasets = IterableDatasetDict({'train': train_dataset, 'validation': valid_dataset})
```
...
```
tokenized_datasets = None
with training_args.main_process_first(desc="dataset map tokenization"):
if not data_args.streaming:
tokenized_datasets = raw_datasets.map(
tokenize_function,
batched=True,
num_proc=data_args.preprocessing_num_workers,
load_from_cache_file=not data_args.overwrite_cache,
desc="Running tokenizer on dataset",
remove_columns=column_names,
)
else:
#TODO 20230722
logger.info('{}: {}'.format(__file__, 'tokenized_datasets = raw_datasets.map('))
logger.info('len raw_datasets: {}'.format(len(raw_datasets.items())))
logger.info('raw_datasets:{}'.format(raw_datasets.items()))
tokenized_datasets = raw_datasets.map(
tokenize_function,
batched=True,
batch_size=1000,
remove_columns=column_names
)
logger.info('map ok!')
logger.info('show train: {}'.format(next(iter(tokenized_datasets['train']))))
logger.info('ok')
# ### RAW CODE ###
# tokenized_datasets = raw_datasets.map(
# tokenize_function,
# batched=True,
# batch_size=1000,
# remove_columns=column_names
# )
#TODO 20230722
logger.info("Finish tokenization")
```
the output of my code is
```
07/22/2023 21:57:09 - INFO - __main__ - /demo/run_blue_space.py: tokenized_datasets = raw_datasets.map(
07/22/2023 21:57:09 - INFO - __main__ - len raw_datasets: 2
07/22/2023 21:57:09 - INFO - __main__ - raw_datasets:dict_items([('train', <datasets.iterable_dataset.IterableDataset object at 0x4005ee301190>), ('validation', <datasets.iterable_dataset.IterableDataset object at 0x4005ee5427f0>)])
07/22/2023 21:57:09 - INFO - __main__ - map ok!
07/22/2023 22:01:07 - INFO - __main__ - show train: {'input_ids': [14608, 26797, 31891, 34260, 12227, 33207, 5, 5, 31632, 26797, 31891, 34260, 12227, 33207, 7398, 28561, 31236, 31177, 31253, 33558, 31556, 31377, 72, 20732, 32383, 32295, 14027, 31178, 53, 61, 53, 55, 31189, 31146, 31321, 31235, 53, 61, 56, 58, 31189, 31145, 72, 53, 61, 58, 54, 31189, 54, 31245, 53, 60, 31224, 31896, 31178, 28561, 29331, 20732, 31888, 32637, 4426, 2824, 72, 53, 61, 60, 55, 31189, 53, 54, 31245, 53, 31224, 31896, 31178, 28561, 29331, 26137, 20732, 4426, 2824, 73, 54, 52, 52, 52, 31189, 61, 31245, 59, 31224, 31896, 31178, 29331, 28561, 20732, 4426, 2824, 73, 5], 'attention_mask': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]}
07/22/2023 22:01:07 - INFO - __main__ - ok
```
| [
-1.2728172540664673,
-0.898106038570404,
-0.6675035357475281,
1.5078846216201782,
-0.15048755705356598,
-1.1838184595108032,
0.1676679104566574,
-1.037777066230774,
1.6529299020767212,
-0.8306827545166016,
0.33186355233192444,
-1.642417550086975,
0.025884125381708145,
-0.5294846892356873,
-0.7099189162254333,
-0.8553285002708435,
-0.3630971908569336,
-0.7704471349716187,
1.1102064847946167,
2.4790022373199463,
1.2116022109985352,
-1.3617780208587646,
2.721543312072754,
0.7294445633888245,
-0.27313902974128723,
-1.022451400756836,
0.5119602680206299,
0.02420932799577713,
-1.3098320960998535,
-0.4780839681625366,
-0.9773918986320496,
-0.06110548600554466,
-0.5749793648719788,
-0.530600368976593,
0.048546627163887024,
0.4360436201095581,
-0.34067589044570923,
-0.43972447514533997,
-0.5995767712593079,
-0.8195635676383972,
0.5065432786941528,
-0.3635629713535309,
0.8847498893737793,
-0.3069908618927002,
1.8620855808258057,
-0.5903087854385376,
0.46847742795944214,
0.7048625349998474,
1.3212766647338867,
0.2136135846376419,
-0.008978569880127907,
0.3795269727706909,
0.34761202335357666,
-0.03379765525460243,
0.528163492679596,
1.2579987049102783,
0.6583824753761292,
0.5207197666168213,
0.768476665019989,
-2.2253053188323975,
1.3710949420928955,
-0.9576165080070496,
0.33361122012138367,
1.3393239974975586,
-0.9172539114952087,
0.2899286150932312,
-1.7659608125686646,
-0.05864223465323448,
0.5995616912841797,
-2.2474288940429688,
0.306321382522583,
-1.3535258769989014,
-0.5243438482284546,
1.055833101272583,
0.3606233596801758,
-1.2128578424453735,
0.1498764455318451,
-0.42331913113594055,
1.1061313152313232,
0.3940792381763458,
1.0456103086471558,
-1.6636619567871094,
-0.07841675728559494,
-0.23848757147789001,
0.11999284476041794,
-1.2947020530700684,
-1.5918309688568115,
0.5457575917243958,
0.5756939053535461,
0.6724304556846619,
-0.101937435567379,
1.0468467473983765,
-1.0250275135040283,
0.7794437408447266,
-0.9785480499267578,
-1.6938483715057373,
-1.3979201316833496,
-2.259873151779175,
-2.243540048599243,
0.7791751623153687,
-0.452364057302475,
-0.57818603515625,
2.0768754482269287,
-1.0700881481170654,
-1.739996314048767,
1.0930438041687012,
0.281719833612442,
0.008906741626560688,
2.378340005874634,
0.2526441812515259,
-0.7203893661499023,
0.4843027889728546,
-0.7691013216972351,
0.7793152332305908,
-0.2793711721897125,
1.382179856300354,
0.4443669319152832,
-1.0933326482772827,
1.5655096769332886,
-0.44966769218444824,
0.5801029801368713,
-0.594494104385376,
-0.5421668887138367,
-0.7353447675704956,
0.24949699640274048,
1.8815587759017944,
-0.26052534580230713,
1.5427982807159424,
-0.35099196434020996,
-1.6580642461776733,
-1.6590973138809204,
0.8649615049362183,
0.4632969796657562,
-0.7855021953582764,
0.1131933182477951,
-0.47784918546676636,
0.1048925593495369,
0.041526518762111664,
1.2390646934509277,
1.3128716945648193,
0.6531018614768982,
-0.4030846655368805,
-0.8126692175865173,
0.15200407803058624,
-0.06470845639705658,
-0.7087991833686829,
-1.7899096012115479,
-0.35062190890312195,
0.20234523713588715,
0.6552833914756775,
-1.1839383840560913,
1.7916535139083862,
0.9244098663330078,
1.91371488571167,
0.982195258140564,
-0.35161951184272766,
1.4709739685058594,
0.06170543283224106,
1.8076668977737427,
-0.4967227578163147,
0.6924989223480225,
-0.37446480989456177,
-1.1475586891174316,
0.7904874086380005,
-0.352630078792572,
-2.0495922565460205,
-0.784993052482605,
-0.7339880466461182,
-0.1399894505739212,
-0.7832950353622437,
0.9168249368667603,
-0.3361148536205292,
-1.4943307638168335,
0.191568985581398,
-0.7171045541763306,
0.21077293157577515,
-1.1997804641723633,
0.329965740442276,
0.6984550952911377,
-0.6635046601295471,
0.11533772200345993,
-0.23885409533977509,
-1.2473503351211548,
-0.5146815180778503,
0.271866112947464,
1.8774033784866333,
-0.7064959406852722,
0.9217275977134705,
1.0683215856552124,
-0.7025314569473267,
0.05051765590906143,
0.3040471076965332,
-0.3278622627258301,
0.8830869793891907,
-1.1087406873703003,
-0.35644012689590454,
1.2247896194458008,
-0.15238086879253387,
-0.6067793965339661,
1.410730004310608,
0.7680283188819885,
-1.016308069229126,
-0.20380298793315887,
-0.1411990225315094,
-0.8540043234825134,
0.07481364160776138,
-1.522090196609497,
-0.12823514640331268,
0.48620402812957764,
-1.4924805164337158,
-0.43667176365852356,
-0.16383124887943268,
1.2791913747787476,
-0.19118830561637878,
1.390853762626648,
-0.4047609567642212,
-0.15612484514713287,
-0.29898351430892944,
-0.3792724609375,
0.1329495757818222,
-0.1946209818124771,
-0.6530145406723022,
0.16107803583145142,
-0.7985470294952393,
0.2982448935508728,
1.4837706089019775,
0.42787131667137146,
0.03449661284685135,
0.4591967761516571,
1.1969916820526123,
0.35998648405075073,
-0.1141214594244957,
-0.8239149451255798,
-1.6157222986221313,
2.0071966648101807,
-1.4026145935058594,
1.9802812337875366,
0.7921321392059326,
-0.042006488889455795,
-1.7863940000534058,
-1.8585829734802246,
1.290173888206482,
1.1519566774368286,
2.426870107650757,
0.5208056569099426,
0.4265890419483185,
-0.8329137563705444,
-0.6926795840263367,
0.36930882930755615,
-1.0225499868392944,
-0.6591797471046448,
0.16508892178535461,
2.368185043334961,
1.8095749616622925,
-0.4727384150028229,
-0.19467832148075104,
-0.9958896636962891,
1.3674784898757935,
-0.2620728015899658,
0.25467997789382935,
1.935243844985962,
-0.2206370085477829,
-1.0521881580352783,
1.3514591455459595,
-2.274789810180664,
0.19494320452213287,
2.045893907546997,
0.23365184664726257,
0.11794169992208481,
-1.3867226839065552,
-0.6197702288627625,
-0.3298516571521759,
-0.3724164068698883,
-1.2480944395065308,
0.4907134175300598,
-0.24311697483062744,
-0.8163476586341858,
-1.3926293849945068,
0.16817116737365723,
-1.1389451026916504,
-1.6686077117919922,
0.29410743713378906,
1.9241273403167725,
2.1020069122314453,
-0.76520836353302,
1.561436414718628,
-0.30712807178497314,
0.14966383576393127,
1.1844006776809692,
1.3334907293319702,
3.1288537979125977,
1.8098686933517456,
-1.3103693723678589,
0.6662647724151611,
-0.14498382806777954,
-0.5045926570892334,
1.1591272354125977,
-1.234257459640503,
1.2798235416412354,
-0.10849984735250473,
-1.1931463479995728,
-1.2401033639907837,
0.9765093922615051,
0.511813759803772,
0.06237350404262543,
-0.4576704204082489,
1.1577140092849731,
0.046737413853406906,
1.3566731214523315,
0.5614393353462219,
-0.3243753910064697,
0.5850516557693481,
-0.36106446385383606,
-0.5654187798500061,
1.4720606803894043,
0.1600532829761505,
-1.437113642692566,
-2.2325220108032227,
-0.18387371301651,
-0.7906442284584045,
0.06312064081430435,
-0.6861430406570435,
-0.9769694209098816,
1.6663440465927124,
0.34448111057281494,
-1.2562439441680908,
-0.24181528389453888,
-0.34916943311691284,
-0.535322904586792,
2.6424765586853027,
-1.3074086904525757,
-0.14765049517154694,
-0.9981063604354858,
-0.6666267514228821,
1.6126532554626465,
-1.1260654926300049,
-0.23927028477191925,
-1.0537796020507812,
-0.5630018711090088,
-1.2659841775894165,
-0.5261600613594055,
0.06710357964038849,
-0.9868696331977844,
0.7178747057914734,
0.13949893414974213,
-1.1362526416778564,
-0.36735913157463074,
-0.9010234475135803,
0.9559107422828674,
-0.1743820309638977,
0.11435312777757645,
1.8490453958511353,
0.34077098965644836,
-0.3901214003562927,
0.7669761180877686,
1.176772952079773,
0.6003429889678955,
-0.6447871923446655,
0.13952834904193878,
-0.6812017560005188,
0.31988880038261414,
-1.36051607131958,
0.3337946832180023,
-2.859066963195801,
0.6829373836517334,
-0.06656322628259659,
-0.14797593653202057,
0.001444750465452671,
-1.3506354093551636,
1.0840740203857422,
2.5894596576690674,
-1.1882277727127075,
0.4818987250328064,
0.32420283555984497,
1.1111310720443726,
-1.6795217990875244,
0.31720009446144104,
-0.4423635005950928,
2.0221872329711914,
0.23435740172863007,
1.2680177688598633,
-0.5199272036552429,
-2.2819950580596924,
0.621296226978302,
-1.254020094871521,
-1.0809417963027954,
0.8199553489685059,
-0.9331535696983337,
0.1540672481060028,
-1.3892176151275635,
-0.32730090618133545,
-0.8660197854042053,
-1.1246663331985474,
0.6168437004089355,
0.1613800972700119,
0.41987407207489014,
-0.5136435031890869,
0.3189338743686676,
-2.272322654724121,
-1.3186430931091309,
-0.17571108043193817,
-0.9592571258544922,
0.5857236981391907,
-0.3780722916126251,
0.650839626789093,
-0.16737212240695953,
0.0013154204934835434,
0.38767609000205994,
1.5025783777236938,
3.389970541000366,
0.20225213468074799,
0.24381813406944275,
-0.15255875885486603,
-0.9369668364524841,
1.41533362865448,
0.8609926700592041,
-0.19099688529968262,
-0.5756115317344666,
-1.0514761209487915,
1.28162682056427,
1.9142260551452637,
0.9662147760391235,
-0.028119679540395737,
-0.8893063068389893,
-0.7600444555282593,
-0.0347595177590847,
0.15274105966091156,
0.40866953134536743,
0.8677349090576172,
0.18397879600524902,
0.08664620667695999,
1.464106798171997,
1.212233304977417,
-0.4454899728298187,
0.353628009557724,
-0.8537306189537048,
-0.45114409923553467,
0.4397623538970947,
0.281556099653244,
-0.05764469504356384,
0.32415658235549927,
-1.033489465713501,
-0.2066495418548584,
-0.40679478645324707,
-0.9256564378738403,
-0.793274462223053,
-0.4112702012062073,
-0.3477209508419037,
1.6259478330612183,
0.1226087436079979,
-0.5532164573669434,
-0.050038378685712814,
-0.8062185049057007,
-0.1780952513217926,
-1.0363116264343262,
0.26823821663856506,
-0.06674559414386749,
-0.13193441927433014,
-0.19742664694786072,
1.6681761741638184,
-0.9554153084754944,
-2.0709786415100098,
0.1939898133277893,
0.23655007779598236,
-0.2969881594181061,
0.1353280246257782,
1.6935700178146362,
0.5369395017623901,
1.4587482213974,
1.2912410497665405,
0.9042574167251587,
-0.6973049640655518,
-1.2924975156784058,
0.7150086760520935,
0.9678940176963806,
-1.3956266641616821,
0.8214772939682007,
-0.11786721646785736,
-0.46477019786834717,
0.6022540330886841,
1.2856194972991943,
0.5307503342628479,
-1.992182731628418,
0.8495544195175171,
-1.006593108177185,
0.7702540755271912,
0.7664495706558228,
0.6361990571022034,
0.19016899168491364,
0.8413786292076111,
-1.2448914051055908,
-1.1749722957611084,
-0.6532060503959656,
-0.7146669626235962,
1.9340896606445312,
-0.31178018450737,
0.6239361763000488,
-0.21617260575294495,
-1.2158901691436768,
-0.09333990514278412,
0.7446455359458923,
0.31973448395729065,
-0.4713742434978485,
0.8087001442909241,
-0.6334474086761475,
-1.0231162309646606,
-1.3708226680755615,
-0.43711405992507935,
-1.048536777496338,
-0.9694881439208984,
0.9131231904029846,
0.7782614827156067,
0.3517824411392212,
1.8862236738204956,
0.6714057326316833,
0.306791216135025,
-2.6030285358428955,
0.8621639013290405,
0.2676733732223511,
-0.06808492541313171,
0.883309006690979,
0.362884521484375,
1.0252817869186401,
0.0020881323143839836,
0.5179023742675781,
-2.3862080574035645,
2.257603645324707,
-0.16850297152996063,
0.6480813026428223,
-0.0683922991156578,
-0.15334925055503845,
1.1617505550384521,
0.6016548275947571,
0.5385868549346924,
-1.0553938150405884,
0.6539948582649231,
-0.5602283477783203,
1.219348430633545,
0.8073272705078125,
-0.8498780131340027,
0.01812680810689926,
1.404471516609192,
0.40335601568222046,
-0.5699864029884338,
-0.9647572040557861,
-0.9221403002738953,
0.8996856808662415,
1.6903843879699707,
-0.03292599320411682,
-0.03700825572013855,
0.7453815937042236,
0.6980094909667969,
-1.318013072013855,
0.06005515158176422,
-0.6141734719276428,
-0.7575258016586304,
1.6861062049865723,
2.100870132446289,
-0.15646304190158844,
-0.21467837691307068,
-0.6671448349952698,
-1.2803055047988892,
0.8249780535697937,
-0.07361974567174911,
0.10443954914808273,
0.632321298122406,
-0.6942756772041321,
1.0874426364898682,
0.8532637357711792,
0.9378148913383484,
0.2387325018644333,
0.2664787471294403,
0.42157265543937683,
-0.3465708792209625,
-1.2244127988815308,
-0.28240054845809937,
-1.1089738607406616,
-2.598557472229004,
0.3991154134273529,
-0.18377608060836792,
-1.4373836517333984,
0.032505448907613754,
-1.0242246389389038,
0.9224293828010559,
-0.648020327091217,
-1.083065152168274,
-1.5118992328643799,
0.22164861857891083,
-0.06929201632738113,
0.9505371451377869,
-1.610608458518982,
-0.16076675057411194,
1.1655131578445435,
0.9485218524932861,
-0.6287582516670227,
1.017970323562622,
0.19189395010471344,
1.019376516342163,
0.881405234336853,
-0.3901577591896057,
0.5577489137649536,
0.0365796722471714,
-1.3785642385482788,
0.42650288343429565,
1.2448222637176514,
0.19750314950942993,
1.4672907590866089,
-0.48292994499206543,
0.0318870022892952,
0.414307564496994,
-0.6287082433700562,
-0.4888523817062378,
-0.43239471316337585,
0.6684964895248413,
0.08432838320732117,
-0.9175506830215454,
-0.09081211686134338,
-0.05782536789774895,
-0.26295435428619385,
0.24902477860450745,
-1.48149573802948,
-0.20921257138252258,
-0.38195598125457764,
-0.5876188278198242,
-1.2107875347137451,
-0.14657805860042572,
1.3973493576049805,
-0.8044940829277039,
-0.19253621995449066,
0.5131112337112427,
0.3424886167049408,
0.46737074851989746,
0.678922176361084,
-0.8116272687911987,
-0.28185075521469116,
-0.22640807926654816,
-0.31366875767707825,
0.3196541965007782,
1.342352032661438,
-0.032387085258960724,
-0.8783203363418579,
0.6310971975326538,
-0.29867228865623474,
0.12962423264980316,
1.9445734024047852,
0.07405976951122284,
-0.7987595796585083,
0.2566708028316498,
-0.7875290513038635,
1.9510339498519897,
1.745648741722107,
1.2961316108703613,
-0.12333840131759644,
-0.9219222664833069,
0.641269862651825,
-0.3431878387928009,
-0.3386867642402649,
0.9251767992973328,
0.40013203024864197,
-0.19691026210784912,
-1.3767236471176147,
0.7505810260772705,
1.2565701007843018,
-0.8602443933486938,
-0.79136061668396,
0.14068739116191864,
-0.8215237259864807,
1.1031270027160645,
0.6536604762077332,
0.31910353899002075,
0.29210594296455383,
1.628665566444397,
0.7785674929618835,
-0.4112801253795624,
0.5156480669975281,
0.5212418437004089,
-0.1201367899775505,
-2.134906530380249,
-1.1480786800384521,
0.34161150455474854,
-0.5448242425918579,
-1.6037064790725708,
1.3668931722640991,
-1.1114294528961182,
-0.9869399070739746,
0.6385155916213989,
0.07644679397344589,
1.36211359500885,
0.3642447590827942,
1.6231374740600586,
2.138058662414551,
0.8603616952896118,
0.33243289589881897,
1.2501112222671509,
-0.13480354845523834,
-0.4335775375366211,
1.7846237421035767,
-0.47297203540802,
0.5162733793258667,
1.0696066617965698,
-0.3468702435493469,
-1.109035849571228,
-0.8235945701599121,
-1.2255563735961914,
-0.726676344871521,
1.121450662612915,
0.16285693645477295,
-1.087782382965088,
0.2538735866546631,
1.6188344955444336,
0.06094513088464737,
-0.2887183427810669,
0.6261609792709351,
0.42095208168029785,
-0.7795237302780151,
-0.06686680018901825,
-0.9138645529747009,
0.5732158422470093,
-0.20531214773654938,
-0.38714298605918884,
0.2692232131958008,
0.4880647659301758,
1.2931008338928223,
-0.05807570368051529,
0.06021587550640106,
1.0877163410186768,
-1.3864737749099731,
1.4752006530761719,
-0.7385877370834351,
0.3225972354412079,
-2.360701560974121,
1.4418747425079346,
-0.7699537873268127,
1.9386522769927979,
-2.650287389755249,
0.5178802013397217,
-0.5528347492218018,
-0.5609498023986816,
0.27745458483695984,
-0.39704570174217224,
0.1605527251958847,
-0.08412831276655197,
-1.0984654426574707,
-0.05926140397787094,
-0.6679657697677612,
0.6155198812484741,
1.2103370428085327,
1.3707938194274902,
-1.2190546989440918,
-0.24441315233707428,
-1.7259461879730225,
-0.16987529397010803,
-0.7472811341285706,
0.27537378668785095,
-1.9482885599136353,
-0.2026057094335556,
-1.9212568998336792,
-2.4384162425994873,
-1.2924424409866333,
-0.7341731190681458,
1.0986510515213013,
0.14043542742729187,
-0.8292104601860046,
1.2580426931381226,
-0.3628932237625122,
-1.7947641611099243,
1.0949991941452026,
-2.1747941970825195
] |
https://github.com/huggingface/datasets/issues/5094 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock | @bio-punk `IterableDatasetDict.map` does not support multiprocessing (only `DatasetDict.map` and `Dataset.map` do), so please open a new issue as this doesn't seem to be related to the original issue. | ## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
| 485 | 28 | Multiprocessing with `Dataset.map` and `PyTorch` results in deadlock
## Describe the bug
There seems to be an issue with using multiprocessing with `datasets.Dataset.map` (i.e. setting `num_proc` to a value greater than one) combined with a function that uses `torch` under the hood. The subprocesses that `datasets.Dataset.map` spawns [a this step](https://github.com/huggingface/datasets/blob/1b935dab9d2f171a8c6294269421fe967eb55e34/src/datasets/arrow_dataset.py#L2663) go into wait mode forever.
## Steps to reproduce the bug
The below code goes into deadlock when `NUMBER_OF_PROCESSES` is greater than one.
```python
NUMBER_OF_PROCESSES = 2
from transformers import AutoTokenizer, AutoModel
from datasets import load_dataset
dataset = load_dataset("glue", "mrpc", split="train")
tokenizer = AutoTokenizer.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model = AutoModel.from_pretrained("sentence-transformers/all-MiniLM-L6-v2")
model.to("cpu")
def cls_pooling(model_output):
return model_output.last_hidden_state[:, 0]
def generate_embeddings_batched(examples):
sentences_batch = list(examples['sentence1'])
encoded_input = tokenizer(
sentences_batch, padding=True, truncation=True, return_tensors="pt"
)
encoded_input = {k: v.to("cpu") for k, v in encoded_input.items()}
model_output = model(**encoded_input)
embeddings = cls_pooling(model_output)
examples['embeddings'] = embeddings.detach().cpu().numpy() # 64, 384
return examples
embeddings_dataset = dataset.map(
generate_embeddings_batched,
batched=True,
batch_size=10,
num_proc=NUMBER_OF_PROCESSES
)
```
While debugging it I've seen that it gets "stuck" when calling `torch.nn.Embedding.forward` but some testing shows that the same happens with other functions from `torch.nn`.
## Environment info
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.31
- Python version: 3.9.14
- PyArrow version: 9.0.0
- Pandas version: 1.5.0
Not sure if this is a HF problem, a PyTorch problem or something I'm doing wrong..
Thanks!
@bio-punk `IterableDatasetDict.map` does not support multiprocessing (only `DatasetDict.map` and `Dataset.map` do), so please open a new issue as this doesn't seem to be related to the original issue. | [
-1.2728172540664673,
-0.898106038570404,
-0.6675035357475281,
1.5078846216201782,
-0.15048755705356598,
-1.1838184595108032,
0.1676679104566574,
-1.037777066230774,
1.6529299020767212,
-0.8306827545166016,
0.33186355233192444,
-1.642417550086975,
0.025884125381708145,
-0.5294846892356873,
-0.7099189162254333,
-0.8553285002708435,
-0.3630971908569336,
-0.7704471349716187,
1.1102064847946167,
2.4790022373199463,
1.2116022109985352,
-1.3617780208587646,
2.721543312072754,
0.7294445633888245,
-0.27313902974128723,
-1.022451400756836,
0.5119602680206299,
0.02420932799577713,
-1.3098320960998535,
-0.4780839681625366,
-0.9773918986320496,
-0.06110548600554466,
-0.5749793648719788,
-0.530600368976593,
0.048546627163887024,
0.4360436201095581,
-0.34067589044570923,
-0.43972447514533997,
-0.5995767712593079,
-0.8195635676383972,
0.5065432786941528,
-0.3635629713535309,
0.8847498893737793,
-0.3069908618927002,
1.8620855808258057,
-0.5903087854385376,
0.46847742795944214,
0.7048625349998474,
1.3212766647338867,
0.2136135846376419,
-0.008978569880127907,
0.3795269727706909,
0.34761202335357666,
-0.03379765525460243,
0.528163492679596,
1.2579987049102783,
0.6583824753761292,
0.5207197666168213,
0.768476665019989,
-2.2253053188323975,
1.3710949420928955,
-0.9576165080070496,
0.33361122012138367,
1.3393239974975586,
-0.9172539114952087,
0.2899286150932312,
-1.7659608125686646,
-0.05864223465323448,
0.5995616912841797,
-2.2474288940429688,
0.306321382522583,
-1.3535258769989014,
-0.5243438482284546,
1.055833101272583,
0.3606233596801758,
-1.2128578424453735,
0.1498764455318451,
-0.42331913113594055,
1.1061313152313232,
0.3940792381763458,
1.0456103086471558,
-1.6636619567871094,
-0.07841675728559494,
-0.23848757147789001,
0.11999284476041794,
-1.2947020530700684,
-1.5918309688568115,
0.5457575917243958,
0.5756939053535461,
0.6724304556846619,
-0.101937435567379,
1.0468467473983765,
-1.0250275135040283,
0.7794437408447266,
-0.9785480499267578,
-1.6938483715057373,
-1.3979201316833496,
-2.259873151779175,
-2.243540048599243,
0.7791751623153687,
-0.452364057302475,
-0.57818603515625,
2.0768754482269287,
-1.0700881481170654,
-1.739996314048767,
1.0930438041687012,
0.281719833612442,
0.008906741626560688,
2.378340005874634,
0.2526441812515259,
-0.7203893661499023,
0.4843027889728546,
-0.7691013216972351,
0.7793152332305908,
-0.2793711721897125,
1.382179856300354,
0.4443669319152832,
-1.0933326482772827,
1.5655096769332886,
-0.44966769218444824,
0.5801029801368713,
-0.594494104385376,
-0.5421668887138367,
-0.7353447675704956,
0.24949699640274048,
1.8815587759017944,
-0.26052534580230713,
1.5427982807159424,
-0.35099196434020996,
-1.6580642461776733,
-1.6590973138809204,
0.8649615049362183,
0.4632969796657562,
-0.7855021953582764,
0.1131933182477951,
-0.47784918546676636,
0.1048925593495369,
0.041526518762111664,
1.2390646934509277,
1.3128716945648193,
0.6531018614768982,
-0.4030846655368805,
-0.8126692175865173,
0.15200407803058624,
-0.06470845639705658,
-0.7087991833686829,
-1.7899096012115479,
-0.35062190890312195,
0.20234523713588715,
0.6552833914756775,
-1.1839383840560913,
1.7916535139083862,
0.9244098663330078,
1.91371488571167,
0.982195258140564,
-0.35161951184272766,
1.4709739685058594,
0.06170543283224106,
1.8076668977737427,
-0.4967227578163147,
0.6924989223480225,
-0.37446480989456177,
-1.1475586891174316,
0.7904874086380005,
-0.352630078792572,
-2.0495922565460205,
-0.784993052482605,
-0.7339880466461182,
-0.1399894505739212,
-0.7832950353622437,
0.9168249368667603,
-0.3361148536205292,
-1.4943307638168335,
0.191568985581398,
-0.7171045541763306,
0.21077293157577515,
-1.1997804641723633,
0.329965740442276,
0.6984550952911377,
-0.6635046601295471,
0.11533772200345993,
-0.23885409533977509,
-1.2473503351211548,
-0.5146815180778503,
0.271866112947464,
1.8774033784866333,
-0.7064959406852722,
0.9217275977134705,
1.0683215856552124,
-0.7025314569473267,
0.05051765590906143,
0.3040471076965332,
-0.3278622627258301,
0.8830869793891907,
-1.1087406873703003,
-0.35644012689590454,
1.2247896194458008,
-0.15238086879253387,
-0.6067793965339661,
1.410730004310608,
0.7680283188819885,
-1.016308069229126,
-0.20380298793315887,
-0.1411990225315094,
-0.8540043234825134,
0.07481364160776138,
-1.522090196609497,
-0.12823514640331268,
0.48620402812957764,
-1.4924805164337158,
-0.43667176365852356,
-0.16383124887943268,
1.2791913747787476,
-0.19118830561637878,
1.390853762626648,
-0.4047609567642212,
-0.15612484514713287,
-0.29898351430892944,
-0.3792724609375,
0.1329495757818222,
-0.1946209818124771,
-0.6530145406723022,
0.16107803583145142,
-0.7985470294952393,
0.2982448935508728,
1.4837706089019775,
0.42787131667137146,
0.03449661284685135,
0.4591967761516571,
1.1969916820526123,
0.35998648405075073,
-0.1141214594244957,
-0.8239149451255798,
-1.6157222986221313,
2.0071966648101807,
-1.4026145935058594,
1.9802812337875366,
0.7921321392059326,
-0.042006488889455795,
-1.7863940000534058,
-1.8585829734802246,
1.290173888206482,
1.1519566774368286,
2.426870107650757,
0.5208056569099426,
0.4265890419483185,
-0.8329137563705444,
-0.6926795840263367,
0.36930882930755615,
-1.0225499868392944,
-0.6591797471046448,
0.16508892178535461,
2.368185043334961,
1.8095749616622925,
-0.4727384150028229,
-0.19467832148075104,
-0.9958896636962891,
1.3674784898757935,
-0.2620728015899658,
0.25467997789382935,
1.935243844985962,
-0.2206370085477829,
-1.0521881580352783,
1.3514591455459595,
-2.274789810180664,
0.19494320452213287,
2.045893907546997,
0.23365184664726257,
0.11794169992208481,
-1.3867226839065552,
-0.6197702288627625,
-0.3298516571521759,
-0.3724164068698883,
-1.2480944395065308,
0.4907134175300598,
-0.24311697483062744,
-0.8163476586341858,
-1.3926293849945068,
0.16817116737365723,
-1.1389451026916504,
-1.6686077117919922,
0.29410743713378906,
1.9241273403167725,
2.1020069122314453,
-0.76520836353302,
1.561436414718628,
-0.30712807178497314,
0.14966383576393127,
1.1844006776809692,
1.3334907293319702,
3.1288537979125977,
1.8098686933517456,
-1.3103693723678589,
0.6662647724151611,
-0.14498382806777954,
-0.5045926570892334,
1.1591272354125977,
-1.234257459640503,
1.2798235416412354,
-0.10849984735250473,
-1.1931463479995728,
-1.2401033639907837,
0.9765093922615051,
0.511813759803772,
0.06237350404262543,
-0.4576704204082489,
1.1577140092849731,
0.046737413853406906,
1.3566731214523315,
0.5614393353462219,
-0.3243753910064697,
0.5850516557693481,
-0.36106446385383606,
-0.5654187798500061,
1.4720606803894043,
0.1600532829761505,
-1.437113642692566,
-2.2325220108032227,
-0.18387371301651,
-0.7906442284584045,
0.06312064081430435,
-0.6861430406570435,
-0.9769694209098816,
1.6663440465927124,
0.34448111057281494,
-1.2562439441680908,
-0.24181528389453888,
-0.34916943311691284,
-0.535322904586792,
2.6424765586853027,
-1.3074086904525757,
-0.14765049517154694,
-0.9981063604354858,
-0.6666267514228821,
1.6126532554626465,
-1.1260654926300049,
-0.23927028477191925,
-1.0537796020507812,
-0.5630018711090088,
-1.2659841775894165,
-0.5261600613594055,
0.06710357964038849,
-0.9868696331977844,
0.7178747057914734,
0.13949893414974213,
-1.1362526416778564,
-0.36735913157463074,
-0.9010234475135803,
0.9559107422828674,
-0.1743820309638977,
0.11435312777757645,
1.8490453958511353,
0.34077098965644836,
-0.3901214003562927,
0.7669761180877686,
1.176772952079773,
0.6003429889678955,
-0.6447871923446655,
0.13952834904193878,
-0.6812017560005188,
0.31988880038261414,
-1.36051607131958,
0.3337946832180023,
-2.859066963195801,
0.6829373836517334,
-0.06656322628259659,
-0.14797593653202057,
0.001444750465452671,
-1.3506354093551636,
1.0840740203857422,
2.5894596576690674,
-1.1882277727127075,
0.4818987250328064,
0.32420283555984497,
1.1111310720443726,
-1.6795217990875244,
0.31720009446144104,
-0.4423635005950928,
2.0221872329711914,
0.23435740172863007,
1.2680177688598633,
-0.5199272036552429,
-2.2819950580596924,
0.621296226978302,
-1.254020094871521,
-1.0809417963027954,
0.8199553489685059,
-0.9331535696983337,
0.1540672481060028,
-1.3892176151275635,
-0.32730090618133545,
-0.8660197854042053,
-1.1246663331985474,
0.6168437004089355,
0.1613800972700119,
0.41987407207489014,
-0.5136435031890869,
0.3189338743686676,
-2.272322654724121,
-1.3186430931091309,
-0.17571108043193817,
-0.9592571258544922,
0.5857236981391907,
-0.3780722916126251,
0.650839626789093,
-0.16737212240695953,
0.0013154204934835434,
0.38767609000205994,
1.5025783777236938,
3.389970541000366,
0.20225213468074799,
0.24381813406944275,
-0.15255875885486603,
-0.9369668364524841,
1.41533362865448,
0.8609926700592041,
-0.19099688529968262,
-0.5756115317344666,
-1.0514761209487915,
1.28162682056427,
1.9142260551452637,
0.9662147760391235,
-0.028119679540395737,
-0.8893063068389893,
-0.7600444555282593,
-0.0347595177590847,
0.15274105966091156,
0.40866953134536743,
0.8677349090576172,
0.18397879600524902,
0.08664620667695999,
1.464106798171997,
1.212233304977417,
-0.4454899728298187,
0.353628009557724,
-0.8537306189537048,
-0.45114409923553467,
0.4397623538970947,
0.281556099653244,
-0.05764469504356384,
0.32415658235549927,
-1.033489465713501,
-0.2066495418548584,
-0.40679478645324707,
-0.9256564378738403,
-0.793274462223053,
-0.4112702012062073,
-0.3477209508419037,
1.6259478330612183,
0.1226087436079979,
-0.5532164573669434,
-0.050038378685712814,
-0.8062185049057007,
-0.1780952513217926,
-1.0363116264343262,
0.26823821663856506,
-0.06674559414386749,
-0.13193441927433014,
-0.19742664694786072,
1.6681761741638184,
-0.9554153084754944,
-2.0709786415100098,
0.1939898133277893,
0.23655007779598236,
-0.2969881594181061,
0.1353280246257782,
1.6935700178146362,
0.5369395017623901,
1.4587482213974,
1.2912410497665405,
0.9042574167251587,
-0.6973049640655518,
-1.2924975156784058,
0.7150086760520935,
0.9678940176963806,
-1.3956266641616821,
0.8214772939682007,
-0.11786721646785736,
-0.46477019786834717,
0.6022540330886841,
1.2856194972991943,
0.5307503342628479,
-1.992182731628418,
0.8495544195175171,
-1.006593108177185,
0.7702540755271912,
0.7664495706558228,
0.6361990571022034,
0.19016899168491364,
0.8413786292076111,
-1.2448914051055908,
-1.1749722957611084,
-0.6532060503959656,
-0.7146669626235962,
1.9340896606445312,
-0.31178018450737,
0.6239361763000488,
-0.21617260575294495,
-1.2158901691436768,
-0.09333990514278412,
0.7446455359458923,
0.31973448395729065,
-0.4713742434978485,
0.8087001442909241,
-0.6334474086761475,
-1.0231162309646606,
-1.3708226680755615,
-0.43711405992507935,
-1.048536777496338,
-0.9694881439208984,
0.9131231904029846,
0.7782614827156067,
0.3517824411392212,
1.8862236738204956,
0.6714057326316833,
0.306791216135025,
-2.6030285358428955,
0.8621639013290405,
0.2676733732223511,
-0.06808492541313171,
0.883309006690979,
0.362884521484375,
1.0252817869186401,
0.0020881323143839836,
0.5179023742675781,
-2.3862080574035645,
2.257603645324707,
-0.16850297152996063,
0.6480813026428223,
-0.0683922991156578,
-0.15334925055503845,
1.1617505550384521,
0.6016548275947571,
0.5385868549346924,
-1.0553938150405884,
0.6539948582649231,
-0.5602283477783203,
1.219348430633545,
0.8073272705078125,
-0.8498780131340027,
0.01812680810689926,
1.404471516609192,
0.40335601568222046,
-0.5699864029884338,
-0.9647572040557861,
-0.9221403002738953,
0.8996856808662415,
1.6903843879699707,
-0.03292599320411682,
-0.03700825572013855,
0.7453815937042236,
0.6980094909667969,
-1.318013072013855,
0.06005515158176422,
-0.6141734719276428,
-0.7575258016586304,
1.6861062049865723,
2.100870132446289,
-0.15646304190158844,
-0.21467837691307068,
-0.6671448349952698,
-1.2803055047988892,
0.8249780535697937,
-0.07361974567174911,
0.10443954914808273,
0.632321298122406,
-0.6942756772041321,
1.0874426364898682,
0.8532637357711792,
0.9378148913383484,
0.2387325018644333,
0.2664787471294403,
0.42157265543937683,
-0.3465708792209625,
-1.2244127988815308,
-0.28240054845809937,
-1.1089738607406616,
-2.598557472229004,
0.3991154134273529,
-0.18377608060836792,
-1.4373836517333984,
0.032505448907613754,
-1.0242246389389038,
0.9224293828010559,
-0.648020327091217,
-1.083065152168274,
-1.5118992328643799,
0.22164861857891083,
-0.06929201632738113,
0.9505371451377869,
-1.610608458518982,
-0.16076675057411194,
1.1655131578445435,
0.9485218524932861,
-0.6287582516670227,
1.017970323562622,
0.19189395010471344,
1.019376516342163,
0.881405234336853,
-0.3901577591896057,
0.5577489137649536,
0.0365796722471714,
-1.3785642385482788,
0.42650288343429565,
1.2448222637176514,
0.19750314950942993,
1.4672907590866089,
-0.48292994499206543,
0.0318870022892952,
0.414307564496994,
-0.6287082433700562,
-0.4888523817062378,
-0.43239471316337585,
0.6684964895248413,
0.08432838320732117,
-0.9175506830215454,
-0.09081211686134338,
-0.05782536789774895,
-0.26295435428619385,
0.24902477860450745,
-1.48149573802948,
-0.20921257138252258,
-0.38195598125457764,
-0.5876188278198242,
-1.2107875347137451,
-0.14657805860042572,
1.3973493576049805,
-0.8044940829277039,
-0.19253621995449066,
0.5131112337112427,
0.3424886167049408,
0.46737074851989746,
0.678922176361084,
-0.8116272687911987,
-0.28185075521469116,
-0.22640807926654816,
-0.31366875767707825,
0.3196541965007782,
1.342352032661438,
-0.032387085258960724,
-0.8783203363418579,
0.6310971975326538,
-0.29867228865623474,
0.12962423264980316,
1.9445734024047852,
0.07405976951122284,
-0.7987595796585083,
0.2566708028316498,
-0.7875290513038635,
1.9510339498519897,
1.745648741722107,
1.2961316108703613,
-0.12333840131759644,
-0.9219222664833069,
0.641269862651825,
-0.3431878387928009,
-0.3386867642402649,
0.9251767992973328,
0.40013203024864197,
-0.19691026210784912,
-1.3767236471176147,
0.7505810260772705,
1.2565701007843018,
-0.8602443933486938,
-0.79136061668396,
0.14068739116191864,
-0.8215237259864807,
1.1031270027160645,
0.6536604762077332,
0.31910353899002075,
0.29210594296455383,
1.628665566444397,
0.7785674929618835,
-0.4112801253795624,
0.5156480669975281,
0.5212418437004089,
-0.1201367899775505,
-2.134906530380249,
-1.1480786800384521,
0.34161150455474854,
-0.5448242425918579,
-1.6037064790725708,
1.3668931722640991,
-1.1114294528961182,
-0.9869399070739746,
0.6385155916213989,
0.07644679397344589,
1.36211359500885,
0.3642447590827942,
1.6231374740600586,
2.138058662414551,
0.8603616952896118,
0.33243289589881897,
1.2501112222671509,
-0.13480354845523834,
-0.4335775375366211,
1.7846237421035767,
-0.47297203540802,
0.5162733793258667,
1.0696066617965698,
-0.3468702435493469,
-1.109035849571228,
-0.8235945701599121,
-1.2255563735961914,
-0.726676344871521,
1.121450662612915,
0.16285693645477295,
-1.087782382965088,
0.2538735866546631,
1.6188344955444336,
0.06094513088464737,
-0.2887183427810669,
0.6261609792709351,
0.42095208168029785,
-0.7795237302780151,
-0.06686680018901825,
-0.9138645529747009,
0.5732158422470093,
-0.20531214773654938,
-0.38714298605918884,
0.2692232131958008,
0.4880647659301758,
1.2931008338928223,
-0.05807570368051529,
0.06021587550640106,
1.0877163410186768,
-1.3864737749099731,
1.4752006530761719,
-0.7385877370834351,
0.3225972354412079,
-2.360701560974121,
1.4418747425079346,
-0.7699537873268127,
1.9386522769927979,
-2.650287389755249,
0.5178802013397217,
-0.5528347492218018,
-0.5609498023986816,
0.27745458483695984,
-0.39704570174217224,
0.1605527251958847,
-0.08412831276655197,
-1.0984654426574707,
-0.05926140397787094,
-0.6679657697677612,
0.6155198812484741,
1.2103370428085327,
1.3707938194274902,
-1.2190546989440918,
-0.24441315233707428,
-1.7259461879730225,
-0.16987529397010803,
-0.7472811341285706,
0.27537378668785095,
-1.9482885599136353,
-0.2026057094335556,
-1.9212568998336792,
-2.4384162425994873,
-1.2924424409866333,
-0.7341731190681458,
1.0986510515213013,
0.14043542742729187,
-0.8292104601860046,
1.2580426931381226,
-0.3628932237625122,
-1.7947641611099243,
1.0949991941452026,
-2.1747941970825195
] |
https://github.com/huggingface/datasets/issues/5093 | Mismatch between tutoriel and doc | Hi, thanks for reporting! This line should be replaced with
```python
dataset = dataset.map(lambda examples: tokenizer(examples["text"], return_tensors="np"), batched=True)
```
for it to work (the `return_tensors` part inside the `tokenizer` call). | ## Describe the bug
In the "Process text data" tutorial, [`map` has `return_tensors` as kwarg](https://huggingface.co/docs/datasets/main/en/nlp_process#map). It does not seem to appear in the [function documentation](https://huggingface.co/docs/datasets/main/en/package_reference/main_classes#datasets.Dataset.map), nor to work.
## Steps to reproduce the bug
MWE:
```python
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
from datasets import load_dataset
dataset = load_dataset("lhoestq/demo1", split="train")
dataset = dataset.map(lambda examples: tokenizer(examples["review"]), batched=True, return_tensors="pt")
```
## Expected results
return_tensors to be a valid kwarg :smiley:
## Actual results
```python
>> TypeError: map() got an unexpected keyword argument 'return_tensors'
```
## Environment info
- `datasets` version: 2.3.2
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 8.0.0
- Pandas version: 1.4.3
| 486 | 30 | Mismatch between tutoriel and doc
## Describe the bug
In the "Process text data" tutorial, [`map` has `return_tensors` as kwarg](https://huggingface.co/docs/datasets/main/en/nlp_process#map). It does not seem to appear in the [function documentation](https://huggingface.co/docs/datasets/main/en/package_reference/main_classes#datasets.Dataset.map), nor to work.
## Steps to reproduce the bug
MWE:
```python
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
from datasets import load_dataset
dataset = load_dataset("lhoestq/demo1", split="train")
dataset = dataset.map(lambda examples: tokenizer(examples["review"]), batched=True, return_tensors="pt")
```
## Expected results
return_tensors to be a valid kwarg :smiley:
## Actual results
```python
>> TypeError: map() got an unexpected keyword argument 'return_tensors'
```
## Environment info
- `datasets` version: 2.3.2
- Platform: Linux-5.14.0-1052-oem-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyArrow version: 8.0.0
- Pandas version: 1.4.3
Hi, thanks for reporting! This line should be replaced with
```python
dataset = dataset.map(lambda examples: tokenizer(examples["text"], return_tensors="np"), batched=True)
```
for it to work (the `return_tensors` part inside the `tokenizer` call). | [
-1.1240530014038086,
-0.8730599880218506,
-0.6890818476676941,
1.4983723163604736,
-0.123601034283638,
-1.2408503293991089,
0.11401708424091339,
-1.0427606105804443,
1.7035943269729614,
-0.7551620006561279,
0.3326227366924286,
-1.7037315368652344,
-0.042782217264175415,
-0.5552496910095215,
-0.7266607880592346,
-0.8249865770339966,
-0.42329418659210205,
-0.6502572894096375,
1.056876301765442,
2.4744436740875244,
1.2478382587432861,
-1.3882602453231812,
2.6655733585357666,
0.728425920009613,
-0.16206195950508118,
-0.9624191522598267,
0.5380881428718567,
-0.01680409535765648,
-1.3533855676651,
-0.37677931785583496,
-0.938736081123352,
-0.06696581840515137,
-0.5432413220405579,
-0.58767169713974,
-0.013672671280801296,
0.4559851884841919,
-0.3384079933166504,
-0.5053144097328186,
-0.6002065539360046,
-0.8184278607368469,
0.42014268040657043,
-0.2832579016685486,
0.9195954203605652,
-0.4015243947505951,
1.800203800201416,
-0.5533133745193481,
0.5184133052825928,
0.7186760902404785,
1.2886236906051636,
0.23555245995521545,
0.013206347823143005,
0.3514588177204132,
0.3672998547554016,
-0.003058964852243662,
0.5857670307159424,
1.2278342247009277,
0.6891109347343445,
0.4885045886039734,
0.7549631595611572,
-2.2432985305786133,
1.2755608558654785,
-0.9673296213150024,
0.271115779876709,
1.363327980041504,
-0.9395132064819336,
0.3146764636039734,
-1.8009480237960815,
-0.053001679480075836,
0.5454915165901184,
-2.2180213928222656,
0.252646267414093,
-1.3346891403198242,
-0.5154328942298889,
1.1200288534164429,
0.3906968832015991,
-1.253799557685852,
0.06513293832540512,
-0.3581865131855011,
0.9933828115463257,
0.4376077950000763,
1.120322346687317,
-1.7276302576065063,
0.00742018036544323,
-0.3259265124797821,
0.09432875365018845,
-1.2034848928451538,
-1.5600039958953857,
0.5481628775596619,
0.6182473301887512,
0.6117801666259766,
-0.11787010729312897,
0.9682487845420837,
-1.0039485692977905,
0.7806441783905029,
-0.9288880228996277,
-1.8558313846588135,
-1.3626644611358643,
-2.2733817100524902,
-2.2822329998016357,
0.7347342371940613,
-0.43869274854660034,
-0.42520830035209656,
2.0444226264953613,
-0.9831901788711548,
-1.7592520713806152,
1.0468578338623047,
0.3245899975299835,
-0.030470674857497215,
2.367647886276245,
0.26531943678855896,
-0.7228078246116638,
0.47542446851730347,
-0.7983485460281372,
0.7195889353752136,
-0.32326626777648926,
1.323538899421692,
0.4000408351421356,
-1.0591650009155273,
1.6222888231277466,
-0.3659638464450836,
0.5966214537620544,
-0.6744585633277893,
-0.5103099346160889,
-0.62861168384552,
0.21973349153995514,
1.9245141744613647,
-0.3521363139152527,
1.4987949132919312,
-0.2885437309741974,
-1.5713481903076172,
-1.5694187879562378,
0.8113420009613037,
0.4686301350593567,
-0.660393476486206,
0.10823477059602737,
-0.3722458779811859,
0.1005944162607193,
-0.05043352395296097,
1.2267494201660156,
1.2646305561065674,
0.7436031103134155,
-0.2880241870880127,
-0.8137720823287964,
0.15036697685718536,
0.0038317404687404633,
-0.7497168779373169,
-1.71115243434906,
-0.35022059082984924,
0.17742416262626648,
0.6175538301467896,
-1.2543518543243408,
1.8065394163131714,
0.8152220845222473,
1.9288203716278076,
1.0495803356170654,
-0.31685274839401245,
1.472333312034607,
0.05183029919862747,
1.9181417226791382,
-0.4554578959941864,
0.5975958704948425,
-0.35820361971855164,
-1.1913986206054688,
0.8743472099304199,
-0.35819751024246216,
-2.044328212738037,
-0.7341690063476562,
-0.8565365672111511,
-0.15119986236095428,
-0.7161491513252258,
0.9963860511779785,
-0.2401229590177536,
-1.4295824766159058,
0.15197089314460754,
-0.7782699465751648,
0.08291126787662506,
-1.26545250415802,
0.26459774374961853,
0.7469433546066284,
-0.6296558976173401,
0.0820869728922844,
-0.2456449568271637,
-1.2586699724197388,
-0.5091774463653564,
0.3466207683086395,
1.9233475923538208,
-0.7581225037574768,
0.9944459199905396,
1.0752193927764893,
-0.7699888348579407,
0.009579302743077278,
0.3058668076992035,
-0.3858101963996887,
0.9351664185523987,
-1.1309056282043457,
-0.4347798824310303,
1.2009618282318115,
-0.19350315630435944,
-0.6703340411186218,
1.4989830255508423,
0.6928104758262634,
-1.0361425876617432,
-0.2605954706668854,
-0.15026193857192993,
-0.8002669811248779,
0.08028518408536911,
-1.611853003501892,
-0.12913884222507477,
0.45484986901283264,
-1.600151777267456,
-0.5222095251083374,
-0.11345822364091873,
1.319100260734558,
-0.147553950548172,
1.387891173362732,
-0.235916867852211,
-0.15511004626750946,
-0.3908407390117645,
-0.4411534368991852,
0.05742856115102768,
-0.21101827919483185,
-0.6278440356254578,
0.23943910002708435,
-0.8248974084854126,
0.3256514072418213,
1.4256982803344727,
0.32766756415367126,
-0.0073631526902318,
0.5876334309577942,
1.1079237461090088,
0.45272091031074524,
-0.11822853237390518,
-0.8288841247558594,
-1.6072871685028076,
2.024475336074829,
-1.4059340953826904,
1.9909071922302246,
0.7372735142707825,
-0.04621657729148865,
-1.797823190689087,
-1.955914855003357,
1.4438220262527466,
1.1445847749710083,
2.369415044784546,
0.5730050206184387,
0.4545230269432068,
-0.8114315271377563,
-0.6730764508247375,
0.3543904721736908,
-0.9596819877624512,
-0.6924045085906982,
0.18225261569023132,
2.3948709964752197,
1.7596087455749512,
-0.46479690074920654,
-0.23254065215587616,
-1.0141756534576416,
1.3515979051589966,
-0.19974815845489502,
0.1932363063097,
1.9129217863082886,
-0.2753221094608307,
-1.012059211730957,
1.3090882301330566,
-2.3317160606384277,
0.166179820895195,
2.0134339332580566,
0.23778612911701202,
0.1441827416419983,
-1.3343310356140137,
-0.6645331978797913,
-0.2988080084323883,
-0.45444244146347046,
-1.1385011672973633,
0.5537548065185547,
-0.14325307309627533,
-0.7853201627731323,
-1.3678330183029175,
0.18194761872291565,
-1.0730431079864502,
-1.732529878616333,
0.1929246038198471,
1.8873326778411865,
1.9934141635894775,
-0.7963080406188965,
1.5350210666656494,
-0.29646098613739014,
0.20680227875709534,
1.290487289428711,
1.2922348976135254,
3.1473798751831055,
1.8761218786239624,
-1.3378665447235107,
0.7477277517318726,
-0.0771101638674736,
-0.45790722966194153,
1.2028089761734009,
-1.2406362295150757,
1.2702534198760986,
-0.20870892703533173,
-1.2165778875350952,
-1.2568080425262451,
0.9217537641525269,
0.499484658241272,
0.03269451856613159,
-0.5290834903717041,
1.189462661743164,
0.07999904453754425,
1.330513596534729,
0.6053056120872498,
-0.32221686840057373,
0.6096652746200562,
-0.4105006754398346,
-0.418331503868103,
1.510866403579712,
0.18854252994060516,
-1.3924940824508667,
-2.29152774810791,
-0.145046204328537,
-0.921907365322113,
0.03251457214355469,
-0.6594719290733337,
-1.0119608640670776,
1.6428298950195312,
0.43173205852508545,
-1.1794259548187256,
-0.2819645404815674,
-0.34459951519966125,
-0.5726287961006165,
2.7102441787719727,
-1.3662903308868408,
-0.1610306054353714,
-1.0351027250289917,
-0.6558496952056885,
1.6587661504745483,
-1.18064284324646,
-0.2306700199842453,
-1.0444995164871216,
-0.6206234693527222,
-1.3113744258880615,
-0.6367247104644775,
0.08636945486068726,
-0.9078913927078247,
0.819370448589325,
0.08141938596963882,
-1.2062591314315796,
-0.25534382462501526,
-0.9562154412269592,
0.9407952427864075,
-0.20508411526679993,
0.15524466335773468,
1.883147120475769,
0.39761343598365784,
-0.34684160351753235,
0.682384729385376,
1.2127492427825928,
0.6641371250152588,
-0.5690514445304871,
0.28024715185165405,
-0.6641941666603088,
0.36933645606040955,
-1.3973135948181152,
0.20442648231983185,
-2.852041482925415,
0.614840567111969,
-0.04688341170549393,
-0.0590813010931015,
0.05971191078424454,
-1.2554867267608643,
1.0553243160247803,
2.542381763458252,
-1.2796361446380615,
0.477236807346344,
0.3492334187030792,
1.0834412574768066,
-1.543005108833313,
0.23406727612018585,
-0.5219495892524719,
2.0994958877563477,
0.17714978754520416,
1.191176414489746,
-0.41580718755722046,
-2.1935043334960938,
0.6474805474281311,
-1.3091766834259033,
-1.1218974590301514,
0.8108112215995789,
-0.8348886966705322,
0.13649053871631622,
-1.3448213338851929,
-0.1906903088092804,
-0.8249596953392029,
-1.1815543174743652,
0.6799685955047607,
0.039748452603816986,
0.41446825861930847,
-0.587872326374054,
0.4262961745262146,
-2.1790008544921875,
-1.3677949905395508,
-0.23366227746009827,
-0.9602963924407959,
0.5268522500991821,
-0.3315483629703522,
0.7036880850791931,
-0.20077165961265564,
0.01568438485264778,
0.33916088938713074,
1.367769718170166,
3.393118143081665,
0.16370822489261627,
0.2805284261703491,
-0.16578221321105957,
-1.0262970924377441,
1.453485131263733,
0.9648043513298035,
-0.18173599243164062,
-0.5579509735107422,
-1.0495696067810059,
1.2793669700622559,
1.9572911262512207,
1.0799248218536377,
0.06842316687107086,
-0.860776960849762,
-0.8489388227462769,
0.016726141795516014,
0.19241540133953094,
0.41989368200302124,
0.8601392507553101,
0.13424299657344818,
0.09291713684797287,
1.412762999534607,
1.1407793760299683,
-0.363439679145813,
0.3311889171600342,
-0.8707502484321594,
-0.4608009457588196,
0.5594600439071655,
0.33649522066116333,
0.07388536632061005,
0.33366838097572327,
-1.0627132654190063,
-0.24906904995441437,
-0.4128624498844147,
-0.8957430720329285,
-0.6765588521957397,
-0.40972501039505005,
-0.36202025413513184,
1.5900734663009644,
0.013951947912573814,
-0.5229321122169495,
-0.04915570467710495,
-0.8531574606895447,
-0.03826151788234711,
-1.0471999645233154,
0.3265330493450165,
-0.14521333575248718,
-0.0784684345126152,
-0.21369335055351257,
1.7206847667694092,
-0.9776341319084167,
-2.079050302505493,
0.21066568791866302,
0.2577936053276062,
-0.37149664759635925,
0.11371751874685287,
1.6584079265594482,
0.6086070537567139,
1.3970617055892944,
1.3647634983062744,
0.958812952041626,
-0.6404153108596802,
-1.2562472820281982,
0.6608397364616394,
1.0545297861099243,
-1.4159404039382935,
0.7545067667961121,
-0.00183159951120615,
-0.5368220210075378,
0.5693560838699341,
1.2656590938568115,
0.5006334185600281,
-1.9326368570327759,
0.7094288468360901,
-0.9024795889854431,
0.8121062517166138,
0.678931474685669,
0.769883394241333,
0.17672012746334076,
0.7805336117744446,
-1.246881127357483,
-1.0889317989349365,
-0.6813725829124451,
-0.6891762614250183,
1.9107258319854736,
-0.2944508492946625,
0.5389876365661621,
-0.22490842640399933,
-1.294074535369873,
-0.13024821877479553,
0.6882005333900452,
0.30954641103744507,
-0.5344789624214172,
0.8265884518623352,
-0.574529230594635,
-1.0174994468688965,
-1.3279650211334229,
-0.439680814743042,
-1.0680145025253296,
-0.9106857776641846,
1.0118858814239502,
0.7775421142578125,
0.4218621551990509,
1.8809638023376465,
0.6472876071929932,
0.2737719714641571,
-2.6190779209136963,
0.8788344860076904,
0.2955683469772339,
-0.0955263301730156,
0.8781761527061462,
0.3610149323940277,
1.0529390573501587,
-0.13874433934688568,
0.5864818096160889,
-2.3768022060394287,
2.297140598297119,
-0.11782127618789673,
0.6393195390701294,
0.029108362272381783,
-0.17751139402389526,
1.0617238283157349,
0.5879295468330383,
0.5292484760284424,
-1.0723270177841187,
0.7030648589134216,
-0.5818149447441101,
1.2013145685195923,
0.7941482663154602,
-0.8593105673789978,
-0.0841769129037857,
1.354413390159607,
0.48386919498443604,
-0.4640626311302185,
-0.9873644709587097,
-0.938076376914978,
1.0028855800628662,
1.6787054538726807,
0.002677702344954014,
0.00034166406840085983,
0.8545501828193665,
0.6724271178245544,
-1.317944049835205,
0.04516874998807907,
-0.6634292006492615,
-0.6853975653648376,
1.6885939836502075,
2.05118989944458,
-0.14514240622520447,
-0.21630895137786865,
-0.7348730564117432,
-1.2292087078094482,
0.755628228187561,
-0.000771435908973217,
0.036686062812805176,
0.7273054718971252,
-0.6498171091079712,
1.1346819400787354,
0.8451459407806396,
0.9108283519744873,
0.15327395498752594,
0.24627673625946045,
0.31345638632774353,
-0.3130658268928528,
-1.279590129852295,
-0.2512524127960205,
-1.0234498977661133,
-2.609342336654663,
0.4611088037490845,
-0.20808690786361694,
-1.4227313995361328,
0.018009912222623825,
-1.058038353919983,
0.9579041004180908,
-0.5845823287963867,
-1.12247896194458,
-1.472462773323059,
0.24939009547233582,
-0.026055512949824333,
0.9503277540206909,
-1.625364899635315,
-0.16891805827617645,
1.251482605934143,
0.9598475694656372,
-0.7178029417991638,
0.9776980876922607,
0.2066079080104828,
1.0353312492370605,
0.8636433482170105,
-0.3008491098880768,
0.5399481058120728,
0.09141819179058075,
-1.4224605560302734,
0.3902132511138916,
1.1803585290908813,
0.13829690217971802,
1.4788637161254883,
-0.5297499299049377,
0.05850795656442642,
0.43248578906059265,
-0.45207643508911133,
-0.5231820344924927,
-0.572419285774231,
0.6366125345230103,
0.09581548720598221,
-0.9376180768013,
-0.10070140659809113,
0.013094313442707062,
-0.1801471710205078,
0.18324901163578033,
-1.5239588022232056,
-0.17206871509552002,
-0.3283717632293701,
-0.6697521209716797,
-1.2082393169403076,
-0.068463996052742,
1.3410879373550415,
-0.8249050378799438,
-0.18647024035453796,
0.5111474990844727,
0.24353426694869995,
0.5058829188346863,
0.6036524772644043,
-0.7168292999267578,
-0.32036131620407104,
-0.2467791587114334,
-0.3828389048576355,
0.3389442265033722,
1.3645583391189575,
-0.06311333179473877,
-0.9694474339485168,
0.6663308143615723,
-0.3453017473220825,
0.09687255322933197,
1.9260915517807007,
0.033711984753608704,
-0.8559297919273376,
0.28903746604919434,
-0.7289482355117798,
1.9068533182144165,
1.7000449895858765,
1.3279317617416382,
-0.0570695698261261,
-0.9316315650939941,
0.6239796876907349,
-0.3077511191368103,
-0.4269126355648041,
0.9241531491279602,
0.35143280029296875,
-0.27189040184020996,
-1.385789155960083,
0.6571968197822571,
1.2937664985656738,
-0.9328064918518066,
-0.8301081657409668,
0.1941859871149063,
-0.8427581787109375,
1.056549072265625,
0.725437343120575,
0.28510138392448425,
0.3572849631309509,
1.5652248859405518,
0.7879354357719421,
-0.43511271476745605,
0.5168856382369995,
0.48932817578315735,
-0.13836312294006348,
-2.02179217338562,
-1.0716476440429688,
0.38188427686691284,
-0.6182175874710083,
-1.5945961475372314,
1.3715872764587402,
-1.2021719217300415,
-0.9897456765174866,
0.6019958257675171,
0.07699323445558548,
1.390213131904602,
0.35902395844459534,
1.6026898622512817,
2.0531063079833984,
0.8281316161155701,
0.3186182379722595,
1.2458537817001343,
-0.14383509755134583,
-0.4053870439529419,
1.708877682685852,
-0.5142326951026917,
0.5559465289115906,
1.053951621055603,
-0.3234042823314667,
-1.1109373569488525,
-0.7946569323539734,
-1.2829680442810059,
-0.7966632843017578,
1.1807247400283813,
0.12415631860494614,
-1.1255723237991333,
0.25067415833473206,
1.588054895401001,
0.058026090264320374,
-0.26271697878837585,
0.6814693808555603,
0.31459248065948486,
-0.8358005881309509,
-0.0579332560300827,
-0.9364877343177795,
0.5473173260688782,
-0.08740334212779999,
-0.37333089113235474,
0.27306994795799255,
0.48862266540527344,
1.3772960901260376,
0.002616656944155693,
0.19446294009685516,
1.1723073720932007,
-1.3839671611785889,
1.5927250385284424,
-0.744865357875824,
0.26647454500198364,
-2.365260124206543,
1.4290417432785034,
-0.7650015950202942,
1.9076650142669678,
-2.6409800052642822,
0.4719979763031006,
-0.4956987798213959,
-0.4931071102619171,
0.20920155942440033,
-0.3490242660045624,
0.1694050282239914,
-0.15363691747188568,
-1.1691235303878784,
-0.12672409415245056,
-0.6580900549888611,
0.6380066275596619,
1.1065402030944824,
1.3670475482940674,
-1.111891269683838,
-0.32330188155174255,
-1.7943050861358643,
-0.12167678773403168,
-0.7068443298339844,
0.3216712474822998,
-1.9211690425872803,
-0.16182783246040344,
-1.8442422151565552,
-2.4984707832336426,
-1.3199821710586548,
-0.7746956944465637,
1.1328266859054565,
0.10763856023550034,
-0.8903704881668091,
1.1770620346069336,
-0.39323312044143677,
-1.8360764980316162,
1.07374107837677,
-2.263245105743408
] |
https://github.com/huggingface/datasets/issues/5088 | load_datasets("json", ...) don't read local .json.gz properly | Hi @junwang-wish, thanks for reporting.
Unfortunately, I'm not able to reproduce the bug. Which version of `datasets` are you using? Does the problem persist if you update `datasets`?
```shell
pip install -U datasets
``` | ## Describe the bug
I have a local file `*.json.gz` and it can be read by `pandas.read_json(lines=True)`, but cannot be read by `load_datasets("json")` (resulting in 0 lines)
## Steps to reproduce the bug
```python
fpath = '/data/junwang/.cache/general/57b6f2314cbe0bc45dda5b78f0871df2/test.json.gz'
ds_panda = DatasetDict(
test=Dataset.from_pandas(
pd.read_json(fpath, lines=True)
)
)
ds_direct = load_dataset(
'json', data_files={
'test': fpath
}, features=Features(
text_input=Value(dtype="string", id=None),
text_output=Value(dtype="string", id=None)
)
)
len(ds_panda['test']), len(ds_direct['test'])
```
## Expected results
Lines of `ds_panda['test']` and `ds_direct['test']` should match.
## Actual results
```
Using custom data configuration default-c0ef2598760968aa
Downloading and preparing dataset json/default to /data/junwang/.cache/huggingface/datasets/json/default-c0ef2598760968aa/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab...
Dataset json downloaded and prepared to /data/junwang/.cache/huggingface/datasets/json/default-c0ef2598760968aa/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab. Subsequent calls will reuse this data.
(62087, 0)
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Ubuntu 18.04.4 LTS
- Python version: 3.8.13
- PyArrow version: 9.0.0
| 488 | 34 | load_datasets("json", ...) don't read local .json.gz properly
## Describe the bug
I have a local file `*.json.gz` and it can be read by `pandas.read_json(lines=True)`, but cannot be read by `load_datasets("json")` (resulting in 0 lines)
## Steps to reproduce the bug
```python
fpath = '/data/junwang/.cache/general/57b6f2314cbe0bc45dda5b78f0871df2/test.json.gz'
ds_panda = DatasetDict(
test=Dataset.from_pandas(
pd.read_json(fpath, lines=True)
)
)
ds_direct = load_dataset(
'json', data_files={
'test': fpath
}, features=Features(
text_input=Value(dtype="string", id=None),
text_output=Value(dtype="string", id=None)
)
)
len(ds_panda['test']), len(ds_direct['test'])
```
## Expected results
Lines of `ds_panda['test']` and `ds_direct['test']` should match.
## Actual results
```
Using custom data configuration default-c0ef2598760968aa
Downloading and preparing dataset json/default to /data/junwang/.cache/huggingface/datasets/json/default-c0ef2598760968aa/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab...
Dataset json downloaded and prepared to /data/junwang/.cache/huggingface/datasets/json/default-c0ef2598760968aa/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab. Subsequent calls will reuse this data.
(62087, 0)
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Ubuntu 18.04.4 LTS
- Python version: 3.8.13
- PyArrow version: 9.0.0
Hi @junwang-wish, thanks for reporting.
Unfortunately, I'm not able to reproduce the bug. Which version of `datasets` are you using? Does the problem persist if you update `datasets`?
```shell
pip install -U datasets
``` | [
-1.2054353952407837,
-0.9305023550987244,
-0.7191705703735352,
1.5577306747436523,
-0.10155139118432999,
-1.131675124168396,
0.13757142424583435,
-0.9527695178985596,
1.6636205911636353,
-0.7428202629089355,
0.26303327083587646,
-1.6782121658325195,
-0.11031098663806915,
-0.6307396292686462,
-0.696113646030426,
-0.8231039047241211,
-0.3227967619895935,
-0.794426441192627,
1.0618168115615845,
2.4734134674072266,
1.249869465827942,
-1.2936025857925415,
2.7454919815063477,
0.7256075143814087,
-0.3616443872451782,
-0.9951328039169312,
0.4678654074668884,
-0.01718057692050934,
-1.197927713394165,
-0.47713780403137207,
-0.919486939907074,
0.015756970271468163,
-0.49240076541900635,
-0.48717302083969116,
0.11399785429239273,
0.4659654498100281,
-0.32913321256637573,
-0.41426652669906616,
-0.539072573184967,
-0.7206785082817078,
0.5303853750228882,
-0.3853505253791809,
0.9112206697463989,
-0.25465601682662964,
1.7885842323303223,
-0.5799092054367065,
0.3662024736404419,
0.6565287113189697,
1.3573158979415894,
0.13576284050941467,
0.06917843222618103,
0.3758862018585205,
0.32205843925476074,
0.004600599408149719,
0.5954729318618774,
1.256142020225525,
0.6453375220298767,
0.4693089723587036,
0.7222145795822144,
-2.2817955017089844,
1.290528416633606,
-0.9634720087051392,
0.2796340584754944,
1.2764379978179932,
-0.9261717200279236,
0.39148402214050293,
-1.7843878269195557,
-0.010072393342852592,
0.5855007171630859,
-2.291059732437134,
0.262096643447876,
-1.3683518171310425,
-0.4662400484085083,
0.9391397833824158,
0.3244481682777405,
-1.24326491355896,
0.19773073494434357,
-0.5046738386154175,
1.0742826461791992,
0.3918045163154602,
1.0504299402236938,
-1.7608939409255981,
-0.1483611911535263,
-0.26522618532180786,
0.1373264491558075,
-1.3279517889022827,
-1.5866094827651978,
0.5203269124031067,
0.596129298210144,
0.7467299699783325,
-0.10113845765590668,
1.1210581064224243,
-1.074381709098816,
0.7361094951629639,
-1.0114977359771729,
-1.6783748865127563,
-1.3923131227493286,
-2.2130274772644043,
-2.2493090629577637,
0.7771425843238831,
-0.4131709933280945,
-0.5222154855728149,
1.9867620468139648,
-1.0233170986175537,
-1.8766921758651733,
1.034017562866211,
0.35094547271728516,
-0.06425414234399796,
2.4521067142486572,
0.2491135448217392,
-0.7751940488815308,
0.47589248418807983,
-0.7146945595741272,
0.7796262502670288,
-0.30926525592803955,
1.3471120595932007,
0.5156304836273193,
-0.984633207321167,
1.6328788995742798,
-0.27194613218307495,
0.6075278520584106,
-0.7216997742652893,
-0.5495867729187012,
-0.854668915271759,
0.23553317785263062,
1.9302746057510376,
-0.386033296585083,
1.441439151763916,
-0.3324078321456909,
-1.633109450340271,
-1.6167703866958618,
0.8800962567329407,
0.46116918325424194,
-0.8347633481025696,
0.11316312104463577,
-0.5349174737930298,
0.16452209651470184,
-0.029362283647060394,
1.1033010482788086,
1.2445855140686035,
0.7182826995849609,
-0.3526369333267212,
-0.7901038527488708,
0.21903087198734283,
-0.014405356720089912,
-0.6228945851325989,
-1.8243706226348877,
-0.3123897910118103,
0.15131887793540955,
0.6817343831062317,
-1.2204140424728394,
1.6351386308670044,
0.8866649270057678,
1.8945764303207397,
1.1166926622390747,
-0.3430193066596985,
1.576606273651123,
0.013503031805157661,
1.839478850364685,
-0.5636716485023499,
0.5996624827384949,
-0.37331342697143555,
-1.1361827850341797,
0.8256665468215942,
-0.34180885553359985,
-2.0424275398254395,
-0.8067328333854675,
-0.6878902912139893,
-0.1817571371793747,
-0.8275256752967834,
0.8585969805717468,
-0.38578885793685913,
-1.5409016609191895,
0.15437662601470947,
-0.6864379048347473,
0.21060442924499512,
-1.198797345161438,
0.29638195037841797,
0.7422763705253601,
-0.5811681151390076,
0.05807740241289139,
-0.24491947889328003,
-1.245374083518982,
-0.37471073865890503,
0.28905171155929565,
1.9224164485931396,
-0.6960240006446838,
0.8657371401786804,
1.0502042770385742,
-0.7535718083381653,
0.16482585668563843,
0.2663242816925049,
-0.21987870335578918,
0.8011118769645691,
-1.1106466054916382,
-0.3437232971191406,
1.1269595623016357,
-0.14982794225215912,
-0.6605930924415588,
1.3823785781860352,
0.82436603307724,
-1.0322506427764893,
-0.24054166674613953,
-0.1360463798046112,
-0.8454115986824036,
0.0021812496706843376,
-1.624800443649292,
-0.1919630467891693,
0.4325443506240845,
-1.515824794769287,
-0.4358257055282593,
-0.28122448921203613,
1.3172554969787598,
-0.22702892124652863,
1.4416072368621826,
-0.18356560170650482,
-0.1734500676393509,
-0.2578914165496826,
-0.45609402656555176,
0.1693689078092575,
-0.17277517914772034,
-0.5840059518814087,
0.21530857682228088,
-0.7754104137420654,
0.3470674753189087,
1.5001190900802612,
0.3705787658691406,
0.01603003963828087,
0.46279191970825195,
1.1410423517227173,
0.3706623315811157,
-0.10585002601146698,
-0.8744868040084839,
-1.583296537399292,
2.01141357421875,
-1.5158981084823608,
1.911932349205017,
0.6718564629554749,
-0.08465629070997238,
-1.7069804668426514,
-1.9685335159301758,
1.3631654977798462,
1.1692360639572144,
2.394118547439575,
0.5610681176185608,
0.44228649139404297,
-0.7890223264694214,
-0.789429247379303,
0.3119494915008545,
-1.0474929809570312,
-0.7352082133293152,
0.1738949865102768,
2.4160807132720947,
1.753209114074707,
-0.5053495168685913,
-0.26617223024368286,
-0.9597115516662598,
1.2923489809036255,
-0.17647124826908112,
0.23745998740196228,
2.0232741832733154,
-0.226030632853508,
-1.050156831741333,
1.3571950197219849,
-2.380516290664673,
0.1637093722820282,
1.974623203277588,
0.2863764762878418,
0.12817905843257904,
-1.4428400993347168,
-0.6730723977088928,
-0.2661222815513611,
-0.4685351848602295,
-1.3387620449066162,
0.5298255085945129,
-0.329298734664917,
-0.8731499314308167,
-1.57109534740448,
0.11347679048776627,
-1.116104006767273,
-1.5810717344284058,
0.2450992316007614,
1.944659948348999,
2.031590700149536,
-0.7828369140625,
1.529371976852417,
-0.27591443061828613,
0.1308877170085907,
1.1916375160217285,
1.3118607997894287,
3.095305919647217,
1.8192204236984253,
-1.3117603063583374,
0.7131660580635071,
-0.1794043928384781,
-0.46793538331985474,
1.142221450805664,
-1.28650963306427,
1.1503218412399292,
-0.2575305104255676,
-1.2130743265151978,
-1.2338359355926514,
0.9362327456474304,
0.4340246319770813,
0.005930674262344837,
-0.4474286437034607,
1.2194125652313232,
0.1178177148103714,
1.3458302021026611,
0.5880048871040344,
-0.3202013373374939,
0.6475235819816589,
-0.4241626262664795,
-0.49886399507522583,
1.587591528892517,
0.17654359340667725,
-1.3860191106796265,
-2.286567211151123,
-0.21341373026371002,
-0.8167130351066589,
0.1050301194190979,
-0.5144001245498657,
-1.0342267751693726,
1.680000901222229,
0.3320271968841553,
-1.2210721969604492,
-0.1923583447933197,
-0.21548841893672943,
-0.516997218132019,
2.6798183917999268,
-1.2815607786178589,
-0.22882021963596344,
-1.0180820226669312,
-0.5873204469680786,
1.624506950378418,
-1.105515956878662,
-0.1673162430524826,
-0.9488202929496765,
-0.6203324794769287,
-1.3237130641937256,
-0.49946463108062744,
-0.01814301684498787,
-0.921211302280426,
0.8224250674247742,
0.2170572429895401,
-1.1502134799957275,
-0.2636529803276062,
-0.9050029516220093,
0.9668405055999756,
-0.14550447463989258,
0.23613955080509186,
1.8431317806243896,
0.3815147876739502,
-0.4172405004501343,
0.8404311537742615,
1.118392825126648,
0.6091738939285278,
-0.68569415807724,
0.1504838764667511,
-0.677828848361969,
0.2516683340072632,
-1.3269057273864746,
0.3396396040916443,
-2.858142137527466,
0.6455976366996765,
-0.07234778255224228,
-0.09895417839288712,
-0.028006529435515404,
-1.3493014574050903,
1.094285249710083,
2.573700428009033,
-1.2123806476593018,
0.5196624398231506,
0.36858904361724854,
1.291414737701416,
-1.582128643989563,
0.17327138781547546,
-0.46646517515182495,
2.1232237815856934,
0.2448846846818924,
1.2590640783309937,
-0.462291419506073,
-2.28796124458313,
0.6177861094474792,
-1.302370548248291,
-1.1637457609176636,
0.7540551424026489,
-0.9526368379592896,
0.14822761714458466,
-1.434694528579712,
-0.22797851264476776,
-0.9323337078094482,
-1.1687601804733276,
0.7314666509628296,
0.1685875505208969,
0.39234256744384766,
-0.5292944312095642,
0.3847472667694092,
-2.0614874362945557,
-1.3081194162368774,
-0.15509825944900513,
-1.0052098035812378,
0.5132980942726135,
-0.3960908055305481,
0.6419681310653687,
-0.09963615983724594,
-0.028198260813951492,
0.3562513589859009,
1.4045236110687256,
3.276373863220215,
0.14282859861850739,
0.24283446371555328,
-0.18167972564697266,
-0.9467253088951111,
1.4236583709716797,
0.9367920160293579,
-0.16063624620437622,
-0.6513515114784241,
-1.1177691221237183,
1.3016483783721924,
1.9542940855026245,
1.0716495513916016,
-0.001879807561635971,
-0.8252403736114502,
-0.786450982093811,
0.02082923799753189,
0.249359592795372,
0.4972080588340759,
0.8860867023468018,
0.015952259302139282,
0.08309318870306015,
1.3762683868408203,
1.1285665035247803,
-0.4611671566963196,
0.3731974959373474,
-0.9374638795852661,
-0.43674999475479126,
0.3727567791938782,
0.1383441984653473,
-0.025009382516145706,
0.36242568492889404,
-1.0805692672729492,
-0.2685359716415405,
-0.35339176654815674,
-0.8908681869506836,
-0.7804882526397705,
-0.34552305936813354,
-0.3681260347366333,
1.654358148574829,
0.09045206755399704,
-0.5487776398658752,
-0.08078262954950333,
-0.717379093170166,
-0.2001185268163681,
-1.0424195528030396,
0.2324226051568985,
-0.17072446644306183,
-0.1373406946659088,
-0.05879399552941322,
1.7339714765548706,
-0.9535843133926392,
-2.131490468978882,
0.19972631335258484,
0.2862944006919861,
-0.282936692237854,
0.250999391078949,
1.7102197408676147,
0.5564435124397278,
1.4439020156860352,
1.337471604347229,
1.0085186958312988,
-0.6290138959884644,
-1.2289186716079712,
0.675434410572052,
0.9526256918907166,
-1.3861356973648071,
0.8377759456634521,
-0.11156684905290604,
-0.5210765600204468,
0.563154399394989,
1.279259443283081,
0.45958131551742554,
-1.9832366704940796,
0.8190133571624756,
-0.9895297884941101,
0.6951733231544495,
0.723347008228302,
0.7153723835945129,
0.30417776107788086,
0.9065314531326294,
-1.2140603065490723,
-1.1141149997711182,
-0.7253791689872742,
-0.6222630739212036,
2.012112617492676,
-0.24321743845939636,
0.5696885585784912,
-0.021186910569667816,
-1.2521896362304688,
-0.126706063747406,
0.7698648571968079,
0.31727147102355957,
-0.4805382490158081,
0.8516771197319031,
-0.6531844139099121,
-1.0354666709899902,
-1.283923864364624,
-0.5185996294021606,
-1.059989333152771,
-0.9372046589851379,
1.007367730140686,
0.8169643878936768,
0.329572856426239,
1.8757997751235962,
0.617467999458313,
0.3116822838783264,
-2.5979888439178467,
0.8905530571937561,
0.3221951127052307,
-0.05301181226968765,
0.9617822170257568,
0.30794864892959595,
1.05350923538208,
0.04430658370256424,
0.5909149050712585,
-2.340684413909912,
2.2284114360809326,
-0.18662860989570618,
0.7605342864990234,
0.022104807198047638,
-0.16344207525253296,
1.0914589166641235,
0.47220557928085327,
0.5663817524909973,
-1.0894986391067505,
0.6969767212867737,
-0.5667757391929626,
1.196061134338379,
0.9204309582710266,
-0.8786006569862366,
0.07009859383106232,
1.2294899225234985,
0.37488096952438354,
-0.507768452167511,
-0.9175758361816406,
-0.9300605058670044,
0.9019497036933899,
1.7300267219543457,
-0.06700621545314789,
0.02626745030283928,
0.8628078103065491,
0.6668070554733276,
-1.2645907402038574,
0.07790457457304001,
-0.5951477289199829,
-0.6873525977134705,
1.7309839725494385,
2.079277276992798,
-0.21508489549160004,
-0.15575401484966278,
-0.6848592162132263,
-1.2185126543045044,
0.7953234314918518,
0.020304225385189056,
0.14743958413600922,
0.7086066007614136,
-0.788303792476654,
1.1108629703521729,
0.7861897349357605,
0.9666203856468201,
0.06898558884859085,
0.3824523687362671,
0.4832109808921814,
-0.3408415913581848,
-1.1608502864837646,
-0.32555675506591797,
-1.0984811782836914,
-2.6203794479370117,
0.4525485038757324,
-0.21126578748226166,
-1.3203330039978027,
0.10931460559368134,
-1.0199908018112183,
0.9543125033378601,
-0.6536880731582642,
-1.0981462001800537,
-1.4688496589660645,
0.28848737478256226,
-0.13045182824134827,
0.8747178316116333,
-1.6620527505874634,
-0.08724184334278107,
1.2068127393722534,
0.9874030351638794,
-0.5775067210197449,
0.9669394493103027,
0.30610543489456177,
0.9670084118843079,
0.8535474538803101,
-0.3422091603279114,
0.6033098697662354,
0.05308014899492264,
-1.3597948551177979,
0.48713386058807373,
1.264913558959961,
0.1912887543439865,
1.5135341882705688,
-0.5180421471595764,
-0.0706205815076828,
0.4424701929092407,
-0.6171424388885498,
-0.4745224714279175,
-0.4833473563194275,
0.6562759876251221,
0.1478402465581894,
-0.9677130579948425,
-0.07817231863737106,
-0.01087317056953907,
-0.1661221981048584,
0.14010562002658844,
-1.5321383476257324,
-0.211482971906662,
-0.45613735914230347,
-0.6011461615562439,
-1.2696181535720825,
-0.05640990287065506,
1.3102226257324219,
-0.8021039366722107,
-0.26717859506607056,
0.43842101097106934,
0.40245407819747925,
0.5058711767196655,
0.5526787042617798,
-0.7340996861457825,
-0.34706026315689087,
-0.23657631874084473,
-0.4120347499847412,
0.3655877113342285,
1.3100520372390747,
-0.08783791214227676,
-0.9870645999908447,
0.6879020929336548,
-0.4384382963180542,
0.02862486243247986,
1.8686003684997559,
-0.029266856610774994,
-0.7425497174263,
0.2376396805047989,
-0.7237142324447632,
1.9094526767730713,
1.6610711812973022,
1.3489625453948975,
-0.2180393636226654,
-0.865032970905304,
0.6731268167495728,
-0.2980089783668518,
-0.41239142417907715,
0.9483662247657776,
0.46402961015701294,
-0.2368045300245285,
-1.4636595249176025,
0.695059597492218,
1.3059098720550537,
-0.9433816075325012,
-0.7115189433097839,
0.11954700946807861,
-0.7875911593437195,
1.1123939752578735,
0.6233286261558533,
0.2429061383008957,
0.20204173028469086,
1.6040289402008057,
0.6923580169677734,
-0.4383426904678345,
0.4852564334869385,
0.458914577960968,
-0.1483786255121231,
-2.198385238647461,
-1.0912326574325562,
0.30879122018814087,
-0.42117422819137573,
-1.5852833986282349,
1.3707245588302612,
-1.1152406930923462,
-0.9100432395935059,
0.539749026298523,
0.1039472222328186,
1.4051731824874878,
0.3994266986846924,
1.6164976358413696,
2.1386120319366455,
0.8657199740409851,
0.3033313751220703,
1.241637945175171,
-0.17639927566051483,
-0.4746462106704712,
1.7872198820114136,
-0.42462295293807983,
0.5276924967765808,
1.0059845447540283,
-0.3161294460296631,
-1.101726770401001,
-0.7475216388702393,
-1.2805761098861694,
-0.6750807166099548,
1.2021061182022095,
0.10097186267375946,
-1.1141457557678223,
0.25596898794174194,
1.5616390705108643,
0.0996297150850296,
-0.2593492269515991,
0.7156859636306763,
0.5018899440765381,
-0.7709414958953857,
-0.12206295877695084,
-0.8710205554962158,
0.5270088911056519,
-0.2708337903022766,
-0.3339605927467346,
0.20222356915473938,
0.47373300790786743,
1.3217856884002686,
0.05979964882135391,
0.08657564967870712,
1.1823307275772095,
-1.3946844339370728,
1.5453360080718994,
-0.7144671082496643,
0.331703245639801,
-2.4752414226531982,
1.4187746047973633,
-0.8462262749671936,
1.9565198421478271,
-2.580566883087158,
0.520053505897522,
-0.5808228254318237,
-0.40957939624786377,
0.27068787813186646,
-0.3065817356109619,
0.11724098026752472,
-0.16414259374141693,
-1.0613523721694946,
-0.09075687825679779,
-0.7154860496520996,
0.6260462403297424,
1.1138277053833008,
1.2803864479064941,
-1.0558212995529175,
-0.18909551203250885,
-1.8063507080078125,
-0.18884392082691193,
-0.7103146910667419,
0.2608775496482849,
-2.0311930179595947,
-0.23620568215847015,
-1.9497758150100708,
-2.344278573989868,
-1.2793655395507812,
-0.7977010011672974,
1.1269383430480957,
0.18694938719272614,
-0.9253695607185364,
1.275766372680664,
-0.33533984422683716,
-1.8035597801208496,
1.0843546390533447,
-2.192633628845215
] |
https://github.com/huggingface/datasets/issues/5088 | load_datasets("json", ...) don't read local .json.gz properly | Thanks @albertvillanova I updated `datasets` from `2.5.1` to `2.5.2` and tested copying the `json.gz` to a different directory and my mind was blown:
```python
fpath = '/data/junwang/.cache/general/57b6f2314cbe0bc45dda5b78f0871df2/test.json.gz'
ds_panda = DatasetDict(
test=Dataset.from_pandas(
pd.read_json(fpath, lines=True)
)
)
ds_direct = load_dataset(
'json', data_files={
'test': fpath
}, features=Features(
text_input=Value(dtype="string", id=None),
text_output=Value(dtype="string", id=None)
)
)
len(ds_panda['test']), len(ds_direct['test'])
```
produces
```python
Using custom data configuration default-0e6cf24134163e8b
Found cached dataset json (/data/junwang/.cache/huggingface/datasets/json/default-0e6cf24134163e8b/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab)
(1, 0)
```
but then I ran below command to see if the same file in a different directory leads to same discrepancy
```shell
cp /data/junwang/.cache/general/57b6f2314cbe0bc45dda5b78f0871df2/test.json.gz tmp_test.json.gz
```
and so I ran
```python
fpath = 'tmp_test.json.gz'
ds_panda = DatasetDict(
test=Dataset.from_pandas(
pd.read_json(fpath, lines=True)
)
)
ds_direct = load_dataset(
'json', data_files={
'test': fpath
}, features=Features(
text_input=Value(dtype="string", id=None),
text_output=Value(dtype="string", id=None)
)
)
len(ds_panda['test']), len(ds_direct['test'])
```
and behold, I get
```python
Using custom data configuration default-f679b32ab0008520
Downloading and preparing dataset json/default to /data/junwang/.cache/huggingface/datasets/json/default-f679b32ab0008520/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab...
Dataset json downloaded and prepared to /data/junwang/.cache/huggingface/datasets/json/default-f679b32ab0008520/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab. Subsequent calls will reuse this data.
(1, 1)
```
They match now !
This problem happens regardless of the shell I use (VScode jupyter extension or plain old Python REPL).
I attached the `json.gz` here for reference: [test.json.gz](https://github.com/huggingface/datasets/files/9734843/test.json.gz)
| ## Describe the bug
I have a local file `*.json.gz` and it can be read by `pandas.read_json(lines=True)`, but cannot be read by `load_datasets("json")` (resulting in 0 lines)
## Steps to reproduce the bug
```python
fpath = '/data/junwang/.cache/general/57b6f2314cbe0bc45dda5b78f0871df2/test.json.gz'
ds_panda = DatasetDict(
test=Dataset.from_pandas(
pd.read_json(fpath, lines=True)
)
)
ds_direct = load_dataset(
'json', data_files={
'test': fpath
}, features=Features(
text_input=Value(dtype="string", id=None),
text_output=Value(dtype="string", id=None)
)
)
len(ds_panda['test']), len(ds_direct['test'])
```
## Expected results
Lines of `ds_panda['test']` and `ds_direct['test']` should match.
## Actual results
```
Using custom data configuration default-c0ef2598760968aa
Downloading and preparing dataset json/default to /data/junwang/.cache/huggingface/datasets/json/default-c0ef2598760968aa/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab...
Dataset json downloaded and prepared to /data/junwang/.cache/huggingface/datasets/json/default-c0ef2598760968aa/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab. Subsequent calls will reuse this data.
(62087, 0)
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Ubuntu 18.04.4 LTS
- Python version: 3.8.13
- PyArrow version: 9.0.0
| 488 | 189 | load_datasets("json", ...) don't read local .json.gz properly
## Describe the bug
I have a local file `*.json.gz` and it can be read by `pandas.read_json(lines=True)`, but cannot be read by `load_datasets("json")` (resulting in 0 lines)
## Steps to reproduce the bug
```python
fpath = '/data/junwang/.cache/general/57b6f2314cbe0bc45dda5b78f0871df2/test.json.gz'
ds_panda = DatasetDict(
test=Dataset.from_pandas(
pd.read_json(fpath, lines=True)
)
)
ds_direct = load_dataset(
'json', data_files={
'test': fpath
}, features=Features(
text_input=Value(dtype="string", id=None),
text_output=Value(dtype="string", id=None)
)
)
len(ds_panda['test']), len(ds_direct['test'])
```
## Expected results
Lines of `ds_panda['test']` and `ds_direct['test']` should match.
## Actual results
```
Using custom data configuration default-c0ef2598760968aa
Downloading and preparing dataset json/default to /data/junwang/.cache/huggingface/datasets/json/default-c0ef2598760968aa/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab...
Dataset json downloaded and prepared to /data/junwang/.cache/huggingface/datasets/json/default-c0ef2598760968aa/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab. Subsequent calls will reuse this data.
(62087, 0)
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Ubuntu 18.04.4 LTS
- Python version: 3.8.13
- PyArrow version: 9.0.0
Thanks @albertvillanova I updated `datasets` from `2.5.1` to `2.5.2` and tested copying the `json.gz` to a different directory and my mind was blown:
```python
fpath = '/data/junwang/.cache/general/57b6f2314cbe0bc45dda5b78f0871df2/test.json.gz'
ds_panda = DatasetDict(
test=Dataset.from_pandas(
pd.read_json(fpath, lines=True)
)
)
ds_direct = load_dataset(
'json', data_files={
'test': fpath
}, features=Features(
text_input=Value(dtype="string", id=None),
text_output=Value(dtype="string", id=None)
)
)
len(ds_panda['test']), len(ds_direct['test'])
```
produces
```python
Using custom data configuration default-0e6cf24134163e8b
Found cached dataset json (/data/junwang/.cache/huggingface/datasets/json/default-0e6cf24134163e8b/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab)
(1, 0)
```
but then I ran below command to see if the same file in a different directory leads to same discrepancy
```shell
cp /data/junwang/.cache/general/57b6f2314cbe0bc45dda5b78f0871df2/test.json.gz tmp_test.json.gz
```
and so I ran
```python
fpath = 'tmp_test.json.gz'
ds_panda = DatasetDict(
test=Dataset.from_pandas(
pd.read_json(fpath, lines=True)
)
)
ds_direct = load_dataset(
'json', data_files={
'test': fpath
}, features=Features(
text_input=Value(dtype="string", id=None),
text_output=Value(dtype="string", id=None)
)
)
len(ds_panda['test']), len(ds_direct['test'])
```
and behold, I get
```python
Using custom data configuration default-f679b32ab0008520
Downloading and preparing dataset json/default to /data/junwang/.cache/huggingface/datasets/json/default-f679b32ab0008520/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab...
Dataset json downloaded and prepared to /data/junwang/.cache/huggingface/datasets/json/default-f679b32ab0008520/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab. Subsequent calls will reuse this data.
(1, 1)
```
They match now !
This problem happens regardless of the shell I use (VScode jupyter extension or plain old Python REPL).
I attached the `json.gz` here for reference: [test.json.gz](https://github.com/huggingface/datasets/files/9734843/test.json.gz)
| [
-1.2054353952407837,
-0.9305023550987244,
-0.7191705703735352,
1.5577306747436523,
-0.10155139118432999,
-1.131675124168396,
0.13757142424583435,
-0.9527695178985596,
1.6636205911636353,
-0.7428202629089355,
0.26303327083587646,
-1.6782121658325195,
-0.11031098663806915,
-0.6307396292686462,
-0.696113646030426,
-0.8231039047241211,
-0.3227967619895935,
-0.794426441192627,
1.0618168115615845,
2.4734134674072266,
1.249869465827942,
-1.2936025857925415,
2.7454919815063477,
0.7256075143814087,
-0.3616443872451782,
-0.9951328039169312,
0.4678654074668884,
-0.01718057692050934,
-1.197927713394165,
-0.47713780403137207,
-0.919486939907074,
0.015756970271468163,
-0.49240076541900635,
-0.48717302083969116,
0.11399785429239273,
0.4659654498100281,
-0.32913321256637573,
-0.41426652669906616,
-0.539072573184967,
-0.7206785082817078,
0.5303853750228882,
-0.3853505253791809,
0.9112206697463989,
-0.25465601682662964,
1.7885842323303223,
-0.5799092054367065,
0.3662024736404419,
0.6565287113189697,
1.3573158979415894,
0.13576284050941467,
0.06917843222618103,
0.3758862018585205,
0.32205843925476074,
0.004600599408149719,
0.5954729318618774,
1.256142020225525,
0.6453375220298767,
0.4693089723587036,
0.7222145795822144,
-2.2817955017089844,
1.290528416633606,
-0.9634720087051392,
0.2796340584754944,
1.2764379978179932,
-0.9261717200279236,
0.39148402214050293,
-1.7843878269195557,
-0.010072393342852592,
0.5855007171630859,
-2.291059732437134,
0.262096643447876,
-1.3683518171310425,
-0.4662400484085083,
0.9391397833824158,
0.3244481682777405,
-1.24326491355896,
0.19773073494434357,
-0.5046738386154175,
1.0742826461791992,
0.3918045163154602,
1.0504299402236938,
-1.7608939409255981,
-0.1483611911535263,
-0.26522618532180786,
0.1373264491558075,
-1.3279517889022827,
-1.5866094827651978,
0.5203269124031067,
0.596129298210144,
0.7467299699783325,
-0.10113845765590668,
1.1210581064224243,
-1.074381709098816,
0.7361094951629639,
-1.0114977359771729,
-1.6783748865127563,
-1.3923131227493286,
-2.2130274772644043,
-2.2493090629577637,
0.7771425843238831,
-0.4131709933280945,
-0.5222154855728149,
1.9867620468139648,
-1.0233170986175537,
-1.8766921758651733,
1.034017562866211,
0.35094547271728516,
-0.06425414234399796,
2.4521067142486572,
0.2491135448217392,
-0.7751940488815308,
0.47589248418807983,
-0.7146945595741272,
0.7796262502670288,
-0.30926525592803955,
1.3471120595932007,
0.5156304836273193,
-0.984633207321167,
1.6328788995742798,
-0.27194613218307495,
0.6075278520584106,
-0.7216997742652893,
-0.5495867729187012,
-0.854668915271759,
0.23553317785263062,
1.9302746057510376,
-0.386033296585083,
1.441439151763916,
-0.3324078321456909,
-1.633109450340271,
-1.6167703866958618,
0.8800962567329407,
0.46116918325424194,
-0.8347633481025696,
0.11316312104463577,
-0.5349174737930298,
0.16452209651470184,
-0.029362283647060394,
1.1033010482788086,
1.2445855140686035,
0.7182826995849609,
-0.3526369333267212,
-0.7901038527488708,
0.21903087198734283,
-0.014405356720089912,
-0.6228945851325989,
-1.8243706226348877,
-0.3123897910118103,
0.15131887793540955,
0.6817343831062317,
-1.2204140424728394,
1.6351386308670044,
0.8866649270057678,
1.8945764303207397,
1.1166926622390747,
-0.3430193066596985,
1.576606273651123,
0.013503031805157661,
1.839478850364685,
-0.5636716485023499,
0.5996624827384949,
-0.37331342697143555,
-1.1361827850341797,
0.8256665468215942,
-0.34180885553359985,
-2.0424275398254395,
-0.8067328333854675,
-0.6878902912139893,
-0.1817571371793747,
-0.8275256752967834,
0.8585969805717468,
-0.38578885793685913,
-1.5409016609191895,
0.15437662601470947,
-0.6864379048347473,
0.21060442924499512,
-1.198797345161438,
0.29638195037841797,
0.7422763705253601,
-0.5811681151390076,
0.05807740241289139,
-0.24491947889328003,
-1.245374083518982,
-0.37471073865890503,
0.28905171155929565,
1.9224164485931396,
-0.6960240006446838,
0.8657371401786804,
1.0502042770385742,
-0.7535718083381653,
0.16482585668563843,
0.2663242816925049,
-0.21987870335578918,
0.8011118769645691,
-1.1106466054916382,
-0.3437232971191406,
1.1269595623016357,
-0.14982794225215912,
-0.6605930924415588,
1.3823785781860352,
0.82436603307724,
-1.0322506427764893,
-0.24054166674613953,
-0.1360463798046112,
-0.8454115986824036,
0.0021812496706843376,
-1.624800443649292,
-0.1919630467891693,
0.4325443506240845,
-1.515824794769287,
-0.4358257055282593,
-0.28122448921203613,
1.3172554969787598,
-0.22702892124652863,
1.4416072368621826,
-0.18356560170650482,
-0.1734500676393509,
-0.2578914165496826,
-0.45609402656555176,
0.1693689078092575,
-0.17277517914772034,
-0.5840059518814087,
0.21530857682228088,
-0.7754104137420654,
0.3470674753189087,
1.5001190900802612,
0.3705787658691406,
0.01603003963828087,
0.46279191970825195,
1.1410423517227173,
0.3706623315811157,
-0.10585002601146698,
-0.8744868040084839,
-1.583296537399292,
2.01141357421875,
-1.5158981084823608,
1.911932349205017,
0.6718564629554749,
-0.08465629070997238,
-1.7069804668426514,
-1.9685335159301758,
1.3631654977798462,
1.1692360639572144,
2.394118547439575,
0.5610681176185608,
0.44228649139404297,
-0.7890223264694214,
-0.789429247379303,
0.3119494915008545,
-1.0474929809570312,
-0.7352082133293152,
0.1738949865102768,
2.4160807132720947,
1.753209114074707,
-0.5053495168685913,
-0.26617223024368286,
-0.9597115516662598,
1.2923489809036255,
-0.17647124826908112,
0.23745998740196228,
2.0232741832733154,
-0.226030632853508,
-1.050156831741333,
1.3571950197219849,
-2.380516290664673,
0.1637093722820282,
1.974623203277588,
0.2863764762878418,
0.12817905843257904,
-1.4428400993347168,
-0.6730723977088928,
-0.2661222815513611,
-0.4685351848602295,
-1.3387620449066162,
0.5298255085945129,
-0.329298734664917,
-0.8731499314308167,
-1.57109534740448,
0.11347679048776627,
-1.116104006767273,
-1.5810717344284058,
0.2450992316007614,
1.944659948348999,
2.031590700149536,
-0.7828369140625,
1.529371976852417,
-0.27591443061828613,
0.1308877170085907,
1.1916375160217285,
1.3118607997894287,
3.095305919647217,
1.8192204236984253,
-1.3117603063583374,
0.7131660580635071,
-0.1794043928384781,
-0.46793538331985474,
1.142221450805664,
-1.28650963306427,
1.1503218412399292,
-0.2575305104255676,
-1.2130743265151978,
-1.2338359355926514,
0.9362327456474304,
0.4340246319770813,
0.005930674262344837,
-0.4474286437034607,
1.2194125652313232,
0.1178177148103714,
1.3458302021026611,
0.5880048871040344,
-0.3202013373374939,
0.6475235819816589,
-0.4241626262664795,
-0.49886399507522583,
1.587591528892517,
0.17654359340667725,
-1.3860191106796265,
-2.286567211151123,
-0.21341373026371002,
-0.8167130351066589,
0.1050301194190979,
-0.5144001245498657,
-1.0342267751693726,
1.680000901222229,
0.3320271968841553,
-1.2210721969604492,
-0.1923583447933197,
-0.21548841893672943,
-0.516997218132019,
2.6798183917999268,
-1.2815607786178589,
-0.22882021963596344,
-1.0180820226669312,
-0.5873204469680786,
1.624506950378418,
-1.105515956878662,
-0.1673162430524826,
-0.9488202929496765,
-0.6203324794769287,
-1.3237130641937256,
-0.49946463108062744,
-0.01814301684498787,
-0.921211302280426,
0.8224250674247742,
0.2170572429895401,
-1.1502134799957275,
-0.2636529803276062,
-0.9050029516220093,
0.9668405055999756,
-0.14550447463989258,
0.23613955080509186,
1.8431317806243896,
0.3815147876739502,
-0.4172405004501343,
0.8404311537742615,
1.118392825126648,
0.6091738939285278,
-0.68569415807724,
0.1504838764667511,
-0.677828848361969,
0.2516683340072632,
-1.3269057273864746,
0.3396396040916443,
-2.858142137527466,
0.6455976366996765,
-0.07234778255224228,
-0.09895417839288712,
-0.028006529435515404,
-1.3493014574050903,
1.094285249710083,
2.573700428009033,
-1.2123806476593018,
0.5196624398231506,
0.36858904361724854,
1.291414737701416,
-1.582128643989563,
0.17327138781547546,
-0.46646517515182495,
2.1232237815856934,
0.2448846846818924,
1.2590640783309937,
-0.462291419506073,
-2.28796124458313,
0.6177861094474792,
-1.302370548248291,
-1.1637457609176636,
0.7540551424026489,
-0.9526368379592896,
0.14822761714458466,
-1.434694528579712,
-0.22797851264476776,
-0.9323337078094482,
-1.1687601804733276,
0.7314666509628296,
0.1685875505208969,
0.39234256744384766,
-0.5292944312095642,
0.3847472667694092,
-2.0614874362945557,
-1.3081194162368774,
-0.15509825944900513,
-1.0052098035812378,
0.5132980942726135,
-0.3960908055305481,
0.6419681310653687,
-0.09963615983724594,
-0.028198260813951492,
0.3562513589859009,
1.4045236110687256,
3.276373863220215,
0.14282859861850739,
0.24283446371555328,
-0.18167972564697266,
-0.9467253088951111,
1.4236583709716797,
0.9367920160293579,
-0.16063624620437622,
-0.6513515114784241,
-1.1177691221237183,
1.3016483783721924,
1.9542940855026245,
1.0716495513916016,
-0.001879807561635971,
-0.8252403736114502,
-0.786450982093811,
0.02082923799753189,
0.249359592795372,
0.4972080588340759,
0.8860867023468018,
0.015952259302139282,
0.08309318870306015,
1.3762683868408203,
1.1285665035247803,
-0.4611671566963196,
0.3731974959373474,
-0.9374638795852661,
-0.43674999475479126,
0.3727567791938782,
0.1383441984653473,
-0.025009382516145706,
0.36242568492889404,
-1.0805692672729492,
-0.2685359716415405,
-0.35339176654815674,
-0.8908681869506836,
-0.7804882526397705,
-0.34552305936813354,
-0.3681260347366333,
1.654358148574829,
0.09045206755399704,
-0.5487776398658752,
-0.08078262954950333,
-0.717379093170166,
-0.2001185268163681,
-1.0424195528030396,
0.2324226051568985,
-0.17072446644306183,
-0.1373406946659088,
-0.05879399552941322,
1.7339714765548706,
-0.9535843133926392,
-2.131490468978882,
0.19972631335258484,
0.2862944006919861,
-0.282936692237854,
0.250999391078949,
1.7102197408676147,
0.5564435124397278,
1.4439020156860352,
1.337471604347229,
1.0085186958312988,
-0.6290138959884644,
-1.2289186716079712,
0.675434410572052,
0.9526256918907166,
-1.3861356973648071,
0.8377759456634521,
-0.11156684905290604,
-0.5210765600204468,
0.563154399394989,
1.279259443283081,
0.45958131551742554,
-1.9832366704940796,
0.8190133571624756,
-0.9895297884941101,
0.6951733231544495,
0.723347008228302,
0.7153723835945129,
0.30417776107788086,
0.9065314531326294,
-1.2140603065490723,
-1.1141149997711182,
-0.7253791689872742,
-0.6222630739212036,
2.012112617492676,
-0.24321743845939636,
0.5696885585784912,
-0.021186910569667816,
-1.2521896362304688,
-0.126706063747406,
0.7698648571968079,
0.31727147102355957,
-0.4805382490158081,
0.8516771197319031,
-0.6531844139099121,
-1.0354666709899902,
-1.283923864364624,
-0.5185996294021606,
-1.059989333152771,
-0.9372046589851379,
1.007367730140686,
0.8169643878936768,
0.329572856426239,
1.8757997751235962,
0.617467999458313,
0.3116822838783264,
-2.5979888439178467,
0.8905530571937561,
0.3221951127052307,
-0.05301181226968765,
0.9617822170257568,
0.30794864892959595,
1.05350923538208,
0.04430658370256424,
0.5909149050712585,
-2.340684413909912,
2.2284114360809326,
-0.18662860989570618,
0.7605342864990234,
0.022104807198047638,
-0.16344207525253296,
1.0914589166641235,
0.47220557928085327,
0.5663817524909973,
-1.0894986391067505,
0.6969767212867737,
-0.5667757391929626,
1.196061134338379,
0.9204309582710266,
-0.8786006569862366,
0.07009859383106232,
1.2294899225234985,
0.37488096952438354,
-0.507768452167511,
-0.9175758361816406,
-0.9300605058670044,
0.9019497036933899,
1.7300267219543457,
-0.06700621545314789,
0.02626745030283928,
0.8628078103065491,
0.6668070554733276,
-1.2645907402038574,
0.07790457457304001,
-0.5951477289199829,
-0.6873525977134705,
1.7309839725494385,
2.079277276992798,
-0.21508489549160004,
-0.15575401484966278,
-0.6848592162132263,
-1.2185126543045044,
0.7953234314918518,
0.020304225385189056,
0.14743958413600922,
0.7086066007614136,
-0.788303792476654,
1.1108629703521729,
0.7861897349357605,
0.9666203856468201,
0.06898558884859085,
0.3824523687362671,
0.4832109808921814,
-0.3408415913581848,
-1.1608502864837646,
-0.32555675506591797,
-1.0984811782836914,
-2.6203794479370117,
0.4525485038757324,
-0.21126578748226166,
-1.3203330039978027,
0.10931460559368134,
-1.0199908018112183,
0.9543125033378601,
-0.6536880731582642,
-1.0981462001800537,
-1.4688496589660645,
0.28848737478256226,
-0.13045182824134827,
0.8747178316116333,
-1.6620527505874634,
-0.08724184334278107,
1.2068127393722534,
0.9874030351638794,
-0.5775067210197449,
0.9669394493103027,
0.30610543489456177,
0.9670084118843079,
0.8535474538803101,
-0.3422091603279114,
0.6033098697662354,
0.05308014899492264,
-1.3597948551177979,
0.48713386058807373,
1.264913558959961,
0.1912887543439865,
1.5135341882705688,
-0.5180421471595764,
-0.0706205815076828,
0.4424701929092407,
-0.6171424388885498,
-0.4745224714279175,
-0.4833473563194275,
0.6562759876251221,
0.1478402465581894,
-0.9677130579948425,
-0.07817231863737106,
-0.01087317056953907,
-0.1661221981048584,
0.14010562002658844,
-1.5321383476257324,
-0.211482971906662,
-0.45613735914230347,
-0.6011461615562439,
-1.2696181535720825,
-0.05640990287065506,
1.3102226257324219,
-0.8021039366722107,
-0.26717859506607056,
0.43842101097106934,
0.40245407819747925,
0.5058711767196655,
0.5526787042617798,
-0.7340996861457825,
-0.34706026315689087,
-0.23657631874084473,
-0.4120347499847412,
0.3655877113342285,
1.3100520372390747,
-0.08783791214227676,
-0.9870645999908447,
0.6879020929336548,
-0.4384382963180542,
0.02862486243247986,
1.8686003684997559,
-0.029266856610774994,
-0.7425497174263,
0.2376396805047989,
-0.7237142324447632,
1.9094526767730713,
1.6610711812973022,
1.3489625453948975,
-0.2180393636226654,
-0.865032970905304,
0.6731268167495728,
-0.2980089783668518,
-0.41239142417907715,
0.9483662247657776,
0.46402961015701294,
-0.2368045300245285,
-1.4636595249176025,
0.695059597492218,
1.3059098720550537,
-0.9433816075325012,
-0.7115189433097839,
0.11954700946807861,
-0.7875911593437195,
1.1123939752578735,
0.6233286261558533,
0.2429061383008957,
0.20204173028469086,
1.6040289402008057,
0.6923580169677734,
-0.4383426904678345,
0.4852564334869385,
0.458914577960968,
-0.1483786255121231,
-2.198385238647461,
-1.0912326574325562,
0.30879122018814087,
-0.42117422819137573,
-1.5852833986282349,
1.3707245588302612,
-1.1152406930923462,
-0.9100432395935059,
0.539749026298523,
0.1039472222328186,
1.4051731824874878,
0.3994266986846924,
1.6164976358413696,
2.1386120319366455,
0.8657199740409851,
0.3033313751220703,
1.241637945175171,
-0.17639927566051483,
-0.4746462106704712,
1.7872198820114136,
-0.42462295293807983,
0.5276924967765808,
1.0059845447540283,
-0.3161294460296631,
-1.101726770401001,
-0.7475216388702393,
-1.2805761098861694,
-0.6750807166099548,
1.2021061182022095,
0.10097186267375946,
-1.1141457557678223,
0.25596898794174194,
1.5616390705108643,
0.0996297150850296,
-0.2593492269515991,
0.7156859636306763,
0.5018899440765381,
-0.7709414958953857,
-0.12206295877695084,
-0.8710205554962158,
0.5270088911056519,
-0.2708337903022766,
-0.3339605927467346,
0.20222356915473938,
0.47373300790786743,
1.3217856884002686,
0.05979964882135391,
0.08657564967870712,
1.1823307275772095,
-1.3946844339370728,
1.5453360080718994,
-0.7144671082496643,
0.331703245639801,
-2.4752414226531982,
1.4187746047973633,
-0.8462262749671936,
1.9565198421478271,
-2.580566883087158,
0.520053505897522,
-0.5808228254318237,
-0.40957939624786377,
0.27068787813186646,
-0.3065817356109619,
0.11724098026752472,
-0.16414259374141693,
-1.0613523721694946,
-0.09075687825679779,
-0.7154860496520996,
0.6260462403297424,
1.1138277053833008,
1.2803864479064941,
-1.0558212995529175,
-0.18909551203250885,
-1.8063507080078125,
-0.18884392082691193,
-0.7103146910667419,
0.2608775496482849,
-2.0311930179595947,
-0.23620568215847015,
-1.9497758150100708,
-2.344278573989868,
-1.2793655395507812,
-0.7977010011672974,
1.1269383430480957,
0.18694938719272614,
-0.9253695607185364,
1.275766372680664,
-0.33533984422683716,
-1.8035597801208496,
1.0843546390533447,
-2.192633628845215
] |
https://github.com/huggingface/datasets/issues/5086 | HTTPError: 404 Client Error: Not Found for url | Hi @km5ar, thanks for reporting.
This should be fixed in the notebook:
- the filename `datasets-issues-with-hf-doc-builder.jsonl` no longer exists on the repo; instead, current filename is `datasets-issues-with-comments.jsonl`
- see: https://huggingface.co/datasets/lewtun/github-issues/tree/main
Anyway, depending on your version of `datasets`, you can now use:
```python
from datasets import load_dataset
issues_dataset = load_dataset("lewtun/github-issues")
issues_dataset
```
instead of:
```python
from huggingface_hub import hf_hub_url
data_files = hf_hub_url(
repo_id="lewtun/github-issues",
filename="datasets-issues-with-hf-doc-builder.jsonl",
repo_type="dataset",
)
from datasets import load_dataset
issues_dataset = load_dataset("json", data_files=data_files, split="train")
issues_dataset
```
Output:
```python
In [25]: ds = load_dataset("lewtun/github-issues")
Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10.5k/10.5k [00:00<00:00, 5.75MB/s]
Using custom data configuration lewtun--github-issues-cff5093ecc410ea2
Downloading and preparing dataset json/lewtun--github-issues to .../.cache/huggingface/datasets/lewtun___json/lewtun--github-issues-cff5093ecc410ea2/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab...
Downloading data: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 12.2M/12.2M [00:00<00:00, 26.5MB/s]
Downloading data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:02<00:00, 2.70s/it]
Extracting data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1589.96it/s]
Dataset json downloaded and prepared to .../.cache/huggingface/datasets/lewtun___json/lewtun--github-issues-cff5093ecc410ea2/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab. Subsequent calls will reuse this data.
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 133.95it/s]
In [26]: ds
Out[26]:
DatasetDict({
train: Dataset({
features: ['url', 'repository_url', 'labels_url', 'comments_url', 'events_url', 'html_url', 'id', 'node_id', 'number', 'title', 'user', 'labels', 'state', 'locked', 'assignee', 'assignees', 'milestone', 'comments', 'created_at', 'updated_at', 'closed_at', 'author_association', 'active_lock_reason', 'pull_request', 'body', 'timeline_url', 'performed_via_github_app', 'is_pull_request'],
num_rows: 3019
})
})
``` | ## Describe the bug
I was following chap 5 from huggingface course: https://huggingface.co/course/chapter5/6?fw=tf
However, I'm not able to download the datasets, with a 404 erros
<img width="1160" alt="iShot2022-10-06_15 54 50" src="https://user-images.githubusercontent.com/54015474/194406327-ae62c2f3-1da5-4686-8631-13d879a0edee.png">
## Steps to reproduce the bug
```python
from huggingface_hub import hf_hub_url
data_files = hf_hub_url(
repo_id="lewtun/github-issues",
filename="datasets-issues-with-hf-doc-builder.jsonl",
repo_type="dataset",
)
from datasets import load_dataset
issues_dataset = load_dataset("json", data_files=data_files, split="train")
issues_dataset
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.12
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
| 489 | 178 | HTTPError: 404 Client Error: Not Found for url
## Describe the bug
I was following chap 5 from huggingface course: https://huggingface.co/course/chapter5/6?fw=tf
However, I'm not able to download the datasets, with a 404 erros
<img width="1160" alt="iShot2022-10-06_15 54 50" src="https://user-images.githubusercontent.com/54015474/194406327-ae62c2f3-1da5-4686-8631-13d879a0edee.png">
## Steps to reproduce the bug
```python
from huggingface_hub import hf_hub_url
data_files = hf_hub_url(
repo_id="lewtun/github-issues",
filename="datasets-issues-with-hf-doc-builder.jsonl",
repo_type="dataset",
)
from datasets import load_dataset
issues_dataset = load_dataset("json", data_files=data_files, split="train")
issues_dataset
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.12
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
Hi @km5ar, thanks for reporting.
This should be fixed in the notebook:
- the filename `datasets-issues-with-hf-doc-builder.jsonl` no longer exists on the repo; instead, current filename is `datasets-issues-with-comments.jsonl`
- see: https://huggingface.co/datasets/lewtun/github-issues/tree/main
Anyway, depending on your version of `datasets`, you can now use:
```python
from datasets import load_dataset
issues_dataset = load_dataset("lewtun/github-issues")
issues_dataset
```
instead of:
```python
from huggingface_hub import hf_hub_url
data_files = hf_hub_url(
repo_id="lewtun/github-issues",
filename="datasets-issues-with-hf-doc-builder.jsonl",
repo_type="dataset",
)
from datasets import load_dataset
issues_dataset = load_dataset("json", data_files=data_files, split="train")
issues_dataset
```
Output:
```python
In [25]: ds = load_dataset("lewtun/github-issues")
Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10.5k/10.5k [00:00<00:00, 5.75MB/s]
Using custom data configuration lewtun--github-issues-cff5093ecc410ea2
Downloading and preparing dataset json/lewtun--github-issues to .../.cache/huggingface/datasets/lewtun___json/lewtun--github-issues-cff5093ecc410ea2/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab...
Downloading data: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 12.2M/12.2M [00:00<00:00, 26.5MB/s]
Downloading data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:02<00:00, 2.70s/it]
Extracting data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1589.96it/s]
Dataset json downloaded and prepared to .../.cache/huggingface/datasets/lewtun___json/lewtun--github-issues-cff5093ecc410ea2/0.0.0/e6070c77f18f01a5ad4551a8b7edfba20b8438b7cad4d94e6ad9378022ce4aab. Subsequent calls will reuse this data.
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 133.95it/s]
In [26]: ds
Out[26]:
DatasetDict({
train: Dataset({
features: ['url', 'repository_url', 'labels_url', 'comments_url', 'events_url', 'html_url', 'id', 'node_id', 'number', 'title', 'user', 'labels', 'state', 'locked', 'assignee', 'assignees', 'milestone', 'comments', 'created_at', 'updated_at', 'closed_at', 'author_association', 'active_lock_reason', 'pull_request', 'body', 'timeline_url', 'performed_via_github_app', 'is_pull_request'],
num_rows: 3019
})
})
``` | [
-1.1769479513168335,
-0.8597759008407593,
-0.6654363870620728,
1.4302005767822266,
-0.11063279956579208,
-1.2424914836883545,
0.17708800733089447,
-1.0378179550170898,
1.6529996395111084,
-0.7495920062065125,
0.3183356523513794,
-1.652048110961914,
0.013562760315835476,
-0.5370358228683472,
-0.7149695158004761,
-0.8322802186012268,
-0.36438727378845215,
-0.7288192510604858,
1.066104769706726,
2.4667410850524902,
1.2711966037750244,
-1.3101437091827393,
2.730109214782715,
0.716189980506897,
-0.23496247828006744,
-0.9313256144523621,
0.4832649827003479,
0.037922203540802,
-1.3570060729980469,
-0.35466131567955017,
-0.9466590881347656,
-0.1159614622592926,
-0.5770796537399292,
-0.5197840929031372,
0.02476494386792183,
0.44355323910713196,
-0.28491947054862976,
-0.39581868052482605,
-0.5343714952468872,
-0.7326856851577759,
0.5058636665344238,
-0.32211124897003174,
0.9145700335502625,
-0.3514608144760132,
1.8263769149780273,
-0.5937510132789612,
0.5259908437728882,
0.7312933206558228,
1.1833053827285767,
0.25584474205970764,
-0.019255133345723152,
0.30069589614868164,
0.3274073004722595,
-0.04506531357765198,
0.5041765570640564,
1.221940517425537,
0.6417719125747681,
0.516913890838623,
0.7365471124649048,
-2.1820592880249023,
1.317162275314331,
-0.9144155979156494,
0.2471090853214264,
1.4340640306472778,
-0.9538095593452454,
0.3969486951828003,
-1.8371385335922241,
-0.0447196364402771,
0.4917212724685669,
-2.2767817974090576,
0.2752155363559723,
-1.316088318824768,
-0.5565806031227112,
1.0262401103973389,
0.3391869366168976,
-1.222042441368103,
0.037841808050870895,
-0.4549913704395294,
0.9929624795913696,
0.4229961633682251,
1.1329808235168457,
-1.6954171657562256,
-0.04499482363462448,
-0.27221664786338806,
0.20112480223178864,
-1.2524967193603516,
-1.5609790086746216,
0.5581552982330322,
0.6116710901260376,
0.6796668767929077,
-0.1169658675789833,
0.987845778465271,
-1.0699557065963745,
0.806334376335144,
-0.9603722095489502,
-1.716360330581665,
-1.3748198747634888,
-2.3501579761505127,
-2.308070421218872,
0.7105762362480164,
-0.4744620621204376,
-0.4626172184944153,
2.0941293239593506,
-1.0894815921783447,
-1.6966552734375,
1.054060697555542,
0.31096282601356506,
0.0034233350306749344,
2.4307894706726074,
0.30103787779808044,
-0.8301334381103516,
0.5838570594787598,
-0.7809854745864868,
0.6920996308326721,
-0.32386261224746704,
1.326442837715149,
0.4252271056175232,
-1.1375185251235962,
1.5573805570602417,
-0.40774717926979065,
0.6091223955154419,
-0.7163029313087463,
-0.4915149509906769,
-0.6976562142372131,
0.18843351304531097,
1.8681015968322754,
-0.22759415209293365,
1.5085794925689697,
-0.25968480110168457,
-1.5445181131362915,
-1.5345361232757568,
0.7960166931152344,
0.5040091872215271,
-0.7987532615661621,
0.12720857560634613,
-0.3712131679058075,
0.04404427856206894,
-0.0023163682781159878,
1.0531455278396606,
1.2308310270309448,
0.7927497625350952,
-0.2704515755176544,
-0.8111715912818909,
0.12613768875598907,
-0.06444508582353592,
-0.7485737800598145,
-1.719511866569519,
-0.2649907171726227,
0.09973013401031494,
0.5857547521591187,
-1.266597032546997,
1.8355978727340698,
0.9123144745826721,
1.9657387733459473,
0.9947175979614258,
-0.38765764236450195,
1.4811831712722778,
0.08252814412117004,
1.8538895845413208,
-0.44998177886009216,
0.6756576299667358,
-0.3562408983707428,
-1.2099372148513794,
0.7606921195983887,
-0.32803019881248474,
-2.052706480026245,
-0.6197072267532349,
-0.7883933186531067,
-0.19203440845012665,
-0.8044040203094482,
0.9252585768699646,
-0.2560882568359375,
-1.410616159439087,
0.21420243382453918,
-0.6323782205581665,
0.15138356387615204,
-1.3238410949707031,
0.31741151213645935,
0.7726492285728455,
-0.6828930377960205,
0.03308652713894844,
-0.24278201162815094,
-1.2699530124664307,
-0.5817851424217224,
0.3866591155529022,
1.8234264850616455,
-0.6850724220275879,
0.9748963117599487,
1.0735337734222412,
-0.6990044713020325,
-0.017009316012263298,
0.36364516615867615,
-0.35999253392219543,
0.8659391403198242,
-1.0478602647781372,
-0.4188544452190399,
1.1553876399993896,
-0.2640976905822754,
-0.5818997621536255,
1.4281954765319824,
0.6840680241584778,
-1.0116846561431885,
-0.2667984962463379,
-0.14492887258529663,
-0.828636109828949,
0.037161894142627716,
-1.5474610328674316,
-0.07493951916694641,
0.3191741108894348,
-1.506112813949585,
-0.4705421030521393,
-0.16825035214424133,
1.3626842498779297,
-0.18436288833618164,
1.3510894775390625,
-0.24844105541706085,
-0.1739734560251236,
-0.4247880280017853,
-0.445600688457489,
0.14563784003257751,
-0.24880389869213104,
-0.5864561796188354,
0.22337016463279724,
-0.7577568888664246,
0.24500200152397156,
1.4471447467803955,
0.3056655824184418,
0.029452063143253326,
0.47201064229011536,
1.149928331375122,
0.4224434494972229,
-0.15423457324504852,
-0.88803631067276,
-1.560093641281128,
1.9684697389602661,
-1.5143378973007202,
2.0176355838775635,
0.8274911642074585,
-0.08308646827936172,
-1.8340349197387695,
-1.9181827306747437,
1.3955904245376587,
1.1364617347717285,
2.4642446041107178,
0.5632087588310242,
0.4100581407546997,
-0.8149814009666443,
-0.7440166473388672,
0.38041064143180847,
-0.8933283686637878,
-0.7662090063095093,
0.1640375852584839,
2.349658727645874,
1.712360143661499,
-0.45529207587242126,
-0.20471729338169098,
-1.0004734992980957,
1.3467183113098145,
-0.17581480741500854,
0.1977228820323944,
2.003247022628784,
-0.30489251017570496,
-1.064159631729126,
1.3363865613937378,
-2.3422772884368896,
0.2719267010688782,
1.9823521375656128,
0.2902502119541168,
0.124640554189682,
-1.3221666812896729,
-0.699149489402771,
-0.24382169544696808,
-0.5230324268341064,
-1.219173789024353,
0.4675371050834656,
-0.2253165990114212,
-0.8070496320724487,
-1.4390369653701782,
0.07212529331445694,
-1.1434191465377808,
-1.6960325241088867,
0.2928633689880371,
1.8879767656326294,
2.0542116165161133,
-0.8096775412559509,
1.460666298866272,
-0.3102596402168274,
0.13587890565395355,
1.2013471126556396,
1.2947331666946411,
3.165328025817871,
1.8546645641326904,
-1.2992967367172241,
0.6710692048072815,
-0.0932418555021286,
-0.4583466947078705,
1.1794624328613281,
-1.0876864194869995,
1.2399321794509888,
-0.1969904899597168,
-1.2579609155654907,
-1.2511557340621948,
0.8837138414382935,
0.4801046550273895,
0.04940936714410782,
-0.5528287291526794,
1.1345107555389404,
0.16799919307231903,
1.3539282083511353,
0.5620846152305603,
-0.307121604681015,
0.5989153385162354,
-0.3679153621196747,
-0.5033922791481018,
1.537102222442627,
0.15543195605278015,
-1.4405139684677124,
-2.347203493118286,
-0.22999097406864166,
-0.9251952767372131,
0.027355551719665527,
-0.7235825061798096,
-1.0382167100906372,
1.6453826427459717,
0.4449487030506134,
-1.1446253061294556,
-0.21888451278209686,
-0.2980245053768158,
-0.5317708849906921,
2.699376344680786,
-1.3296207189559937,
-0.12989747524261475,
-0.9872192144393921,
-0.6434279680252075,
1.6180872917175293,
-1.1778069734573364,
-0.24004487693309784,
-1.0842666625976562,
-0.579400897026062,
-1.3144892454147339,
-0.49826207756996155,
0.0029494743794202805,
-0.8971127271652222,
0.8392760157585144,
0.1465335190296173,
-1.2596627473831177,
-0.29482677578926086,
-0.9883196353912354,
0.9097875356674194,
-0.1489199995994568,
0.10090253502130508,
1.7922338247299194,
0.3427775204181671,
-0.4184112548828125,
0.7188489437103271,
1.1752747297286987,
0.6703884601593018,
-0.6302496790885925,
0.25103074312210083,
-0.7070635557174683,
0.3902255892753601,
-1.3038643598556519,
0.2602540850639343,
-2.9149117469787598,
0.62816321849823,
-0.061455823481082916,
-0.08438418805599213,
-0.051736004650592804,
-1.35288405418396,
1.0777815580368042,
2.492859363555908,
-1.1299718618392944,
0.5491507649421692,
0.36672401428222656,
1.2001769542694092,
-1.6417560577392578,
0.18593166768550873,
-0.5388658046722412,
2.074284791946411,
0.12013290822505951,
1.189322829246521,
-0.49126487970352173,
-2.3277974128723145,
0.5621328353881836,
-1.2698181867599487,
-1.0762945413589478,
0.834294855594635,
-0.8636077642440796,
0.20972320437431335,
-1.298378586769104,
-0.17895002663135529,
-0.91909259557724,
-1.237627387046814,
0.6585046648979187,
0.12259596586227417,
0.5261187553405762,
-0.6061373949050903,
0.3203333914279938,
-2.2387022972106934,
-1.393352746963501,
-0.21161305904388428,
-0.9406120181083679,
0.45219841599464417,
-0.31523948907852173,
0.7188888788223267,
-0.16321076452732086,
0.01134916115552187,
0.3737838864326477,
1.4847007989883423,
3.2634036540985107,
0.10549923032522202,
0.29523614048957825,
-0.20294305682182312,
-1.0331120491027832,
1.5067346096038818,
0.9267509579658508,
-0.14507701992988586,
-0.6269601583480835,
-1.0381187200546265,
1.191111445426941,
1.9351400136947632,
1.0786608457565308,
0.021886304020881653,
-0.8911481499671936,
-0.7483289837837219,
0.07807064801454544,
0.19137592613697052,
0.47810497879981995,
0.9806809425354004,
0.09069003909826279,
0.09219086170196533,
1.4445818662643433,
1.0829858779907227,
-0.33758750557899475,
0.4055723249912262,
-0.8163827061653137,
-0.48269569873809814,
0.48599115014076233,
0.3129095137119293,
0.029853790998458862,
0.35804685950279236,
-1.1018503904342651,
-0.2720552384853363,
-0.3595902621746063,
-0.9157109260559082,
-0.7028815746307373,
-0.44719403982162476,
-0.3967039883136749,
1.655075192451477,
-0.009007168933749199,
-0.47922322154045105,
0.03316814452409744,
-0.7680420875549316,
-0.1366538256406784,
-1.0554009675979614,
0.3495352566242218,
-0.15077440440654755,
0.001925450749695301,
-0.10038996487855911,
1.6929999589920044,
-0.9425005316734314,
-2.1090810298919678,
0.19985143840312958,
0.27028462290763855,
-0.34484148025512695,
0.13982371985912323,
1.6933614015579224,
0.5205515027046204,
1.4267672300338745,
1.3941320180892944,
0.9907189607620239,
-0.6909684538841248,
-1.2967402935028076,
0.7286415100097656,
0.9804475903511047,
-1.3910801410675049,
0.8792482018470764,
-0.09737521409988403,
-0.5848388075828552,
0.5978047847747803,
1.3525993824005127,
0.4602683186531067,
-1.9139180183410645,
0.8324524164199829,
-1.0065288543701172,
0.8315030932426453,
0.7273294925689697,
0.7670323252677917,
0.1447390615940094,
0.8405101895332336,
-1.2292917966842651,
-1.0553308725357056,
-0.6160745024681091,
-0.6196986436843872,
1.8847547769546509,
-0.326625794172287,
0.5503735542297363,
-0.2459104210138321,
-1.285758137702942,
0.04748285189270973,
0.6949830055236816,
0.35455837845802307,
-0.41280293464660645,
0.8155794143676758,
-0.646695613861084,
-1.0697824954986572,
-1.28871488571167,
-0.3997296094894409,
-1.0635629892349243,
-0.8535605072975159,
1.0061588287353516,
0.7663607001304626,
0.3867304027080536,
1.8970251083374023,
0.6985950469970703,
0.30023664236068726,
-2.624920606613159,
0.9105361700057983,
0.3007083535194397,
-0.07945269346237183,
0.9073851108551025,
0.2910568416118622,
1.1513725519180298,
-0.06750249117612839,
0.5913053750991821,
-2.4097683429718018,
2.3131492137908936,
-0.2272872030735016,
0.699664294719696,
0.017113097012043,
-0.1637813299894333,
1.0519535541534424,
0.5980106592178345,
0.5325626134872437,
-1.0982681512832642,
0.798565149307251,
-0.5267883539199829,
1.1285526752471924,
0.8386998772621155,
-0.8689775466918945,
0.03742936626076698,
1.244406819343567,
0.4702569842338562,
-0.47756144404411316,
-0.9336947798728943,
-0.8946566581726074,
0.9154887199401855,
1.712011694908142,
-0.01975190080702305,
0.036996740847826004,
0.8707237243652344,
0.7090301513671875,
-1.3307591676712036,
0.08606727421283722,
-0.6396702527999878,
-0.716643750667572,
1.7359144687652588,
2.0455920696258545,
-0.04459146782755852,
-0.19695758819580078,
-0.7225934863090515,
-1.3099771738052368,
0.824784517288208,
0.0351092554628849,
0.1004919484257698,
0.6068939566612244,
-0.679986834526062,
1.0808912515640259,
0.8395056128501892,
0.9658429622650146,
0.20623065531253815,
0.20110644400119781,
0.3355667293071747,
-0.37616074085235596,
-1.2286666631698608,
-0.22102314233779907,
-1.0136874914169312,
-2.580442428588867,
0.4808339774608612,
-0.19651366770267487,
-1.4217256307601929,
0.10331695526838303,
-1.003531813621521,
0.8545389771461487,
-0.5870736837387085,
-1.119417667388916,
-1.4649499654769897,
0.19185778498649597,
-0.17085933685302734,
0.8333303332328796,
-1.560115933418274,
-0.17043368518352509,
1.2262318134307861,
0.9503287672996521,
-0.6815772652626038,
0.9316589832305908,
0.2154790461063385,
0.9949533939361572,
0.8881786465644836,
-0.4193141460418701,
0.535723865032196,
0.17191052436828613,
-1.4213706254959106,
0.3665253818035126,
1.3103160858154297,
0.22671791911125183,
1.5084604024887085,
-0.490896999835968,
0.0009775292128324509,
0.4445841610431671,
-0.4484638273715973,
-0.5332552790641785,
-0.630634069442749,
0.6274956464767456,
-0.018812835216522217,
-1.0020328760147095,
-0.05823138728737831,
-0.03629251942038536,
-0.19264262914657593,
0.21530582010746002,
-1.5361146926879883,
-0.17739437520503998,
-0.4315911829471588,
-0.5822901129722595,
-1.2731478214263916,
-0.05379994958639145,
1.2873151302337646,
-0.7677276134490967,
-0.1692485362291336,
0.5191802382469177,
0.2610384225845337,
0.5262105464935303,
0.6339825987815857,
-0.7455207109451294,
-0.26817378401756287,
-0.2402513027191162,
-0.45928093791007996,
0.3256493806838989,
1.327897310256958,
-0.11761624366044998,
-0.9483679533004761,
0.5744154453277588,
-0.29891031980514526,
0.1259099543094635,
1.9955425262451172,
-0.010687701404094696,
-0.8139077425003052,
0.3435761034488678,
-0.721410870552063,
1.8815263509750366,
1.6591769456863403,
1.4115347862243652,
-0.17437423765659332,
-0.8931857943534851,
0.6032341122627258,
-0.3718433380126953,
-0.3624124228954315,
0.9784711003303528,
0.41570842266082764,
-0.27789708971977234,
-1.3926080465316772,
0.7377081513404846,
1.2649552822113037,
-0.8969244956970215,
-0.7386626601219177,
0.18492665886878967,
-0.8166199922561646,
1.154528260231018,
0.6930585503578186,
0.3213866353034973,
0.35202187299728394,
1.568009853363037,
0.7874864935874939,
-0.5135648846626282,
0.5022071599960327,
0.4624163508415222,
-0.19598926603794098,
-1.9570980072021484,
-1.122077465057373,
0.40102747082710266,
-0.572320282459259,
-1.5260066986083984,
1.4300910234451294,
-1.2149670124053955,
-1.04962158203125,
0.5575106143951416,
0.09474870562553406,
1.3338220119476318,
0.4122774004936218,
1.7008734941482544,
2.059251546859741,
0.8908933401107788,
0.3867431879043579,
1.1953390836715698,
-0.1510360836982727,
-0.4070791006088257,
1.7970805168151855,
-0.4788109064102173,
0.554370105266571,
1.0903067588806152,
-0.3674592673778534,
-1.1518930196762085,
-0.8449884653091431,
-1.1998435258865356,
-0.7345430254936218,
1.1601358652114868,
0.09872227162122726,
-1.0914133787155151,
0.3198164403438568,
1.572346806526184,
0.05265645310282707,
-0.23915758728981018,
0.7388548254966736,
0.34146836400032043,
-0.7354233264923096,
-0.1059311255812645,
-0.9476915001869202,
0.5557398796081543,
-0.2506294846534729,
-0.4211598038673401,
0.20306181907653809,
0.5757296085357666,
1.3061903715133667,
0.027193661779165268,
0.12901563942432404,
1.2552539110183716,
-1.363433599472046,
1.3886455297470093,
-0.8707481026649475,
0.2744795083999634,
-2.3634912967681885,
1.435999870300293,
-0.8112329840660095,
1.9506713151931763,
-2.6496338844299316,
0.5055845379829407,
-0.46476155519485474,
-0.505528450012207,
0.23003356158733368,
-0.3027344048023224,
0.20622481405735016,
-0.13010559976100922,
-1.059767246246338,
-0.15189751982688904,
-0.809129536151886,
0.5672937035560608,
1.1456637382507324,
1.3627922534942627,
-1.0634156465530396,
-0.3179994821548462,
-1.6582942008972168,
-0.24908119440078735,
-0.6524521112442017,
0.29365620017051697,
-1.8624577522277832,
-0.17607048153877258,
-1.9901878833770752,
-2.4641220569610596,
-1.3106378316879272,
-0.9063674211502075,
1.2096593379974365,
0.17218239605426788,
-0.9528630375862122,
1.2147746086120605,
-0.40612897276878357,
-1.8396875858306885,
1.1294857263565063,
-2.215428113937378
] |
https://github.com/huggingface/datasets/issues/5086 | HTTPError: 404 Client Error: Not Found for url | Thanks for reporting @km5ar and thank you @albertvillanova for the quick solution! I'll post a fix on the source too | ## Describe the bug
I was following chap 5 from huggingface course: https://huggingface.co/course/chapter5/6?fw=tf
However, I'm not able to download the datasets, with a 404 erros
<img width="1160" alt="iShot2022-10-06_15 54 50" src="https://user-images.githubusercontent.com/54015474/194406327-ae62c2f3-1da5-4686-8631-13d879a0edee.png">
## Steps to reproduce the bug
```python
from huggingface_hub import hf_hub_url
data_files = hf_hub_url(
repo_id="lewtun/github-issues",
filename="datasets-issues-with-hf-doc-builder.jsonl",
repo_type="dataset",
)
from datasets import load_dataset
issues_dataset = load_dataset("json", data_files=data_files, split="train")
issues_dataset
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.12
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
| 489 | 20 | HTTPError: 404 Client Error: Not Found for url
## Describe the bug
I was following chap 5 from huggingface course: https://huggingface.co/course/chapter5/6?fw=tf
However, I'm not able to download the datasets, with a 404 erros
<img width="1160" alt="iShot2022-10-06_15 54 50" src="https://user-images.githubusercontent.com/54015474/194406327-ae62c2f3-1da5-4686-8631-13d879a0edee.png">
## Steps to reproduce the bug
```python
from huggingface_hub import hf_hub_url
data_files = hf_hub_url(
repo_id="lewtun/github-issues",
filename="datasets-issues-with-hf-doc-builder.jsonl",
repo_type="dataset",
)
from datasets import load_dataset
issues_dataset = load_dataset("json", data_files=data_files, split="train")
issues_dataset
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-10.16-x86_64-i386-64bit
- Python version: 3.9.12
- PyArrow version: 9.0.0
- Pandas version: 1.4.4
Thanks for reporting @km5ar and thank you @albertvillanova for the quick solution! I'll post a fix on the source too | [
-1.209651231765747,
-0.8835453987121582,
-0.6648665070533752,
1.4863159656524658,
-0.0989912897348404,
-1.2069259881973267,
0.18281129002571106,
-1.051849365234375,
1.6501810550689697,
-0.756775975227356,
0.3404582738876343,
-1.6006808280944824,
0.029591180384159088,
-0.524516224861145,
-0.682874321937561,
-0.8998048305511475,
-0.34990692138671875,
-0.7044265866279602,
1.1159216165542603,
2.471651077270508,
1.272496223449707,
-1.3242676258087158,
2.7200119495391846,
0.7070661187171936,
-0.24841561913490295,
-0.9244132041931152,
0.48371684551239014,
0.05958814173936844,
-1.3187246322631836,
-0.35145825147628784,
-0.9369596242904663,
-0.1291261613368988,
-0.5751173496246338,
-0.4917225241661072,
-0.009633335284888744,
0.4292326867580414,
-0.2933066785335541,
-0.4267599284648895,
-0.5435286164283752,
-0.7705215811729431,
0.49493783712387085,
-0.3315354585647583,
0.8882800936698914,
-0.3674048185348511,
1.8427739143371582,
-0.603990912437439,
0.5368137359619141,
0.7314536571502686,
1.1821430921554565,
0.2291659414768219,
-0.01928074099123478,
0.2990895211696625,
0.3342050611972809,
-0.05688723921775818,
0.5221681594848633,
1.197359561920166,
0.6234780550003052,
0.5512596964836121,
0.719060480594635,
-2.173271894454956,
1.354000210762024,
-0.9884759783744812,
0.2255306988954544,
1.4473044872283936,
-0.970666766166687,
0.43031007051467896,
-1.8248603343963623,
-0.0667533352971077,
0.48221302032470703,
-2.3112075328826904,
0.26034748554229736,
-1.343467116355896,
-0.5770426392555237,
1.0027430057525635,
0.3593111038208008,
-1.2306584119796753,
-0.003541131503880024,
-0.4525129795074463,
1.0332053899765015,
0.43909552693367004,
1.10645592212677,
-1.6955420970916748,
-0.06237589940428734,
-0.28031229972839355,
0.17977626621723175,
-1.3246769905090332,
-1.5519427061080933,
0.5414075255393982,
0.5827621817588806,
0.6459099650382996,
-0.05993574485182762,
1.015065312385559,
-1.0784598588943481,
0.7970849871635437,
-0.9500627517700195,
-1.6877793073654175,
-1.38125741481781,
-2.388115167617798,
-2.3101236820220947,
0.7080973982810974,
-0.4599549174308777,
-0.4925518333911896,
2.094700813293457,
-1.090183973312378,
-1.683547854423523,
1.084516167640686,
0.2749488651752472,
0.0049039144068956375,
2.465376853942871,
0.3021192252635956,
-0.8279139995574951,
0.5842180252075195,
-0.8213798999786377,
0.7167069911956787,
-0.3217921853065491,
1.3376249074935913,
0.4603781998157501,
-1.105492115020752,
1.5344760417938232,
-0.37676239013671875,
0.5828050971031189,
-0.6980117559432983,
-0.5004497170448303,
-0.7381779551506042,
0.19316616654396057,
1.863190770149231,
-0.23692716658115387,
1.5342974662780762,
-0.2780589461326599,
-1.5123465061187744,
-1.528214693069458,
0.81267249584198,
0.5075870752334595,
-0.8086562752723694,
0.13387003540992737,
-0.3269970715045929,
0.04563775658607483,
0.011486313305795193,
1.077034592628479,
1.2480213642120361,
0.7856088280677795,
-0.3107698857784271,
-0.8375773429870605,
0.12119770795106888,
-0.07140932977199554,
-0.7258806228637695,
-1.714478611946106,
-0.27908042073249817,
0.08530806005001068,
0.5899164080619812,
-1.2753827571868896,
1.795215368270874,
0.9320948719978333,
1.9121755361557007,
1.0085078477859497,
-0.3880237936973572,
1.4791916608810425,
0.06800426542758942,
1.8403477668762207,
-0.4548148214817047,
0.7024936079978943,
-0.36594662070274353,
-1.212088942527771,
0.7400580644607544,
-0.33633843064308167,
-2.0488529205322266,
-0.6836323142051697,
-0.8059627413749695,
-0.18828247487545013,
-0.8337814807891846,
0.9125207662582397,
-0.2835949659347534,
-1.4112948179244995,
0.22269418835639954,
-0.6372804045677185,
0.16973209381103516,
-1.3155275583267212,
0.3620014488697052,
0.7592308521270752,
-0.6500548720359802,
0.03760130703449249,
-0.2326526790857315,
-1.2297765016555786,
-0.5696613192558289,
0.35947439074516296,
1.8358267545700073,
-0.6705231666564941,
0.9691557288169861,
1.0587327480316162,
-0.7133695483207703,
-0.022864166647195816,
0.32251468300819397,
-0.3291642665863037,
0.9065685868263245,
-1.038482427597046,
-0.41857171058654785,
1.1637792587280273,
-0.27701252698898315,
-0.5804533362388611,
1.4448927640914917,
0.6670619249343872,
-0.9647258520126343,
-0.27126002311706543,
-0.1468811184167862,
-0.8067315220832825,
0.034494273364543915,
-1.5186164379119873,
-0.08608260750770569,
0.33930251002311707,
-1.497971534729004,
-0.4460705816745758,
-0.15973199903964996,
1.3679841756820679,
-0.2351939082145691,
1.3777774572372437,
-0.26602688431739807,
-0.17667216062545776,
-0.43937739729881287,
-0.4424121677875519,
0.16459928452968597,
-0.22568775713443756,
-0.5969213247299194,
0.18442068994045258,
-0.7493305206298828,
0.24886062741279602,
1.4276474714279175,
0.3337014317512512,
0.04868561029434204,
0.43659621477127075,
1.1392250061035156,
0.41842934489250183,
-0.15656550228595734,
-0.8760066628456116,
-1.5540881156921387,
1.9650721549987793,
-1.510421872138977,
2.053168773651123,
0.8218960762023926,
-0.10610108822584152,
-1.8245381116867065,
-1.905527949333191,
1.3620957136154175,
1.171105146408081,
2.4299142360687256,
0.541158139705658,
0.4103003740310669,
-0.8326683640480042,
-0.7517801523208618,
0.37062156200408936,
-0.9404085278511047,
-0.7452097535133362,
0.16455502808094025,
2.3273837566375732,
1.6582621335983276,
-0.4377385079860687,
-0.19302749633789062,
-1.0128496885299683,
1.355992078781128,
-0.13305597007274628,
0.19755370914936066,
1.9883129596710205,
-0.27210965752601624,
-1.0969126224517822,
1.3073276281356812,
-2.3324975967407227,
0.23260946571826935,
2.0087013244628906,
0.33561351895332336,
0.11345352232456207,
-1.327891230583191,
-0.6919060945510864,
-0.2609693706035614,
-0.4995279610157013,
-1.2305148839950562,
0.45763781666755676,
-0.23758967220783234,
-0.8132082223892212,
-1.454730749130249,
0.07248272001743317,
-1.151151418685913,
-1.6747639179229736,
0.2744039297103882,
1.8821858167648315,
2.0511972904205322,
-0.797447919845581,
1.4598296880722046,
-0.2756449282169342,
0.12462616711854935,
1.1808596849441528,
1.2775315046310425,
3.1377100944519043,
1.8593573570251465,
-1.2968589067459106,
0.6523240804672241,
-0.056713495403528214,
-0.45236319303512573,
1.1959257125854492,
-1.1099414825439453,
1.3064374923706055,
-0.17551018297672272,
-1.2282885313034058,
-1.2520040273666382,
0.8846220970153809,
0.46677953004837036,
0.03642016276717186,
-0.5443642735481262,
1.1542781591415405,
0.15379834175109863,
1.3375039100646973,
0.5416895151138306,
-0.28116223216056824,
0.6157357692718506,
-0.41243302822113037,
-0.523276150226593,
1.5455422401428223,
0.14902156591415405,
-1.4570139646530151,
-2.3052523136138916,
-0.21648725867271423,
-0.8864390254020691,
0.02816176414489746,
-0.6951025724411011,
-1.060067057609558,
1.6470035314559937,
0.44574806094169617,
-1.1588428020477295,
-0.23111094534397125,
-0.32336875796318054,
-0.5772385001182556,
2.723987102508545,
-1.3240984678268433,
-0.11095476895570755,
-0.9961972236633301,
-0.6599977016448975,
1.5891101360321045,
-1.2129138708114624,
-0.21932470798492432,
-1.0408196449279785,
-0.5823975801467896,
-1.3134245872497559,
-0.4874207377433777,
-0.015951693058013916,
-0.9405705332756042,
0.7922210693359375,
0.1713314950466156,
-1.219536304473877,
-0.3228808641433716,
-0.921345591545105,
0.8890835046768188,
-0.13583369553089142,
0.14530225098133087,
1.7898529767990112,
0.31561413407325745,
-0.3909780979156494,
0.7514521479606628,
1.1805745363235474,
0.6468024849891663,
-0.6247888207435608,
0.2468339502811432,
-0.6969737410545349,
0.3660537600517273,
-1.268315315246582,
0.26709747314453125,
-2.908982992172241,
0.607788622379303,
-0.08482331782579422,
-0.11195927858352661,
-0.03265643119812012,
-1.349341869354248,
1.0913753509521484,
2.4732553958892822,
-1.1318665742874146,
0.554656982421875,
0.33997294306755066,
1.162683367729187,
-1.679860234260559,
0.23341335356235504,
-0.4963671863079071,
2.0815672874450684,
0.17854724824428558,
1.1970531940460205,
-0.5187505483627319,
-2.3433566093444824,
0.5771974325180054,
-1.237972378730774,
-1.1089128255844116,
0.8069989681243896,
-0.8871496319770813,
0.21548809111118317,
-1.2712470293045044,
-0.24185296893119812,
-0.8987419009208679,
-1.2250078916549683,
0.6456295251846313,
0.09663859009742737,
0.5192094445228577,
-0.5641198754310608,
0.3384442627429962,
-2.2624287605285645,
-1.3906351327896118,
-0.20680806040763855,
-0.9501209855079651,
0.47792163491249084,
-0.3367781639099121,
0.721644401550293,
-0.15590238571166992,
0.055683426558971405,
0.3714272975921631,
1.4973440170288086,
3.2797532081604004,
0.1357707530260086,
0.3198581635951996,
-0.1822483092546463,
-1.027701735496521,
1.5282343626022339,
0.9289188385009766,
-0.14215697348117828,
-0.6165199279785156,
-1.0632988214492798,
1.2318195104599,
1.9133656024932861,
1.0266673564910889,
0.017518945038318634,
-0.8491768836975098,
-0.7504293918609619,
0.042771436274051666,
0.173904687166214,
0.450316458940506,
0.9925851225852966,
0.10260149091482162,
0.12517417967319489,
1.4792118072509766,
1.1155778169631958,
-0.382309228181839,
0.365154504776001,
-0.8295517563819885,
-0.4707566797733307,
0.49992674589157104,
0.30100440979003906,
-0.02766837552189827,
0.37941306829452515,
-1.0435713529586792,
-0.2898750901222229,
-0.3843785226345062,
-0.9134770631790161,
-0.710877001285553,
-0.4219299256801605,
-0.40030235052108765,
1.6684409379959106,
0.04617754742503166,
-0.5010666251182556,
0.04053780809044838,
-0.7840266823768616,
-0.14438416063785553,
-1.0979793071746826,
0.33894699811935425,
-0.12154224514961243,
-0.02440936490893364,
-0.0817897692322731,
1.7331719398498535,
-0.9216118454933167,
-2.1222712993621826,
0.17833687365055084,
0.24693194031715393,
-0.3464074730873108,
0.15799731016159058,
1.7078684568405151,
0.496009886264801,
1.434092402458191,
1.3504468202590942,
0.996531069278717,
-0.693457841873169,
-1.3043627738952637,
0.722778856754303,
0.9704667329788208,
-1.3964210748672485,
0.8664755821228027,
-0.09454354643821716,
-0.5513445734977722,
0.6053431034088135,
1.3289177417755127,
0.4903014004230499,
-1.902380347251892,
0.8312299251556396,
-1.0102894306182861,
0.8446919918060303,
0.7018186450004578,
0.7376035451889038,
0.150653675198555,
0.867597222328186,
-1.2229795455932617,
-1.0373915433883667,
-0.6086643934249878,
-0.6364241242408752,
1.898261308670044,
-0.37783071398735046,
0.5930447578430176,
-0.2655845582485199,
-1.2422372102737427,
0.0371270477771759,
0.6942710876464844,
0.3511858880519867,
-0.3821876049041748,
0.8445522785186768,
-0.6789031028747559,
-1.0953633785247803,
-1.3228492736816406,
-0.36881232261657715,
-1.0599192380905151,
-0.8748091459274292,
1.0229932069778442,
0.7328536510467529,
0.31905850768089294,
1.911008358001709,
0.6737896800041199,
0.3095782995223999,
-2.642620801925659,
0.9016493558883667,
0.2770603597164154,
-0.01883574202656746,
0.909091591835022,
0.28519296646118164,
1.140739917755127,
-0.06075935810804367,
0.5354002118110657,
-2.3945531845092773,
2.351337194442749,
-0.20846505463123322,
0.7256538271903992,
0.0054288702085614204,
-0.15898773074150085,
1.0622628927230835,
0.6206715703010559,
0.5602750778198242,
-1.123565435409546,
0.7743105292320251,
-0.5237284898757935,
1.135454535484314,
0.8417577743530273,
-0.846590518951416,
-0.001146150752902031,
1.2715187072753906,
0.48708468675613403,
-0.5012065172195435,
-0.9334248304367065,
-0.9084251523017883,
0.9054917097091675,
1.679453730583191,
-0.0054888008162379265,
0.02315347269177437,
0.8402566313743591,
0.6866783499717712,
-1.3122954368591309,
0.10986513644456863,
-0.6605238318443298,
-0.7592549920082092,
1.7315067052841187,
2.0719192028045654,
-0.05844494327902794,
-0.23763631284236908,
-0.6854574680328369,
-1.3320273160934448,
0.8367076516151428,
0.00912789348512888,
0.1251758635044098,
0.5760200023651123,
-0.6726547479629517,
1.0431475639343262,
0.8718957304954529,
0.9530919194221497,
0.22983770072460175,
0.19613765180110931,
0.3643471300601959,
-0.3394661247730255,
-1.2193913459777832,
-0.1740492433309555,
-1.033037543296814,
-2.581801176071167,
0.47355785965919495,
-0.20128723978996277,
-1.4063899517059326,
0.1259782761335373,
-1.008446455001831,
0.8467153906822205,
-0.5979100465774536,
-1.1314526796340942,
-1.476115107536316,
0.151340052485466,
-0.15211869776248932,
0.8556511402130127,
-1.5541729927062988,
-0.18753598630428314,
1.2310423851013184,
0.9538878202438354,
-0.6706135272979736,
0.9611274600028992,
0.189367413520813,
1.0006135702133179,
0.8662380576133728,
-0.4350707530975342,
0.5469639301300049,
0.15479080379009247,
-1.4390963315963745,
0.3829556107521057,
1.3188960552215576,
0.2369980663061142,
1.52035391330719,
-0.4839248061180115,
-0.0031645242124795914,
0.4358786642551422,
-0.47158104181289673,
-0.4889306426048279,
-0.5916529893875122,
0.6166791915893555,
-0.01847238838672638,
-0.9866135716438293,
-0.05020378157496452,
-0.07032674551010132,
-0.22498881816864014,
0.20344649255275726,
-1.529614806175232,
-0.18240506947040558,
-0.47824254631996155,
-0.6211905479431152,
-1.3004679679870605,
-0.04620518535375595,
1.3111538887023926,
-0.7846954464912415,
-0.15212085843086243,
0.4903196096420288,
0.30120810866355896,
0.5185375809669495,
0.6539322137832642,
-0.744078516960144,
-0.24318590760231018,
-0.2446075975894928,
-0.42351171374320984,
0.3561306297779083,
1.294527292251587,
-0.1550663858652115,
-0.9813157916069031,
0.5746160745620728,
-0.2811022400856018,
0.15493156015872955,
1.9935141801834106,
0.0012277420610189438,
-0.7870021462440491,
0.31952154636383057,
-0.7422692775726318,
1.8976892232894897,
1.6685023307800293,
1.4309251308441162,
-0.20194536447525024,
-0.8882546424865723,
0.6071563959121704,
-0.3678022623062134,
-0.34226059913635254,
0.9850931763648987,
0.4281921982765198,
-0.26392674446105957,
-1.376739501953125,
0.7502256035804749,
1.2391457557678223,
-0.9056338667869568,
-0.7396733164787292,
0.1910376101732254,
-0.8070510029792786,
1.155087947845459,
0.651922345161438,
0.33170002698898315,
0.34460872411727905,
1.6416901350021362,
0.7884424328804016,
-0.5054026246070862,
0.5284976959228516,
0.4863935112953186,
-0.2114494889974594,
-1.9910860061645508,
-1.1185709238052368,
0.3873592019081116,
-0.6133127212524414,
-1.521196961402893,
1.4558604955673218,
-1.1786452531814575,
-1.0465515851974487,
0.5753790140151978,
0.07565030455589294,
1.3733843564987183,
0.3693707585334778,
1.69288969039917,
2.0480847358703613,
0.8747997879981995,
0.3846532702445984,
1.1891486644744873,
-0.15016554296016693,
-0.4049988389015198,
1.7990249395370483,
-0.47462689876556396,
0.5158148407936096,
1.0988043546676636,
-0.3671630918979645,
-1.1561590433120728,
-0.828630805015564,
-1.1862974166870117,
-0.7442781329154968,
1.1703040599822998,
0.11979355663061142,
-1.0774176120758057,
0.2901594340801239,
1.5765513181686401,
0.0641293153166771,
-0.26623013615608215,
0.6774484515190125,
0.3587189018726349,
-0.7272043228149414,
-0.10703619569540024,
-0.9678444266319275,
0.5580668449401855,
-0.22390732169151306,
-0.4165200889110565,
0.20730546116828918,
0.5250728726387024,
1.266784429550171,
0.01698232814669609,
0.13031159341335297,
1.263022780418396,
-1.3838058710098267,
1.4101918935775757,
-0.8243106007575989,
0.268858939409256,
-2.3385891914367676,
1.4352130889892578,
-0.7902648448944092,
1.9599740505218506,
-2.656792163848877,
0.5132299065589905,
-0.5029415488243103,
-0.4980470538139343,
0.24368217587471008,
-0.34618574380874634,
0.1908520609140396,
-0.15578705072402954,
-1.0456678867340088,
-0.15125280618667603,
-0.7951738834381104,
0.563748300075531,
1.1446788311004639,
1.3296340703964233,
-1.0556684732437134,
-0.2768145203590393,
-1.6416690349578857,
-0.2063605785369873,
-0.6604325771331787,
0.2874787151813507,
-1.8833560943603516,
-0.19560465216636658,
-1.9947518110275269,
-2.45526385307312,
-1.2604503631591797,
-0.8400336503982544,
1.195239782333374,
0.162975013256073,
-0.9223971962928772,
1.2267035245895386,
-0.3654542863368988,
-1.8088847398757935,
1.153895378112793,
-2.202305316925049
] |
https://github.com/huggingface/datasets/issues/5085 | Filtering on an empty dataset returns a corrupted dataset. | ~~It seems like #5043 fix (merged recently) is the root cause of such behaviour. When we empty indices mapping (because the dataset length equals to zero), we can no longer get column item like: `ds_filter_2['sentence']` which uses
`ds_filter_1._indices.column(0)`~~
**UPDATE:**
Empty datasets are returned without going through partial function on `map` method, which will not work to get indices for `filter`: we need to run `get_indices_from_mask_function` partial function on the dataset to get output = `{"indices": []}`. But this is complicated since functions used in args, in particular `get_indices_from_mask_function`, do not support empty datasets.
We can just handle empty datasets aside on filter method. | ## Describe the bug
When filtering a dataset twice, where the first result is an empty dataset, the second dataset seems corrupted.
## Steps to reproduce the bug
```python
datasets = load_dataset("glue", "sst2")
dataset_split = datasets['validation']
ds_filter_1 = dataset_split.filter(lambda x: False) # Some filtering condition that leads to an empty dataset
assert ds_filter_1.num_rows == 0
sentences = ds_filter_1['sentence']
assert len(sentences) == 0
ds_filter_2 = ds_filter_1.filter(lambda x: False) # Some other filtering condition
assert ds_filter_2.num_rows == 0
assert 'sentence' in ds_filter_2.column_names
sentences = ds_filter_2['sentence']
```
## Expected results
The last line should be returning an empty list, same as 4 lines above.
## Actual results
The last line currently raises `IndexError: index out of bounds`.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-11.6.6-x86_64-i386-64bit
- Python version: 3.9.11
- PyArrow version: 7.0.0
- Pandas version: 1.4.1
| 490 | 103 | Filtering on an empty dataset returns a corrupted dataset.
## Describe the bug
When filtering a dataset twice, where the first result is an empty dataset, the second dataset seems corrupted.
## Steps to reproduce the bug
```python
datasets = load_dataset("glue", "sst2")
dataset_split = datasets['validation']
ds_filter_1 = dataset_split.filter(lambda x: False) # Some filtering condition that leads to an empty dataset
assert ds_filter_1.num_rows == 0
sentences = ds_filter_1['sentence']
assert len(sentences) == 0
ds_filter_2 = ds_filter_1.filter(lambda x: False) # Some other filtering condition
assert ds_filter_2.num_rows == 0
assert 'sentence' in ds_filter_2.column_names
sentences = ds_filter_2['sentence']
```
## Expected results
The last line should be returning an empty list, same as 4 lines above.
## Actual results
The last line currently raises `IndexError: index out of bounds`.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 2.5.2
- Platform: macOS-11.6.6-x86_64-i386-64bit
- Python version: 3.9.11
- PyArrow version: 7.0.0
- Pandas version: 1.4.1
~~It seems like #5043 fix (merged recently) is the root cause of such behaviour. When we empty indices mapping (because the dataset length equals to zero), we can no longer get column item like: `ds_filter_2['sentence']` which uses
`ds_filter_1._indices.column(0)`~~
**UPDATE:**
Empty datasets are returned without going through partial function on `map` method, which will not work to get indices for `filter`: we need to run `get_indices_from_mask_function` partial function on the dataset to get output = `{"indices": []}`. But this is complicated since functions used in args, in particular `get_indices_from_mask_function`, do not support empty datasets.
We can just handle empty datasets aside on filter method. | [
-1.1842976808547974,
-0.9335596561431885,
-0.7286592125892639,
1.5196937322616577,
-0.18202130496501923,
-1.2776389122009277,
0.18957622349262238,
-1.0353822708129883,
1.720245122909546,
-0.7762464284896851,
0.2683296501636505,
-1.6605199575424194,
0.08609013259410858,
-0.5727528929710388,
-0.7417343258857727,
-0.7863245606422424,
-0.38783589005470276,
-0.6524456143379211,
1.106620192527771,
2.418971300125122,
1.2177226543426514,
-1.3806296586990356,
2.590069055557251,
0.7619246244430542,
-0.1966101974248886,
-0.9287897348403931,
0.540611982345581,
0.012375907972455025,
-1.3980480432510376,
-0.37467485666275024,
-0.8509661555290222,
-0.03727353364229202,
-0.5566807985305786,
-0.4801664650440216,
-0.07692290842533112,
0.4074842929840088,
-0.3872433006763458,
-0.45112720131874084,
-0.5490409731864929,
-0.731224775314331,
0.4457489252090454,
-0.32418161630630493,
0.9126602411270142,
-0.3218681216239929,
1.7847174406051636,
-0.622532069683075,
0.4943489134311676,
0.7174633145332336,
1.2732458114624023,
0.19533291459083557,
-0.023668263107538223,
0.37747111916542053,
0.3521845042705536,
0.004747421480715275,
0.5077055096626282,
1.2068946361541748,
0.664939820766449,
0.4880009889602661,
0.7662460803985596,
-2.277681589126587,
1.2683078050613403,
-1.002951979637146,
0.3498390316963196,
1.2987529039382935,
-0.9714150428771973,
0.3025332987308502,
-1.7054519653320312,
-0.011060451157391071,
0.6339909434318542,
-2.2678778171539307,
0.33242133259773254,
-1.3678175210952759,
-0.5144582390785217,
0.9903639554977417,
0.44200852513313293,
-1.1520744562149048,
0.0974162295460701,
-0.49060946702957153,
0.9410697817802429,
0.41865894198417664,
1.0510815382003784,
-1.7041573524475098,
-0.07587136328220367,
-0.3260122239589691,
0.12152224779129028,
-1.312369704246521,
-1.5388544797897339,
0.5736955404281616,
0.6824008822441101,
0.6463881134986877,
-0.15696842968463898,
1.0207921266555786,
-1.0504587888717651,
0.7307370901107788,
-1.0324369668960571,
-1.7781596183776855,
-1.4505326747894287,
-2.316680669784546,
-2.2275092601776123,
0.7083057165145874,
-0.431048184633255,
-0.48384183645248413,
2.082775354385376,
-0.9934937357902527,
-1.7712184190750122,
1.0870689153671265,
0.2884160578250885,
0.023884257301688194,
2.305352210998535,
0.17305628955364227,
-0.7459738254547119,
0.5214279890060425,
-0.801796019077301,
0.7273708581924438,
-0.2817409038543701,
1.2414218187332153,
0.36700373888015747,
-1.0634465217590332,
1.5551204681396484,
-0.3897496461868286,
0.6346566081047058,
-0.666035532951355,
-0.48719045519828796,
-0.7146215438842773,
0.24588483572006226,
1.8859739303588867,
-0.2861737310886383,
1.5176273584365845,
-0.31557998061180115,
-1.512713074684143,
-1.5862332582473755,
0.8716670870780945,
0.4984308183193207,
-0.7164222002029419,
0.10865059494972229,
-0.35972005128860474,
0.18850524723529816,
-0.17423978447914124,
1.193701148033142,
1.2759298086166382,
0.6833277344703674,
-0.410192608833313,
-0.8730178475379944,
0.12874124944210052,
-0.09700562059879303,
-0.7397454380989075,
-1.7868825197219849,
-0.2810310125350952,
0.1145109087228775,
0.6909486055374146,
-1.2004079818725586,
1.7619850635528564,
0.8798867464065552,
1.9714030027389526,
1.0447919368743896,
-0.3829910457134247,
1.435726523399353,
0.14965489506721497,
1.837007761001587,
-0.488391250371933,
0.6446309685707092,
-0.4055675268173218,
-1.1257556676864624,
0.8159099817276001,
-0.3240070044994354,
-2.068655014038086,
-0.6757078170776367,
-0.7641783952713013,
-0.18808817863464355,
-0.7894999980926514,
0.9787819385528564,
-0.3237018883228302,
-1.4465558528900146,
0.24214303493499756,
-0.7400694489479065,
0.13483169674873352,
-1.1902847290039062,
0.2199816107749939,
0.7325862050056458,
-0.586765706539154,
0.03680364042520523,
-0.24480457603931427,
-1.2994513511657715,
-0.49828556180000305,
0.44321393966674805,
1.763418197631836,
-0.6527183651924133,
0.912136435508728,
1.0963801145553589,
-0.6184812188148499,
0.05399569123983383,
0.32939568161964417,
-0.22099453210830688,
0.8695158958435059,
-0.9718378186225891,
-0.4907757639884949,
1.163050651550293,
-0.264283150434494,
-0.6736679673194885,
1.5442216396331787,
0.6797397136688232,
-0.9879656434059143,
-0.17674016952514648,
-0.0429118350148201,
-0.8808131814002991,
0.04779592901468277,
-1.6244128942489624,
-0.0782112255692482,
0.41228851675987244,
-1.6321650743484497,
-0.4863114356994629,
-0.1672479808330536,
1.2876458168029785,
-0.16706600785255432,
1.3222308158874512,
-0.28614458441734314,
-0.08871534466743469,
-0.3663026988506317,
-0.41877084970474243,
0.09789334237575531,
-0.1433390974998474,
-0.6012789011001587,
0.20616663992404938,
-0.784229040145874,
0.3231409192085266,
1.4491705894470215,
0.2950493395328522,
0.06884273886680603,
0.4879339337348938,
1.1180408000946045,
0.3993886411190033,
-0.13865654170513153,
-0.8424020409584045,
-1.5965834856033325,
1.958513617515564,
-1.4359146356582642,
2.0420703887939453,
0.7691477537155151,
-0.08123409748077393,
-1.781188726425171,
-1.9445120096206665,
1.3737825155258179,
1.051966667175293,
2.351206064224243,
0.49892458319664,
0.4029439687728882,
-0.8427695035934448,
-0.674879789352417,
0.32060378789901733,
-0.9709580540657043,
-0.7491548657417297,
0.13623759150505066,
2.4399921894073486,
1.7640520334243774,
-0.34631356596946716,
-0.12175606936216354,
-1.0164992809295654,
1.4716382026672363,
-0.14364250004291534,
0.29225480556488037,
1.9851833581924438,
-0.2017829418182373,
-0.9549746513366699,
1.364943027496338,
-2.344675302505493,
0.13733358681201935,
1.9991265535354614,
0.23769202828407288,
0.1448240727186203,
-1.3311718702316284,
-0.6336343884468079,
-0.28166109323501587,
-0.45235854387283325,
-1.264549970626831,
0.4816015660762787,
-0.2713719606399536,
-0.7490037083625793,
-1.3638043403625488,
0.22935403883457184,
-1.107194185256958,
-1.6778321266174316,
0.23624594509601593,
1.9170942306518555,
1.9861419200897217,
-0.7624133229255676,
1.5370564460754395,
-0.39983832836151123,
0.16812396049499512,
1.2119628190994263,
1.2358826398849487,
3.1266703605651855,
1.9495302438735962,
-1.3177714347839355,
0.6893318891525269,
-0.13646093010902405,
-0.4298734962940216,
1.1696295738220215,
-1.208370327949524,
1.3225228786468506,
-0.21995310485363007,
-1.2176817655563354,
-1.2519856691360474,
0.9440591931343079,
0.5333613157272339,
0.08638027310371399,
-0.5004212856292725,
1.1385606527328491,
0.05648813396692276,
1.3189958333969116,
0.6032085418701172,
-0.3586881756782532,
0.5936076045036316,
-0.44244691729545593,
-0.5805487632751465,
1.5891916751861572,
0.14718292653560638,
-1.4355103969573975,
-2.2925848960876465,
-0.24832873046398163,
-0.8184180855751038,
0.08019671589136124,
-0.6158475875854492,
-1.0135258436203003,
1.6155179738998413,
0.3500611186027527,
-1.2412744760513306,
-0.22668324410915375,
-0.29420942068099976,
-0.5628247261047363,
2.7366721630096436,
-1.3440784215927124,
-0.22627469897270203,
-1.0829715728759766,
-0.6710734963417053,
1.6594574451446533,
-1.1818310022354126,
-0.2712365388870239,
-1.0792745351791382,
-0.5822390913963318,
-1.2900928258895874,
-0.4832027852535248,
0.007501265034079552,
-0.9467670321464539,
0.9022421836853027,
0.1251293271780014,
-1.225592017173767,
-0.4027261734008789,
-0.9061915874481201,
0.9698711037635803,
-0.14019595086574554,
0.1793728768825531,
1.8801742792129517,
0.34279751777648926,
-0.4253547489643097,
0.7439959645271301,
1.1609469652175903,
0.6809082627296448,
-0.7227243781089783,
0.23933927714824677,
-0.5625183582305908,
0.36957094073295593,
-1.3080767393112183,
0.3040235936641693,
-2.8564131259918213,
0.5873576402664185,
-0.01610521599650383,
-0.01870187371969223,
-0.008365615271031857,
-1.342688798904419,
1.0217305421829224,
2.5740714073181152,
-1.167766809463501,
0.5046926736831665,
0.31175053119659424,
1.1580811738967896,
-1.5974961519241333,
0.283394992351532,
-0.5274252891540527,
2.153258800506592,
0.17728152871131897,
1.2079278230667114,
-0.4932449758052826,
-2.355452537536621,
0.6720033288002014,
-1.191756248474121,
-1.211828351020813,
0.8570536375045776,
-0.899967610836029,
0.22107593715190887,
-1.4702627658843994,
-0.27867838740348816,
-0.8428112268447876,
-1.1894543170928955,
0.6649454236030579,
0.17299972474575043,
0.42466500401496887,
-0.650513231754303,
0.33033841848373413,
-2.2497756481170654,
-1.3362609148025513,
-0.17244164645671844,
-0.9318600296974182,
0.5430334806442261,
-0.3879758417606354,
0.6936860680580139,
-0.11026720702648163,
-0.018593668937683105,
0.3172554671764374,
1.4362819194793701,
3.361036777496338,
0.13934369385242462,
0.25603175163269043,
-0.23432570695877075,
-0.8690285086631775,
1.3962421417236328,
0.9522954225540161,
-0.15919175744056702,
-0.5912941098213196,
-1.1107288599014282,
1.2692517042160034,
1.9426783323287964,
0.9503148198127747,
-0.040305204689502716,
-0.8370802402496338,
-0.7454770803451538,
-0.025830086320638657,
0.15937863290309906,
0.5574968457221985,
0.891985297203064,
0.13366104662418365,
0.10595300793647766,
1.3764969110488892,
1.132447361946106,
-0.36375507712364197,
0.3933338224887848,
-0.8878571391105652,
-0.5218566060066223,
0.5011525750160217,
0.3675089180469513,
-0.02027110755443573,
0.33590033650398254,
-1.1365617513656616,
-0.1771535873413086,
-0.403551310300827,
-0.8426695466041565,
-0.6316691040992737,
-0.42088574171066284,
-0.4296320974826813,
1.634757161140442,
0.0486118420958519,
-0.5278325080871582,
-0.09931567311286926,
-0.7792984247207642,
-0.09480101615190506,
-1.0345656871795654,
0.36163264513015747,
-0.17855431139469147,
-0.0812499076128006,
-0.17864851653575897,
1.7072327136993408,
-0.9272711873054504,
-2.0546693801879883,
0.23524869978427887,
0.21583972871303558,
-0.3035711944103241,
0.16933684051036835,
1.6802676916122437,
0.5169815421104431,
1.3648761510849,
1.3258219957351685,
0.9852548241615295,
-0.6676384210586548,
-1.3355642557144165,
0.600505530834198,
1.0102287530899048,
-1.3045042753219604,
0.8045052289962769,
-0.06714476644992828,
-0.5864248275756836,
0.619500458240509,
1.3091622591018677,
0.5109217166900635,
-2.0525999069213867,
0.8371089696884155,
-1.0210239887237549,
0.8284305930137634,
0.8500913977622986,
0.7539302110671997,
0.24104204773902893,
0.8116713166236877,
-1.238503336906433,
-1.1212049722671509,
-0.7013828754425049,
-0.7839736938476562,
1.9497497081756592,
-0.3263511657714844,
0.5418930053710938,
-0.05985334515571594,
-1.3336150646209717,
-0.09431350231170654,
0.6719552278518677,
0.372875452041626,
-0.4807015657424927,
0.8451633453369141,
-0.6498672366142273,
-1.088387370109558,
-1.3140448331832886,
-0.45068275928497314,
-0.9949010014533997,
-0.9407422542572021,
0.9980344176292419,
0.8084515333175659,
0.3308221101760864,
1.8787310123443604,
0.6876491904258728,
0.2321658581495285,
-2.5455851554870605,
0.8868242502212524,
0.3436882197856903,
-0.07901130616664886,
0.8153321743011475,
0.3458046019077301,
1.0161806344985962,
0.04956623911857605,
0.5228926539421082,
-2.4237852096557617,
2.282953977584839,
-0.24387048184871674,
0.6592605710029602,
-0.10147488862276077,
-0.18832489848136902,
1.0810397863388062,
0.5712239146232605,
0.5215821862220764,
-0.9864981174468994,
0.7538260221481323,
-0.5781546235084534,
1.2705730199813843,
0.9026010632514954,
-0.8037471771240234,
-0.13679954409599304,
1.320539116859436,
0.4304916560649872,
-0.5284495949745178,
-0.9203984141349792,
-1.0549147129058838,
0.8842362761497498,
1.7848392724990845,
-0.002374238334596157,
0.035588160157203674,
0.8465467691421509,
0.7415148019790649,
-1.2286440134048462,
0.0768943503499031,
-0.6936830282211304,
-0.7632325291633606,
1.671299695968628,
2.036764144897461,
-0.14019015431404114,
-0.1280105710029602,
-0.7400386929512024,
-1.2347702980041504,
0.8310511112213135,
-0.07949305325746536,
0.08041887730360031,
0.6676382422447205,
-0.5958434343338013,
0.9831361770629883,
0.890930712223053,
0.9210168123245239,
0.14024131000041962,
0.2295634001493454,
0.38363778591156006,
-0.28445547819137573,
-1.261200189590454,
-0.2789946496486664,
-1.0556427240371704,
-2.4832186698913574,
0.40494847297668457,
-0.15175168216228485,
-1.4170253276824951,
0.041143566370010376,
-1.0882700681686401,
0.8825764060020447,
-0.5582296848297119,
-1.162357211112976,
-1.493462085723877,
0.1602010726928711,
-0.06552766263484955,
0.8544940948486328,
-1.5715391635894775,
-0.13262583315372467,
1.1855891942977905,
0.8421564102172852,
-0.6576828956604004,
1.017336368560791,
0.22355930507183075,
1.0170447826385498,
0.8466393947601318,
-0.38897714018821716,
0.511419415473938,
0.10352732986211777,
-1.3175125122070312,
0.4615159332752228,
1.180045485496521,
0.16119836270809174,
1.5855499505996704,
-0.5996755361557007,
-0.021643636748194695,
0.4096255898475647,
-0.537322998046875,
-0.3541165292263031,
-0.6129003167152405,
0.7155542969703674,
0.029705600813031197,
-0.8272574543952942,
-0.025212010368704796,
-0.05912967026233673,
-0.23727039992809296,
0.1584002524614334,
-1.4752711057662964,
-0.040304794907569885,
-0.374244749546051,
-0.6124460697174072,
-1.2383813858032227,
-0.05067025125026703,
1.4798970222473145,
-0.7168979048728943,
-0.19653576612472534,
0.5021737217903137,
0.3342612683773041,
0.5411101579666138,
0.7920811772346497,
-0.6946021318435669,
-0.3064269721508026,
-0.20661461353302002,
-0.3468289375305176,
0.36755093932151794,
1.3571499586105347,
-0.12413214892148972,
-0.9562812447547913,
0.6415691375732422,
-0.39554309844970703,
0.0925755724310875,
1.9789410829544067,
0.07862874865531921,
-0.7485840320587158,
0.3520948588848114,
-0.7801387906074524,
1.9539028406143188,
1.7458500862121582,
1.2861682176589966,
-0.16247062385082245,
-1.0067284107208252,
0.626092791557312,
-0.34727466106414795,
-0.4074818789958954,
0.8717074394226074,
0.42831143736839294,
-0.25737884640693665,
-1.3602882623672485,
0.7621886134147644,
1.2311670780181885,
-0.9470729231834412,
-0.8106086850166321,
0.1808435171842575,
-0.7265828847885132,
1.1722238063812256,
0.6311962008476257,
0.367981880903244,
0.2733541429042816,
1.627539038658142,
0.7880446910858154,
-0.4543295204639435,
0.5283901691436768,
0.5619653463363647,
-0.14970934391021729,
-2.0941736698150635,
-1.1619503498077393,
0.3543611764907837,
-0.5957325100898743,
-1.6320767402648926,
1.4416557550430298,
-1.2031477689743042,
-0.9484377503395081,
0.5394356846809387,
-0.014171521179378033,
1.3774287700653076,
0.36638468503952026,
1.5957202911376953,
2.039111614227295,
0.8865222334861755,
0.449171781539917,
1.3426215648651123,
-0.21268293261528015,
-0.5177019238471985,
1.730626106262207,
-0.5390486717224121,
0.48410964012145996,
1.156045913696289,
-0.37735819816589355,
-1.0872042179107666,
-0.7553272843360901,
-1.2471282482147217,
-0.7125058770179749,
1.2090256214141846,
0.06527508795261383,
-1.0980652570724487,
0.3079172968864441,
1.5554165840148926,
0.08738017827272415,
-0.1954493224620819,
0.6861885786056519,
0.3648303747177124,
-0.8834775686264038,
-0.17760701477527618,
-0.9183785319328308,
0.5777585506439209,
-0.34498628973960876,
-0.36951082944869995,
0.26626524329185486,
0.4660601317882538,
1.3364777565002441,
-0.0268446933478117,
0.14633910357952118,
1.1923247575759888,
-1.4635350704193115,
1.4723894596099854,
-0.7376741170883179,
0.31586095690727234,
-2.4103102684020996,
1.3650010824203491,
-0.7341845035552979,
1.9597746133804321,
-2.6961960792541504,
0.44621965289115906,
-0.6394689083099365,
-0.4838068187236786,
0.28191229701042175,
-0.2809402048587799,
0.12021328508853912,
-0.10345757752656937,
-1.1529278755187988,
-0.028233451768755913,
-0.7417062520980835,
0.5606459975242615,
1.1814931631088257,
1.3316504955291748,
-1.1636635065078735,
-0.24280305206775665,
-1.6290229558944702,
-0.26185736060142517,
-0.7007074356079102,
0.35132843255996704,
-1.9448848962783813,
-0.1903357207775116,
-1.9298287630081177,
-2.4454894065856934,
-1.1665606498718262,
-0.8148959875106812,
1.1226719617843628,
0.17603853344917297,
-0.8900777697563171,
1.1947646141052246,
-0.35624873638153076,
-1.7695057392120361,
1.0864367485046387,
-2.163372755050659
] |
https://github.com/huggingface/datasets/issues/5081 | Bug loading `sentence-transformers/parallel-sentences` | The dataset is sadly not really compatible to be loaded with `load_dataset`. So far it is better to git clone it and to use the files directly.
A data loading script would be needed to be added to this dataset. But this was too much overhead / not really intuitive how to create it. | ## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("sentence-transformers/parallel-sentences")
```
raises this:
```
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [4], line 1
----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train")
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
1692 # Download and prepare data
-> 1693 builder_instance.download_and_prepare(
1694 download_config=download_config,
1695 download_mode=download_mode,
1696 ignore_verifications=ignore_verifications,
1697 try_from_hf_gcs=try_from_hf_gcs,
1698 use_auth_token=use_auth_token,
1699 )
1701 # Build dataset for splits
1702 keep_in_memory = (
1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
1704 )
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
801 if not downloaded_from_gcs:
802 prepare_split_kwargs = {
803 "file_format": file_format,
804 "max_shard_size": max_shard_size,
805 **download_and_prepare_kwargs,
806 }
--> 807 self._download_and_prepare(
808 dl_manager=dl_manager,
809 verify_infos=verify_infos,
810 **prepare_split_kwargs,
811 **download_and_prepare_kwargs,
812 )
813 # Sync info
814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
894 split_dict.add(split_generator.split_info)
896 try:
897 # Prepare split will record examples associated to the split
--> 898 self._prepare_split(split_generator, **prepare_split_kwargs)
899 except OSError as e:
900 raise OSError(
901 "Cannot find data file. "
902 + (self.manual_download_instructions or "")
903 + "\nOriginal error:\n"
904 + str(e)
905 ) from None
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size)
1506 shard_id += 1
1507 writer = writer_class(
1508 features=writer._features,
1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"),
1510 storage_options=self._fs.storage_options,
1511 embed_local_files=embed_local_files,
1512 )
-> 1513 writer.write_table(table)
1514 finally:
1515 num_shards = shard_id + 1
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size)
538 if self.pa_writer is None:
539 self._build_writer(inferred_schema=pa_table.schema)
--> 540 pa_table = table_cast(pa_table, self._schema)
541 if self.embed_local_files:
542 pa_table = embed_table_storage(pa_table)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema)
2032 """Improved version of pa.Table.cast.
2033
2034 It supports casting to feature types stored in the schema metadata.
(...)
2041 table (:obj:`pyarrow.Table`): the casted table
2042 """
2043 if table.schema != schema:
-> 2044 return cast_table_to_schema(table, schema)
2045 elif table.schema.metadata != schema.metadata:
2046 return table.replace_schema_metadata(schema.metadata)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema)
2003 features = Features.from_arrow_schema(schema)
2004 if sorted(table.column_names) != sorted(features):
-> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
2007 return pa.Table.from_arrays(arrays, schema=schema)
ValueError: Couldn't cast
Action taken on Parliament's resolutions: see Minutes: string
Následný postup na základě usnesení Parlamentu: viz zápis: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742
to
{'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)}
because column names don't match
```
## Expected results
no error
## Actual results
error
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Linux
- Python version: Python 3.9.13
- PyArrow version: pyarrow 9.0.0
- transformers 4.22.2
- datasets 2.5.2 | 491 | 54 | Bug loading `sentence-transformers/parallel-sentences`
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("sentence-transformers/parallel-sentences")
```
raises this:
```
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [4], line 1
----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train")
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
1692 # Download and prepare data
-> 1693 builder_instance.download_and_prepare(
1694 download_config=download_config,
1695 download_mode=download_mode,
1696 ignore_verifications=ignore_verifications,
1697 try_from_hf_gcs=try_from_hf_gcs,
1698 use_auth_token=use_auth_token,
1699 )
1701 # Build dataset for splits
1702 keep_in_memory = (
1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
1704 )
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
801 if not downloaded_from_gcs:
802 prepare_split_kwargs = {
803 "file_format": file_format,
804 "max_shard_size": max_shard_size,
805 **download_and_prepare_kwargs,
806 }
--> 807 self._download_and_prepare(
808 dl_manager=dl_manager,
809 verify_infos=verify_infos,
810 **prepare_split_kwargs,
811 **download_and_prepare_kwargs,
812 )
813 # Sync info
814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
894 split_dict.add(split_generator.split_info)
896 try:
897 # Prepare split will record examples associated to the split
--> 898 self._prepare_split(split_generator, **prepare_split_kwargs)
899 except OSError as e:
900 raise OSError(
901 "Cannot find data file. "
902 + (self.manual_download_instructions or "")
903 + "\nOriginal error:\n"
904 + str(e)
905 ) from None
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size)
1506 shard_id += 1
1507 writer = writer_class(
1508 features=writer._features,
1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"),
1510 storage_options=self._fs.storage_options,
1511 embed_local_files=embed_local_files,
1512 )
-> 1513 writer.write_table(table)
1514 finally:
1515 num_shards = shard_id + 1
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size)
538 if self.pa_writer is None:
539 self._build_writer(inferred_schema=pa_table.schema)
--> 540 pa_table = table_cast(pa_table, self._schema)
541 if self.embed_local_files:
542 pa_table = embed_table_storage(pa_table)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema)
2032 """Improved version of pa.Table.cast.
2033
2034 It supports casting to feature types stored in the schema metadata.
(...)
2041 table (:obj:`pyarrow.Table`): the casted table
2042 """
2043 if table.schema != schema:
-> 2044 return cast_table_to_schema(table, schema)
2045 elif table.schema.metadata != schema.metadata:
2046 return table.replace_schema_metadata(schema.metadata)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema)
2003 features = Features.from_arrow_schema(schema)
2004 if sorted(table.column_names) != sorted(features):
-> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
2007 return pa.Table.from_arrays(arrays, schema=schema)
ValueError: Couldn't cast
Action taken on Parliament's resolutions: see Minutes: string
Následný postup na základě usnesení Parlamentu: viz zápis: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742
to
{'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)}
because column names don't match
```
## Expected results
no error
## Actual results
error
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Linux
- Python version: Python 3.9.13
- PyArrow version: pyarrow 9.0.0
- transformers 4.22.2
- datasets 2.5.2
The dataset is sadly not really compatible to be loaded with `load_dataset`. So far it is better to git clone it and to use the files directly.
A data loading script would be needed to be added to this dataset. But this was too much overhead / not really intuitive how to create it. | [
-1.1607729196548462,
-0.8821344971656799,
-0.5440049171447754,
1.4534788131713867,
0.04094377160072327,
-1.3577572107315063,
0.06716285645961761,
-0.8556927442550659,
1.5331424474716187,
-0.8014310598373413,
0.3368062674999237,
-1.6735560894012451,
-0.09366270899772644,
-0.6138854622840881,
-0.5950754880905151,
-0.6831291913986206,
-0.30963295698165894,
-0.7486061453819275,
1.1023167371749878,
2.398585319519043,
1.2118858098983765,
-1.3552902936935425,
2.8708553314208984,
0.6294194459915161,
-0.2638089060783386,
-0.8095683455467224,
0.37454164028167725,
-0.061835892498493195,
-1.3963788747787476,
-0.2799552381038666,
-0.9708189964294434,
-0.013021350838243961,
-0.7438075542449951,
-0.4452950954437256,
0.09665835648775101,
0.4958205819129944,
-0.25083693861961365,
-0.35044294595718384,
-0.48993533849716187,
-0.781643271446228,
0.6320759654045105,
-0.22998717427253723,
0.8762193322181702,
-0.3088870346546173,
1.7954128980636597,
-0.664283275604248,
0.48142674565315247,
0.5770856738090515,
1.2200980186462402,
0.2009754329919815,
0.024623507633805275,
0.3952481150627136,
0.20266154408454895,
-0.029476461932063103,
0.6813179850578308,
1.2462027072906494,
0.6170371174812317,
0.5490838289260864,
0.6951783895492554,
-2.2074904441833496,
1.3660156726837158,
-0.7546902894973755,
0.15930242836475372,
1.339640498161316,
-0.9945853352546692,
0.4561432898044586,
-1.8804855346679688,
-0.12985455989837646,
0.41642358899116516,
-2.243361711502075,
0.13057290017604828,
-1.264999270439148,
-0.5382556915283203,
0.9753740429878235,
0.3487871587276459,
-1.254485011100769,
0.024273673072457314,
-0.45619356632232666,
1.017439842224121,
0.38952019810676575,
1.0810333490371704,
-1.6091265678405762,
0.07416466623544693,
-0.10022076964378357,
0.34826111793518066,
-1.1725455522537231,
-1.6598156690597534,
0.6275768280029297,
0.5841553211212158,
0.7486143112182617,
-0.1281232088804245,
0.9245271682739258,
-1.152008295059204,
0.8701072931289673,
-0.9909219741821289,
-1.7078399658203125,
-1.3212313652038574,
-2.5293080806732178,
-2.4387102127075195,
0.8406350612640381,
-0.4293716251850128,
-0.34340181946754456,
2.0434069633483887,
-1.1373467445373535,
-1.7181628942489624,
1.0111002922058105,
0.30582621693611145,
-0.028882211074233055,
2.3612170219421387,
0.21776948869228363,
-0.9744910597801208,
0.7716489434242249,
-0.8914586305618286,
0.6756870150566101,
-0.3041660189628601,
1.2611899375915527,
0.41043874621391296,
-1.09392249584198,
1.5876736640930176,
-0.4827117919921875,
0.5492165088653564,
-0.6944707632064819,
-0.4522937834262848,
-0.5704922676086426,
0.14395421743392944,
1.9144011735916138,
-0.1515677273273468,
1.511206030845642,
-0.17043721675872803,
-1.4356852769851685,
-1.3782976865768433,
0.7554053664207458,
0.43585526943206787,
-0.8789121508598328,
0.18071871995925903,
-0.44553428888320923,
0.1305457204580307,
0.16197527945041656,
1.099850058555603,
1.232969880104065,
0.7448853850364685,
-0.1670239269733429,
-0.8482081890106201,
0.07618940621614456,
-0.11996407061815262,
-0.5044555068016052,
-1.7753862142562866,
-0.26957136392593384,
0.2257840633392334,
0.6767544746398926,
-1.2410577535629272,
2.0238614082336426,
0.8736896514892578,
2.069153070449829,
1.0275322198867798,
-0.3388373851776123,
1.5022906064987183,
0.06494046002626419,
1.9331603050231934,
-0.31136128306388855,
0.5942142009735107,
-0.5248441696166992,
-1.20709228515625,
0.6719326972961426,
-0.3905032277107239,
-1.990591049194336,
-0.43823590874671936,
-0.8558007478713989,
-0.12912701070308685,
-0.8585320711135864,
0.9881439208984375,
-0.1856396645307541,
-1.4393095970153809,
0.16072019934654236,
-0.6713976263999939,
0.19908781349658966,
-1.334209680557251,
0.25880900025367737,
0.7463904619216919,
-0.7926624417304993,
0.045744337141513824,
-0.4664824306964874,
-1.3919482231140137,
-0.6740078926086426,
0.5508342981338501,
1.814492106437683,
-0.6232456564903259,
1.000312328338623,
1.0515787601470947,
-0.623693585395813,
-0.038559116423130035,
0.4805496037006378,
-0.39618244767189026,
0.8355808854103088,
-1.0045417547225952,
-0.46483418345451355,
1.1157854795455933,
-0.35532182455062866,
-0.5617885589599609,
1.320908784866333,
0.7435839176177979,
-1.0504792928695679,
-0.3373887240886688,
-0.1702519953250885,
-0.8801996111869812,
0.03854934126138687,
-1.5435476303100586,
-0.09836166352033615,
0.28297632932662964,
-1.4990969896316528,
-0.35515913367271423,
0.01712971366941929,
1.3106437921524048,
-0.051186732947826385,
1.337631106376648,
-0.24239613115787506,
-0.12726014852523804,
-0.5051954984664917,
-0.623937726020813,
0.1426246017217636,
-0.08519873023033142,
-0.6026522517204285,
0.2735016345977783,
-0.7513298988342285,
0.16753394901752472,
1.484082579612732,
0.23394201695919037,
0.05613318085670471,
0.4708005487918854,
1.2822505235671997,
0.33458632230758667,
-0.12433266639709473,
-0.8159877061843872,
-1.6978050470352173,
2.001368284225464,
-1.5849405527114868,
1.9012515544891357,
0.7905646562576294,
-0.08221836388111115,
-1.831676959991455,
-1.7972127199172974,
1.4172390699386597,
1.1554471254348755,
2.5022006034851074,
0.5656771659851074,
0.4397628605365753,
-0.8143517374992371,
-0.7302150726318359,
0.5021730065345764,
-0.7159650921821594,
-0.8436433672904968,
0.15343615412712097,
2.3307101726531982,
1.708558201789856,
-0.3732961416244507,
-0.1972811222076416,
-0.9047452807426453,
1.3908637762069702,
-0.33648163080215454,
0.2948516309261322,
1.8993326425552368,
-0.4454544484615326,
-0.9970986247062683,
1.3910863399505615,
-2.4412710666656494,
0.374749094247818,
2.0853400230407715,
0.34447088837623596,
0.09546546638011932,
-1.1640629768371582,
-0.7377153635025024,
-0.15802809596061707,
-0.44120216369628906,
-1.204187035560608,
0.43501949310302734,
-0.25622686743736267,
-0.8229808807373047,
-1.3637855052947998,
-0.02998727560043335,
-1.2086673974990845,
-1.7207586765289307,
0.3211813271045685,
1.779596209526062,
2.2825067043304443,
-0.7894519567489624,
1.2884538173675537,
-0.26146799325942993,
0.2188761681318283,
1.2484849691390991,
1.3746684789657593,
3.26606822013855,
1.8862957954406738,
-1.2395974397659302,
0.7149963974952698,
-0.16541115939617157,
-0.5625905990600586,
1.183849573135376,
-1.0467537641525269,
1.1472523212432861,
-0.29186511039733887,
-1.339465618133545,
-1.2241556644439697,
0.9558612704277039,
0.4473273754119873,
-0.034883614629507065,
-0.46810203790664673,
1.1212223768234253,
0.20736029744148254,
1.284394383430481,
0.6393507122993469,
-0.3061687648296356,
0.4279739260673523,
-0.33727243542671204,
-0.6164606213569641,
1.584937572479248,
0.07449590414762497,
-1.5548888444900513,
-2.3618390560150146,
-0.13739535212516785,
-1.075203537940979,
-0.02642161026597023,
-0.9291841387748718,
-1.0235954523086548,
1.4274156093597412,
0.4422476887702942,
-0.9397797584533691,
-0.0760820060968399,
-0.36725711822509766,
-0.5423033237457275,
2.600759744644165,
-1.353159785270691,
-0.2080712616443634,
-0.9523168802261353,
-0.5788541436195374,
1.5537776947021484,
-1.1886602640151978,
-0.2961878180503845,
-1.0367615222930908,
-0.5460045337677002,
-1.2502491474151611,
-0.36337810754776,
-0.10624347627162933,
-0.8499171137809753,
0.7033047080039978,
0.019891060888767242,
-1.2495888471603394,
-0.24726064503192902,
-1.1468086242675781,
0.9105817675590515,
-0.2613566517829895,
0.11178596317768097,
1.6585278511047363,
0.24027714133262634,
-0.4599626362323761,
0.8276284337043762,
1.3380146026611328,
0.6319798231124878,
-0.5404995679855347,
0.11888440698385239,
-0.6436122059822083,
0.5453301668167114,
-1.2406928539276123,
0.34741687774658203,
-3.020751714706421,
0.6945691108703613,
0.00889497995376587,
-0.11139766126871109,
-0.17944371700286865,
-1.5158042907714844,
0.9340871572494507,
2.410982608795166,
-1.1596834659576416,
0.6520914435386658,
0.3758067488670349,
1.1554408073425293,
-1.6687690019607544,
-0.04254718869924545,
-0.7206392288208008,
2.043369770050049,
-0.035869866609573364,
1.0822824239730835,
-0.5598179697990417,
-2.348196268081665,
0.5614848732948303,
-1.2053242921829224,
-0.9004548192024231,
0.844582200050354,
-0.9017813801765442,
0.3870188295841217,
-1.1347098350524902,
-0.10036981105804443,
-0.9199352860450745,
-1.1531741619110107,
0.488677978515625,
0.020916668698191643,
0.6130759119987488,
-0.5331860184669495,
0.2876741588115692,
-2.308885335922241,
-1.4163657426834106,
-0.11198046058416367,
-0.9402047395706177,
0.5830062627792358,
-0.46941077709198,
0.6662108302116394,
-0.07094965130090714,
0.038570523262023926,
0.2141619175672531,
1.513673186302185,
3.1961045265197754,
-0.007147951051592827,
0.28605398535728455,
-0.23437727987766266,
-1.0574040412902832,
1.550447702407837,
0.902021586894989,
-0.2676921486854553,
-0.554551362991333,
-0.9227903485298157,
1.4096827507019043,
1.9074478149414062,
1.1009228229522705,
0.10625874251127243,
-0.9450398683547974,
-0.7796695828437805,
0.1597955971956253,
0.15419532358646393,
0.4871352016925812,
0.9926089644432068,
0.15802797675132751,
0.18899913132190704,
1.2986781597137451,
1.021227478981018,
-0.268018513917923,
0.4779881536960602,
-0.8516111373901367,
-0.3554612994194031,
0.5167833566665649,
0.27127036452293396,
-0.0070333331823349,
0.2967013120651245,
-1.0209298133850098,
-0.14441320300102234,
-0.23085276782512665,
-0.7956777215003967,
-0.7694410085678101,
-0.39154452085494995,
-0.45592209696769714,
1.6915968656539917,
-0.05038570612668991,
-0.5666322112083435,
0.04596410691738129,
-0.7929159998893738,
-0.1382739096879959,
-1.0477283000946045,
0.2487080693244934,
-0.09601143002510071,
0.05437315255403519,
-0.23847033083438873,
1.59941565990448,
-0.9751170873641968,
-2.2346160411834717,
0.11177287250757217,
0.3065200448036194,
-0.2943721413612366,
-0.146977499127388,
1.8353487253189087,
0.45793861150741577,
1.3570629358291626,
1.5345275402069092,
1.0848805904388428,
-0.5783596634864807,
-1.2962243556976318,
0.7395602464675903,
0.9476937055587769,
-1.3273673057556152,
0.9690961241722107,
-0.295236736536026,
-0.5673539638519287,
0.5574313402175903,
1.3155642747879028,
0.43092721700668335,
-1.9230172634124756,
0.8828601241111755,
-1.2091889381408691,
0.9573650360107422,
0.8634772896766663,
0.8633608818054199,
0.16329975426197052,
0.8961958885192871,
-1.2571382522583008,
-1.047377586364746,
-0.5584021806716919,
-0.7238165140151978,
1.7751601934432983,
-0.30972209572792053,
0.3700762093067169,
-0.2451978623867035,
-1.2481763362884521,
0.05596177279949188,
0.7348904013633728,
0.3677845597267151,
-0.29074954986572266,
0.8113027811050415,
-0.735190749168396,
-1.0045208930969238,
-1.257240891456604,
-0.40155351161956787,
-1.0499851703643799,
-0.8625690937042236,
0.9966345429420471,
0.7386451363563538,
0.5550764799118042,
1.9738481044769287,
0.7118909955024719,
0.30111247301101685,
-2.5777361392974854,
0.7949860095977783,
0.3442125618457794,
-0.11321406066417694,
0.8516546487808228,
0.2887501120567322,
1.293009638786316,
-0.14136497676372528,
0.6108810305595398,
-2.3350491523742676,
2.2270429134368896,
-0.1746489703655243,
0.6989765763282776,
0.0393403023481369,
0.04542244225740433,
1.0152417421340942,
0.5228610038757324,
0.5158514380455017,
-1.1054234504699707,
0.9393267631530762,
-0.5121702551841736,
1.1126034259796143,
0.7939541339874268,
-0.952103316783905,
0.191393181681633,
1.2230110168457031,
0.36035847663879395,
-0.5350584983825684,
-1.087412714958191,
-0.7962648868560791,
0.9342083930969238,
1.6937237977981567,
0.034807756543159485,
0.07737456262111664,
0.8300639986991882,
0.7370695471763611,
-1.26002836227417,
-0.009052280336618423,
-0.4607684016227722,
-0.6446474194526672,
1.852189064025879,
2.0386126041412354,
-0.03280007839202881,
-0.003326933365315199,
-0.709247887134552,
-1.466346025466919,
0.8232996463775635,
0.14868341386318207,
-0.10673912614583969,
0.7464518547058105,
-0.682584285736084,
1.1407139301300049,
0.7264236211776733,
0.8358261585235596,
0.16523723304271698,
0.03686923533678055,
0.2074085921049118,
-0.2607612609863281,
-1.1987898349761963,
-0.38411810994148254,
-1.0161011219024658,
-2.630282402038574,
0.3458617031574249,
-0.2524752914905548,
-1.5209577083587646,
0.21103984117507935,
-0.9694729447364807,
0.717745840549469,
-0.5443626046180725,
-1.2185015678405762,
-1.3375681638717651,
0.31882786750793457,
-0.1412394642829895,
0.8167793154716492,
-1.6601893901824951,
-0.19902653992176056,
1.1037116050720215,
0.9414132833480835,
-0.6570442318916321,
0.884196400642395,
0.3150012493133545,
0.8986225724220276,
0.8811023831367493,
-0.40465211868286133,
0.4906463623046875,
0.2695247232913971,
-1.3696624040603638,
0.3096543550491333,
1.4145495891571045,
0.10726837813854218,
1.3049769401550293,
-0.3858179450035095,
0.03103581629693508,
0.41188332438468933,
-0.35681629180908203,
-0.5885670185089111,
-0.6551402807235718,
0.6505625247955322,
-0.11365880817174911,
-0.970037043094635,
-0.17195788025856018,
0.03840373456478119,
-0.20690909028053284,
0.2866816520690918,
-1.5037986040115356,
-0.15463963150978088,
-0.46768683195114136,
-0.6048100590705872,
-1.4411952495574951,
-0.023322168737649918,
1.2851678133010864,
-0.8356654644012451,
-0.09331055730581284,
0.5978567600250244,
0.2355591356754303,
0.5275699496269226,
0.6865015029907227,
-0.7825233936309814,
-0.17197024822235107,
-0.16094346344470978,
-0.32623642683029175,
0.297749787569046,
1.2336444854736328,
-0.062060415744781494,
-0.9853434562683105,
0.5007516145706177,
-0.2213682234287262,
0.23842033743858337,
1.9194055795669556,
-0.011262977495789528,
-0.8396544456481934,
0.33594661951065063,
-0.8431873917579651,
1.8322840929031372,
1.625205159187317,
1.3007586002349854,
-0.06077677756547928,
-0.8925566077232361,
0.6467018723487854,
-0.27913331985473633,
-0.32210421562194824,
0.9480208158493042,
0.3419659733772278,
-0.3573186993598938,
-1.3912091255187988,
0.7772976160049438,
1.237801432609558,
-0.6863256096839905,
-0.7399165630340576,
0.09559184312820435,
-0.8800296783447266,
1.276536226272583,
0.5592657923698425,
0.2834542989730835,
0.3307764232158661,
1.620394229888916,
0.7673918008804321,
-0.5593752861022949,
0.5098703503608704,
0.5005524754524231,
-0.20193035900592804,
-1.9855955839157104,
-1.1210813522338867,
0.27498871088027954,
-0.4495670199394226,
-1.5097697973251343,
1.4081804752349854,
-1.2526235580444336,
-1.0111383199691772,
0.6137832999229431,
0.10769783705472946,
1.224229097366333,
0.2902431786060333,
1.7219237089157104,
1.9879988431930542,
0.9022790789604187,
0.510475218296051,
1.110407829284668,
-0.2704068124294281,
-0.21948708593845367,
1.6824086904525757,
-0.4861108362674713,
0.6852375864982605,
1.0120024681091309,
-0.4814964234828949,
-1.252383828163147,
-0.8159440755844116,
-1.138954997062683,
-0.7322105169296265,
1.0199682712554932,
0.1717785894870758,
-1.0681838989257812,
0.31891417503356934,
1.6260918378829956,
0.037482455372810364,
-0.013000557199120522,
0.6667510271072388,
0.3542215824127197,
-0.7111058235168457,
-0.06409908086061478,
-1.0795835256576538,
0.6808148622512817,
-0.33516010642051697,
-0.36760422587394714,
0.11563677340745926,
0.6363316178321838,
1.180302619934082,
0.12174301594495773,
0.13493162393569946,
1.3067171573638916,
-1.3900039196014404,
1.2356938123703003,
-1.0254521369934082,
0.41896843910217285,
-2.2918479442596436,
1.4250742197036743,
-0.9374072551727295,
1.9764130115509033,
-2.6355533599853516,
0.49498605728149414,
-0.494548499584198,
-0.6598277688026428,
0.1766606867313385,
-0.16724860668182373,
0.11258301138877869,
-0.04444166272878647,
-0.971718430519104,
-0.13086648285388947,
-0.8682445287704468,
0.4369165599346161,
1.2777036428451538,
1.4095808267593384,
-0.9585288763046265,
-0.31435757875442505,
-1.5961378812789917,
-0.1849396824836731,
-0.5297658443450928,
0.18482112884521484,
-1.7263538837432861,
-0.1719442456960678,
-2.083515167236328,
-2.414438009262085,
-1.3306190967559814,
-1.0069478750228882,
1.3491467237472534,
0.16889353096485138,
-1.0111829042434692,
1.2029330730438232,
-0.44733068346977234,
-1.725719690322876,
1.2462425231933594,
-2.238295078277588
] |
https://github.com/huggingface/datasets/issues/5081 | Bug loading `sentence-transformers/parallel-sentences` | Since the dataset is a bunch of TSVs we should not need a dataset script I think.
By default it tries to load all the TSVs at once, which fails here because they don't all have the same columns (pd.read_csv uses the first line as header by default). But those files have no header ! So, to properly load any TSV file in this repo, one has to pass `names=[...]` for pd.read_csv to know which column names to use.
To fix this situation, we can either do
1. replace the TSVs by TSV with column names
2. OR specify the pd.read_csv kwargs as YAML in the dataset card - and `datasets` would use that by default
WDTY ? | ## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("sentence-transformers/parallel-sentences")
```
raises this:
```
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [4], line 1
----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train")
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
1692 # Download and prepare data
-> 1693 builder_instance.download_and_prepare(
1694 download_config=download_config,
1695 download_mode=download_mode,
1696 ignore_verifications=ignore_verifications,
1697 try_from_hf_gcs=try_from_hf_gcs,
1698 use_auth_token=use_auth_token,
1699 )
1701 # Build dataset for splits
1702 keep_in_memory = (
1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
1704 )
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
801 if not downloaded_from_gcs:
802 prepare_split_kwargs = {
803 "file_format": file_format,
804 "max_shard_size": max_shard_size,
805 **download_and_prepare_kwargs,
806 }
--> 807 self._download_and_prepare(
808 dl_manager=dl_manager,
809 verify_infos=verify_infos,
810 **prepare_split_kwargs,
811 **download_and_prepare_kwargs,
812 )
813 # Sync info
814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
894 split_dict.add(split_generator.split_info)
896 try:
897 # Prepare split will record examples associated to the split
--> 898 self._prepare_split(split_generator, **prepare_split_kwargs)
899 except OSError as e:
900 raise OSError(
901 "Cannot find data file. "
902 + (self.manual_download_instructions or "")
903 + "\nOriginal error:\n"
904 + str(e)
905 ) from None
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size)
1506 shard_id += 1
1507 writer = writer_class(
1508 features=writer._features,
1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"),
1510 storage_options=self._fs.storage_options,
1511 embed_local_files=embed_local_files,
1512 )
-> 1513 writer.write_table(table)
1514 finally:
1515 num_shards = shard_id + 1
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size)
538 if self.pa_writer is None:
539 self._build_writer(inferred_schema=pa_table.schema)
--> 540 pa_table = table_cast(pa_table, self._schema)
541 if self.embed_local_files:
542 pa_table = embed_table_storage(pa_table)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema)
2032 """Improved version of pa.Table.cast.
2033
2034 It supports casting to feature types stored in the schema metadata.
(...)
2041 table (:obj:`pyarrow.Table`): the casted table
2042 """
2043 if table.schema != schema:
-> 2044 return cast_table_to_schema(table, schema)
2045 elif table.schema.metadata != schema.metadata:
2046 return table.replace_schema_metadata(schema.metadata)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema)
2003 features = Features.from_arrow_schema(schema)
2004 if sorted(table.column_names) != sorted(features):
-> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
2007 return pa.Table.from_arrays(arrays, schema=schema)
ValueError: Couldn't cast
Action taken on Parliament's resolutions: see Minutes: string
Následný postup na základě usnesení Parlamentu: viz zápis: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742
to
{'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)}
because column names don't match
```
## Expected results
no error
## Actual results
error
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Linux
- Python version: Python 3.9.13
- PyArrow version: pyarrow 9.0.0
- transformers 4.22.2
- datasets 2.5.2 | 491 | 118 | Bug loading `sentence-transformers/parallel-sentences`
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("sentence-transformers/parallel-sentences")
```
raises this:
```
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [4], line 1
----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train")
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
1692 # Download and prepare data
-> 1693 builder_instance.download_and_prepare(
1694 download_config=download_config,
1695 download_mode=download_mode,
1696 ignore_verifications=ignore_verifications,
1697 try_from_hf_gcs=try_from_hf_gcs,
1698 use_auth_token=use_auth_token,
1699 )
1701 # Build dataset for splits
1702 keep_in_memory = (
1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
1704 )
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
801 if not downloaded_from_gcs:
802 prepare_split_kwargs = {
803 "file_format": file_format,
804 "max_shard_size": max_shard_size,
805 **download_and_prepare_kwargs,
806 }
--> 807 self._download_and_prepare(
808 dl_manager=dl_manager,
809 verify_infos=verify_infos,
810 **prepare_split_kwargs,
811 **download_and_prepare_kwargs,
812 )
813 # Sync info
814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
894 split_dict.add(split_generator.split_info)
896 try:
897 # Prepare split will record examples associated to the split
--> 898 self._prepare_split(split_generator, **prepare_split_kwargs)
899 except OSError as e:
900 raise OSError(
901 "Cannot find data file. "
902 + (self.manual_download_instructions or "")
903 + "\nOriginal error:\n"
904 + str(e)
905 ) from None
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size)
1506 shard_id += 1
1507 writer = writer_class(
1508 features=writer._features,
1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"),
1510 storage_options=self._fs.storage_options,
1511 embed_local_files=embed_local_files,
1512 )
-> 1513 writer.write_table(table)
1514 finally:
1515 num_shards = shard_id + 1
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size)
538 if self.pa_writer is None:
539 self._build_writer(inferred_schema=pa_table.schema)
--> 540 pa_table = table_cast(pa_table, self._schema)
541 if self.embed_local_files:
542 pa_table = embed_table_storage(pa_table)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema)
2032 """Improved version of pa.Table.cast.
2033
2034 It supports casting to feature types stored in the schema metadata.
(...)
2041 table (:obj:`pyarrow.Table`): the casted table
2042 """
2043 if table.schema != schema:
-> 2044 return cast_table_to_schema(table, schema)
2045 elif table.schema.metadata != schema.metadata:
2046 return table.replace_schema_metadata(schema.metadata)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema)
2003 features = Features.from_arrow_schema(schema)
2004 if sorted(table.column_names) != sorted(features):
-> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
2007 return pa.Table.from_arrays(arrays, schema=schema)
ValueError: Couldn't cast
Action taken on Parliament's resolutions: see Minutes: string
Následný postup na základě usnesení Parlamentu: viz zápis: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742
to
{'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)}
because column names don't match
```
## Expected results
no error
## Actual results
error
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Linux
- Python version: Python 3.9.13
- PyArrow version: pyarrow 9.0.0
- transformers 4.22.2
- datasets 2.5.2
Since the dataset is a bunch of TSVs we should not need a dataset script I think.
By default it tries to load all the TSVs at once, which fails here because they don't all have the same columns (pd.read_csv uses the first line as header by default). But those files have no header ! So, to properly load any TSV file in this repo, one has to pass `names=[...]` for pd.read_csv to know which column names to use.
To fix this situation, we can either do
1. replace the TSVs by TSV with column names
2. OR specify the pd.read_csv kwargs as YAML in the dataset card - and `datasets` would use that by default
WDTY ? | [
-1.1607729196548462,
-0.8821344971656799,
-0.5440049171447754,
1.4534788131713867,
0.04094377160072327,
-1.3577572107315063,
0.06716285645961761,
-0.8556927442550659,
1.5331424474716187,
-0.8014310598373413,
0.3368062674999237,
-1.6735560894012451,
-0.09366270899772644,
-0.6138854622840881,
-0.5950754880905151,
-0.6831291913986206,
-0.30963295698165894,
-0.7486061453819275,
1.1023167371749878,
2.398585319519043,
1.2118858098983765,
-1.3552902936935425,
2.8708553314208984,
0.6294194459915161,
-0.2638089060783386,
-0.8095683455467224,
0.37454164028167725,
-0.061835892498493195,
-1.3963788747787476,
-0.2799552381038666,
-0.9708189964294434,
-0.013021350838243961,
-0.7438075542449951,
-0.4452950954437256,
0.09665835648775101,
0.4958205819129944,
-0.25083693861961365,
-0.35044294595718384,
-0.48993533849716187,
-0.781643271446228,
0.6320759654045105,
-0.22998717427253723,
0.8762193322181702,
-0.3088870346546173,
1.7954128980636597,
-0.664283275604248,
0.48142674565315247,
0.5770856738090515,
1.2200980186462402,
0.2009754329919815,
0.024623507633805275,
0.3952481150627136,
0.20266154408454895,
-0.029476461932063103,
0.6813179850578308,
1.2462027072906494,
0.6170371174812317,
0.5490838289260864,
0.6951783895492554,
-2.2074904441833496,
1.3660156726837158,
-0.7546902894973755,
0.15930242836475372,
1.339640498161316,
-0.9945853352546692,
0.4561432898044586,
-1.8804855346679688,
-0.12985455989837646,
0.41642358899116516,
-2.243361711502075,
0.13057290017604828,
-1.264999270439148,
-0.5382556915283203,
0.9753740429878235,
0.3487871587276459,
-1.254485011100769,
0.024273673072457314,
-0.45619356632232666,
1.017439842224121,
0.38952019810676575,
1.0810333490371704,
-1.6091265678405762,
0.07416466623544693,
-0.10022076964378357,
0.34826111793518066,
-1.1725455522537231,
-1.6598156690597534,
0.6275768280029297,
0.5841553211212158,
0.7486143112182617,
-0.1281232088804245,
0.9245271682739258,
-1.152008295059204,
0.8701072931289673,
-0.9909219741821289,
-1.7078399658203125,
-1.3212313652038574,
-2.5293080806732178,
-2.4387102127075195,
0.8406350612640381,
-0.4293716251850128,
-0.34340181946754456,
2.0434069633483887,
-1.1373467445373535,
-1.7181628942489624,
1.0111002922058105,
0.30582621693611145,
-0.028882211074233055,
2.3612170219421387,
0.21776948869228363,
-0.9744910597801208,
0.7716489434242249,
-0.8914586305618286,
0.6756870150566101,
-0.3041660189628601,
1.2611899375915527,
0.41043874621391296,
-1.09392249584198,
1.5876736640930176,
-0.4827117919921875,
0.5492165088653564,
-0.6944707632064819,
-0.4522937834262848,
-0.5704922676086426,
0.14395421743392944,
1.9144011735916138,
-0.1515677273273468,
1.511206030845642,
-0.17043721675872803,
-1.4356852769851685,
-1.3782976865768433,
0.7554053664207458,
0.43585526943206787,
-0.8789121508598328,
0.18071871995925903,
-0.44553428888320923,
0.1305457204580307,
0.16197527945041656,
1.099850058555603,
1.232969880104065,
0.7448853850364685,
-0.1670239269733429,
-0.8482081890106201,
0.07618940621614456,
-0.11996407061815262,
-0.5044555068016052,
-1.7753862142562866,
-0.26957136392593384,
0.2257840633392334,
0.6767544746398926,
-1.2410577535629272,
2.0238614082336426,
0.8736896514892578,
2.069153070449829,
1.0275322198867798,
-0.3388373851776123,
1.5022906064987183,
0.06494046002626419,
1.9331603050231934,
-0.31136128306388855,
0.5942142009735107,
-0.5248441696166992,
-1.20709228515625,
0.6719326972961426,
-0.3905032277107239,
-1.990591049194336,
-0.43823590874671936,
-0.8558007478713989,
-0.12912701070308685,
-0.8585320711135864,
0.9881439208984375,
-0.1856396645307541,
-1.4393095970153809,
0.16072019934654236,
-0.6713976263999939,
0.19908781349658966,
-1.334209680557251,
0.25880900025367737,
0.7463904619216919,
-0.7926624417304993,
0.045744337141513824,
-0.4664824306964874,
-1.3919482231140137,
-0.6740078926086426,
0.5508342981338501,
1.814492106437683,
-0.6232456564903259,
1.000312328338623,
1.0515787601470947,
-0.623693585395813,
-0.038559116423130035,
0.4805496037006378,
-0.39618244767189026,
0.8355808854103088,
-1.0045417547225952,
-0.46483418345451355,
1.1157854795455933,
-0.35532182455062866,
-0.5617885589599609,
1.320908784866333,
0.7435839176177979,
-1.0504792928695679,
-0.3373887240886688,
-0.1702519953250885,
-0.8801996111869812,
0.03854934126138687,
-1.5435476303100586,
-0.09836166352033615,
0.28297632932662964,
-1.4990969896316528,
-0.35515913367271423,
0.01712971366941929,
1.3106437921524048,
-0.051186732947826385,
1.337631106376648,
-0.24239613115787506,
-0.12726014852523804,
-0.5051954984664917,
-0.623937726020813,
0.1426246017217636,
-0.08519873023033142,
-0.6026522517204285,
0.2735016345977783,
-0.7513298988342285,
0.16753394901752472,
1.484082579612732,
0.23394201695919037,
0.05613318085670471,
0.4708005487918854,
1.2822505235671997,
0.33458632230758667,
-0.12433266639709473,
-0.8159877061843872,
-1.6978050470352173,
2.001368284225464,
-1.5849405527114868,
1.9012515544891357,
0.7905646562576294,
-0.08221836388111115,
-1.831676959991455,
-1.7972127199172974,
1.4172390699386597,
1.1554471254348755,
2.5022006034851074,
0.5656771659851074,
0.4397628605365753,
-0.8143517374992371,
-0.7302150726318359,
0.5021730065345764,
-0.7159650921821594,
-0.8436433672904968,
0.15343615412712097,
2.3307101726531982,
1.708558201789856,
-0.3732961416244507,
-0.1972811222076416,
-0.9047452807426453,
1.3908637762069702,
-0.33648163080215454,
0.2948516309261322,
1.8993326425552368,
-0.4454544484615326,
-0.9970986247062683,
1.3910863399505615,
-2.4412710666656494,
0.374749094247818,
2.0853400230407715,
0.34447088837623596,
0.09546546638011932,
-1.1640629768371582,
-0.7377153635025024,
-0.15802809596061707,
-0.44120216369628906,
-1.204187035560608,
0.43501949310302734,
-0.25622686743736267,
-0.8229808807373047,
-1.3637855052947998,
-0.02998727560043335,
-1.2086673974990845,
-1.7207586765289307,
0.3211813271045685,
1.779596209526062,
2.2825067043304443,
-0.7894519567489624,
1.2884538173675537,
-0.26146799325942993,
0.2188761681318283,
1.2484849691390991,
1.3746684789657593,
3.26606822013855,
1.8862957954406738,
-1.2395974397659302,
0.7149963974952698,
-0.16541115939617157,
-0.5625905990600586,
1.183849573135376,
-1.0467537641525269,
1.1472523212432861,
-0.29186511039733887,
-1.339465618133545,
-1.2241556644439697,
0.9558612704277039,
0.4473273754119873,
-0.034883614629507065,
-0.46810203790664673,
1.1212223768234253,
0.20736029744148254,
1.284394383430481,
0.6393507122993469,
-0.3061687648296356,
0.4279739260673523,
-0.33727243542671204,
-0.6164606213569641,
1.584937572479248,
0.07449590414762497,
-1.5548888444900513,
-2.3618390560150146,
-0.13739535212516785,
-1.075203537940979,
-0.02642161026597023,
-0.9291841387748718,
-1.0235954523086548,
1.4274156093597412,
0.4422476887702942,
-0.9397797584533691,
-0.0760820060968399,
-0.36725711822509766,
-0.5423033237457275,
2.600759744644165,
-1.353159785270691,
-0.2080712616443634,
-0.9523168802261353,
-0.5788541436195374,
1.5537776947021484,
-1.1886602640151978,
-0.2961878180503845,
-1.0367615222930908,
-0.5460045337677002,
-1.2502491474151611,
-0.36337810754776,
-0.10624347627162933,
-0.8499171137809753,
0.7033047080039978,
0.019891060888767242,
-1.2495888471603394,
-0.24726064503192902,
-1.1468086242675781,
0.9105817675590515,
-0.2613566517829895,
0.11178596317768097,
1.6585278511047363,
0.24027714133262634,
-0.4599626362323761,
0.8276284337043762,
1.3380146026611328,
0.6319798231124878,
-0.5404995679855347,
0.11888440698385239,
-0.6436122059822083,
0.5453301668167114,
-1.2406928539276123,
0.34741687774658203,
-3.020751714706421,
0.6945691108703613,
0.00889497995376587,
-0.11139766126871109,
-0.17944371700286865,
-1.5158042907714844,
0.9340871572494507,
2.410982608795166,
-1.1596834659576416,
0.6520914435386658,
0.3758067488670349,
1.1554408073425293,
-1.6687690019607544,
-0.04254718869924545,
-0.7206392288208008,
2.043369770050049,
-0.035869866609573364,
1.0822824239730835,
-0.5598179697990417,
-2.348196268081665,
0.5614848732948303,
-1.2053242921829224,
-0.9004548192024231,
0.844582200050354,
-0.9017813801765442,
0.3870188295841217,
-1.1347098350524902,
-0.10036981105804443,
-0.9199352860450745,
-1.1531741619110107,
0.488677978515625,
0.020916668698191643,
0.6130759119987488,
-0.5331860184669495,
0.2876741588115692,
-2.308885335922241,
-1.4163657426834106,
-0.11198046058416367,
-0.9402047395706177,
0.5830062627792358,
-0.46941077709198,
0.6662108302116394,
-0.07094965130090714,
0.038570523262023926,
0.2141619175672531,
1.513673186302185,
3.1961045265197754,
-0.007147951051592827,
0.28605398535728455,
-0.23437727987766266,
-1.0574040412902832,
1.550447702407837,
0.902021586894989,
-0.2676921486854553,
-0.554551362991333,
-0.9227903485298157,
1.4096827507019043,
1.9074478149414062,
1.1009228229522705,
0.10625874251127243,
-0.9450398683547974,
-0.7796695828437805,
0.1597955971956253,
0.15419532358646393,
0.4871352016925812,
0.9926089644432068,
0.15802797675132751,
0.18899913132190704,
1.2986781597137451,
1.021227478981018,
-0.268018513917923,
0.4779881536960602,
-0.8516111373901367,
-0.3554612994194031,
0.5167833566665649,
0.27127036452293396,
-0.0070333331823349,
0.2967013120651245,
-1.0209298133850098,
-0.14441320300102234,
-0.23085276782512665,
-0.7956777215003967,
-0.7694410085678101,
-0.39154452085494995,
-0.45592209696769714,
1.6915968656539917,
-0.05038570612668991,
-0.5666322112083435,
0.04596410691738129,
-0.7929159998893738,
-0.1382739096879959,
-1.0477283000946045,
0.2487080693244934,
-0.09601143002510071,
0.05437315255403519,
-0.23847033083438873,
1.59941565990448,
-0.9751170873641968,
-2.2346160411834717,
0.11177287250757217,
0.3065200448036194,
-0.2943721413612366,
-0.146977499127388,
1.8353487253189087,
0.45793861150741577,
1.3570629358291626,
1.5345275402069092,
1.0848805904388428,
-0.5783596634864807,
-1.2962243556976318,
0.7395602464675903,
0.9476937055587769,
-1.3273673057556152,
0.9690961241722107,
-0.295236736536026,
-0.5673539638519287,
0.5574313402175903,
1.3155642747879028,
0.43092721700668335,
-1.9230172634124756,
0.8828601241111755,
-1.2091889381408691,
0.9573650360107422,
0.8634772896766663,
0.8633608818054199,
0.16329975426197052,
0.8961958885192871,
-1.2571382522583008,
-1.047377586364746,
-0.5584021806716919,
-0.7238165140151978,
1.7751601934432983,
-0.30972209572792053,
0.3700762093067169,
-0.2451978623867035,
-1.2481763362884521,
0.05596177279949188,
0.7348904013633728,
0.3677845597267151,
-0.29074954986572266,
0.8113027811050415,
-0.735190749168396,
-1.0045208930969238,
-1.257240891456604,
-0.40155351161956787,
-1.0499851703643799,
-0.8625690937042236,
0.9966345429420471,
0.7386451363563538,
0.5550764799118042,
1.9738481044769287,
0.7118909955024719,
0.30111247301101685,
-2.5777361392974854,
0.7949860095977783,
0.3442125618457794,
-0.11321406066417694,
0.8516546487808228,
0.2887501120567322,
1.293009638786316,
-0.14136497676372528,
0.6108810305595398,
-2.3350491523742676,
2.2270429134368896,
-0.1746489703655243,
0.6989765763282776,
0.0393403023481369,
0.04542244225740433,
1.0152417421340942,
0.5228610038757324,
0.5158514380455017,
-1.1054234504699707,
0.9393267631530762,
-0.5121702551841736,
1.1126034259796143,
0.7939541339874268,
-0.952103316783905,
0.191393181681633,
1.2230110168457031,
0.36035847663879395,
-0.5350584983825684,
-1.087412714958191,
-0.7962648868560791,
0.9342083930969238,
1.6937237977981567,
0.034807756543159485,
0.07737456262111664,
0.8300639986991882,
0.7370695471763611,
-1.26002836227417,
-0.009052280336618423,
-0.4607684016227722,
-0.6446474194526672,
1.852189064025879,
2.0386126041412354,
-0.03280007839202881,
-0.003326933365315199,
-0.709247887134552,
-1.466346025466919,
0.8232996463775635,
0.14868341386318207,
-0.10673912614583969,
0.7464518547058105,
-0.682584285736084,
1.1407139301300049,
0.7264236211776733,
0.8358261585235596,
0.16523723304271698,
0.03686923533678055,
0.2074085921049118,
-0.2607612609863281,
-1.1987898349761963,
-0.38411810994148254,
-1.0161011219024658,
-2.630282402038574,
0.3458617031574249,
-0.2524752914905548,
-1.5209577083587646,
0.21103984117507935,
-0.9694729447364807,
0.717745840549469,
-0.5443626046180725,
-1.2185015678405762,
-1.3375681638717651,
0.31882786750793457,
-0.1412394642829895,
0.8167793154716492,
-1.6601893901824951,
-0.19902653992176056,
1.1037116050720215,
0.9414132833480835,
-0.6570442318916321,
0.884196400642395,
0.3150012493133545,
0.8986225724220276,
0.8811023831367493,
-0.40465211868286133,
0.4906463623046875,
0.2695247232913971,
-1.3696624040603638,
0.3096543550491333,
1.4145495891571045,
0.10726837813854218,
1.3049769401550293,
-0.3858179450035095,
0.03103581629693508,
0.41188332438468933,
-0.35681629180908203,
-0.5885670185089111,
-0.6551402807235718,
0.6505625247955322,
-0.11365880817174911,
-0.970037043094635,
-0.17195788025856018,
0.03840373456478119,
-0.20690909028053284,
0.2866816520690918,
-1.5037986040115356,
-0.15463963150978088,
-0.46768683195114136,
-0.6048100590705872,
-1.4411952495574951,
-0.023322168737649918,
1.2851678133010864,
-0.8356654644012451,
-0.09331055730581284,
0.5978567600250244,
0.2355591356754303,
0.5275699496269226,
0.6865015029907227,
-0.7825233936309814,
-0.17197024822235107,
-0.16094346344470978,
-0.32623642683029175,
0.297749787569046,
1.2336444854736328,
-0.062060415744781494,
-0.9853434562683105,
0.5007516145706177,
-0.2213682234287262,
0.23842033743858337,
1.9194055795669556,
-0.011262977495789528,
-0.8396544456481934,
0.33594661951065063,
-0.8431873917579651,
1.8322840929031372,
1.625205159187317,
1.3007586002349854,
-0.06077677756547928,
-0.8925566077232361,
0.6467018723487854,
-0.27913331985473633,
-0.32210421562194824,
0.9480208158493042,
0.3419659733772278,
-0.3573186993598938,
-1.3912091255187988,
0.7772976160049438,
1.237801432609558,
-0.6863256096839905,
-0.7399165630340576,
0.09559184312820435,
-0.8800296783447266,
1.276536226272583,
0.5592657923698425,
0.2834542989730835,
0.3307764232158661,
1.620394229888916,
0.7673918008804321,
-0.5593752861022949,
0.5098703503608704,
0.5005524754524231,
-0.20193035900592804,
-1.9855955839157104,
-1.1210813522338867,
0.27498871088027954,
-0.4495670199394226,
-1.5097697973251343,
1.4081804752349854,
-1.2526235580444336,
-1.0111383199691772,
0.6137832999229431,
0.10769783705472946,
1.224229097366333,
0.2902431786060333,
1.7219237089157104,
1.9879988431930542,
0.9022790789604187,
0.510475218296051,
1.110407829284668,
-0.2704068124294281,
-0.21948708593845367,
1.6824086904525757,
-0.4861108362674713,
0.6852375864982605,
1.0120024681091309,
-0.4814964234828949,
-1.252383828163147,
-0.8159440755844116,
-1.138954997062683,
-0.7322105169296265,
1.0199682712554932,
0.1717785894870758,
-1.0681838989257812,
0.31891417503356934,
1.6260918378829956,
0.037482455372810364,
-0.013000557199120522,
0.6667510271072388,
0.3542215824127197,
-0.7111058235168457,
-0.06409908086061478,
-1.0795835256576538,
0.6808148622512817,
-0.33516010642051697,
-0.36760422587394714,
0.11563677340745926,
0.6363316178321838,
1.180302619934082,
0.12174301594495773,
0.13493162393569946,
1.3067171573638916,
-1.3900039196014404,
1.2356938123703003,
-1.0254521369934082,
0.41896843910217285,
-2.2918479442596436,
1.4250742197036743,
-0.9374072551727295,
1.9764130115509033,
-2.6355533599853516,
0.49498605728149414,
-0.494548499584198,
-0.6598277688026428,
0.1766606867313385,
-0.16724860668182373,
0.11258301138877869,
-0.04444166272878647,
-0.971718430519104,
-0.13086648285388947,
-0.8682445287704468,
0.4369165599346161,
1.2777036428451538,
1.4095808267593384,
-0.9585288763046265,
-0.31435757875442505,
-1.5961378812789917,
-0.1849396824836731,
-0.5297658443450928,
0.18482112884521484,
-1.7263538837432861,
-0.1719442456960678,
-2.083515167236328,
-2.414438009262085,
-1.3306190967559814,
-1.0069478750228882,
1.3491467237472534,
0.16889353096485138,
-1.0111829042434692,
1.2029330730438232,
-0.44733068346977234,
-1.725719690322876,
1.2462425231933594,
-2.238295078277588
] |
https://github.com/huggingface/datasets/issues/5081 | Bug loading `sentence-transformers/parallel-sentences` | There are more issues in the dataset.
To load OpenSubtitles I have to provide this (see `skiprows`):
```python
df_os = pd.read_csv(
"./parallel-sentences/OpenSubtitles/OpenSubtitles-en-de-train.tsv.gz",
sep="\t",
quoting=csv.QUOTE_NONE,
header=None,
names=["en", "de"],
skiprows=[540344, 9151700, 10040173, 10040199, 11314673, 11338258, 11869223, 12159297, 12251078, 12303334],
)
``` | ## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("sentence-transformers/parallel-sentences")
```
raises this:
```
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [4], line 1
----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train")
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
1692 # Download and prepare data
-> 1693 builder_instance.download_and_prepare(
1694 download_config=download_config,
1695 download_mode=download_mode,
1696 ignore_verifications=ignore_verifications,
1697 try_from_hf_gcs=try_from_hf_gcs,
1698 use_auth_token=use_auth_token,
1699 )
1701 # Build dataset for splits
1702 keep_in_memory = (
1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
1704 )
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
801 if not downloaded_from_gcs:
802 prepare_split_kwargs = {
803 "file_format": file_format,
804 "max_shard_size": max_shard_size,
805 **download_and_prepare_kwargs,
806 }
--> 807 self._download_and_prepare(
808 dl_manager=dl_manager,
809 verify_infos=verify_infos,
810 **prepare_split_kwargs,
811 **download_and_prepare_kwargs,
812 )
813 # Sync info
814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
894 split_dict.add(split_generator.split_info)
896 try:
897 # Prepare split will record examples associated to the split
--> 898 self._prepare_split(split_generator, **prepare_split_kwargs)
899 except OSError as e:
900 raise OSError(
901 "Cannot find data file. "
902 + (self.manual_download_instructions or "")
903 + "\nOriginal error:\n"
904 + str(e)
905 ) from None
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size)
1506 shard_id += 1
1507 writer = writer_class(
1508 features=writer._features,
1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"),
1510 storage_options=self._fs.storage_options,
1511 embed_local_files=embed_local_files,
1512 )
-> 1513 writer.write_table(table)
1514 finally:
1515 num_shards = shard_id + 1
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size)
538 if self.pa_writer is None:
539 self._build_writer(inferred_schema=pa_table.schema)
--> 540 pa_table = table_cast(pa_table, self._schema)
541 if self.embed_local_files:
542 pa_table = embed_table_storage(pa_table)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema)
2032 """Improved version of pa.Table.cast.
2033
2034 It supports casting to feature types stored in the schema metadata.
(...)
2041 table (:obj:`pyarrow.Table`): the casted table
2042 """
2043 if table.schema != schema:
-> 2044 return cast_table_to_schema(table, schema)
2045 elif table.schema.metadata != schema.metadata:
2046 return table.replace_schema_metadata(schema.metadata)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema)
2003 features = Features.from_arrow_schema(schema)
2004 if sorted(table.column_names) != sorted(features):
-> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
2007 return pa.Table.from_arrays(arrays, schema=schema)
ValueError: Couldn't cast
Action taken on Parliament's resolutions: see Minutes: string
Následný postup na základě usnesení Parlamentu: viz zápis: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742
to
{'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)}
because column names don't match
```
## Expected results
no error
## Actual results
error
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Linux
- Python version: Python 3.9.13
- PyArrow version: pyarrow 9.0.0
- transformers 4.22.2
- datasets 2.5.2 | 491 | 39 | Bug loading `sentence-transformers/parallel-sentences`
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("sentence-transformers/parallel-sentences")
```
raises this:
```
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [4], line 1
----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train")
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
1692 # Download and prepare data
-> 1693 builder_instance.download_and_prepare(
1694 download_config=download_config,
1695 download_mode=download_mode,
1696 ignore_verifications=ignore_verifications,
1697 try_from_hf_gcs=try_from_hf_gcs,
1698 use_auth_token=use_auth_token,
1699 )
1701 # Build dataset for splits
1702 keep_in_memory = (
1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
1704 )
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
801 if not downloaded_from_gcs:
802 prepare_split_kwargs = {
803 "file_format": file_format,
804 "max_shard_size": max_shard_size,
805 **download_and_prepare_kwargs,
806 }
--> 807 self._download_and_prepare(
808 dl_manager=dl_manager,
809 verify_infos=verify_infos,
810 **prepare_split_kwargs,
811 **download_and_prepare_kwargs,
812 )
813 # Sync info
814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
894 split_dict.add(split_generator.split_info)
896 try:
897 # Prepare split will record examples associated to the split
--> 898 self._prepare_split(split_generator, **prepare_split_kwargs)
899 except OSError as e:
900 raise OSError(
901 "Cannot find data file. "
902 + (self.manual_download_instructions or "")
903 + "\nOriginal error:\n"
904 + str(e)
905 ) from None
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size)
1506 shard_id += 1
1507 writer = writer_class(
1508 features=writer._features,
1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"),
1510 storage_options=self._fs.storage_options,
1511 embed_local_files=embed_local_files,
1512 )
-> 1513 writer.write_table(table)
1514 finally:
1515 num_shards = shard_id + 1
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size)
538 if self.pa_writer is None:
539 self._build_writer(inferred_schema=pa_table.schema)
--> 540 pa_table = table_cast(pa_table, self._schema)
541 if self.embed_local_files:
542 pa_table = embed_table_storage(pa_table)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema)
2032 """Improved version of pa.Table.cast.
2033
2034 It supports casting to feature types stored in the schema metadata.
(...)
2041 table (:obj:`pyarrow.Table`): the casted table
2042 """
2043 if table.schema != schema:
-> 2044 return cast_table_to_schema(table, schema)
2045 elif table.schema.metadata != schema.metadata:
2046 return table.replace_schema_metadata(schema.metadata)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema)
2003 features = Features.from_arrow_schema(schema)
2004 if sorted(table.column_names) != sorted(features):
-> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
2007 return pa.Table.from_arrays(arrays, schema=schema)
ValueError: Couldn't cast
Action taken on Parliament's resolutions: see Minutes: string
Následný postup na základě usnesení Parlamentu: viz zápis: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742
to
{'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)}
because column names don't match
```
## Expected results
no error
## Actual results
error
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Linux
- Python version: Python 3.9.13
- PyArrow version: pyarrow 9.0.0
- transformers 4.22.2
- datasets 2.5.2
There are more issues in the dataset.
To load OpenSubtitles I have to provide this (see `skiprows`):
```python
df_os = pd.read_csv(
"./parallel-sentences/OpenSubtitles/OpenSubtitles-en-de-train.tsv.gz",
sep="\t",
quoting=csv.QUOTE_NONE,
header=None,
names=["en", "de"],
skiprows=[540344, 9151700, 10040173, 10040199, 11314673, 11338258, 11869223, 12159297, 12251078, 12303334],
)
``` | [
-1.1607729196548462,
-0.8821344971656799,
-0.5440049171447754,
1.4534788131713867,
0.04094377160072327,
-1.3577572107315063,
0.06716285645961761,
-0.8556927442550659,
1.5331424474716187,
-0.8014310598373413,
0.3368062674999237,
-1.6735560894012451,
-0.09366270899772644,
-0.6138854622840881,
-0.5950754880905151,
-0.6831291913986206,
-0.30963295698165894,
-0.7486061453819275,
1.1023167371749878,
2.398585319519043,
1.2118858098983765,
-1.3552902936935425,
2.8708553314208984,
0.6294194459915161,
-0.2638089060783386,
-0.8095683455467224,
0.37454164028167725,
-0.061835892498493195,
-1.3963788747787476,
-0.2799552381038666,
-0.9708189964294434,
-0.013021350838243961,
-0.7438075542449951,
-0.4452950954437256,
0.09665835648775101,
0.4958205819129944,
-0.25083693861961365,
-0.35044294595718384,
-0.48993533849716187,
-0.781643271446228,
0.6320759654045105,
-0.22998717427253723,
0.8762193322181702,
-0.3088870346546173,
1.7954128980636597,
-0.664283275604248,
0.48142674565315247,
0.5770856738090515,
1.2200980186462402,
0.2009754329919815,
0.024623507633805275,
0.3952481150627136,
0.20266154408454895,
-0.029476461932063103,
0.6813179850578308,
1.2462027072906494,
0.6170371174812317,
0.5490838289260864,
0.6951783895492554,
-2.2074904441833496,
1.3660156726837158,
-0.7546902894973755,
0.15930242836475372,
1.339640498161316,
-0.9945853352546692,
0.4561432898044586,
-1.8804855346679688,
-0.12985455989837646,
0.41642358899116516,
-2.243361711502075,
0.13057290017604828,
-1.264999270439148,
-0.5382556915283203,
0.9753740429878235,
0.3487871587276459,
-1.254485011100769,
0.024273673072457314,
-0.45619356632232666,
1.017439842224121,
0.38952019810676575,
1.0810333490371704,
-1.6091265678405762,
0.07416466623544693,
-0.10022076964378357,
0.34826111793518066,
-1.1725455522537231,
-1.6598156690597534,
0.6275768280029297,
0.5841553211212158,
0.7486143112182617,
-0.1281232088804245,
0.9245271682739258,
-1.152008295059204,
0.8701072931289673,
-0.9909219741821289,
-1.7078399658203125,
-1.3212313652038574,
-2.5293080806732178,
-2.4387102127075195,
0.8406350612640381,
-0.4293716251850128,
-0.34340181946754456,
2.0434069633483887,
-1.1373467445373535,
-1.7181628942489624,
1.0111002922058105,
0.30582621693611145,
-0.028882211074233055,
2.3612170219421387,
0.21776948869228363,
-0.9744910597801208,
0.7716489434242249,
-0.8914586305618286,
0.6756870150566101,
-0.3041660189628601,
1.2611899375915527,
0.41043874621391296,
-1.09392249584198,
1.5876736640930176,
-0.4827117919921875,
0.5492165088653564,
-0.6944707632064819,
-0.4522937834262848,
-0.5704922676086426,
0.14395421743392944,
1.9144011735916138,
-0.1515677273273468,
1.511206030845642,
-0.17043721675872803,
-1.4356852769851685,
-1.3782976865768433,
0.7554053664207458,
0.43585526943206787,
-0.8789121508598328,
0.18071871995925903,
-0.44553428888320923,
0.1305457204580307,
0.16197527945041656,
1.099850058555603,
1.232969880104065,
0.7448853850364685,
-0.1670239269733429,
-0.8482081890106201,
0.07618940621614456,
-0.11996407061815262,
-0.5044555068016052,
-1.7753862142562866,
-0.26957136392593384,
0.2257840633392334,
0.6767544746398926,
-1.2410577535629272,
2.0238614082336426,
0.8736896514892578,
2.069153070449829,
1.0275322198867798,
-0.3388373851776123,
1.5022906064987183,
0.06494046002626419,
1.9331603050231934,
-0.31136128306388855,
0.5942142009735107,
-0.5248441696166992,
-1.20709228515625,
0.6719326972961426,
-0.3905032277107239,
-1.990591049194336,
-0.43823590874671936,
-0.8558007478713989,
-0.12912701070308685,
-0.8585320711135864,
0.9881439208984375,
-0.1856396645307541,
-1.4393095970153809,
0.16072019934654236,
-0.6713976263999939,
0.19908781349658966,
-1.334209680557251,
0.25880900025367737,
0.7463904619216919,
-0.7926624417304993,
0.045744337141513824,
-0.4664824306964874,
-1.3919482231140137,
-0.6740078926086426,
0.5508342981338501,
1.814492106437683,
-0.6232456564903259,
1.000312328338623,
1.0515787601470947,
-0.623693585395813,
-0.038559116423130035,
0.4805496037006378,
-0.39618244767189026,
0.8355808854103088,
-1.0045417547225952,
-0.46483418345451355,
1.1157854795455933,
-0.35532182455062866,
-0.5617885589599609,
1.320908784866333,
0.7435839176177979,
-1.0504792928695679,
-0.3373887240886688,
-0.1702519953250885,
-0.8801996111869812,
0.03854934126138687,
-1.5435476303100586,
-0.09836166352033615,
0.28297632932662964,
-1.4990969896316528,
-0.35515913367271423,
0.01712971366941929,
1.3106437921524048,
-0.051186732947826385,
1.337631106376648,
-0.24239613115787506,
-0.12726014852523804,
-0.5051954984664917,
-0.623937726020813,
0.1426246017217636,
-0.08519873023033142,
-0.6026522517204285,
0.2735016345977783,
-0.7513298988342285,
0.16753394901752472,
1.484082579612732,
0.23394201695919037,
0.05613318085670471,
0.4708005487918854,
1.2822505235671997,
0.33458632230758667,
-0.12433266639709473,
-0.8159877061843872,
-1.6978050470352173,
2.001368284225464,
-1.5849405527114868,
1.9012515544891357,
0.7905646562576294,
-0.08221836388111115,
-1.831676959991455,
-1.7972127199172974,
1.4172390699386597,
1.1554471254348755,
2.5022006034851074,
0.5656771659851074,
0.4397628605365753,
-0.8143517374992371,
-0.7302150726318359,
0.5021730065345764,
-0.7159650921821594,
-0.8436433672904968,
0.15343615412712097,
2.3307101726531982,
1.708558201789856,
-0.3732961416244507,
-0.1972811222076416,
-0.9047452807426453,
1.3908637762069702,
-0.33648163080215454,
0.2948516309261322,
1.8993326425552368,
-0.4454544484615326,
-0.9970986247062683,
1.3910863399505615,
-2.4412710666656494,
0.374749094247818,
2.0853400230407715,
0.34447088837623596,
0.09546546638011932,
-1.1640629768371582,
-0.7377153635025024,
-0.15802809596061707,
-0.44120216369628906,
-1.204187035560608,
0.43501949310302734,
-0.25622686743736267,
-0.8229808807373047,
-1.3637855052947998,
-0.02998727560043335,
-1.2086673974990845,
-1.7207586765289307,
0.3211813271045685,
1.779596209526062,
2.2825067043304443,
-0.7894519567489624,
1.2884538173675537,
-0.26146799325942993,
0.2188761681318283,
1.2484849691390991,
1.3746684789657593,
3.26606822013855,
1.8862957954406738,
-1.2395974397659302,
0.7149963974952698,
-0.16541115939617157,
-0.5625905990600586,
1.183849573135376,
-1.0467537641525269,
1.1472523212432861,
-0.29186511039733887,
-1.339465618133545,
-1.2241556644439697,
0.9558612704277039,
0.4473273754119873,
-0.034883614629507065,
-0.46810203790664673,
1.1212223768234253,
0.20736029744148254,
1.284394383430481,
0.6393507122993469,
-0.3061687648296356,
0.4279739260673523,
-0.33727243542671204,
-0.6164606213569641,
1.584937572479248,
0.07449590414762497,
-1.5548888444900513,
-2.3618390560150146,
-0.13739535212516785,
-1.075203537940979,
-0.02642161026597023,
-0.9291841387748718,
-1.0235954523086548,
1.4274156093597412,
0.4422476887702942,
-0.9397797584533691,
-0.0760820060968399,
-0.36725711822509766,
-0.5423033237457275,
2.600759744644165,
-1.353159785270691,
-0.2080712616443634,
-0.9523168802261353,
-0.5788541436195374,
1.5537776947021484,
-1.1886602640151978,
-0.2961878180503845,
-1.0367615222930908,
-0.5460045337677002,
-1.2502491474151611,
-0.36337810754776,
-0.10624347627162933,
-0.8499171137809753,
0.7033047080039978,
0.019891060888767242,
-1.2495888471603394,
-0.24726064503192902,
-1.1468086242675781,
0.9105817675590515,
-0.2613566517829895,
0.11178596317768097,
1.6585278511047363,
0.24027714133262634,
-0.4599626362323761,
0.8276284337043762,
1.3380146026611328,
0.6319798231124878,
-0.5404995679855347,
0.11888440698385239,
-0.6436122059822083,
0.5453301668167114,
-1.2406928539276123,
0.34741687774658203,
-3.020751714706421,
0.6945691108703613,
0.00889497995376587,
-0.11139766126871109,
-0.17944371700286865,
-1.5158042907714844,
0.9340871572494507,
2.410982608795166,
-1.1596834659576416,
0.6520914435386658,
0.3758067488670349,
1.1554408073425293,
-1.6687690019607544,
-0.04254718869924545,
-0.7206392288208008,
2.043369770050049,
-0.035869866609573364,
1.0822824239730835,
-0.5598179697990417,
-2.348196268081665,
0.5614848732948303,
-1.2053242921829224,
-0.9004548192024231,
0.844582200050354,
-0.9017813801765442,
0.3870188295841217,
-1.1347098350524902,
-0.10036981105804443,
-0.9199352860450745,
-1.1531741619110107,
0.488677978515625,
0.020916668698191643,
0.6130759119987488,
-0.5331860184669495,
0.2876741588115692,
-2.308885335922241,
-1.4163657426834106,
-0.11198046058416367,
-0.9402047395706177,
0.5830062627792358,
-0.46941077709198,
0.6662108302116394,
-0.07094965130090714,
0.038570523262023926,
0.2141619175672531,
1.513673186302185,
3.1961045265197754,
-0.007147951051592827,
0.28605398535728455,
-0.23437727987766266,
-1.0574040412902832,
1.550447702407837,
0.902021586894989,
-0.2676921486854553,
-0.554551362991333,
-0.9227903485298157,
1.4096827507019043,
1.9074478149414062,
1.1009228229522705,
0.10625874251127243,
-0.9450398683547974,
-0.7796695828437805,
0.1597955971956253,
0.15419532358646393,
0.4871352016925812,
0.9926089644432068,
0.15802797675132751,
0.18899913132190704,
1.2986781597137451,
1.021227478981018,
-0.268018513917923,
0.4779881536960602,
-0.8516111373901367,
-0.3554612994194031,
0.5167833566665649,
0.27127036452293396,
-0.0070333331823349,
0.2967013120651245,
-1.0209298133850098,
-0.14441320300102234,
-0.23085276782512665,
-0.7956777215003967,
-0.7694410085678101,
-0.39154452085494995,
-0.45592209696769714,
1.6915968656539917,
-0.05038570612668991,
-0.5666322112083435,
0.04596410691738129,
-0.7929159998893738,
-0.1382739096879959,
-1.0477283000946045,
0.2487080693244934,
-0.09601143002510071,
0.05437315255403519,
-0.23847033083438873,
1.59941565990448,
-0.9751170873641968,
-2.2346160411834717,
0.11177287250757217,
0.3065200448036194,
-0.2943721413612366,
-0.146977499127388,
1.8353487253189087,
0.45793861150741577,
1.3570629358291626,
1.5345275402069092,
1.0848805904388428,
-0.5783596634864807,
-1.2962243556976318,
0.7395602464675903,
0.9476937055587769,
-1.3273673057556152,
0.9690961241722107,
-0.295236736536026,
-0.5673539638519287,
0.5574313402175903,
1.3155642747879028,
0.43092721700668335,
-1.9230172634124756,
0.8828601241111755,
-1.2091889381408691,
0.9573650360107422,
0.8634772896766663,
0.8633608818054199,
0.16329975426197052,
0.8961958885192871,
-1.2571382522583008,
-1.047377586364746,
-0.5584021806716919,
-0.7238165140151978,
1.7751601934432983,
-0.30972209572792053,
0.3700762093067169,
-0.2451978623867035,
-1.2481763362884521,
0.05596177279949188,
0.7348904013633728,
0.3677845597267151,
-0.29074954986572266,
0.8113027811050415,
-0.735190749168396,
-1.0045208930969238,
-1.257240891456604,
-0.40155351161956787,
-1.0499851703643799,
-0.8625690937042236,
0.9966345429420471,
0.7386451363563538,
0.5550764799118042,
1.9738481044769287,
0.7118909955024719,
0.30111247301101685,
-2.5777361392974854,
0.7949860095977783,
0.3442125618457794,
-0.11321406066417694,
0.8516546487808228,
0.2887501120567322,
1.293009638786316,
-0.14136497676372528,
0.6108810305595398,
-2.3350491523742676,
2.2270429134368896,
-0.1746489703655243,
0.6989765763282776,
0.0393403023481369,
0.04542244225740433,
1.0152417421340942,
0.5228610038757324,
0.5158514380455017,
-1.1054234504699707,
0.9393267631530762,
-0.5121702551841736,
1.1126034259796143,
0.7939541339874268,
-0.952103316783905,
0.191393181681633,
1.2230110168457031,
0.36035847663879395,
-0.5350584983825684,
-1.087412714958191,
-0.7962648868560791,
0.9342083930969238,
1.6937237977981567,
0.034807756543159485,
0.07737456262111664,
0.8300639986991882,
0.7370695471763611,
-1.26002836227417,
-0.009052280336618423,
-0.4607684016227722,
-0.6446474194526672,
1.852189064025879,
2.0386126041412354,
-0.03280007839202881,
-0.003326933365315199,
-0.709247887134552,
-1.466346025466919,
0.8232996463775635,
0.14868341386318207,
-0.10673912614583969,
0.7464518547058105,
-0.682584285736084,
1.1407139301300049,
0.7264236211776733,
0.8358261585235596,
0.16523723304271698,
0.03686923533678055,
0.2074085921049118,
-0.2607612609863281,
-1.1987898349761963,
-0.38411810994148254,
-1.0161011219024658,
-2.630282402038574,
0.3458617031574249,
-0.2524752914905548,
-1.5209577083587646,
0.21103984117507935,
-0.9694729447364807,
0.717745840549469,
-0.5443626046180725,
-1.2185015678405762,
-1.3375681638717651,
0.31882786750793457,
-0.1412394642829895,
0.8167793154716492,
-1.6601893901824951,
-0.19902653992176056,
1.1037116050720215,
0.9414132833480835,
-0.6570442318916321,
0.884196400642395,
0.3150012493133545,
0.8986225724220276,
0.8811023831367493,
-0.40465211868286133,
0.4906463623046875,
0.2695247232913971,
-1.3696624040603638,
0.3096543550491333,
1.4145495891571045,
0.10726837813854218,
1.3049769401550293,
-0.3858179450035095,
0.03103581629693508,
0.41188332438468933,
-0.35681629180908203,
-0.5885670185089111,
-0.6551402807235718,
0.6505625247955322,
-0.11365880817174911,
-0.970037043094635,
-0.17195788025856018,
0.03840373456478119,
-0.20690909028053284,
0.2866816520690918,
-1.5037986040115356,
-0.15463963150978088,
-0.46768683195114136,
-0.6048100590705872,
-1.4411952495574951,
-0.023322168737649918,
1.2851678133010864,
-0.8356654644012451,
-0.09331055730581284,
0.5978567600250244,
0.2355591356754303,
0.5275699496269226,
0.6865015029907227,
-0.7825233936309814,
-0.17197024822235107,
-0.16094346344470978,
-0.32623642683029175,
0.297749787569046,
1.2336444854736328,
-0.062060415744781494,
-0.9853434562683105,
0.5007516145706177,
-0.2213682234287262,
0.23842033743858337,
1.9194055795669556,
-0.011262977495789528,
-0.8396544456481934,
0.33594661951065063,
-0.8431873917579651,
1.8322840929031372,
1.625205159187317,
1.3007586002349854,
-0.06077677756547928,
-0.8925566077232361,
0.6467018723487854,
-0.27913331985473633,
-0.32210421562194824,
0.9480208158493042,
0.3419659733772278,
-0.3573186993598938,
-1.3912091255187988,
0.7772976160049438,
1.237801432609558,
-0.6863256096839905,
-0.7399165630340576,
0.09559184312820435,
-0.8800296783447266,
1.276536226272583,
0.5592657923698425,
0.2834542989730835,
0.3307764232158661,
1.620394229888916,
0.7673918008804321,
-0.5593752861022949,
0.5098703503608704,
0.5005524754524231,
-0.20193035900592804,
-1.9855955839157104,
-1.1210813522338867,
0.27498871088027954,
-0.4495670199394226,
-1.5097697973251343,
1.4081804752349854,
-1.2526235580444336,
-1.0111383199691772,
0.6137832999229431,
0.10769783705472946,
1.224229097366333,
0.2902431786060333,
1.7219237089157104,
1.9879988431930542,
0.9022790789604187,
0.510475218296051,
1.110407829284668,
-0.2704068124294281,
-0.21948708593845367,
1.6824086904525757,
-0.4861108362674713,
0.6852375864982605,
1.0120024681091309,
-0.4814964234828949,
-1.252383828163147,
-0.8159440755844116,
-1.138954997062683,
-0.7322105169296265,
1.0199682712554932,
0.1717785894870758,
-1.0681838989257812,
0.31891417503356934,
1.6260918378829956,
0.037482455372810364,
-0.013000557199120522,
0.6667510271072388,
0.3542215824127197,
-0.7111058235168457,
-0.06409908086061478,
-1.0795835256576538,
0.6808148622512817,
-0.33516010642051697,
-0.36760422587394714,
0.11563677340745926,
0.6363316178321838,
1.180302619934082,
0.12174301594495773,
0.13493162393569946,
1.3067171573638916,
-1.3900039196014404,
1.2356938123703003,
-1.0254521369934082,
0.41896843910217285,
-2.2918479442596436,
1.4250742197036743,
-0.9374072551727295,
1.9764130115509033,
-2.6355533599853516,
0.49498605728149414,
-0.494548499584198,
-0.6598277688026428,
0.1766606867313385,
-0.16724860668182373,
0.11258301138877869,
-0.04444166272878647,
-0.971718430519104,
-0.13086648285388947,
-0.8682445287704468,
0.4369165599346161,
1.2777036428451538,
1.4095808267593384,
-0.9585288763046265,
-0.31435757875442505,
-1.5961378812789917,
-0.1849396824836731,
-0.5297658443450928,
0.18482112884521484,
-1.7263538837432861,
-0.1719442456960678,
-2.083515167236328,
-2.414438009262085,
-1.3306190967559814,
-1.0069478750228882,
1.3491467237472534,
0.16889353096485138,
-1.0111829042434692,
1.2029330730438232,
-0.44733068346977234,
-1.725719690322876,
1.2462425231933594,
-2.238295078277588
] |
https://github.com/huggingface/datasets/issues/5081 | Bug loading `sentence-transformers/parallel-sentences` | What's wrong with those lines exactly ?
Maybe passing `error_bad_lines=False` (and maybe `warn_bad_lines=True`) can be helpful | ## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("sentence-transformers/parallel-sentences")
```
raises this:
```
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [4], line 1
----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train")
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
1692 # Download and prepare data
-> 1693 builder_instance.download_and_prepare(
1694 download_config=download_config,
1695 download_mode=download_mode,
1696 ignore_verifications=ignore_verifications,
1697 try_from_hf_gcs=try_from_hf_gcs,
1698 use_auth_token=use_auth_token,
1699 )
1701 # Build dataset for splits
1702 keep_in_memory = (
1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
1704 )
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
801 if not downloaded_from_gcs:
802 prepare_split_kwargs = {
803 "file_format": file_format,
804 "max_shard_size": max_shard_size,
805 **download_and_prepare_kwargs,
806 }
--> 807 self._download_and_prepare(
808 dl_manager=dl_manager,
809 verify_infos=verify_infos,
810 **prepare_split_kwargs,
811 **download_and_prepare_kwargs,
812 )
813 # Sync info
814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
894 split_dict.add(split_generator.split_info)
896 try:
897 # Prepare split will record examples associated to the split
--> 898 self._prepare_split(split_generator, **prepare_split_kwargs)
899 except OSError as e:
900 raise OSError(
901 "Cannot find data file. "
902 + (self.manual_download_instructions or "")
903 + "\nOriginal error:\n"
904 + str(e)
905 ) from None
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size)
1506 shard_id += 1
1507 writer = writer_class(
1508 features=writer._features,
1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"),
1510 storage_options=self._fs.storage_options,
1511 embed_local_files=embed_local_files,
1512 )
-> 1513 writer.write_table(table)
1514 finally:
1515 num_shards = shard_id + 1
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size)
538 if self.pa_writer is None:
539 self._build_writer(inferred_schema=pa_table.schema)
--> 540 pa_table = table_cast(pa_table, self._schema)
541 if self.embed_local_files:
542 pa_table = embed_table_storage(pa_table)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema)
2032 """Improved version of pa.Table.cast.
2033
2034 It supports casting to feature types stored in the schema metadata.
(...)
2041 table (:obj:`pyarrow.Table`): the casted table
2042 """
2043 if table.schema != schema:
-> 2044 return cast_table_to_schema(table, schema)
2045 elif table.schema.metadata != schema.metadata:
2046 return table.replace_schema_metadata(schema.metadata)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema)
2003 features = Features.from_arrow_schema(schema)
2004 if sorted(table.column_names) != sorted(features):
-> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
2007 return pa.Table.from_arrays(arrays, schema=schema)
ValueError: Couldn't cast
Action taken on Parliament's resolutions: see Minutes: string
Následný postup na základě usnesení Parlamentu: viz zápis: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742
to
{'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)}
because column names don't match
```
## Expected results
no error
## Actual results
error
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Linux
- Python version: Python 3.9.13
- PyArrow version: pyarrow 9.0.0
- transformers 4.22.2
- datasets 2.5.2 | 491 | 16 | Bug loading `sentence-transformers/parallel-sentences`
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("sentence-transformers/parallel-sentences")
```
raises this:
```
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [4], line 1
----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train")
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
1692 # Download and prepare data
-> 1693 builder_instance.download_and_prepare(
1694 download_config=download_config,
1695 download_mode=download_mode,
1696 ignore_verifications=ignore_verifications,
1697 try_from_hf_gcs=try_from_hf_gcs,
1698 use_auth_token=use_auth_token,
1699 )
1701 # Build dataset for splits
1702 keep_in_memory = (
1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
1704 )
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
801 if not downloaded_from_gcs:
802 prepare_split_kwargs = {
803 "file_format": file_format,
804 "max_shard_size": max_shard_size,
805 **download_and_prepare_kwargs,
806 }
--> 807 self._download_and_prepare(
808 dl_manager=dl_manager,
809 verify_infos=verify_infos,
810 **prepare_split_kwargs,
811 **download_and_prepare_kwargs,
812 )
813 # Sync info
814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
894 split_dict.add(split_generator.split_info)
896 try:
897 # Prepare split will record examples associated to the split
--> 898 self._prepare_split(split_generator, **prepare_split_kwargs)
899 except OSError as e:
900 raise OSError(
901 "Cannot find data file. "
902 + (self.manual_download_instructions or "")
903 + "\nOriginal error:\n"
904 + str(e)
905 ) from None
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size)
1506 shard_id += 1
1507 writer = writer_class(
1508 features=writer._features,
1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"),
1510 storage_options=self._fs.storage_options,
1511 embed_local_files=embed_local_files,
1512 )
-> 1513 writer.write_table(table)
1514 finally:
1515 num_shards = shard_id + 1
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size)
538 if self.pa_writer is None:
539 self._build_writer(inferred_schema=pa_table.schema)
--> 540 pa_table = table_cast(pa_table, self._schema)
541 if self.embed_local_files:
542 pa_table = embed_table_storage(pa_table)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema)
2032 """Improved version of pa.Table.cast.
2033
2034 It supports casting to feature types stored in the schema metadata.
(...)
2041 table (:obj:`pyarrow.Table`): the casted table
2042 """
2043 if table.schema != schema:
-> 2044 return cast_table_to_schema(table, schema)
2045 elif table.schema.metadata != schema.metadata:
2046 return table.replace_schema_metadata(schema.metadata)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema)
2003 features = Features.from_arrow_schema(schema)
2004 if sorted(table.column_names) != sorted(features):
-> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
2007 return pa.Table.from_arrays(arrays, schema=schema)
ValueError: Couldn't cast
Action taken on Parliament's resolutions: see Minutes: string
Následný postup na základě usnesení Parlamentu: viz zápis: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742
to
{'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)}
because column names don't match
```
## Expected results
no error
## Actual results
error
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Linux
- Python version: Python 3.9.13
- PyArrow version: pyarrow 9.0.0
- transformers 4.22.2
- datasets 2.5.2
What's wrong with those lines exactly ?
Maybe passing `error_bad_lines=False` (and maybe `warn_bad_lines=True`) can be helpful | [
-1.1607729196548462,
-0.8821344971656799,
-0.5440049171447754,
1.4534788131713867,
0.04094377160072327,
-1.3577572107315063,
0.06716285645961761,
-0.8556927442550659,
1.5331424474716187,
-0.8014310598373413,
0.3368062674999237,
-1.6735560894012451,
-0.09366270899772644,
-0.6138854622840881,
-0.5950754880905151,
-0.6831291913986206,
-0.30963295698165894,
-0.7486061453819275,
1.1023167371749878,
2.398585319519043,
1.2118858098983765,
-1.3552902936935425,
2.8708553314208984,
0.6294194459915161,
-0.2638089060783386,
-0.8095683455467224,
0.37454164028167725,
-0.061835892498493195,
-1.3963788747787476,
-0.2799552381038666,
-0.9708189964294434,
-0.013021350838243961,
-0.7438075542449951,
-0.4452950954437256,
0.09665835648775101,
0.4958205819129944,
-0.25083693861961365,
-0.35044294595718384,
-0.48993533849716187,
-0.781643271446228,
0.6320759654045105,
-0.22998717427253723,
0.8762193322181702,
-0.3088870346546173,
1.7954128980636597,
-0.664283275604248,
0.48142674565315247,
0.5770856738090515,
1.2200980186462402,
0.2009754329919815,
0.024623507633805275,
0.3952481150627136,
0.20266154408454895,
-0.029476461932063103,
0.6813179850578308,
1.2462027072906494,
0.6170371174812317,
0.5490838289260864,
0.6951783895492554,
-2.2074904441833496,
1.3660156726837158,
-0.7546902894973755,
0.15930242836475372,
1.339640498161316,
-0.9945853352546692,
0.4561432898044586,
-1.8804855346679688,
-0.12985455989837646,
0.41642358899116516,
-2.243361711502075,
0.13057290017604828,
-1.264999270439148,
-0.5382556915283203,
0.9753740429878235,
0.3487871587276459,
-1.254485011100769,
0.024273673072457314,
-0.45619356632232666,
1.017439842224121,
0.38952019810676575,
1.0810333490371704,
-1.6091265678405762,
0.07416466623544693,
-0.10022076964378357,
0.34826111793518066,
-1.1725455522537231,
-1.6598156690597534,
0.6275768280029297,
0.5841553211212158,
0.7486143112182617,
-0.1281232088804245,
0.9245271682739258,
-1.152008295059204,
0.8701072931289673,
-0.9909219741821289,
-1.7078399658203125,
-1.3212313652038574,
-2.5293080806732178,
-2.4387102127075195,
0.8406350612640381,
-0.4293716251850128,
-0.34340181946754456,
2.0434069633483887,
-1.1373467445373535,
-1.7181628942489624,
1.0111002922058105,
0.30582621693611145,
-0.028882211074233055,
2.3612170219421387,
0.21776948869228363,
-0.9744910597801208,
0.7716489434242249,
-0.8914586305618286,
0.6756870150566101,
-0.3041660189628601,
1.2611899375915527,
0.41043874621391296,
-1.09392249584198,
1.5876736640930176,
-0.4827117919921875,
0.5492165088653564,
-0.6944707632064819,
-0.4522937834262848,
-0.5704922676086426,
0.14395421743392944,
1.9144011735916138,
-0.1515677273273468,
1.511206030845642,
-0.17043721675872803,
-1.4356852769851685,
-1.3782976865768433,
0.7554053664207458,
0.43585526943206787,
-0.8789121508598328,
0.18071871995925903,
-0.44553428888320923,
0.1305457204580307,
0.16197527945041656,
1.099850058555603,
1.232969880104065,
0.7448853850364685,
-0.1670239269733429,
-0.8482081890106201,
0.07618940621614456,
-0.11996407061815262,
-0.5044555068016052,
-1.7753862142562866,
-0.26957136392593384,
0.2257840633392334,
0.6767544746398926,
-1.2410577535629272,
2.0238614082336426,
0.8736896514892578,
2.069153070449829,
1.0275322198867798,
-0.3388373851776123,
1.5022906064987183,
0.06494046002626419,
1.9331603050231934,
-0.31136128306388855,
0.5942142009735107,
-0.5248441696166992,
-1.20709228515625,
0.6719326972961426,
-0.3905032277107239,
-1.990591049194336,
-0.43823590874671936,
-0.8558007478713989,
-0.12912701070308685,
-0.8585320711135864,
0.9881439208984375,
-0.1856396645307541,
-1.4393095970153809,
0.16072019934654236,
-0.6713976263999939,
0.19908781349658966,
-1.334209680557251,
0.25880900025367737,
0.7463904619216919,
-0.7926624417304993,
0.045744337141513824,
-0.4664824306964874,
-1.3919482231140137,
-0.6740078926086426,
0.5508342981338501,
1.814492106437683,
-0.6232456564903259,
1.000312328338623,
1.0515787601470947,
-0.623693585395813,
-0.038559116423130035,
0.4805496037006378,
-0.39618244767189026,
0.8355808854103088,
-1.0045417547225952,
-0.46483418345451355,
1.1157854795455933,
-0.35532182455062866,
-0.5617885589599609,
1.320908784866333,
0.7435839176177979,
-1.0504792928695679,
-0.3373887240886688,
-0.1702519953250885,
-0.8801996111869812,
0.03854934126138687,
-1.5435476303100586,
-0.09836166352033615,
0.28297632932662964,
-1.4990969896316528,
-0.35515913367271423,
0.01712971366941929,
1.3106437921524048,
-0.051186732947826385,
1.337631106376648,
-0.24239613115787506,
-0.12726014852523804,
-0.5051954984664917,
-0.623937726020813,
0.1426246017217636,
-0.08519873023033142,
-0.6026522517204285,
0.2735016345977783,
-0.7513298988342285,
0.16753394901752472,
1.484082579612732,
0.23394201695919037,
0.05613318085670471,
0.4708005487918854,
1.2822505235671997,
0.33458632230758667,
-0.12433266639709473,
-0.8159877061843872,
-1.6978050470352173,
2.001368284225464,
-1.5849405527114868,
1.9012515544891357,
0.7905646562576294,
-0.08221836388111115,
-1.831676959991455,
-1.7972127199172974,
1.4172390699386597,
1.1554471254348755,
2.5022006034851074,
0.5656771659851074,
0.4397628605365753,
-0.8143517374992371,
-0.7302150726318359,
0.5021730065345764,
-0.7159650921821594,
-0.8436433672904968,
0.15343615412712097,
2.3307101726531982,
1.708558201789856,
-0.3732961416244507,
-0.1972811222076416,
-0.9047452807426453,
1.3908637762069702,
-0.33648163080215454,
0.2948516309261322,
1.8993326425552368,
-0.4454544484615326,
-0.9970986247062683,
1.3910863399505615,
-2.4412710666656494,
0.374749094247818,
2.0853400230407715,
0.34447088837623596,
0.09546546638011932,
-1.1640629768371582,
-0.7377153635025024,
-0.15802809596061707,
-0.44120216369628906,
-1.204187035560608,
0.43501949310302734,
-0.25622686743736267,
-0.8229808807373047,
-1.3637855052947998,
-0.02998727560043335,
-1.2086673974990845,
-1.7207586765289307,
0.3211813271045685,
1.779596209526062,
2.2825067043304443,
-0.7894519567489624,
1.2884538173675537,
-0.26146799325942993,
0.2188761681318283,
1.2484849691390991,
1.3746684789657593,
3.26606822013855,
1.8862957954406738,
-1.2395974397659302,
0.7149963974952698,
-0.16541115939617157,
-0.5625905990600586,
1.183849573135376,
-1.0467537641525269,
1.1472523212432861,
-0.29186511039733887,
-1.339465618133545,
-1.2241556644439697,
0.9558612704277039,
0.4473273754119873,
-0.034883614629507065,
-0.46810203790664673,
1.1212223768234253,
0.20736029744148254,
1.284394383430481,
0.6393507122993469,
-0.3061687648296356,
0.4279739260673523,
-0.33727243542671204,
-0.6164606213569641,
1.584937572479248,
0.07449590414762497,
-1.5548888444900513,
-2.3618390560150146,
-0.13739535212516785,
-1.075203537940979,
-0.02642161026597023,
-0.9291841387748718,
-1.0235954523086548,
1.4274156093597412,
0.4422476887702942,
-0.9397797584533691,
-0.0760820060968399,
-0.36725711822509766,
-0.5423033237457275,
2.600759744644165,
-1.353159785270691,
-0.2080712616443634,
-0.9523168802261353,
-0.5788541436195374,
1.5537776947021484,
-1.1886602640151978,
-0.2961878180503845,
-1.0367615222930908,
-0.5460045337677002,
-1.2502491474151611,
-0.36337810754776,
-0.10624347627162933,
-0.8499171137809753,
0.7033047080039978,
0.019891060888767242,
-1.2495888471603394,
-0.24726064503192902,
-1.1468086242675781,
0.9105817675590515,
-0.2613566517829895,
0.11178596317768097,
1.6585278511047363,
0.24027714133262634,
-0.4599626362323761,
0.8276284337043762,
1.3380146026611328,
0.6319798231124878,
-0.5404995679855347,
0.11888440698385239,
-0.6436122059822083,
0.5453301668167114,
-1.2406928539276123,
0.34741687774658203,
-3.020751714706421,
0.6945691108703613,
0.00889497995376587,
-0.11139766126871109,
-0.17944371700286865,
-1.5158042907714844,
0.9340871572494507,
2.410982608795166,
-1.1596834659576416,
0.6520914435386658,
0.3758067488670349,
1.1554408073425293,
-1.6687690019607544,
-0.04254718869924545,
-0.7206392288208008,
2.043369770050049,
-0.035869866609573364,
1.0822824239730835,
-0.5598179697990417,
-2.348196268081665,
0.5614848732948303,
-1.2053242921829224,
-0.9004548192024231,
0.844582200050354,
-0.9017813801765442,
0.3870188295841217,
-1.1347098350524902,
-0.10036981105804443,
-0.9199352860450745,
-1.1531741619110107,
0.488677978515625,
0.020916668698191643,
0.6130759119987488,
-0.5331860184669495,
0.2876741588115692,
-2.308885335922241,
-1.4163657426834106,
-0.11198046058416367,
-0.9402047395706177,
0.5830062627792358,
-0.46941077709198,
0.6662108302116394,
-0.07094965130090714,
0.038570523262023926,
0.2141619175672531,
1.513673186302185,
3.1961045265197754,
-0.007147951051592827,
0.28605398535728455,
-0.23437727987766266,
-1.0574040412902832,
1.550447702407837,
0.902021586894989,
-0.2676921486854553,
-0.554551362991333,
-0.9227903485298157,
1.4096827507019043,
1.9074478149414062,
1.1009228229522705,
0.10625874251127243,
-0.9450398683547974,
-0.7796695828437805,
0.1597955971956253,
0.15419532358646393,
0.4871352016925812,
0.9926089644432068,
0.15802797675132751,
0.18899913132190704,
1.2986781597137451,
1.021227478981018,
-0.268018513917923,
0.4779881536960602,
-0.8516111373901367,
-0.3554612994194031,
0.5167833566665649,
0.27127036452293396,
-0.0070333331823349,
0.2967013120651245,
-1.0209298133850098,
-0.14441320300102234,
-0.23085276782512665,
-0.7956777215003967,
-0.7694410085678101,
-0.39154452085494995,
-0.45592209696769714,
1.6915968656539917,
-0.05038570612668991,
-0.5666322112083435,
0.04596410691738129,
-0.7929159998893738,
-0.1382739096879959,
-1.0477283000946045,
0.2487080693244934,
-0.09601143002510071,
0.05437315255403519,
-0.23847033083438873,
1.59941565990448,
-0.9751170873641968,
-2.2346160411834717,
0.11177287250757217,
0.3065200448036194,
-0.2943721413612366,
-0.146977499127388,
1.8353487253189087,
0.45793861150741577,
1.3570629358291626,
1.5345275402069092,
1.0848805904388428,
-0.5783596634864807,
-1.2962243556976318,
0.7395602464675903,
0.9476937055587769,
-1.3273673057556152,
0.9690961241722107,
-0.295236736536026,
-0.5673539638519287,
0.5574313402175903,
1.3155642747879028,
0.43092721700668335,
-1.9230172634124756,
0.8828601241111755,
-1.2091889381408691,
0.9573650360107422,
0.8634772896766663,
0.8633608818054199,
0.16329975426197052,
0.8961958885192871,
-1.2571382522583008,
-1.047377586364746,
-0.5584021806716919,
-0.7238165140151978,
1.7751601934432983,
-0.30972209572792053,
0.3700762093067169,
-0.2451978623867035,
-1.2481763362884521,
0.05596177279949188,
0.7348904013633728,
0.3677845597267151,
-0.29074954986572266,
0.8113027811050415,
-0.735190749168396,
-1.0045208930969238,
-1.257240891456604,
-0.40155351161956787,
-1.0499851703643799,
-0.8625690937042236,
0.9966345429420471,
0.7386451363563538,
0.5550764799118042,
1.9738481044769287,
0.7118909955024719,
0.30111247301101685,
-2.5777361392974854,
0.7949860095977783,
0.3442125618457794,
-0.11321406066417694,
0.8516546487808228,
0.2887501120567322,
1.293009638786316,
-0.14136497676372528,
0.6108810305595398,
-2.3350491523742676,
2.2270429134368896,
-0.1746489703655243,
0.6989765763282776,
0.0393403023481369,
0.04542244225740433,
1.0152417421340942,
0.5228610038757324,
0.5158514380455017,
-1.1054234504699707,
0.9393267631530762,
-0.5121702551841736,
1.1126034259796143,
0.7939541339874268,
-0.952103316783905,
0.191393181681633,
1.2230110168457031,
0.36035847663879395,
-0.5350584983825684,
-1.087412714958191,
-0.7962648868560791,
0.9342083930969238,
1.6937237977981567,
0.034807756543159485,
0.07737456262111664,
0.8300639986991882,
0.7370695471763611,
-1.26002836227417,
-0.009052280336618423,
-0.4607684016227722,
-0.6446474194526672,
1.852189064025879,
2.0386126041412354,
-0.03280007839202881,
-0.003326933365315199,
-0.709247887134552,
-1.466346025466919,
0.8232996463775635,
0.14868341386318207,
-0.10673912614583969,
0.7464518547058105,
-0.682584285736084,
1.1407139301300049,
0.7264236211776733,
0.8358261585235596,
0.16523723304271698,
0.03686923533678055,
0.2074085921049118,
-0.2607612609863281,
-1.1987898349761963,
-0.38411810994148254,
-1.0161011219024658,
-2.630282402038574,
0.3458617031574249,
-0.2524752914905548,
-1.5209577083587646,
0.21103984117507935,
-0.9694729447364807,
0.717745840549469,
-0.5443626046180725,
-1.2185015678405762,
-1.3375681638717651,
0.31882786750793457,
-0.1412394642829895,
0.8167793154716492,
-1.6601893901824951,
-0.19902653992176056,
1.1037116050720215,
0.9414132833480835,
-0.6570442318916321,
0.884196400642395,
0.3150012493133545,
0.8986225724220276,
0.8811023831367493,
-0.40465211868286133,
0.4906463623046875,
0.2695247232913971,
-1.3696624040603638,
0.3096543550491333,
1.4145495891571045,
0.10726837813854218,
1.3049769401550293,
-0.3858179450035095,
0.03103581629693508,
0.41188332438468933,
-0.35681629180908203,
-0.5885670185089111,
-0.6551402807235718,
0.6505625247955322,
-0.11365880817174911,
-0.970037043094635,
-0.17195788025856018,
0.03840373456478119,
-0.20690909028053284,
0.2866816520690918,
-1.5037986040115356,
-0.15463963150978088,
-0.46768683195114136,
-0.6048100590705872,
-1.4411952495574951,
-0.023322168737649918,
1.2851678133010864,
-0.8356654644012451,
-0.09331055730581284,
0.5978567600250244,
0.2355591356754303,
0.5275699496269226,
0.6865015029907227,
-0.7825233936309814,
-0.17197024822235107,
-0.16094346344470978,
-0.32623642683029175,
0.297749787569046,
1.2336444854736328,
-0.062060415744781494,
-0.9853434562683105,
0.5007516145706177,
-0.2213682234287262,
0.23842033743858337,
1.9194055795669556,
-0.011262977495789528,
-0.8396544456481934,
0.33594661951065063,
-0.8431873917579651,
1.8322840929031372,
1.625205159187317,
1.3007586002349854,
-0.06077677756547928,
-0.8925566077232361,
0.6467018723487854,
-0.27913331985473633,
-0.32210421562194824,
0.9480208158493042,
0.3419659733772278,
-0.3573186993598938,
-1.3912091255187988,
0.7772976160049438,
1.237801432609558,
-0.6863256096839905,
-0.7399165630340576,
0.09559184312820435,
-0.8800296783447266,
1.276536226272583,
0.5592657923698425,
0.2834542989730835,
0.3307764232158661,
1.620394229888916,
0.7673918008804321,
-0.5593752861022949,
0.5098703503608704,
0.5005524754524231,
-0.20193035900592804,
-1.9855955839157104,
-1.1210813522338867,
0.27498871088027954,
-0.4495670199394226,
-1.5097697973251343,
1.4081804752349854,
-1.2526235580444336,
-1.0111383199691772,
0.6137832999229431,
0.10769783705472946,
1.224229097366333,
0.2902431786060333,
1.7219237089157104,
1.9879988431930542,
0.9022790789604187,
0.510475218296051,
1.110407829284668,
-0.2704068124294281,
-0.21948708593845367,
1.6824086904525757,
-0.4861108362674713,
0.6852375864982605,
1.0120024681091309,
-0.4814964234828949,
-1.252383828163147,
-0.8159440755844116,
-1.138954997062683,
-0.7322105169296265,
1.0199682712554932,
0.1717785894870758,
-1.0681838989257812,
0.31891417503356934,
1.6260918378829956,
0.037482455372810364,
-0.013000557199120522,
0.6667510271072388,
0.3542215824127197,
-0.7111058235168457,
-0.06409908086061478,
-1.0795835256576538,
0.6808148622512817,
-0.33516010642051697,
-0.36760422587394714,
0.11563677340745926,
0.6363316178321838,
1.180302619934082,
0.12174301594495773,
0.13493162393569946,
1.3067171573638916,
-1.3900039196014404,
1.2356938123703003,
-1.0254521369934082,
0.41896843910217285,
-2.2918479442596436,
1.4250742197036743,
-0.9374072551727295,
1.9764130115509033,
-2.6355533599853516,
0.49498605728149414,
-0.494548499584198,
-0.6598277688026428,
0.1766606867313385,
-0.16724860668182373,
0.11258301138877869,
-0.04444166272878647,
-0.971718430519104,
-0.13086648285388947,
-0.8682445287704468,
0.4369165599346161,
1.2777036428451538,
1.4095808267593384,
-0.9585288763046265,
-0.31435757875442505,
-1.5961378812789917,
-0.1849396824836731,
-0.5297658443450928,
0.18482112884521484,
-1.7263538837432861,
-0.1719442456960678,
-2.083515167236328,
-2.414438009262085,
-1.3306190967559814,
-1.0069478750228882,
1.3491467237472534,
0.16889353096485138,
-1.0111829042434692,
1.2029330730438232,
-0.44733068346977234,
-1.725719690322876,
1.2462425231933594,
-2.238295078277588
] |
https://github.com/huggingface/datasets/issues/5081 | Bug loading `sentence-transformers/parallel-sentences` | > What's wrong with those lines exactly ?
Stuff like this: `ParserError: Error tokenizing data. C error: Expected 2 fields in line 540345, saw 3`
| ## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("sentence-transformers/parallel-sentences")
```
raises this:
```
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [4], line 1
----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train")
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
1692 # Download and prepare data
-> 1693 builder_instance.download_and_prepare(
1694 download_config=download_config,
1695 download_mode=download_mode,
1696 ignore_verifications=ignore_verifications,
1697 try_from_hf_gcs=try_from_hf_gcs,
1698 use_auth_token=use_auth_token,
1699 )
1701 # Build dataset for splits
1702 keep_in_memory = (
1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
1704 )
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
801 if not downloaded_from_gcs:
802 prepare_split_kwargs = {
803 "file_format": file_format,
804 "max_shard_size": max_shard_size,
805 **download_and_prepare_kwargs,
806 }
--> 807 self._download_and_prepare(
808 dl_manager=dl_manager,
809 verify_infos=verify_infos,
810 **prepare_split_kwargs,
811 **download_and_prepare_kwargs,
812 )
813 # Sync info
814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
894 split_dict.add(split_generator.split_info)
896 try:
897 # Prepare split will record examples associated to the split
--> 898 self._prepare_split(split_generator, **prepare_split_kwargs)
899 except OSError as e:
900 raise OSError(
901 "Cannot find data file. "
902 + (self.manual_download_instructions or "")
903 + "\nOriginal error:\n"
904 + str(e)
905 ) from None
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size)
1506 shard_id += 1
1507 writer = writer_class(
1508 features=writer._features,
1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"),
1510 storage_options=self._fs.storage_options,
1511 embed_local_files=embed_local_files,
1512 )
-> 1513 writer.write_table(table)
1514 finally:
1515 num_shards = shard_id + 1
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size)
538 if self.pa_writer is None:
539 self._build_writer(inferred_schema=pa_table.schema)
--> 540 pa_table = table_cast(pa_table, self._schema)
541 if self.embed_local_files:
542 pa_table = embed_table_storage(pa_table)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema)
2032 """Improved version of pa.Table.cast.
2033
2034 It supports casting to feature types stored in the schema metadata.
(...)
2041 table (:obj:`pyarrow.Table`): the casted table
2042 """
2043 if table.schema != schema:
-> 2044 return cast_table_to_schema(table, schema)
2045 elif table.schema.metadata != schema.metadata:
2046 return table.replace_schema_metadata(schema.metadata)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema)
2003 features = Features.from_arrow_schema(schema)
2004 if sorted(table.column_names) != sorted(features):
-> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
2007 return pa.Table.from_arrays(arrays, schema=schema)
ValueError: Couldn't cast
Action taken on Parliament's resolutions: see Minutes: string
Následný postup na základě usnesení Parlamentu: viz zápis: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742
to
{'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)}
because column names don't match
```
## Expected results
no error
## Actual results
error
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Linux
- Python version: Python 3.9.13
- PyArrow version: pyarrow 9.0.0
- transformers 4.22.2
- datasets 2.5.2 | 491 | 25 | Bug loading `sentence-transformers/parallel-sentences`
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("sentence-transformers/parallel-sentences")
```
raises this:
```
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [4], line 1
----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train")
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
1692 # Download and prepare data
-> 1693 builder_instance.download_and_prepare(
1694 download_config=download_config,
1695 download_mode=download_mode,
1696 ignore_verifications=ignore_verifications,
1697 try_from_hf_gcs=try_from_hf_gcs,
1698 use_auth_token=use_auth_token,
1699 )
1701 # Build dataset for splits
1702 keep_in_memory = (
1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
1704 )
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
801 if not downloaded_from_gcs:
802 prepare_split_kwargs = {
803 "file_format": file_format,
804 "max_shard_size": max_shard_size,
805 **download_and_prepare_kwargs,
806 }
--> 807 self._download_and_prepare(
808 dl_manager=dl_manager,
809 verify_infos=verify_infos,
810 **prepare_split_kwargs,
811 **download_and_prepare_kwargs,
812 )
813 # Sync info
814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
894 split_dict.add(split_generator.split_info)
896 try:
897 # Prepare split will record examples associated to the split
--> 898 self._prepare_split(split_generator, **prepare_split_kwargs)
899 except OSError as e:
900 raise OSError(
901 "Cannot find data file. "
902 + (self.manual_download_instructions or "")
903 + "\nOriginal error:\n"
904 + str(e)
905 ) from None
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size)
1506 shard_id += 1
1507 writer = writer_class(
1508 features=writer._features,
1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"),
1510 storage_options=self._fs.storage_options,
1511 embed_local_files=embed_local_files,
1512 )
-> 1513 writer.write_table(table)
1514 finally:
1515 num_shards = shard_id + 1
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size)
538 if self.pa_writer is None:
539 self._build_writer(inferred_schema=pa_table.schema)
--> 540 pa_table = table_cast(pa_table, self._schema)
541 if self.embed_local_files:
542 pa_table = embed_table_storage(pa_table)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema)
2032 """Improved version of pa.Table.cast.
2033
2034 It supports casting to feature types stored in the schema metadata.
(...)
2041 table (:obj:`pyarrow.Table`): the casted table
2042 """
2043 if table.schema != schema:
-> 2044 return cast_table_to_schema(table, schema)
2045 elif table.schema.metadata != schema.metadata:
2046 return table.replace_schema_metadata(schema.metadata)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema)
2003 features = Features.from_arrow_schema(schema)
2004 if sorted(table.column_names) != sorted(features):
-> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
2007 return pa.Table.from_arrays(arrays, schema=schema)
ValueError: Couldn't cast
Action taken on Parliament's resolutions: see Minutes: string
Následný postup na základě usnesení Parlamentu: viz zápis: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742
to
{'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)}
because column names don't match
```
## Expected results
no error
## Actual results
error
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Linux
- Python version: Python 3.9.13
- PyArrow version: pyarrow 9.0.0
- transformers 4.22.2
- datasets 2.5.2
> What's wrong with those lines exactly ?
Stuff like this: `ParserError: Error tokenizing data. C error: Expected 2 fields in line 540345, saw 3`
| [
-1.1607729196548462,
-0.8821344971656799,
-0.5440049171447754,
1.4534788131713867,
0.04094377160072327,
-1.3577572107315063,
0.06716285645961761,
-0.8556927442550659,
1.5331424474716187,
-0.8014310598373413,
0.3368062674999237,
-1.6735560894012451,
-0.09366270899772644,
-0.6138854622840881,
-0.5950754880905151,
-0.6831291913986206,
-0.30963295698165894,
-0.7486061453819275,
1.1023167371749878,
2.398585319519043,
1.2118858098983765,
-1.3552902936935425,
2.8708553314208984,
0.6294194459915161,
-0.2638089060783386,
-0.8095683455467224,
0.37454164028167725,
-0.061835892498493195,
-1.3963788747787476,
-0.2799552381038666,
-0.9708189964294434,
-0.013021350838243961,
-0.7438075542449951,
-0.4452950954437256,
0.09665835648775101,
0.4958205819129944,
-0.25083693861961365,
-0.35044294595718384,
-0.48993533849716187,
-0.781643271446228,
0.6320759654045105,
-0.22998717427253723,
0.8762193322181702,
-0.3088870346546173,
1.7954128980636597,
-0.664283275604248,
0.48142674565315247,
0.5770856738090515,
1.2200980186462402,
0.2009754329919815,
0.024623507633805275,
0.3952481150627136,
0.20266154408454895,
-0.029476461932063103,
0.6813179850578308,
1.2462027072906494,
0.6170371174812317,
0.5490838289260864,
0.6951783895492554,
-2.2074904441833496,
1.3660156726837158,
-0.7546902894973755,
0.15930242836475372,
1.339640498161316,
-0.9945853352546692,
0.4561432898044586,
-1.8804855346679688,
-0.12985455989837646,
0.41642358899116516,
-2.243361711502075,
0.13057290017604828,
-1.264999270439148,
-0.5382556915283203,
0.9753740429878235,
0.3487871587276459,
-1.254485011100769,
0.024273673072457314,
-0.45619356632232666,
1.017439842224121,
0.38952019810676575,
1.0810333490371704,
-1.6091265678405762,
0.07416466623544693,
-0.10022076964378357,
0.34826111793518066,
-1.1725455522537231,
-1.6598156690597534,
0.6275768280029297,
0.5841553211212158,
0.7486143112182617,
-0.1281232088804245,
0.9245271682739258,
-1.152008295059204,
0.8701072931289673,
-0.9909219741821289,
-1.7078399658203125,
-1.3212313652038574,
-2.5293080806732178,
-2.4387102127075195,
0.8406350612640381,
-0.4293716251850128,
-0.34340181946754456,
2.0434069633483887,
-1.1373467445373535,
-1.7181628942489624,
1.0111002922058105,
0.30582621693611145,
-0.028882211074233055,
2.3612170219421387,
0.21776948869228363,
-0.9744910597801208,
0.7716489434242249,
-0.8914586305618286,
0.6756870150566101,
-0.3041660189628601,
1.2611899375915527,
0.41043874621391296,
-1.09392249584198,
1.5876736640930176,
-0.4827117919921875,
0.5492165088653564,
-0.6944707632064819,
-0.4522937834262848,
-0.5704922676086426,
0.14395421743392944,
1.9144011735916138,
-0.1515677273273468,
1.511206030845642,
-0.17043721675872803,
-1.4356852769851685,
-1.3782976865768433,
0.7554053664207458,
0.43585526943206787,
-0.8789121508598328,
0.18071871995925903,
-0.44553428888320923,
0.1305457204580307,
0.16197527945041656,
1.099850058555603,
1.232969880104065,
0.7448853850364685,
-0.1670239269733429,
-0.8482081890106201,
0.07618940621614456,
-0.11996407061815262,
-0.5044555068016052,
-1.7753862142562866,
-0.26957136392593384,
0.2257840633392334,
0.6767544746398926,
-1.2410577535629272,
2.0238614082336426,
0.8736896514892578,
2.069153070449829,
1.0275322198867798,
-0.3388373851776123,
1.5022906064987183,
0.06494046002626419,
1.9331603050231934,
-0.31136128306388855,
0.5942142009735107,
-0.5248441696166992,
-1.20709228515625,
0.6719326972961426,
-0.3905032277107239,
-1.990591049194336,
-0.43823590874671936,
-0.8558007478713989,
-0.12912701070308685,
-0.8585320711135864,
0.9881439208984375,
-0.1856396645307541,
-1.4393095970153809,
0.16072019934654236,
-0.6713976263999939,
0.19908781349658966,
-1.334209680557251,
0.25880900025367737,
0.7463904619216919,
-0.7926624417304993,
0.045744337141513824,
-0.4664824306964874,
-1.3919482231140137,
-0.6740078926086426,
0.5508342981338501,
1.814492106437683,
-0.6232456564903259,
1.000312328338623,
1.0515787601470947,
-0.623693585395813,
-0.038559116423130035,
0.4805496037006378,
-0.39618244767189026,
0.8355808854103088,
-1.0045417547225952,
-0.46483418345451355,
1.1157854795455933,
-0.35532182455062866,
-0.5617885589599609,
1.320908784866333,
0.7435839176177979,
-1.0504792928695679,
-0.3373887240886688,
-0.1702519953250885,
-0.8801996111869812,
0.03854934126138687,
-1.5435476303100586,
-0.09836166352033615,
0.28297632932662964,
-1.4990969896316528,
-0.35515913367271423,
0.01712971366941929,
1.3106437921524048,
-0.051186732947826385,
1.337631106376648,
-0.24239613115787506,
-0.12726014852523804,
-0.5051954984664917,
-0.623937726020813,
0.1426246017217636,
-0.08519873023033142,
-0.6026522517204285,
0.2735016345977783,
-0.7513298988342285,
0.16753394901752472,
1.484082579612732,
0.23394201695919037,
0.05613318085670471,
0.4708005487918854,
1.2822505235671997,
0.33458632230758667,
-0.12433266639709473,
-0.8159877061843872,
-1.6978050470352173,
2.001368284225464,
-1.5849405527114868,
1.9012515544891357,
0.7905646562576294,
-0.08221836388111115,
-1.831676959991455,
-1.7972127199172974,
1.4172390699386597,
1.1554471254348755,
2.5022006034851074,
0.5656771659851074,
0.4397628605365753,
-0.8143517374992371,
-0.7302150726318359,
0.5021730065345764,
-0.7159650921821594,
-0.8436433672904968,
0.15343615412712097,
2.3307101726531982,
1.708558201789856,
-0.3732961416244507,
-0.1972811222076416,
-0.9047452807426453,
1.3908637762069702,
-0.33648163080215454,
0.2948516309261322,
1.8993326425552368,
-0.4454544484615326,
-0.9970986247062683,
1.3910863399505615,
-2.4412710666656494,
0.374749094247818,
2.0853400230407715,
0.34447088837623596,
0.09546546638011932,
-1.1640629768371582,
-0.7377153635025024,
-0.15802809596061707,
-0.44120216369628906,
-1.204187035560608,
0.43501949310302734,
-0.25622686743736267,
-0.8229808807373047,
-1.3637855052947998,
-0.02998727560043335,
-1.2086673974990845,
-1.7207586765289307,
0.3211813271045685,
1.779596209526062,
2.2825067043304443,
-0.7894519567489624,
1.2884538173675537,
-0.26146799325942993,
0.2188761681318283,
1.2484849691390991,
1.3746684789657593,
3.26606822013855,
1.8862957954406738,
-1.2395974397659302,
0.7149963974952698,
-0.16541115939617157,
-0.5625905990600586,
1.183849573135376,
-1.0467537641525269,
1.1472523212432861,
-0.29186511039733887,
-1.339465618133545,
-1.2241556644439697,
0.9558612704277039,
0.4473273754119873,
-0.034883614629507065,
-0.46810203790664673,
1.1212223768234253,
0.20736029744148254,
1.284394383430481,
0.6393507122993469,
-0.3061687648296356,
0.4279739260673523,
-0.33727243542671204,
-0.6164606213569641,
1.584937572479248,
0.07449590414762497,
-1.5548888444900513,
-2.3618390560150146,
-0.13739535212516785,
-1.075203537940979,
-0.02642161026597023,
-0.9291841387748718,
-1.0235954523086548,
1.4274156093597412,
0.4422476887702942,
-0.9397797584533691,
-0.0760820060968399,
-0.36725711822509766,
-0.5423033237457275,
2.600759744644165,
-1.353159785270691,
-0.2080712616443634,
-0.9523168802261353,
-0.5788541436195374,
1.5537776947021484,
-1.1886602640151978,
-0.2961878180503845,
-1.0367615222930908,
-0.5460045337677002,
-1.2502491474151611,
-0.36337810754776,
-0.10624347627162933,
-0.8499171137809753,
0.7033047080039978,
0.019891060888767242,
-1.2495888471603394,
-0.24726064503192902,
-1.1468086242675781,
0.9105817675590515,
-0.2613566517829895,
0.11178596317768097,
1.6585278511047363,
0.24027714133262634,
-0.4599626362323761,
0.8276284337043762,
1.3380146026611328,
0.6319798231124878,
-0.5404995679855347,
0.11888440698385239,
-0.6436122059822083,
0.5453301668167114,
-1.2406928539276123,
0.34741687774658203,
-3.020751714706421,
0.6945691108703613,
0.00889497995376587,
-0.11139766126871109,
-0.17944371700286865,
-1.5158042907714844,
0.9340871572494507,
2.410982608795166,
-1.1596834659576416,
0.6520914435386658,
0.3758067488670349,
1.1554408073425293,
-1.6687690019607544,
-0.04254718869924545,
-0.7206392288208008,
2.043369770050049,
-0.035869866609573364,
1.0822824239730835,
-0.5598179697990417,
-2.348196268081665,
0.5614848732948303,
-1.2053242921829224,
-0.9004548192024231,
0.844582200050354,
-0.9017813801765442,
0.3870188295841217,
-1.1347098350524902,
-0.10036981105804443,
-0.9199352860450745,
-1.1531741619110107,
0.488677978515625,
0.020916668698191643,
0.6130759119987488,
-0.5331860184669495,
0.2876741588115692,
-2.308885335922241,
-1.4163657426834106,
-0.11198046058416367,
-0.9402047395706177,
0.5830062627792358,
-0.46941077709198,
0.6662108302116394,
-0.07094965130090714,
0.038570523262023926,
0.2141619175672531,
1.513673186302185,
3.1961045265197754,
-0.007147951051592827,
0.28605398535728455,
-0.23437727987766266,
-1.0574040412902832,
1.550447702407837,
0.902021586894989,
-0.2676921486854553,
-0.554551362991333,
-0.9227903485298157,
1.4096827507019043,
1.9074478149414062,
1.1009228229522705,
0.10625874251127243,
-0.9450398683547974,
-0.7796695828437805,
0.1597955971956253,
0.15419532358646393,
0.4871352016925812,
0.9926089644432068,
0.15802797675132751,
0.18899913132190704,
1.2986781597137451,
1.021227478981018,
-0.268018513917923,
0.4779881536960602,
-0.8516111373901367,
-0.3554612994194031,
0.5167833566665649,
0.27127036452293396,
-0.0070333331823349,
0.2967013120651245,
-1.0209298133850098,
-0.14441320300102234,
-0.23085276782512665,
-0.7956777215003967,
-0.7694410085678101,
-0.39154452085494995,
-0.45592209696769714,
1.6915968656539917,
-0.05038570612668991,
-0.5666322112083435,
0.04596410691738129,
-0.7929159998893738,
-0.1382739096879959,
-1.0477283000946045,
0.2487080693244934,
-0.09601143002510071,
0.05437315255403519,
-0.23847033083438873,
1.59941565990448,
-0.9751170873641968,
-2.2346160411834717,
0.11177287250757217,
0.3065200448036194,
-0.2943721413612366,
-0.146977499127388,
1.8353487253189087,
0.45793861150741577,
1.3570629358291626,
1.5345275402069092,
1.0848805904388428,
-0.5783596634864807,
-1.2962243556976318,
0.7395602464675903,
0.9476937055587769,
-1.3273673057556152,
0.9690961241722107,
-0.295236736536026,
-0.5673539638519287,
0.5574313402175903,
1.3155642747879028,
0.43092721700668335,
-1.9230172634124756,
0.8828601241111755,
-1.2091889381408691,
0.9573650360107422,
0.8634772896766663,
0.8633608818054199,
0.16329975426197052,
0.8961958885192871,
-1.2571382522583008,
-1.047377586364746,
-0.5584021806716919,
-0.7238165140151978,
1.7751601934432983,
-0.30972209572792053,
0.3700762093067169,
-0.2451978623867035,
-1.2481763362884521,
0.05596177279949188,
0.7348904013633728,
0.3677845597267151,
-0.29074954986572266,
0.8113027811050415,
-0.735190749168396,
-1.0045208930969238,
-1.257240891456604,
-0.40155351161956787,
-1.0499851703643799,
-0.8625690937042236,
0.9966345429420471,
0.7386451363563538,
0.5550764799118042,
1.9738481044769287,
0.7118909955024719,
0.30111247301101685,
-2.5777361392974854,
0.7949860095977783,
0.3442125618457794,
-0.11321406066417694,
0.8516546487808228,
0.2887501120567322,
1.293009638786316,
-0.14136497676372528,
0.6108810305595398,
-2.3350491523742676,
2.2270429134368896,
-0.1746489703655243,
0.6989765763282776,
0.0393403023481369,
0.04542244225740433,
1.0152417421340942,
0.5228610038757324,
0.5158514380455017,
-1.1054234504699707,
0.9393267631530762,
-0.5121702551841736,
1.1126034259796143,
0.7939541339874268,
-0.952103316783905,
0.191393181681633,
1.2230110168457031,
0.36035847663879395,
-0.5350584983825684,
-1.087412714958191,
-0.7962648868560791,
0.9342083930969238,
1.6937237977981567,
0.034807756543159485,
0.07737456262111664,
0.8300639986991882,
0.7370695471763611,
-1.26002836227417,
-0.009052280336618423,
-0.4607684016227722,
-0.6446474194526672,
1.852189064025879,
2.0386126041412354,
-0.03280007839202881,
-0.003326933365315199,
-0.709247887134552,
-1.466346025466919,
0.8232996463775635,
0.14868341386318207,
-0.10673912614583969,
0.7464518547058105,
-0.682584285736084,
1.1407139301300049,
0.7264236211776733,
0.8358261585235596,
0.16523723304271698,
0.03686923533678055,
0.2074085921049118,
-0.2607612609863281,
-1.1987898349761963,
-0.38411810994148254,
-1.0161011219024658,
-2.630282402038574,
0.3458617031574249,
-0.2524752914905548,
-1.5209577083587646,
0.21103984117507935,
-0.9694729447364807,
0.717745840549469,
-0.5443626046180725,
-1.2185015678405762,
-1.3375681638717651,
0.31882786750793457,
-0.1412394642829895,
0.8167793154716492,
-1.6601893901824951,
-0.19902653992176056,
1.1037116050720215,
0.9414132833480835,
-0.6570442318916321,
0.884196400642395,
0.3150012493133545,
0.8986225724220276,
0.8811023831367493,
-0.40465211868286133,
0.4906463623046875,
0.2695247232913971,
-1.3696624040603638,
0.3096543550491333,
1.4145495891571045,
0.10726837813854218,
1.3049769401550293,
-0.3858179450035095,
0.03103581629693508,
0.41188332438468933,
-0.35681629180908203,
-0.5885670185089111,
-0.6551402807235718,
0.6505625247955322,
-0.11365880817174911,
-0.970037043094635,
-0.17195788025856018,
0.03840373456478119,
-0.20690909028053284,
0.2866816520690918,
-1.5037986040115356,
-0.15463963150978088,
-0.46768683195114136,
-0.6048100590705872,
-1.4411952495574951,
-0.023322168737649918,
1.2851678133010864,
-0.8356654644012451,
-0.09331055730581284,
0.5978567600250244,
0.2355591356754303,
0.5275699496269226,
0.6865015029907227,
-0.7825233936309814,
-0.17197024822235107,
-0.16094346344470978,
-0.32623642683029175,
0.297749787569046,
1.2336444854736328,
-0.062060415744781494,
-0.9853434562683105,
0.5007516145706177,
-0.2213682234287262,
0.23842033743858337,
1.9194055795669556,
-0.011262977495789528,
-0.8396544456481934,
0.33594661951065063,
-0.8431873917579651,
1.8322840929031372,
1.625205159187317,
1.3007586002349854,
-0.06077677756547928,
-0.8925566077232361,
0.6467018723487854,
-0.27913331985473633,
-0.32210421562194824,
0.9480208158493042,
0.3419659733772278,
-0.3573186993598938,
-1.3912091255187988,
0.7772976160049438,
1.237801432609558,
-0.6863256096839905,
-0.7399165630340576,
0.09559184312820435,
-0.8800296783447266,
1.276536226272583,
0.5592657923698425,
0.2834542989730835,
0.3307764232158661,
1.620394229888916,
0.7673918008804321,
-0.5593752861022949,
0.5098703503608704,
0.5005524754524231,
-0.20193035900592804,
-1.9855955839157104,
-1.1210813522338867,
0.27498871088027954,
-0.4495670199394226,
-1.5097697973251343,
1.4081804752349854,
-1.2526235580444336,
-1.0111383199691772,
0.6137832999229431,
0.10769783705472946,
1.224229097366333,
0.2902431786060333,
1.7219237089157104,
1.9879988431930542,
0.9022790789604187,
0.510475218296051,
1.110407829284668,
-0.2704068124294281,
-0.21948708593845367,
1.6824086904525757,
-0.4861108362674713,
0.6852375864982605,
1.0120024681091309,
-0.4814964234828949,
-1.252383828163147,
-0.8159440755844116,
-1.138954997062683,
-0.7322105169296265,
1.0199682712554932,
0.1717785894870758,
-1.0681838989257812,
0.31891417503356934,
1.6260918378829956,
0.037482455372810364,
-0.013000557199120522,
0.6667510271072388,
0.3542215824127197,
-0.7111058235168457,
-0.06409908086061478,
-1.0795835256576538,
0.6808148622512817,
-0.33516010642051697,
-0.36760422587394714,
0.11563677340745926,
0.6363316178321838,
1.180302619934082,
0.12174301594495773,
0.13493162393569946,
1.3067171573638916,
-1.3900039196014404,
1.2356938123703003,
-1.0254521369934082,
0.41896843910217285,
-2.2918479442596436,
1.4250742197036743,
-0.9374072551727295,
1.9764130115509033,
-2.6355533599853516,
0.49498605728149414,
-0.494548499584198,
-0.6598277688026428,
0.1766606867313385,
-0.16724860668182373,
0.11258301138877869,
-0.04444166272878647,
-0.971718430519104,
-0.13086648285388947,
-0.8682445287704468,
0.4369165599346161,
1.2777036428451538,
1.4095808267593384,
-0.9585288763046265,
-0.31435757875442505,
-1.5961378812789917,
-0.1849396824836731,
-0.5297658443450928,
0.18482112884521484,
-1.7263538837432861,
-0.1719442456960678,
-2.083515167236328,
-2.414438009262085,
-1.3306190967559814,
-1.0069478750228882,
1.3491467237472534,
0.16889353096485138,
-1.0111829042434692,
1.2029330730438232,
-0.44733068346977234,
-1.725719690322876,
1.2462425231933594,
-2.238295078277588
] |
https://github.com/huggingface/datasets/issues/5081 | Bug loading `sentence-transformers/parallel-sentences` | > Maybe passing error_bad_lines=False (and maybe warn_bad_lines=True) can be helpful
Yes. That would hide the issue but not solve it. | ## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("sentence-transformers/parallel-sentences")
```
raises this:
```
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [4], line 1
----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train")
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
1692 # Download and prepare data
-> 1693 builder_instance.download_and_prepare(
1694 download_config=download_config,
1695 download_mode=download_mode,
1696 ignore_verifications=ignore_verifications,
1697 try_from_hf_gcs=try_from_hf_gcs,
1698 use_auth_token=use_auth_token,
1699 )
1701 # Build dataset for splits
1702 keep_in_memory = (
1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
1704 )
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
801 if not downloaded_from_gcs:
802 prepare_split_kwargs = {
803 "file_format": file_format,
804 "max_shard_size": max_shard_size,
805 **download_and_prepare_kwargs,
806 }
--> 807 self._download_and_prepare(
808 dl_manager=dl_manager,
809 verify_infos=verify_infos,
810 **prepare_split_kwargs,
811 **download_and_prepare_kwargs,
812 )
813 # Sync info
814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
894 split_dict.add(split_generator.split_info)
896 try:
897 # Prepare split will record examples associated to the split
--> 898 self._prepare_split(split_generator, **prepare_split_kwargs)
899 except OSError as e:
900 raise OSError(
901 "Cannot find data file. "
902 + (self.manual_download_instructions or "")
903 + "\nOriginal error:\n"
904 + str(e)
905 ) from None
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size)
1506 shard_id += 1
1507 writer = writer_class(
1508 features=writer._features,
1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"),
1510 storage_options=self._fs.storage_options,
1511 embed_local_files=embed_local_files,
1512 )
-> 1513 writer.write_table(table)
1514 finally:
1515 num_shards = shard_id + 1
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size)
538 if self.pa_writer is None:
539 self._build_writer(inferred_schema=pa_table.schema)
--> 540 pa_table = table_cast(pa_table, self._schema)
541 if self.embed_local_files:
542 pa_table = embed_table_storage(pa_table)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema)
2032 """Improved version of pa.Table.cast.
2033
2034 It supports casting to feature types stored in the schema metadata.
(...)
2041 table (:obj:`pyarrow.Table`): the casted table
2042 """
2043 if table.schema != schema:
-> 2044 return cast_table_to_schema(table, schema)
2045 elif table.schema.metadata != schema.metadata:
2046 return table.replace_schema_metadata(schema.metadata)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema)
2003 features = Features.from_arrow_schema(schema)
2004 if sorted(table.column_names) != sorted(features):
-> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
2007 return pa.Table.from_arrays(arrays, schema=schema)
ValueError: Couldn't cast
Action taken on Parliament's resolutions: see Minutes: string
Následný postup na základě usnesení Parlamentu: viz zápis: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742
to
{'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)}
because column names don't match
```
## Expected results
no error
## Actual results
error
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Linux
- Python version: Python 3.9.13
- PyArrow version: pyarrow 9.0.0
- transformers 4.22.2
- datasets 2.5.2 | 491 | 20 | Bug loading `sentence-transformers/parallel-sentences`
## Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("sentence-transformers/parallel-sentences")
```
raises this:
```
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
/home/phmay/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py:697: FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols'
return pd.read_csv(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), **kwargs)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [4], line 1
----> 1 dataset = load_dataset("sentence-transformers/parallel-sentences", split="train")
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/load.py:1693, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs)
1690 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
1692 # Download and prepare data
-> 1693 builder_instance.download_and_prepare(
1694 download_config=download_config,
1695 download_mode=download_mode,
1696 ignore_verifications=ignore_verifications,
1697 try_from_hf_gcs=try_from_hf_gcs,
1698 use_auth_token=use_auth_token,
1699 )
1701 # Build dataset for splits
1702 keep_in_memory = (
1703 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
1704 )
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:807, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, storage_options, **download_and_prepare_kwargs)
801 if not downloaded_from_gcs:
802 prepare_split_kwargs = {
803 "file_format": file_format,
804 "max_shard_size": max_shard_size,
805 **download_and_prepare_kwargs,
806 }
--> 807 self._download_and_prepare(
808 dl_manager=dl_manager,
809 verify_infos=verify_infos,
810 **prepare_split_kwargs,
811 **download_and_prepare_kwargs,
812 )
813 # Sync info
814 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:898, in DatasetBuilder._download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
894 split_dict.add(split_generator.split_info)
896 try:
897 # Prepare split will record examples associated to the split
--> 898 self._prepare_split(split_generator, **prepare_split_kwargs)
899 except OSError as e:
900 raise OSError(
901 "Cannot find data file. "
902 + (self.manual_download_instructions or "")
903 + "\nOriginal error:\n"
904 + str(e)
905 ) from None
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/builder.py:1513, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, max_shard_size)
1506 shard_id += 1
1507 writer = writer_class(
1508 features=writer._features,
1509 path=fpath.replace("SSSSS", f"{shard_id:05d}"),
1510 storage_options=self._fs.storage_options,
1511 embed_local_files=embed_local_files,
1512 )
-> 1513 writer.write_table(table)
1514 finally:
1515 num_shards = shard_id + 1
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/arrow_writer.py:540, in ArrowWriter.write_table(self, pa_table, writer_batch_size)
538 if self.pa_writer is None:
539 self._build_writer(inferred_schema=pa_table.schema)
--> 540 pa_table = table_cast(pa_table, self._schema)
541 if self.embed_local_files:
542 pa_table = embed_table_storage(pa_table)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2044, in table_cast(table, schema)
2032 """Improved version of pa.Table.cast.
2033
2034 It supports casting to feature types stored in the schema metadata.
(...)
2041 table (:obj:`pyarrow.Table`): the casted table
2042 """
2043 if table.schema != schema:
-> 2044 return cast_table_to_schema(table, schema)
2045 elif table.schema.metadata != schema.metadata:
2046 return table.replace_schema_metadata(schema.metadata)
File ~/miniconda3/envs/paraphrase-mining/lib/python3.9/site-packages/datasets/table.py:2005, in cast_table_to_schema(table, schema)
2003 features = Features.from_arrow_schema(schema)
2004 if sorted(table.column_names) != sorted(features):
-> 2005 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
2006 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
2007 return pa.Table.from_arrays(arrays, schema=schema)
ValueError: Couldn't cast
Action taken on Parliament's resolutions: see Minutes: string
Následný postup na základě usnesení Parlamentu: viz zápis: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 742
to
{'Membership of Parliament: see Minutes': Value(dtype='string', id=None), 'Състав на Парламента: вж. протоколи': Value(dtype='string', id=None)}
because column names don't match
```
## Expected results
no error
## Actual results
error
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Linux
- Python version: Python 3.9.13
- PyArrow version: pyarrow 9.0.0
- transformers 4.22.2
- datasets 2.5.2
> Maybe passing error_bad_lines=False (and maybe warn_bad_lines=True) can be helpful
Yes. That would hide the issue but not solve it. | [
-1.1607729196548462,
-0.8821344971656799,
-0.5440049171447754,
1.4534788131713867,
0.04094377160072327,
-1.3577572107315063,
0.06716285645961761,
-0.8556927442550659,
1.5331424474716187,
-0.8014310598373413,
0.3368062674999237,
-1.6735560894012451,
-0.09366270899772644,
-0.6138854622840881,
-0.5950754880905151,
-0.6831291913986206,
-0.30963295698165894,
-0.7486061453819275,
1.1023167371749878,
2.398585319519043,
1.2118858098983765,
-1.3552902936935425,
2.8708553314208984,
0.6294194459915161,
-0.2638089060783386,
-0.8095683455467224,
0.37454164028167725,
-0.061835892498493195,
-1.3963788747787476,
-0.2799552381038666,
-0.9708189964294434,
-0.013021350838243961,
-0.7438075542449951,
-0.4452950954437256,
0.09665835648775101,
0.4958205819129944,
-0.25083693861961365,
-0.35044294595718384,
-0.48993533849716187,
-0.781643271446228,
0.6320759654045105,
-0.22998717427253723,
0.8762193322181702,
-0.3088870346546173,
1.7954128980636597,
-0.664283275604248,
0.48142674565315247,
0.5770856738090515,
1.2200980186462402,
0.2009754329919815,
0.024623507633805275,
0.3952481150627136,
0.20266154408454895,
-0.029476461932063103,
0.6813179850578308,
1.2462027072906494,
0.6170371174812317,
0.5490838289260864,
0.6951783895492554,
-2.2074904441833496,
1.3660156726837158,
-0.7546902894973755,
0.15930242836475372,
1.339640498161316,
-0.9945853352546692,
0.4561432898044586,
-1.8804855346679688,
-0.12985455989837646,
0.41642358899116516,
-2.243361711502075,
0.13057290017604828,
-1.264999270439148,
-0.5382556915283203,
0.9753740429878235,
0.3487871587276459,
-1.254485011100769,
0.024273673072457314,
-0.45619356632232666,
1.017439842224121,
0.38952019810676575,
1.0810333490371704,
-1.6091265678405762,
0.07416466623544693,
-0.10022076964378357,
0.34826111793518066,
-1.1725455522537231,
-1.6598156690597534,
0.6275768280029297,
0.5841553211212158,
0.7486143112182617,
-0.1281232088804245,
0.9245271682739258,
-1.152008295059204,
0.8701072931289673,
-0.9909219741821289,
-1.7078399658203125,
-1.3212313652038574,
-2.5293080806732178,
-2.4387102127075195,
0.8406350612640381,
-0.4293716251850128,
-0.34340181946754456,
2.0434069633483887,
-1.1373467445373535,
-1.7181628942489624,
1.0111002922058105,
0.30582621693611145,
-0.028882211074233055,
2.3612170219421387,
0.21776948869228363,
-0.9744910597801208,
0.7716489434242249,
-0.8914586305618286,
0.6756870150566101,
-0.3041660189628601,
1.2611899375915527,
0.41043874621391296,
-1.09392249584198,
1.5876736640930176,
-0.4827117919921875,
0.5492165088653564,
-0.6944707632064819,
-0.4522937834262848,
-0.5704922676086426,
0.14395421743392944,
1.9144011735916138,
-0.1515677273273468,
1.511206030845642,
-0.17043721675872803,
-1.4356852769851685,
-1.3782976865768433,
0.7554053664207458,
0.43585526943206787,
-0.8789121508598328,
0.18071871995925903,
-0.44553428888320923,
0.1305457204580307,
0.16197527945041656,
1.099850058555603,
1.232969880104065,
0.7448853850364685,
-0.1670239269733429,
-0.8482081890106201,
0.07618940621614456,
-0.11996407061815262,
-0.5044555068016052,
-1.7753862142562866,
-0.26957136392593384,
0.2257840633392334,
0.6767544746398926,
-1.2410577535629272,
2.0238614082336426,
0.8736896514892578,
2.069153070449829,
1.0275322198867798,
-0.3388373851776123,
1.5022906064987183,
0.06494046002626419,
1.9331603050231934,
-0.31136128306388855,
0.5942142009735107,
-0.5248441696166992,
-1.20709228515625,
0.6719326972961426,
-0.3905032277107239,
-1.990591049194336,
-0.43823590874671936,
-0.8558007478713989,
-0.12912701070308685,
-0.8585320711135864,
0.9881439208984375,
-0.1856396645307541,
-1.4393095970153809,
0.16072019934654236,
-0.6713976263999939,
0.19908781349658966,
-1.334209680557251,
0.25880900025367737,
0.7463904619216919,
-0.7926624417304993,
0.045744337141513824,
-0.4664824306964874,
-1.3919482231140137,
-0.6740078926086426,
0.5508342981338501,
1.814492106437683,
-0.6232456564903259,
1.000312328338623,
1.0515787601470947,
-0.623693585395813,
-0.038559116423130035,
0.4805496037006378,
-0.39618244767189026,
0.8355808854103088,
-1.0045417547225952,
-0.46483418345451355,
1.1157854795455933,
-0.35532182455062866,
-0.5617885589599609,
1.320908784866333,
0.7435839176177979,
-1.0504792928695679,
-0.3373887240886688,
-0.1702519953250885,
-0.8801996111869812,
0.03854934126138687,
-1.5435476303100586,
-0.09836166352033615,
0.28297632932662964,
-1.4990969896316528,
-0.35515913367271423,
0.01712971366941929,
1.3106437921524048,
-0.051186732947826385,
1.337631106376648,
-0.24239613115787506,
-0.12726014852523804,
-0.5051954984664917,
-0.623937726020813,
0.1426246017217636,
-0.08519873023033142,
-0.6026522517204285,
0.2735016345977783,
-0.7513298988342285,
0.16753394901752472,
1.484082579612732,
0.23394201695919037,
0.05613318085670471,
0.4708005487918854,
1.2822505235671997,
0.33458632230758667,
-0.12433266639709473,
-0.8159877061843872,
-1.6978050470352173,
2.001368284225464,
-1.5849405527114868,
1.9012515544891357,
0.7905646562576294,
-0.08221836388111115,
-1.831676959991455,
-1.7972127199172974,
1.4172390699386597,
1.1554471254348755,
2.5022006034851074,
0.5656771659851074,
0.4397628605365753,
-0.8143517374992371,
-0.7302150726318359,
0.5021730065345764,
-0.7159650921821594,
-0.8436433672904968,
0.15343615412712097,
2.3307101726531982,
1.708558201789856,
-0.3732961416244507,
-0.1972811222076416,
-0.9047452807426453,
1.3908637762069702,
-0.33648163080215454,
0.2948516309261322,
1.8993326425552368,
-0.4454544484615326,
-0.9970986247062683,
1.3910863399505615,
-2.4412710666656494,
0.374749094247818,
2.0853400230407715,
0.34447088837623596,
0.09546546638011932,
-1.1640629768371582,
-0.7377153635025024,
-0.15802809596061707,
-0.44120216369628906,
-1.204187035560608,
0.43501949310302734,
-0.25622686743736267,
-0.8229808807373047,
-1.3637855052947998,
-0.02998727560043335,
-1.2086673974990845,
-1.7207586765289307,
0.3211813271045685,
1.779596209526062,
2.2825067043304443,
-0.7894519567489624,
1.2884538173675537,
-0.26146799325942993,
0.2188761681318283,
1.2484849691390991,
1.3746684789657593,
3.26606822013855,
1.8862957954406738,
-1.2395974397659302,
0.7149963974952698,
-0.16541115939617157,
-0.5625905990600586,
1.183849573135376,
-1.0467537641525269,
1.1472523212432861,
-0.29186511039733887,
-1.339465618133545,
-1.2241556644439697,
0.9558612704277039,
0.4473273754119873,
-0.034883614629507065,
-0.46810203790664673,
1.1212223768234253,
0.20736029744148254,
1.284394383430481,
0.6393507122993469,
-0.3061687648296356,
0.4279739260673523,
-0.33727243542671204,
-0.6164606213569641,
1.584937572479248,
0.07449590414762497,
-1.5548888444900513,
-2.3618390560150146,
-0.13739535212516785,
-1.075203537940979,
-0.02642161026597023,
-0.9291841387748718,
-1.0235954523086548,
1.4274156093597412,
0.4422476887702942,
-0.9397797584533691,
-0.0760820060968399,
-0.36725711822509766,
-0.5423033237457275,
2.600759744644165,
-1.353159785270691,
-0.2080712616443634,
-0.9523168802261353,
-0.5788541436195374,
1.5537776947021484,
-1.1886602640151978,
-0.2961878180503845,
-1.0367615222930908,
-0.5460045337677002,
-1.2502491474151611,
-0.36337810754776,
-0.10624347627162933,
-0.8499171137809753,
0.7033047080039978,
0.019891060888767242,
-1.2495888471603394,
-0.24726064503192902,
-1.1468086242675781,
0.9105817675590515,
-0.2613566517829895,
0.11178596317768097,
1.6585278511047363,
0.24027714133262634,
-0.4599626362323761,
0.8276284337043762,
1.3380146026611328,
0.6319798231124878,
-0.5404995679855347,
0.11888440698385239,
-0.6436122059822083,
0.5453301668167114,
-1.2406928539276123,
0.34741687774658203,
-3.020751714706421,
0.6945691108703613,
0.00889497995376587,
-0.11139766126871109,
-0.17944371700286865,
-1.5158042907714844,
0.9340871572494507,
2.410982608795166,
-1.1596834659576416,
0.6520914435386658,
0.3758067488670349,
1.1554408073425293,
-1.6687690019607544,
-0.04254718869924545,
-0.7206392288208008,
2.043369770050049,
-0.035869866609573364,
1.0822824239730835,
-0.5598179697990417,
-2.348196268081665,
0.5614848732948303,
-1.2053242921829224,
-0.9004548192024231,
0.844582200050354,
-0.9017813801765442,
0.3870188295841217,
-1.1347098350524902,
-0.10036981105804443,
-0.9199352860450745,
-1.1531741619110107,
0.488677978515625,
0.020916668698191643,
0.6130759119987488,
-0.5331860184669495,
0.2876741588115692,
-2.308885335922241,
-1.4163657426834106,
-0.11198046058416367,
-0.9402047395706177,
0.5830062627792358,
-0.46941077709198,
0.6662108302116394,
-0.07094965130090714,
0.038570523262023926,
0.2141619175672531,
1.513673186302185,
3.1961045265197754,
-0.007147951051592827,
0.28605398535728455,
-0.23437727987766266,
-1.0574040412902832,
1.550447702407837,
0.902021586894989,
-0.2676921486854553,
-0.554551362991333,
-0.9227903485298157,
1.4096827507019043,
1.9074478149414062,
1.1009228229522705,
0.10625874251127243,
-0.9450398683547974,
-0.7796695828437805,
0.1597955971956253,
0.15419532358646393,
0.4871352016925812,
0.9926089644432068,
0.15802797675132751,
0.18899913132190704,
1.2986781597137451,
1.021227478981018,
-0.268018513917923,
0.4779881536960602,
-0.8516111373901367,
-0.3554612994194031,
0.5167833566665649,
0.27127036452293396,
-0.0070333331823349,
0.2967013120651245,
-1.0209298133850098,
-0.14441320300102234,
-0.23085276782512665,
-0.7956777215003967,
-0.7694410085678101,
-0.39154452085494995,
-0.45592209696769714,
1.6915968656539917,
-0.05038570612668991,
-0.5666322112083435,
0.04596410691738129,
-0.7929159998893738,
-0.1382739096879959,
-1.0477283000946045,
0.2487080693244934,
-0.09601143002510071,
0.05437315255403519,
-0.23847033083438873,
1.59941565990448,
-0.9751170873641968,
-2.2346160411834717,
0.11177287250757217,
0.3065200448036194,
-0.2943721413612366,
-0.146977499127388,
1.8353487253189087,
0.45793861150741577,
1.3570629358291626,
1.5345275402069092,
1.0848805904388428,
-0.5783596634864807,
-1.2962243556976318,
0.7395602464675903,
0.9476937055587769,
-1.3273673057556152,
0.9690961241722107,
-0.295236736536026,
-0.5673539638519287,
0.5574313402175903,
1.3155642747879028,
0.43092721700668335,
-1.9230172634124756,
0.8828601241111755,
-1.2091889381408691,
0.9573650360107422,
0.8634772896766663,
0.8633608818054199,
0.16329975426197052,
0.8961958885192871,
-1.2571382522583008,
-1.047377586364746,
-0.5584021806716919,
-0.7238165140151978,
1.7751601934432983,
-0.30972209572792053,
0.3700762093067169,
-0.2451978623867035,
-1.2481763362884521,
0.05596177279949188,
0.7348904013633728,
0.3677845597267151,
-0.29074954986572266,
0.8113027811050415,
-0.735190749168396,
-1.0045208930969238,
-1.257240891456604,
-0.40155351161956787,
-1.0499851703643799,
-0.8625690937042236,
0.9966345429420471,
0.7386451363563538,
0.5550764799118042,
1.9738481044769287,
0.7118909955024719,
0.30111247301101685,
-2.5777361392974854,
0.7949860095977783,
0.3442125618457794,
-0.11321406066417694,
0.8516546487808228,
0.2887501120567322,
1.293009638786316,
-0.14136497676372528,
0.6108810305595398,
-2.3350491523742676,
2.2270429134368896,
-0.1746489703655243,
0.6989765763282776,
0.0393403023481369,
0.04542244225740433,
1.0152417421340942,
0.5228610038757324,
0.5158514380455017,
-1.1054234504699707,
0.9393267631530762,
-0.5121702551841736,
1.1126034259796143,
0.7939541339874268,
-0.952103316783905,
0.191393181681633,
1.2230110168457031,
0.36035847663879395,
-0.5350584983825684,
-1.087412714958191,
-0.7962648868560791,
0.9342083930969238,
1.6937237977981567,
0.034807756543159485,
0.07737456262111664,
0.8300639986991882,
0.7370695471763611,
-1.26002836227417,
-0.009052280336618423,
-0.4607684016227722,
-0.6446474194526672,
1.852189064025879,
2.0386126041412354,
-0.03280007839202881,
-0.003326933365315199,
-0.709247887134552,
-1.466346025466919,
0.8232996463775635,
0.14868341386318207,
-0.10673912614583969,
0.7464518547058105,
-0.682584285736084,
1.1407139301300049,
0.7264236211776733,
0.8358261585235596,
0.16523723304271698,
0.03686923533678055,
0.2074085921049118,
-0.2607612609863281,
-1.1987898349761963,
-0.38411810994148254,
-1.0161011219024658,
-2.630282402038574,
0.3458617031574249,
-0.2524752914905548,
-1.5209577083587646,
0.21103984117507935,
-0.9694729447364807,
0.717745840549469,
-0.5443626046180725,
-1.2185015678405762,
-1.3375681638717651,
0.31882786750793457,
-0.1412394642829895,
0.8167793154716492,
-1.6601893901824951,
-0.19902653992176056,
1.1037116050720215,
0.9414132833480835,
-0.6570442318916321,
0.884196400642395,
0.3150012493133545,
0.8986225724220276,
0.8811023831367493,
-0.40465211868286133,
0.4906463623046875,
0.2695247232913971,
-1.3696624040603638,
0.3096543550491333,
1.4145495891571045,
0.10726837813854218,
1.3049769401550293,
-0.3858179450035095,
0.03103581629693508,
0.41188332438468933,
-0.35681629180908203,
-0.5885670185089111,
-0.6551402807235718,
0.6505625247955322,
-0.11365880817174911,
-0.970037043094635,
-0.17195788025856018,
0.03840373456478119,
-0.20690909028053284,
0.2866816520690918,
-1.5037986040115356,
-0.15463963150978088,
-0.46768683195114136,
-0.6048100590705872,
-1.4411952495574951,
-0.023322168737649918,
1.2851678133010864,
-0.8356654644012451,
-0.09331055730581284,
0.5978567600250244,
0.2355591356754303,
0.5275699496269226,
0.6865015029907227,
-0.7825233936309814,
-0.17197024822235107,
-0.16094346344470978,
-0.32623642683029175,
0.297749787569046,
1.2336444854736328,
-0.062060415744781494,
-0.9853434562683105,
0.5007516145706177,
-0.2213682234287262,
0.23842033743858337,
1.9194055795669556,
-0.011262977495789528,
-0.8396544456481934,
0.33594661951065063,
-0.8431873917579651,
1.8322840929031372,
1.625205159187317,
1.3007586002349854,
-0.06077677756547928,
-0.8925566077232361,
0.6467018723487854,
-0.27913331985473633,
-0.32210421562194824,
0.9480208158493042,
0.3419659733772278,
-0.3573186993598938,
-1.3912091255187988,
0.7772976160049438,
1.237801432609558,
-0.6863256096839905,
-0.7399165630340576,
0.09559184312820435,
-0.8800296783447266,
1.276536226272583,
0.5592657923698425,
0.2834542989730835,
0.3307764232158661,
1.620394229888916,
0.7673918008804321,
-0.5593752861022949,
0.5098703503608704,
0.5005524754524231,
-0.20193035900592804,
-1.9855955839157104,
-1.1210813522338867,
0.27498871088027954,
-0.4495670199394226,
-1.5097697973251343,
1.4081804752349854,
-1.2526235580444336,
-1.0111383199691772,
0.6137832999229431,
0.10769783705472946,
1.224229097366333,
0.2902431786060333,
1.7219237089157104,
1.9879988431930542,
0.9022790789604187,
0.510475218296051,
1.110407829284668,
-0.2704068124294281,
-0.21948708593845367,
1.6824086904525757,
-0.4861108362674713,
0.6852375864982605,
1.0120024681091309,
-0.4814964234828949,
-1.252383828163147,
-0.8159440755844116,
-1.138954997062683,
-0.7322105169296265,
1.0199682712554932,
0.1717785894870758,
-1.0681838989257812,
0.31891417503356934,
1.6260918378829956,
0.037482455372810364,
-0.013000557199120522,
0.6667510271072388,
0.3542215824127197,
-0.7111058235168457,
-0.06409908086061478,
-1.0795835256576538,
0.6808148622512817,
-0.33516010642051697,
-0.36760422587394714,
0.11563677340745926,
0.6363316178321838,
1.180302619934082,
0.12174301594495773,
0.13493162393569946,
1.3067171573638916,
-1.3900039196014404,
1.2356938123703003,
-1.0254521369934082,
0.41896843910217285,
-2.2918479442596436,
1.4250742197036743,
-0.9374072551727295,
1.9764130115509033,
-2.6355533599853516,
0.49498605728149414,
-0.494548499584198,
-0.6598277688026428,
0.1766606867313385,
-0.16724860668182373,
0.11258301138877869,
-0.04444166272878647,
-0.971718430519104,
-0.13086648285388947,
-0.8682445287704468,
0.4369165599346161,
1.2777036428451538,
1.4095808267593384,
-0.9585288763046265,
-0.31435757875442505,
-1.5961378812789917,
-0.1849396824836731,
-0.5297658443450928,
0.18482112884521484,
-1.7263538837432861,
-0.1719442456960678,
-2.083515167236328,
-2.414438009262085,
-1.3306190967559814,
-1.0069478750228882,
1.3491467237472534,
0.16889353096485138,
-1.0111829042434692,
1.2029330730438232,
-0.44733068346977234,
-1.725719690322876,
1.2462425231933594,
-2.238295078277588
] |
https://github.com/huggingface/datasets/issues/5074 | Replace AssertionErrors with more meaningful errors | Looks like the top-level `datasource` directory was removed when https://github.com/huggingface/datasets/pull/4974 was merged, so there are 3 source files to fix. | Replace the AssertionErrors with more meaningful errors such as ValueError, TypeError, etc.
The files with AssertionErrors that need to be replaced:
```
src/datasets/arrow_reader.py
src/datasets/builder.py
src/datasets/utils/version.py
``` | 494 | 20 | Replace AssertionErrors with more meaningful errors
Replace the AssertionErrors with more meaningful errors such as ValueError, TypeError, etc.
The files with AssertionErrors that need to be replaced:
```
src/datasets/arrow_reader.py
src/datasets/builder.py
src/datasets/utils/version.py
```
Looks like the top-level `datasource` directory was removed when https://github.com/huggingface/datasets/pull/4974 was merged, so there are 3 source files to fix. | [
-1.1891648769378662,
-0.8220502138137817,
-0.8862897157669067,
1.4116299152374268,
-0.18645091354846954,
-1.241629958152771,
0.18752391636371613,
-1.115193486213684,
1.618017315864563,
-0.7106717824935913,
0.26914140582084656,
-1.8162603378295898,
-0.06994334608316422,
-0.5199590921401978,
-0.6952865123748779,
-0.780950129032135,
-0.44364893436431885,
-0.7269124388694763,
0.919439971446991,
2.4877538681030273,
1.2541083097457886,
-1.255456566810608,
2.7203314304351807,
0.7341715097427368,
-0.21803703904151917,
-1.0458303689956665,
0.6233536601066589,
0.18460339307785034,
-1.1946487426757812,
-0.34856754541397095,
-0.914625346660614,
-0.04326408728957176,
-0.5697342157363892,
-0.3817465305328369,
0.0820157527923584,
0.39066269993782043,
-0.22023169696331024,
-0.2387208193540573,
-0.6353045701980591,
-0.8004005551338196,
0.43578293919563293,
-0.40060949325561523,
0.8978140950202942,
-0.40954694151878357,
1.7577390670776367,
-0.4905284643173218,
0.30878013372421265,
0.7713698148727417,
1.4593515396118164,
0.16683457791805267,
-0.047905150800943375,
0.2597406208515167,
0.3043871521949768,
0.0234377458691597,
0.4182298481464386,
1.1832497119903564,
0.5169717669487,
0.5876564979553223,
0.604383647441864,
-2.1706817150115967,
1.3361239433288574,
-0.8659979701042175,
0.2114207148551941,
1.3558714389801025,
-0.9761760234832764,
0.36023154854774475,
-1.8890184164047241,
-0.08890452980995178,
0.48191577196121216,
-2.4474565982818604,
0.21260200440883636,
-1.1733487844467163,
-0.6007838249206543,
0.9534658193588257,
0.29846855998039246,
-1.3178682327270508,
0.18821905553340912,
-0.41210928559303284,
1.0176390409469604,
0.5765967965126038,
1.1678063869476318,
-1.6402432918548584,
0.19194425642490387,
-0.27180594205856323,
-0.0661252960562706,
-1.447516679763794,
-1.4582507610321045,
0.5342769622802734,
0.597037136554718,
0.712314248085022,
-0.06344781816005707,
0.9479029178619385,
-0.8122687339782715,
0.7136787176132202,
-0.7534168362617493,
-1.6967827081680298,
-1.2523269653320312,
-2.246438503265381,
-2.2472126483917236,
0.9170722365379333,
-0.502160906791687,
-0.6254069209098816,
2.033290386199951,
-0.8644250631332397,
-2.0204415321350098,
1.043715000152588,
0.4279498755931854,
-0.012520893476903439,
2.531318426132202,
0.34744760394096375,
-0.5969762802124023,
0.2583719491958618,
-0.7387681603431702,
0.9031869173049927,
-0.4010755717754364,
1.4527794122695923,
0.5693565607070923,
-1.0346131324768066,
1.7308666706085205,
-0.3563164472579956,
0.5955668091773987,
-0.733424723148346,
-0.6398264169692993,
-0.750452995300293,
0.3082658052444458,
1.920008659362793,
-0.3909876048564911,
1.4966049194335938,
-0.3954930603504181,
-1.5553401708602905,
-1.5783830881118774,
0.8159002661705017,
0.5614324808120728,
-0.7629109621047974,
0.03229383006691933,
-0.30835118889808655,
0.0017507551237940788,
0.030796833336353302,
1.0794779062271118,
1.1810702085494995,
0.5823794007301331,
-0.2892777919769287,
-0.8045873641967773,
0.2838568091392517,
0.011638356372714043,
-0.6254425644874573,
-1.8407663106918335,
-0.378995418548584,
0.13863930106163025,
0.6594735980033875,
-1.252341866493225,
1.7635380029678345,
0.8310241103172302,
2.0722992420196533,
0.9036848545074463,
-0.40300190448760986,
1.4462484121322632,
-0.22064431011676788,
1.8745126724243164,
-0.4683227241039276,
0.5976163148880005,
-0.25556400418281555,
-1.1485586166381836,
0.8563713431358337,
-0.26229581236839294,
-2.0922744274139404,
-0.8379173278808594,
-0.9533880352973938,
-0.14604529738426208,
-0.6202371120452881,
0.9522770047187805,
-0.26926717162132263,
-1.3113439083099365,
-0.06173006072640419,
-0.578427255153656,
0.07373708486557007,
-1.3913851976394653,
0.18932868540287018,
0.6731332540512085,
-0.7277414202690125,
-0.12448835372924805,
-0.3117204010486603,
-1.293001413345337,
-0.6152346730232239,
0.315807968378067,
1.877487063407898,
-0.6003413796424866,
0.9741169810295105,
0.9769291877746582,
-1.021598219871521,
0.19142891466617584,
0.25356176495552063,
-0.32794350385665894,
0.7916317582130432,
-1.0893784761428833,
-0.4239121079444885,
1.1376187801361084,
-0.13350524008274078,
-0.6939333081245422,
1.4442553520202637,
0.8804835081100464,
-1.1430388689041138,
-0.17996738851070404,
-0.3511582314968109,
-0.7255369424819946,
0.07093891501426697,
-1.586438775062561,
-0.24278302490711212,
0.18236300349235535,
-1.3591359853744507,
-0.46491774916648865,
-0.24627088010311127,
1.428214430809021,
-0.10181468725204468,
1.2941949367523193,
-0.15361079573631287,
-0.30654311180114746,
-0.3319424092769623,
-0.5524331331253052,
0.12656572461128235,
-0.1102031022310257,
-0.5295770764350891,
0.3562353551387787,
-0.9609400629997253,
0.41761600971221924,
1.465380311012268,
0.3449976444244385,
0.14405888319015503,
0.6304078102111816,
0.9748977422714233,
0.37478190660476685,
-0.16135874390602112,
-0.9436021447181702,
-1.6018297672271729,
1.9450485706329346,
-1.397927165031433,
1.9278916120529175,
0.6650564670562744,
-0.06656676530838013,
-1.7253297567367554,
-1.9201006889343262,
1.5127123594284058,
1.2750264406204224,
2.2856969833374023,
0.6653186678886414,
0.2573162615299225,
-0.7571744322776794,
-0.8368934392929077,
0.3167482316493988,
-1.0383055210113525,
-0.6465802192687988,
0.22913353145122528,
2.2937750816345215,
1.6953319311141968,
-0.6433406472206116,
-0.18902282416820526,
-1.095045566558838,
1.0211644172668457,
-0.23777221143245697,
0.32836025953292847,
2.036062479019165,
-0.4688401520252228,
-1.1667052507400513,
1.1129372119903564,
-2.4546594619750977,
0.2299720197916031,
1.9900976419448853,
0.2987889051437378,
0.2862972617149353,
-1.3991785049438477,
-0.7413387894630432,
-0.2457951158285141,
-0.45170414447784424,
-1.152142882347107,
0.6233585476875305,
-0.1670387089252472,
-0.9499742984771729,
-1.4143387079238892,
0.1362471878528595,
-1.177860140800476,
-1.7690261602401733,
0.5333633422851562,
1.9882901906967163,
2.0058274269104004,
-0.7080226540565491,
1.3885869979858398,
-0.3068867325782776,
-0.0675281211733818,
1.295953631401062,
1.2778387069702148,
2.9046566486358643,
1.7381614446640015,
-1.1498119831085205,
0.9036197662353516,
-0.02318803407251835,
-0.5625538229942322,
1.2164863348007202,
-1.0464712381362915,
1.1974021196365356,
-0.3039483428001404,
-1.1412019729614258,
-1.3829156160354614,
0.7770763635635376,
0.4294809401035309,
0.04544129595160484,
-0.4691604673862457,
1.2016689777374268,
0.16106481850147247,
1.3384307622909546,
0.5082538723945618,
-0.4773247539997101,
0.624792218208313,
-0.2967255711555481,
-0.4104207158088684,
1.655050277709961,
0.12390159070491791,
-1.5133044719696045,
-2.4251720905303955,
-0.22184400260448456,
-0.8223680853843689,
-0.024431908503174782,
-0.6718428730964661,
-1.0164825916290283,
1.62715482711792,
0.517333447933197,
-1.0670106410980225,
-0.241959348320961,
-0.5287396311759949,
-0.44760861992836,
2.557328939437866,
-1.5126972198486328,
-0.10632087290287018,
-0.8223145008087158,
-0.393224835395813,
1.606550693511963,
-1.1131970882415771,
-0.14015565812587738,
-1.044224739074707,
-0.5616744756698608,
-1.4219708442687988,
-0.5747877955436707,
0.0967213362455368,
-0.9676182866096497,
0.7311956286430359,
0.1108134388923645,
-1.0097748041152954,
-0.27220460772514343,
-0.8287968635559082,
0.9778592586517334,
-0.23098067939281464,
0.2544412314891815,
1.905018925666809,
0.5396431088447571,
-0.3212941288948059,
0.8255401849746704,
1.1448289155960083,
0.5913361310958862,
-0.4955793023109436,
0.38035640120506287,
-0.7114464044570923,
0.3397734761238098,
-1.3632668256759644,
0.18272118270397186,
-3.017430543899536,
0.6813348531723022,
-0.177572563290596,
-0.02137378603219986,
0.001041444018483162,
-1.4403754472732544,
1.1337981224060059,
2.6635048389434814,
-1.2768124341964722,
0.4309544861316681,
0.33850038051605225,
1.0661885738372803,
-1.3468879461288452,
0.07809095084667206,
-0.4314446449279785,
1.9882164001464844,
0.06335495412349701,
1.175702452659607,
-0.6290326118469238,
-2.0485622882843018,
0.7544853687286377,
-1.23271644115448,
-1.1060924530029297,
0.8928313255310059,
-0.7123887538909912,
0.14067338407039642,
-1.4212141036987305,
-0.014635218307375908,
-0.939081609249115,
-1.3102420568466187,
0.846246600151062,
0.21591323614120483,
0.46736618876457214,
-0.5475299954414368,
0.3412961959838867,
-2.142643690109253,
-1.289050817489624,
-0.21090173721313477,
-1.068281888961792,
0.6752274632453918,
-0.23568294942378998,
0.5001689791679382,
-0.11388881504535675,
0.14433464407920837,
0.37969970703125,
1.3317561149597168,
3.2825615406036377,
0.043402452021837234,
0.20610155165195465,
-0.07261823117733002,
-0.9224089980125427,
1.5218181610107422,
1.065247893333435,
-0.015493631362915039,
-0.5242545008659363,
-0.909726619720459,
1.205398678779602,
2.0604984760284424,
1.2110710144042969,
0.10567118227481842,
-0.9403477907180786,
-0.7207742929458618,
-0.024598699063062668,
0.20750316977500916,
0.4081970751285553,
0.9785774350166321,
-0.00987309031188488,
0.02030307613313198,
1.2182035446166992,
1.3684583902359009,
-0.5397432446479797,
0.4695757329463959,
-0.9092239141464233,
-0.36339250206947327,
0.4733293354511261,
0.337662011384964,
0.0785050094127655,
0.48672065138816833,
-1.0070714950561523,
-0.17140239477157593,
-0.16614335775375366,
-0.9742781519889832,
-0.7864773869514465,
-0.34088313579559326,
-0.5736690163612366,
1.650052785873413,
0.06783336400985718,
-0.4716379642486572,
0.02947700023651123,
-0.7264201045036316,
-0.036012157797813416,
-0.986780047416687,
0.17193561792373657,
-0.15254653990268707,
-0.030938297510147095,
-0.1383693516254425,
1.6277382373809814,
-1.044893503189087,
-2.1117708683013916,
0.37496381998062134,
0.37011831998825073,
-0.4708450734615326,
0.2817886471748352,
1.670604944229126,
0.5026159882545471,
1.5292596817016602,
1.3876456022262573,
0.956030547618866,
-0.572033703327179,
-1.2085700035095215,
0.7180256247520447,
0.9823369383811951,
-1.4091640710830688,
0.8545759916305542,
0.01694607362151146,
-0.43920567631721497,
0.6459953784942627,
1.2588238716125488,
0.43374717235565186,
-2.0559122562408447,
0.7829300761222839,
-0.8176209926605225,
0.783270537853241,
0.5901172757148743,
0.8755322694778442,
0.24956800043582916,
0.9059993624687195,
-1.1033236980438232,
-1.194106101989746,
-0.7839588522911072,
-0.6543117165565491,
1.9949557781219482,
-0.1316608190536499,
0.5954622030258179,
-0.1571541279554367,
-1.2153147459030151,
-0.26530200242996216,
0.5963869094848633,
0.3732936382293701,
-0.5210146903991699,
0.8894172310829163,
-0.512637197971344,
-0.9345842003822327,
-1.4898896217346191,
-0.5008262991905212,
-1.049607276916504,
-0.9089767932891846,
0.9663994908332825,
0.8154900670051575,
0.3324102759361267,
1.847464919090271,
0.3767595887184143,
0.20568855106830597,
-2.7145907878875732,
0.942914605140686,
0.43304669857025146,
-0.04379752278327942,
0.8043401837348938,
0.3518010079860687,
1.090154767036438,
-0.2282400280237198,
0.672652542591095,
-2.1472342014312744,
2.3175699710845947,
-0.16152484714984894,
0.6139323115348816,
0.17331020534038544,
-0.12564945220947266,
1.0029029846191406,
0.5430230498313904,
0.6090962886810303,
-1.2209302186965942,
0.7289144992828369,
-0.7479838728904724,
1.1975055932998657,
0.930862307548523,
-0.8705836534500122,
-0.007580695208162069,
1.4215350151062012,
0.552619457244873,
-0.25374042987823486,
-0.8013813495635986,
-0.8070133924484253,
1.0081111192703247,
1.608427882194519,
-0.10908298194408417,
-0.0006274767220020294,
0.7816072106361389,
0.646988570690155,
-1.342042088508606,
-0.0903836041688919,
-0.7289997935295105,
-0.6651461124420166,
1.6935700178146362,
1.97245454788208,
-0.04455450922250748,
-0.17097388207912445,
-0.8653296232223511,
-1.154746413230896,
0.8105257153511047,
-0.02958730421960354,
0.019321655854582787,
0.6860319972038269,
-0.6998091340065002,
1.397472620010376,
0.5900941491127014,
0.8328767418861389,
0.05190940573811531,
0.4483647048473358,
0.30599555373191833,
-0.3001195788383484,
-1.2202316522598267,
-0.39469844102859497,
-1.1038419008255005,
-2.6184685230255127,
0.54158616065979,
-0.40448299050331116,
-1.4913861751556396,
-0.12334385514259338,
-1.0937206745147705,
0.8610532283782959,
-0.6421236395835876,
-1.0668948888778687,
-1.4022536277770996,
0.3627176284790039,
-0.22561712563037872,
0.9488388895988464,
-1.6942722797393799,
-0.0661262720823288,
1.3716320991516113,
0.9053115248680115,
-0.7462781071662903,
0.940519392490387,
0.33440685272216797,
1.1518199443817139,
0.836739182472229,
-0.3801121413707733,
0.5056307911872864,
-0.024984775111079216,
-1.2456742525100708,
0.41252413392066956,
1.1182841062545776,
0.07152844965457916,
1.3605446815490723,
-0.46928998827934265,
0.0790872722864151,
0.5100671648979187,
-0.60835200548172,
-0.6858481168746948,
-0.5891244411468506,
0.7464219331741333,
-0.02432086318731308,
-1.1428182125091553,
0.030236173421144485,
-0.08479964733123779,
-0.07548277080059052,
0.2890346646308899,
-1.5150814056396484,
-0.4569346308708191,
-0.28679561614990234,
-0.4124079644680023,
-1.3412864208221436,
0.007099077105522156,
1.2815111875534058,
-0.5724194645881653,
-0.1593289077281952,
0.48241254687309265,
0.30487415194511414,
0.5164782404899597,
0.6202788352966309,
-0.7893566489219666,
-0.27429264783859253,
-0.34533819556236267,
-0.4161228835582733,
0.40030553936958313,
1.1635115146636963,
-0.15445981919765472,
-1.025816559791565,
0.8110985159873962,
-0.27717408537864685,
0.15289029479026794,
1.9878343343734741,
-0.019266828894615173,
-0.9734074473381042,
0.2890317142009735,
-0.6816725730895996,
1.7796584367752075,
1.6477314233779907,
1.1730931997299194,
-0.14541840553283691,
-0.839212954044342,
0.6240677237510681,
-0.23853856325149536,
-0.1861550211906433,
0.902588963508606,
0.5018994212150574,
-0.24348735809326172,
-1.4325127601623535,
0.5271158814430237,
1.3877884149551392,
-0.8745085000991821,
-0.9141939282417297,
-0.04792816936969757,
-0.7618896961212158,
1.070656418800354,
0.8263767957687378,
0.2120686173439026,
0.26908230781555176,
1.510898232460022,
0.525755763053894,
-0.3711443841457367,
0.5431773066520691,
0.3133471608161926,
-0.1685168445110321,
-2.0453009605407715,
-1.0156641006469727,
0.32215848565101624,
-0.39646273851394653,
-1.5688855648040771,
1.3691527843475342,
-1.0994720458984375,
-0.8173843026161194,
0.4763062298297882,
0.17361679673194885,
1.484256625175476,
0.3006083071231842,
1.6880428791046143,
2.0456695556640625,
0.8538987636566162,
0.19884490966796875,
1.4187005758285522,
-0.046470653265714645,
-0.37589365243911743,
1.852829098701477,
-0.4613085091114044,
0.4333495795726776,
1.0856595039367676,
-0.3331005573272705,
-0.9249423742294312,
-0.8502906560897827,
-1.1552942991256714,
-0.7387135624885559,
1.3649356365203857,
0.1783083975315094,
-1.1217454671859741,
0.13701079785823822,
1.5682172775268555,
0.07879742980003357,
-0.1995954066514969,
0.7250463366508484,
0.41081681847572327,
-0.8681393265724182,
-0.1509012132883072,
-0.9433583617210388,
0.3890858292579651,
-0.10853759944438934,
-0.32712364196777344,
0.3105586767196655,
0.45403560996055603,
1.2168012857437134,
-0.05448640510439873,
0.2031642645597458,
1.007989525794983,
-1.3844513893127441,
1.5878859758377075,
-0.6280485391616821,
0.36139601469039917,
-2.3598697185516357,
1.535407304763794,
-0.7104235887527466,
2.0109336376190186,
-2.63507342338562,
0.45765459537506104,
-0.5191290974617004,
-0.4084206819534302,
0.18552066385746002,
-0.42926689982414246,
0.1603541076183319,
-0.10220974683761597,
-0.951468825340271,
-0.10837395489215851,
-0.8582471609115601,
0.6465687155723572,
1.1851612329483032,
1.2437567710876465,
-0.9325567483901978,
-0.35164162516593933,
-1.9241411685943604,
-0.3747898042201996,
-0.6728909015655518,
0.5777527093887329,
-2.054590940475464,
-0.3196543753147125,
-1.9650646448135376,
-2.3706424236297607,
-1.3059637546539307,
-0.8078179359436035,
1.208701252937317,
0.10844919085502625,
-0.8962807059288025,
1.1012403964996338,
-0.40739497542381287,
-1.9875551462173462,
1.1267951726913452,
-2.245720148086548
] |
https://github.com/huggingface/datasets/issues/5070 | Support default config name when no builder configs | Thank you for creating this feature request, Albert.
For context this is the datatest where Albert has been helping me to switch to on-the-fly split config https://huggingface.co/datasets/HuggingFaceM4/cm4-synthetic-testing
and the attempt to switch on-the-fly splits was here: https://huggingface.co/datasets/HuggingFaceM4/cm4-synthetic-testing/discussions/2/files
but which I had to revert since providing no split breaks at run time.
| **Is your feature request related to a problem? Please describe.**
As discussed with @stas00, we could support defining a default config name, even if no predefined allowed config names are set. That is, support `DEFAULT_CONFIG_NAME`, even when `BUILDER_CONFIGS` is not defined.
**Additional context**
In order to support creating configs on the fly **by name** (not using kwargs), the list of allowed builder configs `BUILDER_CONFIGS` must not be set.
However, if so, then `DEFAULT_CONFIG_NAME` is not supported.
| 495 | 51 | Support default config name when no builder configs
**Is your feature request related to a problem? Please describe.**
As discussed with @stas00, we could support defining a default config name, even if no predefined allowed config names are set. That is, support `DEFAULT_CONFIG_NAME`, even when `BUILDER_CONFIGS` is not defined.
**Additional context**
In order to support creating configs on the fly **by name** (not using kwargs), the list of allowed builder configs `BUILDER_CONFIGS` must not be set.
However, if so, then `DEFAULT_CONFIG_NAME` is not supported.
Thank you for creating this feature request, Albert.
For context this is the datatest where Albert has been helping me to switch to on-the-fly split config https://huggingface.co/datasets/HuggingFaceM4/cm4-synthetic-testing
and the attempt to switch on-the-fly splits was here: https://huggingface.co/datasets/HuggingFaceM4/cm4-synthetic-testing/discussions/2/files
but which I had to revert since providing no split breaks at run time.
| [
-1.1884071826934814,
-0.8962437510490417,
-0.7320778369903564,
1.3746912479400635,
-0.1305580735206604,
-1.3658910989761353,
0.18253792822360992,
-1.0390468835830688,
1.6138347387313843,
-0.865161657333374,
0.39514705538749695,
-1.7098984718322754,
0.06904924660921097,
-0.7204312682151794,
-0.879813551902771,
-0.7919873595237732,
-0.4625990092754364,
-0.7242671847343445,
0.9548638463020325,
2.524972915649414,
1.2122164964675903,
-1.4765558242797852,
2.6822891235351562,
0.5969049334526062,
-0.10436812788248062,
-1.0384107828140259,
0.5404733419418335,
0.009829266928136349,
-1.2504292726516724,
-0.49247264862060547,
-0.9265261888504028,
-0.14299793541431427,
-0.618948221206665,
-0.5210503339767456,
0.008386830799281597,
0.3165494501590729,
-0.18271152675151825,
-0.2806839048862457,
-0.5207982659339905,
-0.7545941472053528,
0.4983971416950226,
-0.42227768898010254,
0.9313777685165405,
-0.43169674277305603,
1.8463345766067505,
-0.5992914438247681,
0.3763408958911896,
0.7459744215011597,
1.3712897300720215,
0.2021298110485077,
-0.01347490306943655,
0.29085835814476013,
0.45378607511520386,
-0.06814772635698318,
0.4595765173435211,
1.1121872663497925,
0.7220818996429443,
0.5238847732543945,
0.6651510000228882,
-2.1330249309539795,
1.4047609567642212,
-1.010086178779602,
0.1965697556734085,
1.3763195276260376,
-1.056557059288025,
0.37195393443107605,
-1.8562978506088257,
-0.04835687577724457,
0.5714790225028992,
-2.280895709991455,
0.14122754335403442,
-1.1950193643569946,
-0.5349955558776855,
0.962316632270813,
0.2672707736492157,
-1.31403386592865,
0.23560075461864471,
-0.4304639399051666,
0.9362992644309998,
0.4569369852542877,
1.2150137424468994,
-1.7687584161758423,
-0.035906121134757996,
-0.39877524971961975,
0.08398053795099258,
-1.3287229537963867,
-1.5613154172897339,
0.6050191521644592,
0.5963441729545593,
0.4409012198448181,
-0.13590721786022186,
0.8969486355781555,
-1.0134930610656738,
0.8659906387329102,
-1.1206207275390625,
-1.5500929355621338,
-1.5204604864120483,
-2.254808187484741,
-2.3258161544799805,
0.8714331984519958,
-0.5087589025497437,
-0.4568999409675598,
1.960876703262329,
-1.0460913181304932,
-1.6768831014633179,
1.0130724906921387,
0.2105865180492401,
0.11039353907108307,
2.306190252304077,
0.1759413480758667,
-0.6591597199440002,
0.44495466351509094,
-0.6846652626991272,
0.7870355844497681,
-0.4432842433452606,
1.3606529235839844,
0.4567689895629883,
-1.0762816667556763,
1.5798228979110718,
-0.5342913269996643,
0.4577040672302246,
-0.733731210231781,
-0.46293458342552185,
-0.7265945076942444,
0.3869418501853943,
1.9146274328231812,
-0.2862549126148224,
1.5266563892364502,
-0.37144094705581665,
-1.5649189949035645,
-1.5226988792419434,
0.889886736869812,
0.4628939628601074,
-0.8313615918159485,
0.105577751994133,
-0.4117101728916168,
0.10561128705739975,
-0.009542930871248245,
1.0740208625793457,
1.2342784404754639,
0.6595043540000916,
-0.3525453209877014,
-0.9081615209579468,
0.20577479898929596,
-0.17792539298534393,
-0.6956245303153992,
-1.86811101436615,
-0.3255678117275238,
0.17742271721363068,
0.6997585892677307,
-1.1732873916625977,
1.8627562522888184,
0.9984336495399475,
1.878734827041626,
0.9914053082466125,
-0.2655777931213379,
1.4647217988967896,
-0.09116114675998688,
1.9234914779663086,
-0.5436047911643982,
0.72757887840271,
-0.299421489238739,
-1.0334874391555786,
0.8804324865341187,
-0.3724393844604492,
-2.0761044025421143,
-0.7414516806602478,
-0.7614046335220337,
-0.2287740260362625,
-0.849799633026123,
1.0370129346847534,
-0.13346098363399506,
-1.2938567399978638,
0.2300310730934143,
-0.6756436824798584,
0.19391533732414246,
-1.2446471452713013,
0.24146944284439087,
0.7507702708244324,
-0.7137159705162048,
-0.0016941605135798454,
-0.24264173209667206,
-1.383833408355713,
-0.5369839668273926,
0.25427499413490295,
1.9362448453903198,
-0.7672017812728882,
0.9073890447616577,
0.925774097442627,
-0.6563007831573486,
-0.006658406462520361,
0.44525980949401855,
-0.345539927482605,
0.7900254130363464,
-1.066196084022522,
-0.43581104278564453,
1.1667622327804565,
-0.18171150982379913,
-0.5456677079200745,
1.496920108795166,
0.8351613283157349,
-1.0167547464370728,
-0.16947919130325317,
-0.16323262453079224,
-0.8991050720214844,
0.03872401639819145,
-1.6141419410705566,
-0.10427401214838028,
0.1348819136619568,
-1.4301390647888184,
-0.5567800402641296,
-0.21252384781837463,
1.3243508338928223,
-0.17211203277111053,
1.3597098588943481,
-0.32551226019859314,
-0.24395796656608582,
-0.41703763604164124,
-0.3695157468318939,
0.16579388082027435,
-0.2188909500837326,
-0.6265121102333069,
0.3525313436985016,
-0.8360090851783752,
0.317962646484375,
1.4225175380706787,
0.360526978969574,
-0.0009954813867807388,
0.5965988636016846,
0.9653382897377014,
0.25530770421028137,
0.0025216657668352127,
-0.8785952925682068,
-1.546254277229309,
2.0480473041534424,
-1.5188825130462646,
1.9787116050720215,
0.8478435277938843,
0.009998095221817493,
-1.704654574394226,
-1.7866427898406982,
1.3836172819137573,
1.1813966035842896,
2.350414276123047,
0.49709829688072205,
0.2674417495727539,
-0.8418797850608826,
-0.6110439896583557,
0.4069337248802185,
-1.0472434759140015,
-0.7834042310714722,
0.053988173604011536,
2.4352071285247803,
1.8645625114440918,
-0.5281667709350586,
-0.19781729578971863,
-0.9495311975479126,
1.2711840867996216,
-0.12585210800170898,
0.16475577652454376,
2.1148464679718018,
-0.3231279253959656,
-1.0808035135269165,
1.3032182455062866,
-2.3671135902404785,
0.18437103927135468,
1.9478062391281128,
0.35076645016670227,
0.10160107910633087,
-1.4312978982925415,
-0.6719256639480591,
-0.22862282395362854,
-0.4933415353298187,
-1.2938984632492065,
0.46248361468315125,
-0.26546189188957214,
-0.8773318529129028,
-1.4236791133880615,
0.13303886353969574,
-1.1745848655700684,
-1.6611655950546265,
0.5285981297492981,
1.7403385639190674,
1.991989254951477,
-0.7515326738357544,
1.5354026556015015,
-0.2992083430290222,
0.169422909617424,
1.221171498298645,
1.2330676317214966,
3.2187438011169434,
1.9484894275665283,
-1.308703064918518,
0.669154942035675,
-0.2697778344154358,
-0.48884549736976624,
1.0546075105667114,
-0.9877221584320068,
1.238897681236267,
-0.2819851338863373,
-1.1523517370224,
-1.2147901058197021,
1.0161539316177368,
0.4850800633430481,
0.04684211313724518,
-0.5117893218994141,
1.193603754043579,
0.13845324516296387,
1.2488338947296143,
0.5037108659744263,
-0.365683913230896,
0.529339611530304,
-0.43915802240371704,
-0.5968213081359863,
1.5877701044082642,
0.2794819474220276,
-1.5264832973480225,
-2.256591558456421,
-0.20139656960964203,
-0.9465031027793884,
-0.03874065726995468,
-0.6384029388427734,
-1.0047866106033325,
1.737269401550293,
0.39059749245643616,
-1.3940479755401611,
-0.33006033301353455,
-0.3189935088157654,
-0.6137250065803528,
2.6639764308929443,
-1.4817454814910889,
-0.28314444422721863,
-0.9361201524734497,
-0.58282470703125,
1.6640609502792358,
-1.3032464981079102,
-0.18751700222492218,
-1.0923150777816772,
-0.6193880438804626,
-1.246915340423584,
-0.43915948271751404,
-0.05777611583471298,
-0.8562772274017334,
0.820942759513855,
0.09065896272659302,
-1.16294527053833,
-0.4133985638618469,
-0.8749573826789856,
0.6878489255905151,
-0.00006829854100942612,
0.2089831382036209,
1.779834508895874,
0.3894149661064148,
-0.4703986942768097,
0.6304379105567932,
1.1406562328338623,
0.6062191128730774,
-0.6360531449317932,
0.22559091448783875,
-0.5256074666976929,
0.3668697774410248,
-1.2114193439483643,
0.3604019582271576,
-2.888854742050171,
0.6071659326553345,
-0.1183786392211914,
-0.08038017153739929,
-0.023911189287900925,
-1.3583623170852661,
1.1548755168914795,
2.5607829093933105,
-1.0739891529083252,
0.48420727252960205,
0.2774238586425781,
1.180126667022705,
-1.6530898809432983,
0.3819948136806488,
-0.3988402485847473,
2.154609203338623,
0.10966644436120987,
1.0750008821487427,
-0.512891411781311,
-2.163100481033325,
0.6517080068588257,
-1.1526943445205688,
-1.1277670860290527,
0.7065232396125793,
-0.6751294732093811,
0.0072333356365561485,
-1.3983126878738403,
-0.18553392589092255,
-0.8941697478294373,
-1.2177462577819824,
0.7940459847450256,
0.1623430848121643,
0.4152667820453644,
-0.6431439518928528,
0.17273874580860138,
-2.0891127586364746,
-1.303175449371338,
-0.2317056953907013,
-0.8732960224151611,
0.48057258129119873,
-0.3543335497379303,
0.5998007655143738,
-0.04940449446439743,
0.15685315430164337,
0.3180713653564453,
1.3856996297836304,
3.3697397708892822,
0.10393913090229034,
0.4906158149242401,
-0.1833558827638626,
-0.8191772699356079,
1.4674409627914429,
0.8760219812393188,
0.01711895316839218,
-0.5525863170623779,
-0.9970903396606445,
1.2705061435699463,
1.9589712619781494,
0.9782750606536865,
-0.02922545000910759,
-0.8088800311088562,
-0.6498196721076965,
0.04000595211982727,
0.187589630484581,
0.5471684336662292,
1.0034480094909668,
-0.05972309783101082,
0.055382221937179565,
1.3923083543777466,
1.2857897281646729,
-0.38945329189300537,
0.4684363603591919,
-0.8255610466003418,
-0.3085334002971649,
0.44901978969573975,
0.4058353304862976,
0.09811678528785706,
0.30588197708129883,
-0.9982045292854309,
-0.33608338236808777,
-0.1960812658071518,
-0.9752227663993835,
-0.7854164838790894,
-0.612810492515564,
-0.4116804301738739,
1.690697431564331,
0.05548548698425293,
-0.4667535126209259,
-0.013735013082623482,
-0.7774456143379211,
-0.09973524510860443,
-1.0647826194763184,
0.20686374604701996,
-0.002416980918496847,
-0.11697765439748764,
-0.08611997216939926,
1.7867021560668945,
-0.897702157497406,
-2.2241203784942627,
0.2436217963695526,
0.30354562401771545,
-0.4454174339771271,
0.18999850749969482,
1.6515343189239502,
0.5157921314239502,
1.4683572053909302,
1.3847213983535767,
0.9997327923774719,
-0.6194161772727966,
-1.3024392127990723,
0.6515699028968811,
0.8619406223297119,
-1.416986346244812,
0.9599073529243469,
-0.03639174625277519,
-0.4141201972961426,
0.8007896542549133,
1.2238130569458008,
0.36010077595710754,
-1.982706069946289,
0.7469295263290405,
-0.8645520210266113,
0.7959776520729065,
0.6367618441581726,
0.7760760188102722,
0.26714539527893066,
0.8770554065704346,
-1.1992557048797607,
-1.1488274335861206,
-0.8013858795166016,
-0.6228526830673218,
2.0360922813415527,
-0.25692451000213623,
0.47266334295272827,
-0.13238957524299622,
-1.282791256904602,
-0.08563917130231857,
0.8079314827919006,
0.350889652967453,
-0.35906845331192017,
0.7451110482215881,
-0.7225321531295776,
-1.0907902717590332,
-1.3739652633666992,
-0.4939066469669342,
-0.9370865821838379,
-0.8693624138832092,
1.1306718587875366,
0.8919135332107544,
0.40997186303138733,
2.0323076248168945,
0.5874595046043396,
0.16518038511276245,
-2.6539249420166016,
0.8479043245315552,
0.254794180393219,
0.055714093148708344,
0.9968907237052917,
0.3399995267391205,
1.0154403448104858,
-0.008257094770669937,
0.5851724743843079,
-2.5176634788513184,
2.3211495876312256,
-0.3517279028892517,
0.7074428200721741,
-0.025379303842782974,
-0.16036179661750793,
1.2321949005126953,
0.6472570896148682,
0.509858250617981,
-1.1406409740447998,
0.6734078526496887,
-0.5610069632530212,
1.241647481918335,
0.9664711952209473,
-0.8213309049606323,
0.13155421614646912,
1.2065168619155884,
0.4426298141479492,
-0.44688206911087036,
-0.9328043460845947,
-0.9891306757926941,
0.8867250680923462,
1.8308607339859009,
-0.08682876825332642,
-0.04335508868098259,
0.8198359608650208,
0.7292260527610779,
-1.1806859970092773,
0.20071034133434296,
-0.8399249911308289,
-0.7414772510528564,
1.671089768409729,
2.0374903678894043,
-0.07981609553098679,
-0.12004461884498596,
-0.6891798377037048,
-1.2720671892166138,
0.8340271711349487,
0.029215916991233826,
0.10314179956912994,
0.6551294922828674,
-0.6448898911476135,
1.1954327821731567,
0.8204634785652161,
0.8896985650062561,
0.14337927103042603,
0.37127935886383057,
0.48124685883522034,
-0.3079565465450287,
-1.0447678565979004,
-0.31647059321403503,
-1.26627516746521,
-2.602170705795288,
0.47839242219924927,
-0.30953848361968994,
-1.420870304107666,
-0.04567005857825279,
-1.0323983430862427,
0.7480016350746155,
-0.52606201171875,
-1.19461190700531,
-1.4812768697738647,
0.19000405073165894,
-0.07171536982059479,
0.8717889189720154,
-1.6878485679626465,
-0.05861302837729454,
1.2197237014770508,
0.7498807907104492,
-0.5375555157661438,
0.9064318537712097,
0.2605876922607422,
0.9906348586082458,
0.8274081945419312,
-0.3113853633403778,
0.44136467576026917,
0.17536839842796326,
-1.327608346939087,
0.5325245261192322,
1.3141371011734009,
0.14335545897483826,
1.3470485210418701,
-0.5062113404273987,
0.16245132684707642,
0.3617960810661316,
-0.5765769481658936,
-0.4898323118686676,
-0.5455127358436584,
0.7344004511833191,
0.047342631965875626,
-0.9269115924835205,
0.0931699201464653,
-0.17344868183135986,
-0.22718921303749084,
0.1879732459783554,
-1.3430856466293335,
-0.2000538408756256,
-0.35689207911491394,
-0.47716692090034485,
-1.2478022575378418,
-0.11627888679504395,
1.3994319438934326,
-0.7228631973266602,
-0.1799120008945465,
0.5891698002815247,
0.4081164300441742,
0.6016605496406555,
0.6536210775375366,
-0.6325399875640869,
-0.4115278720855713,
-0.2292800098657608,
-0.3621775507926941,
0.3028908371925354,
1.2877320051193237,
-0.17944718897342682,
-0.9576905369758606,
0.7394946217536926,
-0.5094990134239197,
0.13073842227458954,
2.024303436279297,
0.10109073668718338,
-0.7186936140060425,
0.488762229681015,
-0.7135804891586304,
1.8724733591079712,
1.774526596069336,
1.248484492301941,
-0.048917580395936966,
-0.9587158560752869,
0.6036309003829956,
-0.201589897274971,
-0.4239170253276825,
0.9034754633903503,
0.4852191209793091,
-0.22168605029582977,
-1.3866838216781616,
0.4624042510986328,
1.2923970222473145,
-0.8098306655883789,
-0.8836262822151184,
0.08008462935686111,
-0.9614143371582031,
1.1436583995819092,
0.6988353133201599,
0.5198253989219666,
0.20498430728912354,
1.6041661500930786,
0.6056799292564392,
-0.39709749817848206,
0.4578292965888977,
0.47029441595077515,
-0.2673703730106354,
-2.1316676139831543,
-1.1882082223892212,
0.2839665710926056,
-0.4302603602409363,
-1.4187566041946411,
1.2825202941894531,
-1.1617823839187622,
-1.0050158500671387,
0.45545998215675354,
0.16204749047756195,
1.49677574634552,
0.352997750043869,
1.6277154684066772,
2.0694098472595215,
0.8953719735145569,
0.3818909823894501,
1.3246477842330933,
-0.09842070937156677,
-0.5040600895881653,
1.8541206121444702,
-0.3407110869884491,
0.4808727502822876,
1.0361342430114746,
-0.31428784132003784,
-1.0413098335266113,
-0.8197460770606995,
-1.0901474952697754,
-0.6733248233795166,
1.2142366170883179,
0.04007794335484505,
-1.096603512763977,
0.20980523526668549,
1.576960563659668,
0.11929116398096085,
-0.3072545826435089,
0.45760512351989746,
0.44088032841682434,
-0.6933737397193909,
-0.07796482741832733,
-0.974311888217926,
0.5398063063621521,
-0.32460686564445496,
-0.33615565299987793,
0.3235020935535431,
0.5095651745796204,
1.2183704376220703,
-0.0628293827176094,
0.20741300284862518,
1.2288422584533691,
-1.4879289865493774,
1.4313013553619385,
-0.5728077292442322,
0.2116321474313736,
-2.40639591217041,
1.5550062656402588,
-0.6945317983627319,
1.8594962358474731,
-2.699153184890747,
0.29622986912727356,
-0.586762547492981,
-0.553820788860321,
0.40818101167678833,
-0.3196329176425934,
0.14291639626026154,
-0.1332230120897293,
-1.0873914957046509,
0.08361846208572388,
-0.7055048942565918,
0.5322037935256958,
1.2224369049072266,
1.3019282817840576,
-1.1306077241897583,
-0.1897113025188446,
-1.738633394241333,
-0.13060061633586884,
-0.6976900696754456,
0.3111509084701538,
-1.9567675590515137,
-0.031719375401735306,
-1.9114189147949219,
-2.272212028503418,
-1.445975661277771,
-0.9188605546951294,
1.060707688331604,
0.26808294653892517,
-0.8421666026115417,
0.9546118974685669,
-0.39823564887046814,
-1.8101694583892822,
1.1034183502197266,
-2.0814552307128906
] |
https://github.com/huggingface/datasets/issues/5061 | `_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map` | This is maybe related to python 3.10, do you think you could try on 3.8 ?
In the meantime we'll keep improving the support for 3.10. Let me add a dedicated CI | ## Describe the bug
When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`.
```
File "~/project/dataset.py", line 204, in <dictcomp>
split: dataset.map(
File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map
transformed_shards[index] = async_result.get()
File ".../site-packages/multiprocess/pool.py", line 771, in get
raise self._value
File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks
put(task)
File ".../site-packages/multiprocess/connection.py", line 214, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File ".../site-packages/multiprocess/reduction.py", line 54, in dumps
cls(buf, protocol, *args, **kwds).dump(obj)
File ".../site-packages/dill/_dill.py", line 620, in dump
StockPickler.dump(self, obj)
File ".../pickle.py", line 487, in dump
self.save(obj)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 902, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc
pickler._batch_setitems(iter(source.items()))
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 578, in save
rv = reduce(self.proto)
File ".../logging/__init__.py", line 1774, in __reduce__
raise pickle.PicklingError('logger cannot be pickled')
_pickle.PicklingError: logger cannot be pickled
```
## Steps to reproduce the bug
Sorry I failed to have a minimal reproducible example, but the offending line on my end is
```python
dataset.map(
lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda
batched=True,
num_proc=4,
)
```
This does work when `num_proc=1`, so it's likely a multiprocessing thing.
## Expected results
`map` succeeds
## Actual results
The error trace above.
## Environment info
- `datasets` version: 1.16.1 and 2.5.1 both failed
- Platform: Ubuntu 20.04.4 LTS
- Python version: 3.10.4
- PyArrow version: 9.0.0
| 496 | 32 | `_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map`
## Describe the bug
When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`.
```
File "~/project/dataset.py", line 204, in <dictcomp>
split: dataset.map(
File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map
transformed_shards[index] = async_result.get()
File ".../site-packages/multiprocess/pool.py", line 771, in get
raise self._value
File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks
put(task)
File ".../site-packages/multiprocess/connection.py", line 214, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File ".../site-packages/multiprocess/reduction.py", line 54, in dumps
cls(buf, protocol, *args, **kwds).dump(obj)
File ".../site-packages/dill/_dill.py", line 620, in dump
StockPickler.dump(self, obj)
File ".../pickle.py", line 487, in dump
self.save(obj)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 902, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc
pickler._batch_setitems(iter(source.items()))
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 578, in save
rv = reduce(self.proto)
File ".../logging/__init__.py", line 1774, in __reduce__
raise pickle.PicklingError('logger cannot be pickled')
_pickle.PicklingError: logger cannot be pickled
```
## Steps to reproduce the bug
Sorry I failed to have a minimal reproducible example, but the offending line on my end is
```python
dataset.map(
lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda
batched=True,
num_proc=4,
)
```
This does work when `num_proc=1`, so it's likely a multiprocessing thing.
## Expected results
`map` succeeds
## Actual results
The error trace above.
## Environment info
- `datasets` version: 1.16.1 and 2.5.1 both failed
- Platform: Ubuntu 20.04.4 LTS
- Python version: 3.10.4
- PyArrow version: 9.0.0
This is maybe related to python 3.10, do you think you could try on 3.8 ?
In the meantime we'll keep improving the support for 3.10. Let me add a dedicated CI | [
-1.2471206188201904,
-0.860986053943634,
-0.615219235420227,
1.3964499235153198,
-0.12581144273281097,
-1.1994258165359497,
0.19851703941822052,
-1.0489683151245117,
1.7292120456695557,
-0.769146203994751,
0.28908079862594604,
-1.6509270668029785,
0.007008756510913372,
-0.4673088490962982,
-0.7280068397521973,
-0.9479445815086365,
-0.3652215301990509,
-0.8450031280517578,
1.056427001953125,
2.5661282539367676,
1.2502115964889526,
-1.3459467887878418,
2.6478512287139893,
0.6389708518981934,
-0.2447873204946518,
-0.9723098278045654,
0.5781002640724182,
0.12768220901489258,
-1.3102405071258545,
-0.4492894113063812,
-1.0598927736282349,
-0.15163104236125946,
-0.5764464735984802,
-0.4706466495990753,
0.12515410780906677,
0.24377135932445526,
-0.2999609708786011,
-0.30980151891708374,
-0.5917728543281555,
-0.8102633953094482,
0.4424038529396057,
-0.39760076999664307,
0.9385910034179688,
-0.31477904319763184,
1.7415001392364502,
-0.6967385411262512,
0.6173581480979919,
0.746575653553009,
1.2285358905792236,
0.204132080078125,
-0.04432391747832298,
0.3590351343154907,
0.4342067241668701,
0.12818989157676697,
0.5744185447692871,
1.0802772045135498,
0.6575289368629456,
0.5115800499916077,
0.705460250377655,
-2.2163503170013428,
1.2685904502868652,
-1.0120054483413696,
0.12370134145021439,
1.2585375308990479,
-0.805888831615448,
0.2974938750267029,
-1.8046194314956665,
-0.14977194368839264,
0.697386622428894,
-2.2989346981048584,
0.2791447937488556,
-1.4468483924865723,
-0.5206634998321533,
0.9964675307273865,
0.38141366839408875,
-1.1667492389678955,
0.08592525124549866,
-0.3702556788921356,
0.9330874085426331,
0.3283766508102417,
1.1450914144515991,
-1.7131932973861694,
-0.09122996032238007,
-0.28274857997894287,
0.04921656847000122,
-1.149707555770874,
-1.5619878768920898,
0.5756258964538574,
0.5895231366157532,
0.59208744764328,
-0.06553838402032852,
0.9493139386177063,
-1.1226664781570435,
0.8202714920043945,
-0.9906206130981445,
-1.6768827438354492,
-1.383616328239441,
-2.3850443363189697,
-2.3944504261016846,
0.8506118059158325,
-0.5277522206306458,
-0.5064203143119812,
2.119014024734497,
-0.9664971232414246,
-1.716546893119812,
1.0741397142410278,
0.21426652371883392,
-0.0031253877095878124,
2.4334306716918945,
0.16080115735530853,
-0.6662982106208801,
0.48602795600891113,
-0.7610843181610107,
0.7014145851135254,
-0.29706382751464844,
1.3712550401687622,
0.4294266998767853,
-0.9999902248382568,
1.5827555656433105,
-0.5012006759643555,
0.4885222911834717,
-0.5679305195808411,
-0.45455148816108704,
-0.6692450046539307,
0.35187670588493347,
1.8243943452835083,
-0.24180729687213898,
1.499588966369629,
-0.2505359351634979,
-1.5388458967208862,
-1.495242714881897,
0.815359890460968,
0.5007305145263672,
-0.7673307061195374,
0.0036193905398249626,
-0.3506302535533905,
0.18633797764778137,
-0.027870986610651016,
1.189770221710205,
1.354283332824707,
0.8659751415252686,
-0.3572452664375305,
-0.8517676591873169,
0.17056335508823395,
-0.23956526815891266,
-0.8668314218521118,
-1.8456460237503052,
-0.3344252407550812,
0.07688169181346893,
0.673512876033783,
-1.2617759704589844,
1.793894648551941,
0.9265499711036682,
1.9065332412719727,
0.9230021834373474,
-0.4059363901615143,
1.544165015220642,
0.040215957909822464,
1.9796772003173828,
-0.44730252027511597,
0.7268947958946228,
-0.4716495871543884,
-1.1498585939407349,
0.9079707860946655,
-0.3183356821537018,
-1.9305328130722046,
-0.7327989935874939,
-0.7707381844520569,
-0.15773864090442657,
-0.6935303807258606,
0.9444195628166199,
-0.2068701535463333,
-1.4626641273498535,
0.21840284764766693,
-0.7290189862251282,
0.07379366457462311,
-1.2590240240097046,
0.2877960205078125,
0.5997335314750671,
-0.6896296143531799,
0.05632968991994858,
-0.35878634452819824,
-1.3204509019851685,
-0.4903133809566498,
0.21116913855075836,
1.926723599433899,
-0.7612565755844116,
0.9714670777320862,
1.0621269941329956,
-0.7795722484588623,
-0.008532928302884102,
0.33798015117645264,
-0.392334520816803,
0.7045400142669678,
-1.1680338382720947,
-0.4420619606971741,
1.231989860534668,
-0.16295908391475677,
-0.641629695892334,
1.3188003301620483,
0.6670206189155579,
-1.1083816289901733,
-0.23499983549118042,
-0.23770955204963684,
-0.7980053424835205,
0.08794386684894562,
-1.6166408061981201,
-0.14414988458156586,
0.38172248005867004,
-1.4926637411117554,
-0.31826046109199524,
-0.16366805136203766,
1.4449243545532227,
-0.1305902749300003,
1.3948947191238403,
-0.32947221398353577,
-0.2882480025291443,
-0.34000974893569946,
-0.2679322063922882,
0.18051724135875702,
-0.22857674956321716,
-0.534568190574646,
0.2862376570701599,
-0.8230464458465576,
0.3363998532295227,
1.5278788805007935,
0.26396051049232483,
0.0710354670882225,
0.43056589365005493,
0.9664979577064514,
0.4207918047904968,
-0.06789922714233398,
-0.9216985106468201,
-1.556986689567566,
2.0939829349517822,
-1.4272593259811401,
1.9106093645095825,
0.7164607644081116,
-0.08214284479618073,
-1.8579635620117188,
-1.8909955024719238,
1.222252607345581,
1.0375977754592896,
2.429386854171753,
0.5558859705924988,
0.4384945034980774,
-0.7351957559585571,
-0.6266991496086121,
0.34338000416755676,
-0.9932306408882141,
-0.676385760307312,
0.3021676540374756,
2.3909647464752197,
1.6485824584960938,
-0.5181550979614258,
-0.07841093093156815,
-0.9660351276397705,
1.3056105375289917,
-0.2567639946937561,
0.22496186196804047,
2.12095046043396,
-0.33019310235977173,
-1.1163241863250732,
1.2568073272705078,
-2.363960027694702,
0.17320352792739868,
2.0730302333831787,
0.19302678108215332,
0.1362004578113556,
-1.5162361860275269,
-0.660364031791687,
-0.2769002318382263,
-0.4231581389904022,
-1.1607563495635986,
0.5669540166854858,
-0.21370987594127655,
-0.9597195386886597,
-1.447752833366394,
0.06499458104372025,
-1.1602839231491089,
-1.8495581150054932,
0.23617587983608246,
1.8977338075637817,
2.0857369899749756,
-0.8487536907196045,
1.4082943201065063,
-0.23440062999725342,
-0.07379031926393509,
1.2714029550552368,
1.1526861190795898,
3.0100903511047363,
1.9798071384429932,
-1.2902776002883911,
0.6890529990196228,
-0.19645050168037415,
-0.37236079573631287,
1.1052993535995483,
-1.1927906274795532,
1.1729780435562134,
-0.12523877620697021,
-1.1116409301757812,
-1.228848934173584,
1.0061181783676147,
0.40898531675338745,
-0.023008985444903374,
-0.4234141409397125,
1.3213081359863281,
0.09889549016952515,
1.4373732805252075,
0.5526547431945801,
-0.2889099419116974,
0.6399698853492737,
-0.37965285778045654,
-0.5237212777137756,
1.6579875946044922,
0.31698471307754517,
-1.578631043434143,
-2.3721961975097656,
-0.32064422965049744,
-0.9913011193275452,
0.006242628209292889,
-0.483585387468338,
-0.8825964331626892,
1.691257119178772,
0.3238050639629364,
-1.1201250553131104,
-0.2775666415691376,
-0.2862846255302429,
-0.565986156463623,
2.7950327396392822,
-1.2833467721939087,
-0.1378358155488968,
-0.9672075510025024,
-0.6022164225578308,
1.6203172206878662,
-1.2075703144073486,
-0.17888140678405762,
-1.023044228553772,
-0.5221265554428101,
-1.2604581117630005,
-0.4548906683921814,
0.03871718794107437,
-1.0552582740783691,
0.7384840250015259,
0.21384450793266296,
-1.1187649965286255,
-0.45062142610549927,
-0.8796732425689697,
0.8486500978469849,
0.10204312950372696,
0.14039582014083862,
1.9212284088134766,
0.3770129084587097,
-0.32553040981292725,
0.6867411732673645,
1.1657328605651855,
0.5568055510520935,
-0.5776206254959106,
0.17972740530967712,
-0.6541141271591187,
0.3148147463798523,
-1.2649478912353516,
0.29349780082702637,
-2.806532382965088,
0.6726118922233582,
-0.25550705194473267,
-0.08434915542602539,
-0.1543954759836197,
-1.3044497966766357,
1.1479291915893555,
2.6303036212921143,
-1.092892050743103,
0.5613331198692322,
0.2769918143749237,
1.161339521408081,
-1.47699773311615,
0.412447988986969,
-0.458681583404541,
2.1951122283935547,
0.2367427796125412,
1.0691113471984863,
-0.49937644600868225,
-2.2038331031799316,
0.7839114665985107,
-1.2458502054214478,
-1.075494408607483,
0.7704730033874512,
-0.8582358360290527,
0.20147870481014252,
-1.3962147235870361,
-0.10336259007453918,
-0.7518014311790466,
-1.2382874488830566,
0.6060189008712769,
0.1398271769285202,
0.5237914323806763,
-0.5063562989234924,
0.37805578112602234,
-2.195570230484009,
-1.3488569259643555,
-0.2878725528717041,
-0.9760102033615112,
0.4956488013267517,
-0.2865663766860962,
0.7669566869735718,
-0.2553546726703644,
0.033958807587623596,
0.37676411867141724,
1.4613478183746338,
3.4537363052368164,
0.09787779301404953,
0.22805194556713104,
-0.10398814082145691,
-1.0545181035995483,
1.3790228366851807,
0.9097058176994324,
-0.2001809924840927,
-0.5709105134010315,
-1.1321080923080444,
1.202343463897705,
2.101206064224243,
1.0254521369934082,
0.10524718463420868,
-0.8825162649154663,
-0.7019433379173279,
0.049139369279146194,
0.1774902641773224,
0.4728620946407318,
0.9921819567680359,
0.03215023875236511,
-0.05253829434514046,
1.5531104803085327,
1.1794847249984741,
-0.3107853829860687,
0.3497011661529541,
-0.8636958599090576,
-0.43183791637420654,
0.4975314140319824,
0.22096805274486542,
0.08581919968128204,
0.41252273321151733,
-1.0072484016418457,
-0.3384472131729126,
-0.3121134340763092,
-0.9521654844284058,
-0.810236930847168,
-0.3653048872947693,
-0.4172077476978302,
1.689294695854187,
0.11009179055690765,
-0.4302871823310852,
0.05532355606555939,
-0.6114773750305176,
-0.019128546118736267,
-1.080419898033142,
0.23514485359191895,
-0.063752681016922,
-0.07518650591373444,
-0.08118800818920135,
1.717673897743225,
-0.821169912815094,
-1.9940603971481323,
0.22248516976833344,
0.2494393140077591,
-0.3390529751777649,
0.2752019166946411,
1.6618701219558716,
0.6405718922615051,
1.4812092781066895,
1.275524377822876,
0.8915396332740784,
-0.5099515318870544,
-1.3600294589996338,
0.6627126932144165,
0.9852460026741028,
-1.4635870456695557,
0.7747676968574524,
-0.16319285333156586,
-0.40669894218444824,
0.6100658774375916,
1.3775420188903809,
0.3739706575870514,
-2.031001567840576,
0.9223422408103943,
-0.9161351323127747,
0.735878050327301,
0.6324958801269531,
0.7258058190345764,
0.035066913813352585,
0.7363975644111633,
-1.2296154499053955,
-1.1604321002960205,
-0.7403667569160461,
-0.6737980842590332,
1.9505183696746826,
-0.1929774135351181,
0.559796929359436,
-0.2900807857513428,
-1.3104219436645508,
-0.16658584773540497,
0.6266103982925415,
0.3389923572540283,
-0.4231257438659668,
0.8161301612854004,
-0.6252014636993408,
-1.0434839725494385,
-1.437967300415039,
-0.4781397879123688,
-1.1090753078460693,
-0.8087034225463867,
1.0604784488677979,
0.7843661904335022,
0.4690539538860321,
1.8511743545532227,
0.5503541231155396,
0.35204073786735535,
-2.582880735397339,
0.9383492469787598,
0.36742445826530457,
-0.15738044679164886,
0.8723543882369995,
0.2884802222251892,
1.1024608612060547,
-0.16507309675216675,
0.5540401339530945,
-2.3830642700195312,
2.334843873977661,
-0.2487606704235077,
0.6584398746490479,
0.21264466643333435,
-0.10387932509183884,
1.008292317390442,
0.6024591326713562,
0.6292163729667664,
-1.0235542058944702,
0.6006110310554504,
-0.5683347582817078,
1.2700482606887817,
0.9046947360038757,
-0.7216199636459351,
-0.03139133378863335,
1.3632911443710327,
0.4854859709739685,
-0.4027569591999054,
-0.8236438632011414,
-1.0044177770614624,
0.9676376581192017,
1.706260323524475,
-0.2519027292728424,
-0.023918744176626205,
0.8158812522888184,
0.530455470085144,
-1.2625395059585571,
-0.05546882748603821,
-0.8627710342407227,
-0.6689109802246094,
1.683101773262024,
2.1288492679595947,
-0.13560859858989716,
-0.2854018211364746,
-0.7882252931594849,
-1.3551722764968872,
0.816405177116394,
-0.15341326594352722,
0.09380707144737244,
0.6906988024711609,
-0.4939804673194885,
1.0602285861968994,
0.730955183506012,
1.0880402326583862,
0.27036792039871216,
0.3561374843120575,
0.2288171350955963,
-0.4054514765739441,
-1.0897347927093506,
-0.3142926096916199,
-1.078376293182373,
-2.6136631965637207,
0.45176780223846436,
-0.32538536190986633,
-1.603124737739563,
0.00855491403490305,
-0.9735742807388306,
0.8802613019943237,
-0.526664674282074,
-1.082470417022705,
-1.3437749147415161,
0.28896698355674744,
-0.1681501269340515,
1.0737909078598022,
-1.6864099502563477,
-0.22972974181175232,
1.2632802724838257,
0.8552268147468567,
-0.6697648763656616,
0.9615662097930908,
0.26467394828796387,
1.1528359651565552,
0.7571742534637451,
-0.34499481320381165,
0.544722855091095,
-0.006619099993258715,
-1.2347264289855957,
0.3915990889072418,
1.1666618585586548,
0.20500387251377106,
1.3611215353012085,
-0.5914063453674316,
0.04573766142129898,
0.3461858332157135,
-0.658271074295044,
-0.5293881297111511,
-0.41087567806243896,
0.7653253078460693,
-0.050704989582300186,
-1.0512269735336304,
-0.08044928312301636,
-0.06314908713102341,
-0.16994085907936096,
0.18553535640239716,
-1.4094146490097046,
-0.2865094542503357,
-0.33861464262008667,
-0.49745580554008484,
-1.2845206260681152,
-0.10433448851108551,
1.2581603527069092,
-0.7355518341064453,
-0.0904046893119812,
0.4151584506034851,
0.3236962854862213,
0.5381293296813965,
0.6763801574707031,
-0.6902280449867249,
-0.4256581962108612,
-0.3120598793029785,
-0.3579040467739105,
0.35996076464653015,
1.3826733827590942,
0.0028441250324249268,
-1.023137092590332,
0.709674596786499,
-0.32075953483581543,
0.20320577919483185,
1.915953516960144,
0.05714801698923111,
-0.8433390259742737,
0.276252418756485,
-0.6532784700393677,
1.8121322393417358,
1.774766206741333,
1.1375846862792969,
-0.06851144880056381,
-0.8941605091094971,
0.5421833395957947,
-0.3733789324760437,
-0.40908336639404297,
0.7714724540710449,
0.4733127951622009,
-0.17669299244880676,
-1.3628393411636353,
0.6567424535751343,
1.276790976524353,
-0.7633687853813171,
-0.8478093147277832,
0.1287224292755127,
-0.8214479088783264,
1.1310371160507202,
0.8359099626541138,
0.43721896409988403,
0.25372305512428284,
1.589289903640747,
0.8585758805274963,
-0.5158058404922485,
0.5068761706352234,
0.4918023943901062,
-0.15393772721290588,
-2.11586594581604,
-1.1232776641845703,
0.25789010524749756,
-0.5260132551193237,
-1.574873685836792,
1.4346152544021606,
-1.1277663707733154,
-0.9501867890357971,
0.5296670198440552,
0.15191206336021423,
1.3124250173568726,
0.42828822135925293,
1.6252379417419434,
2.102477788925171,
0.9454332590103149,
0.4224461317062378,
1.2909588813781738,
-0.08969833701848984,
-0.5565211176872253,
1.843288540840149,
-0.3288557231426239,
0.45904675126075745,
1.0353771448135376,
-0.32745036482810974,
-0.9246472716331482,
-0.9440499544143677,
-1.1267446279525757,
-0.6108519434928894,
1.1083316802978516,
0.0749741792678833,
-1.1274924278259277,
0.18720071017742157,
1.608096718788147,
0.06772902607917786,
-0.38327276706695557,
0.6257021427154541,
0.3731095492839813,
-0.7963790893554688,
-0.16019423305988312,
-0.8706049919128418,
0.5251327157020569,
-0.1807408183813095,
-0.3559459149837494,
0.3126469850540161,
0.47090083360671997,
1.3502411842346191,
-0.06992732733488083,
0.1921069175004959,
1.0234066247940063,
-1.3407355546951294,
1.589625358581543,
-0.5756515264511108,
0.3535621166229248,
-2.243743896484375,
1.2872631549835205,
-0.7809408903121948,
1.839895486831665,
-2.652770519256592,
0.45726412534713745,
-0.3557819426059723,
-0.46529102325439453,
0.11777349561452866,
-0.45611533522605896,
0.14229780435562134,
-0.10480695217847824,
-1.1723276376724243,
-0.06618253886699677,
-0.7105565071105957,
0.5614446401596069,
1.0453052520751953,
1.4644582271575928,
-1.1495532989501953,
-0.28326156735420227,
-1.7912380695343018,
-0.13798785209655762,
-0.6962169408798218,
0.2668309211730957,
-1.8639326095581055,
-0.20483429729938507,
-1.9207065105438232,
-2.2309017181396484,
-1.4773567914962769,
-0.9329016208648682,
1.150131106376648,
0.05698797106742859,
-0.9065448641777039,
1.1052000522613525,
-0.29405394196510315,
-1.9652765989303589,
1.1571071147918701,
-2.202465057373047
] |
https://github.com/huggingface/datasets/issues/5061 | `_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map` | I did some binary search and seems like the root cause is either `multiprocess` or `dill`. python 3.10 is fine. Specifically:
- `multiprocess==0.70.12.2, dill==0.3.4`: works
- `multiprocess==0.70.12.2, dill==0.3.5.1`: doesn't work
- `multiprocess==0.70.13, dill==0.3.5.1`: doesn't work
- `multiprocess==0.70.13, dill==0.3.4`: can't test, `multiprocess==0.70.13` requires `dill>=0.3.5.1`
I will pin their versions on my end. I don't have enough knowledge of how python multiprocessing works to debug this, but ideally there could be a fix. It's also possible that I'm doing something wrong in my code, but again the `.name` of the logger that failed to pickle is `datasets.fingerprint`, which I'm not using directly. | ## Describe the bug
When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`.
```
File "~/project/dataset.py", line 204, in <dictcomp>
split: dataset.map(
File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map
transformed_shards[index] = async_result.get()
File ".../site-packages/multiprocess/pool.py", line 771, in get
raise self._value
File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks
put(task)
File ".../site-packages/multiprocess/connection.py", line 214, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File ".../site-packages/multiprocess/reduction.py", line 54, in dumps
cls(buf, protocol, *args, **kwds).dump(obj)
File ".../site-packages/dill/_dill.py", line 620, in dump
StockPickler.dump(self, obj)
File ".../pickle.py", line 487, in dump
self.save(obj)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 902, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc
pickler._batch_setitems(iter(source.items()))
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 578, in save
rv = reduce(self.proto)
File ".../logging/__init__.py", line 1774, in __reduce__
raise pickle.PicklingError('logger cannot be pickled')
_pickle.PicklingError: logger cannot be pickled
```
## Steps to reproduce the bug
Sorry I failed to have a minimal reproducible example, but the offending line on my end is
```python
dataset.map(
lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda
batched=True,
num_proc=4,
)
```
This does work when `num_proc=1`, so it's likely a multiprocessing thing.
## Expected results
`map` succeeds
## Actual results
The error trace above.
## Environment info
- `datasets` version: 1.16.1 and 2.5.1 both failed
- Platform: Ubuntu 20.04.4 LTS
- Python version: 3.10.4
- PyArrow version: 9.0.0
| 496 | 100 | `_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map`
## Describe the bug
When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`.
```
File "~/project/dataset.py", line 204, in <dictcomp>
split: dataset.map(
File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map
transformed_shards[index] = async_result.get()
File ".../site-packages/multiprocess/pool.py", line 771, in get
raise self._value
File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks
put(task)
File ".../site-packages/multiprocess/connection.py", line 214, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File ".../site-packages/multiprocess/reduction.py", line 54, in dumps
cls(buf, protocol, *args, **kwds).dump(obj)
File ".../site-packages/dill/_dill.py", line 620, in dump
StockPickler.dump(self, obj)
File ".../pickle.py", line 487, in dump
self.save(obj)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 902, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc
pickler._batch_setitems(iter(source.items()))
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 578, in save
rv = reduce(self.proto)
File ".../logging/__init__.py", line 1774, in __reduce__
raise pickle.PicklingError('logger cannot be pickled')
_pickle.PicklingError: logger cannot be pickled
```
## Steps to reproduce the bug
Sorry I failed to have a minimal reproducible example, but the offending line on my end is
```python
dataset.map(
lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda
batched=True,
num_proc=4,
)
```
This does work when `num_proc=1`, so it's likely a multiprocessing thing.
## Expected results
`map` succeeds
## Actual results
The error trace above.
## Environment info
- `datasets` version: 1.16.1 and 2.5.1 both failed
- Platform: Ubuntu 20.04.4 LTS
- Python version: 3.10.4
- PyArrow version: 9.0.0
I did some binary search and seems like the root cause is either `multiprocess` or `dill`. python 3.10 is fine. Specifically:
- `multiprocess==0.70.12.2, dill==0.3.4`: works
- `multiprocess==0.70.12.2, dill==0.3.5.1`: doesn't work
- `multiprocess==0.70.13, dill==0.3.5.1`: doesn't work
- `multiprocess==0.70.13, dill==0.3.4`: can't test, `multiprocess==0.70.13` requires `dill>=0.3.5.1`
I will pin their versions on my end. I don't have enough knowledge of how python multiprocessing works to debug this, but ideally there could be a fix. It's also possible that I'm doing something wrong in my code, but again the `.name` of the logger that failed to pickle is `datasets.fingerprint`, which I'm not using directly. | [
-1.2471206188201904,
-0.860986053943634,
-0.615219235420227,
1.3964499235153198,
-0.12581144273281097,
-1.1994258165359497,
0.19851703941822052,
-1.0489683151245117,
1.7292120456695557,
-0.769146203994751,
0.28908079862594604,
-1.6509270668029785,
0.007008756510913372,
-0.4673088490962982,
-0.7280068397521973,
-0.9479445815086365,
-0.3652215301990509,
-0.8450031280517578,
1.056427001953125,
2.5661282539367676,
1.2502115964889526,
-1.3459467887878418,
2.6478512287139893,
0.6389708518981934,
-0.2447873204946518,
-0.9723098278045654,
0.5781002640724182,
0.12768220901489258,
-1.3102405071258545,
-0.4492894113063812,
-1.0598927736282349,
-0.15163104236125946,
-0.5764464735984802,
-0.4706466495990753,
0.12515410780906677,
0.24377135932445526,
-0.2999609708786011,
-0.30980151891708374,
-0.5917728543281555,
-0.8102633953094482,
0.4424038529396057,
-0.39760076999664307,
0.9385910034179688,
-0.31477904319763184,
1.7415001392364502,
-0.6967385411262512,
0.6173581480979919,
0.746575653553009,
1.2285358905792236,
0.204132080078125,
-0.04432391747832298,
0.3590351343154907,
0.4342067241668701,
0.12818989157676697,
0.5744185447692871,
1.0802772045135498,
0.6575289368629456,
0.5115800499916077,
0.705460250377655,
-2.2163503170013428,
1.2685904502868652,
-1.0120054483413696,
0.12370134145021439,
1.2585375308990479,
-0.805888831615448,
0.2974938750267029,
-1.8046194314956665,
-0.14977194368839264,
0.697386622428894,
-2.2989346981048584,
0.2791447937488556,
-1.4468483924865723,
-0.5206634998321533,
0.9964675307273865,
0.38141366839408875,
-1.1667492389678955,
0.08592525124549866,
-0.3702556788921356,
0.9330874085426331,
0.3283766508102417,
1.1450914144515991,
-1.7131932973861694,
-0.09122996032238007,
-0.28274857997894287,
0.04921656847000122,
-1.149707555770874,
-1.5619878768920898,
0.5756258964538574,
0.5895231366157532,
0.59208744764328,
-0.06553838402032852,
0.9493139386177063,
-1.1226664781570435,
0.8202714920043945,
-0.9906206130981445,
-1.6768827438354492,
-1.383616328239441,
-2.3850443363189697,
-2.3944504261016846,
0.8506118059158325,
-0.5277522206306458,
-0.5064203143119812,
2.119014024734497,
-0.9664971232414246,
-1.716546893119812,
1.0741397142410278,
0.21426652371883392,
-0.0031253877095878124,
2.4334306716918945,
0.16080115735530853,
-0.6662982106208801,
0.48602795600891113,
-0.7610843181610107,
0.7014145851135254,
-0.29706382751464844,
1.3712550401687622,
0.4294266998767853,
-0.9999902248382568,
1.5827555656433105,
-0.5012006759643555,
0.4885222911834717,
-0.5679305195808411,
-0.45455148816108704,
-0.6692450046539307,
0.35187670588493347,
1.8243943452835083,
-0.24180729687213898,
1.499588966369629,
-0.2505359351634979,
-1.5388458967208862,
-1.495242714881897,
0.815359890460968,
0.5007305145263672,
-0.7673307061195374,
0.0036193905398249626,
-0.3506302535533905,
0.18633797764778137,
-0.027870986610651016,
1.189770221710205,
1.354283332824707,
0.8659751415252686,
-0.3572452664375305,
-0.8517676591873169,
0.17056335508823395,
-0.23956526815891266,
-0.8668314218521118,
-1.8456460237503052,
-0.3344252407550812,
0.07688169181346893,
0.673512876033783,
-1.2617759704589844,
1.793894648551941,
0.9265499711036682,
1.9065332412719727,
0.9230021834373474,
-0.4059363901615143,
1.544165015220642,
0.040215957909822464,
1.9796772003173828,
-0.44730252027511597,
0.7268947958946228,
-0.4716495871543884,
-1.1498585939407349,
0.9079707860946655,
-0.3183356821537018,
-1.9305328130722046,
-0.7327989935874939,
-0.7707381844520569,
-0.15773864090442657,
-0.6935303807258606,
0.9444195628166199,
-0.2068701535463333,
-1.4626641273498535,
0.21840284764766693,
-0.7290189862251282,
0.07379366457462311,
-1.2590240240097046,
0.2877960205078125,
0.5997335314750671,
-0.6896296143531799,
0.05632968991994858,
-0.35878634452819824,
-1.3204509019851685,
-0.4903133809566498,
0.21116913855075836,
1.926723599433899,
-0.7612565755844116,
0.9714670777320862,
1.0621269941329956,
-0.7795722484588623,
-0.008532928302884102,
0.33798015117645264,
-0.392334520816803,
0.7045400142669678,
-1.1680338382720947,
-0.4420619606971741,
1.231989860534668,
-0.16295908391475677,
-0.641629695892334,
1.3188003301620483,
0.6670206189155579,
-1.1083816289901733,
-0.23499983549118042,
-0.23770955204963684,
-0.7980053424835205,
0.08794386684894562,
-1.6166408061981201,
-0.14414988458156586,
0.38172248005867004,
-1.4926637411117554,
-0.31826046109199524,
-0.16366805136203766,
1.4449243545532227,
-0.1305902749300003,
1.3948947191238403,
-0.32947221398353577,
-0.2882480025291443,
-0.34000974893569946,
-0.2679322063922882,
0.18051724135875702,
-0.22857674956321716,
-0.534568190574646,
0.2862376570701599,
-0.8230464458465576,
0.3363998532295227,
1.5278788805007935,
0.26396051049232483,
0.0710354670882225,
0.43056589365005493,
0.9664979577064514,
0.4207918047904968,
-0.06789922714233398,
-0.9216985106468201,
-1.556986689567566,
2.0939829349517822,
-1.4272593259811401,
1.9106093645095825,
0.7164607644081116,
-0.08214284479618073,
-1.8579635620117188,
-1.8909955024719238,
1.222252607345581,
1.0375977754592896,
2.429386854171753,
0.5558859705924988,
0.4384945034980774,
-0.7351957559585571,
-0.6266991496086121,
0.34338000416755676,
-0.9932306408882141,
-0.676385760307312,
0.3021676540374756,
2.3909647464752197,
1.6485824584960938,
-0.5181550979614258,
-0.07841093093156815,
-0.9660351276397705,
1.3056105375289917,
-0.2567639946937561,
0.22496186196804047,
2.12095046043396,
-0.33019310235977173,
-1.1163241863250732,
1.2568073272705078,
-2.363960027694702,
0.17320352792739868,
2.0730302333831787,
0.19302678108215332,
0.1362004578113556,
-1.5162361860275269,
-0.660364031791687,
-0.2769002318382263,
-0.4231581389904022,
-1.1607563495635986,
0.5669540166854858,
-0.21370987594127655,
-0.9597195386886597,
-1.447752833366394,
0.06499458104372025,
-1.1602839231491089,
-1.8495581150054932,
0.23617587983608246,
1.8977338075637817,
2.0857369899749756,
-0.8487536907196045,
1.4082943201065063,
-0.23440062999725342,
-0.07379031926393509,
1.2714029550552368,
1.1526861190795898,
3.0100903511047363,
1.9798071384429932,
-1.2902776002883911,
0.6890529990196228,
-0.19645050168037415,
-0.37236079573631287,
1.1052993535995483,
-1.1927906274795532,
1.1729780435562134,
-0.12523877620697021,
-1.1116409301757812,
-1.228848934173584,
1.0061181783676147,
0.40898531675338745,
-0.023008985444903374,
-0.4234141409397125,
1.3213081359863281,
0.09889549016952515,
1.4373732805252075,
0.5526547431945801,
-0.2889099419116974,
0.6399698853492737,
-0.37965285778045654,
-0.5237212777137756,
1.6579875946044922,
0.31698471307754517,
-1.578631043434143,
-2.3721961975097656,
-0.32064422965049744,
-0.9913011193275452,
0.006242628209292889,
-0.483585387468338,
-0.8825964331626892,
1.691257119178772,
0.3238050639629364,
-1.1201250553131104,
-0.2775666415691376,
-0.2862846255302429,
-0.565986156463623,
2.7950327396392822,
-1.2833467721939087,
-0.1378358155488968,
-0.9672075510025024,
-0.6022164225578308,
1.6203172206878662,
-1.2075703144073486,
-0.17888140678405762,
-1.023044228553772,
-0.5221265554428101,
-1.2604581117630005,
-0.4548906683921814,
0.03871718794107437,
-1.0552582740783691,
0.7384840250015259,
0.21384450793266296,
-1.1187649965286255,
-0.45062142610549927,
-0.8796732425689697,
0.8486500978469849,
0.10204312950372696,
0.14039582014083862,
1.9212284088134766,
0.3770129084587097,
-0.32553040981292725,
0.6867411732673645,
1.1657328605651855,
0.5568055510520935,
-0.5776206254959106,
0.17972740530967712,
-0.6541141271591187,
0.3148147463798523,
-1.2649478912353516,
0.29349780082702637,
-2.806532382965088,
0.6726118922233582,
-0.25550705194473267,
-0.08434915542602539,
-0.1543954759836197,
-1.3044497966766357,
1.1479291915893555,
2.6303036212921143,
-1.092892050743103,
0.5613331198692322,
0.2769918143749237,
1.161339521408081,
-1.47699773311615,
0.412447988986969,
-0.458681583404541,
2.1951122283935547,
0.2367427796125412,
1.0691113471984863,
-0.49937644600868225,
-2.2038331031799316,
0.7839114665985107,
-1.2458502054214478,
-1.075494408607483,
0.7704730033874512,
-0.8582358360290527,
0.20147870481014252,
-1.3962147235870361,
-0.10336259007453918,
-0.7518014311790466,
-1.2382874488830566,
0.6060189008712769,
0.1398271769285202,
0.5237914323806763,
-0.5063562989234924,
0.37805578112602234,
-2.195570230484009,
-1.3488569259643555,
-0.2878725528717041,
-0.9760102033615112,
0.4956488013267517,
-0.2865663766860962,
0.7669566869735718,
-0.2553546726703644,
0.033958807587623596,
0.37676411867141724,
1.4613478183746338,
3.4537363052368164,
0.09787779301404953,
0.22805194556713104,
-0.10398814082145691,
-1.0545181035995483,
1.3790228366851807,
0.9097058176994324,
-0.2001809924840927,
-0.5709105134010315,
-1.1321080923080444,
1.202343463897705,
2.101206064224243,
1.0254521369934082,
0.10524718463420868,
-0.8825162649154663,
-0.7019433379173279,
0.049139369279146194,
0.1774902641773224,
0.4728620946407318,
0.9921819567680359,
0.03215023875236511,
-0.05253829434514046,
1.5531104803085327,
1.1794847249984741,
-0.3107853829860687,
0.3497011661529541,
-0.8636958599090576,
-0.43183791637420654,
0.4975314140319824,
0.22096805274486542,
0.08581919968128204,
0.41252273321151733,
-1.0072484016418457,
-0.3384472131729126,
-0.3121134340763092,
-0.9521654844284058,
-0.810236930847168,
-0.3653048872947693,
-0.4172077476978302,
1.689294695854187,
0.11009179055690765,
-0.4302871823310852,
0.05532355606555939,
-0.6114773750305176,
-0.019128546118736267,
-1.080419898033142,
0.23514485359191895,
-0.063752681016922,
-0.07518650591373444,
-0.08118800818920135,
1.717673897743225,
-0.821169912815094,
-1.9940603971481323,
0.22248516976833344,
0.2494393140077591,
-0.3390529751777649,
0.2752019166946411,
1.6618701219558716,
0.6405718922615051,
1.4812092781066895,
1.275524377822876,
0.8915396332740784,
-0.5099515318870544,
-1.3600294589996338,
0.6627126932144165,
0.9852460026741028,
-1.4635870456695557,
0.7747676968574524,
-0.16319285333156586,
-0.40669894218444824,
0.6100658774375916,
1.3775420188903809,
0.3739706575870514,
-2.031001567840576,
0.9223422408103943,
-0.9161351323127747,
0.735878050327301,
0.6324958801269531,
0.7258058190345764,
0.035066913813352585,
0.7363975644111633,
-1.2296154499053955,
-1.1604321002960205,
-0.7403667569160461,
-0.6737980842590332,
1.9505183696746826,
-0.1929774135351181,
0.559796929359436,
-0.2900807857513428,
-1.3104219436645508,
-0.16658584773540497,
0.6266103982925415,
0.3389923572540283,
-0.4231257438659668,
0.8161301612854004,
-0.6252014636993408,
-1.0434839725494385,
-1.437967300415039,
-0.4781397879123688,
-1.1090753078460693,
-0.8087034225463867,
1.0604784488677979,
0.7843661904335022,
0.4690539538860321,
1.8511743545532227,
0.5503541231155396,
0.35204073786735535,
-2.582880735397339,
0.9383492469787598,
0.36742445826530457,
-0.15738044679164886,
0.8723543882369995,
0.2884802222251892,
1.1024608612060547,
-0.16507309675216675,
0.5540401339530945,
-2.3830642700195312,
2.334843873977661,
-0.2487606704235077,
0.6584398746490479,
0.21264466643333435,
-0.10387932509183884,
1.008292317390442,
0.6024591326713562,
0.6292163729667664,
-1.0235542058944702,
0.6006110310554504,
-0.5683347582817078,
1.2700482606887817,
0.9046947360038757,
-0.7216199636459351,
-0.03139133378863335,
1.3632911443710327,
0.4854859709739685,
-0.4027569591999054,
-0.8236438632011414,
-1.0044177770614624,
0.9676376581192017,
1.706260323524475,
-0.2519027292728424,
-0.023918744176626205,
0.8158812522888184,
0.530455470085144,
-1.2625395059585571,
-0.05546882748603821,
-0.8627710342407227,
-0.6689109802246094,
1.683101773262024,
2.1288492679595947,
-0.13560859858989716,
-0.2854018211364746,
-0.7882252931594849,
-1.3551722764968872,
0.816405177116394,
-0.15341326594352722,
0.09380707144737244,
0.6906988024711609,
-0.4939804673194885,
1.0602285861968994,
0.730955183506012,
1.0880402326583862,
0.27036792039871216,
0.3561374843120575,
0.2288171350955963,
-0.4054514765739441,
-1.0897347927093506,
-0.3142926096916199,
-1.078376293182373,
-2.6136631965637207,
0.45176780223846436,
-0.32538536190986633,
-1.603124737739563,
0.00855491403490305,
-0.9735742807388306,
0.8802613019943237,
-0.526664674282074,
-1.082470417022705,
-1.3437749147415161,
0.28896698355674744,
-0.1681501269340515,
1.0737909078598022,
-1.6864099502563477,
-0.22972974181175232,
1.2632802724838257,
0.8552268147468567,
-0.6697648763656616,
0.9615662097930908,
0.26467394828796387,
1.1528359651565552,
0.7571742534637451,
-0.34499481320381165,
0.544722855091095,
-0.006619099993258715,
-1.2347264289855957,
0.3915990889072418,
1.1666618585586548,
0.20500387251377106,
1.3611215353012085,
-0.5914063453674316,
0.04573766142129898,
0.3461858332157135,
-0.658271074295044,
-0.5293881297111511,
-0.41087567806243896,
0.7653253078460693,
-0.050704989582300186,
-1.0512269735336304,
-0.08044928312301636,
-0.06314908713102341,
-0.16994085907936096,
0.18553535640239716,
-1.4094146490097046,
-0.2865094542503357,
-0.33861464262008667,
-0.49745580554008484,
-1.2845206260681152,
-0.10433448851108551,
1.2581603527069092,
-0.7355518341064453,
-0.0904046893119812,
0.4151584506034851,
0.3236962854862213,
0.5381293296813965,
0.6763801574707031,
-0.6902280449867249,
-0.4256581962108612,
-0.3120598793029785,
-0.3579040467739105,
0.35996076464653015,
1.3826733827590942,
0.0028441250324249268,
-1.023137092590332,
0.709674596786499,
-0.32075953483581543,
0.20320577919483185,
1.915953516960144,
0.05714801698923111,
-0.8433390259742737,
0.276252418756485,
-0.6532784700393677,
1.8121322393417358,
1.774766206741333,
1.1375846862792969,
-0.06851144880056381,
-0.8941605091094971,
0.5421833395957947,
-0.3733789324760437,
-0.40908336639404297,
0.7714724540710449,
0.4733127951622009,
-0.17669299244880676,
-1.3628393411636353,
0.6567424535751343,
1.276790976524353,
-0.7633687853813171,
-0.8478093147277832,
0.1287224292755127,
-0.8214479088783264,
1.1310371160507202,
0.8359099626541138,
0.43721896409988403,
0.25372305512428284,
1.589289903640747,
0.8585758805274963,
-0.5158058404922485,
0.5068761706352234,
0.4918023943901062,
-0.15393772721290588,
-2.11586594581604,
-1.1232776641845703,
0.25789010524749756,
-0.5260132551193237,
-1.574873685836792,
1.4346152544021606,
-1.1277663707733154,
-0.9501867890357971,
0.5296670198440552,
0.15191206336021423,
1.3124250173568726,
0.42828822135925293,
1.6252379417419434,
2.102477788925171,
0.9454332590103149,
0.4224461317062378,
1.2909588813781738,
-0.08969833701848984,
-0.5565211176872253,
1.843288540840149,
-0.3288557231426239,
0.45904675126075745,
1.0353771448135376,
-0.32745036482810974,
-0.9246472716331482,
-0.9440499544143677,
-1.1267446279525757,
-0.6108519434928894,
1.1083316802978516,
0.0749741792678833,
-1.1274924278259277,
0.18720071017742157,
1.608096718788147,
0.06772902607917786,
-0.38327276706695557,
0.6257021427154541,
0.3731095492839813,
-0.7963790893554688,
-0.16019423305988312,
-0.8706049919128418,
0.5251327157020569,
-0.1807408183813095,
-0.3559459149837494,
0.3126469850540161,
0.47090083360671997,
1.3502411842346191,
-0.06992732733488083,
0.1921069175004959,
1.0234066247940063,
-1.3407355546951294,
1.589625358581543,
-0.5756515264511108,
0.3535621166229248,
-2.243743896484375,
1.2872631549835205,
-0.7809408903121948,
1.839895486831665,
-2.652770519256592,
0.45726412534713745,
-0.3557819426059723,
-0.46529102325439453,
0.11777349561452866,
-0.45611533522605896,
0.14229780435562134,
-0.10480695217847824,
-1.1723276376724243,
-0.06618253886699677,
-0.7105565071105957,
0.5614446401596069,
1.0453052520751953,
1.4644582271575928,
-1.1495532989501953,
-0.28326156735420227,
-1.7912380695343018,
-0.13798785209655762,
-0.6962169408798218,
0.2668309211730957,
-1.8639326095581055,
-0.20483429729938507,
-1.9207065105438232,
-2.2309017181396484,
-1.4773567914962769,
-0.9329016208648682,
1.150131106376648,
0.05698797106742859,
-0.9065448641777039,
1.1052000522613525,
-0.29405394196510315,
-1.9652765989303589,
1.1571071147918701,
-2.202465057373047
] |
https://github.com/huggingface/datasets/issues/5061 | `_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map` | I'm not 100% sure how to figure it out -- the stack trace above doesn't clearly give me a place where I can print out who owns the logger, etc. I only found out its `.name` is `datasets.fingerprint` by printing right before
```
File ".../logging/__init__.py", line 1774, in __reduce__
raise pickle.PicklingError('logger cannot be pickled')
```
If you have any idea on how to find it out, please let me know. | ## Describe the bug
When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`.
```
File "~/project/dataset.py", line 204, in <dictcomp>
split: dataset.map(
File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map
transformed_shards[index] = async_result.get()
File ".../site-packages/multiprocess/pool.py", line 771, in get
raise self._value
File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks
put(task)
File ".../site-packages/multiprocess/connection.py", line 214, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File ".../site-packages/multiprocess/reduction.py", line 54, in dumps
cls(buf, protocol, *args, **kwds).dump(obj)
File ".../site-packages/dill/_dill.py", line 620, in dump
StockPickler.dump(self, obj)
File ".../pickle.py", line 487, in dump
self.save(obj)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 902, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc
pickler._batch_setitems(iter(source.items()))
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 578, in save
rv = reduce(self.proto)
File ".../logging/__init__.py", line 1774, in __reduce__
raise pickle.PicklingError('logger cannot be pickled')
_pickle.PicklingError: logger cannot be pickled
```
## Steps to reproduce the bug
Sorry I failed to have a minimal reproducible example, but the offending line on my end is
```python
dataset.map(
lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda
batched=True,
num_proc=4,
)
```
This does work when `num_proc=1`, so it's likely a multiprocessing thing.
## Expected results
`map` succeeds
## Actual results
The error trace above.
## Environment info
- `datasets` version: 1.16.1 and 2.5.1 both failed
- Platform: Ubuntu 20.04.4 LTS
- Python version: 3.10.4
- PyArrow version: 9.0.0
| 496 | 70 | `_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map`
## Describe the bug
When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`.
```
File "~/project/dataset.py", line 204, in <dictcomp>
split: dataset.map(
File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map
transformed_shards[index] = async_result.get()
File ".../site-packages/multiprocess/pool.py", line 771, in get
raise self._value
File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks
put(task)
File ".../site-packages/multiprocess/connection.py", line 214, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File ".../site-packages/multiprocess/reduction.py", line 54, in dumps
cls(buf, protocol, *args, **kwds).dump(obj)
File ".../site-packages/dill/_dill.py", line 620, in dump
StockPickler.dump(self, obj)
File ".../pickle.py", line 487, in dump
self.save(obj)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 902, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc
pickler._batch_setitems(iter(source.items()))
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 578, in save
rv = reduce(self.proto)
File ".../logging/__init__.py", line 1774, in __reduce__
raise pickle.PicklingError('logger cannot be pickled')
_pickle.PicklingError: logger cannot be pickled
```
## Steps to reproduce the bug
Sorry I failed to have a minimal reproducible example, but the offending line on my end is
```python
dataset.map(
lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda
batched=True,
num_proc=4,
)
```
This does work when `num_proc=1`, so it's likely a multiprocessing thing.
## Expected results
`map` succeeds
## Actual results
The error trace above.
## Environment info
- `datasets` version: 1.16.1 and 2.5.1 both failed
- Platform: Ubuntu 20.04.4 LTS
- Python version: 3.10.4
- PyArrow version: 9.0.0
I'm not 100% sure how to figure it out -- the stack trace above doesn't clearly give me a place where I can print out who owns the logger, etc. I only found out its `.name` is `datasets.fingerprint` by printing right before
```
File ".../logging/__init__.py", line 1774, in __reduce__
raise pickle.PicklingError('logger cannot be pickled')
```
If you have any idea on how to find it out, please let me know. | [
-1.2471206188201904,
-0.860986053943634,
-0.615219235420227,
1.3964499235153198,
-0.12581144273281097,
-1.1994258165359497,
0.19851703941822052,
-1.0489683151245117,
1.7292120456695557,
-0.769146203994751,
0.28908079862594604,
-1.6509270668029785,
0.007008756510913372,
-0.4673088490962982,
-0.7280068397521973,
-0.9479445815086365,
-0.3652215301990509,
-0.8450031280517578,
1.056427001953125,
2.5661282539367676,
1.2502115964889526,
-1.3459467887878418,
2.6478512287139893,
0.6389708518981934,
-0.2447873204946518,
-0.9723098278045654,
0.5781002640724182,
0.12768220901489258,
-1.3102405071258545,
-0.4492894113063812,
-1.0598927736282349,
-0.15163104236125946,
-0.5764464735984802,
-0.4706466495990753,
0.12515410780906677,
0.24377135932445526,
-0.2999609708786011,
-0.30980151891708374,
-0.5917728543281555,
-0.8102633953094482,
0.4424038529396057,
-0.39760076999664307,
0.9385910034179688,
-0.31477904319763184,
1.7415001392364502,
-0.6967385411262512,
0.6173581480979919,
0.746575653553009,
1.2285358905792236,
0.204132080078125,
-0.04432391747832298,
0.3590351343154907,
0.4342067241668701,
0.12818989157676697,
0.5744185447692871,
1.0802772045135498,
0.6575289368629456,
0.5115800499916077,
0.705460250377655,
-2.2163503170013428,
1.2685904502868652,
-1.0120054483413696,
0.12370134145021439,
1.2585375308990479,
-0.805888831615448,
0.2974938750267029,
-1.8046194314956665,
-0.14977194368839264,
0.697386622428894,
-2.2989346981048584,
0.2791447937488556,
-1.4468483924865723,
-0.5206634998321533,
0.9964675307273865,
0.38141366839408875,
-1.1667492389678955,
0.08592525124549866,
-0.3702556788921356,
0.9330874085426331,
0.3283766508102417,
1.1450914144515991,
-1.7131932973861694,
-0.09122996032238007,
-0.28274857997894287,
0.04921656847000122,
-1.149707555770874,
-1.5619878768920898,
0.5756258964538574,
0.5895231366157532,
0.59208744764328,
-0.06553838402032852,
0.9493139386177063,
-1.1226664781570435,
0.8202714920043945,
-0.9906206130981445,
-1.6768827438354492,
-1.383616328239441,
-2.3850443363189697,
-2.3944504261016846,
0.8506118059158325,
-0.5277522206306458,
-0.5064203143119812,
2.119014024734497,
-0.9664971232414246,
-1.716546893119812,
1.0741397142410278,
0.21426652371883392,
-0.0031253877095878124,
2.4334306716918945,
0.16080115735530853,
-0.6662982106208801,
0.48602795600891113,
-0.7610843181610107,
0.7014145851135254,
-0.29706382751464844,
1.3712550401687622,
0.4294266998767853,
-0.9999902248382568,
1.5827555656433105,
-0.5012006759643555,
0.4885222911834717,
-0.5679305195808411,
-0.45455148816108704,
-0.6692450046539307,
0.35187670588493347,
1.8243943452835083,
-0.24180729687213898,
1.499588966369629,
-0.2505359351634979,
-1.5388458967208862,
-1.495242714881897,
0.815359890460968,
0.5007305145263672,
-0.7673307061195374,
0.0036193905398249626,
-0.3506302535533905,
0.18633797764778137,
-0.027870986610651016,
1.189770221710205,
1.354283332824707,
0.8659751415252686,
-0.3572452664375305,
-0.8517676591873169,
0.17056335508823395,
-0.23956526815891266,
-0.8668314218521118,
-1.8456460237503052,
-0.3344252407550812,
0.07688169181346893,
0.673512876033783,
-1.2617759704589844,
1.793894648551941,
0.9265499711036682,
1.9065332412719727,
0.9230021834373474,
-0.4059363901615143,
1.544165015220642,
0.040215957909822464,
1.9796772003173828,
-0.44730252027511597,
0.7268947958946228,
-0.4716495871543884,
-1.1498585939407349,
0.9079707860946655,
-0.3183356821537018,
-1.9305328130722046,
-0.7327989935874939,
-0.7707381844520569,
-0.15773864090442657,
-0.6935303807258606,
0.9444195628166199,
-0.2068701535463333,
-1.4626641273498535,
0.21840284764766693,
-0.7290189862251282,
0.07379366457462311,
-1.2590240240097046,
0.2877960205078125,
0.5997335314750671,
-0.6896296143531799,
0.05632968991994858,
-0.35878634452819824,
-1.3204509019851685,
-0.4903133809566498,
0.21116913855075836,
1.926723599433899,
-0.7612565755844116,
0.9714670777320862,
1.0621269941329956,
-0.7795722484588623,
-0.008532928302884102,
0.33798015117645264,
-0.392334520816803,
0.7045400142669678,
-1.1680338382720947,
-0.4420619606971741,
1.231989860534668,
-0.16295908391475677,
-0.641629695892334,
1.3188003301620483,
0.6670206189155579,
-1.1083816289901733,
-0.23499983549118042,
-0.23770955204963684,
-0.7980053424835205,
0.08794386684894562,
-1.6166408061981201,
-0.14414988458156586,
0.38172248005867004,
-1.4926637411117554,
-0.31826046109199524,
-0.16366805136203766,
1.4449243545532227,
-0.1305902749300003,
1.3948947191238403,
-0.32947221398353577,
-0.2882480025291443,
-0.34000974893569946,
-0.2679322063922882,
0.18051724135875702,
-0.22857674956321716,
-0.534568190574646,
0.2862376570701599,
-0.8230464458465576,
0.3363998532295227,
1.5278788805007935,
0.26396051049232483,
0.0710354670882225,
0.43056589365005493,
0.9664979577064514,
0.4207918047904968,
-0.06789922714233398,
-0.9216985106468201,
-1.556986689567566,
2.0939829349517822,
-1.4272593259811401,
1.9106093645095825,
0.7164607644081116,
-0.08214284479618073,
-1.8579635620117188,
-1.8909955024719238,
1.222252607345581,
1.0375977754592896,
2.429386854171753,
0.5558859705924988,
0.4384945034980774,
-0.7351957559585571,
-0.6266991496086121,
0.34338000416755676,
-0.9932306408882141,
-0.676385760307312,
0.3021676540374756,
2.3909647464752197,
1.6485824584960938,
-0.5181550979614258,
-0.07841093093156815,
-0.9660351276397705,
1.3056105375289917,
-0.2567639946937561,
0.22496186196804047,
2.12095046043396,
-0.33019310235977173,
-1.1163241863250732,
1.2568073272705078,
-2.363960027694702,
0.17320352792739868,
2.0730302333831787,
0.19302678108215332,
0.1362004578113556,
-1.5162361860275269,
-0.660364031791687,
-0.2769002318382263,
-0.4231581389904022,
-1.1607563495635986,
0.5669540166854858,
-0.21370987594127655,
-0.9597195386886597,
-1.447752833366394,
0.06499458104372025,
-1.1602839231491089,
-1.8495581150054932,
0.23617587983608246,
1.8977338075637817,
2.0857369899749756,
-0.8487536907196045,
1.4082943201065063,
-0.23440062999725342,
-0.07379031926393509,
1.2714029550552368,
1.1526861190795898,
3.0100903511047363,
1.9798071384429932,
-1.2902776002883911,
0.6890529990196228,
-0.19645050168037415,
-0.37236079573631287,
1.1052993535995483,
-1.1927906274795532,
1.1729780435562134,
-0.12523877620697021,
-1.1116409301757812,
-1.228848934173584,
1.0061181783676147,
0.40898531675338745,
-0.023008985444903374,
-0.4234141409397125,
1.3213081359863281,
0.09889549016952515,
1.4373732805252075,
0.5526547431945801,
-0.2889099419116974,
0.6399698853492737,
-0.37965285778045654,
-0.5237212777137756,
1.6579875946044922,
0.31698471307754517,
-1.578631043434143,
-2.3721961975097656,
-0.32064422965049744,
-0.9913011193275452,
0.006242628209292889,
-0.483585387468338,
-0.8825964331626892,
1.691257119178772,
0.3238050639629364,
-1.1201250553131104,
-0.2775666415691376,
-0.2862846255302429,
-0.565986156463623,
2.7950327396392822,
-1.2833467721939087,
-0.1378358155488968,
-0.9672075510025024,
-0.6022164225578308,
1.6203172206878662,
-1.2075703144073486,
-0.17888140678405762,
-1.023044228553772,
-0.5221265554428101,
-1.2604581117630005,
-0.4548906683921814,
0.03871718794107437,
-1.0552582740783691,
0.7384840250015259,
0.21384450793266296,
-1.1187649965286255,
-0.45062142610549927,
-0.8796732425689697,
0.8486500978469849,
0.10204312950372696,
0.14039582014083862,
1.9212284088134766,
0.3770129084587097,
-0.32553040981292725,
0.6867411732673645,
1.1657328605651855,
0.5568055510520935,
-0.5776206254959106,
0.17972740530967712,
-0.6541141271591187,
0.3148147463798523,
-1.2649478912353516,
0.29349780082702637,
-2.806532382965088,
0.6726118922233582,
-0.25550705194473267,
-0.08434915542602539,
-0.1543954759836197,
-1.3044497966766357,
1.1479291915893555,
2.6303036212921143,
-1.092892050743103,
0.5613331198692322,
0.2769918143749237,
1.161339521408081,
-1.47699773311615,
0.412447988986969,
-0.458681583404541,
2.1951122283935547,
0.2367427796125412,
1.0691113471984863,
-0.49937644600868225,
-2.2038331031799316,
0.7839114665985107,
-1.2458502054214478,
-1.075494408607483,
0.7704730033874512,
-0.8582358360290527,
0.20147870481014252,
-1.3962147235870361,
-0.10336259007453918,
-0.7518014311790466,
-1.2382874488830566,
0.6060189008712769,
0.1398271769285202,
0.5237914323806763,
-0.5063562989234924,
0.37805578112602234,
-2.195570230484009,
-1.3488569259643555,
-0.2878725528717041,
-0.9760102033615112,
0.4956488013267517,
-0.2865663766860962,
0.7669566869735718,
-0.2553546726703644,
0.033958807587623596,
0.37676411867141724,
1.4613478183746338,
3.4537363052368164,
0.09787779301404953,
0.22805194556713104,
-0.10398814082145691,
-1.0545181035995483,
1.3790228366851807,
0.9097058176994324,
-0.2001809924840927,
-0.5709105134010315,
-1.1321080923080444,
1.202343463897705,
2.101206064224243,
1.0254521369934082,
0.10524718463420868,
-0.8825162649154663,
-0.7019433379173279,
0.049139369279146194,
0.1774902641773224,
0.4728620946407318,
0.9921819567680359,
0.03215023875236511,
-0.05253829434514046,
1.5531104803085327,
1.1794847249984741,
-0.3107853829860687,
0.3497011661529541,
-0.8636958599090576,
-0.43183791637420654,
0.4975314140319824,
0.22096805274486542,
0.08581919968128204,
0.41252273321151733,
-1.0072484016418457,
-0.3384472131729126,
-0.3121134340763092,
-0.9521654844284058,
-0.810236930847168,
-0.3653048872947693,
-0.4172077476978302,
1.689294695854187,
0.11009179055690765,
-0.4302871823310852,
0.05532355606555939,
-0.6114773750305176,
-0.019128546118736267,
-1.080419898033142,
0.23514485359191895,
-0.063752681016922,
-0.07518650591373444,
-0.08118800818920135,
1.717673897743225,
-0.821169912815094,
-1.9940603971481323,
0.22248516976833344,
0.2494393140077591,
-0.3390529751777649,
0.2752019166946411,
1.6618701219558716,
0.6405718922615051,
1.4812092781066895,
1.275524377822876,
0.8915396332740784,
-0.5099515318870544,
-1.3600294589996338,
0.6627126932144165,
0.9852460026741028,
-1.4635870456695557,
0.7747676968574524,
-0.16319285333156586,
-0.40669894218444824,
0.6100658774375916,
1.3775420188903809,
0.3739706575870514,
-2.031001567840576,
0.9223422408103943,
-0.9161351323127747,
0.735878050327301,
0.6324958801269531,
0.7258058190345764,
0.035066913813352585,
0.7363975644111633,
-1.2296154499053955,
-1.1604321002960205,
-0.7403667569160461,
-0.6737980842590332,
1.9505183696746826,
-0.1929774135351181,
0.559796929359436,
-0.2900807857513428,
-1.3104219436645508,
-0.16658584773540497,
0.6266103982925415,
0.3389923572540283,
-0.4231257438659668,
0.8161301612854004,
-0.6252014636993408,
-1.0434839725494385,
-1.437967300415039,
-0.4781397879123688,
-1.1090753078460693,
-0.8087034225463867,
1.0604784488677979,
0.7843661904335022,
0.4690539538860321,
1.8511743545532227,
0.5503541231155396,
0.35204073786735535,
-2.582880735397339,
0.9383492469787598,
0.36742445826530457,
-0.15738044679164886,
0.8723543882369995,
0.2884802222251892,
1.1024608612060547,
-0.16507309675216675,
0.5540401339530945,
-2.3830642700195312,
2.334843873977661,
-0.2487606704235077,
0.6584398746490479,
0.21264466643333435,
-0.10387932509183884,
1.008292317390442,
0.6024591326713562,
0.6292163729667664,
-1.0235542058944702,
0.6006110310554504,
-0.5683347582817078,
1.2700482606887817,
0.9046947360038757,
-0.7216199636459351,
-0.03139133378863335,
1.3632911443710327,
0.4854859709739685,
-0.4027569591999054,
-0.8236438632011414,
-1.0044177770614624,
0.9676376581192017,
1.706260323524475,
-0.2519027292728424,
-0.023918744176626205,
0.8158812522888184,
0.530455470085144,
-1.2625395059585571,
-0.05546882748603821,
-0.8627710342407227,
-0.6689109802246094,
1.683101773262024,
2.1288492679595947,
-0.13560859858989716,
-0.2854018211364746,
-0.7882252931594849,
-1.3551722764968872,
0.816405177116394,
-0.15341326594352722,
0.09380707144737244,
0.6906988024711609,
-0.4939804673194885,
1.0602285861968994,
0.730955183506012,
1.0880402326583862,
0.27036792039871216,
0.3561374843120575,
0.2288171350955963,
-0.4054514765739441,
-1.0897347927093506,
-0.3142926096916199,
-1.078376293182373,
-2.6136631965637207,
0.45176780223846436,
-0.32538536190986633,
-1.603124737739563,
0.00855491403490305,
-0.9735742807388306,
0.8802613019943237,
-0.526664674282074,
-1.082470417022705,
-1.3437749147415161,
0.28896698355674744,
-0.1681501269340515,
1.0737909078598022,
-1.6864099502563477,
-0.22972974181175232,
1.2632802724838257,
0.8552268147468567,
-0.6697648763656616,
0.9615662097930908,
0.26467394828796387,
1.1528359651565552,
0.7571742534637451,
-0.34499481320381165,
0.544722855091095,
-0.006619099993258715,
-1.2347264289855957,
0.3915990889072418,
1.1666618585586548,
0.20500387251377106,
1.3611215353012085,
-0.5914063453674316,
0.04573766142129898,
0.3461858332157135,
-0.658271074295044,
-0.5293881297111511,
-0.41087567806243896,
0.7653253078460693,
-0.050704989582300186,
-1.0512269735336304,
-0.08044928312301636,
-0.06314908713102341,
-0.16994085907936096,
0.18553535640239716,
-1.4094146490097046,
-0.2865094542503357,
-0.33861464262008667,
-0.49745580554008484,
-1.2845206260681152,
-0.10433448851108551,
1.2581603527069092,
-0.7355518341064453,
-0.0904046893119812,
0.4151584506034851,
0.3236962854862213,
0.5381293296813965,
0.6763801574707031,
-0.6902280449867249,
-0.4256581962108612,
-0.3120598793029785,
-0.3579040467739105,
0.35996076464653015,
1.3826733827590942,
0.0028441250324249268,
-1.023137092590332,
0.709674596786499,
-0.32075953483581543,
0.20320577919483185,
1.915953516960144,
0.05714801698923111,
-0.8433390259742737,
0.276252418756485,
-0.6532784700393677,
1.8121322393417358,
1.774766206741333,
1.1375846862792969,
-0.06851144880056381,
-0.8941605091094971,
0.5421833395957947,
-0.3733789324760437,
-0.40908336639404297,
0.7714724540710449,
0.4733127951622009,
-0.17669299244880676,
-1.3628393411636353,
0.6567424535751343,
1.276790976524353,
-0.7633687853813171,
-0.8478093147277832,
0.1287224292755127,
-0.8214479088783264,
1.1310371160507202,
0.8359099626541138,
0.43721896409988403,
0.25372305512428284,
1.589289903640747,
0.8585758805274963,
-0.5158058404922485,
0.5068761706352234,
0.4918023943901062,
-0.15393772721290588,
-2.11586594581604,
-1.1232776641845703,
0.25789010524749756,
-0.5260132551193237,
-1.574873685836792,
1.4346152544021606,
-1.1277663707733154,
-0.9501867890357971,
0.5296670198440552,
0.15191206336021423,
1.3124250173568726,
0.42828822135925293,
1.6252379417419434,
2.102477788925171,
0.9454332590103149,
0.4224461317062378,
1.2909588813781738,
-0.08969833701848984,
-0.5565211176872253,
1.843288540840149,
-0.3288557231426239,
0.45904675126075745,
1.0353771448135376,
-0.32745036482810974,
-0.9246472716331482,
-0.9440499544143677,
-1.1267446279525757,
-0.6108519434928894,
1.1083316802978516,
0.0749741792678833,
-1.1274924278259277,
0.18720071017742157,
1.608096718788147,
0.06772902607917786,
-0.38327276706695557,
0.6257021427154541,
0.3731095492839813,
-0.7963790893554688,
-0.16019423305988312,
-0.8706049919128418,
0.5251327157020569,
-0.1807408183813095,
-0.3559459149837494,
0.3126469850540161,
0.47090083360671997,
1.3502411842346191,
-0.06992732733488083,
0.1921069175004959,
1.0234066247940063,
-1.3407355546951294,
1.589625358581543,
-0.5756515264511108,
0.3535621166229248,
-2.243743896484375,
1.2872631549835205,
-0.7809408903121948,
1.839895486831665,
-2.652770519256592,
0.45726412534713745,
-0.3557819426059723,
-0.46529102325439453,
0.11777349561452866,
-0.45611533522605896,
0.14229780435562134,
-0.10480695217847824,
-1.1723276376724243,
-0.06618253886699677,
-0.7105565071105957,
0.5614446401596069,
1.0453052520751953,
1.4644582271575928,
-1.1495532989501953,
-0.28326156735420227,
-1.7912380695343018,
-0.13798785209655762,
-0.6962169408798218,
0.2668309211730957,
-1.8639326095581055,
-0.20483429729938507,
-1.9207065105438232,
-2.2309017181396484,
-1.4773567914962769,
-0.9329016208648682,
1.150131106376648,
0.05698797106742859,
-0.9065448641777039,
1.1052000522613525,
-0.29405394196510315,
-1.9652765989303589,
1.1571071147918701,
-2.202465057373047
] |
https://github.com/huggingface/datasets/issues/5061 | `_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map` | Ok I see, not sure why it triggers this error though, in `logging.py` the code is
https://github.com/python/cpython/blob/c9da063e32725a66495e4047b8a5ed13e72d9e8e/Lib/logging/__init__.py#L1769-L1775
and on my side it works on 3.10 with dill 0.3.5.1 and multiprocess 0.70.13
```python
>>> datasets.fingerprint.logger.__reduce__()
(<function logging.getLogger(name=None)>, ('datasets.fingerprint',))
```
Could you try to run this code ?
Are you in an environment where the loggers are instantiated differently ? Can you check the source code of `logging.Logger.__reduce__` in `".../logging/__init__.py", line 1774` ? | ## Describe the bug
When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`.
```
File "~/project/dataset.py", line 204, in <dictcomp>
split: dataset.map(
File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map
transformed_shards[index] = async_result.get()
File ".../site-packages/multiprocess/pool.py", line 771, in get
raise self._value
File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks
put(task)
File ".../site-packages/multiprocess/connection.py", line 214, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File ".../site-packages/multiprocess/reduction.py", line 54, in dumps
cls(buf, protocol, *args, **kwds).dump(obj)
File ".../site-packages/dill/_dill.py", line 620, in dump
StockPickler.dump(self, obj)
File ".../pickle.py", line 487, in dump
self.save(obj)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 902, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc
pickler._batch_setitems(iter(source.items()))
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 578, in save
rv = reduce(self.proto)
File ".../logging/__init__.py", line 1774, in __reduce__
raise pickle.PicklingError('logger cannot be pickled')
_pickle.PicklingError: logger cannot be pickled
```
## Steps to reproduce the bug
Sorry I failed to have a minimal reproducible example, but the offending line on my end is
```python
dataset.map(
lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda
batched=True,
num_proc=4,
)
```
This does work when `num_proc=1`, so it's likely a multiprocessing thing.
## Expected results
`map` succeeds
## Actual results
The error trace above.
## Environment info
- `datasets` version: 1.16.1 and 2.5.1 both failed
- Platform: Ubuntu 20.04.4 LTS
- Python version: 3.10.4
- PyArrow version: 9.0.0
| 496 | 71 | `_pickle.PicklingError: logger cannot be pickled` in multiprocessing `map`
## Describe the bug
When I `map` with multiple processes, this error occurs. The `.name` of the `logger` that fails to pickle in the final line is `datasets.fingerprint`.
```
File "~/project/dataset.py", line 204, in <dictcomp>
split: dataset.map(
File ".../site-packages/datasets/arrow_dataset.py", line 2489, in map
transformed_shards[index] = async_result.get()
File ".../site-packages/multiprocess/pool.py", line 771, in get
raise self._value
File ".../site-packages/multiprocess/pool.py", line 537, in _handle_tasks
put(task)
File ".../site-packages/multiprocess/connection.py", line 214, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File ".../site-packages/multiprocess/reduction.py", line 54, in dumps
cls(buf, protocol, *args, **kwds).dump(obj)
File ".../site-packages/dill/_dill.py", line 620, in dump
StockPickler.dump(self, obj)
File ".../pickle.py", line 487, in dump
self.save(obj)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 902, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File ".../pickle.py", line 717, in save_reduce
save(state)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../pickle.py", line 887, in save_tuple
save(element)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File ".../pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
File ".../site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File ".../site-packages/dill/_dill.py", line 1154, in _save_with_postproc
pickler._batch_setitems(iter(source.items()))
File ".../pickle.py", line 998, in _batch_setitems
save(v)
File ".../pickle.py", line 578, in save
rv = reduce(self.proto)
File ".../logging/__init__.py", line 1774, in __reduce__
raise pickle.PicklingError('logger cannot be pickled')
_pickle.PicklingError: logger cannot be pickled
```
## Steps to reproduce the bug
Sorry I failed to have a minimal reproducible example, but the offending line on my end is
```python
dataset.map(
lambda examples: self.tokenize(examples), # this doesn't matter, lambda e: [1] * len(...) also breaks. In fact I'm pretty sure it breaks before executing this lambda
batched=True,
num_proc=4,
)
```
This does work when `num_proc=1`, so it's likely a multiprocessing thing.
## Expected results
`map` succeeds
## Actual results
The error trace above.
## Environment info
- `datasets` version: 1.16.1 and 2.5.1 both failed
- Platform: Ubuntu 20.04.4 LTS
- Python version: 3.10.4
- PyArrow version: 9.0.0
Ok I see, not sure why it triggers this error though, in `logging.py` the code is
https://github.com/python/cpython/blob/c9da063e32725a66495e4047b8a5ed13e72d9e8e/Lib/logging/__init__.py#L1769-L1775
and on my side it works on 3.10 with dill 0.3.5.1 and multiprocess 0.70.13
```python
>>> datasets.fingerprint.logger.__reduce__()
(<function logging.getLogger(name=None)>, ('datasets.fingerprint',))
```
Could you try to run this code ?
Are you in an environment where the loggers are instantiated differently ? Can you check the source code of `logging.Logger.__reduce__` in `".../logging/__init__.py", line 1774` ? | [
-1.2471206188201904,
-0.860986053943634,
-0.615219235420227,
1.3964499235153198,
-0.12581144273281097,
-1.1994258165359497,
0.19851703941822052,
-1.0489683151245117,
1.7292120456695557,
-0.769146203994751,
0.28908079862594604,
-1.6509270668029785,
0.007008756510913372,
-0.4673088490962982,
-0.7280068397521973,
-0.9479445815086365,
-0.3652215301990509,
-0.8450031280517578,
1.056427001953125,
2.5661282539367676,
1.2502115964889526,
-1.3459467887878418,
2.6478512287139893,
0.6389708518981934,
-0.2447873204946518,
-0.9723098278045654,
0.5781002640724182,
0.12768220901489258,
-1.3102405071258545,
-0.4492894113063812,
-1.0598927736282349,
-0.15163104236125946,
-0.5764464735984802,
-0.4706466495990753,
0.12515410780906677,
0.24377135932445526,
-0.2999609708786011,
-0.30980151891708374,
-0.5917728543281555,
-0.8102633953094482,
0.4424038529396057,
-0.39760076999664307,
0.9385910034179688,
-0.31477904319763184,
1.7415001392364502,
-0.6967385411262512,
0.6173581480979919,
0.746575653553009,
1.2285358905792236,
0.204132080078125,
-0.04432391747832298,
0.3590351343154907,
0.4342067241668701,
0.12818989157676697,
0.5744185447692871,
1.0802772045135498,
0.6575289368629456,
0.5115800499916077,
0.705460250377655,
-2.2163503170013428,
1.2685904502868652,
-1.0120054483413696,
0.12370134145021439,
1.2585375308990479,
-0.805888831615448,
0.2974938750267029,
-1.8046194314956665,
-0.14977194368839264,
0.697386622428894,
-2.2989346981048584,
0.2791447937488556,
-1.4468483924865723,
-0.5206634998321533,
0.9964675307273865,
0.38141366839408875,
-1.1667492389678955,
0.08592525124549866,
-0.3702556788921356,
0.9330874085426331,
0.3283766508102417,
1.1450914144515991,
-1.7131932973861694,
-0.09122996032238007,
-0.28274857997894287,
0.04921656847000122,
-1.149707555770874,
-1.5619878768920898,
0.5756258964538574,
0.5895231366157532,
0.59208744764328,
-0.06553838402032852,
0.9493139386177063,
-1.1226664781570435,
0.8202714920043945,
-0.9906206130981445,
-1.6768827438354492,
-1.383616328239441,
-2.3850443363189697,
-2.3944504261016846,
0.8506118059158325,
-0.5277522206306458,
-0.5064203143119812,
2.119014024734497,
-0.9664971232414246,
-1.716546893119812,
1.0741397142410278,
0.21426652371883392,
-0.0031253877095878124,
2.4334306716918945,
0.16080115735530853,
-0.6662982106208801,
0.48602795600891113,
-0.7610843181610107,
0.7014145851135254,
-0.29706382751464844,
1.3712550401687622,
0.4294266998767853,
-0.9999902248382568,
1.5827555656433105,
-0.5012006759643555,
0.4885222911834717,
-0.5679305195808411,
-0.45455148816108704,
-0.6692450046539307,
0.35187670588493347,
1.8243943452835083,
-0.24180729687213898,
1.499588966369629,
-0.2505359351634979,
-1.5388458967208862,
-1.495242714881897,
0.815359890460968,
0.5007305145263672,
-0.7673307061195374,
0.0036193905398249626,
-0.3506302535533905,
0.18633797764778137,
-0.027870986610651016,
1.189770221710205,
1.354283332824707,
0.8659751415252686,
-0.3572452664375305,
-0.8517676591873169,
0.17056335508823395,
-0.23956526815891266,
-0.8668314218521118,
-1.8456460237503052,
-0.3344252407550812,
0.07688169181346893,
0.673512876033783,
-1.2617759704589844,
1.793894648551941,
0.9265499711036682,
1.9065332412719727,
0.9230021834373474,
-0.4059363901615143,
1.544165015220642,
0.040215957909822464,
1.9796772003173828,
-0.44730252027511597,
0.7268947958946228,
-0.4716495871543884,
-1.1498585939407349,
0.9079707860946655,
-0.3183356821537018,
-1.9305328130722046,
-0.7327989935874939,
-0.7707381844520569,
-0.15773864090442657,
-0.6935303807258606,
0.9444195628166199,
-0.2068701535463333,
-1.4626641273498535,
0.21840284764766693,
-0.7290189862251282,
0.07379366457462311,
-1.2590240240097046,
0.2877960205078125,
0.5997335314750671,
-0.6896296143531799,
0.05632968991994858,
-0.35878634452819824,
-1.3204509019851685,
-0.4903133809566498,
0.21116913855075836,
1.926723599433899,
-0.7612565755844116,
0.9714670777320862,
1.0621269941329956,
-0.7795722484588623,
-0.008532928302884102,
0.33798015117645264,
-0.392334520816803,
0.7045400142669678,
-1.1680338382720947,
-0.4420619606971741,
1.231989860534668,
-0.16295908391475677,
-0.641629695892334,
1.3188003301620483,
0.6670206189155579,
-1.1083816289901733,
-0.23499983549118042,
-0.23770955204963684,
-0.7980053424835205,
0.08794386684894562,
-1.6166408061981201,
-0.14414988458156586,
0.38172248005867004,
-1.4926637411117554,
-0.31826046109199524,
-0.16366805136203766,
1.4449243545532227,
-0.1305902749300003,
1.3948947191238403,
-0.32947221398353577,
-0.2882480025291443,
-0.34000974893569946,
-0.2679322063922882,
0.18051724135875702,
-0.22857674956321716,
-0.534568190574646,
0.2862376570701599,
-0.8230464458465576,
0.3363998532295227,
1.5278788805007935,
0.26396051049232483,
0.0710354670882225,
0.43056589365005493,
0.9664979577064514,
0.4207918047904968,
-0.06789922714233398,
-0.9216985106468201,
-1.556986689567566,
2.0939829349517822,
-1.4272593259811401,
1.9106093645095825,
0.7164607644081116,
-0.08214284479618073,
-1.8579635620117188,
-1.8909955024719238,
1.222252607345581,
1.0375977754592896,
2.429386854171753,
0.5558859705924988,
0.4384945034980774,
-0.7351957559585571,
-0.6266991496086121,
0.34338000416755676,
-0.9932306408882141,
-0.676385760307312,
0.3021676540374756,
2.3909647464752197,
1.6485824584960938,
-0.5181550979614258,
-0.07841093093156815,
-0.9660351276397705,
1.3056105375289917,
-0.2567639946937561,
0.22496186196804047,
2.12095046043396,
-0.33019310235977173,
-1.1163241863250732,
1.2568073272705078,
-2.363960027694702,
0.17320352792739868,
2.0730302333831787,
0.19302678108215332,
0.1362004578113556,
-1.5162361860275269,
-0.660364031791687,
-0.2769002318382263,
-0.4231581389904022,
-1.1607563495635986,
0.5669540166854858,
-0.21370987594127655,
-0.9597195386886597,
-1.447752833366394,
0.06499458104372025,
-1.1602839231491089,
-1.8495581150054932,
0.23617587983608246,
1.8977338075637817,
2.0857369899749756,
-0.8487536907196045,
1.4082943201065063,
-0.23440062999725342,
-0.07379031926393509,
1.2714029550552368,
1.1526861190795898,
3.0100903511047363,
1.9798071384429932,
-1.2902776002883911,
0.6890529990196228,
-0.19645050168037415,
-0.37236079573631287,
1.1052993535995483,
-1.1927906274795532,
1.1729780435562134,
-0.12523877620697021,
-1.1116409301757812,
-1.228848934173584,
1.0061181783676147,
0.40898531675338745,
-0.023008985444903374,
-0.4234141409397125,
1.3213081359863281,
0.09889549016952515,
1.4373732805252075,
0.5526547431945801,
-0.2889099419116974,
0.6399698853492737,
-0.37965285778045654,
-0.5237212777137756,
1.6579875946044922,
0.31698471307754517,
-1.578631043434143,
-2.3721961975097656,
-0.32064422965049744,
-0.9913011193275452,
0.006242628209292889,
-0.483585387468338,
-0.8825964331626892,
1.691257119178772,
0.3238050639629364,
-1.1201250553131104,
-0.2775666415691376,
-0.2862846255302429,
-0.565986156463623,
2.7950327396392822,
-1.2833467721939087,
-0.1378358155488968,
-0.9672075510025024,
-0.6022164225578308,
1.6203172206878662,
-1.2075703144073486,
-0.17888140678405762,
-1.023044228553772,
-0.5221265554428101,
-1.2604581117630005,
-0.4548906683921814,
0.03871718794107437,
-1.0552582740783691,
0.7384840250015259,
0.21384450793266296,
-1.1187649965286255,
-0.45062142610549927,
-0.8796732425689697,
0.8486500978469849,
0.10204312950372696,
0.14039582014083862,
1.9212284088134766,
0.3770129084587097,
-0.32553040981292725,
0.6867411732673645,
1.1657328605651855,
0.5568055510520935,
-0.5776206254959106,
0.17972740530967712,
-0.6541141271591187,
0.3148147463798523,
-1.2649478912353516,
0.29349780082702637,
-2.806532382965088,
0.6726118922233582,
-0.25550705194473267,
-0.08434915542602539,
-0.1543954759836197,
-1.3044497966766357,
1.1479291915893555,
2.6303036212921143,
-1.092892050743103,
0.5613331198692322,
0.2769918143749237,
1.161339521408081,
-1.47699773311615,
0.412447988986969,
-0.458681583404541,
2.1951122283935547,
0.2367427796125412,
1.0691113471984863,
-0.49937644600868225,
-2.2038331031799316,
0.7839114665985107,
-1.2458502054214478,
-1.075494408607483,
0.7704730033874512,
-0.8582358360290527,
0.20147870481014252,
-1.3962147235870361,
-0.10336259007453918,
-0.7518014311790466,
-1.2382874488830566,
0.6060189008712769,
0.1398271769285202,
0.5237914323806763,
-0.5063562989234924,
0.37805578112602234,
-2.195570230484009,
-1.3488569259643555,
-0.2878725528717041,
-0.9760102033615112,
0.4956488013267517,
-0.2865663766860962,
0.7669566869735718,
-0.2553546726703644,
0.033958807587623596,
0.37676411867141724,
1.4613478183746338,
3.4537363052368164,
0.09787779301404953,
0.22805194556713104,
-0.10398814082145691,
-1.0545181035995483,
1.3790228366851807,
0.9097058176994324,
-0.2001809924840927,
-0.5709105134010315,
-1.1321080923080444,
1.202343463897705,
2.101206064224243,
1.0254521369934082,
0.10524718463420868,
-0.8825162649154663,
-0.7019433379173279,
0.049139369279146194,
0.1774902641773224,
0.4728620946407318,
0.9921819567680359,
0.03215023875236511,
-0.05253829434514046,
1.5531104803085327,
1.1794847249984741,
-0.3107853829860687,
0.3497011661529541,
-0.8636958599090576,
-0.43183791637420654,
0.4975314140319824,
0.22096805274486542,
0.08581919968128204,
0.41252273321151733,
-1.0072484016418457,
-0.3384472131729126,
-0.3121134340763092,
-0.9521654844284058,
-0.810236930847168,
-0.3653048872947693,
-0.4172077476978302,
1.689294695854187,
0.11009179055690765,
-0.4302871823310852,
0.05532355606555939,
-0.6114773750305176,
-0.019128546118736267,
-1.080419898033142,
0.23514485359191895,
-0.063752681016922,
-0.07518650591373444,
-0.08118800818920135,
1.717673897743225,
-0.821169912815094,
-1.9940603971481323,
0.22248516976833344,
0.2494393140077591,
-0.3390529751777649,
0.2752019166946411,
1.6618701219558716,
0.6405718922615051,
1.4812092781066895,
1.275524377822876,
0.8915396332740784,
-0.5099515318870544,
-1.3600294589996338,
0.6627126932144165,
0.9852460026741028,
-1.4635870456695557,
0.7747676968574524,
-0.16319285333156586,
-0.40669894218444824,
0.6100658774375916,
1.3775420188903809,
0.3739706575870514,
-2.031001567840576,
0.9223422408103943,
-0.9161351323127747,
0.735878050327301,
0.6324958801269531,
0.7258058190345764,
0.035066913813352585,
0.7363975644111633,
-1.2296154499053955,
-1.1604321002960205,
-0.7403667569160461,
-0.6737980842590332,
1.9505183696746826,
-0.1929774135351181,
0.559796929359436,
-0.2900807857513428,
-1.3104219436645508,
-0.16658584773540497,
0.6266103982925415,
0.3389923572540283,
-0.4231257438659668,
0.8161301612854004,
-0.6252014636993408,
-1.0434839725494385,
-1.437967300415039,
-0.4781397879123688,
-1.1090753078460693,
-0.8087034225463867,
1.0604784488677979,
0.7843661904335022,
0.4690539538860321,
1.8511743545532227,
0.5503541231155396,
0.35204073786735535,
-2.582880735397339,
0.9383492469787598,
0.36742445826530457,
-0.15738044679164886,
0.8723543882369995,
0.2884802222251892,
1.1024608612060547,
-0.16507309675216675,
0.5540401339530945,
-2.3830642700195312,
2.334843873977661,
-0.2487606704235077,
0.6584398746490479,
0.21264466643333435,
-0.10387932509183884,
1.008292317390442,
0.6024591326713562,
0.6292163729667664,
-1.0235542058944702,
0.6006110310554504,
-0.5683347582817078,
1.2700482606887817,
0.9046947360038757,
-0.7216199636459351,
-0.03139133378863335,
1.3632911443710327,
0.4854859709739685,
-0.4027569591999054,
-0.8236438632011414,
-1.0044177770614624,
0.9676376581192017,
1.706260323524475,
-0.2519027292728424,
-0.023918744176626205,
0.8158812522888184,
0.530455470085144,
-1.2625395059585571,
-0.05546882748603821,
-0.8627710342407227,
-0.6689109802246094,
1.683101773262024,
2.1288492679595947,
-0.13560859858989716,
-0.2854018211364746,
-0.7882252931594849,
-1.3551722764968872,
0.816405177116394,
-0.15341326594352722,
0.09380707144737244,
0.6906988024711609,
-0.4939804673194885,
1.0602285861968994,
0.730955183506012,
1.0880402326583862,
0.27036792039871216,
0.3561374843120575,
0.2288171350955963,
-0.4054514765739441,
-1.0897347927093506,
-0.3142926096916199,
-1.078376293182373,
-2.6136631965637207,
0.45176780223846436,
-0.32538536190986633,
-1.603124737739563,
0.00855491403490305,
-0.9735742807388306,
0.8802613019943237,
-0.526664674282074,
-1.082470417022705,
-1.3437749147415161,
0.28896698355674744,
-0.1681501269340515,
1.0737909078598022,
-1.6864099502563477,
-0.22972974181175232,
1.2632802724838257,
0.8552268147468567,
-0.6697648763656616,
0.9615662097930908,
0.26467394828796387,
1.1528359651565552,
0.7571742534637451,
-0.34499481320381165,
0.544722855091095,
-0.006619099993258715,
-1.2347264289855957,
0.3915990889072418,
1.1666618585586548,
0.20500387251377106,
1.3611215353012085,
-0.5914063453674316,
0.04573766142129898,
0.3461858332157135,
-0.658271074295044,
-0.5293881297111511,
-0.41087567806243896,
0.7653253078460693,
-0.050704989582300186,
-1.0512269735336304,
-0.08044928312301636,
-0.06314908713102341,
-0.16994085907936096,
0.18553535640239716,
-1.4094146490097046,
-0.2865094542503357,
-0.33861464262008667,
-0.49745580554008484,
-1.2845206260681152,
-0.10433448851108551,
1.2581603527069092,
-0.7355518341064453,
-0.0904046893119812,
0.4151584506034851,
0.3236962854862213,
0.5381293296813965,
0.6763801574707031,
-0.6902280449867249,
-0.4256581962108612,
-0.3120598793029785,
-0.3579040467739105,
0.35996076464653015,
1.3826733827590942,
0.0028441250324249268,
-1.023137092590332,
0.709674596786499,
-0.32075953483581543,
0.20320577919483185,
1.915953516960144,
0.05714801698923111,
-0.8433390259742737,
0.276252418756485,
-0.6532784700393677,
1.8121322393417358,
1.774766206741333,
1.1375846862792969,
-0.06851144880056381,
-0.8941605091094971,
0.5421833395957947,
-0.3733789324760437,
-0.40908336639404297,
0.7714724540710449,
0.4733127951622009,
-0.17669299244880676,
-1.3628393411636353,
0.6567424535751343,
1.276790976524353,
-0.7633687853813171,
-0.8478093147277832,
0.1287224292755127,
-0.8214479088783264,
1.1310371160507202,
0.8359099626541138,
0.43721896409988403,
0.25372305512428284,
1.589289903640747,
0.8585758805274963,
-0.5158058404922485,
0.5068761706352234,
0.4918023943901062,
-0.15393772721290588,
-2.11586594581604,
-1.1232776641845703,
0.25789010524749756,
-0.5260132551193237,
-1.574873685836792,
1.4346152544021606,
-1.1277663707733154,
-0.9501867890357971,
0.5296670198440552,
0.15191206336021423,
1.3124250173568726,
0.42828822135925293,
1.6252379417419434,
2.102477788925171,
0.9454332590103149,
0.4224461317062378,
1.2909588813781738,
-0.08969833701848984,
-0.5565211176872253,
1.843288540840149,
-0.3288557231426239,
0.45904675126075745,
1.0353771448135376,
-0.32745036482810974,
-0.9246472716331482,
-0.9440499544143677,
-1.1267446279525757,
-0.6108519434928894,
1.1083316802978516,
0.0749741792678833,
-1.1274924278259277,
0.18720071017742157,
1.608096718788147,
0.06772902607917786,
-0.38327276706695557,
0.6257021427154541,
0.3731095492839813,
-0.7963790893554688,
-0.16019423305988312,
-0.8706049919128418,
0.5251327157020569,
-0.1807408183813095,
-0.3559459149837494,
0.3126469850540161,
0.47090083360671997,
1.3502411842346191,
-0.06992732733488083,
0.1921069175004959,
1.0234066247940063,
-1.3407355546951294,
1.589625358581543,
-0.5756515264511108,
0.3535621166229248,
-2.243743896484375,
1.2872631549835205,
-0.7809408903121948,
1.839895486831665,
-2.652770519256592,
0.45726412534713745,
-0.3557819426059723,
-0.46529102325439453,
0.11777349561452866,
-0.45611533522605896,
0.14229780435562134,
-0.10480695217847824,
-1.1723276376724243,
-0.06618253886699677,
-0.7105565071105957,
0.5614446401596069,
1.0453052520751953,
1.4644582271575928,
-1.1495532989501953,
-0.28326156735420227,
-1.7912380695343018,
-0.13798785209655762,
-0.6962169408798218,
0.2668309211730957,
-1.8639326095581055,
-0.20483429729938507,
-1.9207065105438232,
-2.2309017181396484,
-1.4773567914962769,
-0.9329016208648682,
1.150131106376648,
0.05698797106742859,
-0.9065448641777039,
1.1052000522613525,
-0.29405394196510315,
-1.9652765989303589,
1.1571071147918701,
-2.202465057373047
] |
Subsets and Splits