html_url
stringlengths 51
51
| comments
stringlengths 67
24.7k
| title
stringlengths 6
280
| body
stringlengths 51
36.2k
| comment_length
int64 16
1.45k
| text
stringlengths 190
38.3k
| embeddings
sequence |
---|---|---|---|---|---|---|
https://github.com/huggingface/datasets/issues/5717 | @yairl-dn You should be able to bypass this issue by reducing `datasets.config.DEFAULT_MAX_BATCH_SIZE` (1000 by default)
In Datasets 3.0, the Image storage format will be simplified, so this should be easier to fix then. | Errror when saving to disk a dataset of images | ### Describe the bug
Hello!
I have an issue when I try to save on disk my dataset of images. The error I get is:
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1442, in save_to_disk
for job_id, done, content in Dataset._save_to_disk_single(**kwargs):
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1473, in _save_to_disk_single
writer.write_table(pa_table)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_writer.py", line 570, in write_table
pa_table = embed_table_storage(pa_table)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2268, in embed_table_storage
arrays = [
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2269, in <listcomp>
embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name]
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2142, in embed_array_storage
return feature.embed_storage(array)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/features/image.py", line 269, in embed_storage
storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null())
File "pyarrow/array.pxi", line 2766, in pyarrow.lib.StructArray.from_arrays
File "pyarrow/array.pxi", line 2961, in pyarrow.lib.c_mask_inverted_from_obj
TypeError: Mask must be a pyarrow.Array of type boolean
```
My dataset is around 50K images, is this error might be due to a bad image?
Thanks for the help.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("imagefolder", data_dir="/path/to/dataset")
dataset["train"].save_to_disk("./myds", num_shards=40)
```
### Expected behavior
Having my dataset properly saved to disk.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
- Python version: 3.10.10
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 2.0.0 | 33 | Errror when saving to disk a dataset of images
### Describe the bug
Hello!
I have an issue when I try to save on disk my dataset of images. The error I get is:
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1442, in save_to_disk
for job_id, done, content in Dataset._save_to_disk_single(**kwargs):
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1473, in _save_to_disk_single
writer.write_table(pa_table)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_writer.py", line 570, in write_table
pa_table = embed_table_storage(pa_table)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2268, in embed_table_storage
arrays = [
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2269, in <listcomp>
embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name]
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2142, in embed_array_storage
return feature.embed_storage(array)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/features/image.py", line 269, in embed_storage
storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null())
File "pyarrow/array.pxi", line 2766, in pyarrow.lib.StructArray.from_arrays
File "pyarrow/array.pxi", line 2961, in pyarrow.lib.c_mask_inverted_from_obj
TypeError: Mask must be a pyarrow.Array of type boolean
```
My dataset is around 50K images, is this error might be due to a bad image?
Thanks for the help.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("imagefolder", data_dir="/path/to/dataset")
dataset["train"].save_to_disk("./myds", num_shards=40)
```
### Expected behavior
Having my dataset properly saved to disk.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
- Python version: 3.10.10
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 2.0.0
@yairl-dn You should be able to bypass this issue by reducing `datasets.config.DEFAULT_MAX_BATCH_SIZE` (1000 by default)
In Datasets 3.0, the Image storage format will be simplified, so this should be easier to fix then. | [
-0.07521145045757294,
-0.44404372572898865,
-0.10260006785392761,
0.3910185396671295,
0.4102981388568878,
0.2558813691139221,
0.09858540445566177,
0.14438162744045258,
-0.23703399300575256,
0.16042831540107727,
0.12004079669713974,
0.2100370079278946,
-0.37237343192100525,
-0.163156196475029,
-0.14881615340709686,
-0.06601633876562119,
0.24606919288635254,
0.03519495576620102,
0.31553390622138977,
-0.019280478358268738,
-0.4303226172924042,
0.19783370196819305,
-0.1113562062382698,
0.09576098620891571,
-0.27228742837905884,
-0.2518807351589203,
-0.07265754044055939,
0.03906097263097763,
-0.21042500436306,
-0.17154012620449066,
0.017110593616962433,
-0.3008976876735687,
0.2001149207353592,
0.30391937494277954,
-0.00010683824075385928,
-0.06346380710601807,
0.1338302344083786,
-0.2446221113204956,
-0.1711452603340149,
-0.18469086289405823,
-0.029161572456359863,
-0.23259443044662476,
-0.09101284295320511,
-0.4684022068977356,
0.2943912744522095,
-0.39507049322128296,
0.17993436753749847,
-0.2451118528842926,
0.36369597911834717,
0.16123627126216888,
0.3394441306591034,
0.011902399361133575,
0.06407707929611206,
-0.04979504644870758,
0.2123362123966217,
0.24630074203014374,
-0.10447150468826294,
0.2141420692205429,
-0.0875370055437088,
-0.18472406268119812,
0.3181774616241455,
0.24582964181900024,
-0.17366400361061096,
0.021281659603118896,
0.36216437816619873,
0.12314276397228241,
0.14020870625972748,
-0.39135026931762695,
-0.038269393146038055,
-0.24940410256385803,
0.38114824891090393,
-0.20504772663116455,
-0.3106054365634918,
0.1304585039615631,
0.10274402797222137,
-0.17744117975234985,
0.123715341091156,
0.4535548985004425,
-0.30707091093063354,
-0.020448630675673485,
-0.20804595947265625,
-0.06651081889867783,
-0.28110188245773315,
0.14265312254428864,
0.10370694845914841,
-0.36077338457107544,
-0.13505321741104126,
0.047490090131759644,
0.35591980814933777,
-0.08992345631122589,
0.23759342730045319,
-0.1558655947446823,
0.025217805057764053,
-0.013141533359885216,
-0.06903750449419022,
0.07333274185657501,
-0.28681495785713196,
0.0021687988191843033,
-0.0037605762481689453,
0.14187319576740265,
0.13929684460163116,
-0.182829350233078,
0.10016985237598419,
0.5118119120597839,
0.16544079780578613,
0.07154826819896698,
-0.05473723262548447,
0.25718164443969727,
0.25826579332351685,
0.17220374941825867,
0.07092982530593872,
-0.23628807067871094,
-0.011139418929815292,
-0.08605104684829712,
0.6543039679527283,
-0.1560084968805313,
0.291303813457489,
-0.1396411657333374,
-0.346112996339798,
0.33113956451416016,
0.17150026559829712,
0.08249978721141815,
-0.21306881308555603,
0.40643012523651123,
0.18383638560771942,
0.01610761694610119,
0.2483498454093933,
0.3640080988407135,
0.09276524931192398,
0.32699909806251526,
-0.19953101873397827,
0.05025489255785942,
0.06057003140449524,
0.01128462329506874,
-0.0712488517165184,
-0.14167657494544983,
-0.032544322311878204,
-0.07895251363515854,
0.002147434279322624,
-0.12808194756507874,
0.05790014564990997,
-0.3844551146030426,
0.12698836624622345,
0.21361513435840607,
0.10926977545022964,
-0.018329795449972153,
0.18122516572475433,
-0.04368593171238899,
0.06269016861915588,
0.3234748840332031,
-0.24392817914485931,
-0.14761410653591156,
-0.5825220942497253,
0.2519259452819824,
0.20470614731311798,
0.18937428295612335,
-0.41880130767822266,
-0.28549641370773315,
0.532703161239624,
-0.06712023913860321,
0.1645340472459793,
0.005608614534139633,
-0.23900458216667175,
-0.40241342782974243,
0.031858861446380615,
0.06052999943494797,
-0.11074275523424149,
0.3362394869327545,
-0.18630331754684448,
-0.1206112876534462,
0.18576999008655548,
0.279161274433136,
0.0943707823753357,
0.022373739629983902,
-0.3228868544101715,
0.20212626457214355,
0.2174447476863861,
-0.1931425780057907,
-0.2941567301750183,
0.02616206556558609,
0.009151071310043335,
-0.22987550497055054,
0.009707003831863403,
0.3027123510837555,
0.25104236602783203,
0.03275531157851219,
0.005905028432607651,
0.12701642513275146,
-0.11297629028558731,
0.134468674659729,
-0.4011509120464325,
0.0364857017993927,
-0.039081402122974396,
0.07814368605613708,
-0.08642607927322388,
-0.023362748324871063,
0.15075474977493286,
-0.11259259283542633,
0.08091743290424347,
-0.1435239017009735,
0.19488419592380524,
0.4261718690395355,
0.5107192993164062,
-0.1333882063627243,
-0.02897782064974308,
-0.1044483557343483,
-0.3802588880062103,
-0.010527841746807098,
0.026425980031490326,
-0.15207281708717346,
-0.40087080001831055,
0.002535223960876465,
-0.11862386763095856,
0.040294088423252106,
-0.1852819323539734,
0.08772015571594238,
0.20070911943912506,
0.02182682603597641,
-0.228620246052742,
0.19586914777755737,
-0.13302363455295563,
0.10301966965198517,
-0.06732400506734848,
0.0161990225315094,
-0.1804533153772354,
0.6394294500350952,
-0.36360448598861694,
-0.3987492024898529,
-0.09684595465660095,
-0.13777363300323486,
0.07341127097606659,
0.05916937440633774,
-0.22453834116458893,
0.5005024671554565,
0.09431740641593933,
0.2028811275959015,
-0.21213915944099426,
-0.24337849020957947,
0.09839238971471786,
-0.48302143812179565,
0.02854587323963642,
0.08102963119745255,
0.35732531547546387,
0.09609165787696838,
-0.14956983923912048,
0.1470751017332077,
-0.07579964399337769,
-0.03369344025850296,
0.03924381732940674,
0.21826258301734924,
0.024246864020824432,
0.09217220544815063,
0.19953469932079315,
-0.4022337794303894,
0.1265515387058258,
0.1389187127351761,
0.03470625728368759,
-0.23187388479709625,
-0.14357584714889526,
-0.13990244269371033,
0.19486744701862335,
0.18210984766483307,
0.2607106566429138,
0.3337177336215973,
0.12543466687202454,
-0.07073107361793518,
0.019383421167731285,
0.4253004789352417,
0.5106462240219116,
0.04017811268568039,
-0.3077417016029358,
-0.053535424172878265,
0.024117354303598404,
0.06729038804769516,
0.30872470140457153,
0.084163136780262,
0.2868502736091614,
0.26298999786376953,
0.2588483393192291,
-0.014060648158192635,
-0.21609899401664734,
-0.05188094452023506,
-0.15916407108306885,
0.3642865717411041,
-0.05564786121249199,
0.13718882203102112,
-0.1274757832288742,
-0.17177258431911469,
-0.059790875762701035,
0.0933283269405365,
-0.21778970956802368,
-0.30813199281692505,
-0.06042242795228958,
0.33995699882507324,
-0.03990950807929039,
-0.04706772044301033,
-0.027463167905807495,
0.3057284355163574,
0.1097867488861084,
0.3232915699481964,
-0.20846343040466309,
0.04787677526473999,
-0.07905063033103943,
0.058791935443878174,
0.16147424280643463,
-0.005746904760599136,
0.550287663936615,
0.06422661244869232,
0.0827576294541359,
-0.4550299644470215,
0.04101371765136719,
-0.040541574358940125,
-0.07280591130256653,
0.10894006490707397,
0.22567924857139587,
0.24726293981075287,
-0.06191921606659889,
-0.36291542649269104,
0.32286959886550903,
-0.008566070348024368,
-0.33640557527542114,
0.28005272150039673,
0.27166590094566345,
-0.14974938333034515,
-0.24121031165122986,
0.18850746750831604,
-0.353957861661911,
-0.3645654618740082,
0.09588726609945297,
0.08514538407325745,
0.27941083908081055,
-0.08018803596496582,
0.31513988971710205,
-0.052724771201610565,
0.2251349687576294,
-0.1396666318178177,
-0.1602000892162323,
-0.09011765569448471,
0.3879828155040741,
-0.10942240059375763,
-0.3624897599220276,
0.07067736983299255,
0.10923071205615997,
-0.012263101525604725,
-0.022776179015636444,
-0.49136704206466675,
-0.43912214040756226,
-0.0586189329624176,
-0.06296747922897339,
-0.31498757004737854,
0.01548515073955059,
0.0672231987118721,
0.14542317390441895,
-0.11607758700847626,
-0.09162913262844086,
-0.22736448049545288,
0.06458864361047745,
0.0768972784280777,
0.3309994041919708,
-0.058574918657541275,
0.411710262298584,
0.2297690212726593,
0.019909778609871864,
0.00584014505147934,
-0.13140517473220825,
0.6140477657318115,
0.11263645440340042,
0.3036918044090271,
-0.1055363118648529,
-0.48759526014328003,
-0.05930434167385101,
-0.006994426250457764,
-0.3009335994720459,
-0.2788499593734741,
-0.1363316774368286,
-0.05949841067194939,
-0.09853174537420273,
0.08512476086616516,
-0.02012932300567627,
0.09336985647678375,
-0.18553999066352844,
0.03879851475358009,
0.05488961562514305,
-0.28556662797927856,
-0.09226623177528381,
-0.09372429549694061,
-0.04375462234020233,
-0.05710690841078758,
0.2522600591182709,
0.34159982204437256,
-0.1299227774143219,
-0.14834710955619812,
-0.016626667231321335,
-0.2732453942298889,
0.4063478708267212,
0.13872011005878448,
0.3885350525379181,
-0.1061183512210846,
0.022707782685756683,
0.2076321691274643,
-0.1498495191335678,
0.493360698223114,
-0.1999422013759613,
-0.14206089079380035,
0.008977726101875305,
0.12484601885080338,
-0.47099441289901733,
-0.04782307893037796,
0.011989563703536987,
0.06963776051998138,
-0.25989922881126404,
0.5957697033882141,
-0.015774846076965332,
0.010713491588830948,
0.06415470689535141,
0.007493361830711365,
-0.4021505117416382,
-0.21996134519577026,
-0.36466723680496216,
-0.36327236890792847,
-0.3501264750957489,
-0.12055060267448425,
0.02136749029159546,
0.059523217380046844,
0.24893322587013245,
0.018065892159938812,
0.04143015295267105,
-0.10177899897098541,
-0.17392538487911224,
-0.20327921211719513,
0.5465952157974243,
-0.4622514843940735,
0.17136447131633759,
-0.1784375160932541,
0.04953498765826225,
0.5429152250289917,
0.25256577134132385,
-0.272407591342926,
-0.22448107600212097,
0.2086336612701416,
-0.1811966449022293,
0.09950433671474457,
-0.020101159811019897,
-0.2247089445590973,
-0.039665453135967255,
-0.10478943586349487,
0.2824459373950958,
-0.20428350567817688,
-0.3170278072357178,
0.360075443983078,
-0.2905513048171997,
-0.12862136960029602,
0.13764218986034393,
0.33205533027648926,
0.1727677285671234,
0.17940418422222137,
0.0715818852186203,
-0.024893026798963547,
-0.10104398429393768,
0.4275776147842407,
0.48721930384635925,
0.8410309553146362,
-0.065415158867836,
0.3637359142303467,
-0.03740920126438141,
-0.3139168918132782,
-0.007414024323225021,
0.04606068879365921,
0.06794607639312744,
-0.3839375078678131,
-0.44326284527778625,
-0.07460722327232361,
-0.1579577922821045,
-0.02599669247865677,
0.0001272503286600113,
-0.2726850211620331,
-0.023972557857632637,
-0.2626406252384186,
-0.0488782562315464,
-0.24869129061698914,
-0.07510309666395187,
-0.4291793406009674,
-0.23395293951034546,
-0.1827024221420288,
0.22474460303783417,
-0.04153886437416077,
0.06093453988432884,
-0.03594597801566124,
-0.0759660005569458,
-0.07736749947071075,
-0.1276557892560959,
-0.403288871049881,
-0.06772810965776443,
-0.29874956607818604,
0.40608322620391846,
-0.14162467420101166,
-0.33281394839286804,
-0.14779189229011536,
0.3944907486438751,
0.1385461390018463,
-0.04560510441660881,
0.0038916952908039093,
-0.22316043078899384,
0.062314722687006,
0.06088651716709137,
-0.2622636556625366,
-0.09927383065223694,
0.2314627766609192,
-0.17787712812423706,
0.09466791152954102,
-0.05396386608481407,
0.15422281622886658,
-0.19130291044712067,
-0.017752304673194885,
0.3690420985221863,
-0.06284864246845245,
-0.044910404831171036,
-0.33713841438293457,
-0.3546522855758667,
-0.17530888319015503,
-0.28952187299728394,
0.20370271801948547,
0.2759840190410614,
0.03658343106508255,
0.3743407130241394,
-0.16362470388412476,
-0.10972857475280762,
0.1342109888792038,
0.544333279132843,
0.11650422215461731,
-0.12895473837852478,
0.3010965585708618,
-0.16983962059020996,
-0.1776038408279419,
-0.33406203985214233,
0.3911176025867462,
-0.08485348522663116,
-0.29709964990615845,
0.4522235691547394,
-0.2659975290298462,
0.09892553091049194,
-0.13411672413349152,
0.03527456149458885,
0.2476743757724762,
0.0539398193359375,
0.025842301547527313,
-0.40739691257476807,
-0.5168470144271851,
0.14435678720474243,
0.1066773533821106,
0.33252233266830444,
-0.2200893610715866,
-0.17351530492305756,
0.11528071016073227,
-0.0547378733754158,
-0.35790330171585083,
0.29164302349090576,
-0.37721988558769226,
0.04004397615790367,
0.1282629370689392,
0.0003440026193857193,
-0.07764223217964172,
-0.07088486105203629,
0.25604796409606934,
0.3145330548286438,
-0.10768771171569824,
-0.21292918920516968,
-0.005848489701747894,
0.11377325654029846,
0.021964184939861298,
-0.27351194620132446,
-0.08116640150547028,
-0.2242637276649475,
-0.13428042829036713,
0.1155378669500351,
-0.30229926109313965,
0.18130698800086975,
-0.15341731905937195,
-0.08665231615304947,
0.11646325141191483,
0.0937434509396553,
0.2892701029777527,
0.004434381611645222,
-0.24114647507667542,
0.2728566527366638,
0.14182651042938232,
-0.018691452220082283,
0.03289370238780975,
-0.16358554363250732,
-0.32848435640335083,
-0.0526885911822319,
-0.08028893172740936,
0.11593534052371979,
0.2549547851085663,
-0.26021912693977356,
-0.21458546817302704,
0.031060393899679184,
0.37542736530303955,
0.17995819449424744,
-0.3606399595737457,
0.06232365965843201,
0.15748725831508636,
0.3051551282405853,
-0.016741402447223663,
-0.3121994137763977,
0.07349468767642975,
-0.17897513508796692,
-0.35765331983566284,
0.13011911511421204,
-0.000911712646484375,
0.07496558129787445,
-0.2177334427833557,
0.0444009006023407,
0.4878174066543579,
-0.3925590217113495,
0.028195124119520187,
0.12654291093349457,
-0.07393982261419296,
0.12509097158908844,
0.03986778110265732,
-0.061330437660217285,
0.44694897532463074,
0.21191254258155823,
-0.11841198801994324,
0.29879969358444214,
0.22659197449684143,
-0.15691839158535004,
0.19504456222057343,
-0.32141420245170593,
-0.0027479473501443863,
0.05936824157834053,
0.02565913274884224,
0.10653232038021088,
0.0645144134759903,
0.1684112250804901,
-0.04923905432224274,
-0.04892580956220627,
-0.15365728735923767,
0.306557834148407,
-0.19247806072235107,
0.1871172934770584,
0.08527738600969315,
-0.1767416149377823,
-0.17560148239135742,
0.04051349312067032,
-0.11955174803733826,
-0.13833937048912048,
0.35015302896499634,
0.3595314919948578,
0.01808731071650982,
0.10643567144870758,
-0.11381229013204575,
0.2423899620771408,
0.12314894795417786,
-0.33362773060798645,
0.1021973043680191,
0.3771551549434662,
-0.01126139983534813,
-0.1491526961326599,
0.33231714367866516,
0.6502026319503784,
0.5205176472663879,
0.10396957397460938,
0.06877332925796509,
0.020600665360689163,
0.03930658847093582,
0.027049202471971512,
0.11379742622375488,
0.10493318736553192,
0.3370399475097656,
0.20669235289096832,
0.1970016360282898,
-0.12948954105377197,
0.18937011063098907,
0.2372012734413147,
0.1642962247133255,
0.1978883445262909,
0.012826714664697647,
-0.15217947959899902,
-0.36612313985824585,
-0.15895450115203857,
-0.026182323694229126,
-0.21511557698249817,
-0.15423409640789032,
0.1268758922815323,
-0.06235358491539955,
0.17887349426746368,
0.11466719210147858,
0.11698716133832932,
-0.23693980276584625,
0.38650763034820557,
0.5090125799179077,
-0.1169380247592926,
-0.39765363931655884,
-0.22727999091148376,
-0.44204574823379517,
0.1687215268611908,
0.05943717435002327,
-0.005614235997200012,
0.014508165419101715,
0.22647668421268463,
-0.19892486929893494,
-0.06747377663850784,
0.44170236587524414,
0.16981755197048187,
-0.041034117341041565,
0.6356558799743652,
-0.3783237338066101,
0.0006774584762752056,
0.40569671988487244,
-0.15703274309635162,
0.015336789190769196,
-0.3836992383003235,
0.2202458679676056,
-0.05782502144575119,
0.24727670848369598,
-0.16062161326408386,
0.06627460569143295,
-0.39454877376556396,
0.2967628538608551,
0.5504470467567444,
0.01685257814824581,
0.031246935948729515,
-0.08765284717082977,
-0.3352944254875183,
0.19998787343502045,
-0.04183846712112427,
-0.11275750398635864,
0.1416485607624054,
0.4372154772281647,
0.5372055172920227,
-0.1324874758720398,
-0.06924180686473846,
-0.4107624292373657,
0.2712883949279785,
-0.021383658051490784,
0.08942871540784836,
-0.1774350106716156,
0.19445708394050598,
0.21437989175319672,
-0.23487362265586853,
0.2792143225669861,
-0.21022216975688934,
0.13424283266067505,
0.31900453567504883,
-0.5583702325820923,
-0.4061664044857025,
0.45400652289390564,
0.19457679986953735,
-0.15187117457389832,
0.19681806862354279,
0.34316539764404297,
0.09981376677751541,
0.16339638829231262,
-0.6086978912353516,
-0.19865062832832336,
0.33156874775886536,
-0.23096677660942078,
-0.239202618598938,
0.25619399547576904,
-0.027780668810009956,
0.08274531364440918,
0.07530894875526428,
0.43439164757728577,
-0.10755044221878052,
-0.15896573662757874,
0.19667655229568481,
-0.18355324864387512
] |
https://github.com/huggingface/datasets/issues/5717 | The same error occurs with my save_to_disk() of Audio() items. I still get it with:
```python
import datasets
datasets.config.DEFAULT_MAX_BATCH_SIZE=35
from datasets import Features, Array2D, Value, Dataset, Sequence, Audio
```
```
Saving the dataset (41/47 shards): 88%|██████████████████████████████████████████▉ | 297/339 [01:21<00:11, 3.65 examples/s]
Traceback (most recent call last):
File "/mnt/ddrive/prj/voice/voice-training-dataset-create/./dataset.py", line 155, in <module>
create_dataset(args)
File "/mnt/ddrive/prj/voice/voice-training-dataset-create/./dataset.py", line 137, in create_dataset
hf_dataset.save_to_disk(args.outds)
File "/home/j/src/py/datasets/src/datasets/arrow_dataset.py", line 1532, in save_to_disk
for job_id, done, content in Dataset._save_to_disk_single(**kwargs):
File "/home/j/src/py/datasets/src/datasets/arrow_dataset.py", line 1563, in _save_to_disk_single
writer.write_table(pa_table)
File "/home/j/src/py/datasets/src/datasets/arrow_writer.py", line 574, in write_table
pa_table = embed_table_storage(pa_table)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/j/src/py/datasets/src/datasets/table.py", line 2307, in embed_table_storage
arrays = [
^
File "/home/j/src/py/datasets/src/datasets/table.py", line 2308, in <listcomp>
embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/j/src/py/datasets/src/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/j/src/py/datasets/src/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/j/src/py/datasets/src/datasets/table.py", line 2177, in embed_array_storage
return feature.embed_storage(array)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/j/src/py/datasets/src/datasets/features/audio.py", line 276, in embed_storage
storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pyarrow/array.pxi", line 2850, in pyarrow.lib.StructArray.from_arrays
File "pyarrow/array.pxi", line 3290, in pyarrow.lib.c_mask_inverted_from_obj
TypeError: Mask must be a pyarrow.Array of type boolean
``` | Errror when saving to disk a dataset of images | ### Describe the bug
Hello!
I have an issue when I try to save on disk my dataset of images. The error I get is:
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1442, in save_to_disk
for job_id, done, content in Dataset._save_to_disk_single(**kwargs):
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1473, in _save_to_disk_single
writer.write_table(pa_table)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_writer.py", line 570, in write_table
pa_table = embed_table_storage(pa_table)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2268, in embed_table_storage
arrays = [
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2269, in <listcomp>
embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name]
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2142, in embed_array_storage
return feature.embed_storage(array)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/features/image.py", line 269, in embed_storage
storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null())
File "pyarrow/array.pxi", line 2766, in pyarrow.lib.StructArray.from_arrays
File "pyarrow/array.pxi", line 2961, in pyarrow.lib.c_mask_inverted_from_obj
TypeError: Mask must be a pyarrow.Array of type boolean
```
My dataset is around 50K images, is this error might be due to a bad image?
Thanks for the help.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("imagefolder", data_dir="/path/to/dataset")
dataset["train"].save_to_disk("./myds", num_shards=40)
```
### Expected behavior
Having my dataset properly saved to disk.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
- Python version: 3.10.10
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 2.0.0 | 187 | Errror when saving to disk a dataset of images
### Describe the bug
Hello!
I have an issue when I try to save on disk my dataset of images. The error I get is:
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1442, in save_to_disk
for job_id, done, content in Dataset._save_to_disk_single(**kwargs):
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1473, in _save_to_disk_single
writer.write_table(pa_table)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_writer.py", line 570, in write_table
pa_table = embed_table_storage(pa_table)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2268, in embed_table_storage
arrays = [
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2269, in <listcomp>
embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name]
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2142, in embed_array_storage
return feature.embed_storage(array)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/features/image.py", line 269, in embed_storage
storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null())
File "pyarrow/array.pxi", line 2766, in pyarrow.lib.StructArray.from_arrays
File "pyarrow/array.pxi", line 2961, in pyarrow.lib.c_mask_inverted_from_obj
TypeError: Mask must be a pyarrow.Array of type boolean
```
My dataset is around 50K images, is this error might be due to a bad image?
Thanks for the help.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("imagefolder", data_dir="/path/to/dataset")
dataset["train"].save_to_disk("./myds", num_shards=40)
```
### Expected behavior
Having my dataset properly saved to disk.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
- Python version: 3.10.10
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 2.0.0
The same error occurs with my save_to_disk() of Audio() items. I still get it with:
```python
import datasets
datasets.config.DEFAULT_MAX_BATCH_SIZE=35
from datasets import Features, Array2D, Value, Dataset, Sequence, Audio
```
```
Saving the dataset (41/47 shards): 88%|██████████████████████████████████████████▉ | 297/339 [01:21<00:11, 3.65 examples/s]
Traceback (most recent call last):
File "/mnt/ddrive/prj/voice/voice-training-dataset-create/./dataset.py", line 155, in <module>
create_dataset(args)
File "/mnt/ddrive/prj/voice/voice-training-dataset-create/./dataset.py", line 137, in create_dataset
hf_dataset.save_to_disk(args.outds)
File "/home/j/src/py/datasets/src/datasets/arrow_dataset.py", line 1532, in save_to_disk
for job_id, done, content in Dataset._save_to_disk_single(**kwargs):
File "/home/j/src/py/datasets/src/datasets/arrow_dataset.py", line 1563, in _save_to_disk_single
writer.write_table(pa_table)
File "/home/j/src/py/datasets/src/datasets/arrow_writer.py", line 574, in write_table
pa_table = embed_table_storage(pa_table)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/j/src/py/datasets/src/datasets/table.py", line 2307, in embed_table_storage
arrays = [
^
File "/home/j/src/py/datasets/src/datasets/table.py", line 2308, in <listcomp>
embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/j/src/py/datasets/src/datasets/table.py", line 1831, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/j/src/py/datasets/src/datasets/table.py", line 1831, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/j/src/py/datasets/src/datasets/table.py", line 2177, in embed_array_storage
return feature.embed_storage(array)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/j/src/py/datasets/src/datasets/features/audio.py", line 276, in embed_storage
storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pyarrow/array.pxi", line 2850, in pyarrow.lib.StructArray.from_arrays
File "pyarrow/array.pxi", line 3290, in pyarrow.lib.c_mask_inverted_from_obj
TypeError: Mask must be a pyarrow.Array of type boolean
``` | [
-0.07521145045757294,
-0.44404372572898865,
-0.10260006785392761,
0.3910185396671295,
0.4102981388568878,
0.2558813691139221,
0.09858540445566177,
0.14438162744045258,
-0.23703399300575256,
0.16042831540107727,
0.12004079669713974,
0.2100370079278946,
-0.37237343192100525,
-0.163156196475029,
-0.14881615340709686,
-0.06601633876562119,
0.24606919288635254,
0.03519495576620102,
0.31553390622138977,
-0.019280478358268738,
-0.4303226172924042,
0.19783370196819305,
-0.1113562062382698,
0.09576098620891571,
-0.27228742837905884,
-0.2518807351589203,
-0.07265754044055939,
0.03906097263097763,
-0.21042500436306,
-0.17154012620449066,
0.017110593616962433,
-0.3008976876735687,
0.2001149207353592,
0.30391937494277954,
-0.00010683824075385928,
-0.06346380710601807,
0.1338302344083786,
-0.2446221113204956,
-0.1711452603340149,
-0.18469086289405823,
-0.029161572456359863,
-0.23259443044662476,
-0.09101284295320511,
-0.4684022068977356,
0.2943912744522095,
-0.39507049322128296,
0.17993436753749847,
-0.2451118528842926,
0.36369597911834717,
0.16123627126216888,
0.3394441306591034,
0.011902399361133575,
0.06407707929611206,
-0.04979504644870758,
0.2123362123966217,
0.24630074203014374,
-0.10447150468826294,
0.2141420692205429,
-0.0875370055437088,
-0.18472406268119812,
0.3181774616241455,
0.24582964181900024,
-0.17366400361061096,
0.021281659603118896,
0.36216437816619873,
0.12314276397228241,
0.14020870625972748,
-0.39135026931762695,
-0.038269393146038055,
-0.24940410256385803,
0.38114824891090393,
-0.20504772663116455,
-0.3106054365634918,
0.1304585039615631,
0.10274402797222137,
-0.17744117975234985,
0.123715341091156,
0.4535548985004425,
-0.30707091093063354,
-0.020448630675673485,
-0.20804595947265625,
-0.06651081889867783,
-0.28110188245773315,
0.14265312254428864,
0.10370694845914841,
-0.36077338457107544,
-0.13505321741104126,
0.047490090131759644,
0.35591980814933777,
-0.08992345631122589,
0.23759342730045319,
-0.1558655947446823,
0.025217805057764053,
-0.013141533359885216,
-0.06903750449419022,
0.07333274185657501,
-0.28681495785713196,
0.0021687988191843033,
-0.0037605762481689453,
0.14187319576740265,
0.13929684460163116,
-0.182829350233078,
0.10016985237598419,
0.5118119120597839,
0.16544079780578613,
0.07154826819896698,
-0.05473723262548447,
0.25718164443969727,
0.25826579332351685,
0.17220374941825867,
0.07092982530593872,
-0.23628807067871094,
-0.011139418929815292,
-0.08605104684829712,
0.6543039679527283,
-0.1560084968805313,
0.291303813457489,
-0.1396411657333374,
-0.346112996339798,
0.33113956451416016,
0.17150026559829712,
0.08249978721141815,
-0.21306881308555603,
0.40643012523651123,
0.18383638560771942,
0.01610761694610119,
0.2483498454093933,
0.3640080988407135,
0.09276524931192398,
0.32699909806251526,
-0.19953101873397827,
0.05025489255785942,
0.06057003140449524,
0.01128462329506874,
-0.0712488517165184,
-0.14167657494544983,
-0.032544322311878204,
-0.07895251363515854,
0.002147434279322624,
-0.12808194756507874,
0.05790014564990997,
-0.3844551146030426,
0.12698836624622345,
0.21361513435840607,
0.10926977545022964,
-0.018329795449972153,
0.18122516572475433,
-0.04368593171238899,
0.06269016861915588,
0.3234748840332031,
-0.24392817914485931,
-0.14761410653591156,
-0.5825220942497253,
0.2519259452819824,
0.20470614731311798,
0.18937428295612335,
-0.41880130767822266,
-0.28549641370773315,
0.532703161239624,
-0.06712023913860321,
0.1645340472459793,
0.005608614534139633,
-0.23900458216667175,
-0.40241342782974243,
0.031858861446380615,
0.06052999943494797,
-0.11074275523424149,
0.3362394869327545,
-0.18630331754684448,
-0.1206112876534462,
0.18576999008655548,
0.279161274433136,
0.0943707823753357,
0.022373739629983902,
-0.3228868544101715,
0.20212626457214355,
0.2174447476863861,
-0.1931425780057907,
-0.2941567301750183,
0.02616206556558609,
0.009151071310043335,
-0.22987550497055054,
0.009707003831863403,
0.3027123510837555,
0.25104236602783203,
0.03275531157851219,
0.005905028432607651,
0.12701642513275146,
-0.11297629028558731,
0.134468674659729,
-0.4011509120464325,
0.0364857017993927,
-0.039081402122974396,
0.07814368605613708,
-0.08642607927322388,
-0.023362748324871063,
0.15075474977493286,
-0.11259259283542633,
0.08091743290424347,
-0.1435239017009735,
0.19488419592380524,
0.4261718690395355,
0.5107192993164062,
-0.1333882063627243,
-0.02897782064974308,
-0.1044483557343483,
-0.3802588880062103,
-0.010527841746807098,
0.026425980031490326,
-0.15207281708717346,
-0.40087080001831055,
0.002535223960876465,
-0.11862386763095856,
0.040294088423252106,
-0.1852819323539734,
0.08772015571594238,
0.20070911943912506,
0.02182682603597641,
-0.228620246052742,
0.19586914777755737,
-0.13302363455295563,
0.10301966965198517,
-0.06732400506734848,
0.0161990225315094,
-0.1804533153772354,
0.6394294500350952,
-0.36360448598861694,
-0.3987492024898529,
-0.09684595465660095,
-0.13777363300323486,
0.07341127097606659,
0.05916937440633774,
-0.22453834116458893,
0.5005024671554565,
0.09431740641593933,
0.2028811275959015,
-0.21213915944099426,
-0.24337849020957947,
0.09839238971471786,
-0.48302143812179565,
0.02854587323963642,
0.08102963119745255,
0.35732531547546387,
0.09609165787696838,
-0.14956983923912048,
0.1470751017332077,
-0.07579964399337769,
-0.03369344025850296,
0.03924381732940674,
0.21826258301734924,
0.024246864020824432,
0.09217220544815063,
0.19953469932079315,
-0.4022337794303894,
0.1265515387058258,
0.1389187127351761,
0.03470625728368759,
-0.23187388479709625,
-0.14357584714889526,
-0.13990244269371033,
0.19486744701862335,
0.18210984766483307,
0.2607106566429138,
0.3337177336215973,
0.12543466687202454,
-0.07073107361793518,
0.019383421167731285,
0.4253004789352417,
0.5106462240219116,
0.04017811268568039,
-0.3077417016029358,
-0.053535424172878265,
0.024117354303598404,
0.06729038804769516,
0.30872470140457153,
0.084163136780262,
0.2868502736091614,
0.26298999786376953,
0.2588483393192291,
-0.014060648158192635,
-0.21609899401664734,
-0.05188094452023506,
-0.15916407108306885,
0.3642865717411041,
-0.05564786121249199,
0.13718882203102112,
-0.1274757832288742,
-0.17177258431911469,
-0.059790875762701035,
0.0933283269405365,
-0.21778970956802368,
-0.30813199281692505,
-0.06042242795228958,
0.33995699882507324,
-0.03990950807929039,
-0.04706772044301033,
-0.027463167905807495,
0.3057284355163574,
0.1097867488861084,
0.3232915699481964,
-0.20846343040466309,
0.04787677526473999,
-0.07905063033103943,
0.058791935443878174,
0.16147424280643463,
-0.005746904760599136,
0.550287663936615,
0.06422661244869232,
0.0827576294541359,
-0.4550299644470215,
0.04101371765136719,
-0.040541574358940125,
-0.07280591130256653,
0.10894006490707397,
0.22567924857139587,
0.24726293981075287,
-0.06191921606659889,
-0.36291542649269104,
0.32286959886550903,
-0.008566070348024368,
-0.33640557527542114,
0.28005272150039673,
0.27166590094566345,
-0.14974938333034515,
-0.24121031165122986,
0.18850746750831604,
-0.353957861661911,
-0.3645654618740082,
0.09588726609945297,
0.08514538407325745,
0.27941083908081055,
-0.08018803596496582,
0.31513988971710205,
-0.052724771201610565,
0.2251349687576294,
-0.1396666318178177,
-0.1602000892162323,
-0.09011765569448471,
0.3879828155040741,
-0.10942240059375763,
-0.3624897599220276,
0.07067736983299255,
0.10923071205615997,
-0.012263101525604725,
-0.022776179015636444,
-0.49136704206466675,
-0.43912214040756226,
-0.0586189329624176,
-0.06296747922897339,
-0.31498757004737854,
0.01548515073955059,
0.0672231987118721,
0.14542317390441895,
-0.11607758700847626,
-0.09162913262844086,
-0.22736448049545288,
0.06458864361047745,
0.0768972784280777,
0.3309994041919708,
-0.058574918657541275,
0.411710262298584,
0.2297690212726593,
0.019909778609871864,
0.00584014505147934,
-0.13140517473220825,
0.6140477657318115,
0.11263645440340042,
0.3036918044090271,
-0.1055363118648529,
-0.48759526014328003,
-0.05930434167385101,
-0.006994426250457764,
-0.3009335994720459,
-0.2788499593734741,
-0.1363316774368286,
-0.05949841067194939,
-0.09853174537420273,
0.08512476086616516,
-0.02012932300567627,
0.09336985647678375,
-0.18553999066352844,
0.03879851475358009,
0.05488961562514305,
-0.28556662797927856,
-0.09226623177528381,
-0.09372429549694061,
-0.04375462234020233,
-0.05710690841078758,
0.2522600591182709,
0.34159982204437256,
-0.1299227774143219,
-0.14834710955619812,
-0.016626667231321335,
-0.2732453942298889,
0.4063478708267212,
0.13872011005878448,
0.3885350525379181,
-0.1061183512210846,
0.022707782685756683,
0.2076321691274643,
-0.1498495191335678,
0.493360698223114,
-0.1999422013759613,
-0.14206089079380035,
0.008977726101875305,
0.12484601885080338,
-0.47099441289901733,
-0.04782307893037796,
0.011989563703536987,
0.06963776051998138,
-0.25989922881126404,
0.5957697033882141,
-0.015774846076965332,
0.010713491588830948,
0.06415470689535141,
0.007493361830711365,
-0.4021505117416382,
-0.21996134519577026,
-0.36466723680496216,
-0.36327236890792847,
-0.3501264750957489,
-0.12055060267448425,
0.02136749029159546,
0.059523217380046844,
0.24893322587013245,
0.018065892159938812,
0.04143015295267105,
-0.10177899897098541,
-0.17392538487911224,
-0.20327921211719513,
0.5465952157974243,
-0.4622514843940735,
0.17136447131633759,
-0.1784375160932541,
0.04953498765826225,
0.5429152250289917,
0.25256577134132385,
-0.272407591342926,
-0.22448107600212097,
0.2086336612701416,
-0.1811966449022293,
0.09950433671474457,
-0.020101159811019897,
-0.2247089445590973,
-0.039665453135967255,
-0.10478943586349487,
0.2824459373950958,
-0.20428350567817688,
-0.3170278072357178,
0.360075443983078,
-0.2905513048171997,
-0.12862136960029602,
0.13764218986034393,
0.33205533027648926,
0.1727677285671234,
0.17940418422222137,
0.0715818852186203,
-0.024893026798963547,
-0.10104398429393768,
0.4275776147842407,
0.48721930384635925,
0.8410309553146362,
-0.065415158867836,
0.3637359142303467,
-0.03740920126438141,
-0.3139168918132782,
-0.007414024323225021,
0.04606068879365921,
0.06794607639312744,
-0.3839375078678131,
-0.44326284527778625,
-0.07460722327232361,
-0.1579577922821045,
-0.02599669247865677,
0.0001272503286600113,
-0.2726850211620331,
-0.023972557857632637,
-0.2626406252384186,
-0.0488782562315464,
-0.24869129061698914,
-0.07510309666395187,
-0.4291793406009674,
-0.23395293951034546,
-0.1827024221420288,
0.22474460303783417,
-0.04153886437416077,
0.06093453988432884,
-0.03594597801566124,
-0.0759660005569458,
-0.07736749947071075,
-0.1276557892560959,
-0.403288871049881,
-0.06772810965776443,
-0.29874956607818604,
0.40608322620391846,
-0.14162467420101166,
-0.33281394839286804,
-0.14779189229011536,
0.3944907486438751,
0.1385461390018463,
-0.04560510441660881,
0.0038916952908039093,
-0.22316043078899384,
0.062314722687006,
0.06088651716709137,
-0.2622636556625366,
-0.09927383065223694,
0.2314627766609192,
-0.17787712812423706,
0.09466791152954102,
-0.05396386608481407,
0.15422281622886658,
-0.19130291044712067,
-0.017752304673194885,
0.3690420985221863,
-0.06284864246845245,
-0.044910404831171036,
-0.33713841438293457,
-0.3546522855758667,
-0.17530888319015503,
-0.28952187299728394,
0.20370271801948547,
0.2759840190410614,
0.03658343106508255,
0.3743407130241394,
-0.16362470388412476,
-0.10972857475280762,
0.1342109888792038,
0.544333279132843,
0.11650422215461731,
-0.12895473837852478,
0.3010965585708618,
-0.16983962059020996,
-0.1776038408279419,
-0.33406203985214233,
0.3911176025867462,
-0.08485348522663116,
-0.29709964990615845,
0.4522235691547394,
-0.2659975290298462,
0.09892553091049194,
-0.13411672413349152,
0.03527456149458885,
0.2476743757724762,
0.0539398193359375,
0.025842301547527313,
-0.40739691257476807,
-0.5168470144271851,
0.14435678720474243,
0.1066773533821106,
0.33252233266830444,
-0.2200893610715866,
-0.17351530492305756,
0.11528071016073227,
-0.0547378733754158,
-0.35790330171585083,
0.29164302349090576,
-0.37721988558769226,
0.04004397615790367,
0.1282629370689392,
0.0003440026193857193,
-0.07764223217964172,
-0.07088486105203629,
0.25604796409606934,
0.3145330548286438,
-0.10768771171569824,
-0.21292918920516968,
-0.005848489701747894,
0.11377325654029846,
0.021964184939861298,
-0.27351194620132446,
-0.08116640150547028,
-0.2242637276649475,
-0.13428042829036713,
0.1155378669500351,
-0.30229926109313965,
0.18130698800086975,
-0.15341731905937195,
-0.08665231615304947,
0.11646325141191483,
0.0937434509396553,
0.2892701029777527,
0.004434381611645222,
-0.24114647507667542,
0.2728566527366638,
0.14182651042938232,
-0.018691452220082283,
0.03289370238780975,
-0.16358554363250732,
-0.32848435640335083,
-0.0526885911822319,
-0.08028893172740936,
0.11593534052371979,
0.2549547851085663,
-0.26021912693977356,
-0.21458546817302704,
0.031060393899679184,
0.37542736530303955,
0.17995819449424744,
-0.3606399595737457,
0.06232365965843201,
0.15748725831508636,
0.3051551282405853,
-0.016741402447223663,
-0.3121994137763977,
0.07349468767642975,
-0.17897513508796692,
-0.35765331983566284,
0.13011911511421204,
-0.000911712646484375,
0.07496558129787445,
-0.2177334427833557,
0.0444009006023407,
0.4878174066543579,
-0.3925590217113495,
0.028195124119520187,
0.12654291093349457,
-0.07393982261419296,
0.12509097158908844,
0.03986778110265732,
-0.061330437660217285,
0.44694897532463074,
0.21191254258155823,
-0.11841198801994324,
0.29879969358444214,
0.22659197449684143,
-0.15691839158535004,
0.19504456222057343,
-0.32141420245170593,
-0.0027479473501443863,
0.05936824157834053,
0.02565913274884224,
0.10653232038021088,
0.0645144134759903,
0.1684112250804901,
-0.04923905432224274,
-0.04892580956220627,
-0.15365728735923767,
0.306557834148407,
-0.19247806072235107,
0.1871172934770584,
0.08527738600969315,
-0.1767416149377823,
-0.17560148239135742,
0.04051349312067032,
-0.11955174803733826,
-0.13833937048912048,
0.35015302896499634,
0.3595314919948578,
0.01808731071650982,
0.10643567144870758,
-0.11381229013204575,
0.2423899620771408,
0.12314894795417786,
-0.33362773060798645,
0.1021973043680191,
0.3771551549434662,
-0.01126139983534813,
-0.1491526961326599,
0.33231714367866516,
0.6502026319503784,
0.5205176472663879,
0.10396957397460938,
0.06877332925796509,
0.020600665360689163,
0.03930658847093582,
0.027049202471971512,
0.11379742622375488,
0.10493318736553192,
0.3370399475097656,
0.20669235289096832,
0.1970016360282898,
-0.12948954105377197,
0.18937011063098907,
0.2372012734413147,
0.1642962247133255,
0.1978883445262909,
0.012826714664697647,
-0.15217947959899902,
-0.36612313985824585,
-0.15895450115203857,
-0.026182323694229126,
-0.21511557698249817,
-0.15423409640789032,
0.1268758922815323,
-0.06235358491539955,
0.17887349426746368,
0.11466719210147858,
0.11698716133832932,
-0.23693980276584625,
0.38650763034820557,
0.5090125799179077,
-0.1169380247592926,
-0.39765363931655884,
-0.22727999091148376,
-0.44204574823379517,
0.1687215268611908,
0.05943717435002327,
-0.005614235997200012,
0.014508165419101715,
0.22647668421268463,
-0.19892486929893494,
-0.06747377663850784,
0.44170236587524414,
0.16981755197048187,
-0.041034117341041565,
0.6356558799743652,
-0.3783237338066101,
0.0006774584762752056,
0.40569671988487244,
-0.15703274309635162,
0.015336789190769196,
-0.3836992383003235,
0.2202458679676056,
-0.05782502144575119,
0.24727670848369598,
-0.16062161326408386,
0.06627460569143295,
-0.39454877376556396,
0.2967628538608551,
0.5504470467567444,
0.01685257814824581,
0.031246935948729515,
-0.08765284717082977,
-0.3352944254875183,
0.19998787343502045,
-0.04183846712112427,
-0.11275750398635864,
0.1416485607624054,
0.4372154772281647,
0.5372055172920227,
-0.1324874758720398,
-0.06924180686473846,
-0.4107624292373657,
0.2712883949279785,
-0.021383658051490784,
0.08942871540784836,
-0.1774350106716156,
0.19445708394050598,
0.21437989175319672,
-0.23487362265586853,
0.2792143225669861,
-0.21022216975688934,
0.13424283266067505,
0.31900453567504883,
-0.5583702325820923,
-0.4061664044857025,
0.45400652289390564,
0.19457679986953735,
-0.15187117457389832,
0.19681806862354279,
0.34316539764404297,
0.09981376677751541,
0.16339638829231262,
-0.6086978912353516,
-0.19865062832832336,
0.33156874775886536,
-0.23096677660942078,
-0.239202618598938,
0.25619399547576904,
-0.027780668810009956,
0.08274531364440918,
0.07530894875526428,
0.43439164757728577,
-0.10755044221878052,
-0.15896573662757874,
0.19667655229568481,
-0.18355324864387512
] |
https://github.com/huggingface/datasets/issues/5716 | Hi! Can you share one of the problematic audio files with us?
I tried to reproduce the error with the following code:
```python
import soundfile as sf
import numpy as np
from datasets import Audio
sf.write("empty.wav", np.array([]), 16000)
Audio(sampling_rate=24000).decode_example({"path": "empty.wav", "bytes": None})
```
But without success.
Also, what version of `librosa` is installed in your env? (You can get this info with `python -c "import librosa; print(librosa.__version__)`)
| Handle empty audio | Some audio paths exist, but they are empty, and an error will be reported when reading the audio path.How to use the filter function to avoid the empty audio path?
when a audio is empty, when do resample , it will break:
`array, sampling_rate = sf.read(f) array = librosa.resample(array, orig_sr=sampling_rate, target_sr=self.sampling_rate)` | 67 | Handle empty audio
Some audio paths exist, but they are empty, and an error will be reported when reading the audio path.How to use the filter function to avoid the empty audio path?
when a audio is empty, when do resample , it will break:
`array, sampling_rate = sf.read(f) array = librosa.resample(array, orig_sr=sampling_rate, target_sr=self.sampling_rate)`
Hi! Can you share one of the problematic audio files with us?
I tried to reproduce the error with the following code:
```python
import soundfile as sf
import numpy as np
from datasets import Audio
sf.write("empty.wav", np.array([]), 16000)
Audio(sampling_rate=24000).decode_example({"path": "empty.wav", "bytes": None})
```
But without success.
Also, what version of `librosa` is installed in your env? (You can get this info with `python -c "import librosa; print(librosa.__version__)`)
| [
0.12720604240894318,
0.0029352009296417236,
0.006146043539047241,
0.06452380120754242,
0.19623878598213196,
-0.4187437891960144,
0.1112334132194519,
-0.03900868818163872,
0.06735233962535858,
0.5490593314170837,
-0.14358477294445038,
-0.01921803504228592,
-0.2331731617450714,
-0.01823415607213974,
-0.4672420620918274,
-0.08751573413610458,
-0.17406755685806274,
0.2785399258136749,
-0.048009466379880905,
-0.22073960304260254,
-0.3688158392906189,
0.09234808385372162,
-0.4008539617061615,
0.026052556931972504,
0.15068192780017853,
0.031009631231427193,
0.23567962646484375,
0.10759567469358444,
-0.03057451918721199,
-0.0970345064997673,
-0.013960152864456177,
-0.5343846678733826,
-0.22397944331169128,
0.4219694137573242,
-0.00012674469326157123,
-0.13483674824237823,
0.43408429622650146,
-0.2621203660964966,
-0.10145553201436996,
-0.5706146955490112,
-0.36436617374420166,
0.18231797218322754,
-0.352010577917099,
0.006975889205932617,
-0.04600372537970543,
0.053255289793014526,
-0.06080804020166397,
-0.4538400173187256,
0.5239293575286865,
0.33052363991737366,
0.0949070155620575,
-0.17361144721508026,
-0.0755632072687149,
0.36344391107559204,
0.2700384259223938,
0.3381052613258362,
0.10923611372709274,
-0.18630489706993103,
0.3416581153869629,
0.026972025632858276,
0.13199591636657715,
0.44978034496307373,
-0.49137797951698303,
-0.02664756216108799,
0.06064288690686226,
-0.26231691241264343,
0.07016556710004807,
-0.513052225112915,
0.2217455506324768,
0.5082472562789917,
0.1173439770936966,
0.06234147399663925,
-0.37271401286125183,
-0.03219123184680939,
0.026102520525455475,
-0.028306420892477036,
0.2756006121635437,
0.3491872251033783,
-0.24921374022960663,
0.041187431663274765,
-0.14977458119392395,
-0.02702672779560089,
-0.02130899578332901,
0.27980920672416687,
0.27363330125808716,
0.11973480880260468,
-0.12347990274429321,
0.1092001423239708,
0.41268420219421387,
-0.33885982632637024,
-0.18061736226081848,
-0.5560065507888794,
0.13433121144771576,
0.4989989697933197,
0.02237442135810852,
-0.04245274141430855,
-0.0747469887137413,
0.09894781559705734,
-0.0854988843202591,
0.006972869858145714,
-0.23722246289253235,
-0.0030947113409638405,
0.08165091276168823,
0.36491814255714417,
0.1600155383348465,
-0.419110506772995,
0.09302937984466553,
0.09586299955844879,
0.11587005853652954,
-0.11001166701316833,
0.1365126669406891,
-0.20669731497764587,
0.06761195510625839,
0.25549396872520447,
-0.4688683748245239,
0.2607528269290924,
0.012787953019142151,
-0.18603941798210144,
-0.35746777057647705,
-0.14997848868370056,
-0.6114792227745056,
0.08730687201023102,
0.2926429510116577,
0.07169944047927856,
0.03969329595565796,
0.28511446714401245,
0.3497730493545532,
0.09067162871360779,
-0.18079118430614471,
0.012911144644021988,
0.12496821582317352,
0.03973088040947914,
0.035084739327430725,
-0.011074412614107132,
0.1771891564130783,
0.07838577032089233,
0.43845224380493164,
-0.05487820506095886,
-0.15297231078147888,
0.031136125326156616,
0.25465691089630127,
-0.46444055438041687,
0.1957351416349411,
0.5389087796211243,
0.21304450929164886,
0.11885524541139603,
-0.18182027339935303,
0.03393816947937012,
-0.05228167772293091,
0.5897253751754761,
-0.20474475622177124,
-0.2678934335708618,
0.005831090733408928,
0.058482758700847626,
-0.3358617424964905,
0.43163976073265076,
0.16606774926185608,
0.18346476554870605,
-0.14420980215072632,
-0.47989392280578613,
0.1397373527288437,
0.16827327013015747,
-0.287151038646698,
-0.08408655226230621,
0.43155840039253235,
0.341939777135849,
-0.38248947262763977,
-0.25954192876815796,
-0.46506446599960327,
-0.07587632536888123,
0.11814470589160919,
-0.10663169622421265,
0.1567552387714386,
-0.05401884764432907,
-0.12851452827453613,
0.3951948285102844,
0.3852604627609253,
-0.26989316940307617,
-0.037384968250989914,
-0.11824150383472443,
0.2588360905647278,
0.16409839689731598,
0.008653797209262848,
0.17059902846813202,
0.05825764685869217,
-0.28344276547431946,
-0.19853545725345612,
0.4414677619934082,
-0.0923309326171875,
-0.2964804768562317,
-0.10056160390377045,
-0.16789963841438293,
-0.10179343819618225,
-0.0019485801458358765,
-0.12375243008136749,
0.02907840721309185,
-0.09374699741601944,
0.0124259814620018,
-0.1671779453754425,
0.06439554691314697,
0.168266162276268,
0.2430211454629898,
0.7142535448074341,
0.08431775867938995,
-0.0695033147931099,
-0.10615716874599457,
0.3573477268218994,
-0.24885061383247375,
-0.22080279886722565,
-0.14129364490509033,
-0.021660897880792618,
-0.1997475028038025,
0.19546988606452942,
-0.16136157512664795,
-0.11599728465080261,
0.06548154354095459,
-0.020206090062856674,
0.12960520386695862,
-0.10492603480815887,
0.02518407255411148,
-0.14594236016273499,
-0.04750371724367142,
-0.23689089715480804,
0.047359760850667953,
-0.20238026976585388,
0.15287509560585022,
0.19687941670417786,
-0.17132988572120667,
-0.10213898122310638,
0.3396119773387909,
0.28530097007751465,
0.2432401329278946,
0.006289571523666382,
0.3589670956134796,
0.17072223126888275,
-0.1366579532623291,
-0.37101325392723083,
0.2218095064163208,
0.09584063291549683,
-0.1404406875371933,
-0.0405845120549202,
0.347260057926178,
0.436592698097229,
-0.21782667934894562,
0.06277529895305634,
0.16942079365253448,
-0.1162685751914978,
0.48414844274520874,
0.14951422810554504,
0.01497214287519455,
0.08015704900026321,
-0.12491615116596222,
-0.2806815803050995,
0.04750850796699524,
0.09857475757598877,
-0.2977481484413147,
0.2613546848297119,
0.0669792890548706,
-0.015354029834270477,
-0.4360700845718384,
0.17066727578639984,
-0.060170143842697144,
-0.03437550365924835,
0.1652354598045349,
-0.1164112240076065,
0.005809880793094635,
0.2344990372657776,
0.08918938040733337,
0.08540790528059006,
0.058127790689468384,
0.0004637278616428375,
-0.037357646971940994,
0.18267491459846497,
-0.07014074921607971,
0.391043484210968,
0.3027120530605316,
-0.13550876080989838,
0.19177958369255066,
-0.26197296380996704,
0.015157733112573624,
-0.02294367551803589,
-0.09511537104845047,
-0.07877155393362045,
-0.10830597579479218,
-0.18297603726387024,
-0.26626384258270264,
-0.010768264532089233,
-0.36468976736068726,
-0.036157798022031784,
-0.3736245036125183,
-0.2095291018486023,
0.2232103794813156,
0.12502621114253998,
0.3721509575843811,
-0.4710069000720978,
0.24578553438186646,
0.12314914166927338,
0.22343853116035461,
-0.019681323319673538,
-0.19050845503807068,
-0.07294400036334991,
0.3363085687160492,
-0.3184508681297302,
-0.014603212475776672,
0.2604954242706299,
0.19553974270820618,
-0.24602624773979187,
0.047232456505298615,
-0.011523831635713577,
0.3517950177192688,
-0.15545432269573212,
0.053051866590976715,
0.20767535269260406,
0.1975870281457901,
-0.04853866249322891,
0.14909133315086365,
0.04944851994514465,
-0.4685719609260559,
0.18029530346393585,
0.07804914563894272,
0.026427902281284332,
0.16453489661216736,
0.05514848232269287,
0.475902795791626,
-0.3824697434902191,
-0.20393921434879303,
-0.18745315074920654,
-0.29659730195999146,
-0.29480087757110596,
-0.41963881254196167,
0.13897477090358734,
0.17870056629180908,
0.20731380581855774,
0.06387849897146225,
-0.37505286931991577,
-0.10469894856214523,
0.030994359403848648,
-0.18537726998329163,
0.23081287741661072,
0.16513660550117493,
0.05993974953889847,
0.3168864846229553,
-0.3257484436035156,
-0.10009409487247467,
0.11110244691371918,
-0.21614930033683777,
-0.08447964489459991,
0.38083234429359436,
-0.36644697189331055,
0.03230596333742142,
0.23883037269115448,
0.15299181640148163,
0.02528892457485199,
0.03958730399608612,
-0.15339016914367676,
-0.1150917261838913,
0.2878294289112091,
-0.15972159802913666,
0.6627225279808044,
0.18878304958343506,
0.3842372000217438,
-0.1287665218114853,
0.11848749220371246,
0.2767690420150757,
0.22622665762901306,
0.16879692673683167,
0.10071821510791779,
0.15307682752609253,
-0.006534889340400696,
0.02559516578912735,
-0.05832558870315552,
0.4133831262588501,
-0.02905583381652832,
-0.15227295458316803,
0.30346256494522095,
0.12026477605104446,
-0.16408780217170715,
-0.1317325383424759,
-0.36107373237609863,
-0.17565786838531494,
0.19163204729557037,
0.026181481778621674,
0.24522118270397186,
0.00958801805973053,
0.15924248099327087,
0.24601738154888153,
-0.1885252594947815,
-0.13414651155471802,
0.25141188502311707,
0.45098498463630676,
0.04025674983859062,
-0.10215344280004501,
-0.29119858145713806,
0.16062985360622406,
0.23091591894626617,
0.13756988942623138,
0.24865876138210297,
-0.23911909759044647,
-0.07762984931468964,
-0.08674594759941101,
0.2447957843542099,
0.5425233244895935,
-0.18378938734531403,
-0.2901015281677246,
0.050285086035728455,
0.1307400017976761,
-0.04058876633644104,
0.2297622561454773,
-0.169630765914917,
0.046150825917720795,
0.18770217895507812,
0.0146835558116436,
-0.12759733200073242,
0.08321815729141235,
-0.05508420988917351,
0.4187313914299011,
0.05210380256175995,
-0.05004703253507614,
-0.2639099955558777,
-0.4462246000766754,
-0.04442867264151573,
0.13867847621440887,
-0.1112605482339859,
0.2818531394004822,
0.2586766481399536,
-0.31559374928474426,
0.2888832986354828,
-0.19375774264335632,
0.2989308834075928,
-0.1670912206172943,
0.6055330038070679,
-0.2394603192806244,
0.17918816208839417,
-0.024180732667446136,
-0.3849520981311798,
0.12528753280639648,
0.23859649896621704,
-0.2078392058610916,
0.18252438306808472,
-0.03531031683087349,
-0.15616858005523682,
0.13278555870056152,
0.0688389465212822,
0.06359401345252991,
0.25185543298721313,
0.1702631562948227,
0.19154895842075348,
0.060823749750852585,
0.05796454846858978,
0.01696949452161789,
0.08384579420089722,
0.04066158086061478,
-0.1933155655860901,
0.1977922022342682,
-0.07224522531032562,
0.05484342575073242,
0.6002711653709412,
0.43936872482299805,
0.08356033265590668,
0.26998770236968994,
-0.23758898675441742,
1.0474188327789307,
0.27546289563179016,
-0.18499472737312317,
0.3158380687236786,
-0.18320298194885254,
-0.007166292518377304,
-0.2290215939283371,
0.14670595526695251,
0.27570563554763794,
0.29900482296943665,
-0.1122225672006607,
0.12944087386131287,
0.16611282527446747,
0.49041950702667236,
-0.16397343575954437,
0.5546525716781616,
-0.10617110878229141,
0.08150692284107208,
0.009451102465391159,
-0.2970098853111267,
-0.13003025949001312,
0.017788544297218323,
-0.10730184614658356,
-0.00359388068318367,
0.2760067880153656,
0.15052193403244019,
0.2030363380908966,
-0.14183670282363892,
0.5767543315887451,
-0.15534141659736633,
-0.016576528549194336,
0.001794770359992981,
-0.3351203501224518,
-0.47684046626091003,
0.09457316249608994,
-0.12312262505292892,
-0.010697506368160248,
-0.23786212503910065,
-0.35385170578956604,
0.44471728801727295,
0.028149137273430824,
0.1476595550775528,
-0.061076246201992035,
0.2983905076980591,
-0.21408012509346008,
0.19794368743896484,
0.06929124146699905,
-0.05302420258522034,
-0.5526213049888611,
0.29555949568748474,
-0.35887905955314636,
-0.1463184952735901,
0.4045196771621704,
-0.23433439433574677,
0.42645463347435,
0.05807005986571312,
-0.29675763845443726,
0.07613682746887207,
0.2830856740474701,
0.03775763511657715,
0.05519454553723335,
-0.2178567349910736,
-0.4679783880710602,
0.3270013928413391,
-0.0833701640367508,
-0.08477956056594849,
0.03669321537017822,
0.0014231093227863312,
0.07700562477111816,
-0.03665542975068092,
0.34245505928993225,
-0.3094419836997986,
0.04221073538064957,
-0.10847736895084381,
0.11855106800794601,
-0.1139102429151535,
0.013116061687469482,
0.1965678632259369,
0.25017601251602173,
-0.29511702060699463,
-0.13718506693840027,
-0.10164016485214233,
-0.20420309901237488,
0.3889288008213043,
-0.5209823846817017,
-0.43050920963287354,
-0.21081218123435974,
0.28970709443092346,
0.30652087926864624,
-0.12014200538396835,
-0.18697956204414368,
-0.14118139445781708,
0.05680692940950394,
-0.4577746093273163,
-0.14056846499443054,
0.11719584465026855,
-0.3714074492454529,
0.4411458671092987,
-0.2100558578968048,
0.29751056432724,
0.15981854498386383,
-0.2085501253604889,
-0.049360405653715134,
0.08915561437606812,
-0.09589995443820953,
0.04701732099056244,
0.014906369149684906,
0.2713327407836914,
-0.005809448659420013,
-0.24537590146064758,
-0.024825261905789375,
-0.3222426772117615,
0.014823473989963531,
-0.1309511363506317,
-0.23002034425735474,
0.19326135516166687,
-0.052601173520088196,
0.11915042996406555,
-0.47802382707595825,
0.026450999081134796,
-0.21465548872947693,
0.10530130565166473,
-0.1827496886253357,
-0.06816651672124863,
0.21072593331336975,
0.14518287777900696,
0.4285552203655243,
-0.12973140180110931,
-0.10377959907054901,
-0.09880433976650238,
-0.31861352920532227,
-0.5275226831436157,
0.22458049654960632,
0.3373457193374634,
0.14862415194511414,
0.01517581194639206,
0.05449405312538147,
0.2484922558069229,
-0.06082075089216232,
0.22179058194160461,
0.45567747950553894,
0.12379705905914307,
-0.24755893647670746,
0.24540077149868011,
-0.21423320472240448,
0.15376967191696167,
0.15992377698421478,
0.04982835054397583,
-0.34256911277770996,
-0.09857086837291718,
0.6515191197395325,
0.16817668080329895,
0.20809990167617798,
0.15259091556072235,
0.23506954312324524,
0.6626056432723999,
-0.09674714505672455,
0.012148027308285236,
-0.1517375260591507,
-0.16764071583747864,
-0.09538811445236206,
0.22071892023086548,
-0.4129272997379303,
0.579291820526123,
0.016741354018449783,
-0.1679225116968155,
-0.1949835866689682,
-0.5422499179840088,
-0.28266504406929016,
0.22461672127246857,
-0.041281502693891525,
0.0979505106806755,
-0.12181009352207184,
-0.10863219201564789,
-0.21597573161125183,
-0.2845171391963959,
0.34825441241264343,
0.10216126590967178,
-0.02463536523282528,
0.07093669474124908,
-0.12230744957923889,
-0.05492658168077469,
-0.03253839164972305,
-0.15259122848510742,
0.5127729177474976,
0.08243970572948456,
0.2904094457626343,
-0.0877847746014595,
0.022385068237781525,
0.019526060670614243,
-0.45268911123275757,
0.443711519241333,
0.18241998553276062,
-0.023406460881233215,
0.18410223722457886,
0.7091287970542908,
0.19242072105407715,
0.6315944194793701,
0.21140795946121216,
0.09079703688621521,
0.05114448815584183,
-0.14861531555652618,
0.2567775249481201,
-0.011173650622367859,
-0.11788558959960938,
-0.0460515022277832,
0.33287477493286133,
0.3055906593799591,
0.5238907933235168,
-0.15219053626060486,
-0.024609003216028214,
-0.08509831130504608,
0.3165942430496216,
-0.01438506692647934,
0.23638685047626495,
-0.28477543592453003,
0.26107197999954224,
-0.018191304057836533,
0.24122875928878784,
-0.47753170132637024,
-0.23285099864006042,
-0.19318026304244995,
-0.05875138193368912,
0.3417356312274933,
-0.18262486159801483,
-0.03498777374625206,
0.2606571912765503,
0.011145781725645065,
-0.20157265663146973,
-0.3291391134262085,
0.1431427001953125,
-0.019940271973609924,
-0.06743159145116806,
-0.20654529333114624,
-0.48830491304397583,
-0.2288656234741211,
-0.24734722077846527,
0.0017073452472686768,
-0.1743762344121933,
-0.19001883268356323,
-0.08734782785177231,
-0.011689987033605576,
-0.17960096895694733,
0.25181522965431213,
-0.0717342272400856,
-0.11511345207691193,
-0.09217385202646255,
-0.13321451842784882,
-0.0721583217382431,
0.20460885763168335,
-0.14597657322883606,
-0.6026551127433777,
-0.19787165522575378,
0.075465127825737,
-0.06562499701976776,
0.3203587830066681,
-0.3061535656452179,
-0.08975491672754288,
0.46545660495758057,
-0.10125142335891724,
0.19441239535808563,
0.032003216445446014,
-0.16191796958446503,
0.018495313823223114,
0.22555460035800934,
0.20036500692367554,
0.004318747669458389,
-0.5497559905052185,
0.24046427011489868,
0.41661661863327026,
-0.3198278546333313,
0.2982564866542816,
-0.18352510035037994,
-0.022508341819047928,
-0.15603984892368317,
0.11129246652126312,
-0.46504366397857666,
0.3102947175502777,
-0.3296643793582916,
0.21928785741329193,
-0.20155945420265198,
-0.17846634984016418,
-0.13496337831020355,
-0.01688983291387558,
-0.5305204391479492,
0.19676482677459717,
0.5861624479293823,
-0.37596285343170166,
-0.05526997148990631,
-0.264212042093277,
0.32979410886764526,
-0.08748994767665863,
-0.01804490014910698,
-0.9412338733673096,
-0.3022172451019287,
0.13393279910087585,
-0.022463491186499596,
-0.0213230662047863,
-0.12319783866405487,
-0.2637908458709717,
-0.012106716632843018,
0.09510432183742523,
-0.40940093994140625,
0.40866366028785706,
-0.10452144593000412,
0.5177892446517944,
-0.24832293391227722
] |
https://github.com/huggingface/datasets/issues/5715 | Hi!
You can use [`.set_format("np")`](https://huggingface.co/docs/datasets/process#format) to get NumPy arrays (or Pytorch tensors with `.set_format("torch")`) in `__getitem__`.
Also, have you been able to reproduce the linked PyTorch issue with a HF dataset?
| Return Numpy Array (fixed length) Mode, in __get_item__, Instead of List | ### Feature request
There are old known issues, but they can be easily forgettable problems in multiprocessing with pytorch-dataloader:
Too high usage of RAM or shared-memory in pytorch when we set num workers > 1 and returning type of dataset or dataloader is "List" or "Dict".
https://github.com/pytorch/pytorch/issues/13246
With huggingface datasets, unfortunately, the default return type is the list, so the problem is raised too often if we do not set anything for the issue.
However, this issue can be released when the returning output is fixed in length.
Therefore, I request the mode, returning outputs with fixed length (e.g. numpy array) rather than list.
The design would be good when we load datasets as
```python
load_dataset(..., with_return_as_fixed_tensor=True)
```
### Motivation
The general solution for this issue is already in the comments: https://github.com/pytorch/pytorch/issues/13246#issuecomment-905703662
: Numpy or Pandas seems not to have problems, while both have the string type.
(I'm not sure that the sequence of huggingface datasets can solve this problem as well)
### Your contribution
I'll read it ! thanks | 31 | Return Numpy Array (fixed length) Mode, in __get_item__, Instead of List
### Feature request
There are old known issues, but they can be easily forgettable problems in multiprocessing with pytorch-dataloader:
Too high usage of RAM or shared-memory in pytorch when we set num workers > 1 and returning type of dataset or dataloader is "List" or "Dict".
https://github.com/pytorch/pytorch/issues/13246
With huggingface datasets, unfortunately, the default return type is the list, so the problem is raised too often if we do not set anything for the issue.
However, this issue can be released when the returning output is fixed in length.
Therefore, I request the mode, returning outputs with fixed length (e.g. numpy array) rather than list.
The design would be good when we load datasets as
```python
load_dataset(..., with_return_as_fixed_tensor=True)
```
### Motivation
The general solution for this issue is already in the comments: https://github.com/pytorch/pytorch/issues/13246#issuecomment-905703662
: Numpy or Pandas seems not to have problems, while both have the string type.
(I'm not sure that the sequence of huggingface datasets can solve this problem as well)
### Your contribution
I'll read it ! thanks
Hi!
You can use [`.set_format("np")`](https://huggingface.co/docs/datasets/process#format) to get NumPy arrays (or Pytorch tensors with `.set_format("torch")`) in `__getitem__`.
Also, have you been able to reproduce the linked PyTorch issue with a HF dataset?
| [
-0.048069775104522705,
-0.5935409665107727,
-0.04750343784689903,
0.0750245749950409,
0.1531980186700821,
-0.2710416913032532,
0.7023616433143616,
0.27597472071647644,
0.42940554022789,
0.23772947490215302,
-0.1788683384656906,
0.4016181528568268,
-0.44294512271881104,
0.3425402045249939,
0.022937994450330734,
-0.17482975125312805,
-0.14005246758460999,
0.20547617971897125,
-0.3952767848968506,
0.010661013424396515,
-0.20876383781433105,
0.127727672457695,
0.05493834614753723,
-0.1583024263381958,
-0.23549190163612366,
-0.12170596420764923,
0.2131229192018509,
0.14216536283493042,
0.0788823738694191,
-0.29162925481796265,
0.6803642511367798,
-0.10929520428180695,
0.08459581434726715,
0.035134073346853256,
-0.00012333900667726994,
0.040623247623443604,
0.12789244949817657,
-0.051280371844768524,
-0.03082667663693428,
-0.1345004439353943,
0.2892964780330658,
-0.46824580430984497,
0.4483264088630676,
-0.2784350514411926,
0.14188611507415771,
-0.181570366024971,
-0.06764449179172516,
-0.3944888114929199,
0.1290913224220276,
0.29897111654281616,
0.08462764322757721,
0.4680149555206299,
-0.1951242834329605,
0.13144871592521667,
-0.3141378164291382,
0.25367921590805054,
-0.0759458839893341,
0.17615345120429993,
0.7364752292633057,
0.07921969145536423,
-0.17144984006881714,
0.3002253770828247,
-0.13863669335842133,
0.4006545841693878,
0.24312135577201843,
0.11070206016302109,
-0.12951026856899261,
-0.1643160581588745,
-0.2475081831216812,
0.4002392292022705,
0.05492135137319565,
0.06329711526632309,
0.028144940733909607,
-0.6144430041313171,
0.1794288456439972,
-0.1622166633605957,
0.009143024682998657,
0.04421986639499664,
-0.3138411045074463,
-0.01615782454609871,
-0.3861815929412842,
0.06900355219841003,
-0.3333667516708374,
0.055243026465177536,
-0.13472560048103333,
-0.019369002431631088,
0.02073793113231659,
0.06953412294387817,
0.30111944675445557,
-0.019897468388080597,
0.08847406506538391,
0.01657593995332718,
0.37100276350975037,
0.175641268491745,
-0.2997657060623169,
-0.07675079256296158,
0.06669995188713074,
-0.4050710201263428,
0.40136653184890747,
-0.17472270131111145,
-0.05241962894797325,
0.0867965966463089,
-0.3999228775501251,
0.008952515199780464,
0.28275173902511597,
0.28372257947921753,
0.007308585569262505,
-0.27566370368003845,
0.08388347178697586,
0.10899896919727325,
0.1514730602502823,
0.09823168814182281,
0.21576324105262756,
0.03159395605325699,
0.45848512649536133,
0.15951964259147644,
0.04908229410648346,
-0.012351550161838531,
-0.18312621116638184,
-0.012108314782381058,
-0.14487111568450928,
0.05529849976301193,
0.02223838120698929,
0.16266396641731262,
-0.037263546139001846,
0.7332189679145813,
0.1197938323020935,
0.04877231642603874,
-0.14797624945640564,
-0.12592701613903046,
-0.0031540244817733765,
-0.2557433843612671,
-0.1661515086889267,
-0.0914059579372406,
0.4078534245491028,
-0.11276783794164658,
-0.020815588533878326,
0.08497157692909241,
0.6439030170440674,
-0.1330184042453766,
0.18522906303405762,
-0.16046671569347382,
0.26041579246520996,
0.04068244248628616,
-0.16302542388439178,
0.16636604070663452,
0.27022212743759155,
0.12262134999036789,
-0.2827133536338806,
0.15845154225826263,
-0.38110965490341187,
-0.45619872212409973,
-0.015038029290735722,
-0.021482598036527634,
0.12536722421646118,
0.21597231924533844,
-0.014028064906597137,
-0.017164010554552078,
0.08208244293928146,
0.3348853290081024,
0.20189698040485382,
-0.635977029800415,
-0.4157507121562958,
-0.19579893350601196,
-0.09704795479774475,
-0.03206111490726471,
0.02568880468606949,
-0.25554001331329346,
-0.05376658961176872,
-0.19853311777114868,
-0.027255859225988388,
0.35839515924453735,
0.01625298336148262,
-0.07571294903755188,
-0.2843872010707855,
-0.02435072511434555,
0.04224007949233055,
-0.10231611877679825,
-0.3240742087364197,
0.13341361284255981,
0.09103284776210785,
0.4408888518810272,
0.22041593492031097,
0.4191979169845581,
0.1680845469236374,
0.2201562225818634,
0.45373672246932983,
0.4748559892177582,
-0.07044856250286102,
0.14007125794887543,
-0.09980178624391556,
-0.46285519003868103,
0.4191797971725464,
0.13402223587036133,
0.2239665389060974,
-0.031939975917339325,
-0.20238535106182098,
-0.17766375839710236,
0.4602517783641815,
-0.11140233278274536,
-0.1463548243045807,
0.06299132108688354,
0.06620689481496811,
0.036156270653009415,
-0.01235988363623619,
-0.42636817693710327,
-0.6224488019943237,
0.24125628173351288,
-0.3970487713813782,
0.1460219770669937,
-0.0448886975646019,
-0.1275772899389267,
-0.0861588716506958,
0.06535165011882782,
-0.14485356211662292,
-0.004952440038323402,
-0.054143548011779785,
-0.2705097198486328,
-0.022423893213272095,
0.07984954118728638,
-0.02226068079471588,
0.6312614679336548,
-0.09491308778524399,
0.04757656529545784,
-0.4101181924343109,
0.2936665713787079,
0.27160942554473877,
-0.16299399733543396,
-0.22479970753192902,
0.26008737087249756,
-0.04992644861340523,
-0.013863179832696915,
0.042108599096536636,
0.09606914222240448,
0.0965849980711937,
-0.05005522072315216,
-0.48524558544158936,
0.2508712410926819,
0.28846558928489685,
-0.043031781911849976,
0.022108113393187523,
0.3437080681324005,
-0.0692821592092514,
-0.25878530740737915,
0.03835693374276161,
0.5719598531723022,
-0.25847506523132324,
0.4929729402065277,
-0.12695322930812836,
0.10234770178794861,
-0.09281222522258759,
0.2014332115650177,
-0.273249089717865,
-0.045828670263290405,
0.2873817980289459,
-0.14408858120441437,
-0.16013047099113464,
0.12125471979379654,
-0.5743083357810974,
-0.046908602118492126,
0.6503000259399414,
0.18337196111679077,
0.3095892071723938,
0.2494003176689148,
0.01587473228573799,
-0.1564534455537796,
0.11275787651538849,
-0.3645741045475006,
0.47244131565093994,
0.02979378029704094,
-0.2343837320804596,
0.020577916875481606,
0.13970839977264404,
0.0005722679197788239,
0.25837790966033936,
-0.006820399314165115,
0.61745685338974,
0.1413305252790451,
0.13456940650939941,
-0.4464455544948578,
0.0117906853556633,
-0.07764022052288055,
-0.3177262842655182,
-0.14347435534000397,
-0.20951692759990692,
-0.08076047897338867,
-0.2901231348514557,
-0.05916694924235344,
-0.4458819627761841,
0.11284174770116806,
-0.2664664685726166,
-0.032818615436553955,
-0.2490522265434265,
0.22824831306934357,
0.10097356140613556,
0.2592310905456543,
0.06882520020008087,
0.10917960107326508,
0.11261314153671265,
-0.1222795620560646,
-0.22981122136116028,
0.2168687880039215,
-0.0892631933093071,
-0.06992854177951813,
-0.17251726984977722,
-0.39601266384124756,
0.24427232146263123,
0.3081570565700531,
-0.2312249094247818,
-0.17649796605110168,
0.019994795322418213,
0.18943464756011963,
0.18859468400478363,
0.06722503900527954,
0.5252459049224854,
0.42686572670936584,
0.14797788858413696,
0.012063287198543549,
0.28022998571395874,
-0.20131166279315948,
0.03663737326860428,
0.2676282525062561,
-0.06394780427217484,
0.6586970090866089,
-0.11979155242443085,
-0.2499752789735794,
-0.49299049377441406,
-0.13707172870635986,
0.4088048040866852,
-0.12199342250823975,
0.3289787173271179,
0.12465116381645203,
0.2667325437068939,
0.17379803955554962,
-0.010135907679796219,
0.15504950284957886,
-0.09645342826843262,
-0.027165748178958893,
0.26222294569015503,
0.08167915791273117,
-0.12635251879692078,
-0.5183377265930176,
-0.07077353447675705,
-0.05989249423146248,
0.11931966245174408,
-0.2402181774377823,
-0.5645228028297424,
-0.11318346112966537,
0.24753570556640625,
-0.13158880174160004,
0.07934651523828506,
0.20316775143146515,
-0.008317369967699051,
-0.0013983696699142456,
0.040269896388053894,
0.09505070000886917,
0.23628370463848114,
-0.0929999053478241,
-0.10533584654331207,
0.3785412907600403,
-0.01195124164223671,
0.34897303581237793,
0.4330456852912903,
0.30955445766448975,
-0.09736543893814087,
-0.10045638680458069,
0.11263412237167358,
-0.0732901394367218,
-0.1504468023777008,
-0.5301377177238464,
-0.14809797704219818,
-0.48181840777397156,
-0.033998262137174606,
0.08542922139167786,
-0.1711379587650299,
-0.10563690960407257,
0.03859400749206543,
0.09130209684371948,
0.2938660979270935,
-0.23802383244037628,
0.27556589245796204,
0.30267471075057983,
0.23317214846611023,
-0.17113204300403595,
0.11245529353618622,
-0.1603122055530548,
-0.041257936507463455,
0.0014427267014980316,
0.03945229575037956,
-0.05420341715216637,
0.10576281696557999,
-0.27759504318237305,
-0.3469582796096802,
-0.4462580680847168,
0.18900595605373383,
0.38395723700523376,
0.303252249956131,
0.2438611090183258,
-0.01043497771024704,
0.1970430463552475,
0.16719268262386322,
0.8853390216827393,
0.47739869356155396,
-0.17553265392780304,
-0.03317397087812424,
-0.24001215398311615,
-0.14056700468063354,
-0.004119761288166046,
-0.19573497772216797,
0.016026511788368225,
0.4439008831977844,
0.4197137653827667,
-0.2860340476036072,
-0.25181666016578674,
-0.12331366539001465,
-0.05229047313332558,
-0.2793388366699219,
-0.019490718841552734,
-0.26612645387649536,
-0.1004803255200386,
-0.09450346231460571,
0.21441271901130676,
0.05470973998308182,
0.3513084650039673,
-0.06725141406059265,
-0.28983086347579956,
-0.10792429745197296,
-0.10564525425434113,
0.12394765019416809,
-0.3671354651451111,
0.08246465027332306,
-0.21356087923049927,
0.019725017249584198,
0.10730074346065521,
0.14852680265903473,
0.08575286716222763,
0.0636918917298317,
-0.5786124467849731,
0.13558828830718994,
-0.005592262372374535,
0.004628773778676987,
0.3925730884075165,
0.3892873227596283,
-0.1516381949186325,
0.20240190625190735,
0.42468389868736267,
0.3705345392227173,
-0.47976261377334595,
-0.15990746021270752,
0.3070884346961975,
0.1325831413269043,
-0.14514708518981934,
-0.5524290204048157,
0.25724345445632935,
-0.057361576706171036,
0.1305398941040039,
0.35243651270866394,
-0.06389611959457397,
-0.13339990377426147,
-0.01114361360669136,
0.29470908641815186,
0.92178875207901,
-0.3075670003890991,
0.41402482986450195,
0.2296144962310791,
-0.22968047857284546,
0.5520875453948975,
0.03746598958969116,
0.12946563959121704,
-0.31712496280670166,
-0.11884718388319016,
-0.06850680708885193,
-0.3385547995567322,
0.007597773335874081,
-0.011515215039253235,
-0.08393853902816772,
0.07504801452159882,
0.31904786825180054,
-0.18232159316539764,
-0.1044975072145462,
0.34049972891807556,
-0.21729975938796997,
-0.5069298148155212,
-0.2327612191438675,
-0.04290793836116791,
-0.3854786157608032,
0.00001062825322151184,
-0.1174125224351883,
-0.06405651569366455,
0.2219422459602356,
-0.035334259271621704,
-0.27040067315101624,
-0.20627650618553162,
-0.40694659948349,
0.29356664419174194,
0.44563934206962585,
-0.5467466115951538,
0.17385269701480865,
0.07737593352794647,
-0.3216465711593628,
-0.10987086594104767,
-0.13973850011825562,
-0.39665913581848145,
0.11038404703140259,
0.23404455184936523,
0.25380057096481323,
-0.06770709902048111,
0.48072919249534607,
0.18584343791007996,
-0.09867069125175476,
-0.1770308017730713,
-0.07513383775949478,
-0.10433050990104675,
0.017626449465751648,
0.10557915270328522,
0.2506844997406006,
-0.41474559903144836,
-0.39443010091781616,
0.06096166372299194,
0.22945405542850494,
-0.1090799868106842,
-0.03551386296749115,
0.31823039054870605,
0.044843435287475586,
0.4092404544353485,
0.11089359223842621,
-0.2254255712032318,
-0.05970151349902153,
0.21428194642066956,
0.6228823065757751,
-0.2683522403240204,
0.3639145493507385,
0.5805025696754456,
-0.24140207469463348,
-0.042099758982658386,
0.2735178470611572,
0.22595852613449097,
-0.38514161109924316,
0.4932922124862671,
0.27243882417678833,
-0.09998983889818192,
-0.4870309829711914,
-0.07996496558189392,
-0.13954877853393555,
0.29133957624435425,
-0.3194984197616577,
-0.1320790946483612,
-0.47672778367996216,
0.19924509525299072,
0.01426953449845314,
0.36440548300743103,
0.1386224925518036,
-0.0884094089269638,
-0.07740668207406998,
-0.2211357206106186,
-0.17963536083698273,
-0.22106868028640747,
-0.0284922793507576,
-0.15343740582466125,
-0.0677323117852211,
-0.250986248254776,
0.16136527061462402,
-0.008706208318471909,
-0.07362499833106995,
0.1684277504682541,
-0.22507049143314362,
-0.12480807304382324,
-0.2533871829509735,
0.14186735451221466,
-0.07813720405101776,
-0.19598251581192017,
0.21214473247528076,
-0.43878185749053955,
0.0015267487615346909,
-0.2938840985298157,
0.17592434585094452,
0.3657023310661316,
0.10830714553594589,
0.32289570569992065,
0.055688370019197464,
-0.022433601319789886,
-0.12790952622890472,
0.16232870519161224,
-0.15253624320030212,
-0.02954036369919777,
-0.02084660530090332,
0.336027055978775,
-0.05345549434423447,
0.11374790966510773,
-0.1098904013633728,
0.20940084755420685,
0.28140711784362793,
0.008262138813734055,
0.28522470593452454,
-0.054919932037591934,
-0.2720738649368286,
-0.2301211953163147,
0.3857294023036957,
-0.16553685069084167,
-0.17123521864414215,
0.03175120800733566,
-0.12525102496147156,
0.118104487657547,
-0.005494080483913422,
-0.044983454048633575,
0.05048828572034836,
-0.04162980616092682,
-0.01790044456720352,
0.4775323271751404,
-0.07900860905647278,
0.2640623152256012,
0.2840135991573334,
-0.09764160215854645,
0.14224950969219208,
-0.15285012125968933,
0.040406208485364914,
0.17461442947387695,
0.24690000712871552,
-0.17468591034412384,
0.28484660387039185,
0.1771240085363388,
0.18456241488456726,
0.30045780539512634,
0.14834171533584595,
0.21949808299541473,
0.08809785544872284,
0.10579946637153625,
0.19134621322155,
-0.04962204024195671,
-0.44826754927635193,
0.22185389697551727,
-0.4164055585861206,
0.376359224319458,
-0.014397040009498596,
0.6445738673210144,
-0.37477660179138184,
-0.19381031394004822,
0.030896402895450592,
-0.007324337959289551,
-0.17995817959308624,
0.13049151003360748,
0.14921532571315765,
0.009099975228309631,
-0.29691725969314575,
-0.03129943087697029,
-0.15441560745239258,
-0.0830925703048706,
0.31950241327285767,
0.23402729630470276,
0.16875100135803223,
-0.17014579474925995,
-0.10848195105791092,
0.059674620628356934,
0.1743580847978592,
-0.032674551010131836,
-0.1548866331577301,
0.33211931586265564,
0.2582646608352661,
-0.03659491613507271,
0.2528815269470215,
0.13411784172058105,
0.3108273148536682,
-0.08885195851325989,
0.004245251417160034,
-0.04421091824769974,
0.04726468771696091,
-0.20628958940505981,
-0.1330355703830719,
0.09446354955434799,
0.16124209761619568,
0.03542814776301384,
-0.0036507565528154373,
-0.03336526080965996,
-0.048114992678165436,
-0.07483072578907013,
-0.2880970239639282,
-0.4425298869609833,
0.5341511964797974,
0.014600487425923347,
-0.40165114402770996,
-0.15062323212623596,
0.058078110218048096,
-0.2208607792854309,
0.12371556460857391,
0.37855780124664307,
0.08228923380374908,
0.15351980924606323,
0.030141141265630722,
0.04970742017030716,
-0.19261601567268372,
0.22953104972839355,
0.027950963005423546,
0.5037755966186523,
-0.061392419040203094,
0.08462139964103699,
-0.19111144542694092,
-0.011827357113361359,
0.058708012104034424,
0.10151320695877075,
0.14192453026771545,
-0.01158703863620758,
0.10787271708250046,
0.05786630138754845,
0.2869236469268799,
-0.14110317826271057,
0.24238252639770508,
0.23997178673744202,
-0.0002955496311187744,
-0.20970705151557922,
0.07062824070453644,
-0.03502664715051651,
0.032139815390110016,
-0.20575681328773499,
0.21794575452804565,
0.005806155502796173,
-0.0851052850484848,
-0.38032472133636475,
0.05486370623111725,
-0.105291947722435,
0.262763649225235,
0.27435433864593506,
0.3379288613796234,
-0.13362979888916016,
0.11968537420034409,
-0.29342806339263916,
0.27907082438468933,
0.12904685735702515,
0.01726962998509407,
0.013336840085685253,
-0.17462976276874542,
0.5179481506347656,
-0.2592051327228546,
-0.2360285073518753,
-0.2581942677497864,
0.38793277740478516,
0.012930922210216522,
-0.30092179775238037,
-0.36830228567123413,
0.09698084741830826,
-0.23088917136192322,
-0.04386257007718086,
-0.05747082456946373,
0.41526663303375244,
0.17521145939826965,
0.06288336962461472,
-0.3170086145401001,
-0.19379660487174988,
0.24434539675712585,
-0.16466310620307922,
-0.36116737127304077,
-0.3554982542991638,
0.29131150245666504,
-0.11617927253246307,
0.06043606996536255,
-0.7151212692260742,
-0.42931073904037476,
0.20178528130054474,
-0.0068348478525877,
-0.10860625654459,
-0.049967192113399506,
-0.059786826372146606,
-0.15090978145599365,
-0.3450998365879059,
0.15475040674209595,
0.12031325697898865,
-0.016245555132627487,
0.07285457849502563,
-0.2815769910812378
] |
https://github.com/huggingface/datasets/issues/5713 | Hi Julien ! This sounds related to https://github.com/huggingface/datasets/issues/5695 - TL;DR: you need to have shards smaller than 2GB to avoid this issue
The number of rows per shard is computed using an estimated size of the full dataset, which can sometimes lead to shards bigger than `max_shard_size`. The estimation is currently done using the first samples of the dataset (which can surely be improved). We should probably open an issue to fix this once and for all.
Anyway for your specific dataset I'd suggest you to pass `num_shards` instead of `max_shard_size` for now, and make sure to have enough shards to end up with shards smaller than 2GB | ArrowNotImplementedError when loading dataset from the hub | ### Describe the bug
Hello,
I have created a dataset by using the image loader. Once the dataset is created I try to download it and I get the error:
```
Traceback (most recent call last):
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 1860, in _prepare_split_single
for _, table in generator:
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 69, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1323, in iter_batches
File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 986, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 1748, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 1893, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Steps to reproduce the bug
Create the dataset and push it to the hub:
```python
from datasets import load_dataset
dataset = load_dataset("imagefolder", data_dir="/path/to/dataset")
dataset.push_to_hub("org/dataset-name", private=True, max_shard_size="1GB")
```
Then use it:
```python
from datasets import load_dataset
dataset = load_dataset("org/dataset-name")
```
### Expected behavior
To properly download and use the pushed dataset.
Something else to note is that I specified to have shards of 1GB max, but at the end, for the train set, it is an almost 7GB single file that is pushed.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
- Python version: 3.10.10
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 2.0.0 | 108 | ArrowNotImplementedError when loading dataset from the hub
### Describe the bug
Hello,
I have created a dataset by using the image loader. Once the dataset is created I try to download it and I get the error:
```
Traceback (most recent call last):
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 1860, in _prepare_split_single
for _, table in generator:
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 69, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1323, in iter_batches
File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 986, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 1748, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 1893, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Steps to reproduce the bug
Create the dataset and push it to the hub:
```python
from datasets import load_dataset
dataset = load_dataset("imagefolder", data_dir="/path/to/dataset")
dataset.push_to_hub("org/dataset-name", private=True, max_shard_size="1GB")
```
Then use it:
```python
from datasets import load_dataset
dataset = load_dataset("org/dataset-name")
```
### Expected behavior
To properly download and use the pushed dataset.
Something else to note is that I specified to have shards of 1GB max, but at the end, for the train set, it is an almost 7GB single file that is pushed.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
- Python version: 3.10.10
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 2.0.0
Hi Julien ! This sounds related to https://github.com/huggingface/datasets/issues/5695 - TL;DR: you need to have shards smaller than 2GB to avoid this issue
The number of rows per shard is computed using an estimated size of the full dataset, which can sometimes lead to shards bigger than `max_shard_size`. The estimation is currently done using the first samples of the dataset (which can surely be improved). We should probably open an issue to fix this once and for all.
Anyway for your specific dataset I'd suggest you to pass `num_shards` instead of `max_shard_size` for now, and make sure to have enough shards to end up with shards smaller than 2GB | [
-0.4514244794845581,
-0.029354557394981384,
-0.004574500024318695,
0.5526852011680603,
0.22211842238903046,
-0.007330708205699921,
0.42876574397087097,
0.3120574951171875,
-0.25685614347457886,
0.31078779697418213,
-0.14230012893676758,
0.5280890464782715,
-0.031971681863069534,
-0.15134984254837036,
-0.16474011540412903,
-0.10938819497823715,
0.08644945919513702,
0.4080408811569214,
-0.08101628720760345,
0.10763806104660034,
-0.14454877376556396,
0.23239341378211975,
-0.31517988443374634,
0.18472909927368164,
-0.15839001536369324,
0.004635000601410866,
-0.05906819552183151,
0.3311823904514313,
-0.23619207739830017,
-0.4516410827636719,
0.22049309313297272,
-0.2684556245803833,
-0.05143056437373161,
0.2922321856021881,
-0.00012910136138089,
0.2382228672504425,
0.44334128499031067,
-0.029248911887407303,
-0.4454147517681122,
-0.15108038485050201,
-0.05314008891582489,
-0.3546397387981415,
0.15682663023471832,
-0.18004833161830902,
0.18470416963100433,
-0.32087013125419617,
0.030423277989029884,
0.18431104719638824,
0.23952177166938782,
0.012844860553741455,
0.07467648386955261,
0.27769607305526733,
0.16074882447719574,
-0.00983814150094986,
0.33125782012939453,
0.25110924243927,
-0.21391001343727112,
0.37303975224494934,
0.14227408170700073,
0.1813393235206604,
-0.4287482500076294,
0.12655392289161682,
-0.01265363022685051,
0.31730636954307556,
0.07403586804866791,
0.17058512568473816,
0.020383307710289955,
-0.15766778588294983,
-0.10542161017656326,
0.16652920842170715,
0.29981347918510437,
-0.1597001701593399,
-0.36357611417770386,
-0.3982807397842407,
0.1084800735116005,
-0.19899332523345947,
0.09834618866443634,
0.35945039987564087,
-0.28839290142059326,
0.06245829537510872,
-0.12620913982391357,
-0.1657392680644989,
-0.49634361267089844,
0.018542949110269547,
-0.13445144891738892,
0.2760776877403259,
-0.06065474450588226,
0.19278211891651154,
-0.07097335159778595,
-0.15349556505680084,
0.5615456700325012,
-0.19398799538612366,
0.045510001480579376,
0.010990403592586517,
-0.07831847667694092,
0.11669493466615677,
-0.3613002896308899,
0.12416280806064606,
0.1322927623987198,
0.16013005375862122,
0.181733638048172,
0.0966586321592331,
0.1409699022769928,
0.13374529778957367,
0.13343971967697144,
0.01991622895002365,
-0.07436779141426086,
0.11101771146059036,
0.11503839492797852,
0.39619383215904236,
0.16035890579223633,
0.0872458666563034,
-0.2488744705915451,
-0.10470113158226013,
-0.03852125257253647,
0.09774232655763626,
0.3657642900943756,
-0.02578818053007126,
-0.4711953401565552,
-0.19402220845222473,
-0.17012646794319153,
-0.0054442621767520905,
0.09920023381710052,
0.20353612303733826,
0.020648039877414703,
0.31474751234054565,
0.05041058361530304,
0.5081401467323303,
-0.20034027099609375,
-0.1837228536605835,
-0.10895844548940659,
0.07906340807676315,
-0.33980661630630493,
0.012016285210847855,
0.09443577378988266,
-0.06817734241485596,
0.061339542269706726,
0.05476607382297516,
0.18699681758880615,
-0.03874858096241951,
-0.14499881863594055,
-0.18103933334350586,
0.13770067691802979,
0.1267983317375183,
0.08282315731048584,
-0.009211879223585129,
0.12962260842323303,
0.030157431960105896,
-0.041384369134902954,
0.4363745152950287,
-0.48072031140327454,
-0.2076369673013687,
-0.3671225309371948,
0.05982500687241554,
-0.3921853303909302,
0.022342894226312637,
-0.2582480311393738,
-0.03929153084754944,
0.31132107973098755,
-0.10425533354282379,
0.03673391044139862,
-0.16653838753700256,
-0.0899290144443512,
-0.4102805554866791,
0.12829285860061646,
0.38798511028289795,
-0.6048063635826111,
-0.01432860642671585,
-0.2684784233570099,
-0.2968515455722809,
0.3281433582305908,
0.02330082654953003,
-0.23328334093093872,
0.302161306142807,
-0.4890856146812439,
0.4899666905403137,
0.26248079538345337,
-0.23667120933532715,
-0.459585577249527,
0.15240627527236938,
-0.16063357889652252,
0.14243672788143158,
0.09637995064258575,
-0.03935068100690842,
0.18209919333457947,
-0.026112055405974388,
-0.18785594403743744,
0.2775324881076813,
-0.008541173301637173,
0.16374973952770233,
-0.1873658448457718,
-0.2314033955335617,
0.040663402527570724,
0.26872146129608154,
0.17933259904384613,
0.11148719489574432,
0.10750819742679596,
0.03359483927488327,
0.22236426174640656,
-0.2870035469532013,
0.38674959540367126,
0.055106271058321,
0.006302942521870136,
-0.2810622751712799,
0.056194134056568146,
-0.0465824231505394,
-0.5105887055397034,
0.2273901104927063,
-0.4438641369342804,
0.025498555973172188,
-0.6396402716636658,
0.18039189279079437,
-0.1813793182373047,
0.2566258907318115,
-0.3714703917503357,
0.2004767507314682,
0.042584821581840515,
0.029349099844694138,
-0.03795267269015312,
-0.25652146339416504,
-0.16159819066524506,
0.2948419153690338,
-0.017088420689105988,
0.31751370429992676,
-0.43237799406051636,
0.7674691081047058,
0.19337081909179688,
-0.43545302748680115,
-0.06030629575252533,
0.13703355193138123,
0.03803008049726486,
-0.15238933265209198,
-0.08477869629859924,
0.4347206950187683,
0.07638721168041229,
0.4207693338394165,
-0.2291560173034668,
-0.5954763293266296,
0.29497507214546204,
-0.45321500301361084,
0.344145268201828,
-0.18716269731521606,
0.1373347043991089,
0.0067487433552742004,
0.04617629200220108,
0.5470939874649048,
0.029994972050189972,
0.2934523820877075,
0.001981392502784729,
0.011702381074428558,
0.006609298288822174,
0.043876223266124725,
0.07794506102800369,
-0.4292539358139038,
-0.052515771239995956,
0.2878623902797699,
0.1697947382926941,
-0.1813843846321106,
-0.04178155958652496,
0.20043544471263885,
0.2884654402732849,
0.05243576318025589,
-0.08619444072246552,
0.19512557983398438,
-0.341410368680954,
-0.055534228682518005,
0.2936766445636749,
0.006961546838283539,
0.5986095666885376,
0.16774165630340576,
0.15975049138069153,
0.05279773473739624,
0.09625940024852753,
-0.035314589738845825,
0.22417548298835754,
0.19921211898326874,
0.5879306793212891,
0.37203145027160645,
0.11975543200969696,
-0.2145911455154419,
-0.34448397159576416,
-0.13191834092140198,
0.08440086990594864,
0.1962255835533142,
-0.48644426465034485,
-0.1563677042722702,
-0.36402666568756104,
0.007869020104408264,
-0.10031794011592865,
-0.2427414059638977,
-0.00762044545263052,
-0.3622554838657379,
0.0034920182079076767,
0.39879339933395386,
-0.07605039328336716,
0.09183211624622345,
-0.14444555342197418,
-0.004297226667404175,
0.04361385107040405,
-0.01086193136870861,
-0.3720358610153198,
0.010600846260786057,
-0.10934905707836151,
-0.0005324520170688629,
0.24014408886432648,
0.13877272605895996,
0.13593469560146332,
-0.019625768065452576,
0.3186691403388977,
-0.2957998216152191,
-0.04706135392189026,
0.2123977392911911,
-0.060526248067617416,
0.0975508987903595,
0.30105823278427124,
0.2306181937456131,
-0.07419343292713165,
-0.2546836733818054,
0.33141687512397766,
0.08086473494768143,
-0.48659613728523254,
0.40514466166496277,
-0.18384066224098206,
0.12943461537361145,
0.04429151117801666,
0.018680674955248833,
-0.3596891760826111,
-0.29282212257385254,
-0.07194186747074127,
0.1915939599275589,
0.2516331076622009,
-0.12734732031822205,
0.22278177738189697,
0.1731579601764679,
-0.029429463669657707,
-0.35614511370658875,
0.11312931030988693,
0.0008146464824676514,
0.3708049952983856,
-0.20886874198913574,
-0.11235898733139038,
0.003363184630870819,
-0.17966704070568085,
0.1804928034543991,
0.2677689492702484,
-0.30966052412986755,
-0.021212521940469742,
-0.029801689088344574,
0.1270558387041092,
-0.0749736800789833,
-0.09656904637813568,
0.26548513770103455,
0.10144267231225967,
-0.004443038254976273,
-0.15275715291500092,
0.12496486306190491,
0.06598681211471558,
-0.062488555908203125,
0.1354835033416748,
-0.03765104338526726,
0.2440585196018219,
0.17420709133148193,
0.6621370911598206,
0.3127008080482483,
-0.02150760404765606,
0.48617199063301086,
-0.08021052181720734,
0.06845256686210632,
-0.06104180961847305,
-0.056940704584121704,
-0.07991723716259003,
-0.03284980356693268,
0.09160362184047699,
0.15653306245803833,
-0.08897711336612701,
-0.28588515520095825,
-0.09600969403982162,
-0.016006968915462494,
-0.40092793107032776,
-0.16636916995048523,
-0.04541672766208649,
-0.2697669565677643,
-0.09841501712799072,
-0.20331451296806335,
-0.01613040268421173,
-0.11822009086608887,
-0.27431413531303406,
-0.029986456036567688,
-0.13683883845806122,
0.24661411345005035,
-0.1132296621799469,
-0.09108182042837143,
-0.14503547549247742,
-0.1526118665933609,
0.3268664479255676,
0.2120385468006134,
0.15320320427417755,
0.20608994364738464,
-0.33466118574142456,
0.24214276671409607,
-0.17393718659877777,
0.6157167553901672,
-0.2204013168811798,
0.052105266600847244,
-0.10077570378780365,
0.2603786587715149,
-0.6412757039070129,
-0.23325058817863464,
-0.277883917093277,
0.3205987513065338,
-0.1782425045967102,
0.604255199432373,
-0.5167261362075806,
-0.007095295935869217,
0.32644203305244446,
0.14266358315944672,
-0.08416864275932312,
-0.13564999401569366,
-0.30846643447875977,
-0.1358397752046585,
-0.2885156571865082,
0.048572879284620285,
-0.20514839887619019,
0.35523074865341187,
0.04158574342727661,
-0.24928653240203857,
-0.15772344172000885,
-0.08954191952943802,
-0.06852301955223083,
0.11818774044513702,
0.3948124051094055,
-0.32208138704299927,
0.11112421751022339,
-0.07380412518978119,
0.16558313369750977,
0.5616494417190552,
0.7012830376625061,
0.06537444144487381,
-0.3781283497810364,
0.21779415011405945,
-0.03608367219567299,
0.21439099311828613,
0.3071902096271515,
-0.1056210994720459,
0.0070100948214530945,
0.07661505043506622,
0.1802954077720642,
-0.00324254110455513,
-0.33554476499557495,
0.03517528623342514,
-0.31101828813552856,
-0.32138437032699585,
0.30380135774612427,
0.5052872896194458,
-0.03506317734718323,
0.08228152990341187,
0.22858725488185883,
0.24625512957572937,
-0.0700753778219223,
0.2865069508552551,
0.3256577253341675,
0.9133561849594116,
0.021821152418851852,
0.023947643116116524,
0.7249040603637695,
-0.2923699915409088,
0.3612353801727295,
0.10252808034420013,
0.1588238775730133,
-0.5373272895812988,
-0.028997154906392097,
-0.15586479008197784,
-0.3671582341194153,
0.22999951243400574,
0.257674902677536,
-0.27159327268600464,
-0.020602893084287643,
-0.27168190479278564,
0.36216792464256287,
0.12397947907447815,
0.011133626103401184,
-0.3846816420555115,
-0.3414279520511627,
-0.14573585987091064,
-0.008960239589214325,
-0.21940641105175018,
0.03922223299741745,
-0.009246520698070526,
-0.3746784031391144,
-0.33942911028862,
0.01081065833568573,
-0.16936257481575012,
0.5028359889984131,
-0.2404111623764038,
0.03472410514950752,
0.0647076964378357,
-0.5172023773193359,
-0.08012058585882187,
0.1037602350115776,
0.09167331457138062,
-0.4515223801136017,
-0.16169603168964386,
0.05058974400162697,
-0.07392679154872894,
0.000014800578355789185,
0.08490338921546936,
-0.16901624202728271,
0.26049157977104187,
-0.09361781924962997,
-0.1589938849210739,
-0.10315880179405212,
-0.033362362533807755,
-0.1989811658859253,
0.3748733401298523,
0.11764100939035416,
0.026750320568680763,
-0.23520846664905548,
-0.24199314415454865,
-0.1156836748123169,
0.03199292719364166,
-0.12440468370914459,
-0.026143129914999008,
-0.07937487214803696,
-0.16736412048339844,
0.09400658309459686,
0.010505277663469315,
-0.29734522104263306,
0.060710128396749496,
0.5077539682388306,
0.2515046298503876,
-0.07282710820436478,
0.4401012361049652,
0.09330302476882935,
-0.2352961152791977,
-0.10892307758331299,
0.09826299548149109,
0.418992280960083,
-0.9421238899230957,
0.23168984055519104,
-0.18262381851673126,
0.24148741364479065,
0.04062667861580849,
-0.22487187385559082,
0.16312745213508606,
0.2232046127319336,
-0.2784391939640045,
-0.40260013937950134,
-0.23304955661296844,
0.18336370587348938,
-0.19508878886699677,
0.11628980189561844,
-0.20776471495628357,
-0.013358581811189651,
0.10731526464223862,
-0.14474283158779144,
-0.16465726494789124,
0.2978670597076416,
-0.06334922462701797,
0.024554256349802017,
-0.2975051999092102,
0.0478145033121109,
-0.01378931850194931,
0.037774525582790375,
0.037954315543174744,
0.290714293718338,
-0.18399575352668762,
-0.009838446974754333,
0.013375312089920044,
0.1601696014404297,
0.18968237936496735,
-0.18186162412166595,
-0.10038132965564728,
0.09597678482532501,
-0.05208991467952728,
0.007174517959356308,
0.3218163251876831,
-0.10780460387468338,
-0.24603331089019775,
-0.046476710587739944,
0.5663986802101135,
0.13826985657215118,
-0.22124141454696655,
0.11501486599445343,
-0.05745955929160118,
0.5082600116729736,
-0.035513125360012054,
0.3150876760482788,
-0.00627494603395462,
-0.03548288345336914,
-0.11327821016311646,
0.07481690496206284,
0.34022000432014465,
-0.020049136132001877,
0.40079838037490845,
-0.3780067563056946,
-0.21130293607711792,
-0.43185102939605713,
0.31159695982933044,
0.34362471103668213,
-0.06624961644411087,
-0.1328689455986023,
-0.05372363701462746,
0.051570821553468704,
-0.27213889360427856,
-0.028317570686340332,
0.2917599081993103,
-0.21810445189476013,
-0.1333368867635727,
0.23043039441108704,
0.17557571828365326,
0.009640082716941833,
0.0051683709025382996,
0.10164956003427505,
0.4474959075450897,
0.01885852962732315,
-0.06512225419282913,
0.6639472246170044,
-0.2506266236305237,
0.14577612280845642,
0.3637690544128418,
-0.14442098140716553,
0.23921194672584534,
0.45943742990493774,
-0.08937736600637436,
0.5679215788841248,
0.16382622718811035,
0.10935413837432861,
0.13948167860507965,
-0.42757970094680786,
-0.21498322486877441,
0.3155045211315155,
0.20688845217227936,
-0.16742514073848724,
0.13420948386192322,
0.4170095920562744,
0.14578522741794586,
-0.23311354219913483,
-0.3398490846157074,
0.1712591052055359,
-0.1143728494644165,
0.058332886546850204,
-0.4119391441345215,
-0.400827556848526,
-0.3535754084587097,
-0.006338231265544891,
-0.15176761150360107,
-0.3199830949306488,
0.23652000725269318,
0.27828413248062134,
-0.10547579824924469,
-0.22436073422431946,
0.1341407746076584,
0.3745235502719879,
-0.005939830094575882,
-0.366520494222641,
0.30742013454437256,
0.2603970170021057,
0.15379366278648376,
0.07981481403112411,
0.4100685119628906,
0.5160812139511108,
0.35463595390319824,
-0.20135530829429626,
-0.15491017699241638,
0.24977706372737885,
-0.08255450427532196,
0.07855252921581268,
0.18535742163658142,
0.0864732563495636,
0.2524595856666565,
0.3891049027442932,
0.07892874628305435,
-0.08101551234722137,
0.05274086073040962,
0.2721374034881592,
0.010750651359558105,
0.008793994784355164,
0.19072507321834564,
-0.2894534468650818,
-0.19310924410820007,
0.13879989087581635,
-0.3868454098701477,
-0.3937959671020508,
-0.1084153950214386,
0.2600933909416199,
-0.3130176365375519,
0.012571640312671661,
0.10304366052150726,
-0.0010431855916976929,
-0.13750320672988892,
0.42775917053222656,
0.4590756297111511,
0.13282087445259094,
-0.20908260345458984,
-0.20452171564102173,
-0.41810721158981323,
0.3710215985774994,
-0.1412937194108963,
0.032615289092063904,
0.07952292263507843,
0.31959450244903564,
-0.07041336596012115,
0.2758571207523346,
0.15202325582504272,
0.384274423122406,
0.21742068231105804,
0.4845835864543915,
-0.31126296520233154,
-0.013775819912552834,
0.5616466999053955,
-0.14063380658626556,
-0.26871901750564575,
-0.5203542709350586,
0.17215344309806824,
0.1251661330461502,
-0.09883934259414673,
0.1429249793291092,
-0.19008605182170868,
0.16146071255207062,
-0.23546163737773895,
0.6080942749977112,
0.14165674149990082,
0.40561196208000183,
0.051006875932216644,
-0.048600297421216965,
-0.1950281262397766,
-0.3464188277721405,
-0.2694307863712311,
0.22797980904579163,
0.044523850083351135,
0.42108649015426636,
0.06088631600141525,
0.06800738722085953,
-0.1760895848274231,
-0.09500807523727417,
0.07767583429813385,
0.49318698048591614,
-0.2753262519836426,
0.2753557860851288,
-0.3212094306945801,
0.12852399051189423,
-0.07293705642223358,
-0.2744095027446747,
0.22627589106559753,
0.17338663339614868,
-0.426591694355011,
-0.3332986831665039,
0.3782082200050354,
-0.12621662020683289,
-0.28127437829971313,
0.24375325441360474,
0.16096699237823486,
-0.011781375855207443,
-0.10282211005687714,
-0.5152227282524109,
-0.10427621006965637,
0.3801584243774414,
-0.1966637670993805,
0.056958362460136414,
0.1265418827533722,
0.1637144386768341,
-0.050595272332429886,
-0.2282024770975113,
0.26537880301475525,
-0.011197101324796677,
-0.20153653621673584,
-0.17241494357585907,
-0.3273618817329407
] |
https://github.com/huggingface/datasets/issues/5713 | Hi Quentin! Thanks a lot! Using `num_shards` instead of `max_shard_size` works as expected.
Indeed the way you describe how the size is computed cannot really work with the dataset I'm building as all the image doesn't have the same resolution and then size. Opening an issue on this might be a good idea. | ArrowNotImplementedError when loading dataset from the hub | ### Describe the bug
Hello,
I have created a dataset by using the image loader. Once the dataset is created I try to download it and I get the error:
```
Traceback (most recent call last):
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 1860, in _prepare_split_single
for _, table in generator:
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 69, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1323, in iter_batches
File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 986, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 1748, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 1893, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Steps to reproduce the bug
Create the dataset and push it to the hub:
```python
from datasets import load_dataset
dataset = load_dataset("imagefolder", data_dir="/path/to/dataset")
dataset.push_to_hub("org/dataset-name", private=True, max_shard_size="1GB")
```
Then use it:
```python
from datasets import load_dataset
dataset = load_dataset("org/dataset-name")
```
### Expected behavior
To properly download and use the pushed dataset.
Something else to note is that I specified to have shards of 1GB max, but at the end, for the train set, it is an almost 7GB single file that is pushed.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
- Python version: 3.10.10
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 2.0.0 | 53 | ArrowNotImplementedError when loading dataset from the hub
### Describe the bug
Hello,
I have created a dataset by using the image loader. Once the dataset is created I try to download it and I get the error:
```
Traceback (most recent call last):
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 1860, in _prepare_split_single
for _, table in generator:
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 69, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1323, in iter_batches
File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 986, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 1748, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/builder.py", line 1893, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Steps to reproduce the bug
Create the dataset and push it to the hub:
```python
from datasets import load_dataset
dataset = load_dataset("imagefolder", data_dir="/path/to/dataset")
dataset.push_to_hub("org/dataset-name", private=True, max_shard_size="1GB")
```
Then use it:
```python
from datasets import load_dataset
dataset = load_dataset("org/dataset-name")
```
### Expected behavior
To properly download and use the pushed dataset.
Something else to note is that I specified to have shards of 1GB max, but at the end, for the train set, it is an almost 7GB single file that is pushed.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
- Python version: 3.10.10
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 2.0.0
Hi Quentin! Thanks a lot! Using `num_shards` instead of `max_shard_size` works as expected.
Indeed the way you describe how the size is computed cannot really work with the dataset I'm building as all the image doesn't have the same resolution and then size. Opening an issue on this might be a good idea. | [
-0.4514244794845581,
-0.029354557394981384,
-0.004574500024318695,
0.5526852011680603,
0.22211842238903046,
-0.007330708205699921,
0.42876574397087097,
0.3120574951171875,
-0.25685614347457886,
0.31078779697418213,
-0.14230012893676758,
0.5280890464782715,
-0.031971681863069534,
-0.15134984254837036,
-0.16474011540412903,
-0.10938819497823715,
0.08644945919513702,
0.4080408811569214,
-0.08101628720760345,
0.10763806104660034,
-0.14454877376556396,
0.23239341378211975,
-0.31517988443374634,
0.18472909927368164,
-0.15839001536369324,
0.004635000601410866,
-0.05906819552183151,
0.3311823904514313,
-0.23619207739830017,
-0.4516410827636719,
0.22049309313297272,
-0.2684556245803833,
-0.05143056437373161,
0.2922321856021881,
-0.00012910136138089,
0.2382228672504425,
0.44334128499031067,
-0.029248911887407303,
-0.4454147517681122,
-0.15108038485050201,
-0.05314008891582489,
-0.3546397387981415,
0.15682663023471832,
-0.18004833161830902,
0.18470416963100433,
-0.32087013125419617,
0.030423277989029884,
0.18431104719638824,
0.23952177166938782,
0.012844860553741455,
0.07467648386955261,
0.27769607305526733,
0.16074882447719574,
-0.00983814150094986,
0.33125782012939453,
0.25110924243927,
-0.21391001343727112,
0.37303975224494934,
0.14227408170700073,
0.1813393235206604,
-0.4287482500076294,
0.12655392289161682,
-0.01265363022685051,
0.31730636954307556,
0.07403586804866791,
0.17058512568473816,
0.020383307710289955,
-0.15766778588294983,
-0.10542161017656326,
0.16652920842170715,
0.29981347918510437,
-0.1597001701593399,
-0.36357611417770386,
-0.3982807397842407,
0.1084800735116005,
-0.19899332523345947,
0.09834618866443634,
0.35945039987564087,
-0.28839290142059326,
0.06245829537510872,
-0.12620913982391357,
-0.1657392680644989,
-0.49634361267089844,
0.018542949110269547,
-0.13445144891738892,
0.2760776877403259,
-0.06065474450588226,
0.19278211891651154,
-0.07097335159778595,
-0.15349556505680084,
0.5615456700325012,
-0.19398799538612366,
0.045510001480579376,
0.010990403592586517,
-0.07831847667694092,
0.11669493466615677,
-0.3613002896308899,
0.12416280806064606,
0.1322927623987198,
0.16013005375862122,
0.181733638048172,
0.0966586321592331,
0.1409699022769928,
0.13374529778957367,
0.13343971967697144,
0.01991622895002365,
-0.07436779141426086,
0.11101771146059036,
0.11503839492797852,
0.39619383215904236,
0.16035890579223633,
0.0872458666563034,
-0.2488744705915451,
-0.10470113158226013,
-0.03852125257253647,
0.09774232655763626,
0.3657642900943756,
-0.02578818053007126,
-0.4711953401565552,
-0.19402220845222473,
-0.17012646794319153,
-0.0054442621767520905,
0.09920023381710052,
0.20353612303733826,
0.020648039877414703,
0.31474751234054565,
0.05041058361530304,
0.5081401467323303,
-0.20034027099609375,
-0.1837228536605835,
-0.10895844548940659,
0.07906340807676315,
-0.33980661630630493,
0.012016285210847855,
0.09443577378988266,
-0.06817734241485596,
0.061339542269706726,
0.05476607382297516,
0.18699681758880615,
-0.03874858096241951,
-0.14499881863594055,
-0.18103933334350586,
0.13770067691802979,
0.1267983317375183,
0.08282315731048584,
-0.009211879223585129,
0.12962260842323303,
0.030157431960105896,
-0.041384369134902954,
0.4363745152950287,
-0.48072031140327454,
-0.2076369673013687,
-0.3671225309371948,
0.05982500687241554,
-0.3921853303909302,
0.022342894226312637,
-0.2582480311393738,
-0.03929153084754944,
0.31132107973098755,
-0.10425533354282379,
0.03673391044139862,
-0.16653838753700256,
-0.0899290144443512,
-0.4102805554866791,
0.12829285860061646,
0.38798511028289795,
-0.6048063635826111,
-0.01432860642671585,
-0.2684784233570099,
-0.2968515455722809,
0.3281433582305908,
0.02330082654953003,
-0.23328334093093872,
0.302161306142807,
-0.4890856146812439,
0.4899666905403137,
0.26248079538345337,
-0.23667120933532715,
-0.459585577249527,
0.15240627527236938,
-0.16063357889652252,
0.14243672788143158,
0.09637995064258575,
-0.03935068100690842,
0.18209919333457947,
-0.026112055405974388,
-0.18785594403743744,
0.2775324881076813,
-0.008541173301637173,
0.16374973952770233,
-0.1873658448457718,
-0.2314033955335617,
0.040663402527570724,
0.26872146129608154,
0.17933259904384613,
0.11148719489574432,
0.10750819742679596,
0.03359483927488327,
0.22236426174640656,
-0.2870035469532013,
0.38674959540367126,
0.055106271058321,
0.006302942521870136,
-0.2810622751712799,
0.056194134056568146,
-0.0465824231505394,
-0.5105887055397034,
0.2273901104927063,
-0.4438641369342804,
0.025498555973172188,
-0.6396402716636658,
0.18039189279079437,
-0.1813793182373047,
0.2566258907318115,
-0.3714703917503357,
0.2004767507314682,
0.042584821581840515,
0.029349099844694138,
-0.03795267269015312,
-0.25652146339416504,
-0.16159819066524506,
0.2948419153690338,
-0.017088420689105988,
0.31751370429992676,
-0.43237799406051636,
0.7674691081047058,
0.19337081909179688,
-0.43545302748680115,
-0.06030629575252533,
0.13703355193138123,
0.03803008049726486,
-0.15238933265209198,
-0.08477869629859924,
0.4347206950187683,
0.07638721168041229,
0.4207693338394165,
-0.2291560173034668,
-0.5954763293266296,
0.29497507214546204,
-0.45321500301361084,
0.344145268201828,
-0.18716269731521606,
0.1373347043991089,
0.0067487433552742004,
0.04617629200220108,
0.5470939874649048,
0.029994972050189972,
0.2934523820877075,
0.001981392502784729,
0.011702381074428558,
0.006609298288822174,
0.043876223266124725,
0.07794506102800369,
-0.4292539358139038,
-0.052515771239995956,
0.2878623902797699,
0.1697947382926941,
-0.1813843846321106,
-0.04178155958652496,
0.20043544471263885,
0.2884654402732849,
0.05243576318025589,
-0.08619444072246552,
0.19512557983398438,
-0.341410368680954,
-0.055534228682518005,
0.2936766445636749,
0.006961546838283539,
0.5986095666885376,
0.16774165630340576,
0.15975049138069153,
0.05279773473739624,
0.09625940024852753,
-0.035314589738845825,
0.22417548298835754,
0.19921211898326874,
0.5879306793212891,
0.37203145027160645,
0.11975543200969696,
-0.2145911455154419,
-0.34448397159576416,
-0.13191834092140198,
0.08440086990594864,
0.1962255835533142,
-0.48644426465034485,
-0.1563677042722702,
-0.36402666568756104,
0.007869020104408264,
-0.10031794011592865,
-0.2427414059638977,
-0.00762044545263052,
-0.3622554838657379,
0.0034920182079076767,
0.39879339933395386,
-0.07605039328336716,
0.09183211624622345,
-0.14444555342197418,
-0.004297226667404175,
0.04361385107040405,
-0.01086193136870861,
-0.3720358610153198,
0.010600846260786057,
-0.10934905707836151,
-0.0005324520170688629,
0.24014408886432648,
0.13877272605895996,
0.13593469560146332,
-0.019625768065452576,
0.3186691403388977,
-0.2957998216152191,
-0.04706135392189026,
0.2123977392911911,
-0.060526248067617416,
0.0975508987903595,
0.30105823278427124,
0.2306181937456131,
-0.07419343292713165,
-0.2546836733818054,
0.33141687512397766,
0.08086473494768143,
-0.48659613728523254,
0.40514466166496277,
-0.18384066224098206,
0.12943461537361145,
0.04429151117801666,
0.018680674955248833,
-0.3596891760826111,
-0.29282212257385254,
-0.07194186747074127,
0.1915939599275589,
0.2516331076622009,
-0.12734732031822205,
0.22278177738189697,
0.1731579601764679,
-0.029429463669657707,
-0.35614511370658875,
0.11312931030988693,
0.0008146464824676514,
0.3708049952983856,
-0.20886874198913574,
-0.11235898733139038,
0.003363184630870819,
-0.17966704070568085,
0.1804928034543991,
0.2677689492702484,
-0.30966052412986755,
-0.021212521940469742,
-0.029801689088344574,
0.1270558387041092,
-0.0749736800789833,
-0.09656904637813568,
0.26548513770103455,
0.10144267231225967,
-0.004443038254976273,
-0.15275715291500092,
0.12496486306190491,
0.06598681211471558,
-0.062488555908203125,
0.1354835033416748,
-0.03765104338526726,
0.2440585196018219,
0.17420709133148193,
0.6621370911598206,
0.3127008080482483,
-0.02150760404765606,
0.48617199063301086,
-0.08021052181720734,
0.06845256686210632,
-0.06104180961847305,
-0.056940704584121704,
-0.07991723716259003,
-0.03284980356693268,
0.09160362184047699,
0.15653306245803833,
-0.08897711336612701,
-0.28588515520095825,
-0.09600969403982162,
-0.016006968915462494,
-0.40092793107032776,
-0.16636916995048523,
-0.04541672766208649,
-0.2697669565677643,
-0.09841501712799072,
-0.20331451296806335,
-0.01613040268421173,
-0.11822009086608887,
-0.27431413531303406,
-0.029986456036567688,
-0.13683883845806122,
0.24661411345005035,
-0.1132296621799469,
-0.09108182042837143,
-0.14503547549247742,
-0.1526118665933609,
0.3268664479255676,
0.2120385468006134,
0.15320320427417755,
0.20608994364738464,
-0.33466118574142456,
0.24214276671409607,
-0.17393718659877777,
0.6157167553901672,
-0.2204013168811798,
0.052105266600847244,
-0.10077570378780365,
0.2603786587715149,
-0.6412757039070129,
-0.23325058817863464,
-0.277883917093277,
0.3205987513065338,
-0.1782425045967102,
0.604255199432373,
-0.5167261362075806,
-0.007095295935869217,
0.32644203305244446,
0.14266358315944672,
-0.08416864275932312,
-0.13564999401569366,
-0.30846643447875977,
-0.1358397752046585,
-0.2885156571865082,
0.048572879284620285,
-0.20514839887619019,
0.35523074865341187,
0.04158574342727661,
-0.24928653240203857,
-0.15772344172000885,
-0.08954191952943802,
-0.06852301955223083,
0.11818774044513702,
0.3948124051094055,
-0.32208138704299927,
0.11112421751022339,
-0.07380412518978119,
0.16558313369750977,
0.5616494417190552,
0.7012830376625061,
0.06537444144487381,
-0.3781283497810364,
0.21779415011405945,
-0.03608367219567299,
0.21439099311828613,
0.3071902096271515,
-0.1056210994720459,
0.0070100948214530945,
0.07661505043506622,
0.1802954077720642,
-0.00324254110455513,
-0.33554476499557495,
0.03517528623342514,
-0.31101828813552856,
-0.32138437032699585,
0.30380135774612427,
0.5052872896194458,
-0.03506317734718323,
0.08228152990341187,
0.22858725488185883,
0.24625512957572937,
-0.0700753778219223,
0.2865069508552551,
0.3256577253341675,
0.9133561849594116,
0.021821152418851852,
0.023947643116116524,
0.7249040603637695,
-0.2923699915409088,
0.3612353801727295,
0.10252808034420013,
0.1588238775730133,
-0.5373272895812988,
-0.028997154906392097,
-0.15586479008197784,
-0.3671582341194153,
0.22999951243400574,
0.257674902677536,
-0.27159327268600464,
-0.020602893084287643,
-0.27168190479278564,
0.36216792464256287,
0.12397947907447815,
0.011133626103401184,
-0.3846816420555115,
-0.3414279520511627,
-0.14573585987091064,
-0.008960239589214325,
-0.21940641105175018,
0.03922223299741745,
-0.009246520698070526,
-0.3746784031391144,
-0.33942911028862,
0.01081065833568573,
-0.16936257481575012,
0.5028359889984131,
-0.2404111623764038,
0.03472410514950752,
0.0647076964378357,
-0.5172023773193359,
-0.08012058585882187,
0.1037602350115776,
0.09167331457138062,
-0.4515223801136017,
-0.16169603168964386,
0.05058974400162697,
-0.07392679154872894,
0.000014800578355789185,
0.08490338921546936,
-0.16901624202728271,
0.26049157977104187,
-0.09361781924962997,
-0.1589938849210739,
-0.10315880179405212,
-0.033362362533807755,
-0.1989811658859253,
0.3748733401298523,
0.11764100939035416,
0.026750320568680763,
-0.23520846664905548,
-0.24199314415454865,
-0.1156836748123169,
0.03199292719364166,
-0.12440468370914459,
-0.026143129914999008,
-0.07937487214803696,
-0.16736412048339844,
0.09400658309459686,
0.010505277663469315,
-0.29734522104263306,
0.060710128396749496,
0.5077539682388306,
0.2515046298503876,
-0.07282710820436478,
0.4401012361049652,
0.09330302476882935,
-0.2352961152791977,
-0.10892307758331299,
0.09826299548149109,
0.418992280960083,
-0.9421238899230957,
0.23168984055519104,
-0.18262381851673126,
0.24148741364479065,
0.04062667861580849,
-0.22487187385559082,
0.16312745213508606,
0.2232046127319336,
-0.2784391939640045,
-0.40260013937950134,
-0.23304955661296844,
0.18336370587348938,
-0.19508878886699677,
0.11628980189561844,
-0.20776471495628357,
-0.013358581811189651,
0.10731526464223862,
-0.14474283158779144,
-0.16465726494789124,
0.2978670597076416,
-0.06334922462701797,
0.024554256349802017,
-0.2975051999092102,
0.0478145033121109,
-0.01378931850194931,
0.037774525582790375,
0.037954315543174744,
0.290714293718338,
-0.18399575352668762,
-0.009838446974754333,
0.013375312089920044,
0.1601696014404297,
0.18968237936496735,
-0.18186162412166595,
-0.10038132965564728,
0.09597678482532501,
-0.05208991467952728,
0.007174517959356308,
0.3218163251876831,
-0.10780460387468338,
-0.24603331089019775,
-0.046476710587739944,
0.5663986802101135,
0.13826985657215118,
-0.22124141454696655,
0.11501486599445343,
-0.05745955929160118,
0.5082600116729736,
-0.035513125360012054,
0.3150876760482788,
-0.00627494603395462,
-0.03548288345336914,
-0.11327821016311646,
0.07481690496206284,
0.34022000432014465,
-0.020049136132001877,
0.40079838037490845,
-0.3780067563056946,
-0.21130293607711792,
-0.43185102939605713,
0.31159695982933044,
0.34362471103668213,
-0.06624961644411087,
-0.1328689455986023,
-0.05372363701462746,
0.051570821553468704,
-0.27213889360427856,
-0.028317570686340332,
0.2917599081993103,
-0.21810445189476013,
-0.1333368867635727,
0.23043039441108704,
0.17557571828365326,
0.009640082716941833,
0.0051683709025382996,
0.10164956003427505,
0.4474959075450897,
0.01885852962732315,
-0.06512225419282913,
0.6639472246170044,
-0.2506266236305237,
0.14577612280845642,
0.3637690544128418,
-0.14442098140716553,
0.23921194672584534,
0.45943742990493774,
-0.08937736600637436,
0.5679215788841248,
0.16382622718811035,
0.10935413837432861,
0.13948167860507965,
-0.42757970094680786,
-0.21498322486877441,
0.3155045211315155,
0.20688845217227936,
-0.16742514073848724,
0.13420948386192322,
0.4170095920562744,
0.14578522741794586,
-0.23311354219913483,
-0.3398490846157074,
0.1712591052055359,
-0.1143728494644165,
0.058332886546850204,
-0.4119391441345215,
-0.400827556848526,
-0.3535754084587097,
-0.006338231265544891,
-0.15176761150360107,
-0.3199830949306488,
0.23652000725269318,
0.27828413248062134,
-0.10547579824924469,
-0.22436073422431946,
0.1341407746076584,
0.3745235502719879,
-0.005939830094575882,
-0.366520494222641,
0.30742013454437256,
0.2603970170021057,
0.15379366278648376,
0.07981481403112411,
0.4100685119628906,
0.5160812139511108,
0.35463595390319824,
-0.20135530829429626,
-0.15491017699241638,
0.24977706372737885,
-0.08255450427532196,
0.07855252921581268,
0.18535742163658142,
0.0864732563495636,
0.2524595856666565,
0.3891049027442932,
0.07892874628305435,
-0.08101551234722137,
0.05274086073040962,
0.2721374034881592,
0.010750651359558105,
0.008793994784355164,
0.19072507321834564,
-0.2894534468650818,
-0.19310924410820007,
0.13879989087581635,
-0.3868454098701477,
-0.3937959671020508,
-0.1084153950214386,
0.2600933909416199,
-0.3130176365375519,
0.012571640312671661,
0.10304366052150726,
-0.0010431855916976929,
-0.13750320672988892,
0.42775917053222656,
0.4590756297111511,
0.13282087445259094,
-0.20908260345458984,
-0.20452171564102173,
-0.41810721158981323,
0.3710215985774994,
-0.1412937194108963,
0.032615289092063904,
0.07952292263507843,
0.31959450244903564,
-0.07041336596012115,
0.2758571207523346,
0.15202325582504272,
0.384274423122406,
0.21742068231105804,
0.4845835864543915,
-0.31126296520233154,
-0.013775819912552834,
0.5616466999053955,
-0.14063380658626556,
-0.26871901750564575,
-0.5203542709350586,
0.17215344309806824,
0.1251661330461502,
-0.09883934259414673,
0.1429249793291092,
-0.19008605182170868,
0.16146071255207062,
-0.23546163737773895,
0.6080942749977112,
0.14165674149990082,
0.40561196208000183,
0.051006875932216644,
-0.048600297421216965,
-0.1950281262397766,
-0.3464188277721405,
-0.2694307863712311,
0.22797980904579163,
0.044523850083351135,
0.42108649015426636,
0.06088631600141525,
0.06800738722085953,
-0.1760895848274231,
-0.09500807523727417,
0.07767583429813385,
0.49318698048591614,
-0.2753262519836426,
0.2753557860851288,
-0.3212094306945801,
0.12852399051189423,
-0.07293705642223358,
-0.2744095027446747,
0.22627589106559753,
0.17338663339614868,
-0.426591694355011,
-0.3332986831665039,
0.3782082200050354,
-0.12621662020683289,
-0.28127437829971313,
0.24375325441360474,
0.16096699237823486,
-0.011781375855207443,
-0.10282211005687714,
-0.5152227282524109,
-0.10427621006965637,
0.3801584243774414,
-0.1966637670993805,
0.056958362460136414,
0.1265418827533722,
0.1637144386768341,
-0.050595272332429886,
-0.2282024770975113,
0.26537880301475525,
-0.011197101324796677,
-0.20153653621673584,
-0.17241494357585907,
-0.3273618817329407
] |
https://github.com/huggingface/datasets/issues/5712 | > Closing since this is a duplicate of #5711
Sorry @mariosasko , my internet went down went submitting the issue, and somehow it ended up creating a duplicate | load_dataset in v2.11.0 raises "ValueError: seek of closed file" in np.load() | ### Describe the bug
Hi,
I have some `dataset_load()` code of a custom offline dataset that works with datasets v2.10.1.
```python
ds = datasets.load_dataset(path=dataset_dir,
name=configuration,
data_dir=dataset_dir,
cache_dir=cache_dir,
aux_dir=aux_dir,
# download_mode=datasets.DownloadMode.FORCE_REDOWNLOAD,
num_proc=18)
```
When upgrading datasets to 2.11.0, it fails with error
```
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/builder.py", line 1651, in _download_and_prepare
super()._download_and_prepare(
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/builder.py", line 964, in _download_and_prepare
split_generators = self._split_generators(dl_manager, **split_generators_kwargs)
File "/home/ramon.casero/.cache/huggingface/modules/datasets_modules/datasets/71f67f69e6e00e139903a121f96b71f39b65a6b6aaeb0862e6a5da3a3f565b4c/mydataset.py", line 682, in _split_generators
self.some_function()
File "/home/ramon.casero/.cache/huggingface/modules/datasets_modules/datasets/71f67f69e6e00e139903a121f96b71f39b65a6b6aaeb0862e6a5da3a3f565b4c/mydataset.py", line 1314, in some_function()
x_df = pd.DataFrame({'cell_type_descriptor': fp['x'].tolist()})
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/numpy/lib/npyio.py", line 248, in __getitem__
bytes = self.zip.open(key)
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/zipfile.py", line 1530, in open
fheader = zef_file.read(sizeFileHeader)
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/zipfile.py", line 744, in read
self._file.seek(self._pos)
ValueError: seek of closed file
```
### Steps to reproduce the bug
Sorry, I cannot share the data or code because they are not mine to share, but the point of failure is a call in `some_function()`
```python
with np.load(filename) as fp:
x_df = pd.DataFrame({'feature': fp['x'].tolist()})
```
I'll try to generate a short snippet that reproduces the error.
### Expected behavior
I would expect that `load_dataset` works on the custom datasets generation script for v2.11.0 the same way it works for 2.10.1, without making `np.load()` give a `ValueError: seek of closed file` error.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-4.18.0-483.el8.x86_64-x86_64-with-glibc2.28
- Python version: 3.10.8
- Huggingface_hub version: 0.12.0
- PyArrow version: 11.0.0
- Pandas version: 1.5.2
- numpy: 1.24.2
- This is an offline dataset that uses `datasets.config.HF_DATASETS_OFFLINE = True` in the generation script.
| 28 | load_dataset in v2.11.0 raises "ValueError: seek of closed file" in np.load()
### Describe the bug
Hi,
I have some `dataset_load()` code of a custom offline dataset that works with datasets v2.10.1.
```python
ds = datasets.load_dataset(path=dataset_dir,
name=configuration,
data_dir=dataset_dir,
cache_dir=cache_dir,
aux_dir=aux_dir,
# download_mode=datasets.DownloadMode.FORCE_REDOWNLOAD,
num_proc=18)
```
When upgrading datasets to 2.11.0, it fails with error
```
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/builder.py", line 1651, in _download_and_prepare
super()._download_and_prepare(
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/builder.py", line 964, in _download_and_prepare
split_generators = self._split_generators(dl_manager, **split_generators_kwargs)
File "/home/ramon.casero/.cache/huggingface/modules/datasets_modules/datasets/71f67f69e6e00e139903a121f96b71f39b65a6b6aaeb0862e6a5da3a3f565b4c/mydataset.py", line 682, in _split_generators
self.some_function()
File "/home/ramon.casero/.cache/huggingface/modules/datasets_modules/datasets/71f67f69e6e00e139903a121f96b71f39b65a6b6aaeb0862e6a5da3a3f565b4c/mydataset.py", line 1314, in some_function()
x_df = pd.DataFrame({'cell_type_descriptor': fp['x'].tolist()})
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/numpy/lib/npyio.py", line 248, in __getitem__
bytes = self.zip.open(key)
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/zipfile.py", line 1530, in open
fheader = zef_file.read(sizeFileHeader)
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/zipfile.py", line 744, in read
self._file.seek(self._pos)
ValueError: seek of closed file
```
### Steps to reproduce the bug
Sorry, I cannot share the data or code because they are not mine to share, but the point of failure is a call in `some_function()`
```python
with np.load(filename) as fp:
x_df = pd.DataFrame({'feature': fp['x'].tolist()})
```
I'll try to generate a short snippet that reproduces the error.
### Expected behavior
I would expect that `load_dataset` works on the custom datasets generation script for v2.11.0 the same way it works for 2.10.1, without making `np.load()` give a `ValueError: seek of closed file` error.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-4.18.0-483.el8.x86_64-x86_64-with-glibc2.28
- Python version: 3.10.8
- Huggingface_hub version: 0.12.0
- PyArrow version: 11.0.0
- Pandas version: 1.5.2
- numpy: 1.24.2
- This is an offline dataset that uses `datasets.config.HF_DATASETS_OFFLINE = True` in the generation script.
> Closing since this is a duplicate of #5711
Sorry @mariosasko , my internet went down went submitting the issue, and somehow it ended up creating a duplicate | [
-0.39707982540130615,
0.21128320693969727,
0.020410917699337006,
0.5140681862831116,
0.09784124791622162,
-0.00237254798412323,
0.40202948451042175,
0.38422852754592896,
0.0661887675523758,
0.14102311432361603,
-0.13914933800697327,
0.1929495483636856,
-0.19966956973075867,
0.2623779773712158,
-0.284524142742157,
-0.4216984212398529,
0.008233334869146347,
0.14142070710659027,
-0.20305117964744568,
0.08905516564846039,
-0.5063535571098328,
0.43430790305137634,
-0.39788591861724854,
0.3270084261894226,
0.06502261757850647,
-0.24894319474697113,
-0.025062624365091324,
0.3376224637031555,
-0.1611059606075287,
-0.47595804929733276,
0.417070597410202,
-0.1525653451681137,
0.32813507318496704,
0.3442267179489136,
-0.0001194835058413446,
-0.03487102687358856,
0.45672503113746643,
0.015492498874664307,
-0.46514007449150085,
-0.25041624903678894,
-0.2704850733280182,
-0.368177205324173,
0.09487461298704147,
-0.19643428921699524,
0.11586295068264008,
-0.3711091876029968,
-0.11895016580820084,
-0.41924595832824707,
0.21156620979309082,
0.06367284059524536,
0.1527549773454666,
0.4306328594684601,
0.37569138407707214,
-0.36890730261802673,
0.13200215995311737,
-0.199647918343544,
-0.253526896238327,
-0.16070158779621124,
0.16622406244277954,
-0.24934548139572144,
0.10293863713741302,
0.21545691788196564,
-0.19880840182304382,
-0.04823802411556244,
0.22924306988716125,
-0.08064506947994232,
-0.09766173362731934,
-0.10470722615718842,
0.1425643414258957,
0.27893882989883423,
0.5051390528678894,
-0.03592148795723915,
-0.42906564474105835,
-0.48385635018348694,
-0.26786503195762634,
-0.45135655999183655,
0.5694960355758667,
0.10621368139982224,
0.04738518223166466,
0.2677295207977295,
0.07072537392377853,
-0.16545608639717102,
-0.05267743766307831,
0.08744318783283234,
-0.10696873068809509,
0.07862264662981033,
-0.2782830595970154,
0.14746026694774628,
0.08192379027605057,
-0.1467856764793396,
0.1565798819065094,
-0.10632534325122833,
-0.1486501395702362,
-0.11109098792076111,
-0.22112232446670532,
0.00953797996044159,
0.10974272340536118,
0.04522300511598587,
0.05152605473995209,
0.2598116397857666,
0.1093570664525032,
-0.15146052837371826,
-0.2051747441291809,
0.09331657737493515,
0.5124964118003845,
0.2654922604560852,
0.21080949902534485,
-0.13537853956222534,
0.30614879727363586,
0.2869967520236969,
-0.05098021775484085,
-0.14835946261882782,
-0.02909984439611435,
-0.3221602439880371,
0.22019506990909576,
0.13944286108016968,
0.48974713683128357,
0.04258066415786743,
-0.1774202287197113,
0.005207721143960953,
0.14649371802806854,
0.01431279256939888,
-0.02935761772096157,
0.029516907408833504,
0.10649731755256653,
0.38419392704963684,
0.1992512196302414,
0.1673770397901535,
-0.06603997945785522,
-0.4921484589576721,
-0.0982092022895813,
-0.11926330626010895,
0.006537258625030518,
-0.098760224878788,
0.06706671416759491,
-0.0056222546845674515,
0.2673512101173401,
-0.2058984935283661,
-0.4314151406288147,
-0.02052253484725952,
0.08828295022249222,
0.0685807317495346,
-0.04496064782142639,
0.4631931781768799,
0.047051019966602325,
0.02510131150484085,
0.052261002361774445,
0.05931749939918518,
-0.015481792390346527,
0.35381847620010376,
-0.24750174582004547,
-0.4132179617881775,
-0.2120666205883026,
0.09699460119009018,
-0.3425389528274536,
0.10162979364395142,
-0.23719054460525513,
-0.083589106798172,
0.10820268094539642,
-0.2573734223842621,
-0.15367701649665833,
-0.08082391321659088,
-0.6031107902526855,
-0.21668294072151184,
-0.059861354529857635,
0.559276819229126,
-0.27264589071273804,
0.23595643043518066,
-0.33518385887145996,
-0.12725748121738434,
-0.08452054858207703,
-0.06899957358837128,
-0.20954585075378418,
0.1897011399269104,
-0.29933810234069824,
-0.09139708429574966,
0.582070529460907,
-0.35336577892303467,
-0.5385497212409973,
0.39355993270874023,
-0.2200486660003662,
0.20162856578826904,
0.3286589980125427,
0.04016530513763428,
0.12250633537769318,
-0.18407109379768372,
-0.17851397395133972,
0.06842255592346191,
-0.059115707874298096,
-0.17589187622070312,
-0.22418805956840515,
-0.13527539372444153,
0.17945903539657593,
-0.0001833215355873108,
-0.01340683177113533,
0.1402834951877594,
0.10238845646381378,
-0.07217514514923096,
0.08129099011421204,
0.14409324526786804,
0.12098319828510284,
0.04549145698547363,
0.05154009163379669,
0.10878325253725052,
0.0719076469540596,
-0.15576858818531036,
-0.5498517751693726,
0.35883376002311707,
-0.19065503776073456,
-0.20996640622615814,
-0.2951860725879669,
-0.09744267910718918,
-0.4188595712184906,
-0.0011325329542160034,
-0.3372759521007538,
-0.12374332547187805,
0.017180945724248886,
0.1366785615682602,
-0.17490792274475098,
0.12108772993087769,
-0.15608927607536316,
0.5555188655853271,
-0.22133207321166992,
0.10208560526371002,
-0.3911648690700531,
0.2904248833656311,
0.07647516578435898,
0.1943981945514679,
-0.039613027125597,
-0.10434000194072723,
0.2427605539560318,
-0.1156616061925888,
-0.2758926749229431,
0.6059426069259644,
0.1969713717699051,
0.19100892543792725,
-0.17666037380695343,
-0.06676150113344193,
0.09543363004922867,
0.1193203330039978,
0.2797023355960846,
0.10258760303258896,
-0.0364152193069458,
0.1032566949725151,
-0.012500414624810219,
0.37235721945762634,
0.09316731989383698,
-0.07266141474246979,
0.11243477463722229,
0.014670446515083313,
0.11679022014141083,
-0.022537454962730408,
-0.031521063297986984,
-0.17963959276676178,
-0.10876259952783585,
0.276658296585083,
-0.11207105219364166,
0.16356323659420013,
0.02186320722103119,
-0.09241697937250137,
0.8268387317657471,
0.09369267523288727,
0.2339756190776825,
0.10009926557540894,
-0.04520510882139206,
-0.06036337465047836,
0.02200690098106861,
0.7470212578773499,
0.48657092452049255,
0.15177589654922485,
0.04836427792906761,
0.35015207529067993,
0.18688443303108215,
-0.027290290221571922,
0.2156027853488922,
0.20735862851142883,
0.31310904026031494,
0.2575538456439972,
-0.04377732425928116,
0.03672671318054199,
-0.06311678141355515,
0.07123208045959473,
0.11284051835536957,
0.39569395780563354,
-0.3222472667694092,
-0.18972238898277283,
-0.30866917967796326,
0.24533456563949585,
-0.028020448982715607,
0.29806211590766907,
0.09678506851196289,
-0.19778987765312195,
-0.2268374264240265,
0.4179862439632416,
-0.01411079615354538,
0.21079286932945251,
-0.09306291490793228,
0.007841125130653381,
0.15947216749191284,
-0.1456451416015625,
0.17357593774795532,
-0.22790563106536865,
-0.26854103803634644,
-0.03381163999438286,
0.27933967113494873,
-0.056539136916399,
0.22606676816940308,
-0.1021827757358551,
-0.06749006360769272,
-0.16021180152893066,
-0.11885210871696472,
-0.16692981123924255,
-0.016314243897795677,
-0.12323057651519775,
0.44782668352127075,
0.11017928272485733,
0.06621140241622925,
0.06056710705161095,
0.26860731840133667,
-0.008506372570991516,
-0.29099661111831665,
0.1854790896177292,
-0.015574747696518898,
0.21821270883083344,
-0.07860012352466583,
-0.6077046394348145,
-0.11833834648132324,
-0.439264714717865,
0.2929480969905853,
-0.11588181555271149,
0.16779890656471252,
0.25575366616249084,
0.15400540828704834,
-0.17343786358833313,
0.29809698462486267,
0.019515328109264374,
-0.03102278895676136,
-0.2675783038139343,
0.10209442675113678,
-0.26059818267822266,
-0.11951210349798203,
0.08598802983760834,
-0.042143113911151886,
0.24449925124645233,
0.2563890218734741,
-0.4262794554233551,
-0.16325893998146057,
-0.005032682791352272,
0.00866701453924179,
-0.19269497692584991,
-0.14904367923736572,
0.46436214447021484,
0.1825302392244339,
0.013330686837434769,
-0.1592307686805725,
-0.036634013056755066,
0.3972250819206238,
-0.08456575125455856,
0.031948793679475784,
0.2459474503993988,
0.6158949136734009,
0.14874695241451263,
0.08452612906694412,
0.09288004040718079,
0.09139302372932434,
0.36993491649627686,
0.21145665645599365,
0.4501960575580597,
-0.22888414561748505,
-0.28444594144821167,
-0.357500284910202,
0.07753896713256836,
-0.020025230944156647,
-0.0388740673661232,
0.023640785366296768,
0.10481693595647812,
-0.3756689429283142,
-0.3534185290336609,
0.11262378841638565,
0.002121947705745697,
-0.30176591873168945,
0.053350355476140976,
0.40102970600128174,
0.05488039553165436,
0.27102187275886536,
-0.1894574761390686,
0.12410563975572586,
0.08681339770555496,
0.058235928416252136,
0.2484809160232544,
-0.1392003893852234,
-0.12468104064464569,
0.2885255515575409,
-0.1303567886352539,
0.3240315318107605,
0.14441348612308502,
0.3330978751182556,
0.12150170654058456,
-0.0652875006198883,
-0.05401366204023361,
-0.024427255615592003,
0.5780174732208252,
-0.28079837560653687,
0.3938522934913635,
0.34689292311668396,
0.0007366016507148743,
-0.44275426864624023,
0.029848560690879822,
0.1241958811879158,
-0.07009465247392654,
0.0563751719892025,
0.3307299315929413,
0.0679163932800293,
-0.2974563241004944,
0.32410427927970886,
0.09427935630083084,
-0.07056918740272522,
-0.16661939024925232,
-0.27912309765815735,
-0.33973586559295654,
-0.19954757392406464,
-0.19657176733016968,
0.011174716055393219,
0.2880113422870636,
-0.1350661814212799,
-0.26398783922195435,
-0.16055364906787872,
-0.159917414188385,
-0.2389450967311859,
-0.0691356509923935,
0.2516446113586426,
-0.0946296751499176,
0.24636892974376678,
-0.06859144568443298,
0.2711864709854126,
0.18104703724384308,
0.4245907664299011,
-0.2102399468421936,
-0.30882734060287476,
0.024358168244361877,
0.05662349984049797,
-0.20807383954524994,
0.12456996738910675,
-0.3242456912994385,
-0.12771199643611908,
-0.11327538639307022,
-0.018632665276527405,
-0.10351325571537018,
-0.2648654282093048,
0.3703452944755554,
-0.12930342555046082,
-0.014849107712507248,
-0.43056556582450867,
0.43132883310317993,
0.069488026201725,
-0.04838297516107559,
0.44733908772468567,
0.027506902813911438,
-0.15760692954063416,
0.03665466606616974,
-0.31707891821861267,
0.3679124712944031,
0.15903595089912415,
-0.00425579771399498,
0.4820447266101837,
-0.34339016675949097,
0.31405961513519287,
-0.035122912377119064,
-0.12152199447154999,
-0.244476318359375,
-0.14585967361927032,
-0.07862557470798492,
0.024865977466106415,
0.3537941575050354,
0.15219181776046753,
-0.07370269298553467,
0.32619208097457886,
-0.062028199434280396,
0.2920805513858795,
0.093894362449646,
0.21134555339813232,
-0.13996177911758423,
-0.01059589721262455,
-0.5017746686935425,
0.004954308271408081,
0.1257362961769104,
0.12365007400512695,
-0.007422979921102524,
-0.26841533184051514,
0.22355826199054718,
0.08108115196228027,
-0.04590582102537155,
0.09315335750579834,
-0.4215026795864105,
0.11747713387012482,
-0.20331096649169922,
-0.3411775231361389,
0.4051017165184021,
0.5930039882659912,
0.4606592357158661,
-0.09415386617183685,
-0.011935853399336338,
0.235207661986351,
-0.2505582869052887,
0.0005846917629241943,
0.1847953200340271,
0.2651645839214325,
0.1757163405418396,
-0.0656561478972435,
-0.08676392585039139,
0.1727840006351471,
-0.2688369154930115,
-0.05903339758515358,
0.25359269976615906,
-0.04945916682481766,
0.2647797763347626,
-0.4304753541946411,
-0.13454949855804443,
-0.28898680210113525,
-0.0474160797894001,
-0.2918664813041687,
0.03544093668460846,
-0.053864412009716034,
-0.0517520047724247,
-0.019723746925592422,
-0.4223434627056122,
-0.43567773699760437,
0.06867074221372604,
0.6714038848876953,
-0.007182619068771601,
0.13496346771717072,
0.49463340640068054,
0.005951307713985443,
0.05007099360227585,
-0.16608969867229462,
0.3912177085876465,
0.12759912014007568,
-0.18646103143692017,
0.4893603026866913,
0.30720221996307373,
0.24304598569869995,
0.09710422158241272,
0.20006495714187622,
-0.005715120118111372,
0.1423785388469696,
0.10348044335842133,
-0.2897859215736389,
-0.38447698950767517,
0.01655077189207077,
-0.06677794456481934,
-0.0381445549428463,
0.23777379095554352,
-0.05469072610139847,
-0.07850848138332367,
-0.40528202056884766,
-0.19736993312835693,
0.3045504093170166,
0.007781803607940674,
-0.183192640542984,
0.6249593496322632,
0.04415472596883774,
0.02944204956293106,
0.024253174662590027,
0.029419854283332825,
-0.01756591722369194,
-0.4087425470352173,
-0.06634702533483505,
-0.07962710410356522,
0.17287229001522064,
-0.04160168766975403,
-0.09357963502407074,
0.0019035525619983673,
-0.550927996635437,
-0.3792419135570526,
-0.06496640294790268,
0.21464359760284424,
0.29922348260879517,
0.003147333860397339,
0.20813912153244019,
-0.06359805911779404,
0.13609889149665833,
-0.25686484575271606,
0.2588888704776764,
-0.4714520275592804,
0.05671515688300133,
-0.11663389205932617,
0.24772687256336212,
0.1374809890985489,
-0.10232479125261307,
-0.226930171251297,
-0.03846373409032822,
-0.2288118600845337,
-0.11549751460552216,
0.561505913734436,
-0.2928142249584198,
-0.19399185478687286,
0.1814088672399521,
0.3266010284423828,
0.06555557996034622,
-0.09854486584663391,
-0.16146442294120789,
0.05334155261516571,
0.12187256664037704,
-0.39944207668304443,
0.02153737097978592,
0.300415575504303,
0.15479809045791626,
-0.032969288527965546,
0.11820968985557556,
0.23211374878883362,
-0.23410916328430176,
0.08406350016593933,
0.1996656358242035,
0.5123068690299988,
-0.35276272892951965,
0.46167120337486267,
0.6787008047103882,
0.2571547031402588,
0.12207449972629547,
0.09098019450902939,
0.16326580941677094,
0.26919206976890564,
0.7529910802841187,
-0.1471540778875351,
0.33336326479911804,
0.3663981854915619,
0.255936861038208,
-0.16989359259605408,
-0.6983917951583862,
-0.28487494587898254,
0.2738102674484253,
-0.13860391080379486,
0.03497812896966934,
-0.25825273990631104,
0.22145435214042664,
-0.2679949104785919,
-0.02172834798693657,
-0.1658240556716919,
0.1627037227153778,
-0.1600101888179779,
-0.07580776512622833,
-0.3041963577270508,
-0.27730435132980347,
-0.0854954794049263,
0.0923469066619873,
-0.0789836049079895,
-0.0038278568536043167,
-0.011382769793272018,
-0.09998960793018341,
-0.06491566449403763,
-0.29605475068092346,
-0.1480700671672821,
0.10475175082683563,
0.02057713083922863,
-0.4175446033477783,
0.3524835407733917,
0.3365403413772583,
0.007936058565974236,
0.23582372069358826,
0.11164089292287827,
0.4911203980445862,
0.2695732116699219,
0.034189481288194656,
-0.1855553388595581,
0.06068183481693268,
-0.06833505630493164,
-0.05790891498327255,
-0.03792676329612732,
-0.20840734243392944,
0.2307094931602478,
0.29344043135643005,
-0.02345072105526924,
0.015332300215959549,
-0.008747521787881851,
0.16298392415046692,
0.05475101247429848,
-0.6329203248023987,
0.23992156982421875,
-0.10830463469028473,
-0.20797625184059143,
-0.28670603036880493,
0.1363823115825653,
-0.05361339449882507,
-0.46850237250328064,
0.35688549280166626,
0.16357918083667755,
0.2031499445438385,
0.014026440680027008,
0.03860948979854584,
-0.2568782567977905,
0.2801409065723419,
0.2591364085674286,
-0.2827570140361786,
-0.20961454510688782,
-0.45781275629997253,
-0.7193721532821655,
-0.0042736344039440155,
0.022495383396744728,
-0.18383511900901794,
0.08114731311798096,
-0.18197955191135406,
0.02744760736823082,
-0.12056310474872589,
-0.1157766729593277,
0.35043367743492126,
0.38428980112075806,
-0.026857934892177582,
-0.33822011947631836,
-0.16906534135341644,
0.16778643429279327,
0.06432300806045532,
-0.16243258118629456,
-0.42264261841773987,
-0.02564283460378647,
-0.059354834258556366,
-0.05236398056149483,
0.15957875549793243,
0.06854843348264694,
-0.008364468812942505,
0.22437943518161774,
0.4305329918861389,
0.08995861560106277,
0.20332381129264832,
0.11165255308151245,
-0.0627509281039238,
-0.27356502413749695,
-0.014652037993073463,
-0.0773458331823349,
0.06731131672859192,
-0.07777620851993561,
0.4259633421897888,
-0.3261816203594208,
0.2748517394065857,
-0.19693879783153534,
0.29784172773361206,
-0.16043826937675476,
0.4679528772830963,
-0.2456691861152649,
0.13160249590873718,
0.07416118681430817,
0.04519268497824669,
0.33724844455718994,
-0.18159794807434082,
-0.07758379727602005,
0.24961701035499573,
-0.44938498735427856,
-0.27309083938598633,
0.4553574025630951,
-0.02992756851017475,
-0.27827370166778564,
-0.08408161997795105,
0.09889183193445206,
0.05041653290390968,
0.046393685042858124,
-0.18528065085411072,
0.07153350114822388,
0.43519556522369385,
0.12341083586215973,
-0.03708634153008461,
0.15254418551921844,
-0.11209367215633392,
0.03959333151578903,
0.2623855173587799,
0.009869813919067383,
-0.05364373326301575,
-0.32087087631225586,
0.02008439600467682,
-0.12891998887062073
] |
https://github.com/huggingface/datasets/issues/5711 | It seems like https://github.com/huggingface/datasets/pull/5626 has introduced this error.
cc @albertvillanova
I think replacing:
https://github.com/huggingface/datasets/blob/0803a006db1c395ac715662cc6079651f77c11ea/src/datasets/download/streaming_download_manager.py#L777-L778
with:
```python
return np.load(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), *args, **kwargs)
```
should fix the issue.
(Maybe this is also worth doing a patch release afterward) | load_dataset in v2.11.0 raises "ValueError: seek of closed file" in np.load() | ### Describe the bug
Hi,
I have some `dataset_load()` code of a custom offline dataset that works with datasets v2.10.1.
```python
ds = datasets.load_dataset(path=dataset_dir,
name=configuration,
data_dir=dataset_dir,
cache_dir=cache_dir,
aux_dir=aux_dir,
# download_mode=datasets.DownloadMode.FORCE_REDOWNLOAD,
num_proc=18)
```
When upgrading datasets to 2.11.0, it fails with error
```
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/builder.py", line 1651, in _download_and_prepare
super()._download_and_prepare(
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/builder.py", line 964, in _download_and_prepare
split_generators = self._split_generators(dl_manager, **split_generators_kwargs)
File "/home/ramon.casero/.cache/huggingface/modules/datasets_modules/datasets/71f67f69e6e00e139903a121f96b71f39b65a6b6aaeb0862e6a5da3a3f565b4c/mydataset.py", line 682, in _split_generators
self.some_function()
File "/home/ramon.casero/.cache/huggingface/modules/datasets_modules/datasets/71f67f69e6e00e139903a121f96b71f39b65a6b6aaeb0862e6a5da3a3f565b4c/mydataset.py", line 1314, in some_function()
x_df = pd.DataFrame({'cell_type_descriptor': fp['x'].tolist()})
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/numpy/lib/npyio.py", line 248, in __getitem__
bytes = self.zip.open(key)
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/zipfile.py", line 1530, in open
fheader = zef_file.read(sizeFileHeader)
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/zipfile.py", line 744, in read
self._file.seek(self._pos)
ValueError: seek of closed file
```
### Steps to reproduce the bug
Sorry, I cannot share the data or code because they are not mine to share, but the point of failure is a call in `some_function()`
```python
with np.load(embedding_filename) as fp:
x_df = pd.DataFrame({'feature': fp['x'].tolist()})
```
I'll try to generate a short snippet that reproduces the error.
### Expected behavior
I would expect that `load_dataset` works on the custom datasets generation script for v2.11.0 the same way it works for 2.10.1, without making `np.load()` give a `ValueError: seek of closed file` error.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-4.18.0-483.el8.x86_64-x86_64-with-glibc2.28
- Python version: 3.10.8
- Huggingface_hub version: 0.12.0
- PyArrow version: 11.0.0
- Pandas version: 1.5.2
- numpy: 1.24.2
- This is an offline dataset that uses `datasets.config.HF_DATASETS_OFFLINE = True` in the generation script.
| 37 | load_dataset in v2.11.0 raises "ValueError: seek of closed file" in np.load()
### Describe the bug
Hi,
I have some `dataset_load()` code of a custom offline dataset that works with datasets v2.10.1.
```python
ds = datasets.load_dataset(path=dataset_dir,
name=configuration,
data_dir=dataset_dir,
cache_dir=cache_dir,
aux_dir=aux_dir,
# download_mode=datasets.DownloadMode.FORCE_REDOWNLOAD,
num_proc=18)
```
When upgrading datasets to 2.11.0, it fails with error
```
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/builder.py", line 1651, in _download_and_prepare
super()._download_and_prepare(
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/datasets/builder.py", line 964, in _download_and_prepare
split_generators = self._split_generators(dl_manager, **split_generators_kwargs)
File "/home/ramon.casero/.cache/huggingface/modules/datasets_modules/datasets/71f67f69e6e00e139903a121f96b71f39b65a6b6aaeb0862e6a5da3a3f565b4c/mydataset.py", line 682, in _split_generators
self.some_function()
File "/home/ramon.casero/.cache/huggingface/modules/datasets_modules/datasets/71f67f69e6e00e139903a121f96b71f39b65a6b6aaeb0862e6a5da3a3f565b4c/mydataset.py", line 1314, in some_function()
x_df = pd.DataFrame({'cell_type_descriptor': fp['x'].tolist()})
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/numpy/lib/npyio.py", line 248, in __getitem__
bytes = self.zip.open(key)
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/zipfile.py", line 1530, in open
fheader = zef_file.read(sizeFileHeader)
File "/home/ramon.casero/opt/miniconda3/envs/myenv/lib/python3.10/zipfile.py", line 744, in read
self._file.seek(self._pos)
ValueError: seek of closed file
```
### Steps to reproduce the bug
Sorry, I cannot share the data or code because they are not mine to share, but the point of failure is a call in `some_function()`
```python
with np.load(embedding_filename) as fp:
x_df = pd.DataFrame({'feature': fp['x'].tolist()})
```
I'll try to generate a short snippet that reproduces the error.
### Expected behavior
I would expect that `load_dataset` works on the custom datasets generation script for v2.11.0 the same way it works for 2.10.1, without making `np.load()` give a `ValueError: seek of closed file` error.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-4.18.0-483.el8.x86_64-x86_64-with-glibc2.28
- Python version: 3.10.8
- Huggingface_hub version: 0.12.0
- PyArrow version: 11.0.0
- Pandas version: 1.5.2
- numpy: 1.24.2
- This is an offline dataset that uses `datasets.config.HF_DATASETS_OFFLINE = True` in the generation script.
It seems like https://github.com/huggingface/datasets/pull/5626 has introduced this error.
cc @albertvillanova
I think replacing:
https://github.com/huggingface/datasets/blob/0803a006db1c395ac715662cc6079651f77c11ea/src/datasets/download/streaming_download_manager.py#L777-L778
with:
```python
return np.load(xopen(filepath_or_buffer, "rb", use_auth_token=use_auth_token), *args, **kwargs)
```
should fix the issue.
(Maybe this is also worth doing a patch release afterward) | [
-0.39707982540130615,
0.21128320693969727,
0.020410917699337006,
0.5140681862831116,
0.09784124791622162,
-0.00237254798412323,
0.40202948451042175,
0.38422852754592896,
0.0661887675523758,
0.14102311432361603,
-0.13914933800697327,
0.1929495483636856,
-0.19966956973075867,
0.2623779773712158,
-0.284524142742157,
-0.4216984212398529,
0.008233334869146347,
0.14142070710659027,
-0.20305117964744568,
0.08905516564846039,
-0.5063535571098328,
0.43430790305137634,
-0.39788591861724854,
0.3270084261894226,
0.06502261757850647,
-0.24894319474697113,
-0.025062624365091324,
0.3376224637031555,
-0.1611059606075287,
-0.47595804929733276,
0.417070597410202,
-0.1525653451681137,
0.32813507318496704,
0.3442267179489136,
-0.0001194835058413446,
-0.03487102687358856,
0.45672503113746643,
0.015492498874664307,
-0.46514007449150085,
-0.25041624903678894,
-0.2704850733280182,
-0.368177205324173,
0.09487461298704147,
-0.19643428921699524,
0.11586295068264008,
-0.3711091876029968,
-0.11895016580820084,
-0.41924595832824707,
0.21156620979309082,
0.06367284059524536,
0.1527549773454666,
0.4306328594684601,
0.37569138407707214,
-0.36890730261802673,
0.13200215995311737,
-0.199647918343544,
-0.253526896238327,
-0.16070158779621124,
0.16622406244277954,
-0.24934548139572144,
0.10293863713741302,
0.21545691788196564,
-0.19880840182304382,
-0.04823802411556244,
0.22924306988716125,
-0.08064506947994232,
-0.09766173362731934,
-0.10470722615718842,
0.1425643414258957,
0.27893882989883423,
0.5051390528678894,
-0.03592148795723915,
-0.42906564474105835,
-0.48385635018348694,
-0.26786503195762634,
-0.45135655999183655,
0.5694960355758667,
0.10621368139982224,
0.04738518223166466,
0.2677295207977295,
0.07072537392377853,
-0.16545608639717102,
-0.05267743766307831,
0.08744318783283234,
-0.10696873068809509,
0.07862264662981033,
-0.2782830595970154,
0.14746026694774628,
0.08192379027605057,
-0.1467856764793396,
0.1565798819065094,
-0.10632534325122833,
-0.1486501395702362,
-0.11109098792076111,
-0.22112232446670532,
0.00953797996044159,
0.10974272340536118,
0.04522300511598587,
0.05152605473995209,
0.2598116397857666,
0.1093570664525032,
-0.15146052837371826,
-0.2051747441291809,
0.09331657737493515,
0.5124964118003845,
0.2654922604560852,
0.21080949902534485,
-0.13537853956222534,
0.30614879727363586,
0.2869967520236969,
-0.05098021775484085,
-0.14835946261882782,
-0.02909984439611435,
-0.3221602439880371,
0.22019506990909576,
0.13944286108016968,
0.48974713683128357,
0.04258066415786743,
-0.1774202287197113,
0.005207721143960953,
0.14649371802806854,
0.01431279256939888,
-0.02935761772096157,
0.029516907408833504,
0.10649731755256653,
0.38419392704963684,
0.1992512196302414,
0.1673770397901535,
-0.06603997945785522,
-0.4921484589576721,
-0.0982092022895813,
-0.11926330626010895,
0.006537258625030518,
-0.098760224878788,
0.06706671416759491,
-0.0056222546845674515,
0.2673512101173401,
-0.2058984935283661,
-0.4314151406288147,
-0.02052253484725952,
0.08828295022249222,
0.0685807317495346,
-0.04496064782142639,
0.4631931781768799,
0.047051019966602325,
0.02510131150484085,
0.052261002361774445,
0.05931749939918518,
-0.015481792390346527,
0.35381847620010376,
-0.24750174582004547,
-0.4132179617881775,
-0.2120666205883026,
0.09699460119009018,
-0.3425389528274536,
0.10162979364395142,
-0.23719054460525513,
-0.083589106798172,
0.10820268094539642,
-0.2573734223842621,
-0.15367701649665833,
-0.08082391321659088,
-0.6031107902526855,
-0.21668294072151184,
-0.059861354529857635,
0.559276819229126,
-0.27264589071273804,
0.23595643043518066,
-0.33518385887145996,
-0.12725748121738434,
-0.08452054858207703,
-0.06899957358837128,
-0.20954585075378418,
0.1897011399269104,
-0.29933810234069824,
-0.09139708429574966,
0.582070529460907,
-0.35336577892303467,
-0.5385497212409973,
0.39355993270874023,
-0.2200486660003662,
0.20162856578826904,
0.3286589980125427,
0.04016530513763428,
0.12250633537769318,
-0.18407109379768372,
-0.17851397395133972,
0.06842255592346191,
-0.059115707874298096,
-0.17589187622070312,
-0.22418805956840515,
-0.13527539372444153,
0.17945903539657593,
-0.0001833215355873108,
-0.01340683177113533,
0.1402834951877594,
0.10238845646381378,
-0.07217514514923096,
0.08129099011421204,
0.14409324526786804,
0.12098319828510284,
0.04549145698547363,
0.05154009163379669,
0.10878325253725052,
0.0719076469540596,
-0.15576858818531036,
-0.5498517751693726,
0.35883376002311707,
-0.19065503776073456,
-0.20996640622615814,
-0.2951860725879669,
-0.09744267910718918,
-0.4188595712184906,
-0.0011325329542160034,
-0.3372759521007538,
-0.12374332547187805,
0.017180945724248886,
0.1366785615682602,
-0.17490792274475098,
0.12108772993087769,
-0.15608927607536316,
0.5555188655853271,
-0.22133207321166992,
0.10208560526371002,
-0.3911648690700531,
0.2904248833656311,
0.07647516578435898,
0.1943981945514679,
-0.039613027125597,
-0.10434000194072723,
0.2427605539560318,
-0.1156616061925888,
-0.2758926749229431,
0.6059426069259644,
0.1969713717699051,
0.19100892543792725,
-0.17666037380695343,
-0.06676150113344193,
0.09543363004922867,
0.1193203330039978,
0.2797023355960846,
0.10258760303258896,
-0.0364152193069458,
0.1032566949725151,
-0.012500414624810219,
0.37235721945762634,
0.09316731989383698,
-0.07266141474246979,
0.11243477463722229,
0.014670446515083313,
0.11679022014141083,
-0.022537454962730408,
-0.031521063297986984,
-0.17963959276676178,
-0.10876259952783585,
0.276658296585083,
-0.11207105219364166,
0.16356323659420013,
0.02186320722103119,
-0.09241697937250137,
0.8268387317657471,
0.09369267523288727,
0.2339756190776825,
0.10009926557540894,
-0.04520510882139206,
-0.06036337465047836,
0.02200690098106861,
0.7470212578773499,
0.48657092452049255,
0.15177589654922485,
0.04836427792906761,
0.35015207529067993,
0.18688443303108215,
-0.027290290221571922,
0.2156027853488922,
0.20735862851142883,
0.31310904026031494,
0.2575538456439972,
-0.04377732425928116,
0.03672671318054199,
-0.06311678141355515,
0.07123208045959473,
0.11284051835536957,
0.39569395780563354,
-0.3222472667694092,
-0.18972238898277283,
-0.30866917967796326,
0.24533456563949585,
-0.028020448982715607,
0.29806211590766907,
0.09678506851196289,
-0.19778987765312195,
-0.2268374264240265,
0.4179862439632416,
-0.01411079615354538,
0.21079286932945251,
-0.09306291490793228,
0.007841125130653381,
0.15947216749191284,
-0.1456451416015625,
0.17357593774795532,
-0.22790563106536865,
-0.26854103803634644,
-0.03381163999438286,
0.27933967113494873,
-0.056539136916399,
0.22606676816940308,
-0.1021827757358551,
-0.06749006360769272,
-0.16021180152893066,
-0.11885210871696472,
-0.16692981123924255,
-0.016314243897795677,
-0.12323057651519775,
0.44782668352127075,
0.11017928272485733,
0.06621140241622925,
0.06056710705161095,
0.26860731840133667,
-0.008506372570991516,
-0.29099661111831665,
0.1854790896177292,
-0.015574747696518898,
0.21821270883083344,
-0.07860012352466583,
-0.6077046394348145,
-0.11833834648132324,
-0.439264714717865,
0.2929480969905853,
-0.11588181555271149,
0.16779890656471252,
0.25575366616249084,
0.15400540828704834,
-0.17343786358833313,
0.29809698462486267,
0.019515328109264374,
-0.03102278895676136,
-0.2675783038139343,
0.10209442675113678,
-0.26059818267822266,
-0.11951210349798203,
0.08598802983760834,
-0.042143113911151886,
0.24449925124645233,
0.2563890218734741,
-0.4262794554233551,
-0.16325893998146057,
-0.005032682791352272,
0.00866701453924179,
-0.19269497692584991,
-0.14904367923736572,
0.46436214447021484,
0.1825302392244339,
0.013330686837434769,
-0.1592307686805725,
-0.036634013056755066,
0.3972250819206238,
-0.08456575125455856,
0.031948793679475784,
0.2459474503993988,
0.6158949136734009,
0.14874695241451263,
0.08452612906694412,
0.09288004040718079,
0.09139302372932434,
0.36993491649627686,
0.21145665645599365,
0.4501960575580597,
-0.22888414561748505,
-0.28444594144821167,
-0.357500284910202,
0.07753896713256836,
-0.020025230944156647,
-0.0388740673661232,
0.023640785366296768,
0.10481693595647812,
-0.3756689429283142,
-0.3534185290336609,
0.11262378841638565,
0.002121947705745697,
-0.30176591873168945,
0.053350355476140976,
0.40102970600128174,
0.05488039553165436,
0.27102187275886536,
-0.1894574761390686,
0.12410563975572586,
0.08681339770555496,
0.058235928416252136,
0.2484809160232544,
-0.1392003893852234,
-0.12468104064464569,
0.2885255515575409,
-0.1303567886352539,
0.3240315318107605,
0.14441348612308502,
0.3330978751182556,
0.12150170654058456,
-0.0652875006198883,
-0.05401366204023361,
-0.024427255615592003,
0.5780174732208252,
-0.28079837560653687,
0.3938522934913635,
0.34689292311668396,
0.0007366016507148743,
-0.44275426864624023,
0.029848560690879822,
0.1241958811879158,
-0.07009465247392654,
0.0563751719892025,
0.3307299315929413,
0.0679163932800293,
-0.2974563241004944,
0.32410427927970886,
0.09427935630083084,
-0.07056918740272522,
-0.16661939024925232,
-0.27912309765815735,
-0.33973586559295654,
-0.19954757392406464,
-0.19657176733016968,
0.011174716055393219,
0.2880113422870636,
-0.1350661814212799,
-0.26398783922195435,
-0.16055364906787872,
-0.159917414188385,
-0.2389450967311859,
-0.0691356509923935,
0.2516446113586426,
-0.0946296751499176,
0.24636892974376678,
-0.06859144568443298,
0.2711864709854126,
0.18104703724384308,
0.4245907664299011,
-0.2102399468421936,
-0.30882734060287476,
0.024358168244361877,
0.05662349984049797,
-0.20807383954524994,
0.12456996738910675,
-0.3242456912994385,
-0.12771199643611908,
-0.11327538639307022,
-0.018632665276527405,
-0.10351325571537018,
-0.2648654282093048,
0.3703452944755554,
-0.12930342555046082,
-0.014849107712507248,
-0.43056556582450867,
0.43132883310317993,
0.069488026201725,
-0.04838297516107559,
0.44733908772468567,
0.027506902813911438,
-0.15760692954063416,
0.03665466606616974,
-0.31707891821861267,
0.3679124712944031,
0.15903595089912415,
-0.00425579771399498,
0.4820447266101837,
-0.34339016675949097,
0.31405961513519287,
-0.035122912377119064,
-0.12152199447154999,
-0.244476318359375,
-0.14585967361927032,
-0.07862557470798492,
0.024865977466106415,
0.3537941575050354,
0.15219181776046753,
-0.07370269298553467,
0.32619208097457886,
-0.062028199434280396,
0.2920805513858795,
0.093894362449646,
0.21134555339813232,
-0.13996177911758423,
-0.01059589721262455,
-0.5017746686935425,
0.004954308271408081,
0.1257362961769104,
0.12365007400512695,
-0.007422979921102524,
-0.26841533184051514,
0.22355826199054718,
0.08108115196228027,
-0.04590582102537155,
0.09315335750579834,
-0.4215026795864105,
0.11747713387012482,
-0.20331096649169922,
-0.3411775231361389,
0.4051017165184021,
0.5930039882659912,
0.4606592357158661,
-0.09415386617183685,
-0.011935853399336338,
0.235207661986351,
-0.2505582869052887,
0.0005846917629241943,
0.1847953200340271,
0.2651645839214325,
0.1757163405418396,
-0.0656561478972435,
-0.08676392585039139,
0.1727840006351471,
-0.2688369154930115,
-0.05903339758515358,
0.25359269976615906,
-0.04945916682481766,
0.2647797763347626,
-0.4304753541946411,
-0.13454949855804443,
-0.28898680210113525,
-0.0474160797894001,
-0.2918664813041687,
0.03544093668460846,
-0.053864412009716034,
-0.0517520047724247,
-0.019723746925592422,
-0.4223434627056122,
-0.43567773699760437,
0.06867074221372604,
0.6714038848876953,
-0.007182619068771601,
0.13496346771717072,
0.49463340640068054,
0.005951307713985443,
0.05007099360227585,
-0.16608969867229462,
0.3912177085876465,
0.12759912014007568,
-0.18646103143692017,
0.4893603026866913,
0.30720221996307373,
0.24304598569869995,
0.09710422158241272,
0.20006495714187622,
-0.005715120118111372,
0.1423785388469696,
0.10348044335842133,
-0.2897859215736389,
-0.38447698950767517,
0.01655077189207077,
-0.06677794456481934,
-0.0381445549428463,
0.23777379095554352,
-0.05469072610139847,
-0.07850848138332367,
-0.40528202056884766,
-0.19736993312835693,
0.3045504093170166,
0.007781803607940674,
-0.183192640542984,
0.6249593496322632,
0.04415472596883774,
0.02944204956293106,
0.024253174662590027,
0.029419854283332825,
-0.01756591722369194,
-0.4087425470352173,
-0.06634702533483505,
-0.07962710410356522,
0.17287229001522064,
-0.04160168766975403,
-0.09357963502407074,
0.0019035525619983673,
-0.550927996635437,
-0.3792419135570526,
-0.06496640294790268,
0.21464359760284424,
0.29922348260879517,
0.003147333860397339,
0.20813912153244019,
-0.06359805911779404,
0.13609889149665833,
-0.25686484575271606,
0.2588888704776764,
-0.4714520275592804,
0.05671515688300133,
-0.11663389205932617,
0.24772687256336212,
0.1374809890985489,
-0.10232479125261307,
-0.226930171251297,
-0.03846373409032822,
-0.2288118600845337,
-0.11549751460552216,
0.561505913734436,
-0.2928142249584198,
-0.19399185478687286,
0.1814088672399521,
0.3266010284423828,
0.06555557996034622,
-0.09854486584663391,
-0.16146442294120789,
0.05334155261516571,
0.12187256664037704,
-0.39944207668304443,
0.02153737097978592,
0.300415575504303,
0.15479809045791626,
-0.032969288527965546,
0.11820968985557556,
0.23211374878883362,
-0.23410916328430176,
0.08406350016593933,
0.1996656358242035,
0.5123068690299988,
-0.35276272892951965,
0.46167120337486267,
0.6787008047103882,
0.2571547031402588,
0.12207449972629547,
0.09098019450902939,
0.16326580941677094,
0.26919206976890564,
0.7529910802841187,
-0.1471540778875351,
0.33336326479911804,
0.3663981854915619,
0.255936861038208,
-0.16989359259605408,
-0.6983917951583862,
-0.28487494587898254,
0.2738102674484253,
-0.13860391080379486,
0.03497812896966934,
-0.25825273990631104,
0.22145435214042664,
-0.2679949104785919,
-0.02172834798693657,
-0.1658240556716919,
0.1627037227153778,
-0.1600101888179779,
-0.07580776512622833,
-0.3041963577270508,
-0.27730435132980347,
-0.0854954794049263,
0.0923469066619873,
-0.0789836049079895,
-0.0038278568536043167,
-0.011382769793272018,
-0.09998960793018341,
-0.06491566449403763,
-0.29605475068092346,
-0.1480700671672821,
0.10475175082683563,
0.02057713083922863,
-0.4175446033477783,
0.3524835407733917,
0.3365403413772583,
0.007936058565974236,
0.23582372069358826,
0.11164089292287827,
0.4911203980445862,
0.2695732116699219,
0.034189481288194656,
-0.1855553388595581,
0.06068183481693268,
-0.06833505630493164,
-0.05790891498327255,
-0.03792676329612732,
-0.20840734243392944,
0.2307094931602478,
0.29344043135643005,
-0.02345072105526924,
0.015332300215959549,
-0.008747521787881851,
0.16298392415046692,
0.05475101247429848,
-0.6329203248023987,
0.23992156982421875,
-0.10830463469028473,
-0.20797625184059143,
-0.28670603036880493,
0.1363823115825653,
-0.05361339449882507,
-0.46850237250328064,
0.35688549280166626,
0.16357918083667755,
0.2031499445438385,
0.014026440680027008,
0.03860948979854584,
-0.2568782567977905,
0.2801409065723419,
0.2591364085674286,
-0.2827570140361786,
-0.20961454510688782,
-0.45781275629997253,
-0.7193721532821655,
-0.0042736344039440155,
0.022495383396744728,
-0.18383511900901794,
0.08114731311798096,
-0.18197955191135406,
0.02744760736823082,
-0.12056310474872589,
-0.1157766729593277,
0.35043367743492126,
0.38428980112075806,
-0.026857934892177582,
-0.33822011947631836,
-0.16906534135341644,
0.16778643429279327,
0.06432300806045532,
-0.16243258118629456,
-0.42264261841773987,
-0.02564283460378647,
-0.059354834258556366,
-0.05236398056149483,
0.15957875549793243,
0.06854843348264694,
-0.008364468812942505,
0.22437943518161774,
0.4305329918861389,
0.08995861560106277,
0.20332381129264832,
0.11165255308151245,
-0.0627509281039238,
-0.27356502413749695,
-0.014652037993073463,
-0.0773458331823349,
0.06731131672859192,
-0.07777620851993561,
0.4259633421897888,
-0.3261816203594208,
0.2748517394065857,
-0.19693879783153534,
0.29784172773361206,
-0.16043826937675476,
0.4679528772830963,
-0.2456691861152649,
0.13160249590873718,
0.07416118681430817,
0.04519268497824669,
0.33724844455718994,
-0.18159794807434082,
-0.07758379727602005,
0.24961701035499573,
-0.44938498735427856,
-0.27309083938598633,
0.4553574025630951,
-0.02992756851017475,
-0.27827370166778564,
-0.08408161997795105,
0.09889183193445206,
0.05041653290390968,
0.046393685042858124,
-0.18528065085411072,
0.07153350114822388,
0.43519556522369385,
0.12341083586215973,
-0.03708634153008461,
0.15254418551921844,
-0.11209367215633392,
0.03959333151578903,
0.2623855173587799,
0.009869813919067383,
-0.05364373326301575,
-0.32087087631225586,
0.02008439600467682,
-0.12891998887062073
] |
https://github.com/huggingface/datasets/issues/5710 | Hi! This error means that PyArrow's internal [`mmap`](https://man7.org/linux/man-pages/man2/mmap.2.html) call failed to allocate memory, which can be tricky to debug. Since this error is more related to PyArrow than us, I think it's best to report this issue in their [repo](https://github.com/apache/arrow) (they are more experienced on this matter). Also, googling "mmap cannot allocate memory" returns some approaches to solving this problem. | OSError: Memory mapping file failed: Cannot allocate memory | ### Describe the bug
Hello, I have a series of datasets each of 5 GB, 600 datasets in total. So together this makes 3TB.
When I trying to load all the 600 datasets into memory, I get the above error message.
Is this normal because I'm hitting the max size of memory mapping of the OS?
Thank you
```terminal
0_21/cache-e9c42499f65b1881.arrow
load_hf_datasets_from_disk: 82%|████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 494/600 [07:26<01:35, 1.11it/s]
Traceback (most recent call last):
File "example_load_genkalm_dataset.py", line 35, in <module>
multi_ds.post_process(max_node_num=args.max_node_num,max_seq_length=args.max_seq_length,delay=args.delay)
File "/home/geng/GenKaLM/src/dataloader/dataset.py", line 142, in post_process
genkalm_dataset = GenKaLM_Dataset.from_hf_dataset(path_or_name=ds_path, max_seq_length=self.max_seq_length,
File "/home/geng/GenKaLM/src/dataloader/dataset.py", line 47, in from_hf_dataset
hf_ds = load_from_disk(path_or_name)
File "/home/geng/.conda/envs/genkalm/lib/python3.8/site-packages/datasets/load.py", line 1848, in load_from_disk
return Dataset.load_from_disk(dataset_path, keep_in_memory=keep_in_memory, storage_options=storage_options)
File "/home/geng/.conda/envs/genkalm/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1549, in load_from_disk
arrow_table = concat_tables(
File "/home/geng/.conda/envs/genkalm/lib/python3.8/site-packages/datasets/table.py", line 1805, in concat_tables
tables = list(tables)
File "/home/geng/.conda/envs/genkalm/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1550, in <genexpr>
table_cls.from_file(Path(dataset_path, data_file["filename"]).as_posix())
File "/home/geng/.conda/envs/genkalm/lib/python3.8/site-packages/datasets/table.py", line 1065, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/geng/.conda/envs/genkalm/lib/python3.8/site-packages/datasets/table.py", line 50, in _memory_mapped_arrow_table_from_file
memory_mapped_stream = pa.memory_map(filename)
File "pyarrow/io.pxi", line 950, in pyarrow.lib.memory_map
File "pyarrow/io.pxi", line 911, in pyarrow.lib.MemoryMappedFile._open
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 115, in pyarrow.lib.check_status
OSError: Memory mapping file failed: Cannot allocate memory
```
### Steps to reproduce the bug
Sorry I can not provide a reproducible code as the data is stored on my server and it's too large to share.
### Expected behavior
I expect the 3TB of data can be fully mapped to memory
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-4.15.0-204-generic-x86_64-with-debian-buster-sid
- Python version: 3.7.6
- PyArrow version: 11.0.0
- Pandas version: 1.0.1 | 60 | OSError: Memory mapping file failed: Cannot allocate memory
### Describe the bug
Hello, I have a series of datasets each of 5 GB, 600 datasets in total. So together this makes 3TB.
When I trying to load all the 600 datasets into memory, I get the above error message.
Is this normal because I'm hitting the max size of memory mapping of the OS?
Thank you
```terminal
0_21/cache-e9c42499f65b1881.arrow
load_hf_datasets_from_disk: 82%|████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 494/600 [07:26<01:35, 1.11it/s]
Traceback (most recent call last):
File "example_load_genkalm_dataset.py", line 35, in <module>
multi_ds.post_process(max_node_num=args.max_node_num,max_seq_length=args.max_seq_length,delay=args.delay)
File "/home/geng/GenKaLM/src/dataloader/dataset.py", line 142, in post_process
genkalm_dataset = GenKaLM_Dataset.from_hf_dataset(path_or_name=ds_path, max_seq_length=self.max_seq_length,
File "/home/geng/GenKaLM/src/dataloader/dataset.py", line 47, in from_hf_dataset
hf_ds = load_from_disk(path_or_name)
File "/home/geng/.conda/envs/genkalm/lib/python3.8/site-packages/datasets/load.py", line 1848, in load_from_disk
return Dataset.load_from_disk(dataset_path, keep_in_memory=keep_in_memory, storage_options=storage_options)
File "/home/geng/.conda/envs/genkalm/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1549, in load_from_disk
arrow_table = concat_tables(
File "/home/geng/.conda/envs/genkalm/lib/python3.8/site-packages/datasets/table.py", line 1805, in concat_tables
tables = list(tables)
File "/home/geng/.conda/envs/genkalm/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1550, in <genexpr>
table_cls.from_file(Path(dataset_path, data_file["filename"]).as_posix())
File "/home/geng/.conda/envs/genkalm/lib/python3.8/site-packages/datasets/table.py", line 1065, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/geng/.conda/envs/genkalm/lib/python3.8/site-packages/datasets/table.py", line 50, in _memory_mapped_arrow_table_from_file
memory_mapped_stream = pa.memory_map(filename)
File "pyarrow/io.pxi", line 950, in pyarrow.lib.memory_map
File "pyarrow/io.pxi", line 911, in pyarrow.lib.MemoryMappedFile._open
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 115, in pyarrow.lib.check_status
OSError: Memory mapping file failed: Cannot allocate memory
```
### Steps to reproduce the bug
Sorry I can not provide a reproducible code as the data is stored on my server and it's too large to share.
### Expected behavior
I expect the 3TB of data can be fully mapped to memory
### Environment info
- `datasets` version: 2.9.0
- Platform: Linux-4.15.0-204-generic-x86_64-with-debian-buster-sid
- Python version: 3.7.6
- PyArrow version: 11.0.0
- Pandas version: 1.0.1
Hi! This error means that PyArrow's internal [`mmap`](https://man7.org/linux/man-pages/man2/mmap.2.html) call failed to allocate memory, which can be tricky to debug. Since this error is more related to PyArrow than us, I think it's best to report this issue in their [repo](https://github.com/apache/arrow) (they are more experienced on this matter). Also, googling "mmap cannot allocate memory" returns some approaches to solving this problem. | [
-0.12390999495983124,
-0.45371362566947937,
-0.03239832818508148,
0.634951114654541,
0.3504887521266937,
0.07127010822296143,
-0.1335451453924179,
0.3299615979194641,
0.4003358483314514,
0.19658923149108887,
-0.004465721547603607,
0.01819867640733719,
-0.25141748785972595,
-0.27970999479293823,
-0.06374026834964752,
-0.0005336496978998184,
0.022168278694152832,
-0.09841743111610413,
-0.4364859461784363,
0.13363945484161377,
-0.565915584564209,
0.15594100952148438,
-0.021690957248210907,
-0.06530947238206863,
-0.24238821864128113,
0.06132671236991882,
-0.1609465330839157,
0.24490508437156677,
-0.10567747056484222,
-0.4016323387622833,
0.06281714886426926,
-0.343137264251709,
-0.026725098490715027,
0.5579981803894043,
-0.00011862316750921309,
-0.0059856027364730835,
0.26102179288864136,
-0.11327328532934189,
-0.08657656610012054,
0.050040531903505325,
-0.2128446102142334,
-0.1434919834136963,
-0.07839159667491913,
-0.046067073941230774,
0.28409796953201294,
0.0840553417801857,
-0.001741921529173851,
-0.5760664939880371,
0.30123746395111084,
0.35153433680534363,
0.20358844101428986,
0.015154257416725159,
0.43937188386917114,
-0.09639661759138107,
0.32918643951416016,
0.017862096428871155,
0.09431085735559464,
0.4728694260120392,
0.22511820495128632,
-0.30390802025794983,
0.08960700035095215,
0.039872754365205765,
0.09009557962417603,
0.24715577065944672,
0.42617806792259216,
-0.16736656427383423,
0.3892461061477661,
-0.40224555134773254,
0.0128787811845541,
0.008022777736186981,
0.5025281310081482,
-0.09670118987560272,
-0.1475829929113388,
0.04639174044132233,
-0.14428681135177612,
-0.5285516977310181,
0.18484251201152802,
0.45545583963394165,
-0.5012712478637695,
-0.1772828847169876,
-0.08308178186416626,
-0.20127803087234497,
-0.0656968504190445,
0.21896547079086304,
-0.325298011302948,
0.03700858727097511,
-0.09229854494333267,
0.18654608726501465,
0.47500723600387573,
-0.2539215385913849,
-0.035925835371017456,
0.0030314065515995026,
-0.09581851214170456,
0.1299232542514801,
-0.5841144919395447,
0.048361897468566895,
-0.17299386858940125,
-0.19907613098621368,
0.2599532902240753,
-0.32524925470352173,
0.04665931686758995,
-0.23060870170593262,
-0.04304666444659233,
0.09327481687068939,
0.36560043692588806,
0.2814062833786011,
-0.40276750922203064,
0.38745391368865967,
-0.01751820743083954,
-0.10426972061395645,
-0.2922038435935974,
-0.11005298793315887,
-0.04862228035926819,
-0.2887120544910431,
0.0584210604429245,
-0.30222269892692566,
0.13473065197467804,
-0.08814974129199982,
-0.1958947479724884,
0.03457777574658394,
-0.12388009577989578,
0.1958015263080597,
-0.12235456705093384,
0.410299688577652,
0.1676216423511505,
0.09519121050834656,
0.16572441160678864,
0.1595587432384491,
-0.11542860418558121,
0.03319839388132095,
-0.10655966401100159,
0.06431979686021805,
-0.3629291355609894,
0.2308264970779419,
-0.12312249839305878,
0.18276503682136536,
0.023106269538402557,
-0.11960598826408386,
-0.07070237398147583,
-0.28156936168670654,
0.10893328487873077,
-0.2609470784664154,
0.14144039154052734,
0.2490735948085785,
-0.19775375723838806,
0.11974886804819107,
0.3632358908653259,
0.35107481479644775,
-0.13026021420955658,
0.5278728604316711,
-0.5018830895423889,
-0.351473331451416,
-0.014795396476984024,
0.1359533965587616,
0.2300829142332077,
0.03495994210243225,
-0.300506055355072,
-0.17334279417991638,
0.6004733443260193,
-0.047666192054748535,
0.11239629238843918,
-0.2330104261636734,
-0.14833037555217743,
-0.1862785965204239,
-0.07406752556562424,
0.4906925559043884,
-0.12516871094703674,
0.11540266871452332,
-0.02455603890120983,
0.15572769939899445,
0.39230430126190186,
0.5422828197479248,
-0.0488751158118248,
0.043293680995702744,
-0.3360198438167572,
-0.24812352657318115,
0.19708865880966187,
0.08415942639112473,
-0.40049707889556885,
0.14986711740493774,
-0.03370312601327896,
-0.15732130408287048,
-0.06244361400604248,
0.07990305125713348,
-0.04711250960826874,
0.2517627477645874,
0.18696871399879456,
0.06403560936450958,
0.020329033955931664,
0.263412743806839,
-0.373290479183197,
-0.15419864654541016,
0.000430205836892128,
0.08569296449422836,
0.15643495321273804,
0.038019731640815735,
0.1779116541147232,
0.01833176612854004,
0.37399163842201233,
-0.08355174958705902,
0.1063852533698082,
0.33080172538757324,
0.20405976474285126,
-0.11039863526821136,
0.09721742570400238,
-0.17601817846298218,
-0.057196520268917084,
0.1666855812072754,
-0.12290462851524353,
-0.019760670140385628,
0.06961649656295776,
0.20923438668251038,
0.05606935918331146,
0.03753416985273361,
-0.16375792026519775,
0.03126974776387215,
0.038673292845487595,
0.039842426776885986,
-0.17494413256645203,
-0.15898075699806213,
0.07530602067708969,
0.1486544907093048,
-0.16947603225708008,
0.15339989960193634,
-0.3384823203086853,
0.2934373617172241,
-0.12269409000873566,
-0.09208223223686218,
-0.21174003183841705,
-0.1911429911851883,
-0.13269922137260437,
0.004461079835891724,
-0.22990277409553528,
0.11507979035377502,
0.301294207572937,
-0.2550877332687378,
-0.27531278133392334,
0.07264736294746399,
0.07446425408124924,
-0.1521274298429489,
0.14290815591812134,
0.013493139296770096,
0.11962345242500305,
-0.15351925790309906,
0.21117769181728363,
-0.206208735704422,
0.11109000444412231,
0.36940789222717285,
-0.03148394823074341,
0.12672443687915802,
-0.0909770056605339,
0.08479845523834229,
0.3570864498615265,
-0.05718446895480156,
0.3090214133262634,
-0.06754817813634872,
0.1345098316669464,
0.0512208566069603,
0.07326266169548035,
-0.38876625895500183,
0.23776356875896454,
0.1596149355173111,
0.20385895669460297,
0.2699621617794037,
-0.0971866026520729,
0.04531528055667877,
-0.02428046241402626,
0.04467862844467163,
0.5208183526992798,
0.041008107364177704,
-0.04036537930369377,
0.02549000270664692,
0.35836514830589294,
0.07737627625465393,
0.060861602425575256,
0.06769432127475739,
0.5307966470718384,
0.1695057451725006,
-0.01421339251101017,
0.045361269265413284,
-0.09916657954454422,
-0.13238750398159027,
0.2107054889202118,
0.44244807958602905,
-0.34284406900405884,
-0.08505530655384064,
-0.013224761933088303,
-0.0804038941860199,
-0.14380890130996704,
0.14404678344726562,
-0.3669476807117462,
-0.1480793058872223,
-0.3499128520488739,
0.07674316316843033,
-0.031845301389694214,
0.033100537955760956,
-0.0794433206319809,
0.22882327437400818,
0.38056519627571106,
-0.08698035776615143,
0.1900320202112198,
0.05510590225458145,
0.09813381731510162,
-0.027989277616143227,
0.4366230070590973,
-0.3781191110610962,
0.1107439398765564,
0.13573655486106873,
-0.16367700695991516,
-0.12061106413602829,
0.11443345248699188,
0.06004222482442856,
0.04880784824490547,
-0.16064384579658508,
-0.14213719964027405,
0.40654027462005615,
-0.11138392984867096,
-0.03818162530660629,
0.13491538166999817,
-0.11255858093500137,
-0.3551222085952759,
0.18950733542442322,
0.09078523516654968,
0.05822594836354256,
-0.038813866674900055,
-0.0423705019056797,
-0.3295155465602875,
-0.6482266187667847,
0.34568580985069275,
0.03550812602043152,
0.3685086667537689,
0.3346250057220459,
0.16271959245204926,
-0.0013909488916397095,
-0.21525642275810242,
-0.00495210662484169,
-0.1383727341890335,
-0.08223793655633926,
0.08474947512149811,
-0.18149533867835999,
-0.08150485157966614,
-0.0007806196808815002,
0.127104714512825,
0.33395570516586304,
0.3546695113182068,
-0.7599276304244995,
-0.023273438215255737,
-0.43863558769226074,
-0.0017410442233085632,
-0.4277486801147461,
0.15566472709178925,
0.07715210318565369,
-0.19122196733951569,
-0.03859153389930725,
0.1408919394016266,
-0.053161658346652985,
-0.17884060740470886,
0.31785520911216736,
0.24353355169296265,
0.19412276148796082,
0.3642888069152832,
0.045282840728759766,
0.5907279849052429,
0.5085004568099976,
0.1826249063014984,
0.5217302441596985,
-0.048982374370098114,
0.15659409761428833,
-0.3017101287841797,
-0.23466183245182037,
0.010713014751672745,
-0.11609894037246704,
-0.13679659366607666,
0.15830105543136597,
-0.03804982453584671,
-0.29179292917251587,
0.050552308559417725,
-0.0103597491979599,
-0.10009375214576721,
-0.14834949374198914,
0.3178569972515106,
-0.35310545563697815,
0.15756869316101074,
-0.25541019439697266,
-0.21366822719573975,
-0.04025261849164963,
-0.059760384261608124,
0.06003151088953018,
-0.05906039476394653,
0.1109451949596405,
0.07175032794475555,
-0.2007085084915161,
-0.02265274152159691,
-0.34911465644836426,
0.3573169708251953,
-0.13055169582366943,
0.20872946083545685,
-0.17782655358314514,
0.07522441446781158,
0.0027480535209178925,
0.13772474229335785,
0.7678788900375366,
0.012340730056166649,
-0.11134663224220276,
0.06512017548084259,
-0.07606382668018341,
-0.4018228352069855,
0.05323775112628937,
0.05449286848306656,
0.2955775260925293,
0.03707379475235939,
0.4423997700214386,
-0.16056591272354126,
0.14269950985908508,
-0.05437879264354706,
0.26622268557548523,
-0.14029386639595032,
-0.4467463493347168,
-0.18253719806671143,
-0.22861447930335999,
-0.302412748336792,
0.011564686894416809,
0.25215452909469604,
0.3083435297012329,
0.24590153992176056,
-0.11521642655134201,
0.02478291280567646,
0.00016370415687561035,
0.1108865886926651,
-0.31423190236091614,
0.2629380524158478,
0.14294195175170898,
0.15236632525920868,
0.04695221036672592,
0.017938576638698578,
0.5056753754615784,
0.8632038831710815,
-0.07142142951488495,
-0.038340307772159576,
0.1653466522693634,
-0.014604389667510986,
0.17745620012283325,
0.17647495865821838,
0.25180724263191223,
-0.031330619007349014,
-0.0862375795841217,
0.24341550469398499,
0.012981496751308441,
0.005559995770454407,
0.17909589409828186,
0.02557425945997238,
-0.4093342423439026,
-0.20137333869934082,
0.32675766944885254,
0.14703884720802307,
0.18595531582832336,
0.6311562061309814,
-0.13663709163665771,
-0.28891804814338684,
0.36253923177719116,
0.1509280502796173,
0.8564048409461975,
-0.4739394187927246,
0.26645031571388245,
-0.14635789394378662,
0.1989871859550476,
0.30547091364860535,
0.037099435925483704,
0.29196205735206604,
-0.42344051599502563,
-0.3446788489818573,
0.12915611267089844,
-0.339455246925354,
-0.008809790015220642,
0.1270618438720703,
-0.14688633382320404,
0.13162030279636383,
-0.02396780252456665,
0.05721543729305267,
-0.0689416378736496,
-0.01802031695842743,
-0.20294834673404694,
-0.19756615161895752,
-0.031011763960123062,
0.13969705998897552,
-0.27505651116371155,
0.1379362940788269,
-0.08390313386917114,
0.03387882560491562,
-0.016212180256843567,
-0.1327190101146698,
-0.36824601888656616,
0.01863115280866623,
-0.5848374962806702,
0.2171824425458908,
-0.09823954105377197,
0.08648405969142914,
0.06293432414531708,
0.3386092782020569,
-0.33107537031173706,
0.18356218934059143,
-0.062100693583488464,
-0.056871552020311356,
0.06154309958219528,
-0.07718515396118164,
-0.0771586149930954,
0.0693168044090271,
0.15316879749298096,
-0.18426665663719177,
-0.20111022889614105,
0.13394509255886078,
-0.21314382553100586,
-0.44358745217323303,
-0.19317477941513062,
0.3119078576564789,
0.11344210803508759,
-0.09448982030153275,
-0.30108746886253357,
-0.1824989914894104,
-0.21126940846443176,
0.04506479948759079,
0.07981650531291962,
0.14292128384113312,
-0.20406471192836761,
0.40728771686553955,
-0.09844603389501572,
-0.5088163614273071,
-0.10135652124881744,
0.36173468828201294,
0.0435866117477417,
0.005635105073451996,
0.49508002400398254,
0.07589998841285706,
0.034082844853401184,
-0.10891806334257126,
0.2580679655075073,
0.3541699945926666,
-0.3445478081703186,
0.21672196686267853,
-0.13797935843467712,
0.18154098093509674,
-0.06918811053037643,
-0.16726192831993103,
0.47233185172080994,
0.1765778809785843,
0.02141796052455902,
-0.3735039234161377,
-0.48547154664993286,
0.1982118785381317,
-0.19880753755569458,
0.20711582899093628,
-0.3012305796146393,
-0.3435411751270294,
-0.051078081130981445,
0.07630994915962219,
-0.20624488592147827,
0.17088976502418518,
-0.0783296450972557,
-0.018301958218216896,
0.009620022028684616,
-0.11695130169391632,
-0.023318611085414886,
-0.02166198194026947,
0.038202788680791855,
0.22221703827381134,
-0.07781428098678589,
-0.1908167600631714,
0.1626361906528473,
0.12134364992380142,
0.16300591826438904,
-0.2424383908510208,
0.11010278761386871,
-0.63838791847229,
-0.12047119438648224,
-0.28608593344688416,
0.0737600028514862,
0.23450994491577148,
-0.2412591576576233,
-0.1265311986207962,
0.39611420035362244,
-0.13863831758499146,
0.06703115999698639,
0.5079113245010376,
0.018694378435611725,
0.2127559930086136,
0.06957808136940002,
0.19652676582336426,
0.2100764513015747,
-0.11114012449979782,
-0.40034782886505127,
0.12088564783334732,
-0.24912068247795105,
-0.21195410192012787,
0.22174708545207977,
-0.4436158835887909,
-0.0677788034081459,
0.17918579280376434,
0.3670155107975006,
0.3755756914615631,
-0.3386175334453583,
0.261890172958374,
0.1514350324869156,
0.17141591012477875,
0.10171905159950256,
-0.08259283006191254,
0.18188965320587158,
0.08339808881282806,
-0.147186279296875,
0.36074504256248474,
0.08482158184051514,
-0.48307526111602783,
-0.06455264985561371,
0.029065284878015518,
0.3361111879348755,
-0.03530760109424591,
0.036827556788921356,
0.20396214723587036,
0.034342579543590546,
-0.15165099501609802,
0.26631978154182434,
0.4566687345504761,
0.25801753997802734,
0.3209405541419983,
-0.003928396850824356,
0.1166517585515976,
0.028228025883436203,
-0.1178617775440216,
-0.04792914539575577,
-0.644631028175354,
0.09874261915683746,
0.3385193943977356,
-0.2974840998649597,
0.3134128153324127,
-0.16095122694969177,
-0.006616707891225815,
-0.07666654884815216,
-0.47908729314804077,
-0.11346232891082764,
-0.06819239258766174,
-0.32081103324890137,
0.2877395749092102,
0.030088402330875397,
-0.02988429367542267,
-0.1557495892047882,
-0.004005357623100281,
-0.0511113777756691,
-0.523398220539093,
0.4564380645751953,
0.045379795134067535,
-0.3232297897338867,
-0.04906211048364639,
0.08471423387527466,
0.4257533848285675,
0.008096490055322647,
-0.5478173494338989,
0.32308676838874817,
0.03659169003367424,
0.036232899874448776,
-0.0235875453799963,
0.25486868619918823,
0.5755578875541687,
0.658782422542572,
-0.13494601845741272,
0.22668685019016266,
0.12211276590824127,
-0.022650007158517838,
-0.20939595997333527,
0.04231848195195198,
0.11705123633146286,
0.14327041804790497,
0.34761515259742737,
0.02601676434278488,
-0.08730530738830566,
-0.007573855109512806,
0.11549799144268036,
0.4264470934867859,
-0.21878638863563538,
-0.10731735825538635,
-0.2366700917482376,
-0.2816445827484131,
0.058652494102716446,
0.1645507663488388,
-0.6572855114936829,
0.10029736161231995,
0.4131172299385071,
-0.270173579454422,
0.15943050384521484,
0.30353033542633057,
0.004699379205703735,
-0.21365925669670105,
0.3931075930595398,
0.47974011301994324,
0.16400061547756195,
-0.40025269985198975,
-0.08177036046981812,
-0.3710460662841797,
0.367162823677063,
-0.41007760167121887,
0.13951066136360168,
0.15517276525497437,
0.10324621945619583,
0.06931163370609283,
-0.11455662548542023,
0.0014270022511482239,
-0.16723544895648956,
-0.18767830729484558,
0.42708975076675415,
-0.30183786153793335,
-0.44141459465026855,
0.22025717794895172,
0.16412508487701416,
0.18295225501060486,
-0.4138800799846649,
0.35442399978637695,
-0.42013856768608093,
-0.035415973514318466,
-0.021235555410385132,
0.015219226479530334,
-0.025238454341888428,
0.2914575934410095,
0.35098162293434143,
0.08858384937047958,
0.5358509421348572,
0.06072625517845154,
-0.4247943162918091,
-0.2256494164466858,
-0.48699715733528137,
-0.0819992870092392,
0.08920913934707642,
0.07086004316806793,
0.4513162076473236,
-0.17105382680892944,
-0.4526790380477905,
-0.2796020209789276,
0.09727820754051208,
-0.24787046015262604,
0.05448909103870392,
0.25273215770721436,
-0.017801828682422638,
0.23350407183170319,
-0.1024957150220871,
0.31149426102638245,
0.1186532974243164,
0.018137045204639435,
0.06536851823329926,
-0.20099592208862305,
-0.22236286103725433,
0.33348673582077026,
-0.08464876562356949,
-0.275687575340271,
-0.04848608002066612,
0.1797553300857544,
-0.04985715448856354,
-0.0856894850730896,
-0.4363515377044678,
0.06295305490493774,
0.4839818775653839,
-0.09460082650184631,
-0.4111171364784241,
0.054528236389160156,
-0.3514247536659241,
0.04217575490474701,
0.03456587344408035,
0.43857911229133606,
-0.11091609299182892,
-0.374127060174942,
0.1568595916032791,
-0.15464776754379272
] |
https://github.com/huggingface/datasets/issues/5709 | hi @jplu ! Did I understand you correctly that you create the dataset, push it to the Hub with `.push_to_hub` and you see a `dataset_infos.json` file there, then you edit this file, load the dataset with `load_dataset` and you don't see any changes in `.info` attribute of a dataset object?
This is actually weird that when you push your dataset to the Hub, a `dataset_infos.json` file is created, because this file is deprecated and it should create `README.md` with the `dataset_info` field instead. Some keys are also deprecated, like "supervised_keys" and "task_templates".
Can you please provide a toy reproducible example of how you create and push the dataset? And also why do you want to change this file, especially the number of bytes and examples? | Manually dataset info made not taken into account | ### Describe the bug
Hello,
I'm manually building an image dataset with the `from_dict` approach. I also build the features with the `cast_features` methods. Once the dataset is created I push it on the hub, and a default `dataset_infos.json` file seems to have been automatically added to the repo in same time. Hence I update it manually with all the missing info, but when I download the dataset the info are never updated.
Former `dataset_infos.json` file:
```
{"default": {
"description": "",
"citation": "",
"homepage": "",
"license": "",
"features": {
"image": {
"_type": "Image"
},
"labels": {
"names": [
"Fake",
"Real"
],
"_type": "ClassLabel"
}
},
"splits": {
"validation": {
"name": "validation",
"num_bytes": 901010094.0,
"num_examples": 3200,
"dataset_name": null
},
"train": {
"name": "train",
"num_bytes": 901010094.0,
"num_examples": 3200,
"dataset_name": null
}
},
"download_size": 1802008414,
"dataset_size": 1802020188.0,
"size_in_bytes": 3604028602.0
}}
```
After I update it manually it looks like:
```
{
"bstrai--deepfake-detection":{
"description":"",
"citation":"",
"homepage":"",
"license":"",
"features":{
"image":{
"decode":true,
"id":null,
"_type":"Image"
},
"labels":{
"num_classes":2,
"names":[
"Fake",
"Real"
],
"id":null,
"_type":"ClassLabel"
}
},
"supervised_keys":{
"input":"image",
"output":"labels"
},
"task_templates":[
{
"task":"image-classification",
"image_column":"image",
"label_column":"labels"
}
],
"config_name":null,
"splits":{
"validation":{
"name":"validation",
"num_bytes":36627822,
"num_examples":123,
"dataset_name":"deepfake-detection"
},
"train":{
"name":"train",
"num_bytes":901023694,
"num_examples":3200,
"dataset_name":"deepfake-detection"
}
},
"download_checksums":null,
"download_size":937562209,
"dataset_size":937651516,
"size_in_bytes":1875213725
}
}
```
Anything I should do to have the new infos in the `dataset_infos.json` to be taken into account? Or it is not possible yet?
Thanks!
### Steps to reproduce the bug
-
### Expected behavior
-
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
- Python version: 3.10.10
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 2.0.0 | 125 | Manually dataset info made not taken into account
### Describe the bug
Hello,
I'm manually building an image dataset with the `from_dict` approach. I also build the features with the `cast_features` methods. Once the dataset is created I push it on the hub, and a default `dataset_infos.json` file seems to have been automatically added to the repo in same time. Hence I update it manually with all the missing info, but when I download the dataset the info are never updated.
Former `dataset_infos.json` file:
```
{"default": {
"description": "",
"citation": "",
"homepage": "",
"license": "",
"features": {
"image": {
"_type": "Image"
},
"labels": {
"names": [
"Fake",
"Real"
],
"_type": "ClassLabel"
}
},
"splits": {
"validation": {
"name": "validation",
"num_bytes": 901010094.0,
"num_examples": 3200,
"dataset_name": null
},
"train": {
"name": "train",
"num_bytes": 901010094.0,
"num_examples": 3200,
"dataset_name": null
}
},
"download_size": 1802008414,
"dataset_size": 1802020188.0,
"size_in_bytes": 3604028602.0
}}
```
After I update it manually it looks like:
```
{
"bstrai--deepfake-detection":{
"description":"",
"citation":"",
"homepage":"",
"license":"",
"features":{
"image":{
"decode":true,
"id":null,
"_type":"Image"
},
"labels":{
"num_classes":2,
"names":[
"Fake",
"Real"
],
"id":null,
"_type":"ClassLabel"
}
},
"supervised_keys":{
"input":"image",
"output":"labels"
},
"task_templates":[
{
"task":"image-classification",
"image_column":"image",
"label_column":"labels"
}
],
"config_name":null,
"splits":{
"validation":{
"name":"validation",
"num_bytes":36627822,
"num_examples":123,
"dataset_name":"deepfake-detection"
},
"train":{
"name":"train",
"num_bytes":901023694,
"num_examples":3200,
"dataset_name":"deepfake-detection"
}
},
"download_checksums":null,
"download_size":937562209,
"dataset_size":937651516,
"size_in_bytes":1875213725
}
}
```
Anything I should do to have the new infos in the `dataset_infos.json` to be taken into account? Or it is not possible yet?
Thanks!
### Steps to reproduce the bug
-
### Expected behavior
-
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
- Python version: 3.10.10
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 2.0.0
hi @jplu ! Did I understand you correctly that you create the dataset, push it to the Hub with `.push_to_hub` and you see a `dataset_infos.json` file there, then you edit this file, load the dataset with `load_dataset` and you don't see any changes in `.info` attribute of a dataset object?
This is actually weird that when you push your dataset to the Hub, a `dataset_infos.json` file is created, because this file is deprecated and it should create `README.md` with the `dataset_info` field instead. Some keys are also deprecated, like "supervised_keys" and "task_templates".
Can you please provide a toy reproducible example of how you create and push the dataset? And also why do you want to change this file, especially the number of bytes and examples? | [
-0.2274862825870514,
-0.0038239210844039917,
-0.03542531281709671,
0.2053673267364502,
0.16327960789203644,
0.12050522118806839,
0.18317842483520508,
0.11353832483291626,
-0.0990067645907402,
0.09088581800460815,
0.1578717827796936,
0.3468891978263855,
0.228308767080307,
0.3312079608440399,
-0.13989953696727753,
0.48101961612701416,
0.18140432238578796,
0.12322694063186646,
0.24489128589630127,
-0.19651487469673157,
-0.20508910715579987,
0.0645248293876648,
-0.0764082819223404,
-0.4095873236656189,
-0.49168500304222107,
0.06107603758573532,
-0.08332213759422302,
0.15466471016407013,
-0.22077949345111847,
-0.2847859859466553,
0.3322944641113281,
0.3391745984554291,
0.008055463433265686,
0.17504237592220306,
-0.00012450863141566515,
0.0277596116065979,
0.43252435326576233,
-0.27312856912612915,
-0.3182888925075531,
0.3313118815422058,
-0.6923757791519165,
-0.3077927529811859,
-0.16381873190402985,
-0.2790791392326355,
-0.1411571353673935,
-0.03707687556743622,
0.06371555477380753,
0.03558366745710373,
0.2192663550376892,
-0.03191816061735153,
0.07939515262842178,
-0.06017017364501953,
0.23458755016326904,
0.014217458665370941,
0.20430895686149597,
0.5831658840179443,
-0.20332594215869904,
-0.045472078025341034,
-0.20578980445861816,
0.4126407206058502,
0.13416151702404022,
0.46031665802001953,
0.0605989471077919,
-0.06338228285312653,
0.20528759062290192,
0.07936625182628632,
-0.0440613329410553,
-0.30137985944747925,
0.023622598499059677,
0.2281610369682312,
0.47205162048339844,
-0.2669832408428192,
-0.4510105848312378,
-0.4718325138092041,
-0.07321103662252426,
-0.2300637662410736,
0.23007136583328247,
0.04334837198257446,
-0.0873849093914032,
0.14575918018817902,
-0.4366820454597473,
-0.3864085376262665,
0.0884370356798172,
0.01826503314077854,
-0.06249941140413284,
-0.03485536575317383,
0.022878490388393402,
0.0720377266407013,
-0.3387850821018219,
-0.08931708335876465,
0.2353210598230362,
-0.519016683101654,
-0.23528143763542175,
-0.00037082284688949585,
0.2260599285364151,
-0.10141538828611374,
0.23418352007865906,
-0.14882723987102509,
0.10939566791057587,
0.16893917322158813,
-0.11795776337385178,
0.19011138379573822,
-0.6943354606628418,
0.045544762164354324,
0.25111833214759827,
0.09898844361305237,
0.08475618064403534,
0.3038919270038605,
0.2710413634777069,
0.21117928624153137,
0.03511461615562439,
-0.06194093078374863,
0.021051008254289627,
0.29430001974105835,
0.2552717924118042,
-0.08722627907991409,
0.40183916687965393,
-0.09700435400009155,
-0.05561577528715134,
-0.014735428616404533,
-0.059976425021886826,
0.05325733497738838,
-0.06996332108974457,
0.04616832733154297,
-0.30254366993904114,
0.03974387049674988,
-0.06840936839580536,
0.09866993129253387,
-0.029244139790534973,
0.10238534957170486,
-0.23629701137542725,
-0.3060005009174347,
0.0410664826631546,
0.03381308168172836,
0.11977380514144897,
0.04078176990151405,
0.4167563319206238,
0.11248177289962769,
-0.16427463293075562,
-0.11523424088954926,
-0.2043699026107788,
-0.1464766263961792,
0.2464544028043747,
0.435968816280365,
-0.04731011018157005,
0.22348368167877197,
-0.2820214331150055,
-0.20323407649993896,
-0.22932171821594238,
0.38844990730285645,
-0.5556222796440125,
-0.19218844175338745,
-0.0447775200009346,
0.05315981060266495,
-0.3679402768611908,
-0.03853679448366165,
-0.2520206868648529,
0.31154024600982666,
0.22261744737625122,
-0.2250145673751831,
-0.1409735083580017,
-0.049906760454177856,
-0.30598315596580505,
-0.14247989654541016,
0.35876476764678955,
0.45479312539100647,
-0.2902078330516815,
-0.11731468141078949,
-0.26598161458969116,
0.11257056891918182,
-0.05174731835722923,
-0.0582643561065197,
-0.20079579949378967,
0.5759897828102112,
-0.2953609824180603,
0.18098384141921997,
0.2908209562301636,
-0.3071495592594147,
-0.5576926469802856,
0.14464128017425537,
0.15384864807128906,
0.2054145187139511,
0.022040119394659996,
0.33170583844184875,
0.4006308913230896,
0.016158882528543472,
-0.04268580675125122,
0.4085296094417572,
-0.08935051411390305,
0.09027046710252762,
-0.010144457221031189,
-0.48278069496154785,
-0.21772490441799164,
0.03267543017864227,
0.17850559949874878,
0.2487851232290268,
0.1870042234659195,
0.352383017539978,
0.33862316608428955,
0.21672797203063965,
0.1705860048532486,
0.40613794326782227,
0.3900788426399231,
-0.20540273189544678,
0.03828561678528786,
0.04954686760902405,
-0.4193124771118164,
0.36420688033103943,
0.28355124592781067,
0.08698233217000961,
-0.3983067572116852,
-0.09422376751899719,
-0.29255378246307373,
-0.10389421880245209,
-0.42003440856933594,
-0.1282225102186203,
0.048521146178245544,
0.43375393748283386,
-0.2606038451194763,
-0.0590612068772316,
0.03269323706626892,
0.2888062000274658,
0.06145462393760681,
0.33129727840423584,
-0.3447403311729431,
0.4052965044975281,
0.11724285781383514,
-0.26756522059440613,
-0.1989067792892456,
0.09781254082918167,
0.15945789217948914,
-0.22237642109394073,
-0.14667578041553497,
0.4503445029258728,
0.26729005575180054,
0.13199393451213837,
-0.046161551028490067,
0.21722188591957092,
0.3309118449687958,
-0.14592593908309937,
0.05025884509086609,
0.18882524967193604,
0.0647556260228157,
-0.11200706660747528,
-0.3509676456451416,
0.17431500554084778,
0.07573722302913666,
0.1975538432598114,
-0.2302028238773346,
-0.1322469711303711,
0.24275082349777222,
-0.12779675424098969,
-0.023125477135181427,
-0.3887263238430023,
-0.7205102443695068,
0.23557725548744202,
-0.12911418080329895,
0.010964713990688324,
0.0772782415151596,
0.4274236559867859,
0.726123571395874,
0.29457759857177734,
-0.017111968249082565,
0.05097237601876259,
-0.18078042566776276,
-0.11603448539972305,
0.16800165176391602,
0.11895373463630676,
0.20323100686073303,
0.08741889894008636,
-0.09693592041730881,
0.02401926927268505,
0.059556566178798676,
0.055948127061128616,
-0.007555931806564331,
0.10953392088413239,
0.2403458058834076,
0.15449801087379456,
0.28506287932395935,
0.048468708992004395,
-0.1370842009782791,
0.1771911382675171,
0.2565857768058777,
0.04031209647655487,
-0.19383415579795837,
-0.03607224300503731,
-0.3056073784828186,
0.08494311571121216,
-0.23381741344928741,
-0.10087934881448746,
-0.2457137107849121,
-0.23960581421852112,
-0.026751015335321426,
0.22688524425029755,
-0.18026691675186157,
0.22511351108551025,
0.10045228898525238,
0.17540916800498962,
0.09365329146385193,
-0.6033603549003601,
0.030110441148281097,
0.10444144904613495,
-0.15814922749996185,
-0.07513666898012161,
-0.023452676832675934,
-0.026864247396588326,
0.12762735784053802,
-0.3594931364059448,
0.21861696243286133,
-0.34843575954437256,
-0.4445124864578247,
0.2990327775478363,
-0.08599765598773956,
0.13228707015514374,
-0.047793351113796234,
0.06037957966327667,
0.21396392583847046,
-0.04416970908641815,
0.04693373292684555,
0.24641640484333038,
-0.19603300094604492,
-0.21534931659698486,
-0.041104041039943695,
0.017910316586494446,
-0.13178938627243042,
-0.15260571241378784,
0.17746038734912872,
-0.15685021877288818,
0.13324442505836487,
0.2674294412136078,
0.14789068698883057,
0.1107860878109932,
0.2394820749759674,
-0.22126662731170654,
0.05648382380604744,
0.12089484184980392,
-0.018624750897288322,
-0.3742852807044983,
0.23613417148590088,
0.040000639855861664,
-0.09578041732311249,
0.1891154646873474,
-0.3734879493713379,
-0.08114778250455856,
0.18081972002983093,
-0.6693986058235168,
-0.20718581974506378,
-0.290677547454834,
0.500670313835144,
0.028295766562223434,
-0.00997620727866888,
0.5927127003669739,
0.1275363564491272,
0.13048237562179565,
-0.37531256675720215,
-0.6145306825637817,
0.13940604031085968,
0.308203786611557,
0.5557724237442017,
-0.12344774603843689,
0.0887647420167923,
-0.09843186289072037,
0.40172040462493896,
0.03831177204847336,
-0.14099358022212982,
0.259257435798645,
-0.02879168651998043,
0.6337553262710571,
-0.3008570075035095,
-0.15506258606910706,
0.003083322197198868,
0.16960325837135315,
-0.10949571430683136,
0.18402829766273499,
0.1706666797399521,
0.05792321264743805,
-0.08361135423183441,
0.05637207627296448,
-0.46881622076034546,
-0.25815126299858093,
-0.18733325600624084,
-0.11612647771835327,
0.1027107685804367,
0.3150666654109955,
0.43317699432373047,
-0.2935656011104584,
-0.218987375497818,
-0.02671733871102333,
0.11563722789287567,
0.24172329902648926,
-0.1408633589744568,
-0.16384516656398773,
0.029811352491378784,
-0.021991167217493057,
0.019566312432289124,
-0.06133849173784256,
0.18488015234470367,
0.16805076599121094,
-0.1069432720541954,
0.06428977847099304,
-0.15189297497272491,
0.4494156241416931,
-0.4070911705493927,
0.22581255435943604,
-0.013294301927089691,
0.10651005059480667,
-0.12354545295238495,
-0.2498115599155426,
-0.09509513527154922,
0.08420468866825104,
0.3056178390979767,
0.5885540246963501,
-0.3539893627166748,
-0.05823438614606857,
0.36922088265419006,
0.0946548730134964,
-0.29124748706817627,
0.06392747908830643,
-0.23451519012451172,
-0.1548517346382141,
-0.25014373660087585,
-0.27778729796409607,
-0.01237771287560463,
0.1942557394504547,
0.014317728579044342,
-0.04298831522464752,
-0.19504788517951965,
0.06230276823043823,
-0.2249901294708252,
-0.054793018847703934,
0.5126283764839172,
0.38644301891326904,
0.4214387834072113,
0.031609538942575455,
0.10218299925327301,
0.3728347420692444,
0.6841872334480286,
0.006289716809988022,
-0.4960140883922577,
-0.11860615015029907,
-0.1693541556596756,
-0.06558737903833389,
0.48150327801704407,
0.18552136421203613,
-0.1282864212989807,
0.051839448511600494,
0.12692700326442719,
-0.44527027010917664,
0.27864307165145874,
0.4962826073169708,
-0.10891600698232651,
-0.15383613109588623,
-0.3969382345676422,
0.36974453926086426,
-0.1478419303894043,
-0.1981876790523529,
0.05120233818888664,
0.14917892217636108,
-0.4778813421726227,
0.44525742530822754,
0.13820816576480865,
0.8339543342590332,
0.31786853075027466,
0.07511581480503082,
0.06097283586859703,
-0.3037135601043701,
0.37800318002700806,
-0.2462298572063446,
-0.012262266129255295,
-0.3066052198410034,
0.07725262641906738,
-0.018506862223148346,
-0.046689849346876144,
0.10356563329696655,
-0.02118966169655323,
-0.06392145156860352,
0.09683457016944885,
-0.1714429259300232,
0.7092676758766174,
0.06474818289279938,
0.11195299029350281,
0.0016322340816259384,
-0.2953207492828369,
0.35645443201065063,
0.02684129774570465,
-0.08301509916782379,
0.32644733786582947,
0.056141458451747894,
-0.4142460227012634,
-0.27779722213745117,
-0.1592278778553009,
-0.3498929440975189,
0.06614180654287338,
0.29795509576797485,
0.09470470994710922,
0.07410630583763123,
-0.17033787071704865,
-0.24585118889808655,
-0.00706681702286005,
0.6780393719673157,
0.3235708773136139,
-0.3321536183357239,
0.35356760025024414,
0.23582614958286285,
0.11624784767627716,
0.0902891755104065,
-0.12323047965765,
0.19380831718444824,
0.058563411235809326,
-0.21384812891483307,
-0.20087580382823944,
-0.2741231620311737,
-0.10603521764278412,
-0.13175639510154724,
-0.18655595183372498,
0.11100666224956512,
-0.23248937726020813,
0.08322224020957947,
0.33852338790893555,
0.1907626986503601,
-0.29722195863723755,
0.04732053354382515,
0.04234620928764343,
0.05039263516664505,
0.44864287972450256,
-0.10877015441656113,
-0.3551858067512512,
-0.2753134071826935,
0.4542601406574249,
0.1691153198480606,
-0.0065391212701797485,
0.4426939785480499,
-0.48997020721435547,
0.10088875889778137,
-0.04288899898529053,
0.49064648151397705,
-0.03860369324684143,
-0.26448702812194824,
-0.0231130663305521,
-0.18541058897972107,
-0.08563753217458725,
-0.0901876837015152,
0.19466674327850342,
0.03055671975016594,
0.06241504102945328,
-0.18955546617507935,
-0.2649036645889282,
-0.16268710792064667,
0.2872466444969177,
-0.10528488457202911,
0.06848955154418945,
-0.3558703064918518,
0.20132052898406982,
0.13999219238758087,
-0.03365296125411987,
-0.22722363471984863,
0.15905998647212982,
0.08835231512784958,
0.24076835811138153,
-0.21912677586078644,
0.2552723288536072,
-0.04572521895170212,
-0.3144013583660126,
-0.015187447890639305,
-0.13007016479969025,
-0.35434141755104065,
-0.034258343279361725,
-0.27354881167411804,
0.22652214765548706,
0.07766208052635193,
0.0957757979631424,
-0.21881303191184998,
-0.4195757806301117,
-0.2694149315357208,
-0.21784891188144684,
0.13729150593280792,
-0.03977930173277855,
0.08787920325994492,
0.13930977880954742,
0.2743428349494934,
0.2976095378398895,
0.11039536446332932,
0.0802326500415802,
0.048207513988018036,
0.48591020703315735,
-0.13894134759902954,
0.21648812294006348,
-0.4526859521865845,
0.13353019952774048,
0.21807761490345,
0.04508739709854126,
-0.21084637939929962,
0.1754872053861618,
0.4495243728160858,
-0.3346717059612274,
0.34165701270103455,
0.11652682721614838,
0.3421696126461029,
0.2215985804796219,
-0.18206042051315308,
-0.39226633310317993,
-0.06025844067335129,
0.13154925405979156,
-0.28120559453964233,
-0.1645709127187729,
0.24725645780563354,
-0.006738666445016861,
0.012005239725112915,
0.0644112229347229,
0.26918143033981323,
0.17023177444934845,
-0.09560540318489075,
0.27368855476379395,
0.5029382705688477,
-0.05116156488656998,
0.17044280469417572,
0.5654544830322266,
-0.2871376574039459,
0.2457246333360672,
0.17616070806980133,
0.08734799921512604,
-0.05813705921173096,
0.6145991683006287,
0.18364685773849487,
0.06291650980710983,
0.3408164978027344,
-0.02196759358048439,
0.22747713327407837,
-0.4127298593521118,
0.39690589904785156,
-0.06991776823997498,
-0.05301710218191147,
-0.09365949779748917,
0.0909581258893013,
0.02984977513551712,
-0.013005971908569336,
-0.19733288884162903,
-0.42633867263793945,
-0.026316341012716293,
-0.15385697782039642,
-0.03956938162446022,
-0.17164002358913422,
-0.17120850086212158,
-0.10293709486722946,
0.001230575144290924,
-0.016375770792365074,
-0.19663049280643463,
-0.14881204068660736,
-0.1597668081521988,
-0.40809953212738037,
-0.09792432188987732,
-0.0173383429646492,
-0.11937494575977325,
0.2128598988056183,
-0.2959727644920349,
0.1718352884054184,
0.05314652994275093,
-0.1574549376964569,
0.17279431223869324,
0.42471879720687866,
0.1505756378173828,
0.14826157689094543,
0.11058351397514343,
0.12781314551830292,
0.34848690032958984,
-0.20888113975524902,
-0.009122423827648163,
0.1898338496685028,
0.1341591626405716,
-0.07094374299049377,
0.01305646076798439,
0.06646212190389633,
-0.18428672850131989,
0.009884015657007694,
0.10533429682254791,
0.17486026883125305,
-0.17257171869277954,
0.5348174571990967,
-0.07267984747886658,
-0.12184441089630127,
0.07604013383388519,
-0.09574462473392487,
0.0337490439414978,
-0.38069355487823486,
0.5496399402618408,
-0.11344267427921295,
0.11428438127040863,
0.03586132824420929,
0.01134423166513443,
-0.43388816714286804,
0.4832448959350586,
0.21881484985351562,
-0.29143011569976807,
-0.1805598884820938,
-0.07054358720779419,
-0.5502915382385254,
0.16083666682243347,
-0.03735337778925896,
-0.35845643281936646,
0.04364154115319252,
0.4591795802116394,
0.028241131454706192,
-0.023170962929725647,
0.009193427860736847,
-0.23749232292175293,
0.22337810695171356,
0.031441569328308105,
-0.434749573469162,
-0.17694072425365448,
-0.1618281453847885,
0.04635234177112579,
-0.0024030059576034546,
-0.47605660557746887,
0.5047016143798828,
-0.05177737772464752,
-0.05512046813964844,
0.23885363340377808,
-0.1749083399772644,
0.26503562927246094,
-0.18300026655197144,
0.33303964138031006,
0.0594797283411026,
0.14016705751419067,
-0.06686653941869736,
-0.2551042139530182,
-0.25124311447143555,
-0.28369760513305664,
-0.2727208733558655,
0.33506500720977783,
-0.18538504838943481,
0.7155604362487793,
-0.12293105572462082,
0.19904911518096924,
-0.1291223168373108,
-0.07756969332695007,
0.2631562352180481,
-0.11614083498716354,
-0.21299967169761658,
0.006311297416687012,
-0.34931570291519165,
0.12684980034828186,
0.1473599672317505,
0.028027202934026718,
0.029097622260451317,
0.08091899752616882,
-0.08061224222183228,
-0.45358872413635254,
0.4970754384994507,
0.12596017122268677,
-0.12806078791618347,
-0.21486157178878784,
0.14840388298034668,
-0.16885511577129364,
-0.17013774812221527,
-0.283824622631073,
0.2392897754907608,
0.5159110426902771,
-0.1616489440202713,
-0.2615004777908325,
0.11086677014827728,
-0.0594884417951107,
0.1263871192932129,
0.010264120995998383,
0.2727782726287842,
-0.07619863748550415,
-0.21248893439769745,
-0.13059166073799133,
0.006976619362831116
] |
https://github.com/huggingface/datasets/issues/5709 | Hi @polinaeterna Yes I have created the dataset with `Dataset.from_dict` applied some updates afterward and when I pushed to the hub I had a `dataset_infos.json` file and there was a `README.md` file as well.
I didn't know that the JSON file was deprecated. So I have built my dataset with `ImageBuilder` instead and now it works like a charm without having to touch anything.
I haven't succeed to reproduce the creation of the JSON file with a toy example, hence, I certainly did some mistakes when I have manipulated my dataset manually at first. My bad. | Manually dataset info made not taken into account | ### Describe the bug
Hello,
I'm manually building an image dataset with the `from_dict` approach. I also build the features with the `cast_features` methods. Once the dataset is created I push it on the hub, and a default `dataset_infos.json` file seems to have been automatically added to the repo in same time. Hence I update it manually with all the missing info, but when I download the dataset the info are never updated.
Former `dataset_infos.json` file:
```
{"default": {
"description": "",
"citation": "",
"homepage": "",
"license": "",
"features": {
"image": {
"_type": "Image"
},
"labels": {
"names": [
"Fake",
"Real"
],
"_type": "ClassLabel"
}
},
"splits": {
"validation": {
"name": "validation",
"num_bytes": 901010094.0,
"num_examples": 3200,
"dataset_name": null
},
"train": {
"name": "train",
"num_bytes": 901010094.0,
"num_examples": 3200,
"dataset_name": null
}
},
"download_size": 1802008414,
"dataset_size": 1802020188.0,
"size_in_bytes": 3604028602.0
}}
```
After I update it manually it looks like:
```
{
"bstrai--deepfake-detection":{
"description":"",
"citation":"",
"homepage":"",
"license":"",
"features":{
"image":{
"decode":true,
"id":null,
"_type":"Image"
},
"labels":{
"num_classes":2,
"names":[
"Fake",
"Real"
],
"id":null,
"_type":"ClassLabel"
}
},
"supervised_keys":{
"input":"image",
"output":"labels"
},
"task_templates":[
{
"task":"image-classification",
"image_column":"image",
"label_column":"labels"
}
],
"config_name":null,
"splits":{
"validation":{
"name":"validation",
"num_bytes":36627822,
"num_examples":123,
"dataset_name":"deepfake-detection"
},
"train":{
"name":"train",
"num_bytes":901023694,
"num_examples":3200,
"dataset_name":"deepfake-detection"
}
},
"download_checksums":null,
"download_size":937562209,
"dataset_size":937651516,
"size_in_bytes":1875213725
}
}
```
Anything I should do to have the new infos in the `dataset_infos.json` to be taken into account? Or it is not possible yet?
Thanks!
### Steps to reproduce the bug
-
### Expected behavior
-
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
- Python version: 3.10.10
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 2.0.0 | 96 | Manually dataset info made not taken into account
### Describe the bug
Hello,
I'm manually building an image dataset with the `from_dict` approach. I also build the features with the `cast_features` methods. Once the dataset is created I push it on the hub, and a default `dataset_infos.json` file seems to have been automatically added to the repo in same time. Hence I update it manually with all the missing info, but when I download the dataset the info are never updated.
Former `dataset_infos.json` file:
```
{"default": {
"description": "",
"citation": "",
"homepage": "",
"license": "",
"features": {
"image": {
"_type": "Image"
},
"labels": {
"names": [
"Fake",
"Real"
],
"_type": "ClassLabel"
}
},
"splits": {
"validation": {
"name": "validation",
"num_bytes": 901010094.0,
"num_examples": 3200,
"dataset_name": null
},
"train": {
"name": "train",
"num_bytes": 901010094.0,
"num_examples": 3200,
"dataset_name": null
}
},
"download_size": 1802008414,
"dataset_size": 1802020188.0,
"size_in_bytes": 3604028602.0
}}
```
After I update it manually it looks like:
```
{
"bstrai--deepfake-detection":{
"description":"",
"citation":"",
"homepage":"",
"license":"",
"features":{
"image":{
"decode":true,
"id":null,
"_type":"Image"
},
"labels":{
"num_classes":2,
"names":[
"Fake",
"Real"
],
"id":null,
"_type":"ClassLabel"
}
},
"supervised_keys":{
"input":"image",
"output":"labels"
},
"task_templates":[
{
"task":"image-classification",
"image_column":"image",
"label_column":"labels"
}
],
"config_name":null,
"splits":{
"validation":{
"name":"validation",
"num_bytes":36627822,
"num_examples":123,
"dataset_name":"deepfake-detection"
},
"train":{
"name":"train",
"num_bytes":901023694,
"num_examples":3200,
"dataset_name":"deepfake-detection"
}
},
"download_checksums":null,
"download_size":937562209,
"dataset_size":937651516,
"size_in_bytes":1875213725
}
}
```
Anything I should do to have the new infos in the `dataset_infos.json` to be taken into account? Or it is not possible yet?
Thanks!
### Steps to reproduce the bug
-
### Expected behavior
-
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
- Python version: 3.10.10
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 2.0.0
Hi @polinaeterna Yes I have created the dataset with `Dataset.from_dict` applied some updates afterward and when I pushed to the hub I had a `dataset_infos.json` file and there was a `README.md` file as well.
I didn't know that the JSON file was deprecated. So I have built my dataset with `ImageBuilder` instead and now it works like a charm without having to touch anything.
I haven't succeed to reproduce the creation of the JSON file with a toy example, hence, I certainly did some mistakes when I have manipulated my dataset manually at first. My bad. | [
-0.2274862825870514,
-0.0038239210844039917,
-0.03542531281709671,
0.2053673267364502,
0.16327960789203644,
0.12050522118806839,
0.18317842483520508,
0.11353832483291626,
-0.0990067645907402,
0.09088581800460815,
0.1578717827796936,
0.3468891978263855,
0.228308767080307,
0.3312079608440399,
-0.13989953696727753,
0.48101961612701416,
0.18140432238578796,
0.12322694063186646,
0.24489128589630127,
-0.19651487469673157,
-0.20508910715579987,
0.0645248293876648,
-0.0764082819223404,
-0.4095873236656189,
-0.49168500304222107,
0.06107603758573532,
-0.08332213759422302,
0.15466471016407013,
-0.22077949345111847,
-0.2847859859466553,
0.3322944641113281,
0.3391745984554291,
0.008055463433265686,
0.17504237592220306,
-0.00012450863141566515,
0.0277596116065979,
0.43252435326576233,
-0.27312856912612915,
-0.3182888925075531,
0.3313118815422058,
-0.6923757791519165,
-0.3077927529811859,
-0.16381873190402985,
-0.2790791392326355,
-0.1411571353673935,
-0.03707687556743622,
0.06371555477380753,
0.03558366745710373,
0.2192663550376892,
-0.03191816061735153,
0.07939515262842178,
-0.06017017364501953,
0.23458755016326904,
0.014217458665370941,
0.20430895686149597,
0.5831658840179443,
-0.20332594215869904,
-0.045472078025341034,
-0.20578980445861816,
0.4126407206058502,
0.13416151702404022,
0.46031665802001953,
0.0605989471077919,
-0.06338228285312653,
0.20528759062290192,
0.07936625182628632,
-0.0440613329410553,
-0.30137985944747925,
0.023622598499059677,
0.2281610369682312,
0.47205162048339844,
-0.2669832408428192,
-0.4510105848312378,
-0.4718325138092041,
-0.07321103662252426,
-0.2300637662410736,
0.23007136583328247,
0.04334837198257446,
-0.0873849093914032,
0.14575918018817902,
-0.4366820454597473,
-0.3864085376262665,
0.0884370356798172,
0.01826503314077854,
-0.06249941140413284,
-0.03485536575317383,
0.022878490388393402,
0.0720377266407013,
-0.3387850821018219,
-0.08931708335876465,
0.2353210598230362,
-0.519016683101654,
-0.23528143763542175,
-0.00037082284688949585,
0.2260599285364151,
-0.10141538828611374,
0.23418352007865906,
-0.14882723987102509,
0.10939566791057587,
0.16893917322158813,
-0.11795776337385178,
0.19011138379573822,
-0.6943354606628418,
0.045544762164354324,
0.25111833214759827,
0.09898844361305237,
0.08475618064403534,
0.3038919270038605,
0.2710413634777069,
0.21117928624153137,
0.03511461615562439,
-0.06194093078374863,
0.021051008254289627,
0.29430001974105835,
0.2552717924118042,
-0.08722627907991409,
0.40183916687965393,
-0.09700435400009155,
-0.05561577528715134,
-0.014735428616404533,
-0.059976425021886826,
0.05325733497738838,
-0.06996332108974457,
0.04616832733154297,
-0.30254366993904114,
0.03974387049674988,
-0.06840936839580536,
0.09866993129253387,
-0.029244139790534973,
0.10238534957170486,
-0.23629701137542725,
-0.3060005009174347,
0.0410664826631546,
0.03381308168172836,
0.11977380514144897,
0.04078176990151405,
0.4167563319206238,
0.11248177289962769,
-0.16427463293075562,
-0.11523424088954926,
-0.2043699026107788,
-0.1464766263961792,
0.2464544028043747,
0.435968816280365,
-0.04731011018157005,
0.22348368167877197,
-0.2820214331150055,
-0.20323407649993896,
-0.22932171821594238,
0.38844990730285645,
-0.5556222796440125,
-0.19218844175338745,
-0.0447775200009346,
0.05315981060266495,
-0.3679402768611908,
-0.03853679448366165,
-0.2520206868648529,
0.31154024600982666,
0.22261744737625122,
-0.2250145673751831,
-0.1409735083580017,
-0.049906760454177856,
-0.30598315596580505,
-0.14247989654541016,
0.35876476764678955,
0.45479312539100647,
-0.2902078330516815,
-0.11731468141078949,
-0.26598161458969116,
0.11257056891918182,
-0.05174731835722923,
-0.0582643561065197,
-0.20079579949378967,
0.5759897828102112,
-0.2953609824180603,
0.18098384141921997,
0.2908209562301636,
-0.3071495592594147,
-0.5576926469802856,
0.14464128017425537,
0.15384864807128906,
0.2054145187139511,
0.022040119394659996,
0.33170583844184875,
0.4006308913230896,
0.016158882528543472,
-0.04268580675125122,
0.4085296094417572,
-0.08935051411390305,
0.09027046710252762,
-0.010144457221031189,
-0.48278069496154785,
-0.21772490441799164,
0.03267543017864227,
0.17850559949874878,
0.2487851232290268,
0.1870042234659195,
0.352383017539978,
0.33862316608428955,
0.21672797203063965,
0.1705860048532486,
0.40613794326782227,
0.3900788426399231,
-0.20540273189544678,
0.03828561678528786,
0.04954686760902405,
-0.4193124771118164,
0.36420688033103943,
0.28355124592781067,
0.08698233217000961,
-0.3983067572116852,
-0.09422376751899719,
-0.29255378246307373,
-0.10389421880245209,
-0.42003440856933594,
-0.1282225102186203,
0.048521146178245544,
0.43375393748283386,
-0.2606038451194763,
-0.0590612068772316,
0.03269323706626892,
0.2888062000274658,
0.06145462393760681,
0.33129727840423584,
-0.3447403311729431,
0.4052965044975281,
0.11724285781383514,
-0.26756522059440613,
-0.1989067792892456,
0.09781254082918167,
0.15945789217948914,
-0.22237642109394073,
-0.14667578041553497,
0.4503445029258728,
0.26729005575180054,
0.13199393451213837,
-0.046161551028490067,
0.21722188591957092,
0.3309118449687958,
-0.14592593908309937,
0.05025884509086609,
0.18882524967193604,
0.0647556260228157,
-0.11200706660747528,
-0.3509676456451416,
0.17431500554084778,
0.07573722302913666,
0.1975538432598114,
-0.2302028238773346,
-0.1322469711303711,
0.24275082349777222,
-0.12779675424098969,
-0.023125477135181427,
-0.3887263238430023,
-0.7205102443695068,
0.23557725548744202,
-0.12911418080329895,
0.010964713990688324,
0.0772782415151596,
0.4274236559867859,
0.726123571395874,
0.29457759857177734,
-0.017111968249082565,
0.05097237601876259,
-0.18078042566776276,
-0.11603448539972305,
0.16800165176391602,
0.11895373463630676,
0.20323100686073303,
0.08741889894008636,
-0.09693592041730881,
0.02401926927268505,
0.059556566178798676,
0.055948127061128616,
-0.007555931806564331,
0.10953392088413239,
0.2403458058834076,
0.15449801087379456,
0.28506287932395935,
0.048468708992004395,
-0.1370842009782791,
0.1771911382675171,
0.2565857768058777,
0.04031209647655487,
-0.19383415579795837,
-0.03607224300503731,
-0.3056073784828186,
0.08494311571121216,
-0.23381741344928741,
-0.10087934881448746,
-0.2457137107849121,
-0.23960581421852112,
-0.026751015335321426,
0.22688524425029755,
-0.18026691675186157,
0.22511351108551025,
0.10045228898525238,
0.17540916800498962,
0.09365329146385193,
-0.6033603549003601,
0.030110441148281097,
0.10444144904613495,
-0.15814922749996185,
-0.07513666898012161,
-0.023452676832675934,
-0.026864247396588326,
0.12762735784053802,
-0.3594931364059448,
0.21861696243286133,
-0.34843575954437256,
-0.4445124864578247,
0.2990327775478363,
-0.08599765598773956,
0.13228707015514374,
-0.047793351113796234,
0.06037957966327667,
0.21396392583847046,
-0.04416970908641815,
0.04693373292684555,
0.24641640484333038,
-0.19603300094604492,
-0.21534931659698486,
-0.041104041039943695,
0.017910316586494446,
-0.13178938627243042,
-0.15260571241378784,
0.17746038734912872,
-0.15685021877288818,
0.13324442505836487,
0.2674294412136078,
0.14789068698883057,
0.1107860878109932,
0.2394820749759674,
-0.22126662731170654,
0.05648382380604744,
0.12089484184980392,
-0.018624750897288322,
-0.3742852807044983,
0.23613417148590088,
0.040000639855861664,
-0.09578041732311249,
0.1891154646873474,
-0.3734879493713379,
-0.08114778250455856,
0.18081972002983093,
-0.6693986058235168,
-0.20718581974506378,
-0.290677547454834,
0.500670313835144,
0.028295766562223434,
-0.00997620727866888,
0.5927127003669739,
0.1275363564491272,
0.13048237562179565,
-0.37531256675720215,
-0.6145306825637817,
0.13940604031085968,
0.308203786611557,
0.5557724237442017,
-0.12344774603843689,
0.0887647420167923,
-0.09843186289072037,
0.40172040462493896,
0.03831177204847336,
-0.14099358022212982,
0.259257435798645,
-0.02879168651998043,
0.6337553262710571,
-0.3008570075035095,
-0.15506258606910706,
0.003083322197198868,
0.16960325837135315,
-0.10949571430683136,
0.18402829766273499,
0.1706666797399521,
0.05792321264743805,
-0.08361135423183441,
0.05637207627296448,
-0.46881622076034546,
-0.25815126299858093,
-0.18733325600624084,
-0.11612647771835327,
0.1027107685804367,
0.3150666654109955,
0.43317699432373047,
-0.2935656011104584,
-0.218987375497818,
-0.02671733871102333,
0.11563722789287567,
0.24172329902648926,
-0.1408633589744568,
-0.16384516656398773,
0.029811352491378784,
-0.021991167217493057,
0.019566312432289124,
-0.06133849173784256,
0.18488015234470367,
0.16805076599121094,
-0.1069432720541954,
0.06428977847099304,
-0.15189297497272491,
0.4494156241416931,
-0.4070911705493927,
0.22581255435943604,
-0.013294301927089691,
0.10651005059480667,
-0.12354545295238495,
-0.2498115599155426,
-0.09509513527154922,
0.08420468866825104,
0.3056178390979767,
0.5885540246963501,
-0.3539893627166748,
-0.05823438614606857,
0.36922088265419006,
0.0946548730134964,
-0.29124748706817627,
0.06392747908830643,
-0.23451519012451172,
-0.1548517346382141,
-0.25014373660087585,
-0.27778729796409607,
-0.01237771287560463,
0.1942557394504547,
0.014317728579044342,
-0.04298831522464752,
-0.19504788517951965,
0.06230276823043823,
-0.2249901294708252,
-0.054793018847703934,
0.5126283764839172,
0.38644301891326904,
0.4214387834072113,
0.031609538942575455,
0.10218299925327301,
0.3728347420692444,
0.6841872334480286,
0.006289716809988022,
-0.4960140883922577,
-0.11860615015029907,
-0.1693541556596756,
-0.06558737903833389,
0.48150327801704407,
0.18552136421203613,
-0.1282864212989807,
0.051839448511600494,
0.12692700326442719,
-0.44527027010917664,
0.27864307165145874,
0.4962826073169708,
-0.10891600698232651,
-0.15383613109588623,
-0.3969382345676422,
0.36974453926086426,
-0.1478419303894043,
-0.1981876790523529,
0.05120233818888664,
0.14917892217636108,
-0.4778813421726227,
0.44525742530822754,
0.13820816576480865,
0.8339543342590332,
0.31786853075027466,
0.07511581480503082,
0.06097283586859703,
-0.3037135601043701,
0.37800318002700806,
-0.2462298572063446,
-0.012262266129255295,
-0.3066052198410034,
0.07725262641906738,
-0.018506862223148346,
-0.046689849346876144,
0.10356563329696655,
-0.02118966169655323,
-0.06392145156860352,
0.09683457016944885,
-0.1714429259300232,
0.7092676758766174,
0.06474818289279938,
0.11195299029350281,
0.0016322340816259384,
-0.2953207492828369,
0.35645443201065063,
0.02684129774570465,
-0.08301509916782379,
0.32644733786582947,
0.056141458451747894,
-0.4142460227012634,
-0.27779722213745117,
-0.1592278778553009,
-0.3498929440975189,
0.06614180654287338,
0.29795509576797485,
0.09470470994710922,
0.07410630583763123,
-0.17033787071704865,
-0.24585118889808655,
-0.00706681702286005,
0.6780393719673157,
0.3235708773136139,
-0.3321536183357239,
0.35356760025024414,
0.23582614958286285,
0.11624784767627716,
0.0902891755104065,
-0.12323047965765,
0.19380831718444824,
0.058563411235809326,
-0.21384812891483307,
-0.20087580382823944,
-0.2741231620311737,
-0.10603521764278412,
-0.13175639510154724,
-0.18655595183372498,
0.11100666224956512,
-0.23248937726020813,
0.08322224020957947,
0.33852338790893555,
0.1907626986503601,
-0.29722195863723755,
0.04732053354382515,
0.04234620928764343,
0.05039263516664505,
0.44864287972450256,
-0.10877015441656113,
-0.3551858067512512,
-0.2753134071826935,
0.4542601406574249,
0.1691153198480606,
-0.0065391212701797485,
0.4426939785480499,
-0.48997020721435547,
0.10088875889778137,
-0.04288899898529053,
0.49064648151397705,
-0.03860369324684143,
-0.26448702812194824,
-0.0231130663305521,
-0.18541058897972107,
-0.08563753217458725,
-0.0901876837015152,
0.19466674327850342,
0.03055671975016594,
0.06241504102945328,
-0.18955546617507935,
-0.2649036645889282,
-0.16268710792064667,
0.2872466444969177,
-0.10528488457202911,
0.06848955154418945,
-0.3558703064918518,
0.20132052898406982,
0.13999219238758087,
-0.03365296125411987,
-0.22722363471984863,
0.15905998647212982,
0.08835231512784958,
0.24076835811138153,
-0.21912677586078644,
0.2552723288536072,
-0.04572521895170212,
-0.3144013583660126,
-0.015187447890639305,
-0.13007016479969025,
-0.35434141755104065,
-0.034258343279361725,
-0.27354881167411804,
0.22652214765548706,
0.07766208052635193,
0.0957757979631424,
-0.21881303191184998,
-0.4195757806301117,
-0.2694149315357208,
-0.21784891188144684,
0.13729150593280792,
-0.03977930173277855,
0.08787920325994492,
0.13930977880954742,
0.2743428349494934,
0.2976095378398895,
0.11039536446332932,
0.0802326500415802,
0.048207513988018036,
0.48591020703315735,
-0.13894134759902954,
0.21648812294006348,
-0.4526859521865845,
0.13353019952774048,
0.21807761490345,
0.04508739709854126,
-0.21084637939929962,
0.1754872053861618,
0.4495243728160858,
-0.3346717059612274,
0.34165701270103455,
0.11652682721614838,
0.3421696126461029,
0.2215985804796219,
-0.18206042051315308,
-0.39226633310317993,
-0.06025844067335129,
0.13154925405979156,
-0.28120559453964233,
-0.1645709127187729,
0.24725645780563354,
-0.006738666445016861,
0.012005239725112915,
0.0644112229347229,
0.26918143033981323,
0.17023177444934845,
-0.09560540318489075,
0.27368855476379395,
0.5029382705688477,
-0.05116156488656998,
0.17044280469417572,
0.5654544830322266,
-0.2871376574039459,
0.2457246333360672,
0.17616070806980133,
0.08734799921512604,
-0.05813705921173096,
0.6145991683006287,
0.18364685773849487,
0.06291650980710983,
0.3408164978027344,
-0.02196759358048439,
0.22747713327407837,
-0.4127298593521118,
0.39690589904785156,
-0.06991776823997498,
-0.05301710218191147,
-0.09365949779748917,
0.0909581258893013,
0.02984977513551712,
-0.013005971908569336,
-0.19733288884162903,
-0.42633867263793945,
-0.026316341012716293,
-0.15385697782039642,
-0.03956938162446022,
-0.17164002358913422,
-0.17120850086212158,
-0.10293709486722946,
0.001230575144290924,
-0.016375770792365074,
-0.19663049280643463,
-0.14881204068660736,
-0.1597668081521988,
-0.40809953212738037,
-0.09792432188987732,
-0.0173383429646492,
-0.11937494575977325,
0.2128598988056183,
-0.2959727644920349,
0.1718352884054184,
0.05314652994275093,
-0.1574549376964569,
0.17279431223869324,
0.42471879720687866,
0.1505756378173828,
0.14826157689094543,
0.11058351397514343,
0.12781314551830292,
0.34848690032958984,
-0.20888113975524902,
-0.009122423827648163,
0.1898338496685028,
0.1341591626405716,
-0.07094374299049377,
0.01305646076798439,
0.06646212190389633,
-0.18428672850131989,
0.009884015657007694,
0.10533429682254791,
0.17486026883125305,
-0.17257171869277954,
0.5348174571990967,
-0.07267984747886658,
-0.12184441089630127,
0.07604013383388519,
-0.09574462473392487,
0.0337490439414978,
-0.38069355487823486,
0.5496399402618408,
-0.11344267427921295,
0.11428438127040863,
0.03586132824420929,
0.01134423166513443,
-0.43388816714286804,
0.4832448959350586,
0.21881484985351562,
-0.29143011569976807,
-0.1805598884820938,
-0.07054358720779419,
-0.5502915382385254,
0.16083666682243347,
-0.03735337778925896,
-0.35845643281936646,
0.04364154115319252,
0.4591795802116394,
0.028241131454706192,
-0.023170962929725647,
0.009193427860736847,
-0.23749232292175293,
0.22337810695171356,
0.031441569328308105,
-0.434749573469162,
-0.17694072425365448,
-0.1618281453847885,
0.04635234177112579,
-0.0024030059576034546,
-0.47605660557746887,
0.5047016143798828,
-0.05177737772464752,
-0.05512046813964844,
0.23885363340377808,
-0.1749083399772644,
0.26503562927246094,
-0.18300026655197144,
0.33303964138031006,
0.0594797283411026,
0.14016705751419067,
-0.06686653941869736,
-0.2551042139530182,
-0.25124311447143555,
-0.28369760513305664,
-0.2727208733558655,
0.33506500720977783,
-0.18538504838943481,
0.7155604362487793,
-0.12293105572462082,
0.19904911518096924,
-0.1291223168373108,
-0.07756969332695007,
0.2631562352180481,
-0.11614083498716354,
-0.21299967169761658,
0.006311297416687012,
-0.34931570291519165,
0.12684980034828186,
0.1473599672317505,
0.028027202934026718,
0.029097622260451317,
0.08091899752616882,
-0.08061224222183228,
-0.45358872413635254,
0.4970754384994507,
0.12596017122268677,
-0.12806078791618347,
-0.21486157178878784,
0.14840388298034668,
-0.16885511577129364,
-0.17013774812221527,
-0.283824622631073,
0.2392897754907608,
0.5159110426902771,
-0.1616489440202713,
-0.2615004777908325,
0.11086677014827728,
-0.0594884417951107,
0.1263871192932129,
0.010264120995998383,
0.2727782726287842,
-0.07619863748550415,
-0.21248893439769745,
-0.13059166073799133,
0.006976619362831116
] |
https://github.com/huggingface/datasets/issues/5708 | looks great!
Do you encode the fact that you've already converted a dataset? (to not convert it twice) or do you base yourself on the info contained in `dataset_info` | Dataset sizes are in MiB instead of MB in dataset cards | As @severo reported in an internal discussion (https://github.com/huggingface/moon-landing/issues/5929):
Now we show the dataset size:
- from the dataset card (in the side column)
- from the datasets-server (in the viewer)
But, even if the size is the same, we see a mismatch because the viewer shows MB, while the info from the README generally shows MiB (even if it's written MB -> https://huggingface.co/datasets/blimp/blob/main/README.md?code=true#L1932)
<img width="664" alt="Capture d’écran 2023-04-04 à 10 16 01" src="https://user-images.githubusercontent.com/1676121/229730887-0bd8fa6e-9462-46c6-bd4e-4d2c5784cabb.png">
TODO: Values to be fixed in: `Size of downloaded dataset files:`, `Size of the generated dataset:` and `Total amount of disk used:`
- [x] Bulk edit on the Hub to fix this in all canonical datasets
- [x] Bulk PR on the Hub to fix ancient canonical datasets that were moved to organizations | 29 | Dataset sizes are in MiB instead of MB in dataset cards
As @severo reported in an internal discussion (https://github.com/huggingface/moon-landing/issues/5929):
Now we show the dataset size:
- from the dataset card (in the side column)
- from the datasets-server (in the viewer)
But, even if the size is the same, we see a mismatch because the viewer shows MB, while the info from the README generally shows MiB (even if it's written MB -> https://huggingface.co/datasets/blimp/blob/main/README.md?code=true#L1932)
<img width="664" alt="Capture d’écran 2023-04-04 à 10 16 01" src="https://user-images.githubusercontent.com/1676121/229730887-0bd8fa6e-9462-46c6-bd4e-4d2c5784cabb.png">
TODO: Values to be fixed in: `Size of downloaded dataset files:`, `Size of the generated dataset:` and `Total amount of disk used:`
- [x] Bulk edit on the Hub to fix this in all canonical datasets
- [x] Bulk PR on the Hub to fix ancient canonical datasets that were moved to organizations
looks great!
Do you encode the fact that you've already converted a dataset? (to not convert it twice) or do you base yourself on the info contained in `dataset_info` | [
-0.30520763993263245,
-0.430510938167572,
0.051380690187215805,
0.3353791832923889,
0.126092329621315,
-0.03623035550117493,
0.07882920652627945,
0.1869267225265503,
0.11231429874897003,
0.2592553198337555,
-0.06472647190093994,
0.08979273587465286,
0.030698761343955994,
0.5333747267723083,
0.06958950310945511,
0.09538445621728897,
0.22835201025009155,
0.11632664501667023,
-0.4391767382621765,
0.038486726582050323,
-0.3426256775856018,
0.1951538324356079,
-0.1082863137125969,
-0.4214440584182739,
-0.31087228655815125,
0.15898504853248596,
0.0018270313739776611,
-0.03654082491993904,
-0.5977954864501953,
-0.362567663192749,
0.14848628640174866,
-0.08691294491291046,
0.18819715082645416,
0.22290518879890442,
-0.00011155066749779508,
-0.18824970722198486,
0.19525951147079468,
-0.04891751706600189,
-0.3566453158855438,
0.13868127763271332,
0.1988401561975479,
-0.23770198225975037,
0.02204626053571701,
0.0005152076482772827,
-0.022327043116092682,
-0.012887842953205109,
0.13431088626384735,
0.0024544745683670044,
0.09107594192028046,
0.07513600587844849,
0.25773775577545166,
0.23168662190437317,
0.1144951581954956,
-0.048349782824516296,
0.06822211295366287,
0.5781054496765137,
0.051034457981586456,
0.14277052879333496,
0.022198166698217392,
0.27341365814208984,
-0.15781110525131226,
0.49245330691337585,
0.20828309655189514,
0.011283934116363525,
0.28584396839141846,
0.051892634481191635,
0.19897940754890442,
-0.08322469890117645,
0.1828782707452774,
0.00670767854899168,
0.21509134769439697,
-0.32164937257766724,
-0.310242235660553,
-0.37312906980514526,
-0.07303337007761002,
-0.0243978388607502,
0.1869395673274994,
0.2588995397090912,
0.05763740837574005,
0.028872797265648842,
-0.8051100969314575,
-0.11857247352600098,
0.04319016635417938,
-0.10757723450660706,
-0.2688695788383484,
0.16928277909755707,
-0.3060869574546814,
0.09397514164447784,
-0.14051178097724915,
-0.1432710886001587,
0.07426239550113678,
-0.012998837046325207,
0.03192313015460968,
-0.007923413068056107,
-0.014903414994478226,
-0.02586965262889862,
0.0003625769168138504,
0.26190561056137085,
0.2166392207145691,
0.09800173342227936,
-0.05462760478258133,
-0.07224996387958527,
-0.10040710866451263,
0.04895623400807381,
0.17692820727825165,
0.3060707449913025,
-0.051331281661987305,
-0.04024809971451759,
0.0035934490151703358,
0.32398688793182373,
0.06812702864408493,
0.07463493198156357,
0.07300390303134918,
-0.15945865213871002,
-0.46097445487976074,
-0.2559071481227875,
0.12996213138103485,
-0.37231573462486267,
-0.16848185658454895,
-0.09966181218624115,
-0.10948114097118378,
-0.007616166025400162,
-0.09343340992927551,
0.25853192806243896,
-0.18389560282230377,
0.20515833795070648,
0.2686629295349121,
0.002635594457387924,
-0.1756410300731659,
-0.340997576713562,
-0.2354506403207779,
-0.15427836775779724,
-0.20245620608329773,
0.17550162971019745,
0.028430283069610596,
-0.22029824554920197,
0.31534457206726074,
0.25264111161231995,
0.059921376407146454,
0.1135026216506958,
-0.20508022606372833,
0.08029258251190186,
0.23992067575454712,
0.3166908919811249,
0.07947377860546112,
0.07812139391899109,
-0.03795618936419487,
0.08321748673915863,
-0.24402764439582825,
0.18722902238368988,
-0.01772329956293106,
0.006161205470561981,
-0.2552366256713867,
0.21245859563350677,
-0.29324090480804443,
-0.015519856475293636,
-0.44811373949050903,
0.2517539858818054,
0.07461386173963547,
-0.023032978177070618,
0.0623643733561039,
-0.07000432908535004,
-0.11637266725301743,
-0.10174080729484558,
0.35674965381622314,
0.2588636875152588,
-0.29249173402786255,
-0.22701454162597656,
-0.05065179616212845,
-0.0908999890089035,
0.3232484459877014,
0.20603588223457336,
0.012466266751289368,
0.13446450233459473,
-0.5106402039527893,
-0.045537762343883514,
-0.34403377771377563,
-0.12647055089473724,
-0.32500624656677246,
0.15939444303512573,
-0.039862245321273804,
0.055907994508743286,
0.09169408679008484,
0.06693431735038757,
0.2545623183250427,
-0.0822935402393341,
0.1543753445148468,
0.09217425435781479,
-0.056140556931495667,
0.14175881445407867,
-0.4098469913005829,
-0.47296142578125,
0.022144459187984467,
0.05030012130737305,
0.11972960084676743,
-0.019991856068372726,
0.22302274405956268,
0.39137551188468933,
0.33222538232803345,
0.06298045814037323,
0.03573784977197647,
0.17743664979934692,
0.14718426764011383,
-0.3457397222518921,
-0.08926773071289062,
0.025403767824172974,
-0.13743998110294342,
0.15840336680412292,
-0.17173658311367035,
0.2207719087600708,
0.33290034532546997,
-0.23990555107593536,
-0.3782085180282593,
-0.09661373496055603,
-0.06645715236663818,
-0.19259974360466003,
0.10582494735717773,
0.1177341565489769,
0.11181366443634033,
-0.08194147795438766,
0.084254689514637,
0.16837120056152344,
-0.21568885445594788,
0.0976945012807846,
-0.5786235928535461,
0.38463670015335083,
-0.09886211901903152,
-0.06678484380245209,
0.2976219654083252,
0.06568799167871475,
0.11683839559555054,
-0.0027688033878803253,
-0.09966103732585907,
0.396354079246521,
-0.07087930291891098,
0.2786620259284973,
0.24449343979358673,
0.0882117748260498,
0.3417946398258209,
-0.14353008568286896,
0.2888650894165039,
0.08572887629270554,
-0.18643786013126373,
0.08836758136749268,
-0.3000846207141876,
0.37188127636909485,
-0.0444139689207077,
-0.04057871177792549,
0.046944260597229004,
-0.15379798412322998,
-0.10576431453227997,
0.16403986513614655,
0.01980198174715042,
-0.5039975643157959,
0.04294881597161293,
0.07051868736743927,
0.050549209117889404,
0.1945326179265976,
-0.1945631206035614,
0.1696627140045166,
0.6849340796470642,
-0.00318966805934906,
-0.24796082079410553,
0.2601957619190216,
-0.47090113162994385,
-0.3564091920852661,
0.447631299495697,
0.13170741498470306,
0.24689246714115143,
0.3659822642803192,
0.3014623820781708,
0.30681490898132324,
0.01035303995013237,
-0.09105710685253143,
0.19634224474430084,
-0.08818148076534271,
-0.2242806851863861,
-0.10754355788230896,
0.1378776729106903,
-0.13803179562091827,
-0.2625309228897095,
0.4783453345298767,
-0.004092894494533539,
0.04300163686275482,
-0.38639378547668457,
-0.2785753905773163,
-0.18585895001888275,
-0.3138917088508606,
-0.5595481991767883,
-0.2251761257648468,
-0.4017641544342041,
-0.38496479392051697,
0.09537850320339203,
0.17395086586475372,
0.10160849988460541,
0.015288487076759338,
0.03910541534423828,
0.030213341116905212,
-0.12269848585128784,
0.12158054113388062,
0.10505890846252441,
0.17949871718883514,
-0.1795959621667862,
0.12873312830924988,
0.10889999568462372,
0.025560181587934494,
0.4168175458908081,
-0.4246619939804077,
0.0893775075674057,
-0.4192298948764801,
-0.6019806265830994,
0.2667103409767151,
-0.10627306252717972,
0.07656700164079666,
0.1355115920305252,
0.08241014182567596,
0.06396093964576721,
0.2199166715145111,
0.03479607403278351,
0.07060195505619049,
-0.1705836057662964,
-0.09113295376300812,
-0.3478807210922241,
-0.054720498621463776,
-0.2929130792617798,
-0.2647674083709717,
-0.04179731383919716,
-0.25003260374069214,
0.11433229595422745,
-0.03410431742668152,
0.228671133518219,
0.12698955833911896,
0.20095345377922058,
0.007554899901151657,
-0.27830585837364197,
-0.037448205053806305,
-0.34902292490005493,
-0.5837427377700806,
0.03777729719877243,
-0.24380281567573547,
-0.2866382896900177,
0.16959500312805176,
0.28130751848220825,
0.23152224719524384,
0.013353001326322556,
-0.6766418814659119,
-0.3557858169078827,
-0.2534763216972351,
-0.02594945579767227,
0.1008334755897522,
0.2916380763053894,
0.0780564695596695,
-0.0853278636932373,
-0.1099863201379776,
-0.14809226989746094,
-0.37262049317359924,
-0.13107019662857056,
0.20328190922737122,
0.6208549737930298,
-0.008946452289819717,
-0.07289763540029526,
0.03240114450454712,
0.37418296933174133,
0.6028190851211548,
-0.13276565074920654,
0.17941732704639435,
-0.02632540464401245,
0.4067041277885437,
-0.1910245418548584,
0.07227123528718948,
0.6491906046867371,
-0.0263129323720932,
0.023383833467960358,
0.48429009318351746,
0.09440526366233826,
0.30767524242401123,
0.13657869398593903,
0.1164645105600357,
-0.24077816307544708,
-0.28928548097610474,
0.0076141636818647385,
-0.0005322682554833591,
-0.12743310630321503,
-0.04644428566098213,
0.0787605494260788,
-0.10695506632328033,
-0.0850045382976532,
-0.023488126695156097,
0.005592115223407745,
-0.0403389111161232,
0.252181738615036,
-0.16764262318611145,
-0.08044033497571945,
-0.4917429983615875,
0.31124424934387207,
-0.1950121521949768,
0.19323424994945526,
-0.09860466420650482,
0.008594334125518799,
0.09407509863376617,
0.14573431015014648,
0.4383791983127594,
-0.1551826000213623,
-0.070411816239357,
-0.3596824109554291,
-0.09865757077932358,
-0.5106461048126221,
0.014149017632007599,
0.04148168861865997,
-0.0343962088227272,
0.3690394163131714,
0.5638279914855957,
-0.2581937611103058,
-0.08794037252664566,
0.12045422941446304,
0.3064272105693817,
-0.07062134146690369,
0.03460599482059479,
-0.36916863918304443,
-0.12031789124011993,
-0.2700701653957367,
-0.16757315397262573,
0.0194547101855278,
0.08552540838718414,
-0.13082963228225708,
-0.20019420981407166,
-0.13156382739543915,
-0.11044560372829437,
0.10259503126144409,
0.16414493322372437,
0.44276875257492065,
0.016377955675125122,
0.2571948170661926,
0.4387046992778778,
0.4660404622554779,
0.4173157513141632,
0.8867500424385071,
-0.25846320390701294,
-0.1934884786605835,
0.1437990814447403,
0.05457920953631401,
0.1550985872745514,
0.5074558854103088,
0.1808072030544281,
-0.09021778404712677,
0.30090492963790894,
0.36171069741249084,
-0.5828365683555603,
0.2158510386943817,
-0.08251810073852539,
0.036875318735837936,
-0.3349084258079529,
-0.2579081654548645,
0.31441113352775574,
0.23860500752925873,
0.11156505346298218,
0.05623019114136696,
0.3662872910499573,
-0.26557570695877075,
0.0788593664765358,
0.06616728007793427,
0.7660998106002808,
-0.15406855940818787,
0.06435541808605194,
0.03506043925881386,
-0.36655402183532715,
0.21620066463947296,
0.035805679857730865,
-0.010736310854554176,
-0.4130391776561737,
-0.0011632293462753296,
-0.05321691185235977,
0.09135762602090836,
-0.06070940941572189,
-0.2268831729888916,
-0.36060020327568054,
0.28234392404556274,
0.0576166957616806,
0.2532952129840851,
-0.14106452465057373,
0.15089695155620575,
-0.26511088013648987,
-0.18645398318767548,
-0.2172570824623108,
0.1873151957988739,
-0.35374194383621216,
0.2992377281188965,
-0.07820714265108109,
-0.04055820778012276,
-0.08691376447677612,
-0.11762386560440063,
-0.3559108078479767,
0.012758009135723114,
-0.4496953785419464,
-0.37063825130462646,
0.061158742755651474,
0.05798083543777466,
-0.07585830986499786,
0.22305727005004883,
0.33499425649642944,
0.03229277580976486,
-0.18952500820159912,
0.12267707288265228,
-0.35374245047569275,
0.14089655876159668,
-0.15705238282680511,
0.0800136849284172,
0.14098642766475677,
0.04418864846229553,
-0.09023552387952805,
-0.1916431188583374,
0.09758012741804123,
0.3189381957054138,
-0.21725806593894958,
-0.006633434444665909,
0.0023386720567941666,
-0.2542063295841217,
-0.050528787076473236,
-0.24340090155601501,
0.1320389211177826,
-0.1538335382938385,
0.13472400605678558,
-0.16668444871902466,
0.017853163182735443,
0.21087419986724854,
0.2919478714466095,
-0.333599328994751,
-0.278574675321579,
0.4532727897167206,
-0.11702604591846466,
-0.09337683022022247,
-0.08673275262117386,
0.08425511419773102,
-0.11040936410427094,
0.03036370873451233,
0.24084311723709106,
0.2648177742958069,
-0.44478940963745117,
0.0014768131077289581,
-0.18497681617736816,
-0.10240103304386139,
0.2271530032157898,
0.234824076294899,
0.4175751805305481,
-0.1983461230993271,
-0.05988088622689247,
-0.11402922868728638,
-0.41855913400650024,
0.25817862153053284,
-0.16824114322662354,
0.44310054183006287,
0.14977507293224335,
0.05544010177254677,
0.0419376865029335,
0.10321027040481567,
-0.3338480591773987,
0.08053363859653473,
-0.031010378152132034,
0.25258710980415344,
-0.011805681511759758,
0.020501112565398216,
0.05209013819694519,
-0.17573872208595276,
0.048160795122385025,
0.18530704081058502,
-0.33739882707595825,
-0.12371160835027695,
-0.18184103071689606,
0.08731556683778763,
0.12909355759620667,
-0.1947108507156372,
0.05142952874302864,
0.1762782335281372,
-0.07171443849802017,
-0.31906038522720337,
0.3597857654094696,
0.306365966796875,
-0.014249268919229507,
-0.1282612830400467,
-0.09184431284666061,
-0.10831902921199799,
0.08239695429801941,
-0.17009153962135315,
0.41372573375701904,
0.49537193775177,
-0.013963568955659866,
0.11082352697849274,
-0.2782391309738159,
0.007012605667114258,
0.06986960768699646,
0.20531314611434937,
0.19554875791072845,
0.08313993364572525,
0.08325693011283875,
-0.05628775432705879,
0.15335151553153992,
0.17591828107833862,
0.34353968501091003,
-0.13277606666088104,
-0.1720433086156845,
-0.2144518792629242,
0.07497125118970871,
0.176732137799263,
-0.2085883766412735,
0.04721134901046753,
0.1691831648349762,
0.055784836411476135,
-0.054747581481933594,
0.26808589696884155,
0.5063164830207825,
0.17808745801448822,
-0.17456761002540588,
-0.03699662536382675,
0.40403980016708374,
-0.032585859298706055,
0.10707876086235046,
0.4789482057094574,
-0.19829124212265015,
0.14997760951519012,
0.2599713206291199,
0.21381846070289612,
0.18978336453437805,
0.567861795425415,
-0.12238995730876923,
0.548054039478302,
0.06399370729923248,
0.21070975065231323,
0.30845290422439575,
-0.02860158309340477,
0.12204843759536743,
0.3880796432495117,
-0.08021911978721619,
0.30347707867622375,
0.11212790012359619,
0.4474721848964691,
-0.180837482213974,
-0.26752424240112305,
-0.1635337769985199,
0.15974074602127075,
-0.0907290130853653,
0.08431100845336914,
-0.06409670412540436,
-0.059685587882995605,
-0.31693804264068604,
0.19776633381843567,
-0.15152665972709656,
-0.34316539764404297,
0.23115579783916473,
0.08084855228662491,
-0.34130439162254333,
-0.47271162271499634,
-0.17563609778881073,
0.08888927102088928,
0.06463050842285156,
-0.16851577162742615,
0.3134509325027466,
0.18748021125793457,
-0.1596435308456421,
0.4106947183609009,
0.3994008004665375,
0.505955696105957,
0.20166020095348358,
0.11413603276014328,
-0.107127845287323,
0.4384031891822815,
-0.03553377836942673,
-0.14300420880317688,
-0.21441884338855743,
0.15972086787223816,
-0.23507384955883026,
0.20952780544757843,
0.17216500639915466,
-0.1966395080089569,
-0.22958418726921082,
-0.2161094695329666,
0.11288593709468842,
0.07606038451194763,
0.2696148455142975,
-0.6374276280403137,
-0.003532417118549347,
-0.13271915912628174,
-0.17110851407051086,
-0.5696176290512085,
0.017363708466291428,
0.2545899450778961,
-0.005099914968013763,
0.15606416761875153,
0.010477565228939056,
0.08189788460731506,
0.04754897207021713,
0.19754546880722046,
0.4067304730415344,
-0.2506830394268036,
-0.10540981590747833,
-0.20637910068035126,
-0.6394690871238708,
0.07604500651359558,
0.12978805601596832,
0.1614229530096054,
0.04781857132911682,
0.08121680468320847,
-0.07620955258607864,
-0.08912961184978485,
0.29473283886909485,
-0.12869489192962646,
0.32416749000549316,
0.05608190968632698,
-0.004784815013408661,
-0.13168376684188843,
0.13704752922058105,
-0.1520296037197113,
-0.00881824642419815,
-0.21017371118068695,
0.33167150616645813,
-0.1911460906267166,
0.00548572838306427,
-0.1997327208518982,
0.39027225971221924,
-0.12446827441453934,
-0.13653984665870667,
0.31470176577568054,
0.20661471784114838,
0.41308286786079407,
-0.18614907562732697,
-0.2661183476448059,
-0.06404333561658859,
-0.030147405341267586,
-0.46059995889663696,
0.25704801082611084,
-0.32660314440727234,
0.5969905257225037,
0.010641716420650482,
-0.27495595812797546,
-0.322769433259964,
0.1236884593963623,
0.33098089694976807,
-0.18218949437141418,
-0.26804280281066895,
0.07585302740335464,
-0.31461527943611145,
-0.13158011436462402,
0.2894192934036255,
0.40944355726242065,
0.06641571968793869,
0.209270641207695,
-0.159456267952919,
-0.41497716307640076,
0.3627931475639343,
-0.044707365334033966,
0.07976159453392029,
0.14915284514427185,
0.021122798323631287,
0.1274479627609253,
-0.25392961502075195,
-0.8314512968063354,
0.1240101307630539,
0.1305088847875595,
-0.20632308721542358,
0.12089583277702332,
0.36467811465263367,
-0.06607375293970108,
0.08641904592514038,
-0.06899871677160263,
0.31551799178123474,
0.21096327900886536,
-0.3642544746398926,
0.17563140392303467,
-0.025537729263305664
] |
https://github.com/huggingface/datasets/issues/5708 | I am only looping trough the dataset cards, assuming that all of them were created with MiB.
I agree we should only run the bulk edit once for all canonical datasets: I'm using a for-loop over canonical datasets. | Dataset sizes are in MiB instead of MB in dataset cards | As @severo reported in an internal discussion (https://github.com/huggingface/moon-landing/issues/5929):
Now we show the dataset size:
- from the dataset card (in the side column)
- from the datasets-server (in the viewer)
But, even if the size is the same, we see a mismatch because the viewer shows MB, while the info from the README generally shows MiB (even if it's written MB -> https://huggingface.co/datasets/blimp/blob/main/README.md?code=true#L1932)
<img width="664" alt="Capture d’écran 2023-04-04 à 10 16 01" src="https://user-images.githubusercontent.com/1676121/229730887-0bd8fa6e-9462-46c6-bd4e-4d2c5784cabb.png">
TODO: Values to be fixed in: `Size of downloaded dataset files:`, `Size of the generated dataset:` and `Total amount of disk used:`
- [x] Bulk edit on the Hub to fix this in all canonical datasets
- [x] Bulk PR on the Hub to fix ancient canonical datasets that were moved to organizations | 38 | Dataset sizes are in MiB instead of MB in dataset cards
As @severo reported in an internal discussion (https://github.com/huggingface/moon-landing/issues/5929):
Now we show the dataset size:
- from the dataset card (in the side column)
- from the datasets-server (in the viewer)
But, even if the size is the same, we see a mismatch because the viewer shows MB, while the info from the README generally shows MiB (even if it's written MB -> https://huggingface.co/datasets/blimp/blob/main/README.md?code=true#L1932)
<img width="664" alt="Capture d’écran 2023-04-04 à 10 16 01" src="https://user-images.githubusercontent.com/1676121/229730887-0bd8fa6e-9462-46c6-bd4e-4d2c5784cabb.png">
TODO: Values to be fixed in: `Size of downloaded dataset files:`, `Size of the generated dataset:` and `Total amount of disk used:`
- [x] Bulk edit on the Hub to fix this in all canonical datasets
- [x] Bulk PR on the Hub to fix ancient canonical datasets that were moved to organizations
I am only looping trough the dataset cards, assuming that all of them were created with MiB.
I agree we should only run the bulk edit once for all canonical datasets: I'm using a for-loop over canonical datasets. | [
-0.23767679929733276,
-0.37029165029525757,
0.017483960837125778,
0.2873428761959076,
0.08194397389888763,
0.007679581642150879,
0.09554731845855713,
0.2410692572593689,
0.20588989555835724,
0.19727198779582977,
-0.166701540350914,
0.003100067377090454,
0.013803843408823013,
0.5014073252677917,
-0.03230992704629898,
0.15475282073020935,
0.252253919839859,
0.16372618079185486,
-0.47041478753089905,
0.056151047348976135,
-0.33021295070648193,
0.15656983852386475,
-0.08081585168838501,
-0.5264867544174194,
-0.3614158034324646,
0.07138185203075409,
-0.06053696945309639,
-0.03792821615934372,
-0.43746253848075867,
-0.38283056020736694,
0.13287882506847382,
0.08638851344585419,
0.16507038474082947,
0.17820210754871368,
-0.00011438503861427307,
-0.1280607432126999,
0.2545281946659088,
-0.013029567897319794,
-0.33049532771110535,
0.35730814933776855,
0.23727212846279144,
-0.16845761239528656,
-0.06028038263320923,
-0.0019270926713943481,
0.10798132419586182,
0.009887821972370148,
0.16778837144374847,
-0.07263307273387909,
0.030539236962795258,
-0.02232670783996582,
0.22424836456775665,
0.19020646810531616,
0.0473501980304718,
0.030229151248931885,
-0.007759299129247665,
0.6103647947311401,
0.19721806049346924,
0.06326691806316376,
0.16496089100837708,
0.19504567980766296,
-0.12974002957344055,
0.5571870803833008,
0.20596036314964294,
0.00998508557677269,
0.2309192419052124,
-0.06281711161136627,
0.19993974268436432,
-0.11581650376319885,
0.1494915634393692,
-0.041346292942762375,
0.18559306859970093,
-0.29369089007377625,
-0.28872570395469666,
-0.3795444965362549,
-0.02634241245687008,
-0.06475956737995148,
0.28869888186454773,
0.24976786971092224,
0.057308439165353775,
-0.051190830767154694,
-0.7756218314170837,
-0.1820726841688156,
0.148456871509552,
-0.07389794290065765,
-0.1886322796344757,
0.19273586571216583,
-0.20532694458961487,
0.1109062060713768,
-0.23658423125743866,
-0.07417415082454681,
0.07911418378353119,
0.0499923974275589,
0.04684340953826904,
-0.07959119230508804,
-0.12931881844997406,
-0.010245561599731445,
-0.01570737734436989,
0.16993871331214905,
0.11864899843931198,
0.08639919012784958,
0.03045172244310379,
-0.06227193772792816,
0.005176454782485962,
0.021052785217761993,
0.27113398909568787,
0.16727685928344727,
0.01028183102607727,
-0.01521989330649376,
0.07321134209632874,
0.32338303327560425,
0.04386124014854431,
0.16412866115570068,
0.13499796390533447,
-0.18831542134284973,
-0.4865904450416565,
-0.1319607049226761,
0.06592191755771637,
-0.3047993779182434,
-0.17235074937343597,
-0.08496291935443878,
-0.04767175391316414,
0.029299475252628326,
-0.14657849073410034,
0.1688166856765747,
-0.22041648626327515,
0.29703083634376526,
0.1726011484861374,
-0.10316218435764313,
-0.20356112718582153,
-0.2627395987510681,
-0.16699524223804474,
-0.1737155020236969,
-0.1423838585615158,
0.1561160683631897,
0.12096665799617767,
-0.18993046879768372,
0.3100809156894684,
0.3122207820415497,
0.007949956692755222,
0.0379156619310379,
-0.2822123169898987,
0.07066604495048523,
0.17573252320289612,
0.3282603323459625,
0.049780212342739105,
0.013503357768058777,
-0.10572796314954758,
0.20567676424980164,
-0.2535584568977356,
0.2091326266527176,
-0.08161228895187378,
-0.03338261693716049,
-0.18545925617218018,
0.16408826410770416,
-0.21409153938293457,
-0.015222208574414253,
-0.5077849626541138,
0.2160777449607849,
0.12172038853168488,
-0.04456402733922005,
0.10786395519971848,
-0.036520011723041534,
-0.12087390571832657,
-0.038982316851615906,
0.28846123814582825,
0.2239043265581131,
-0.25906801223754883,
-0.15598663687705994,
-0.032484158873558044,
0.08584391325712204,
0.33482638001441956,
0.22271201014518738,
0.012339573353528976,
0.18271833658218384,
-0.5479023456573486,
-0.1177661120891571,
-0.42942845821380615,
-0.14340201020240784,
-0.35145896673202515,
-0.03341633081436157,
-0.05086318403482437,
0.08604130148887634,
0.07667681574821472,
0.06423784047365189,
0.3167060613632202,
-0.12964078783988953,
0.19699281454086304,
0.0811971127986908,
0.010059960186481476,
0.1598350703716278,
-0.4399552643299103,
-0.4350126087665558,
-0.03908396512269974,
0.09497056156396866,
0.19237905740737915,
-0.06595903635025024,
0.2267320156097412,
0.34849828481674194,
0.33026137948036194,
0.09575680643320084,
0.03040900081396103,
0.30592045187950134,
0.1676183044910431,
-0.2335873693227768,
0.025720786303281784,
0.032815247774124146,
-0.20329943299293518,
0.1942765712738037,
-0.1653578132390976,
0.1502918154001236,
0.29742807149887085,
-0.3418789505958557,
-0.30783265829086304,
-0.16902503371238708,
-0.059209853410720825,
-0.2270851731300354,
0.05757477506995201,
0.25542357563972473,
0.022454865276813507,
-0.2002638578414917,
0.048634082078933716,
0.1701745241880417,
-0.26345163583755493,
0.07969826459884644,
-0.4477202892303467,
0.39945992827415466,
-0.05031031370162964,
-0.020816408097743988,
0.23804199695587158,
0.05226622521877289,
-0.05061214417219162,
-0.07976637780666351,
-0.0717785656452179,
0.410309374332428,
-0.011433888226747513,
0.1822097897529602,
0.3524070978164673,
0.184118390083313,
0.33645015954971313,
-0.2030399739742279,
0.21597380936145782,
0.18338891863822937,
-0.11721454560756683,
0.1294490396976471,
-0.30481183528900146,
0.49187684059143066,
-0.14797699451446533,
0.002443157136440277,
0.009829811751842499,
-0.19503730535507202,
-0.1635476052761078,
0.20687687397003174,
0.03362646698951721,
-0.41500240564346313,
0.022942909970879555,
0.08722631633281708,
0.08215969800949097,
0.17347587645053864,
-0.17290522158145905,
0.16209515929222107,
0.6235735416412354,
0.0951995924115181,
-0.2742002010345459,
0.26508283615112305,
-0.38658636808395386,
-0.27263590693473816,
0.3447567820549011,
0.05670143663883209,
0.12339774519205093,
0.33314651250839233,
0.2170306295156479,
0.29846420884132385,
0.14404915273189545,
-0.018131330609321594,
0.2421882152557373,
0.06663418561220169,
-0.2920279800891876,
-0.016451669856905937,
0.4034956097602844,
-0.04351256787776947,
-0.30338582396507263,
0.43661195039749146,
-0.057749345898628235,
0.06372731924057007,
-0.37893155217170715,
-0.22671929001808167,
-0.09115925431251526,
-0.3203362226486206,
-0.569575309753418,
-0.2146834135055542,
-0.4881584048271179,
-0.38968294858932495,
0.15225237607955933,
0.06904543936252594,
-0.014116257429122925,
0.17780739068984985,
0.1846877783536911,
0.31965699791908264,
-0.13598093390464783,
0.1758718341588974,
0.10879257321357727,
0.1576223522424698,
-0.15653014183044434,
0.07195427268743515,
0.1647060215473175,
-0.08265913277864456,
0.41713380813598633,
-0.4374062120914459,
0.17100712656974792,
-0.4104021489620209,
-0.7423360347747803,
0.14107538759708405,
-0.048063598573207855,
-0.050880707800388336,
0.11596618592739105,
-0.01242203637957573,
0.03261710703372955,
0.19030101597309113,
-0.05031080171465874,
0.01350545883178711,
-0.13773766160011292,
-0.16966408491134644,
-0.3428562581539154,
0.03335600718855858,
-0.28265616297721863,
-0.1941342055797577,
0.00367039255797863,
-0.34040361642837524,
0.057984866201877594,
-0.025150537490844727,
0.2807917296886444,
0.1382194459438324,
0.062268517911434174,
-0.07738999277353287,
-0.29726144671440125,
0.015557561069726944,
-0.2734232246875763,
-0.5750882625579834,
-0.07645341753959656,
-0.16094303131103516,
-0.2686777114868164,
0.11935669928789139,
0.2238440066576004,
0.17023679614067078,
0.04590778797864914,
-0.7310325503349304,
-0.3821084797382355,
-0.23714415729045868,
-0.08550827950239182,
0.09937474876642227,
0.3646078109741211,
0.002264399081468582,
-0.029578376561403275,
-0.12107229232788086,
-0.08037503063678741,
-0.34935760498046875,
-0.10860351473093033,
0.19399049878120422,
0.5315711498260498,
0.005579125136137009,
-0.20430371165275574,
0.05829240381717682,
0.3434528708457947,
0.5925934910774231,
-0.12263479828834534,
0.12443391978740692,
-0.05976171791553497,
0.38686174154281616,
-0.17086076736450195,
0.017923153936862946,
0.6594565510749817,
-0.03531143069267273,
-0.038966890424489975,
0.5169603824615479,
0.05810089409351349,
0.2718299627304077,
0.23393428325653076,
0.16875161230564117,
-0.2814160883426666,
-0.3257962465286255,
0.021845756098628044,
-0.09690924733877182,
-0.06582462787628174,
-0.0363202765583992,
0.0007803589105606079,
-0.24613825976848602,
-0.11955758184194565,
0.05397741124033928,
0.0336548313498497,
-0.1634974479675293,
0.21986472606658936,
-0.1473529040813446,
-0.09853516519069672,
-0.42869293689727783,
0.4220190942287445,
-0.19474440813064575,
0.39076483249664307,
-0.007008768618106842,
-0.016754843294620514,
0.0764189213514328,
0.08395231515169144,
0.551081657409668,
-0.10118544101715088,
-0.08355368673801422,
-0.4505392909049988,
-0.15197888016700745,
-0.4342957139015198,
-0.07976973056793213,
-0.00051165372133255,
-0.006070464849472046,
0.4527711868286133,
0.5839471817016602,
-0.22606956958770752,
-0.08546602725982666,
0.11137741059064865,
0.22238630056381226,
-0.07795789837837219,
0.04278777167201042,
-0.3011179566383362,
-0.10913755744695663,
-0.31572598218917847,
-0.12823329865932465,
0.03641878068447113,
0.06350518763065338,
-0.0772520899772644,
-0.18165290355682373,
-0.20573045313358307,
-0.1544337272644043,
0.11607861518859863,
0.11985507607460022,
0.4335644841194153,
0.13091547787189484,
0.22739697992801666,
0.35728389024734497,
0.43662896752357483,
0.49722057580947876,
0.9151791334152222,
-0.3540063202381134,
-0.14590980112552643,
0.09441821277141571,
-0.06778042018413544,
0.14917442202568054,
0.6338481903076172,
0.22776879370212555,
-0.20290572941303253,
0.19897277653217316,
0.3794431686401367,
-0.5720300078392029,
0.30042368173599243,
-0.1576269268989563,
0.07222659885883331,
-0.40316659212112427,
-0.3067549467086792,
0.28795063495635986,
0.3346119821071625,
0.1126716136932373,
0.26194778084754944,
0.3197687864303589,
-0.21949654817581177,
0.17085841298103333,
0.10277960449457169,
0.7659335136413574,
-0.12377577275037766,
0.09134846925735474,
-0.012407527305185795,
-0.27991610765457153,
0.18226002156734467,
0.11632253229618073,
0.04185109958052635,
-0.2994464635848999,
0.05038689076900482,
-0.06421063095331192,
0.1385689377784729,
-0.11727635562419891,
-0.2693468928337097,
-0.20016667246818542,
0.34641924500465393,
0.07517614960670471,
0.22362551093101501,
-0.200883150100708,
0.011804625391960144,
-0.3091740012168884,
-0.13395442068576813,
-0.07442420721054077,
0.10364912450313568,
-0.35768964886665344,
0.29745763540267944,
-0.06793878972530365,
-0.02787816897034645,
-0.06648741662502289,
-0.2151680439710617,
-0.3759285807609558,
-0.12841175496578217,
-0.4764334559440613,
-0.2787076234817505,
0.18085436522960663,
0.10584254562854767,
-0.1853598654270172,
0.1665821671485901,
0.2936963438987732,
0.05470772832632065,
-0.11426430940628052,
0.2026907205581665,
-0.1586817502975464,
0.15651920437812805,
-0.11407138407230377,
0.13544146716594696,
0.15090805292129517,
0.10064437985420227,
-0.10367128998041153,
-0.26073870062828064,
0.06596265733242035,
0.2474665343761444,
-0.2063814252614975,
-0.020774144679307938,
0.04565008357167244,
-0.09087778627872467,
-0.026944486424326897,
-0.3397000730037689,
0.09897886216640472,
-0.24645429849624634,
0.09760337322950363,
-0.2598719596862793,
0.04637117683887482,
0.22198323905467987,
0.24113623797893524,
-0.33666008710861206,
-0.24232646822929382,
0.46660730242729187,
-0.11347270011901855,
-0.18530625104904175,
0.015170648694038391,
0.1395016759634018,
-0.07800016552209854,
0.010684028267860413,
0.08502455800771713,
0.1238473653793335,
-0.4570128917694092,
0.09461171180009842,
-0.3718146085739136,
-0.1301874816417694,
0.3751390278339386,
0.3390938341617584,
0.4161456227302551,
-0.18269100785255432,
-0.019455261528491974,
-0.2621067762374878,
-0.4782479405403137,
0.23742130398750305,
-0.12475878745317459,
0.5253177285194397,
0.14776577055454254,
0.0634082555770874,
-0.061797767877578735,
0.08025955408811569,
-0.31359297037124634,
0.10370774567127228,
-0.08185253292322159,
0.27012887597084045,
-0.07844963669776917,
0.07666191458702087,
-0.03680265694856644,
-0.1526925265789032,
-0.010608263313770294,
0.10472431033849716,
-0.3624231517314911,
-0.10162514448165894,
-0.22001248598098755,
0.12340238690376282,
0.08671784400939941,
-0.14419013261795044,
0.06113951653242111,
0.18324196338653564,
-0.0888630747795105,
-0.3408278822898865,
0.31641674041748047,
0.15318405628204346,
-0.0006018206477165222,
-0.035708628594875336,
0.013320354744791985,
-0.1950511336326599,
0.23094870150089264,
-0.12234370410442352,
0.42480412125587463,
0.36803123354911804,
0.05321858823299408,
0.17426374554634094,
-0.33239999413490295,
0.017652884125709534,
0.1321507841348648,
0.23042817413806915,
0.08444134891033173,
0.15164142847061157,
0.08638252317905426,
-0.14902490377426147,
0.21267691254615784,
0.2117227166891098,
0.332374632358551,
-0.020718183368444443,
-0.20155203342437744,
-0.24629539251327515,
-0.03974061459302902,
0.15707990527153015,
-0.25373736023902893,
0.0851956233382225,
0.09092339873313904,
0.21975192427635193,
-0.08587966114282608,
0.3313581645488739,
0.6758142709732056,
-0.0007342994213104248,
-0.227597177028656,
0.07171837985515594,
0.44101405143737793,
-0.08867073059082031,
0.12259986996650696,
0.5329570770263672,
-0.11058907955884933,
0.12789666652679443,
0.15688224136829376,
0.3165097236633301,
0.11937665939331055,
0.6224542856216431,
-0.05137376859784126,
0.5728338360786438,
0.11344361305236816,
0.20108044147491455,
0.16790328919887543,
-0.13161499798297882,
0.34921956062316895,
0.41654902696609497,
0.1084224283695221,
0.34552356600761414,
0.21890127658843994,
0.28326311707496643,
-0.06547274440526962,
-0.3212532699108124,
-0.09107858687639236,
0.23107463121414185,
0.0027123820036649704,
0.07540766149759293,
-0.09575876593589783,
-0.0641275942325592,
-0.27883756160736084,
0.2621081471443176,
-0.15604467689990997,
-0.2744363248348236,
0.19205933809280396,
0.12998129427433014,
-0.4276432693004608,
-0.5721254944801331,
-0.22219428420066833,
0.12331736087799072,
0.2117432951927185,
-0.23212064802646637,
0.26216739416122437,
0.258428692817688,
-0.23279651999473572,
0.48357582092285156,
0.44297489523887634,
0.5232609510421753,
0.2812565267086029,
-0.08288291841745377,
-0.06787626445293427,
0.3737582564353943,
0.046785034239292145,
-0.20666976273059845,
-0.17622382938861847,
0.148427814245224,
-0.2462959587574005,
0.16940514743328094,
0.12133153527975082,
-0.17435196042060852,
-0.1988547295331955,
-0.29222244024276733,
0.179965540766716,
0.13388782739639282,
0.3100200593471527,
-0.5382331013679504,
-0.011222325265407562,
-0.16794657707214355,
-0.07647071778774261,
-0.5712470412254333,
-0.03650951385498047,
0.3821395933628082,
-0.03830007463693619,
0.1512959897518158,
0.05561365187168121,
0.07685920596122742,
-0.05852571502327919,
0.2949036657810211,
0.5214978456497192,
-0.2577073574066162,
-0.0801176205277443,
-0.25904905796051025,
-0.5859424471855164,
0.09052387624979019,
0.12632741034030914,
0.049134381115436554,
0.2462063729763031,
0.06477031111717224,
-0.04496725648641586,
-0.18756921589374542,
0.2875787317752838,
-0.1525120884180069,
0.22774779796600342,
0.05191952735185623,
-0.16161376237869263,
-0.09436741471290588,
0.055020805448293686,
-0.1379396766424179,
0.005236722528934479,
-0.21858276426792145,
0.3418596088886261,
-0.19896680116653442,
-0.005984991788864136,
-0.13762235641479492,
0.3173603117465973,
-0.03178613260388374,
-0.07911649346351624,
0.2061464488506317,
0.15787798166275024,
0.3118325173854828,
-0.2043740451335907,
-0.3119076192378998,
-0.23694294691085815,
-0.0631491094827652,
-0.5024840235710144,
0.217754065990448,
-0.2340938299894333,
0.6632137894630432,
-0.10847523808479309,
-0.3090561032295227,
-0.2802532911300659,
0.08136837184429169,
0.36241868138313293,
-0.21438206732273102,
-0.2344767451286316,
0.06250199675559998,
-0.29623374342918396,
-0.10538224875926971,
0.2913661599159241,
0.5342788100242615,
0.12720192968845367,
0.17053361237049103,
-0.2216363251209259,
-0.41813570261001587,
0.38949447870254517,
-0.15851137042045593,
-0.051852695643901825,
0.0330970473587513,
0.15984944999217987,
0.03631255775690079,
-0.18628095090389252,
-0.8884111642837524,
0.11397425830364227,
0.06180604547262192,
-0.1931898593902588,
-0.02086496725678444,
0.3951140344142914,
-0.015243152156472206,
0.12262830138206482,
-0.014462076127529144,
0.14117597043514252,
0.17853233218193054,
-0.331359326839447,
-0.028664596378803253,
-0.04594486951828003
] |
https://github.com/huggingface/datasets/issues/5708 | I have just included as well the conversion from MB to GB if necessary. See:
- https://huggingface.co/datasets/bookcorpus/discussions/2/files
- https://huggingface.co/datasets/asnq/discussions/2/files | Dataset sizes are in MiB instead of MB in dataset cards | As @severo reported in an internal discussion (https://github.com/huggingface/moon-landing/issues/5929):
Now we show the dataset size:
- from the dataset card (in the side column)
- from the datasets-server (in the viewer)
But, even if the size is the same, we see a mismatch because the viewer shows MB, while the info from the README generally shows MiB (even if it's written MB -> https://huggingface.co/datasets/blimp/blob/main/README.md?code=true#L1932)
<img width="664" alt="Capture d’écran 2023-04-04 à 10 16 01" src="https://user-images.githubusercontent.com/1676121/229730887-0bd8fa6e-9462-46c6-bd4e-4d2c5784cabb.png">
TODO: Values to be fixed in: `Size of downloaded dataset files:`, `Size of the generated dataset:` and `Total amount of disk used:`
- [x] Bulk edit on the Hub to fix this in all canonical datasets
- [x] Bulk PR on the Hub to fix ancient canonical datasets that were moved to organizations | 19 | Dataset sizes are in MiB instead of MB in dataset cards
As @severo reported in an internal discussion (https://github.com/huggingface/moon-landing/issues/5929):
Now we show the dataset size:
- from the dataset card (in the side column)
- from the datasets-server (in the viewer)
But, even if the size is the same, we see a mismatch because the viewer shows MB, while the info from the README generally shows MiB (even if it's written MB -> https://huggingface.co/datasets/blimp/blob/main/README.md?code=true#L1932)
<img width="664" alt="Capture d’écran 2023-04-04 à 10 16 01" src="https://user-images.githubusercontent.com/1676121/229730887-0bd8fa6e-9462-46c6-bd4e-4d2c5784cabb.png">
TODO: Values to be fixed in: `Size of downloaded dataset files:`, `Size of the generated dataset:` and `Total amount of disk used:`
- [x] Bulk edit on the Hub to fix this in all canonical datasets
- [x] Bulk PR on the Hub to fix ancient canonical datasets that were moved to organizations
I have just included as well the conversion from MB to GB if necessary. See:
- https://huggingface.co/datasets/bookcorpus/discussions/2/files
- https://huggingface.co/datasets/asnq/discussions/2/files | [
-0.25288209319114685,
-0.4595600664615631,
0.030742637813091278,
0.40320414304733276,
0.05378488823771477,
-0.04627220332622528,
0.06590965390205383,
0.1412510722875595,
0.09253361821174622,
0.29250848293304443,
-0.07427690923213959,
0.032737456262111664,
0.0014762841165065765,
0.5542909502983093,
0.08542977273464203,
0.08900018036365509,
0.20447884500026703,
0.08786336332559586,
-0.43302297592163086,
0.017377018928527832,
-0.30166345834732056,
0.30114808678627014,
-0.09939680993556976,
-0.4167293906211853,
-0.2530101537704468,
0.12887892127037048,
0.011695131659507751,
-0.06105516850948334,
-0.6216244697570801,
-0.3626369535923004,
0.18354074656963348,
-0.12237012386322021,
0.16347457468509674,
0.22903481125831604,
-0.00011344918311806396,
-0.19453078508377075,
0.1762046217918396,
-0.06333265453577042,
-0.3591013252735138,
0.14708323776721954,
0.17178982496261597,
-0.18745100498199463,
0.030303433537483215,
0.06296247243881226,
-0.00677480548620224,
0.015359155833721161,
0.18824274837970734,
0.0028039216995239258,
-0.03367401286959648,
0.07484830915927887,
0.2352679967880249,
0.27195262908935547,
0.07926222681999207,
-0.032052308320999146,
0.0651518851518631,
0.5671073198318481,
0.091307133436203,
0.1728268414735794,
0.0851060301065445,
0.3136886954307556,
-0.12861482799053192,
0.45376455783843994,
0.27538949251174927,
0.0024099573493003845,
0.3435644209384918,
0.06564253568649292,
0.186329185962677,
-0.06885205209255219,
0.1643037497997284,
0.0027719372883439064,
0.23020653426647186,
-0.2925465404987335,
-0.2790868282318115,
-0.343466579914093,
-0.10960569232702255,
0.04781319200992584,
0.2707430422306061,
0.3043231964111328,
0.04532682150602341,
0.007113748230040073,
-0.7975578904151917,
-0.1291322410106659,
0.021011829376220703,
-0.030287444591522217,
-0.2519491910934448,
0.1890702247619629,
-0.33097824454307556,
0.0956585481762886,
-0.2036498486995697,
-0.08359910547733307,
0.04465828835964203,
-0.010477150790393353,
0.01782996393740177,
-0.010572576895356178,
-0.039585236459970474,
-0.0062659382820129395,
-0.02108640968799591,
0.2650187611579895,
0.19432637095451355,
0.04022972285747528,
-0.010692665353417397,
-0.11674502491950989,
-0.0633937194943428,
0.0430971197783947,
0.17230406403541565,
0.2999184727668762,
-0.006928350776433945,
-0.05867135524749756,
-0.01160166971385479,
0.3438676595687866,
0.17220725119113922,
0.037139248102903366,
0.12700356543064117,
-0.09702523052692413,
-0.5390327572822571,
-0.32732057571411133,
0.05858553946018219,
-0.4026370942592621,
-0.1710994988679886,
-0.07797017693519592,
-0.0513836070895195,
-0.02191322110593319,
-0.05185655876994133,
0.24722197651863098,
-0.19546619057655334,
0.1534145623445511,
0.23302902281284332,
-0.014528529718518257,
-0.15498915314674377,
-0.3103315234184265,
-0.2390088140964508,
-0.1736268699169159,
-0.1758471131324768,
0.11639098078012466,
0.07855929434299469,
-0.2345442771911621,
0.33331751823425293,
0.20051687955856323,
0.09440824389457703,
0.15247488021850586,
-0.24065443873405457,
0.11247777938842773,
0.29221946001052856,
0.29802989959716797,
0.03530809283256531,
0.04061552882194519,
-0.09461937844753265,
0.15378302335739136,
-0.24870513379573822,
0.14412133395671844,
-0.023284420371055603,
0.04005026817321777,
-0.23887205123901367,
0.1975010186433792,
-0.3046928942203522,
-0.031102266162633896,
-0.41753754019737244,
0.19402667880058289,
0.03038787469267845,
-0.10556820780038834,
0.1466386318206787,
-0.003314673900604248,
-0.1384584903717041,
-0.07541806995868683,
0.33354276418685913,
0.19495879113674164,
-0.26741868257522583,
-0.303058385848999,
-0.03464392200112343,
-0.0310073159635067,
0.3118617832660675,
0.17484654486179352,
0.05591500177979469,
0.1065383329987526,
-0.5589417219161987,
-0.02471432089805603,
-0.390066921710968,
-0.14434754848480225,
-0.3988398313522339,
0.1460505723953247,
0.0070021748542785645,
0.04536008834838867,
0.11938734352588654,
0.09305480122566223,
0.24425728619098663,
0.008871134370565414,
0.16608142852783203,
0.0618382953107357,
0.019839050248265266,
0.1101001501083374,
-0.4084707200527191,
-0.5252158641815186,
0.03734108805656433,
0.0721125453710556,
0.1610729992389679,
-0.03365461528301239,
0.2550615072250366,
0.30333399772644043,
0.3456854224205017,
0.12799130380153656,
0.05293086916208267,
0.1671065241098404,
0.14536124467849731,
-0.36443400382995605,
-0.06019851565361023,
-0.028177108615636826,
-0.2107830047607422,
0.17575159668922424,
-0.18537884950637817,
0.1668124794960022,
0.3097802698612213,
-0.22312040627002716,
-0.3225057125091553,
-0.17989438772201538,
-0.005752775818109512,
-0.22472122311592102,
0.06670146435499191,
0.11429761350154877,
0.08737687021493912,
-0.07505130022764206,
0.07972295582294464,
0.1758977472782135,
-0.21410620212554932,
0.06839577853679657,
-0.5363231897354126,
0.3919680118560791,
-0.07283012568950653,
-0.050090424716472626,
0.3026164472103119,
0.017811372876167297,
0.040178894996643066,
-0.027734719216823578,
-0.05186986178159714,
0.3920549750328064,
-0.09883680939674377,
0.28028056025505066,
0.2018243819475174,
0.1086357980966568,
0.3572290539741516,
-0.10269352048635483,
0.28376254439353943,
0.13423195481300354,
-0.21601757407188416,
0.12314193695783615,
-0.3168722987174988,
0.36486345529556274,
-0.11648812890052795,
-0.08861862123012543,
0.08476488292217255,
-0.13642354309558868,
-0.137409508228302,
0.1926111876964569,
-0.0034493915736675262,
-0.519040584564209,
0.13449643552303314,
0.01048056036233902,
0.09986935555934906,
0.19245359301567078,
-0.18920740485191345,
0.11950382590293884,
0.6896357536315918,
0.10848802328109741,
-0.232358917593956,
0.2577483057975769,
-0.47883474826812744,
-0.3156017065048218,
0.5106290578842163,
0.12514668703079224,
0.26926347613334656,
0.3408520519733429,
0.23752957582473755,
0.2896174490451813,
0.07632981985807419,
-0.11632618308067322,
0.1472049504518509,
-0.05550765246152878,
-0.3326421082019806,
-0.042924560606479645,
0.09367271512746811,
-0.19484993815422058,
-0.2889917492866516,
0.5182546377182007,
-0.013764053583145142,
0.010168908163905144,
-0.37960049510002136,
-0.24766582250595093,
-0.10984532535076141,
-0.3006647229194641,
-0.5208736658096313,
-0.2878968119621277,
-0.5003453493118286,
-0.3366866707801819,
0.12370482087135315,
0.1048719584941864,
0.13912686705589294,
-0.03903372213244438,
0.0020562931895256042,
0.17427417635917664,
-0.17010098695755005,
0.19093674421310425,
0.10791077464818954,
0.2517927289009094,
-0.1448192447423935,
0.12850971519947052,
0.0467180572450161,
0.04070566967129707,
0.4221200942993164,
-0.47952336072921753,
0.0940576121211052,
-0.35062822699546814,
-0.6043544411659241,
0.2770227789878845,
-0.03850245475769043,
0.1004917323589325,
0.16415800154209137,
0.001528952270746231,
0.001315474510192871,
0.24614408612251282,
-0.04197424277663231,
-0.035041023045778275,
-0.19019292294979095,
-0.1245202124118805,
-0.3351539969444275,
-0.010265719145536423,
-0.3433706760406494,
-0.2860485911369324,
-0.09496133774518967,
-0.22167497873306274,
0.17467020452022552,
0.015844322741031647,
0.2678171694278717,
0.14041849970817566,
0.13950306177139282,
-0.009785782545804977,
-0.32475489377975464,
0.0332934632897377,
-0.3504446744918823,
-0.6734304428100586,
-0.01968412846326828,
-0.220818892121315,
-0.3179512023925781,
0.17356142401695251,
0.3288007378578186,
0.2593240439891815,
-0.009853977710008621,
-0.6655973196029663,
-0.3765619993209839,
-0.22581404447555542,
-0.07738956063985825,
0.11950799822807312,
0.29102808237075806,
0.050295956432819366,
-0.10177938640117645,
-0.06771525740623474,
-0.17072349786758423,
-0.31452393531799316,
-0.10626603662967682,
0.23053552210330963,
0.6238014101982117,
-0.022879591211676598,
-0.15315327048301697,
0.06818094849586487,
0.29961884021759033,
0.6190322041511536,
-0.13839399814605713,
0.14160726964473724,
0.004396772012114525,
0.43069422245025635,
-0.16116607189178467,
0.11983809620141983,
0.6723095774650574,
0.03317221999168396,
0.04411417245864868,
0.5329905152320862,
0.12722143530845642,
0.35657015442848206,
0.14440667629241943,
0.09665847569704056,
-0.20763704180717468,
-0.23851467669010162,
-0.029157716780900955,
0.010836532339453697,
-0.06714624166488647,
-0.06670711934566498,
0.0800713300704956,
-0.10176409780979156,
-0.17658711969852448,
0.0034393630921840668,
0.03978755697607994,
-0.08276627957820892,
0.30585014820098877,
-0.1569652259349823,
-0.11974303424358368,
-0.5415083765983582,
0.2814252972602844,
-0.17537619173526764,
0.23880916833877563,
-0.09247663617134094,
0.019503295421600342,
0.11991515010595322,
0.16838626563549042,
0.4288283884525299,
-0.13209909200668335,
-0.0475536584854126,
-0.4331226348876953,
-0.07214938849210739,
-0.46052926778793335,
-0.00021882355213165283,
0.03437589108943939,
-0.033610738813877106,
0.38049599528312683,
0.5322579145431519,
-0.19873787462711334,
-0.07703407108783722,
0.07567152380943298,
0.20705729722976685,
-0.09077537059783936,
-0.021681886166334152,
-0.35133105516433716,
0.0026914551854133606,
-0.19552180171012878,
-0.21722997725009918,
-0.027646660804748535,
0.004849318414926529,
-0.1029830127954483,
-0.1829492449760437,
-0.12044425308704376,
-0.09054697304964066,
0.09204787760972977,
0.18880264461040497,
0.502349317073822,
-0.055328890681266785,
0.21176502108573914,
0.5232254862785339,
0.5326083898544312,
0.45928287506103516,
0.866278886795044,
-0.22860866785049438,
-0.11255180090665817,
0.1697865128517151,
-0.006471380591392517,
0.14000843465328217,
0.5041027665138245,
0.1324743628501892,
-0.07625342905521393,
0.3073009252548218,
0.31715667247772217,
-0.5972996950149536,
0.2094961553812027,
-0.0718277096748352,
0.04797745868563652,
-0.24370723962783813,
-0.20739108324050903,
0.25177597999572754,
0.23213604092597961,
0.09983421862125397,
0.061408188194036484,
0.2925359010696411,
-0.28468918800354004,
0.05017082393169403,
0.06414645910263062,
0.7712483406066895,
-0.09479153156280518,
0.10840417444705963,
-0.03422486037015915,
-0.34011879563331604,
0.13550859689712524,
0.06054317206144333,
0.037444304674863815,
-0.37956252694129944,
-0.031185900792479515,
-0.09977038204669952,
0.08472032099962234,
-0.0830480307340622,
-0.20678004622459412,
-0.35209476947784424,
0.2893598973751068,
0.14214164018630981,
0.31679394841194153,
-0.1519627869129181,
0.11919118463993073,
-0.29633668065071106,
-0.11815518885850906,
-0.19841808080673218,
0.13102522492408752,
-0.31725791096687317,
0.2811332046985626,
-0.12734490633010864,
0.0017108507454395294,
-0.07379430532455444,
-0.1604682207107544,
-0.3299432396888733,
-0.04986363649368286,
-0.39493003487586975,
-0.323382169008255,
0.08922779560089111,
0.06551197171211243,
-0.0904814600944519,
0.22320809960365295,
0.24226371943950653,
0.0018944302573800087,
-0.22393283247947693,
0.18297556042671204,
-0.34457927942276,
0.14226724207401276,
-0.1172223761677742,
0.15639927983283997,
0.09803856164216995,
0.04528825730085373,
-0.08307898789644241,
-0.18339285254478455,
0.12726262211799622,
0.27019786834716797,
-0.22085173428058624,
0.004530351608991623,
-0.00011549796909093857,
-0.20067496597766876,
-0.05331218242645264,
-0.35109347105026245,
0.10417775064706802,
-0.13633377850055695,
0.11396622657775879,
-0.1545884758234024,
0.04872184991836548,
0.20141398906707764,
0.37102752923965454,
-0.35296517610549927,
-0.31393519043922424,
0.5435266494750977,
-0.1232677772641182,
-0.07573646306991577,
-0.08482664823532104,
0.08574124425649643,
-0.08053217828273773,
0.04135487228631973,
0.1679929792881012,
0.18736189603805542,
-0.42944732308387756,
-0.013807032257318497,
-0.17642110586166382,
-0.06245805323123932,
0.20923392474651337,
0.29938650131225586,
0.46453824639320374,
-0.22543680667877197,
-0.13409292697906494,
-0.15248838067054749,
-0.3858465254306793,
0.2764481008052826,
-0.1903933435678482,
0.483799010515213,
0.14483793079853058,
0.015597250312566757,
0.04003741592168808,
0.051366545259952545,
-0.3025924265384674,
0.09738568961620331,
-0.039391398429870605,
0.18113085627555847,
-0.043318234384059906,
0.018188830465078354,
0.1427973061800003,
-0.19853731989860535,
-0.002727571874856949,
0.11327557265758514,
-0.34321659803390503,
-0.08182308077812195,
-0.10629281401634216,
0.09572964906692505,
0.12123910337686539,
-0.1879003345966339,
0.019467338919639587,
0.16209635138511658,
-0.10072129219770432,
-0.2667694687843323,
0.3361963629722595,
0.31515440344810486,
-0.021749883890151978,
-0.14819933474063873,
-0.10892832279205322,
-0.10408511757850647,
0.09143944084644318,
-0.13475629687309265,
0.4294230341911316,
0.4421660304069519,
0.0062098316848278046,
0.08995885401964188,
-0.29202133417129517,
0.042676568031311035,
0.15757966041564941,
0.22312116622924805,
0.13186584413051605,
0.13004831969738007,
0.08514101058244705,
-0.0565376877784729,
0.20157764852046967,
0.14888611435890198,
0.336671382188797,
-0.1408742368221283,
-0.14639794826507568,
-0.2659851610660553,
0.0359095074236393,
0.15976396203041077,
-0.1512061357498169,
-0.008176736533641815,
0.12650632858276367,
0.15493609011173248,
-0.04828988015651703,
0.27012714743614197,
0.5550100803375244,
0.14643576741218567,
-0.1697324961423874,
-0.0055007971823215485,
0.42077526450157166,
0.04641791060566902,
0.12917214632034302,
0.47371503710746765,
-0.13919514417648315,
0.18828622996807098,
0.276268869638443,
0.24376657605171204,
0.18895107507705688,
0.5385237336158752,
-0.09513093531131744,
0.4244389235973358,
0.06833304464817047,
0.22234541177749634,
0.2427787184715271,
-0.004232339560985565,
0.07992535829544067,
0.30068954825401306,
-0.037587523460388184,
0.3211592733860016,
0.1537633091211319,
0.45800983905792236,
-0.16304972767829895,
-0.25392043590545654,
-0.18551282584667206,
0.09529419988393784,
-0.11408643424510956,
0.11622512340545654,
-0.0790468230843544,
-0.11848583072423935,
-0.2842159867286682,
0.23137104511260986,
-0.15815448760986328,
-0.3194509744644165,
0.26934266090393066,
0.04524102807044983,
-0.331062912940979,
-0.5034785866737366,
-0.17929117381572723,
0.1330977827310562,
0.05362585932016373,
-0.17949733138084412,
0.3281867802143097,
0.12300805747509003,
-0.1485450565814972,
0.4906209409236908,
0.3980623781681061,
0.5028316378593445,
0.19334642589092255,
0.16572241485118866,
-0.1332596093416214,
0.4461357593536377,
0.012508250772953033,
-0.17717424035072327,
-0.20214533805847168,
0.17940714955329895,
-0.2485712319612503,
0.2005414366722107,
0.16732783615589142,
-0.18866415321826935,
-0.19527357816696167,
-0.24202775955200195,
0.17872852087020874,
0.08568142354488373,
0.24132639169692993,
-0.6885383129119873,
0.013108834624290466,
-0.12854033708572388,
-0.1600986272096634,
-0.6300836205482483,
0.017696596682071686,
0.16471636295318604,
0.001352887600660324,
0.1854677051305771,
-0.026044152677059174,
0.07119089365005493,
0.045727699995040894,
0.1905309110879898,
0.43523773550987244,
-0.2693411707878113,
-0.0754588395357132,
-0.2678688168525696,
-0.5439982414245605,
0.07556451112031937,
0.15198837220668793,
0.17922073602676392,
0.03185088932514191,
0.10635556280612946,
-0.09319034218788147,
-0.17609941959381104,
0.384385347366333,
-0.059170160442590714,
0.22736644744873047,
-0.004556138068437576,
-0.05497027933597565,
-0.12779372930526733,
0.11474485695362091,
-0.12129303812980652,
-0.027747750282287598,
-0.1068333238363266,
0.3100259304046631,
-0.2434522807598114,
-0.023306626826524734,
-0.1865496039390564,
0.39062464237213135,
-0.2001500129699707,
-0.10630299896001816,
0.31618186831474304,
0.18243324756622314,
0.3635329604148865,
-0.18989521265029907,
-0.3000108003616333,
-0.08770284056663513,
-0.04346994683146477,
-0.444384902715683,
0.2604510486125946,
-0.3456743657588959,
0.6143916249275208,
-0.05865532532334328,
-0.34745165705680847,
-0.27558010816574097,
0.1355658918619156,
0.2970049977302551,
-0.19726787507534027,
-0.23826229572296143,
0.08566556125879288,
-0.32977789640426636,
-0.16925166547298431,
0.26385608315467834,
0.4669891893863678,
0.02893870323896408,
0.12527017295360565,
-0.12105032801628113,
-0.4038483500480652,
0.3219255208969116,
-0.034189894795417786,
0.16090556979179382,
0.12225199490785599,
0.03382496163249016,
0.17097318172454834,
-0.2840171754360199,
-0.8351396918296814,
0.11775493621826172,
0.1301649659872055,
-0.20116963982582092,
0.16462603211402893,
0.34151631593704224,
-0.06155649572610855,
0.09938396513462067,
-0.06581588834524155,
0.3323638439178467,
0.2545601725578308,
-0.375610888004303,
0.15794944763183594,
-0.023335978388786316
] |
https://github.com/huggingface/datasets/issues/5708 | First, I tested some batches to check the changes made. Then I incorporated the MB to GB conversion. Now I'm running the rest. | Dataset sizes are in MiB instead of MB in dataset cards | As @severo reported in an internal discussion (https://github.com/huggingface/moon-landing/issues/5929):
Now we show the dataset size:
- from the dataset card (in the side column)
- from the datasets-server (in the viewer)
But, even if the size is the same, we see a mismatch because the viewer shows MB, while the info from the README generally shows MiB (even if it's written MB -> https://huggingface.co/datasets/blimp/blob/main/README.md?code=true#L1932)
<img width="664" alt="Capture d’écran 2023-04-04 à 10 16 01" src="https://user-images.githubusercontent.com/1676121/229730887-0bd8fa6e-9462-46c6-bd4e-4d2c5784cabb.png">
TODO: Values to be fixed in: `Size of downloaded dataset files:`, `Size of the generated dataset:` and `Total amount of disk used:`
- [x] Bulk edit on the Hub to fix this in all canonical datasets
- [x] Bulk PR on the Hub to fix ancient canonical datasets that were moved to organizations | 23 | Dataset sizes are in MiB instead of MB in dataset cards
As @severo reported in an internal discussion (https://github.com/huggingface/moon-landing/issues/5929):
Now we show the dataset size:
- from the dataset card (in the side column)
- from the datasets-server (in the viewer)
But, even if the size is the same, we see a mismatch because the viewer shows MB, while the info from the README generally shows MiB (even if it's written MB -> https://huggingface.co/datasets/blimp/blob/main/README.md?code=true#L1932)
<img width="664" alt="Capture d’écran 2023-04-04 à 10 16 01" src="https://user-images.githubusercontent.com/1676121/229730887-0bd8fa6e-9462-46c6-bd4e-4d2c5784cabb.png">
TODO: Values to be fixed in: `Size of downloaded dataset files:`, `Size of the generated dataset:` and `Total amount of disk used:`
- [x] Bulk edit on the Hub to fix this in all canonical datasets
- [x] Bulk PR on the Hub to fix ancient canonical datasets that were moved to organizations
First, I tested some batches to check the changes made. Then I incorporated the MB to GB conversion. Now I'm running the rest. | [
-0.24703067541122437,
-0.4211527705192566,
0.07354752719402313,
0.29551488161087036,
0.10169419646263123,
-0.006690613925457001,
0.08733142167329788,
0.22690634429454803,
0.15091241896152496,
0.26976513862609863,
-0.11977491527795792,
0.11481043696403503,
-0.047404877841472626,
0.49410179257392883,
0.05962807685136795,
0.08553504943847656,
0.19867472350597382,
0.09944136440753937,
-0.424237459897995,
0.020478293299674988,
-0.31647324562072754,
0.22060656547546387,
-0.0997372567653656,
-0.42448049783706665,
-0.30035051703453064,
0.16660477221012115,
-0.057653170078992844,
0.02183498442173004,
-0.5809025168418884,
-0.3114998936653137,
0.12453625351190567,
-0.1095832958817482,
0.14296181499958038,
0.24341847002506256,
-0.00010947151167783886,
-0.21038313210010529,
0.2224506139755249,
-0.05312275141477585,
-0.3220168650150299,
0.16394658386707306,
0.24297218024730682,
-0.16562089323997498,
0.006569474935531616,
0.001967489719390869,
0.008681602776050568,
0.011597532778978348,
0.14824028313159943,
0.07385815680027008,
0.12875212728977203,
0.06774713844060898,
0.27361881732940674,
0.23643706738948822,
0.10822674632072449,
-0.02237316407263279,
0.02442375384271145,
0.5513457655906677,
0.025914184749126434,
0.1603822410106659,
0.11773467808961868,
0.2516404092311859,
-0.1319124400615692,
0.4258926510810852,
0.22116270661354065,
0.041542526334524155,
0.23735816776752472,
0.019353285431861877,
0.1634242981672287,
-0.09084754437208176,
0.13719576597213745,
-0.006969207897782326,
0.13397492468357086,
-0.2678879201412201,
-0.27669763565063477,
-0.3467146158218384,
-0.0260323416441679,
-0.0751929059624672,
0.2396024912595749,
0.2715480923652649,
-0.05484135076403618,
-0.05007454752922058,
-0.7689158916473389,
-0.1362852305173874,
-0.02979673445224762,
-0.1160864382982254,
-0.2445480078458786,
0.19745305180549622,
-0.29931432008743286,
0.060179729014635086,
-0.16108989715576172,
-0.03263808786869049,
0.037923119962215424,
0.060016077011823654,
0.0802524983882904,
-0.06953230500221252,
-0.05251673236489296,
-0.004315555095672607,
0.047375790774822235,
0.2811785638332367,
0.2214207798242569,
0.033320918679237366,
-0.02619102969765663,
-0.025794081389904022,
0.0074663832783699036,
0.02702421136200428,
0.0946449488401413,
0.33698177337646484,
-0.10179458558559418,
-0.08809620887041092,
0.032570868730545044,
0.3443692922592163,
0.06434960663318634,
0.07334716618061066,
0.11633612215518951,
-0.1669411063194275,
-0.4980679154396057,
-0.24563509225845337,
0.13768446445465088,
-0.4161701500415802,
-0.08387771248817444,
-0.10239680111408234,
-0.057025693356990814,
0.04494275525212288,
-0.1697702407836914,
0.25578075647354126,
-0.17707601189613342,
0.11784462630748749,
0.22984009981155396,
0.014393849298357964,
-0.15980002284049988,
-0.2618950605392456,
-0.24061526358127594,
-0.1576797068119049,
-0.19784778356552124,
0.16636133193969727,
0.13886509835720062,
-0.18035481870174408,
0.315851092338562,
0.2339034527540207,
0.06006470322608948,
0.1300927996635437,
-0.2190447300672531,
0.15958470106124878,
0.21763937175273895,
0.3087141513824463,
0.1166364997625351,
0.016461998224258423,
-0.08485797047615051,
0.14212386310100555,
-0.2071658968925476,
0.1682819128036499,
-0.005522182211279869,
-0.03687426447868347,
-0.22599627077579498,
0.22468067705631256,
-0.35382628440856934,
-0.024964308366179466,
-0.47868379950523376,
0.181552454829216,
0.0405922532081604,
-0.02585141360759735,
0.03246545046567917,
-0.0026074014604091644,
-0.06179076433181763,
-0.057991400361061096,
0.34819287061691284,
0.2228456735610962,
-0.23378579318523407,
-0.25350630283355713,
-0.05258148908615112,
0.02083417773246765,
0.3648236095905304,
0.17506960034370422,
0.10011403262615204,
0.14666347205638885,
-0.5196377635002136,
-0.000640377402305603,
-0.4751605987548828,
-0.06924623996019363,
-0.30921632051467896,
0.08217215538024902,
-0.03609524667263031,
0.10171426832675934,
0.044785890728235245,
-0.06053129583597183,
0.26023274660110474,
-0.03131258115172386,
0.1873241662979126,
0.08237603306770325,
-0.040634505450725555,
0.12940067052841187,
-0.4578518867492676,
-0.42887750267982483,
-0.018961887806653976,
0.1355833113193512,
0.19227328896522522,
-0.03578275442123413,
0.1711365133523941,
0.3244810402393341,
0.24346938729286194,
0.013361725024878979,
0.13255411386489868,
0.21426543593406677,
0.1830022931098938,
-0.3907158374786377,
-0.05826832354068756,
-0.007534556090831757,
-0.16991499066352844,
0.2134827971458435,
-0.16451284289360046,
0.26274925470352173,
0.2560889720916748,
-0.1883580982685089,
-0.31687092781066895,
-0.14010578393936157,
-0.0881919264793396,
-0.22378244996070862,
0.10506455600261688,
0.09957726299762726,
0.09705647081136703,
-0.04987324774265289,
0.05590236186981201,
0.1849457323551178,
-0.2149113416671753,
0.07971194386482239,
-0.49055197834968567,
0.4164366126060486,
-0.14650215208530426,
-0.15133613348007202,
0.30029967427253723,
0.10359792411327362,
0.03227118402719498,
-0.12905989587306976,
-0.09260573983192444,
0.37471356987953186,
-0.17307430505752563,
0.22073139250278473,
0.2569480240345001,
0.049582548439502716,
0.3750290274620056,
-0.17096012830734253,
0.27461206912994385,
0.12999454140663147,
-0.1924736648797989,
0.06249050796031952,
-0.27141979336738586,
0.42601722478866577,
-0.1578400731086731,
-0.04678584262728691,
0.09161446988582611,
-0.08319538086652756,
-0.10423999279737473,
0.10161395370960236,
0.028545677661895752,
-0.44954168796539307,
0.11038009822368622,
-0.004185672849416733,
0.07873572409152985,
0.16627097129821777,
-0.1757526993751526,
0.1291607916355133,
0.658825159072876,
0.08902429789304733,
-0.1821276843547821,
0.3246404230594635,
-0.3843342661857605,
-0.3639868199825287,
0.43075427412986755,
0.07821044325828552,
0.2627236247062683,
0.35054051876068115,
0.2620464563369751,
0.3419002890586853,
0.06818007677793503,
-0.09079689532518387,
0.19150730967521667,
-0.07102730870246887,
-0.3019465208053589,
-0.005479516461491585,
0.16591031849384308,
-0.1310255229473114,
-0.3463229537010193,
0.43234461545944214,
0.02131207287311554,
0.057684220373630524,
-0.33188575506210327,
-0.3153352737426758,
-0.07619652897119522,
-0.24224098026752472,
-0.47532251477241516,
-0.25702300667762756,
-0.42318272590637207,
-0.3411233127117157,
0.16785013675689697,
0.14422281086444855,
0.1045532375574112,
0.10396001487970352,
0.12351378798484802,
0.17483094334602356,
-0.12055855989456177,
0.17214566469192505,
-0.028570525348186493,
0.20644745230674744,
-0.14289475977420807,
0.14945140480995178,
0.11002326011657715,
0.04637620598077774,
0.38962018489837646,
-0.40357398986816406,
0.10475596785545349,
-0.39424413442611694,
-0.6366233825683594,
0.2470530867576599,
-0.165290966629982,
0.09245564043521881,
0.10080435872077942,
0.0834721177816391,
0.013757504522800446,
0.25153160095214844,
0.02047412469983101,
-0.05161610245704651,
-0.19407033920288086,
-0.08298113942146301,
-0.35847264528274536,
-0.06756451725959778,
-0.37059640884399414,
-0.27036622166633606,
0.004426872357726097,
-0.31752684712409973,
0.16380228102207184,
-0.008536718785762787,
0.22735373675823212,
0.17956814169883728,
0.19219008088111877,
0.016087431460618973,
-0.2097519487142563,
-0.02296079881489277,
-0.29638203978538513,
-0.6163357496261597,
0.01103989128023386,
-0.30079901218414307,
-0.31943821907043457,
0.15816769003868103,
0.4052053689956665,
0.24040362238883972,
-0.04408460110425949,
-0.6616403460502625,
-0.4315396547317505,
-0.22283445298671722,
-0.027354657649993896,
0.08647770434617996,
0.2651466429233551,
0.0800800770521164,
-0.039909545332193375,
-0.13628986477851868,
-0.1562630832195282,
-0.3125607371330261,
-0.10510243475437164,
0.21837712824344635,
0.5598874092102051,
-0.006997325457632542,
-0.11010676622390747,
0.08216120302677155,
0.3426899313926697,
0.5420020222663879,
-0.1145617738366127,
0.22411684691905975,
-0.0001855120062828064,
0.4003508985042572,
-0.20053553581237793,
0.03695661574602127,
0.7401113510131836,
0.010771580040454865,
0.00963609665632248,
0.51227205991745,
0.12861424684524536,
0.2900282144546509,
0.14117741584777832,
0.11551248282194138,
-0.20226693153381348,
-0.26833704113960266,
-0.01855061762034893,
0.0507681779563427,
-0.10302262753248215,
-0.0023764297366142273,
-0.008269205689430237,
-0.12577927112579346,
-0.11387230455875397,
0.04540025442838669,
0.02625979110598564,
-0.054573480039834976,
0.22737106680870056,
-0.184273824095726,
-0.062154464423656464,
-0.6073072552680969,
0.32087618112564087,
-0.2866182327270508,
0.18990370631217957,
-0.15535779297351837,
0.012830555438995361,
0.08749767392873764,
0.11939260363578796,
0.4091361463069916,
-0.15916602313518524,
0.018482619896531105,
-0.3669288754463196,
-0.06302952766418457,
-0.48311999440193176,
-0.04095453768968582,
0.010580077767372131,
0.03982698544859886,
0.4227340519428253,
0.5488021373748779,
-0.2663484215736389,
-0.11158920079469681,
0.11576183140277863,
0.2326328158378601,
-0.0028003379702568054,
0.056830018758773804,
-0.3525221049785614,
-0.18890444934368134,
-0.23329587280750275,
-0.13815750181674957,
-0.006479404866695404,
0.042911071330308914,
-0.14488676190376282,
-0.29505491256713867,
-0.09617985039949417,
-0.10944610834121704,
0.028767062351107597,
0.14835824072360992,
0.42324283719062805,
-0.04635748267173767,
0.23899509012699127,
0.3974008858203888,
0.4422645568847656,
0.3933371603488922,
0.8487029075622559,
-0.24864089488983154,
-0.10670876502990723,
0.17361967265605927,
-0.02572484314441681,
0.12230987846851349,
0.5447704195976257,
0.16776365041732788,
-0.13350655138492584,
0.2194763422012329,
0.3968948423862457,
-0.5547217130661011,
0.20071765780448914,
-0.07671274244785309,
0.012276846915483475,
-0.2749662399291992,
-0.0926392525434494,
0.23223797976970673,
0.21551844477653503,
0.10600437223911285,
0.13717569410800934,
0.32843896746635437,
-0.2844579815864563,
0.17145764827728271,
0.0374533087015152,
0.8051800727844238,
-0.17664633691310883,
0.07652167975902557,
0.04553596302866936,
-0.3205474615097046,
0.10891809314489365,
0.125264972448349,
0.005230464041233063,
-0.3715417981147766,
0.014680065214633942,
-0.052654556930065155,
0.11463303864002228,
-0.08706355094909668,
-0.2760770618915558,
-0.28468140959739685,
0.23883147537708282,
0.10357068479061127,
0.29470133781433105,
-0.11324367672204971,
0.10625268518924713,
-0.25169065594673157,
-0.20746684074401855,
-0.19651487469673157,
0.184865802526474,
-0.37437674403190613,
0.2466098964214325,
-0.10452178865671158,
-0.028689797967672348,
-0.10475955158472061,
-0.1792476922273636,
-0.3342362642288208,
0.03724508732557297,
-0.3580838739871979,
-0.2918027937412262,
0.108431376516819,
0.09478926658630371,
-0.08841899037361145,
0.21388457715511322,
0.2706151604652405,
0.00011325301602482796,
-0.24468392133712769,
0.22271527349948883,
-0.33566632866859436,
0.09138259291648865,
-0.0948808565735817,
0.09126801788806915,
0.0784909725189209,
0.04998387396335602,
-0.06707575172185898,
-0.2572679817676544,
0.08763271570205688,
0.24497252702713013,
-0.20824916660785675,
-0.009199973195791245,
-0.005913134664297104,
-0.19567540287971497,
-0.07452014088630676,
-0.34781941771507263,
0.06134814769029617,
-0.19576427340507507,
0.15805380046367645,
-0.2729504406452179,
-0.006895564496517181,
0.24976783990859985,
0.33964473009109497,
-0.33334606885910034,
-0.2514117658138275,
0.4590214490890503,
-0.18605086207389832,
0.007452681660652161,
-0.02311958745121956,
0.1489245593547821,
-0.010664954781532288,
-0.005350582301616669,
0.11263938993215561,
0.23652498424053192,
-0.49563971161842346,
0.058935727924108505,
-0.19793030619621277,
-0.07275494933128357,
0.3145407438278198,
0.2902372479438782,
0.42851051688194275,
-0.1876656711101532,
-0.06690923124551773,
-0.16507507860660553,
-0.35406333208084106,
0.23552215099334717,
-0.17253980040550232,
0.5158572793006897,
0.06814324110746384,
0.07540720701217651,
-0.010295543819665909,
0.052338555455207825,
-0.34911108016967773,
0.1673923283815384,
-0.1327303946018219,
0.23320642113685608,
-0.07192801684141159,
-0.09670665115118027,
0.08771402388811111,
-0.17010143399238586,
0.07601460814476013,
0.17053361237049103,
-0.3620910048484802,
-0.14978258311748505,
-0.12270374596118927,
0.0736674964427948,
0.13078248500823975,
-0.19111508131027222,
0.034620098769664764,
0.22416295111179352,
-0.19803787767887115,
-0.28695252537727356,
0.36642467975616455,
0.28092002868652344,
-0.0779600739479065,
-0.17084600031375885,
-0.05331443250179291,
-0.15557946264743805,
0.14401809871196747,
-0.21440213918685913,
0.41782379150390625,
0.426910400390625,
-0.021909553557634354,
0.06896262615919113,
-0.27358970046043396,
0.03000592440366745,
0.12492979317903519,
0.1792011260986328,
0.11778039485216141,
0.17907100915908813,
0.16784191131591797,
-0.09048429131507874,
0.14091894030570984,
0.13313792645931244,
0.4294810891151428,
-0.11409717798233032,
-0.18151119351387024,
-0.21733388304710388,
0.029698655009269714,
0.2070365697145462,
-0.2075439691543579,
0.010311417281627655,
0.1680709272623062,
0.07186982780694962,
-0.08012095093727112,
0.24012157320976257,
0.5616702437400818,
0.09901230037212372,
-0.17390789091587067,
0.03153562545776367,
0.47020384669303894,
-0.02669443190097809,
0.056173454970121384,
0.3745143711566925,
-0.15735283493995667,
0.13781625032424927,
0.27610909938812256,
0.17518091201782227,
0.20446573197841644,
0.5769867300987244,
-0.12931963801383972,
0.45669522881507874,
0.021383047103881836,
0.29018881916999817,
0.2560141682624817,
-0.04937009885907173,
0.14287197589874268,
0.35254716873168945,
-0.02796454355120659,
0.3228265047073364,
0.08159613609313965,
0.4249279797077179,
-0.23153971135616302,
-0.37941718101501465,
-0.20485635101795197,
0.13306431472301483,
-0.08348867297172546,
0.15003126859664917,
-0.07438109070062637,
-0.10403724014759064,
-0.2686607837677002,
0.21466214954853058,
-0.1648184061050415,
-0.2989729642868042,
0.2259453982114792,
0.12014046311378479,
-0.2975519895553589,
-0.46832555532455444,
-0.16821008920669556,
0.08187773823738098,
0.11044733226299286,
-0.1363293081521988,
0.3065529763698578,
0.15436512231826782,
-0.22579017281532288,
0.34772053360939026,
0.4218277335166931,
0.5539129972457886,
0.26916739344596863,
-0.024193277582526207,
0.005384191870689392,
0.41409170627593994,
-0.005708996206521988,
-0.15143565833568573,
-0.12338967621326447,
0.2383476048707962,
-0.2620127499103546,
0.1607644259929657,
0.1805940866470337,
-0.22094649076461792,
-0.22142328321933746,
-0.2734517753124237,
0.09869858622550964,
0.18343955278396606,
0.2223961055278778,
-0.5869706869125366,
0.000839725136756897,
-0.17239920794963837,
-0.20909765362739563,
-0.5849539637565613,
-0.033009063452482224,
0.18073363602161407,
-0.004732891917228699,
0.15167008340358734,
0.021496128290891647,
0.0975864827632904,
-0.029283100739121437,
0.2493678629398346,
0.44905146956443787,
-0.2591268718242645,
-0.13646093010902405,
-0.2593267560005188,
-0.5933915376663208,
0.07552769780158997,
0.20147937536239624,
0.17575529217720032,
0.08098350465297699,
0.1473218947649002,
-0.15605799853801727,
-0.2040388584136963,
0.27792078256607056,
-0.13707244396209717,
0.3084210753440857,
0.004601179156452417,
-0.13802556693553925,
0.00875719916075468,
0.14806292951107025,
-0.11444402486085892,
-0.062247712165117264,
-0.17091120779514313,
0.32510918378829956,
-0.2209482043981552,
0.0229170024394989,
-0.12544089555740356,
0.34694480895996094,
-0.14597874879837036,
-0.11661510914564133,
0.3043496012687683,
0.17940548062324524,
0.3587852716445923,
-0.1715855598449707,
-0.2731753885746002,
-0.16781026124954224,
-0.06464026868343353,
-0.36069995164871216,
0.20701664686203003,
-0.29552629590034485,
0.614806056022644,
0.006774455308914185,
-0.3010857403278351,
-0.3433385491371155,
0.1285104751586914,
0.340778648853302,
-0.14850857853889465,
-0.25503915548324585,
0.1652243733406067,
-0.29448091983795166,
-0.10066968947649002,
0.26336997747421265,
0.473804771900177,
0.0092005655169487,
0.16008204221725464,
-0.26440149545669556,
-0.40556493401527405,
0.4067462682723999,
-0.014367390424013138,
0.03920537233352661,
0.1624315232038498,
0.12217314541339874,
0.16808956861495972,
-0.22905072569847107,
-0.8228254914283752,
0.06557400524616241,
0.06167425960302353,
-0.19831912219524384,
0.033151477575302124,
0.4126991033554077,
-0.046988680958747864,
0.05981697142124176,
-0.02671338990330696,
0.23508158326148987,
0.1888853907585144,
-0.3438001871109009,
0.15285451710224152,
0.007070958614349365
] |
https://github.com/huggingface/datasets/issues/5708 | Thanks a lot!
The sizes now match as expected!
<img width="1446" alt="Capture d’écran 2023-04-05 à 16 10 15" src="https://user-images.githubusercontent.com/1676121/230107044-ac2a76ea-a4fe-4e81-a925-f464b85f5edd.png">
| Dataset sizes are in MiB instead of MB in dataset cards | As @severo reported in an internal discussion (https://github.com/huggingface/moon-landing/issues/5929):
Now we show the dataset size:
- from the dataset card (in the side column)
- from the datasets-server (in the viewer)
But, even if the size is the same, we see a mismatch because the viewer shows MB, while the info from the README generally shows MiB (even if it's written MB -> https://huggingface.co/datasets/blimp/blob/main/README.md?code=true#L1932)
<img width="664" alt="Capture d’écran 2023-04-04 à 10 16 01" src="https://user-images.githubusercontent.com/1676121/229730887-0bd8fa6e-9462-46c6-bd4e-4d2c5784cabb.png">
TODO: Values to be fixed in: `Size of downloaded dataset files:`, `Size of the generated dataset:` and `Total amount of disk used:`
- [x] Bulk edit on the Hub to fix this in all canonical datasets
- [x] Bulk PR on the Hub to fix ancient canonical datasets that were moved to organizations | 19 | Dataset sizes are in MiB instead of MB in dataset cards
As @severo reported in an internal discussion (https://github.com/huggingface/moon-landing/issues/5929):
Now we show the dataset size:
- from the dataset card (in the side column)
- from the datasets-server (in the viewer)
But, even if the size is the same, we see a mismatch because the viewer shows MB, while the info from the README generally shows MiB (even if it's written MB -> https://huggingface.co/datasets/blimp/blob/main/README.md?code=true#L1932)
<img width="664" alt="Capture d’écran 2023-04-04 à 10 16 01" src="https://user-images.githubusercontent.com/1676121/229730887-0bd8fa6e-9462-46c6-bd4e-4d2c5784cabb.png">
TODO: Values to be fixed in: `Size of downloaded dataset files:`, `Size of the generated dataset:` and `Total amount of disk used:`
- [x] Bulk edit on the Hub to fix this in all canonical datasets
- [x] Bulk PR on the Hub to fix ancient canonical datasets that were moved to organizations
Thanks a lot!
The sizes now match as expected!
<img width="1446" alt="Capture d’écran 2023-04-05 à 16 10 15" src="https://user-images.githubusercontent.com/1676121/230107044-ac2a76ea-a4fe-4e81-a925-f464b85f5edd.png">
| [
-0.25985187292099,
-0.421073853969574,
0.01803220435976982,
0.34752607345581055,
0.05826717987656593,
-0.10421357303857803,
0.16397622227668762,
0.18023625016212463,
0.11308826506137848,
0.26625874638557434,
-0.05506281182169914,
0.022360142320394516,
0.05824898183345795,
0.525748610496521,
0.0756995677947998,
0.09550930559635162,
0.12789902091026306,
0.16201075911521912,
-0.4024553894996643,
0.022283703088760376,
-0.28866544365882874,
0.24089422821998596,
-0.1328500658273697,
-0.3939880430698395,
-0.28644314408302307,
0.19379577040672302,
0.026265345513820648,
-0.047000784426927567,
-0.5996389389038086,
-0.2588397264480591,
0.18347784876823425,
-0.11349181830883026,
0.10374042391777039,
0.17613422870635986,
-0.0001125933849834837,
-0.1997378170490265,
0.17977264523506165,
-0.07548338174819946,
-0.2748030424118042,
0.09367324411869049,
0.18915285170078278,
-0.21633900701999664,
0.007974941283464432,
0.08283296227455139,
-0.002317085862159729,
0.007362242788076401,
0.18772627413272858,
0.06636173278093338,
-0.04431693255901337,
0.028442278504371643,
0.24232709407806396,
0.22481687366962433,
0.05763009935617447,
0.0003421194851398468,
0.05545874685049057,
0.5527217984199524,
0.12595388293266296,
0.13548126816749573,
0.05881400406360626,
0.23414111137390137,
-0.1118825376033783,
0.38803327083587646,
0.20807361602783203,
0.013541851192712784,
0.25820931792259216,
0.06419838964939117,
0.15733832120895386,
-0.033630527555942535,
0.20054760575294495,
0.029014740139245987,
0.20787601172924042,
-0.27702128887176514,
-0.28730642795562744,
-0.36030375957489014,
-0.14602087438106537,
0.06697442382574081,
0.21307870745658875,
0.2789357304573059,
0.02454332634806633,
-0.056568440049886703,
-0.8571030497550964,
-0.08502023667097092,
0.07453371584415436,
-0.03400547429919243,
-0.29450100660324097,
0.2396547794342041,
-0.2990109324455261,
0.09088802337646484,
-0.28563693165779114,
-0.11608389765024185,
0.04868941009044647,
-0.11086384207010269,
-0.010365177877247334,
-0.004684761166572571,
-0.0598277673125267,
0.015562072396278381,
-0.05545146390795708,
0.2572266161441803,
0.2751307487487793,
0.1043420359492302,
-0.004773637279868126,
-0.06651107966899872,
-0.03360535949468613,
0.03622395545244217,
0.17271555960178375,
0.3374160826206207,
-0.04093119502067566,
0.01422855630517006,
-0.0452578067779541,
0.3019782304763794,
0.10696859657764435,
0.1004100888967514,
0.18530045449733734,
-0.141633540391922,
-0.5360581874847412,
-0.3587477505207062,
0.07961519062519073,
-0.36108657717704773,
-0.09972293674945831,
-0.06790728867053986,
-0.09244433045387268,
-0.02367171086370945,
-0.14390495419502258,
0.2491450160741806,
-0.21730077266693115,
0.21918973326683044,
0.253765344619751,
-0.0033680563792586327,
-0.16438508033752441,
-0.21817438304424286,
-0.2674102485179901,
-0.18685561418533325,
-0.13471628725528717,
0.10295764356851578,
0.07682161033153534,
-0.16917425394058228,
0.37692272663116455,
0.20970049500465393,
0.15350031852722168,
0.18131493031978607,
-0.274726003408432,
0.09722887724637985,
0.25675639510154724,
0.3142955005168915,
0.06683535873889923,
-0.04959108680486679,
-0.13658539950847626,
0.0879206508398056,
-0.21542640030384064,
0.22260689735412598,
0.00938490591943264,
0.04589095711708069,
-0.18928956985473633,
0.22574763000011444,
-0.3728964328765869,
-0.03696870803833008,
-0.4212329685688019,
0.13752025365829468,
0.08945029973983765,
-0.06135813146829605,
0.1297214925289154,
-0.10318717360496521,
-0.11221157759428024,
-0.06917434930801392,
0.3640548586845398,
0.13083218038082123,
-0.3108503222465515,
-0.22814759612083435,
-0.03149819374084473,
0.05307259038090706,
0.3280225396156311,
0.17858508229255676,
0.1296430379152298,
0.08934547752141953,
-0.5379542708396912,
0.002692863345146179,
-0.44365784525871277,
-0.15832430124282837,
-0.391892671585083,
0.1538071632385254,
-0.007270872592926025,
0.09870021045207977,
0.12316679954528809,
0.11278672516345978,
0.26641398668289185,
0.05316195636987686,
0.15775474905967712,
0.08883793652057648,
-0.04517730697989464,
0.16970694065093994,
-0.39814889430999756,
-0.468270480632782,
-0.012026317417621613,
0.09652078151702881,
0.171373650431633,
-0.11970379203557968,
0.20003589987754822,
0.34048351645469666,
0.3861856460571289,
0.11247000098228455,
0.04377061873674393,
0.1342303603887558,
0.1766924262046814,
-0.38965901732444763,
-0.049747172743082047,
-0.02823357656598091,
-0.20170900225639343,
0.18924060463905334,
-0.1125321313738823,
0.13171249628067017,
0.3433222770690918,
-0.18685613572597504,
-0.35164618492126465,
-0.18518534302711487,
-0.07079777121543884,
-0.28922775387763977,
0.0714322105050087,
0.11555929481983185,
0.052569784224033356,
-0.0808500424027443,
0.05983244627714157,
0.230264812707901,
-0.21650977432727814,
0.08634325861930847,
-0.5191892981529236,
0.4023357629776001,
-0.08726296573877335,
-0.04585207626223564,
0.31706398725509644,
0.07455851882696152,
0.017054358497262,
-0.008091777563095093,
-0.05430984869599342,
0.36570340394973755,
-0.06571164727210999,
0.2649695873260498,
0.18840856850147247,
0.033540330827236176,
0.3590589761734009,
-0.11392848938703537,
0.28811678290367126,
0.1229434683918953,
-0.19541485607624054,
0.059202879667282104,
-0.2379048764705658,
0.39682573080062866,
-0.04312402755022049,
-0.05115532502532005,
0.0789480209350586,
-0.19559398293495178,
-0.16152018308639526,
0.11670766025781631,
0.042387954890728,
-0.5191643238067627,
0.10187353193759918,
0.10300701856613159,
0.1116420179605484,
0.1762549877166748,
-0.20700034499168396,
0.12834911048412323,
0.6575833559036255,
0.10888922214508057,
-0.2375722974538803,
0.23497720062732697,
-0.44837284088134766,
-0.28421691060066223,
0.46655550599098206,
0.11295489966869354,
0.2576742172241211,
0.37950852513313293,
0.2184082418680191,
0.3328550457954407,
0.07218602299690247,
-0.14445054531097412,
0.14400535821914673,
-0.04857965558767319,
-0.3368493318557739,
0.023093990981578827,
0.14415523409843445,
-0.1643970012664795,
-0.3293892443180084,
0.5080490112304688,
-0.0764472484588623,
-0.10615872591733932,
-0.37415748834609985,
-0.26835715770721436,
-0.1596968173980713,
-0.28912681341171265,
-0.4978933334350586,
-0.27523237466812134,
-0.5145732760429382,
-0.2900046408176422,
0.15174567699432373,
0.1105860248208046,
0.13155335187911987,
0.009620696306228638,
0.03339870274066925,
0.17871372401714325,
-0.10769858211278915,
0.15537495911121368,
0.10999821126461029,
0.24532219767570496,
-0.1394362598657608,
0.1546265184879303,
-0.028680220246315002,
-0.04719754308462143,
0.3386116027832031,
-0.4225206673145294,
0.03395891189575195,
-0.3560605049133301,
-0.6740776896476746,
0.2664588391780853,
-0.06729237735271454,
0.12273306399583817,
0.1509072184562683,
0.011569555848836899,
0.06474797427654266,
0.26374801993370056,
-0.06576313078403473,
0.07627866417169571,
-0.2965176999568939,
-0.15386775135993958,
-0.3087061643600464,
-0.03239800035953522,
-0.4131108522415161,
-0.21072697639465332,
-0.04330216348171234,
-0.23641571402549744,
0.14897766709327698,
0.04823795706033707,
0.23180729150772095,
0.13082362711429596,
0.17332299053668976,
-0.018016748130321503,
-0.3390972912311554,
-0.0028360188007354736,
-0.31832757592201233,
-0.5977665185928345,
-0.014964569360017776,
-0.21702136099338531,
-0.32385826110839844,
0.1326717585325241,
0.27757805585861206,
0.2000429779291153,
-0.008117005228996277,
-0.6809269189834595,
-0.4413761794567108,
-0.2420516014099121,
-0.1114368885755539,
0.17696307599544525,
0.33663037419319153,
-0.04628736898303032,
-0.10844482481479645,
-0.04720718041062355,
-0.19388243556022644,
-0.3507641553878784,
-0.08590613305568695,
0.24010157585144043,
0.6298924684524536,
0.03099070116877556,
-0.1571989506483078,
0.09824271500110626,
0.33235040307044983,
0.5716987252235413,
-0.15588651597499847,
0.15434621274471283,
0.0005756989121437073,
0.4489247798919678,
-0.14272655546665192,
0.17255482077598572,
0.6947879791259766,
0.04601680859923363,
0.046937718987464905,
0.46684730052948,
0.08525414764881134,
0.35727691650390625,
0.2105194628238678,
0.16449765861034393,
-0.1828412413597107,
-0.1890268623828888,
-0.054667629301548004,
0.06071778014302254,
-0.18139779567718506,
-0.0013814419507980347,
0.06379103660583496,
-0.11159038543701172,
-0.1499958336353302,
-0.06689634174108505,
-0.026021409779787064,
-0.12039817869663239,
0.24255338311195374,
-0.12670591473579407,
-0.06893861293792725,
-0.5100025534629822,
0.3364512324333191,
-0.13148275017738342,
0.18314129114151,
-0.04862822964787483,
-0.012443050742149353,
0.07336597144603729,
0.18032464385032654,
0.48144128918647766,
-0.1405017375946045,
0.007963688112795353,
-0.47553932666778564,
-0.1522923707962036,
-0.44044509530067444,
0.016788333654403687,
0.13590490818023682,
-0.11593575775623322,
0.37359702587127686,
0.5950962901115417,
-0.17394503951072693,
-0.0347600132226944,
0.04910381883382797,
0.20149052143096924,
-0.11404083669185638,
-0.03427036106586456,
-0.3043419122695923,
-0.033456988632678986,
-0.1666172444820404,
-0.22800004482269287,
0.023751601576805115,
0.08184210956096649,
-0.07800741493701935,
-0.2561292350292206,
-0.12495716661214828,
-0.19161376357078552,
0.047656212002038956,
0.14783671498298645,
0.4469411373138428,
-0.0776289626955986,
0.21068033576011658,
0.41721662878990173,
0.5135420560836792,
0.38183289766311646,
0.8934875130653381,
-0.24357958137989044,
-0.13373780250549316,
0.1521344929933548,
0.009972769767045975,
0.14780941605567932,
0.5355587601661682,
0.16038236021995544,
-0.13026827573776245,
0.2809525728225708,
0.3325424790382385,
-0.48811402916908264,
0.1972983479499817,
-0.09261336922645569,
0.05833813548088074,
-0.20858220756053925,
-0.21414504945278168,
0.23716336488723755,
0.2084384560585022,
0.1458815336227417,
0.0702558383345604,
0.2733211815357208,
-0.2670685350894928,
0.049696411937475204,
0.053336773067712784,
0.7135549187660217,
-0.002742096781730652,
0.12780696153640747,
-0.028740720823407173,
-0.3831147849559784,
0.09672742336988449,
0.06920668482780457,
-0.007051702588796616,
-0.41808366775512695,
-0.04101260006427765,
-0.07388530671596527,
0.038413673639297485,
-0.16440948843955994,
-0.17991626262664795,
-0.20277923345565796,
0.26771610975265503,
0.18746785819530487,
0.2894551753997803,
-0.11656636744737625,
0.11469627916812897,
-0.2677912414073944,
-0.06316055357456207,
-0.16726036369800568,
0.144948810338974,
-0.3091064393520355,
0.2744227945804596,
-0.09553384780883789,
0.023928124457597733,
-0.0860619843006134,
-0.21007251739501953,
-0.36853650212287903,
0.07732827961444855,
-0.46088987588882446,
-0.3120577037334442,
0.11818961799144745,
0.06176695227622986,
-0.10011272132396698,
0.25248685479164124,
0.19391191005706787,
-0.03905302658677101,
-0.18036501109600067,
0.26039496064186096,
-0.26511716842651367,
0.14537455141544342,
-0.1437554955482483,
0.10594367980957031,
0.06435393542051315,
0.025874607264995575,
-0.06384558975696564,
-0.23569133877754211,
0.13432124257087708,
0.2578161954879761,
-0.19822020828723907,
-0.0018414650112390518,
-0.02897249162197113,
-0.1567729413509369,
-0.1296435296535492,
-0.35237637162208557,
0.18262013792991638,
-0.15494376420974731,
0.12831300497055054,
-0.1987384855747223,
0.05584565922617912,
0.1679973155260086,
0.3647010326385498,
-0.3487619161605835,
-0.28814515471458435,
0.5504745244979858,
-0.12244068831205368,
-0.006415650248527527,
-0.07481633126735687,
0.09723466634750366,
-0.06560764461755753,
0.0791911706328392,
0.18514446914196014,
0.22099056839942932,
-0.3903258144855499,
0.00154779851436615,
-0.21058526635169983,
-0.12525364756584167,
0.2713068127632141,
0.28193891048431396,
0.47708094120025635,
-0.2540332078933716,
-0.08861763030290604,
-0.19352099299430847,
-0.32905033230781555,
0.2721814811229706,
-0.23393741250038147,
0.5422444343566895,
0.16547785699367523,
0.04142085462808609,
0.013829894363880157,
0.06458433717489243,
-0.30016201734542847,
0.1139896810054779,
-0.053690697997808456,
0.19381847977638245,
-0.0668502002954483,
0.014153129421174526,
0.1767989993095398,
-0.1650547981262207,
0.043756935745477676,
0.16864831745624542,
-0.3717634379863739,
-0.11781714111566544,
-0.13555660843849182,
0.07014783471822739,
0.14943592250347137,
-0.18463194370269775,
0.02124730497598648,
0.19662407040596008,
-0.14784903824329376,
-0.26457664370536804,
0.37555626034736633,
0.24875786900520325,
-0.06019872426986694,
-0.1674024909734726,
-0.10461938381195068,
-0.15156584978103638,
0.08692547678947449,
-0.12866239249706268,
0.3778141736984253,
0.48413172364234924,
0.09957901388406754,
0.0862928032875061,
-0.3079843521118164,
0.03405106067657471,
0.15088331699371338,
0.17363116145133972,
0.10592827200889587,
0.12186247110366821,
0.07742288708686829,
-0.04421639069914818,
0.146322563290596,
0.11158148944377899,
0.39765453338623047,
-0.1487179398536682,
-0.1450645923614502,
-0.23419298231601715,
-0.016066690906882286,
0.16405117511749268,
-0.18967518210411072,
0.036351278424263,
0.20019960403442383,
0.17015919089317322,
-0.05005341023206711,
0.25907954573631287,
0.5131994485855103,
0.18446747958660126,
-0.2600504755973816,
0.024249117821455002,
0.46708205342292786,
0.033822499215602875,
0.11026298999786377,
0.4497278928756714,
-0.18770276010036469,
0.21046464145183563,
0.2704792320728302,
0.2909712791442871,
0.18310168385505676,
0.5478706359863281,
-0.010784916579723358,
0.4440648555755615,
0.052160490304231644,
0.1988854855298996,
0.27217116951942444,
-0.051703616976737976,
0.14294758439064026,
0.32011890411376953,
-0.062349557876586914,
0.3164273500442505,
0.1921234130859375,
0.3730611801147461,
-0.12949569523334503,
-0.2185731828212738,
-0.11834666132926941,
0.09410035610198975,
-0.08219703286886215,
0.13619652390480042,
-0.08065643906593323,
-0.15745361149311066,
-0.3069193661212921,
0.20902127027511597,
-0.1532006710767746,
-0.29576683044433594,
0.2667166292667389,
0.07904370129108429,
-0.3536635935306549,
-0.5044785141944885,
-0.2016572654247284,
0.0743899941444397,
-0.03789959102869034,
-0.14825108647346497,
0.32070082426071167,
0.12684416770935059,
-0.1661682426929474,
0.46714475750923157,
0.44643744826316833,
0.48858869075775146,
0.18961524963378906,
0.11683081835508347,
-0.20549046993255615,
0.48257118463516235,
-0.05375117063522339,
-0.22150027751922607,
-0.22984640300273895,
0.16396421194076538,
-0.2757948637008667,
0.20643171668052673,
0.21176856756210327,
-0.16455817222595215,
-0.20617935061454773,
-0.21189697086811066,
0.06115458533167839,
0.06442445516586304,
0.26313015818595886,
-0.6439346671104431,
0.013388358056545258,
-0.11996641755104065,
-0.19968774914741516,
-0.6138851046562195,
-0.020582443103194237,
0.16256150603294373,
0.021627672016620636,
0.1723656952381134,
-0.007193416357040405,
0.07722903788089752,
-0.01121770590543747,
0.16489945352077484,
0.43999916315078735,
-0.25505998730659485,
-0.035567305982112885,
-0.22081850469112396,
-0.547822892665863,
0.1002742350101471,
0.09148907661437988,
0.13880422711372375,
0.04417935386300087,
0.1383812129497528,
-0.09573861956596375,
-0.24650876224040985,
0.38884782791137695,
-0.04792763665318489,
0.2547908425331116,
-0.007057743147015572,
-0.07005862891674042,
-0.09863358736038208,
0.11816772818565369,
-0.18139640986919403,
-0.030160311609506607,
-0.12055885046720505,
0.25446194410324097,
-0.2402556836605072,
-0.004348568618297577,
-0.13420112431049347,
0.3520720899105072,
-0.15790805220603943,
-0.12042242288589478,
0.2711789608001709,
0.18388746678829193,
0.4033243954181671,
-0.16381369531154633,
-0.2844586670398712,
-0.07364271581172943,
0.011695761233568192,
-0.4493975043296814,
0.25538432598114014,
-0.33168160915374756,
0.5879277586936951,
-0.018097706139087677,
-0.29802414774894714,
-0.27573737502098083,
0.10921178758144379,
0.26623401045799255,
-0.2229474037885666,
-0.1865706592798233,
0.09199243038892746,
-0.34691476821899414,
-0.1767532229423523,
0.23225511610507965,
0.4430835247039795,
-0.04446668177843094,
0.15265806019306183,
-0.07529070228338242,
-0.4263591170310974,
0.2988922595977783,
-0.03546295687556267,
0.11692587286233902,
0.1768304705619812,
0.0036996304988861084,
0.12218589335680008,
-0.19804327189922333,
-0.7887298464775085,
0.09633365273475647,
0.14045380055904388,
-0.24929307401180267,
0.18449267745018005,
0.3246158957481384,
-0.017994685098528862,
0.07455414533615112,
-0.08353019505739212,
0.27059561014175415,
0.2775540351867676,
-0.3638855814933777,
0.14414027333259583,
-0.045925628393888474
] |
https://github.com/huggingface/datasets/issues/5708 | I made another bulk edit of ancient canonical datasets that were moved to community organization. I have parsed 11 datasets and opened a PR on 3 of them:
- [x] "allenai/scicite": https://huggingface.co/datasets/allenai/scicite/discussions/3
- [x] "allenai/scifact": https://huggingface.co/datasets/allenai/scifact/discussions/2
- [x] "dair-ai/emotion": https://huggingface.co/datasets/dair-ai/emotion/discussions/6 | Dataset sizes are in MiB instead of MB in dataset cards | As @severo reported in an internal discussion (https://github.com/huggingface/moon-landing/issues/5929):
Now we show the dataset size:
- from the dataset card (in the side column)
- from the datasets-server (in the viewer)
But, even if the size is the same, we see a mismatch because the viewer shows MB, while the info from the README generally shows MiB (even if it's written MB -> https://huggingface.co/datasets/blimp/blob/main/README.md?code=true#L1932)
<img width="664" alt="Capture d’écran 2023-04-04 à 10 16 01" src="https://user-images.githubusercontent.com/1676121/229730887-0bd8fa6e-9462-46c6-bd4e-4d2c5784cabb.png">
TODO: Values to be fixed in: `Size of downloaded dataset files:`, `Size of the generated dataset:` and `Total amount of disk used:`
- [x] Bulk edit on the Hub to fix this in all canonical datasets
- [x] Bulk PR on the Hub to fix ancient canonical datasets that were moved to organizations | 40 | Dataset sizes are in MiB instead of MB in dataset cards
As @severo reported in an internal discussion (https://github.com/huggingface/moon-landing/issues/5929):
Now we show the dataset size:
- from the dataset card (in the side column)
- from the datasets-server (in the viewer)
But, even if the size is the same, we see a mismatch because the viewer shows MB, while the info from the README generally shows MiB (even if it's written MB -> https://huggingface.co/datasets/blimp/blob/main/README.md?code=true#L1932)
<img width="664" alt="Capture d’écran 2023-04-04 à 10 16 01" src="https://user-images.githubusercontent.com/1676121/229730887-0bd8fa6e-9462-46c6-bd4e-4d2c5784cabb.png">
TODO: Values to be fixed in: `Size of downloaded dataset files:`, `Size of the generated dataset:` and `Total amount of disk used:`
- [x] Bulk edit on the Hub to fix this in all canonical datasets
- [x] Bulk PR on the Hub to fix ancient canonical datasets that were moved to organizations
I made another bulk edit of ancient canonical datasets that were moved to community organization. I have parsed 11 datasets and opened a PR on 3 of them:
- [x] "allenai/scicite": https://huggingface.co/datasets/allenai/scicite/discussions/3
- [x] "allenai/scifact": https://huggingface.co/datasets/allenai/scifact/discussions/2
- [x] "dair-ai/emotion": https://huggingface.co/datasets/dair-ai/emotion/discussions/6 | [
-0.2266460657119751,
-0.3218250572681427,
0.04137040674686432,
0.3185628056526184,
0.14769849181175232,
-0.11843086779117584,
0.032626692205667496,
0.19912543892860413,
0.12102067470550537,
0.24956467747688293,
-0.09855564683675766,
-0.013729743659496307,
-0.00844629481434822,
0.5083847641944885,
-0.03745516389608383,
0.0401795394718647,
0.21878691017627716,
0.056058891117572784,
-0.3512817919254303,
0.06951767951250076,
-0.3735174536705017,
0.22725950181484222,
-0.10630711913108826,
-0.4229302406311035,
-0.30818596482276917,
0.05485493689775467,
-0.010803356766700745,
0.021610356867313385,
-0.5204119682312012,
-0.35625237226486206,
0.12389609962701797,
-0.043780405074357986,
0.17495296895503998,
0.263071209192276,
-0.00011597890261327848,
-0.15196330845355988,
0.26707160472869873,
-0.04813283681869507,
-0.2868221700191498,
0.25167202949523926,
0.25241267681121826,
-0.08795780688524246,
-0.09182676672935486,
0.05413694679737091,
0.003823414444923401,
-0.0454336516559124,
0.18017549812793732,
-0.13520441949367523,
-0.004999339580535889,
0.12862101197242737,
0.19440332055091858,
0.25471991300582886,
0.03676317632198334,
-0.0033554136753082275,
0.017774414271116257,
0.6308258175849915,
0.07887090742588043,
0.12496834248304367,
0.08511906862258911,
0.26395362615585327,
-0.14468489587306976,
0.5339577198028564,
0.19050458073616028,
-0.0017357543110847473,
0.26228782534599304,
-0.022757014259696007,
0.20719248056411743,
-0.09576760232448578,
0.20003654062747955,
-0.022694509476423264,
0.23805291950702667,
-0.26073476672172546,
-0.20980173349380493,
-0.35157260298728943,
-0.11489541828632355,
0.08316727727651596,
0.23130705952644348,
0.29825738072395325,
0.04607265070080757,
0.01426759734749794,
-0.7903395891189575,
-0.055223964154720306,
0.10446104407310486,
0.0037997979670763016,
-0.25062814354896545,
0.2672198414802551,
-0.2846885621547699,
0.07081428170204163,
-0.2320217490196228,
-0.18059854209423065,
0.1461312174797058,
0.04866047948598862,
0.06896466761827469,
-0.034677065908908844,
-0.04201263189315796,
-0.012467451393604279,
-0.0013377107679843903,
0.3193551301956177,
0.13962504267692566,
0.11760886013507843,
-0.008117934688925743,
-0.062135402113199234,
-0.0633658692240715,
-0.01583046093583107,
0.264446496963501,
0.19465678930282593,
-0.006480090320110321,
-0.015186645090579987,
0.04930046573281288,
0.4366512894630432,
0.10939574241638184,
0.10602473467588425,
0.0978795662522316,
-0.1640346497297287,
-0.5772649645805359,
-0.2506119906902313,
0.10656455159187317,
-0.32492780685424805,
-0.19234241545200348,
-0.05400461703538895,
-0.08901115506887436,
0.04152096062898636,
-0.10327628254890442,
0.2572108209133148,
-0.21992363035678864,
0.3542431592941284,
0.19344159960746765,
-0.08024939149618149,
-0.2260071039199829,
-0.32769230008125305,
-0.20728495717048645,
-0.09816363453865051,
-0.17547821998596191,
0.10984645783901215,
0.10361003875732422,
-0.242746040225029,
0.32767340540885925,
0.22268497943878174,
0.06441740691661835,
0.0557430237531662,
-0.26813676953315735,
-0.0010288245975971222,
0.26112622022628784,
0.37649062275886536,
0.0011863484978675842,
0.041886813938617706,
-0.0526403971016407,
0.15126822888851166,
-0.281948447227478,
0.1517656147480011,
-0.004556577652692795,
-0.06362321227788925,
-0.14996430277824402,
0.18581530451774597,
-0.26057299971580505,
-0.04518347978591919,
-0.4136103689670563,
0.23921534419059753,
0.13130101561546326,
-0.06681498885154724,
0.14397501945495605,
-0.07886677980422974,
-0.19963890314102173,
-0.06393782794475555,
0.37374746799468994,
0.18498490750789642,
-0.23940235376358032,
-0.2818566560745239,
-0.07190430909395218,
0.11660325527191162,
0.31787556409835815,
0.3129595220088959,
0.05580031871795654,
0.1693916618824005,
-0.5306732058525085,
-0.03554660081863403,
-0.47655123472213745,
-0.1308462917804718,
-0.4516439437866211,
0.04737680405378342,
0.0027789250016212463,
0.10321839898824692,
0.13684134185314178,
0.0273955836892128,
0.33681729435920715,
-0.10002018511295319,
0.17666129767894745,
0.1284487545490265,
0.004331843927502632,
0.16803139448165894,
-0.42939597368240356,
-0.4689251482486725,
-0.043649718165397644,
0.06480352580547333,
0.23558560013771057,
-0.10825757682323456,
0.3014570474624634,
0.33046799898147583,
0.36782580614089966,
0.13586431741714478,
0.07505260407924652,
0.14242351055145264,
0.17242178320884705,
-0.30743208527565,
0.007936537265777588,
-0.03998029977083206,
-0.16793912649154663,
0.19027550518512726,
-0.1006525307893753,
0.21454426646232605,
0.3025554418563843,
-0.2741587162017822,
-0.41929084062576294,
-0.13255718350410461,
-0.09435495734214783,
-0.24888114631175995,
0.042494162917137146,
0.15488356351852417,
0.09131942689418793,
-0.11255569756031036,
0.10737533867359161,
0.25933459401130676,
-0.2343917191028595,
0.14672936499118805,
-0.5082147717475891,
0.4574648439884186,
-0.12621672451496124,
-0.06402251124382019,
0.21606063842773438,
0.07611991465091705,
-0.009042555466294289,
-0.04664737731218338,
-0.05085987597703934,
0.3489006459712982,
-0.11657845973968506,
0.2796553373336792,
0.18611347675323486,
0.19122281670570374,
0.345377117395401,
-0.22239288687705994,
0.316096693277359,
0.19770219922065735,
-0.20543746650218964,
0.1410762220621109,
-0.3789328336715698,
0.47313815355300903,
-0.06012066826224327,
0.009506404399871826,
0.03486932814121246,
-0.17780596017837524,
-0.13162802159786224,
0.1151600331068039,
0.04073864966630936,
-0.4278867542743683,
0.06156299635767937,
0.17604798078536987,
0.10029050707817078,
0.22577451169490814,
-0.15857931971549988,
0.14975926280021667,
0.5929147601127625,
0.08001656830310822,
-0.2553755044937134,
0.2410646677017212,
-0.5025532841682434,
-0.35180824995040894,
0.46842122077941895,
0.11668268591165543,
0.24936580657958984,
0.3034789264202118,
0.23655980825424194,
0.2758641242980957,
0.07471156120300293,
-0.09523791074752808,
0.16626349091529846,
0.009057531133294106,
-0.26260411739349365,
0.024760521948337555,
0.28299617767333984,
-0.03185074403882027,
-0.31555068492889404,
0.4699113070964813,
-0.04253580421209335,
0.0010722018778324127,
-0.42909592390060425,
-0.276283860206604,
-0.10456189513206482,
-0.32888132333755493,
-0.5148500204086304,
-0.1652727574110031,
-0.460775226354599,
-0.39477258920669556,
0.07224279642105103,
0.12781760096549988,
0.012175969779491425,
0.015135515481233597,
0.07020658999681473,
0.23360851407051086,
-0.18531078100204468,
0.2205316126346588,
0.08801229298114777,
0.2327224165201187,
-0.16161009669303894,
0.07743842899799347,
0.115780308842659,
-0.018466711044311523,
0.3888319134712219,
-0.4632003903388977,
0.11470089107751846,
-0.40551841259002686,
-0.7074252367019653,
0.25123998522758484,
0.033827777951955795,
0.03667844086885452,
0.059561338275671005,
0.03198052942752838,
0.055345192551612854,
0.07691830396652222,
-0.06772543489933014,
-0.02420024573802948,
-0.1750713437795639,
-0.21726764738559723,
-0.3830879330635071,
0.09318391978740692,
-0.2613251507282257,
-0.3444436192512512,
-0.07945265620946884,
-0.32173267006874084,
0.20855297148227692,
0.056858524680137634,
0.25771385431289673,
0.1106736958026886,
0.04410972073674202,
-0.10487315058708191,
-0.2581773102283478,
-0.0172863956540823,
-0.3614577353000641,
-0.6006791591644287,
-0.012409685179591179,
-0.1538427323102951,
-0.22707276046276093,
0.12158282101154327,
0.19287118315696716,
0.16107258200645447,
0.08991999924182892,
-0.6376292109489441,
-0.3037843406200409,
-0.26855897903442383,
-0.043068815022706985,
0.19281794130802155,
0.30215102434158325,
0.09800547361373901,
-0.05942260101437569,
-0.08528924733400345,
-0.07302188873291016,
-0.32658928632736206,
-0.12226492166519165,
0.23135143518447876,
0.5698775053024292,
-0.016687605530023575,
-0.18261027336120605,
0.17355333268642426,
0.4477975070476532,
0.4559606909751892,
-0.16230586171150208,
0.12443162500858307,
0.04790239781141281,
0.44617727398872375,
-0.07700207829475403,
0.07918170839548111,
0.6769382953643799,
-0.08222447335720062,
0.07465305924415588,
0.5533434748649597,
0.16625122725963593,
0.34784263372421265,
0.21747303009033203,
0.11086666584014893,
-0.2072887122631073,
-0.294569194316864,
-0.05327242985367775,
-0.08447369933128357,
-0.07260778546333313,
-0.0006847754120826721,
0.07031044363975525,
-0.1739743947982788,
-0.14974814653396606,
0.07027771323919296,
0.07794540375471115,
-0.21798992156982422,
0.25677791237831116,
-0.21573324501514435,
0.03363577276468277,
-0.47626879811286926,
0.345717191696167,
-0.1454351544380188,
0.2872968912124634,
-0.002619445323944092,
-0.018978439271450043,
0.06777334213256836,
0.0892668217420578,
0.463893324136734,
-0.18842586874961853,
-0.05982508882880211,
-0.4268605411052704,
-0.06388615071773529,
-0.4233308732509613,
-0.014506466686725616,
0.03324209898710251,
-0.028341416269540787,
0.46348267793655396,
0.6549896001815796,
-0.19315508008003235,
-0.07564415782690048,
0.14362479746341705,
0.18337535858154297,
-0.079768106341362,
0.020226873457431793,
-0.2796516716480255,
-0.1063830554485321,
-0.24870748817920685,
-0.15527865290641785,
0.02774842083454132,
-0.01673559471964836,
-0.17333129048347473,
-0.13804049789905548,
-0.15361745655536652,
-0.11630238592624664,
0.1326611340045929,
0.07297573983669281,
0.4391702711582184,
0.09570722281932831,
0.17102158069610596,
0.4856562316417694,
0.533979594707489,
0.5385412573814392,
0.8712382316589355,
-0.2882952392101288,
-0.3024941086769104,
0.06836071610450745,
-0.031618617475032806,
0.1140289157629013,
0.5976269841194153,
0.19823361933231354,
-0.20507676899433136,
0.28799766302108765,
0.378837525844574,
-0.5454374551773071,
0.41200917959213257,
-0.1244744211435318,
0.06303413212299347,
-0.2728557586669922,
-0.2673729956150055,
0.2548397481441498,
0.29737305641174316,
0.04660677909851074,
0.11695818603038788,
0.3184424042701721,
-0.31143248081207275,
0.1053866595029831,
0.1059192568063736,
0.8331705331802368,
-0.102659210562706,
0.10974615812301636,
0.006080588325858116,
-0.2956225275993347,
0.23101189732551575,
0.016249477863311768,
-0.019701510667800903,
-0.32745760679244995,
-0.026302602142095566,
-0.07489271461963654,
0.11730733513832092,
-0.0893150269985199,
-0.2544175386428833,
-0.3364708423614502,
0.33193719387054443,
0.0862891674041748,
0.24909649789333344,
-0.041098423302173615,
0.1286925971508026,
-0.27982932329177856,
-0.13739602267742157,
-0.16418111324310303,
0.10074726492166519,
-0.34039583802223206,
0.33686330914497375,
-0.09763608872890472,
-0.03185930475592613,
-0.13965561985969543,
-0.17050129175186157,
-0.375011146068573,
-0.029118292033672333,
-0.5071987509727478,
-0.2612493336200714,
0.1540282517671585,
0.05063505470752716,
-0.06053131818771362,
0.24835248291492462,
0.4257839024066925,
0.029467366635799408,
-0.1870940625667572,
0.20600658655166626,
-0.1756954789161682,
0.1159769743680954,
-0.005810629576444626,
0.05434533581137657,
0.16045168042182922,
0.12473215907812119,
-0.08471126109361649,
-0.19294801354408264,
0.015765439718961716,
0.29356130957603455,
-0.27953553199768066,
-0.06540414690971375,
0.11834850907325745,
-0.21901759505271912,
-0.018099352717399597,
-0.3462508022785187,
0.09250272810459137,
-0.21557286381721497,
0.10567216575145721,
-0.2784609794616699,
0.17854540050029755,
0.1569661945104599,
0.2323829084634781,
-0.3199653625488281,
-0.28992360830307007,
0.5499649047851562,
-0.1117871105670929,
-0.23251816630363464,
-0.028036559000611305,
0.12040863931179047,
-0.13400383293628693,
0.010373368859291077,
0.14414522051811218,
0.22095629572868347,
-0.4527370035648346,
0.03959352523088455,
-0.2797474265098572,
-0.20872928202152252,
0.3011414408683777,
0.3216502070426941,
0.44556358456611633,
-0.28189799189567566,
-0.11530396342277527,
-0.20657029747962952,
-0.45287731289863586,
0.29343968629837036,
-0.1940324753522873,
0.39231863617897034,
0.192562997341156,
0.1012267917394638,
0.03689884394407272,
0.07783937454223633,
-0.28785428404808044,
0.09577243775129318,
-0.08559048920869827,
0.1982438564300537,
-0.0754832774400711,
-0.04096492752432823,
-0.00814766064286232,
-0.21853482723236084,
-0.03154686093330383,
0.11658504605293274,
-0.3038986921310425,
-0.06829094886779785,
-0.19327783584594727,
0.12562233209609985,
0.11563076078891754,
-0.18710961937904358,
0.03595645725727081,
0.18028798699378967,
-0.0629805475473404,
-0.31353849172592163,
0.31334710121154785,
0.3273625373840332,
-0.014017842710018158,
-0.19388256967067719,
0.03312210366129875,
-0.0815276950597763,
0.11133052408695221,
-0.09424598515033722,
0.35991421341896057,
0.4086174964904785,
0.014379657804965973,
0.13753420114517212,
-0.31533879041671753,
-0.011001132428646088,
0.18652182817459106,
0.23844711482524872,
0.21919448673725128,
0.11357398331165314,
0.1400095373392105,
-0.1018654853105545,
0.0908459946513176,
0.1765633076429367,
0.3446192145347595,
-0.06279778480529785,
-0.21010726690292358,
-0.2634565234184265,
0.007657211273908615,
0.14088532328605652,
-0.23043319582939148,
0.0024498291313648224,
0.06979873776435852,
0.15416964888572693,
-0.05039367452263832,
0.2532788813114166,
0.6312237977981567,
0.028955459594726562,
-0.19640132784843445,
0.02769429236650467,
0.5056371688842773,
-0.026558589190244675,
0.13799172639846802,
0.40373191237449646,
-0.11670703440904617,
0.1425434947013855,
0.28890731930732727,
0.1701500117778778,
0.14859332144260406,
0.47469982504844666,
-0.02298600599169731,
0.4916604459285736,
0.18611879646778107,
0.2373965084552765,
0.20515291392803192,
-0.12481512129306793,
0.21614006161689758,
0.35182684659957886,
-0.024506807327270508,
0.3337177336215973,
0.18938979506492615,
0.4530382752418518,
-0.05069481208920479,
-0.2299700528383255,
-0.09395180642604828,
0.1178261861205101,
-0.040242210030555725,
0.04348533973097801,
-0.08340926468372345,
-0.10622875392436981,
-0.310401976108551,
0.2156328707933426,
-0.18375007808208466,
-0.3120575547218323,
0.26138928532600403,
-0.008228197693824768,
-0.44082197546958923,
-0.5664933323860168,
-0.185833141207695,
0.10076659917831421,
0.13930365443229675,
-0.2445487529039383,
0.3754814863204956,
0.18963053822517395,
-0.1984119862318039,
0.49394774436950684,
0.3774341940879822,
0.517874538898468,
0.21508407592773438,
-0.02832525596022606,
-0.08219391852617264,
0.42151638865470886,
0.0026388466358184814,
-0.2178879976272583,
-0.27478694915771484,
0.1780579388141632,
-0.2143639326095581,
0.22561460733413696,
0.13738423585891724,
-0.19879408180713654,
-0.22568120062351227,
-0.21764430403709412,
0.2247585654258728,
0.11732050776481628,
0.24920666217803955,
-0.623719334602356,
-0.03449241816997528,
-0.015419119969010353,
-0.10445451736450195,
-0.5969495177268982,
-0.010698709636926651,
0.21797539293766022,
-0.10410550236701965,
0.23159030079841614,
0.015460330992937088,
0.07132788747549057,
0.05125930905342102,
0.24374353885650635,
0.4735124111175537,
-0.26085683703422546,
-0.07076971232891083,
-0.32539570331573486,
-0.6273013353347778,
0.08650301396846771,
0.13364380598068237,
0.10300163179636002,
0.12861938774585724,
0.06317956745624542,
0.016194069758057594,
-0.20571881532669067,
0.17492857575416565,
-0.03143826127052307,
0.211044579744339,
-0.0652284249663353,
-0.1791677474975586,
-0.06515045464038849,
0.07133656740188599,
-0.07746252417564392,
0.03894410282373428,
-0.2101227194070816,
0.33502787351608276,
-0.1506379395723343,
-0.05818832665681839,
-0.1719624400138855,
0.3289605975151062,
-0.12296600639820099,
-0.11528641730546951,
0.1691441386938095,
0.16774298250675201,
0.3452293872833252,
-0.22363610565662384,
-0.32003289461135864,
-0.1723518818616867,
-0.01113886572420597,
-0.500625729560852,
0.28398397564888,
-0.3210531771183014,
0.6884737014770508,
-0.08021318167448044,
-0.3002987504005432,
-0.20932185649871826,
0.05480886623263359,
0.35738587379455566,
-0.11712700128555298,
-0.3168417811393738,
0.08742725849151611,
-0.3146883249282837,
-0.11554044485092163,
0.22811259329319,
0.4616084396839142,
-0.002501741051673889,
0.15567870438098907,
-0.17828483879566193,
-0.43715929985046387,
0.33957159519195557,
-0.09442584216594696,
0.058766573667526245,
-0.054070040583610535,
0.09235484898090363,
0.08904796093702316,
-0.21865080296993256,
-0.7626646757125854,
0.12036179006099701,
0.14153534173965454,
-0.17087142169475555,
-0.009032778441905975,
0.2403186559677124,
-0.06327851116657257,
0.061939388513565063,
-0.034617532044649124,
0.2445584535598755,
0.2647760510444641,
-0.35646897554397583,
0.033267997205257416,
-0.0050807371735572815
] |
https://github.com/huggingface/datasets/issues/5706 | Hi ! We could definitely a type that holds the categories and uses a DictionaryType storage. There's a ClassLabel type that is similar with a 'names' parameter (similar to a id2label in deep learning frameworks) that uses an integer array as storage.
It can be added in `features.py`. Here are some pointers:
- the conversion from HF type to PyArrow type is done in `get_nested_type`
- the conversion from Pyarrow type to HF type is done in `generate_from_arrow_type`
- `encode_nested_example` and `decode_nested_example` are used to do user's value (what users see) <-> storage value (what is in the pyarrow.array) if there's any conversion to do | Support categorical data types for Parquet | ### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first. | 105 | Support categorical data types for Parquet
### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first.
Hi ! We could definitely a type that holds the categories and uses a DictionaryType storage. There's a ClassLabel type that is similar with a 'names' parameter (similar to a id2label in deep learning frameworks) that uses an integer array as storage.
It can be added in `features.py`. Here are some pointers:
- the conversion from HF type to PyArrow type is done in `get_nested_type`
- the conversion from Pyarrow type to HF type is done in `generate_from_arrow_type`
- `encode_nested_example` and `decode_nested_example` are used to do user's value (what users see) <-> storage value (what is in the pyarrow.array) if there's any conversion to do | [
-0.152938574552536,
-0.06370358169078827,
0.07160879671573639,
0.32455649971961975,
0.4551955461502075,
0.06469179689884186,
-0.1901731789112091,
0.22342005372047424,
0.203786700963974,
-0.2283174693584442,
-0.11718685179948807,
0.5124905109405518,
-0.2902349531650543,
0.44914382696151733,
-0.020855922251939774,
-0.2356620728969574,
0.11446522921323776,
-0.05483004450798035,
0.0671464204788208,
0.21519631147384644,
-0.2553243339061737,
0.37052780389785767,
0.021052315831184387,
0.17270562052726746,
-0.005001053214073181,
-0.20741158723831177,
-0.17676939070224762,
0.1230643093585968,
-0.4154319167137146,
-0.648801326751709,
0.38270604610443115,
-0.06258346140384674,
0.07781172543764114,
0.16082338988780975,
-0.00011092540808022022,
0.20099994540214539,
0.22811582684516907,
-0.05094720423221588,
0.07525114715099335,
-0.6103057861328125,
0.25767678022384644,
-0.3289322257041931,
0.5521793961524963,
-0.21667873859405518,
-0.28450876474380493,
-0.5699324011802673,
-0.0010316865518689156,
-0.050077129155397415,
0.13149625062942505,
0.24128347635269165,
0.2137584686279297,
0.12009842693805695,
0.3107171058654785,
-0.026749245822429657,
0.29283881187438965,
0.2815583050251007,
-0.26439225673675537,
0.1390400528907776,
0.19724245369434357,
-0.03920833021402359,
0.10887692123651505,
-0.047020141035318375,
0.07511953264474869,
-0.12355630099773407,
0.26804596185684204,
0.19692714512348175,
0.2707127332687378,
-0.16132812201976776,
-0.1130475103855133,
0.15778645873069763,
0.23117531836032867,
-0.348167359828949,
-0.3780864179134369,
-0.34970414638519287,
-0.08686838299036026,
-0.23116783797740936,
0.3346812129020691,
0.3381064832210541,
-0.03735218942165375,
0.07614102214574814,
0.2864310145378113,
0.10737806558609009,
-0.1368553787469864,
0.15590734779834747,
-0.20811225473880768,
0.051938969641923904,
-0.22799769043922424,
-0.04494556412100792,
0.35474693775177,
-0.27781617641448975,
-0.22969049215316772,
0.05305665358901024,
-0.1878403127193451,
0.0989813357591629,
-0.2532532215118408,
-0.1310701221227646,
-0.18735121190547943,
0.43419149518013,
0.24213898181915283,
-0.08589248359203339,
0.1634422093629837,
-0.06389711052179337,
0.1353231519460678,
0.29720693826675415,
0.47173649072647095,
-0.17446671426296234,
0.038373105227947235,
0.04406629130244255,
-0.26854804158210754,
0.3720489740371704,
0.1295095980167389,
-0.2310546636581421,
0.026296399533748627,
-0.21925373375415802,
-0.208120658993721,
-0.1931491196155548,
0.5561254620552063,
-0.0638805404305458,
-0.1691259890794754,
0.1650553047657013,
0.11396956443786621,
0.18829651176929474,
0.10086981952190399,
0.3479073643684387,
-0.022937806323170662,
0.02642764523625374,
-0.10813335329294205,
0.4272960424423218,
-0.06958991289138794,
-0.26751598715782166,
-0.052012547850608826,
0.18189457058906555,
-0.12289297580718994,
-0.34406009316444397,
0.051090121269226074,
-0.13396772742271423,
-0.016252990812063217,
0.24607893824577332,
0.016065379604697227,
0.11210143566131592,
-0.20609289407730103,
-0.24143250286579132,
-0.099113829433918,
0.210547536611557,
-0.1118248701095581,
-0.042394645512104034,
0.44341424107551575,
-0.5455547571182251,
-0.29060906171798706,
-0.06072327122092247,
-0.17885178327560425,
-0.13254398107528687,
-0.26276135444641113,
0.11716574430465698,
0.04377703368663788,
-0.10584572702646255,
-0.6395193934440613,
0.4424750804901123,
-0.1372944712638855,
-0.1937583088874817,
-0.05611115321516991,
-0.07101194560527802,
-0.1416284441947937,
-0.25209540128707886,
0.052349187433719635,
0.22650232911109924,
-0.42769789695739746,
0.02059689164161682,
0.01941388100385666,
-0.23541375994682312,
0.3803633153438568,
0.3180568814277649,
-0.02763085812330246,
-0.4074193239212036,
-0.03246611729264259,
0.22595669329166412,
0.3833453953266144,
-0.034665364772081375,
0.029156766831874847,
0.10229064524173737,
0.11098361760377884,
0.31626445055007935,
0.18920253217220306,
-0.3239975571632385,
0.50709068775177,
-0.013011213392019272,
-0.02620040625333786,
0.04411611706018448,
-0.20981580018997192,
-0.06783615797758102,
-0.3061771094799042,
-0.14404937624931335,
0.4953615367412567,
0.14524048566818237,
-0.2497681975364685,
-0.10603898763656616,
0.2180664986371994,
-0.26237770915031433,
0.14679385721683502,
-0.031239736825227737,
-0.030373938381671906,
-0.023333575576543808,
0.2688630521297455,
0.6133161187171936,
0.08784923702478409,
-0.3044065237045288,
-0.3224829435348511,
0.2282199114561081,
0.052213676273822784,
0.06213083863258362,
-0.24143855273723602,
-0.30301064252853394,
-0.14496557414531708,
0.1378384530544281,
-0.09390182793140411,
-0.01944703608751297,
0.1721343994140625,
-0.08013330399990082,
0.021914541721343994,
0.29322192072868347,
-0.18580783903598785,
0.22619204223155975,
-0.21847137808799744,
0.2586442530155182,
-0.06182252988219261,
0.18199323117733002,
-0.10379088670015335,
-0.3180977702140808,
0.07615016400814056,
0.21751287579536438,
0.07291470468044281,
-0.10771507024765015,
0.2687312066555023,
0.2809019088745117,
0.2731555104255676,
0.027974411845207214,
-0.09046827256679535,
0.16220802068710327,
0.14152175188064575,
-0.05531177297234535,
-0.1670624315738678,
-0.12894617021083832,
0.1957995593547821,
0.12024074047803879,
-0.05643313378095627,
0.39094457030296326,
-0.035749807953834534,
0.023572636768221855,
-0.11664607375860214,
0.17691445350646973,
0.24842453002929688,
0.32303303480148315,
-0.23134571313858032,
-0.12353555858135223,
0.2530020475387573,
-0.0045946817845106125,
-0.1921282559633255,
-0.07039051502943039,
-0.5973890423774719,
0.01568268984556198,
0.3798612952232361,
0.11977086216211319,
0.1029573604464531,
0.04136619344353676,
0.2032211422920227,
0.08613710105419159,
-0.04918786138296127,
0.27293264865875244,
0.0384262353181839,
0.2379569262266159,
-0.12969478964805603,
0.08426417410373688,
-0.22460967302322388,
0.058242786675691605,
0.2596370577812195,
0.17151939868927002,
-0.05381207540631294,
-0.21425727009773254,
0.2914349436759949,
0.06249687820672989,
-0.37361446022987366,
0.14000560343265533,
0.06541142612695694,
0.10063115507364273,
-0.42535924911499023,
0.10444281250238419,
-0.3702431321144104,
-0.05711374431848526,
-0.13888244330883026,
-0.00012029334902763367,
-0.23791804909706116,
-0.20550847053527832,
-0.10111063718795776,
0.12339800596237183,
-0.09335972368717194,
-0.04076502472162247,
-0.1659088134765625,
0.18208682537078857,
-0.027358591556549072,
-0.12820883095264435,
-0.262002170085907,
-0.36206701397895813,
-0.12342662364244461,
0.09313923120498657,
0.15297982096672058,
-0.14776605367660522,
0.35018548369407654,
-0.042704418301582336,
0.027697138488292694,
-0.25959527492523193,
-0.4133831858634949,
-0.023066453635692596,
-0.39364928007125854,
0.1958536058664322,
0.22667653858661652,
0.09073315560817719,
-0.2696143388748169,
-0.28969186544418335,
0.47491422295570374,
-0.056450508534908295,
-0.20800185203552246,
0.22151446342468262,
-0.0034103170037269592,
-0.0970926433801651,
-0.10649419575929642,
-0.10217826068401337,
-0.29842817783355713,
-0.2879944145679474,
0.4497191607952118,
0.1444402039051056,
-0.034513913094997406,
-0.1965426504611969,
-0.0278362687677145,
-0.01861807331442833,
-0.527838945388794,
0.06636419147253036,
-0.040320198982954025,
-0.002724006772041321,
0.32798123359680176,
-0.1422857940196991,
-0.38700562715530396,
0.19021424651145935,
-0.00631202757358551,
0.18691426515579224,
-0.003984272480010986,
-0.20849883556365967,
-0.08707308024168015,
-0.10268814861774445,
0.19811725616455078,
-0.037180427461862564,
-0.14256322383880615,
0.3516176640987396,
0.06691202521324158,
-0.024691686034202576,
-0.07317157089710236,
-0.06056349724531174,
-0.004815500229597092,
0.184244766831398,
-0.05091938003897667,
-0.04849030077457428,
0.6205022931098938,
0.2456151247024536,
0.17862682044506073,
-0.05995325744152069,
0.14099034667015076,
0.6188872456550598,
-0.32015615701675415,
0.39276546239852905,
-0.04005168378353119,
-0.2920130491256714,
-0.08307938277721405,
-0.25417888164520264,
0.26055699586868286,
0.117622971534729,
-0.05621738359332085,
-0.1948554515838623,
-0.11590456962585449,
-0.07275794446468353,
-0.2815675735473633,
-0.2757439613342285,
-0.057677969336509705,
-0.035767700523138046,
0.06650535762310028,
-0.12679755687713623,
-0.12256654351949692,
-0.010229043662548065,
-0.13874486088752747,
0.07516616582870483,
0.44735440611839294,
-0.061268918216228485,
0.19017724692821503,
0.01140981912612915,
-0.03884042054414749,
-0.45768457651138306,
0.1959451138973236,
-0.07473284751176834,
0.04759768769145012,
-0.07114357501268387,
0.0807332843542099,
0.0882553905248642,
-0.06675455719232559,
0.718495786190033,
0.22504828870296478,
-0.06621228158473969,
-0.024248193949460983,
-0.33991539478302,
-0.8340396285057068,
-0.013831473886966705,
-0.27823197841644287,
-0.057074785232543945,
0.04007493332028389,
0.17242532968521118,
-0.49052464962005615,
-0.09912491589784622,
-0.18934789299964905,
-0.16268613934516907,
0.06819130480289459,
0.16527393460273743,
-0.3242438733577728,
-0.11752858757972717,
-0.23418593406677246,
0.10246653854846954,
0.3930708169937134,
0.4166416823863983,
0.07237891107797623,
0.18640689551830292,
-0.25309085845947266,
-0.06964681297540665,
0.05651126429438591,
0.04648076742887497,
0.4361877143383026,
-0.16080568730831146,
0.055259376764297485,
0.07910327613353729,
0.3671548664569855,
-0.0054856762290000916,
0.6376227140426636,
0.18200403451919556,
-0.8556132316589355,
0.09358629584312439,
0.07778027653694153,
0.1841108500957489,
-0.11737856268882751,
-0.21510514616966248,
0.132696270942688,
-0.2387053519487381,
0.023384831845760345,
-0.39083680510520935,
-0.007381375879049301,
0.4942101836204529,
-0.1826823353767395,
-0.05021054670214653,
-0.30054232478141785,
0.4798077940940857,
0.05160748213529587,
0.16309425234794617,
0.006000073626637459,
1.0382771492004395,
-0.07405431568622589,
0.5716263055801392,
0.19556033611297607,
0.5652731657028198,
-0.2233593612909317,
0.13003714382648468,
0.4695199131965637,
-0.43532776832580566,
0.6631953716278076,
-0.20386216044425964,
0.1119074821472168,
-0.19924727082252502,
0.14236706495285034,
-0.12076494097709656,
-0.0540260449051857,
0.35178524255752563,
0.17814071476459503,
-0.3683437705039978,
0.013651318848133087,
-0.06607756018638611,
-0.1214323490858078,
-0.18642890453338623,
0.09076545387506485,
-0.2680352032184601,
-0.04683420807123184,
-0.5542470812797546,
0.1113433986902237,
-0.04513793811202049,
-0.22735461592674255,
0.08390355855226517,
-0.08016453683376312,
-0.04552546143531799,
-0.16013798117637634,
-0.3407999873161316,
-0.12523427605628967,
-0.2388758808374405,
-0.058940693736076355,
0.2853381633758545,
-0.08259396255016327,
0.46309414505958557,
0.41096872091293335,
0.20715627074241638,
-0.15141089260578156,
-0.27755090594291687,
-0.09449218958616257,
-0.011212252080440521,
-0.28136682510375977,
-0.09983998537063599,
-0.07942645251750946,
0.14180442690849304,
-0.024740781635046005,
0.07766857743263245,
-0.17458173632621765,
-0.019267994910478592,
0.06438839435577393,
-0.008225589990615845,
0.15524323284626007,
-0.07160738110542297,
-0.4612441956996918,
-0.20946843922138214,
-0.5635542869567871,
0.19257597625255585,
-0.03703829646110535,
0.09621217846870422,
0.10231173038482666,
0.06616123020648956,
-0.21871308982372284,
0.020441005006432533,
-0.07168574631214142,
-0.06777378916740417,
0.10968833416700363,
-0.2659640610218048,
0.42996281385421753,
0.37740302085876465,
0.21425646543502808,
-0.35159140825271606,
0.002625107765197754,
-0.22908002138137817,
0.420737624168396,
-0.3914269208908081,
0.1481291949748993,
0.16586580872535706,
-0.11029859632253647,
0.060873616486787796,
0.3707968294620514,
0.18954689800739288,
-0.21172161400318146,
0.17728830873966217,
-0.43558192253112793,
-0.05445905029773712,
0.4014973044395447,
-0.23180708289146423,
-0.021581605076789856,
0.5051809549331665,
0.17413538694381714,
0.020044520497322083,
-0.15647566318511963,
-0.2798447906970978,
0.2047216296195984,
-0.04424840211868286,
0.09171046316623688,
0.3787393867969513,
-0.15282294154167175,
0.17503759264945984,
0.1801518052816391,
0.15004710853099823,
0.2598145604133606,
0.07804537564516068,
-0.1108713299036026,
-0.05083814635872841,
0.0741894543170929,
0.04354808107018471,
0.2666358947753906,
-0.1173529177904129,
-0.04297483712434769,
-0.2918795347213745,
-0.0614822693169117,
0.0847870409488678,
0.09422503411769867,
-0.19989259541034698,
0.043434254825115204,
0.4416302442550659,
-0.017980754375457764,
-0.00846833735704422,
0.0936708152294159,
-0.15071329474449158,
-0.03702670335769653,
-0.036776602268218994,
-0.003534260904416442,
-0.360785573720932,
0.042213574051856995,
0.10087853670120239,
0.310473769903183,
0.07996118813753128,
-0.04534416273236275,
0.38723933696746826,
-0.13583886623382568,
0.062409721314907074,
0.1783066987991333,
0.48660868406295776,
0.24026572704315186,
0.08309144526720047,
-0.19391180574893951,
0.2908010482788086,
0.08038543909788132,
-0.3014996647834778,
-0.16011452674865723,
0.19678619503974915,
0.3266863524913788,
0.16219529509544373,
0.2776813507080078,
0.11590345203876495,
0.18691939115524292,
-0.2710854709148407,
0.08541136980056763,
0.44702982902526855,
0.06388489156961441,
0.16394956409931183,
0.0839596837759018,
-0.060318723320961,
-0.04282628744840622,
0.14711418747901917,
0.16866344213485718,
0.1388208419084549,
0.2380208820104599,
-0.08630967885255814,
0.04701230674982071,
0.11994391679763794,
-0.038249652832746506,
0.17654800415039062,
-0.33754265308380127,
0.13054609298706055,
0.11013396084308624,
0.2258099466562271,
-0.023585986346006393,
-0.005128789693117142,
0.39979514479637146,
0.2657366693019867,
-0.14418570697307587,
-0.2427893579006195,
0.2887210547924042,
-0.16075743734836578,
-0.047337356954813004,
0.16876649856567383,
-0.23207923769950867,
-0.11525672674179077,
-0.05090245231986046,
-0.18779151141643524,
-0.023482035845518112,
0.07682802528142929,
-0.02623225376009941,
0.3115014433860779,
-0.33180370926856995,
-0.06646447628736496,
-0.027238165959715843,
0.31528085470199585,
-0.1311650425195694,
0.2724405527114868,
0.13928985595703125,
-0.36486461758613586,
0.13467589020729065,
0.2744894027709961,
0.5965859889984131,
0.2164677530527115,
-0.11494973301887512,
-0.05759773403406143,
-0.31083670258522034,
-0.13155889511108398,
0.18677058815956116,
0.07129751145839691,
0.18611417710781097,
0.47037971019744873,
0.40274327993392944,
0.1273161917924881,
0.04153133183717728,
-0.3296956419944763,
0.0058267321437597275,
0.2159140706062317,
-0.21139472723007202,
0.14371562004089355,
-0.13591676950454712,
0.09227066487073898,
-0.15669949352741241,
-0.058654818683862686,
-0.43180030584335327,
-0.4557279646396637,
-0.1574457734823227,
0.05842245742678642,
0.12081960588693619,
-0.11879095435142517,
0.0824909433722496,
0.3132113814353943,
0.43742692470550537,
0.3032170832157135,
-0.04457304626703262,
-0.12881413102149963,
-0.14282426238059998,
-0.5084798336029053,
0.049753542989492416,
-0.1661849319934845,
-0.226470485329628,
0.4137077033519745,
0.2573765516281128,
0.18270227313041687,
0.18920999765396118,
-0.19281329214572906,
0.31290143728256226,
-0.23681403696537018,
0.15212537348270416,
-0.11407220363616943,
-0.20943593978881836,
0.005846225656569004,
-0.3120182752609253,
-0.02526034042239189,
0.2024112045764923,
0.2185799479484558,
-0.07268483191728592,
0.03043949604034424,
-0.015098392963409424,
0.1416952908039093,
-0.3610880970954895,
-0.28920018672943115,
-0.1019616574048996,
0.22302132844924927,
0.1745631843805313,
0.04900035262107849,
-0.07820279151201248,
-0.17177166044712067,
-0.18933190405368805,
-0.23088882863521576,
0.5810200572013855,
-0.11861994862556458,
0.29229021072387695,
-0.305107980966568,
-0.2905067503452301,
-0.11792607605457306,
0.07087436318397522,
-0.04611311852931976,
-0.05421169847249985,
-0.24019373953342438,
0.18587009608745575,
0.16082878410816193,
-0.08625855296850204,
-0.08565138280391693,
0.191035658121109,
0.1209009662270546,
0.25492897629737854,
0.0780114233493805,
-0.48965519666671753,
0.4284687042236328,
-0.4832099676132202,
-0.2350735366344452,
0.16522657871246338,
0.009573161602020264,
0.39178329706192017,
-0.012847625650465488,
-0.38523703813552856,
-0.02024843543767929,
0.1411222666501999,
0.06605831533670425,
0.02197563648223877,
-0.03927989676594734,
-0.04531735181808472,
-0.18241041898727417,
-0.2932910919189453,
0.21277183294296265,
0.07405507564544678,
0.1467665731906891,
0.14264404773712158,
-0.24928566813468933
] |
https://github.com/huggingface/datasets/issues/5706 | Hey folks -- I'm thinking about trying a PR for this. As far as I can tell the only sticky point is that auto-generation of features from a pyarrow schema will fail under the current `generate_from_arrow_type` function because there is no encoding of the categorical string label -> int map in the pa.dictionary type itself; that is stored with the full array.
I see two ways to solve this. Option 1 is to require datasets with categorical types to use pyarrow schema metadata to encode the entire HF feature dictionary, that way categorical types don't ever need to be inferred from the pa type alone. The downside to this is that it means that these datasets will be a bit brittle, as if the feature encoding API ever changes, they will suddenly be unloadable.
The other option is to modify `generate_from_arrow_type` to take per-field metadata, and include just that metadata (the category labels) in the schema metadata.
Does anyone at HF have any preference on these two (or alternate) approaches? | Support categorical data types for Parquet | ### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first. | 170 | Support categorical data types for Parquet
### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first.
Hey folks -- I'm thinking about trying a PR for this. As far as I can tell the only sticky point is that auto-generation of features from a pyarrow schema will fail under the current `generate_from_arrow_type` function because there is no encoding of the categorical string label -> int map in the pa.dictionary type itself; that is stored with the full array.
I see two ways to solve this. Option 1 is to require datasets with categorical types to use pyarrow schema metadata to encode the entire HF feature dictionary, that way categorical types don't ever need to be inferred from the pa type alone. The downside to this is that it means that these datasets will be a bit brittle, as if the feature encoding API ever changes, they will suddenly be unloadable.
The other option is to modify `generate_from_arrow_type` to take per-field metadata, and include just that metadata (the category labels) in the schema metadata.
Does anyone at HF have any preference on these two (or alternate) approaches? | [
-0.152938574552536,
-0.06370358169078827,
0.07160879671573639,
0.32455649971961975,
0.4551955461502075,
0.06469179689884186,
-0.1901731789112091,
0.22342005372047424,
0.203786700963974,
-0.2283174693584442,
-0.11718685179948807,
0.5124905109405518,
-0.2902349531650543,
0.44914382696151733,
-0.020855922251939774,
-0.2356620728969574,
0.11446522921323776,
-0.05483004450798035,
0.0671464204788208,
0.21519631147384644,
-0.2553243339061737,
0.37052780389785767,
0.021052315831184387,
0.17270562052726746,
-0.005001053214073181,
-0.20741158723831177,
-0.17676939070224762,
0.1230643093585968,
-0.4154319167137146,
-0.648801326751709,
0.38270604610443115,
-0.06258346140384674,
0.07781172543764114,
0.16082338988780975,
-0.00011092540808022022,
0.20099994540214539,
0.22811582684516907,
-0.05094720423221588,
0.07525114715099335,
-0.6103057861328125,
0.25767678022384644,
-0.3289322257041931,
0.5521793961524963,
-0.21667873859405518,
-0.28450876474380493,
-0.5699324011802673,
-0.0010316865518689156,
-0.050077129155397415,
0.13149625062942505,
0.24128347635269165,
0.2137584686279297,
0.12009842693805695,
0.3107171058654785,
-0.026749245822429657,
0.29283881187438965,
0.2815583050251007,
-0.26439225673675537,
0.1390400528907776,
0.19724245369434357,
-0.03920833021402359,
0.10887692123651505,
-0.047020141035318375,
0.07511953264474869,
-0.12355630099773407,
0.26804596185684204,
0.19692714512348175,
0.2707127332687378,
-0.16132812201976776,
-0.1130475103855133,
0.15778645873069763,
0.23117531836032867,
-0.348167359828949,
-0.3780864179134369,
-0.34970414638519287,
-0.08686838299036026,
-0.23116783797740936,
0.3346812129020691,
0.3381064832210541,
-0.03735218942165375,
0.07614102214574814,
0.2864310145378113,
0.10737806558609009,
-0.1368553787469864,
0.15590734779834747,
-0.20811225473880768,
0.051938969641923904,
-0.22799769043922424,
-0.04494556412100792,
0.35474693775177,
-0.27781617641448975,
-0.22969049215316772,
0.05305665358901024,
-0.1878403127193451,
0.0989813357591629,
-0.2532532215118408,
-0.1310701221227646,
-0.18735121190547943,
0.43419149518013,
0.24213898181915283,
-0.08589248359203339,
0.1634422093629837,
-0.06389711052179337,
0.1353231519460678,
0.29720693826675415,
0.47173649072647095,
-0.17446671426296234,
0.038373105227947235,
0.04406629130244255,
-0.26854804158210754,
0.3720489740371704,
0.1295095980167389,
-0.2310546636581421,
0.026296399533748627,
-0.21925373375415802,
-0.208120658993721,
-0.1931491196155548,
0.5561254620552063,
-0.0638805404305458,
-0.1691259890794754,
0.1650553047657013,
0.11396956443786621,
0.18829651176929474,
0.10086981952190399,
0.3479073643684387,
-0.022937806323170662,
0.02642764523625374,
-0.10813335329294205,
0.4272960424423218,
-0.06958991289138794,
-0.26751598715782166,
-0.052012547850608826,
0.18189457058906555,
-0.12289297580718994,
-0.34406009316444397,
0.051090121269226074,
-0.13396772742271423,
-0.016252990812063217,
0.24607893824577332,
0.016065379604697227,
0.11210143566131592,
-0.20609289407730103,
-0.24143250286579132,
-0.099113829433918,
0.210547536611557,
-0.1118248701095581,
-0.042394645512104034,
0.44341424107551575,
-0.5455547571182251,
-0.29060906171798706,
-0.06072327122092247,
-0.17885178327560425,
-0.13254398107528687,
-0.26276135444641113,
0.11716574430465698,
0.04377703368663788,
-0.10584572702646255,
-0.6395193934440613,
0.4424750804901123,
-0.1372944712638855,
-0.1937583088874817,
-0.05611115321516991,
-0.07101194560527802,
-0.1416284441947937,
-0.25209540128707886,
0.052349187433719635,
0.22650232911109924,
-0.42769789695739746,
0.02059689164161682,
0.01941388100385666,
-0.23541375994682312,
0.3803633153438568,
0.3180568814277649,
-0.02763085812330246,
-0.4074193239212036,
-0.03246611729264259,
0.22595669329166412,
0.3833453953266144,
-0.034665364772081375,
0.029156766831874847,
0.10229064524173737,
0.11098361760377884,
0.31626445055007935,
0.18920253217220306,
-0.3239975571632385,
0.50709068775177,
-0.013011213392019272,
-0.02620040625333786,
0.04411611706018448,
-0.20981580018997192,
-0.06783615797758102,
-0.3061771094799042,
-0.14404937624931335,
0.4953615367412567,
0.14524048566818237,
-0.2497681975364685,
-0.10603898763656616,
0.2180664986371994,
-0.26237770915031433,
0.14679385721683502,
-0.031239736825227737,
-0.030373938381671906,
-0.023333575576543808,
0.2688630521297455,
0.6133161187171936,
0.08784923702478409,
-0.3044065237045288,
-0.3224829435348511,
0.2282199114561081,
0.052213676273822784,
0.06213083863258362,
-0.24143855273723602,
-0.30301064252853394,
-0.14496557414531708,
0.1378384530544281,
-0.09390182793140411,
-0.01944703608751297,
0.1721343994140625,
-0.08013330399990082,
0.021914541721343994,
0.29322192072868347,
-0.18580783903598785,
0.22619204223155975,
-0.21847137808799744,
0.2586442530155182,
-0.06182252988219261,
0.18199323117733002,
-0.10379088670015335,
-0.3180977702140808,
0.07615016400814056,
0.21751287579536438,
0.07291470468044281,
-0.10771507024765015,
0.2687312066555023,
0.2809019088745117,
0.2731555104255676,
0.027974411845207214,
-0.09046827256679535,
0.16220802068710327,
0.14152175188064575,
-0.05531177297234535,
-0.1670624315738678,
-0.12894617021083832,
0.1957995593547821,
0.12024074047803879,
-0.05643313378095627,
0.39094457030296326,
-0.035749807953834534,
0.023572636768221855,
-0.11664607375860214,
0.17691445350646973,
0.24842453002929688,
0.32303303480148315,
-0.23134571313858032,
-0.12353555858135223,
0.2530020475387573,
-0.0045946817845106125,
-0.1921282559633255,
-0.07039051502943039,
-0.5973890423774719,
0.01568268984556198,
0.3798612952232361,
0.11977086216211319,
0.1029573604464531,
0.04136619344353676,
0.2032211422920227,
0.08613710105419159,
-0.04918786138296127,
0.27293264865875244,
0.0384262353181839,
0.2379569262266159,
-0.12969478964805603,
0.08426417410373688,
-0.22460967302322388,
0.058242786675691605,
0.2596370577812195,
0.17151939868927002,
-0.05381207540631294,
-0.21425727009773254,
0.2914349436759949,
0.06249687820672989,
-0.37361446022987366,
0.14000560343265533,
0.06541142612695694,
0.10063115507364273,
-0.42535924911499023,
0.10444281250238419,
-0.3702431321144104,
-0.05711374431848526,
-0.13888244330883026,
-0.00012029334902763367,
-0.23791804909706116,
-0.20550847053527832,
-0.10111063718795776,
0.12339800596237183,
-0.09335972368717194,
-0.04076502472162247,
-0.1659088134765625,
0.18208682537078857,
-0.027358591556549072,
-0.12820883095264435,
-0.262002170085907,
-0.36206701397895813,
-0.12342662364244461,
0.09313923120498657,
0.15297982096672058,
-0.14776605367660522,
0.35018548369407654,
-0.042704418301582336,
0.027697138488292694,
-0.25959527492523193,
-0.4133831858634949,
-0.023066453635692596,
-0.39364928007125854,
0.1958536058664322,
0.22667653858661652,
0.09073315560817719,
-0.2696143388748169,
-0.28969186544418335,
0.47491422295570374,
-0.056450508534908295,
-0.20800185203552246,
0.22151446342468262,
-0.0034103170037269592,
-0.0970926433801651,
-0.10649419575929642,
-0.10217826068401337,
-0.29842817783355713,
-0.2879944145679474,
0.4497191607952118,
0.1444402039051056,
-0.034513913094997406,
-0.1965426504611969,
-0.0278362687677145,
-0.01861807331442833,
-0.527838945388794,
0.06636419147253036,
-0.040320198982954025,
-0.002724006772041321,
0.32798123359680176,
-0.1422857940196991,
-0.38700562715530396,
0.19021424651145935,
-0.00631202757358551,
0.18691426515579224,
-0.003984272480010986,
-0.20849883556365967,
-0.08707308024168015,
-0.10268814861774445,
0.19811725616455078,
-0.037180427461862564,
-0.14256322383880615,
0.3516176640987396,
0.06691202521324158,
-0.024691686034202576,
-0.07317157089710236,
-0.06056349724531174,
-0.004815500229597092,
0.184244766831398,
-0.05091938003897667,
-0.04849030077457428,
0.6205022931098938,
0.2456151247024536,
0.17862682044506073,
-0.05995325744152069,
0.14099034667015076,
0.6188872456550598,
-0.32015615701675415,
0.39276546239852905,
-0.04005168378353119,
-0.2920130491256714,
-0.08307938277721405,
-0.25417888164520264,
0.26055699586868286,
0.117622971534729,
-0.05621738359332085,
-0.1948554515838623,
-0.11590456962585449,
-0.07275794446468353,
-0.2815675735473633,
-0.2757439613342285,
-0.057677969336509705,
-0.035767700523138046,
0.06650535762310028,
-0.12679755687713623,
-0.12256654351949692,
-0.010229043662548065,
-0.13874486088752747,
0.07516616582870483,
0.44735440611839294,
-0.061268918216228485,
0.19017724692821503,
0.01140981912612915,
-0.03884042054414749,
-0.45768457651138306,
0.1959451138973236,
-0.07473284751176834,
0.04759768769145012,
-0.07114357501268387,
0.0807332843542099,
0.0882553905248642,
-0.06675455719232559,
0.718495786190033,
0.22504828870296478,
-0.06621228158473969,
-0.024248193949460983,
-0.33991539478302,
-0.8340396285057068,
-0.013831473886966705,
-0.27823197841644287,
-0.057074785232543945,
0.04007493332028389,
0.17242532968521118,
-0.49052464962005615,
-0.09912491589784622,
-0.18934789299964905,
-0.16268613934516907,
0.06819130480289459,
0.16527393460273743,
-0.3242438733577728,
-0.11752858757972717,
-0.23418593406677246,
0.10246653854846954,
0.3930708169937134,
0.4166416823863983,
0.07237891107797623,
0.18640689551830292,
-0.25309085845947266,
-0.06964681297540665,
0.05651126429438591,
0.04648076742887497,
0.4361877143383026,
-0.16080568730831146,
0.055259376764297485,
0.07910327613353729,
0.3671548664569855,
-0.0054856762290000916,
0.6376227140426636,
0.18200403451919556,
-0.8556132316589355,
0.09358629584312439,
0.07778027653694153,
0.1841108500957489,
-0.11737856268882751,
-0.21510514616966248,
0.132696270942688,
-0.2387053519487381,
0.023384831845760345,
-0.39083680510520935,
-0.007381375879049301,
0.4942101836204529,
-0.1826823353767395,
-0.05021054670214653,
-0.30054232478141785,
0.4798077940940857,
0.05160748213529587,
0.16309425234794617,
0.006000073626637459,
1.0382771492004395,
-0.07405431568622589,
0.5716263055801392,
0.19556033611297607,
0.5652731657028198,
-0.2233593612909317,
0.13003714382648468,
0.4695199131965637,
-0.43532776832580566,
0.6631953716278076,
-0.20386216044425964,
0.1119074821472168,
-0.19924727082252502,
0.14236706495285034,
-0.12076494097709656,
-0.0540260449051857,
0.35178524255752563,
0.17814071476459503,
-0.3683437705039978,
0.013651318848133087,
-0.06607756018638611,
-0.1214323490858078,
-0.18642890453338623,
0.09076545387506485,
-0.2680352032184601,
-0.04683420807123184,
-0.5542470812797546,
0.1113433986902237,
-0.04513793811202049,
-0.22735461592674255,
0.08390355855226517,
-0.08016453683376312,
-0.04552546143531799,
-0.16013798117637634,
-0.3407999873161316,
-0.12523427605628967,
-0.2388758808374405,
-0.058940693736076355,
0.2853381633758545,
-0.08259396255016327,
0.46309414505958557,
0.41096872091293335,
0.20715627074241638,
-0.15141089260578156,
-0.27755090594291687,
-0.09449218958616257,
-0.011212252080440521,
-0.28136682510375977,
-0.09983998537063599,
-0.07942645251750946,
0.14180442690849304,
-0.024740781635046005,
0.07766857743263245,
-0.17458173632621765,
-0.019267994910478592,
0.06438839435577393,
-0.008225589990615845,
0.15524323284626007,
-0.07160738110542297,
-0.4612441956996918,
-0.20946843922138214,
-0.5635542869567871,
0.19257597625255585,
-0.03703829646110535,
0.09621217846870422,
0.10231173038482666,
0.06616123020648956,
-0.21871308982372284,
0.020441005006432533,
-0.07168574631214142,
-0.06777378916740417,
0.10968833416700363,
-0.2659640610218048,
0.42996281385421753,
0.37740302085876465,
0.21425646543502808,
-0.35159140825271606,
0.002625107765197754,
-0.22908002138137817,
0.420737624168396,
-0.3914269208908081,
0.1481291949748993,
0.16586580872535706,
-0.11029859632253647,
0.060873616486787796,
0.3707968294620514,
0.18954689800739288,
-0.21172161400318146,
0.17728830873966217,
-0.43558192253112793,
-0.05445905029773712,
0.4014973044395447,
-0.23180708289146423,
-0.021581605076789856,
0.5051809549331665,
0.17413538694381714,
0.020044520497322083,
-0.15647566318511963,
-0.2798447906970978,
0.2047216296195984,
-0.04424840211868286,
0.09171046316623688,
0.3787393867969513,
-0.15282294154167175,
0.17503759264945984,
0.1801518052816391,
0.15004710853099823,
0.2598145604133606,
0.07804537564516068,
-0.1108713299036026,
-0.05083814635872841,
0.0741894543170929,
0.04354808107018471,
0.2666358947753906,
-0.1173529177904129,
-0.04297483712434769,
-0.2918795347213745,
-0.0614822693169117,
0.0847870409488678,
0.09422503411769867,
-0.19989259541034698,
0.043434254825115204,
0.4416302442550659,
-0.017980754375457764,
-0.00846833735704422,
0.0936708152294159,
-0.15071329474449158,
-0.03702670335769653,
-0.036776602268218994,
-0.003534260904416442,
-0.360785573720932,
0.042213574051856995,
0.10087853670120239,
0.310473769903183,
0.07996118813753128,
-0.04534416273236275,
0.38723933696746826,
-0.13583886623382568,
0.062409721314907074,
0.1783066987991333,
0.48660868406295776,
0.24026572704315186,
0.08309144526720047,
-0.19391180574893951,
0.2908010482788086,
0.08038543909788132,
-0.3014996647834778,
-0.16011452674865723,
0.19678619503974915,
0.3266863524913788,
0.16219529509544373,
0.2776813507080078,
0.11590345203876495,
0.18691939115524292,
-0.2710854709148407,
0.08541136980056763,
0.44702982902526855,
0.06388489156961441,
0.16394956409931183,
0.0839596837759018,
-0.060318723320961,
-0.04282628744840622,
0.14711418747901917,
0.16866344213485718,
0.1388208419084549,
0.2380208820104599,
-0.08630967885255814,
0.04701230674982071,
0.11994391679763794,
-0.038249652832746506,
0.17654800415039062,
-0.33754265308380127,
0.13054609298706055,
0.11013396084308624,
0.2258099466562271,
-0.023585986346006393,
-0.005128789693117142,
0.39979514479637146,
0.2657366693019867,
-0.14418570697307587,
-0.2427893579006195,
0.2887210547924042,
-0.16075743734836578,
-0.047337356954813004,
0.16876649856567383,
-0.23207923769950867,
-0.11525672674179077,
-0.05090245231986046,
-0.18779151141643524,
-0.023482035845518112,
0.07682802528142929,
-0.02623225376009941,
0.3115014433860779,
-0.33180370926856995,
-0.06646447628736496,
-0.027238165959715843,
0.31528085470199585,
-0.1311650425195694,
0.2724405527114868,
0.13928985595703125,
-0.36486461758613586,
0.13467589020729065,
0.2744894027709961,
0.5965859889984131,
0.2164677530527115,
-0.11494973301887512,
-0.05759773403406143,
-0.31083670258522034,
-0.13155889511108398,
0.18677058815956116,
0.07129751145839691,
0.18611417710781097,
0.47037971019744873,
0.40274327993392944,
0.1273161917924881,
0.04153133183717728,
-0.3296956419944763,
0.0058267321437597275,
0.2159140706062317,
-0.21139472723007202,
0.14371562004089355,
-0.13591676950454712,
0.09227066487073898,
-0.15669949352741241,
-0.058654818683862686,
-0.43180030584335327,
-0.4557279646396637,
-0.1574457734823227,
0.05842245742678642,
0.12081960588693619,
-0.11879095435142517,
0.0824909433722496,
0.3132113814353943,
0.43742692470550537,
0.3032170832157135,
-0.04457304626703262,
-0.12881413102149963,
-0.14282426238059998,
-0.5084798336029053,
0.049753542989492416,
-0.1661849319934845,
-0.226470485329628,
0.4137077033519745,
0.2573765516281128,
0.18270227313041687,
0.18920999765396118,
-0.19281329214572906,
0.31290143728256226,
-0.23681403696537018,
0.15212537348270416,
-0.11407220363616943,
-0.20943593978881836,
0.005846225656569004,
-0.3120182752609253,
-0.02526034042239189,
0.2024112045764923,
0.2185799479484558,
-0.07268483191728592,
0.03043949604034424,
-0.015098392963409424,
0.1416952908039093,
-0.3610880970954895,
-0.28920018672943115,
-0.1019616574048996,
0.22302132844924927,
0.1745631843805313,
0.04900035262107849,
-0.07820279151201248,
-0.17177166044712067,
-0.18933190405368805,
-0.23088882863521576,
0.5810200572013855,
-0.11861994862556458,
0.29229021072387695,
-0.305107980966568,
-0.2905067503452301,
-0.11792607605457306,
0.07087436318397522,
-0.04611311852931976,
-0.05421169847249985,
-0.24019373953342438,
0.18587009608745575,
0.16082878410816193,
-0.08625855296850204,
-0.08565138280391693,
0.191035658121109,
0.1209009662270546,
0.25492897629737854,
0.0780114233493805,
-0.48965519666671753,
0.4284687042236328,
-0.4832099676132202,
-0.2350735366344452,
0.16522657871246338,
0.009573161602020264,
0.39178329706192017,
-0.012847625650465488,
-0.38523703813552856,
-0.02024843543767929,
0.1411222666501999,
0.06605831533670425,
0.02197563648223877,
-0.03927989676594734,
-0.04531735181808472,
-0.18241041898727417,
-0.2932910919189453,
0.21277183294296265,
0.07405507564544678,
0.1467665731906891,
0.14264404773712158,
-0.24928566813468933
] |
https://github.com/huggingface/datasets/issues/5706 | Maybe we don't need to store the string label -> int map in the categorical for the corresponding `datasets` feature ? | Support categorical data types for Parquet | ### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first. | 21 | Support categorical data types for Parquet
### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first.
Maybe we don't need to store the string label -> int map in the categorical for the corresponding `datasets` feature ? | [
-0.152938574552536,
-0.06370358169078827,
0.07160879671573639,
0.32455649971961975,
0.4551955461502075,
0.06469179689884186,
-0.1901731789112091,
0.22342005372047424,
0.203786700963974,
-0.2283174693584442,
-0.11718685179948807,
0.5124905109405518,
-0.2902349531650543,
0.44914382696151733,
-0.020855922251939774,
-0.2356620728969574,
0.11446522921323776,
-0.05483004450798035,
0.0671464204788208,
0.21519631147384644,
-0.2553243339061737,
0.37052780389785767,
0.021052315831184387,
0.17270562052726746,
-0.005001053214073181,
-0.20741158723831177,
-0.17676939070224762,
0.1230643093585968,
-0.4154319167137146,
-0.648801326751709,
0.38270604610443115,
-0.06258346140384674,
0.07781172543764114,
0.16082338988780975,
-0.00011092540808022022,
0.20099994540214539,
0.22811582684516907,
-0.05094720423221588,
0.07525114715099335,
-0.6103057861328125,
0.25767678022384644,
-0.3289322257041931,
0.5521793961524963,
-0.21667873859405518,
-0.28450876474380493,
-0.5699324011802673,
-0.0010316865518689156,
-0.050077129155397415,
0.13149625062942505,
0.24128347635269165,
0.2137584686279297,
0.12009842693805695,
0.3107171058654785,
-0.026749245822429657,
0.29283881187438965,
0.2815583050251007,
-0.26439225673675537,
0.1390400528907776,
0.19724245369434357,
-0.03920833021402359,
0.10887692123651505,
-0.047020141035318375,
0.07511953264474869,
-0.12355630099773407,
0.26804596185684204,
0.19692714512348175,
0.2707127332687378,
-0.16132812201976776,
-0.1130475103855133,
0.15778645873069763,
0.23117531836032867,
-0.348167359828949,
-0.3780864179134369,
-0.34970414638519287,
-0.08686838299036026,
-0.23116783797740936,
0.3346812129020691,
0.3381064832210541,
-0.03735218942165375,
0.07614102214574814,
0.2864310145378113,
0.10737806558609009,
-0.1368553787469864,
0.15590734779834747,
-0.20811225473880768,
0.051938969641923904,
-0.22799769043922424,
-0.04494556412100792,
0.35474693775177,
-0.27781617641448975,
-0.22969049215316772,
0.05305665358901024,
-0.1878403127193451,
0.0989813357591629,
-0.2532532215118408,
-0.1310701221227646,
-0.18735121190547943,
0.43419149518013,
0.24213898181915283,
-0.08589248359203339,
0.1634422093629837,
-0.06389711052179337,
0.1353231519460678,
0.29720693826675415,
0.47173649072647095,
-0.17446671426296234,
0.038373105227947235,
0.04406629130244255,
-0.26854804158210754,
0.3720489740371704,
0.1295095980167389,
-0.2310546636581421,
0.026296399533748627,
-0.21925373375415802,
-0.208120658993721,
-0.1931491196155548,
0.5561254620552063,
-0.0638805404305458,
-0.1691259890794754,
0.1650553047657013,
0.11396956443786621,
0.18829651176929474,
0.10086981952190399,
0.3479073643684387,
-0.022937806323170662,
0.02642764523625374,
-0.10813335329294205,
0.4272960424423218,
-0.06958991289138794,
-0.26751598715782166,
-0.052012547850608826,
0.18189457058906555,
-0.12289297580718994,
-0.34406009316444397,
0.051090121269226074,
-0.13396772742271423,
-0.016252990812063217,
0.24607893824577332,
0.016065379604697227,
0.11210143566131592,
-0.20609289407730103,
-0.24143250286579132,
-0.099113829433918,
0.210547536611557,
-0.1118248701095581,
-0.042394645512104034,
0.44341424107551575,
-0.5455547571182251,
-0.29060906171798706,
-0.06072327122092247,
-0.17885178327560425,
-0.13254398107528687,
-0.26276135444641113,
0.11716574430465698,
0.04377703368663788,
-0.10584572702646255,
-0.6395193934440613,
0.4424750804901123,
-0.1372944712638855,
-0.1937583088874817,
-0.05611115321516991,
-0.07101194560527802,
-0.1416284441947937,
-0.25209540128707886,
0.052349187433719635,
0.22650232911109924,
-0.42769789695739746,
0.02059689164161682,
0.01941388100385666,
-0.23541375994682312,
0.3803633153438568,
0.3180568814277649,
-0.02763085812330246,
-0.4074193239212036,
-0.03246611729264259,
0.22595669329166412,
0.3833453953266144,
-0.034665364772081375,
0.029156766831874847,
0.10229064524173737,
0.11098361760377884,
0.31626445055007935,
0.18920253217220306,
-0.3239975571632385,
0.50709068775177,
-0.013011213392019272,
-0.02620040625333786,
0.04411611706018448,
-0.20981580018997192,
-0.06783615797758102,
-0.3061771094799042,
-0.14404937624931335,
0.4953615367412567,
0.14524048566818237,
-0.2497681975364685,
-0.10603898763656616,
0.2180664986371994,
-0.26237770915031433,
0.14679385721683502,
-0.031239736825227737,
-0.030373938381671906,
-0.023333575576543808,
0.2688630521297455,
0.6133161187171936,
0.08784923702478409,
-0.3044065237045288,
-0.3224829435348511,
0.2282199114561081,
0.052213676273822784,
0.06213083863258362,
-0.24143855273723602,
-0.30301064252853394,
-0.14496557414531708,
0.1378384530544281,
-0.09390182793140411,
-0.01944703608751297,
0.1721343994140625,
-0.08013330399990082,
0.021914541721343994,
0.29322192072868347,
-0.18580783903598785,
0.22619204223155975,
-0.21847137808799744,
0.2586442530155182,
-0.06182252988219261,
0.18199323117733002,
-0.10379088670015335,
-0.3180977702140808,
0.07615016400814056,
0.21751287579536438,
0.07291470468044281,
-0.10771507024765015,
0.2687312066555023,
0.2809019088745117,
0.2731555104255676,
0.027974411845207214,
-0.09046827256679535,
0.16220802068710327,
0.14152175188064575,
-0.05531177297234535,
-0.1670624315738678,
-0.12894617021083832,
0.1957995593547821,
0.12024074047803879,
-0.05643313378095627,
0.39094457030296326,
-0.035749807953834534,
0.023572636768221855,
-0.11664607375860214,
0.17691445350646973,
0.24842453002929688,
0.32303303480148315,
-0.23134571313858032,
-0.12353555858135223,
0.2530020475387573,
-0.0045946817845106125,
-0.1921282559633255,
-0.07039051502943039,
-0.5973890423774719,
0.01568268984556198,
0.3798612952232361,
0.11977086216211319,
0.1029573604464531,
0.04136619344353676,
0.2032211422920227,
0.08613710105419159,
-0.04918786138296127,
0.27293264865875244,
0.0384262353181839,
0.2379569262266159,
-0.12969478964805603,
0.08426417410373688,
-0.22460967302322388,
0.058242786675691605,
0.2596370577812195,
0.17151939868927002,
-0.05381207540631294,
-0.21425727009773254,
0.2914349436759949,
0.06249687820672989,
-0.37361446022987366,
0.14000560343265533,
0.06541142612695694,
0.10063115507364273,
-0.42535924911499023,
0.10444281250238419,
-0.3702431321144104,
-0.05711374431848526,
-0.13888244330883026,
-0.00012029334902763367,
-0.23791804909706116,
-0.20550847053527832,
-0.10111063718795776,
0.12339800596237183,
-0.09335972368717194,
-0.04076502472162247,
-0.1659088134765625,
0.18208682537078857,
-0.027358591556549072,
-0.12820883095264435,
-0.262002170085907,
-0.36206701397895813,
-0.12342662364244461,
0.09313923120498657,
0.15297982096672058,
-0.14776605367660522,
0.35018548369407654,
-0.042704418301582336,
0.027697138488292694,
-0.25959527492523193,
-0.4133831858634949,
-0.023066453635692596,
-0.39364928007125854,
0.1958536058664322,
0.22667653858661652,
0.09073315560817719,
-0.2696143388748169,
-0.28969186544418335,
0.47491422295570374,
-0.056450508534908295,
-0.20800185203552246,
0.22151446342468262,
-0.0034103170037269592,
-0.0970926433801651,
-0.10649419575929642,
-0.10217826068401337,
-0.29842817783355713,
-0.2879944145679474,
0.4497191607952118,
0.1444402039051056,
-0.034513913094997406,
-0.1965426504611969,
-0.0278362687677145,
-0.01861807331442833,
-0.527838945388794,
0.06636419147253036,
-0.040320198982954025,
-0.002724006772041321,
0.32798123359680176,
-0.1422857940196991,
-0.38700562715530396,
0.19021424651145935,
-0.00631202757358551,
0.18691426515579224,
-0.003984272480010986,
-0.20849883556365967,
-0.08707308024168015,
-0.10268814861774445,
0.19811725616455078,
-0.037180427461862564,
-0.14256322383880615,
0.3516176640987396,
0.06691202521324158,
-0.024691686034202576,
-0.07317157089710236,
-0.06056349724531174,
-0.004815500229597092,
0.184244766831398,
-0.05091938003897667,
-0.04849030077457428,
0.6205022931098938,
0.2456151247024536,
0.17862682044506073,
-0.05995325744152069,
0.14099034667015076,
0.6188872456550598,
-0.32015615701675415,
0.39276546239852905,
-0.04005168378353119,
-0.2920130491256714,
-0.08307938277721405,
-0.25417888164520264,
0.26055699586868286,
0.117622971534729,
-0.05621738359332085,
-0.1948554515838623,
-0.11590456962585449,
-0.07275794446468353,
-0.2815675735473633,
-0.2757439613342285,
-0.057677969336509705,
-0.035767700523138046,
0.06650535762310028,
-0.12679755687713623,
-0.12256654351949692,
-0.010229043662548065,
-0.13874486088752747,
0.07516616582870483,
0.44735440611839294,
-0.061268918216228485,
0.19017724692821503,
0.01140981912612915,
-0.03884042054414749,
-0.45768457651138306,
0.1959451138973236,
-0.07473284751176834,
0.04759768769145012,
-0.07114357501268387,
0.0807332843542099,
0.0882553905248642,
-0.06675455719232559,
0.718495786190033,
0.22504828870296478,
-0.06621228158473969,
-0.024248193949460983,
-0.33991539478302,
-0.8340396285057068,
-0.013831473886966705,
-0.27823197841644287,
-0.057074785232543945,
0.04007493332028389,
0.17242532968521118,
-0.49052464962005615,
-0.09912491589784622,
-0.18934789299964905,
-0.16268613934516907,
0.06819130480289459,
0.16527393460273743,
-0.3242438733577728,
-0.11752858757972717,
-0.23418593406677246,
0.10246653854846954,
0.3930708169937134,
0.4166416823863983,
0.07237891107797623,
0.18640689551830292,
-0.25309085845947266,
-0.06964681297540665,
0.05651126429438591,
0.04648076742887497,
0.4361877143383026,
-0.16080568730831146,
0.055259376764297485,
0.07910327613353729,
0.3671548664569855,
-0.0054856762290000916,
0.6376227140426636,
0.18200403451919556,
-0.8556132316589355,
0.09358629584312439,
0.07778027653694153,
0.1841108500957489,
-0.11737856268882751,
-0.21510514616966248,
0.132696270942688,
-0.2387053519487381,
0.023384831845760345,
-0.39083680510520935,
-0.007381375879049301,
0.4942101836204529,
-0.1826823353767395,
-0.05021054670214653,
-0.30054232478141785,
0.4798077940940857,
0.05160748213529587,
0.16309425234794617,
0.006000073626637459,
1.0382771492004395,
-0.07405431568622589,
0.5716263055801392,
0.19556033611297607,
0.5652731657028198,
-0.2233593612909317,
0.13003714382648468,
0.4695199131965637,
-0.43532776832580566,
0.6631953716278076,
-0.20386216044425964,
0.1119074821472168,
-0.19924727082252502,
0.14236706495285034,
-0.12076494097709656,
-0.0540260449051857,
0.35178524255752563,
0.17814071476459503,
-0.3683437705039978,
0.013651318848133087,
-0.06607756018638611,
-0.1214323490858078,
-0.18642890453338623,
0.09076545387506485,
-0.2680352032184601,
-0.04683420807123184,
-0.5542470812797546,
0.1113433986902237,
-0.04513793811202049,
-0.22735461592674255,
0.08390355855226517,
-0.08016453683376312,
-0.04552546143531799,
-0.16013798117637634,
-0.3407999873161316,
-0.12523427605628967,
-0.2388758808374405,
-0.058940693736076355,
0.2853381633758545,
-0.08259396255016327,
0.46309414505958557,
0.41096872091293335,
0.20715627074241638,
-0.15141089260578156,
-0.27755090594291687,
-0.09449218958616257,
-0.011212252080440521,
-0.28136682510375977,
-0.09983998537063599,
-0.07942645251750946,
0.14180442690849304,
-0.024740781635046005,
0.07766857743263245,
-0.17458173632621765,
-0.019267994910478592,
0.06438839435577393,
-0.008225589990615845,
0.15524323284626007,
-0.07160738110542297,
-0.4612441956996918,
-0.20946843922138214,
-0.5635542869567871,
0.19257597625255585,
-0.03703829646110535,
0.09621217846870422,
0.10231173038482666,
0.06616123020648956,
-0.21871308982372284,
0.020441005006432533,
-0.07168574631214142,
-0.06777378916740417,
0.10968833416700363,
-0.2659640610218048,
0.42996281385421753,
0.37740302085876465,
0.21425646543502808,
-0.35159140825271606,
0.002625107765197754,
-0.22908002138137817,
0.420737624168396,
-0.3914269208908081,
0.1481291949748993,
0.16586580872535706,
-0.11029859632253647,
0.060873616486787796,
0.3707968294620514,
0.18954689800739288,
-0.21172161400318146,
0.17728830873966217,
-0.43558192253112793,
-0.05445905029773712,
0.4014973044395447,
-0.23180708289146423,
-0.021581605076789856,
0.5051809549331665,
0.17413538694381714,
0.020044520497322083,
-0.15647566318511963,
-0.2798447906970978,
0.2047216296195984,
-0.04424840211868286,
0.09171046316623688,
0.3787393867969513,
-0.15282294154167175,
0.17503759264945984,
0.1801518052816391,
0.15004710853099823,
0.2598145604133606,
0.07804537564516068,
-0.1108713299036026,
-0.05083814635872841,
0.0741894543170929,
0.04354808107018471,
0.2666358947753906,
-0.1173529177904129,
-0.04297483712434769,
-0.2918795347213745,
-0.0614822693169117,
0.0847870409488678,
0.09422503411769867,
-0.19989259541034698,
0.043434254825115204,
0.4416302442550659,
-0.017980754375457764,
-0.00846833735704422,
0.0936708152294159,
-0.15071329474449158,
-0.03702670335769653,
-0.036776602268218994,
-0.003534260904416442,
-0.360785573720932,
0.042213574051856995,
0.10087853670120239,
0.310473769903183,
0.07996118813753128,
-0.04534416273236275,
0.38723933696746826,
-0.13583886623382568,
0.062409721314907074,
0.1783066987991333,
0.48660868406295776,
0.24026572704315186,
0.08309144526720047,
-0.19391180574893951,
0.2908010482788086,
0.08038543909788132,
-0.3014996647834778,
-0.16011452674865723,
0.19678619503974915,
0.3266863524913788,
0.16219529509544373,
0.2776813507080078,
0.11590345203876495,
0.18691939115524292,
-0.2710854709148407,
0.08541136980056763,
0.44702982902526855,
0.06388489156961441,
0.16394956409931183,
0.0839596837759018,
-0.060318723320961,
-0.04282628744840622,
0.14711418747901917,
0.16866344213485718,
0.1388208419084549,
0.2380208820104599,
-0.08630967885255814,
0.04701230674982071,
0.11994391679763794,
-0.038249652832746506,
0.17654800415039062,
-0.33754265308380127,
0.13054609298706055,
0.11013396084308624,
0.2258099466562271,
-0.023585986346006393,
-0.005128789693117142,
0.39979514479637146,
0.2657366693019867,
-0.14418570697307587,
-0.2427893579006195,
0.2887210547924042,
-0.16075743734836578,
-0.047337356954813004,
0.16876649856567383,
-0.23207923769950867,
-0.11525672674179077,
-0.05090245231986046,
-0.18779151141643524,
-0.023482035845518112,
0.07682802528142929,
-0.02623225376009941,
0.3115014433860779,
-0.33180370926856995,
-0.06646447628736496,
-0.027238165959715843,
0.31528085470199585,
-0.1311650425195694,
0.2724405527114868,
0.13928985595703125,
-0.36486461758613586,
0.13467589020729065,
0.2744894027709961,
0.5965859889984131,
0.2164677530527115,
-0.11494973301887512,
-0.05759773403406143,
-0.31083670258522034,
-0.13155889511108398,
0.18677058815956116,
0.07129751145839691,
0.18611417710781097,
0.47037971019744873,
0.40274327993392944,
0.1273161917924881,
0.04153133183717728,
-0.3296956419944763,
0.0058267321437597275,
0.2159140706062317,
-0.21139472723007202,
0.14371562004089355,
-0.13591676950454712,
0.09227066487073898,
-0.15669949352741241,
-0.058654818683862686,
-0.43180030584335327,
-0.4557279646396637,
-0.1574457734823227,
0.05842245742678642,
0.12081960588693619,
-0.11879095435142517,
0.0824909433722496,
0.3132113814353943,
0.43742692470550537,
0.3032170832157135,
-0.04457304626703262,
-0.12881413102149963,
-0.14282426238059998,
-0.5084798336029053,
0.049753542989492416,
-0.1661849319934845,
-0.226470485329628,
0.4137077033519745,
0.2573765516281128,
0.18270227313041687,
0.18920999765396118,
-0.19281329214572906,
0.31290143728256226,
-0.23681403696537018,
0.15212537348270416,
-0.11407220363616943,
-0.20943593978881836,
0.005846225656569004,
-0.3120182752609253,
-0.02526034042239189,
0.2024112045764923,
0.2185799479484558,
-0.07268483191728592,
0.03043949604034424,
-0.015098392963409424,
0.1416952908039093,
-0.3610880970954895,
-0.28920018672943115,
-0.1019616574048996,
0.22302132844924927,
0.1745631843805313,
0.04900035262107849,
-0.07820279151201248,
-0.17177166044712067,
-0.18933190405368805,
-0.23088882863521576,
0.5810200572013855,
-0.11861994862556458,
0.29229021072387695,
-0.305107980966568,
-0.2905067503452301,
-0.11792607605457306,
0.07087436318397522,
-0.04611311852931976,
-0.05421169847249985,
-0.24019373953342438,
0.18587009608745575,
0.16082878410816193,
-0.08625855296850204,
-0.08565138280391693,
0.191035658121109,
0.1209009662270546,
0.25492897629737854,
0.0780114233493805,
-0.48965519666671753,
0.4284687042236328,
-0.4832099676132202,
-0.2350735366344452,
0.16522657871246338,
0.009573161602020264,
0.39178329706192017,
-0.012847625650465488,
-0.38523703813552856,
-0.02024843543767929,
0.1411222666501999,
0.06605831533670425,
0.02197563648223877,
-0.03927989676594734,
-0.04531735181808472,
-0.18241041898727417,
-0.2932910919189453,
0.21277183294296265,
0.07405507564544678,
0.1467665731906891,
0.14264404773712158,
-0.24928566813468933
] |
https://github.com/huggingface/datasets/issues/5706 | I think that does need to be stored in the Feature object. Similar to how
`ClassLabel` needs the class names for some of the provided default
functionality (e.g., encoding or decoding values) here, a categorical
feature needs the same. Without storing that information, would you suggest
that categorical features just be stored internally as integer arrays?
On Fri, Sep 8, 2023, 5:37 AM Quentin Lhoest ***@***.***>
wrote:
> Maybe we don't need to store the string label -> int map in the
> categorical for the corresponding datasets feature ?
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/5706#issuecomment-1711375652>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AADS5XZV3RA4GBRVBLJN72LXZLROZANCNFSM6AAAAAAWSOUTJ4>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
| Support categorical data types for Parquet | ### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first. | 124 | Support categorical data types for Parquet
### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first.
I think that does need to be stored in the Feature object. Similar to how
`ClassLabel` needs the class names for some of the provided default
functionality (e.g., encoding or decoding values) here, a categorical
feature needs the same. Without storing that information, would you suggest
that categorical features just be stored internally as integer arrays?
On Fri, Sep 8, 2023, 5:37 AM Quentin Lhoest ***@***.***>
wrote:
> Maybe we don't need to store the string label -> int map in the
> categorical for the corresponding datasets feature ?
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/5706#issuecomment-1711375652>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AADS5XZV3RA4GBRVBLJN72LXZLROZANCNFSM6AAAAAAWSOUTJ4>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
| [
-0.152938574552536,
-0.06370358169078827,
0.07160879671573639,
0.32455649971961975,
0.4551955461502075,
0.06469179689884186,
-0.1901731789112091,
0.22342005372047424,
0.203786700963974,
-0.2283174693584442,
-0.11718685179948807,
0.5124905109405518,
-0.2902349531650543,
0.44914382696151733,
-0.020855922251939774,
-0.2356620728969574,
0.11446522921323776,
-0.05483004450798035,
0.0671464204788208,
0.21519631147384644,
-0.2553243339061737,
0.37052780389785767,
0.021052315831184387,
0.17270562052726746,
-0.005001053214073181,
-0.20741158723831177,
-0.17676939070224762,
0.1230643093585968,
-0.4154319167137146,
-0.648801326751709,
0.38270604610443115,
-0.06258346140384674,
0.07781172543764114,
0.16082338988780975,
-0.00011092540808022022,
0.20099994540214539,
0.22811582684516907,
-0.05094720423221588,
0.07525114715099335,
-0.6103057861328125,
0.25767678022384644,
-0.3289322257041931,
0.5521793961524963,
-0.21667873859405518,
-0.28450876474380493,
-0.5699324011802673,
-0.0010316865518689156,
-0.050077129155397415,
0.13149625062942505,
0.24128347635269165,
0.2137584686279297,
0.12009842693805695,
0.3107171058654785,
-0.026749245822429657,
0.29283881187438965,
0.2815583050251007,
-0.26439225673675537,
0.1390400528907776,
0.19724245369434357,
-0.03920833021402359,
0.10887692123651505,
-0.047020141035318375,
0.07511953264474869,
-0.12355630099773407,
0.26804596185684204,
0.19692714512348175,
0.2707127332687378,
-0.16132812201976776,
-0.1130475103855133,
0.15778645873069763,
0.23117531836032867,
-0.348167359828949,
-0.3780864179134369,
-0.34970414638519287,
-0.08686838299036026,
-0.23116783797740936,
0.3346812129020691,
0.3381064832210541,
-0.03735218942165375,
0.07614102214574814,
0.2864310145378113,
0.10737806558609009,
-0.1368553787469864,
0.15590734779834747,
-0.20811225473880768,
0.051938969641923904,
-0.22799769043922424,
-0.04494556412100792,
0.35474693775177,
-0.27781617641448975,
-0.22969049215316772,
0.05305665358901024,
-0.1878403127193451,
0.0989813357591629,
-0.2532532215118408,
-0.1310701221227646,
-0.18735121190547943,
0.43419149518013,
0.24213898181915283,
-0.08589248359203339,
0.1634422093629837,
-0.06389711052179337,
0.1353231519460678,
0.29720693826675415,
0.47173649072647095,
-0.17446671426296234,
0.038373105227947235,
0.04406629130244255,
-0.26854804158210754,
0.3720489740371704,
0.1295095980167389,
-0.2310546636581421,
0.026296399533748627,
-0.21925373375415802,
-0.208120658993721,
-0.1931491196155548,
0.5561254620552063,
-0.0638805404305458,
-0.1691259890794754,
0.1650553047657013,
0.11396956443786621,
0.18829651176929474,
0.10086981952190399,
0.3479073643684387,
-0.022937806323170662,
0.02642764523625374,
-0.10813335329294205,
0.4272960424423218,
-0.06958991289138794,
-0.26751598715782166,
-0.052012547850608826,
0.18189457058906555,
-0.12289297580718994,
-0.34406009316444397,
0.051090121269226074,
-0.13396772742271423,
-0.016252990812063217,
0.24607893824577332,
0.016065379604697227,
0.11210143566131592,
-0.20609289407730103,
-0.24143250286579132,
-0.099113829433918,
0.210547536611557,
-0.1118248701095581,
-0.042394645512104034,
0.44341424107551575,
-0.5455547571182251,
-0.29060906171798706,
-0.06072327122092247,
-0.17885178327560425,
-0.13254398107528687,
-0.26276135444641113,
0.11716574430465698,
0.04377703368663788,
-0.10584572702646255,
-0.6395193934440613,
0.4424750804901123,
-0.1372944712638855,
-0.1937583088874817,
-0.05611115321516991,
-0.07101194560527802,
-0.1416284441947937,
-0.25209540128707886,
0.052349187433719635,
0.22650232911109924,
-0.42769789695739746,
0.02059689164161682,
0.01941388100385666,
-0.23541375994682312,
0.3803633153438568,
0.3180568814277649,
-0.02763085812330246,
-0.4074193239212036,
-0.03246611729264259,
0.22595669329166412,
0.3833453953266144,
-0.034665364772081375,
0.029156766831874847,
0.10229064524173737,
0.11098361760377884,
0.31626445055007935,
0.18920253217220306,
-0.3239975571632385,
0.50709068775177,
-0.013011213392019272,
-0.02620040625333786,
0.04411611706018448,
-0.20981580018997192,
-0.06783615797758102,
-0.3061771094799042,
-0.14404937624931335,
0.4953615367412567,
0.14524048566818237,
-0.2497681975364685,
-0.10603898763656616,
0.2180664986371994,
-0.26237770915031433,
0.14679385721683502,
-0.031239736825227737,
-0.030373938381671906,
-0.023333575576543808,
0.2688630521297455,
0.6133161187171936,
0.08784923702478409,
-0.3044065237045288,
-0.3224829435348511,
0.2282199114561081,
0.052213676273822784,
0.06213083863258362,
-0.24143855273723602,
-0.30301064252853394,
-0.14496557414531708,
0.1378384530544281,
-0.09390182793140411,
-0.01944703608751297,
0.1721343994140625,
-0.08013330399990082,
0.021914541721343994,
0.29322192072868347,
-0.18580783903598785,
0.22619204223155975,
-0.21847137808799744,
0.2586442530155182,
-0.06182252988219261,
0.18199323117733002,
-0.10379088670015335,
-0.3180977702140808,
0.07615016400814056,
0.21751287579536438,
0.07291470468044281,
-0.10771507024765015,
0.2687312066555023,
0.2809019088745117,
0.2731555104255676,
0.027974411845207214,
-0.09046827256679535,
0.16220802068710327,
0.14152175188064575,
-0.05531177297234535,
-0.1670624315738678,
-0.12894617021083832,
0.1957995593547821,
0.12024074047803879,
-0.05643313378095627,
0.39094457030296326,
-0.035749807953834534,
0.023572636768221855,
-0.11664607375860214,
0.17691445350646973,
0.24842453002929688,
0.32303303480148315,
-0.23134571313858032,
-0.12353555858135223,
0.2530020475387573,
-0.0045946817845106125,
-0.1921282559633255,
-0.07039051502943039,
-0.5973890423774719,
0.01568268984556198,
0.3798612952232361,
0.11977086216211319,
0.1029573604464531,
0.04136619344353676,
0.2032211422920227,
0.08613710105419159,
-0.04918786138296127,
0.27293264865875244,
0.0384262353181839,
0.2379569262266159,
-0.12969478964805603,
0.08426417410373688,
-0.22460967302322388,
0.058242786675691605,
0.2596370577812195,
0.17151939868927002,
-0.05381207540631294,
-0.21425727009773254,
0.2914349436759949,
0.06249687820672989,
-0.37361446022987366,
0.14000560343265533,
0.06541142612695694,
0.10063115507364273,
-0.42535924911499023,
0.10444281250238419,
-0.3702431321144104,
-0.05711374431848526,
-0.13888244330883026,
-0.00012029334902763367,
-0.23791804909706116,
-0.20550847053527832,
-0.10111063718795776,
0.12339800596237183,
-0.09335972368717194,
-0.04076502472162247,
-0.1659088134765625,
0.18208682537078857,
-0.027358591556549072,
-0.12820883095264435,
-0.262002170085907,
-0.36206701397895813,
-0.12342662364244461,
0.09313923120498657,
0.15297982096672058,
-0.14776605367660522,
0.35018548369407654,
-0.042704418301582336,
0.027697138488292694,
-0.25959527492523193,
-0.4133831858634949,
-0.023066453635692596,
-0.39364928007125854,
0.1958536058664322,
0.22667653858661652,
0.09073315560817719,
-0.2696143388748169,
-0.28969186544418335,
0.47491422295570374,
-0.056450508534908295,
-0.20800185203552246,
0.22151446342468262,
-0.0034103170037269592,
-0.0970926433801651,
-0.10649419575929642,
-0.10217826068401337,
-0.29842817783355713,
-0.2879944145679474,
0.4497191607952118,
0.1444402039051056,
-0.034513913094997406,
-0.1965426504611969,
-0.0278362687677145,
-0.01861807331442833,
-0.527838945388794,
0.06636419147253036,
-0.040320198982954025,
-0.002724006772041321,
0.32798123359680176,
-0.1422857940196991,
-0.38700562715530396,
0.19021424651145935,
-0.00631202757358551,
0.18691426515579224,
-0.003984272480010986,
-0.20849883556365967,
-0.08707308024168015,
-0.10268814861774445,
0.19811725616455078,
-0.037180427461862564,
-0.14256322383880615,
0.3516176640987396,
0.06691202521324158,
-0.024691686034202576,
-0.07317157089710236,
-0.06056349724531174,
-0.004815500229597092,
0.184244766831398,
-0.05091938003897667,
-0.04849030077457428,
0.6205022931098938,
0.2456151247024536,
0.17862682044506073,
-0.05995325744152069,
0.14099034667015076,
0.6188872456550598,
-0.32015615701675415,
0.39276546239852905,
-0.04005168378353119,
-0.2920130491256714,
-0.08307938277721405,
-0.25417888164520264,
0.26055699586868286,
0.117622971534729,
-0.05621738359332085,
-0.1948554515838623,
-0.11590456962585449,
-0.07275794446468353,
-0.2815675735473633,
-0.2757439613342285,
-0.057677969336509705,
-0.035767700523138046,
0.06650535762310028,
-0.12679755687713623,
-0.12256654351949692,
-0.010229043662548065,
-0.13874486088752747,
0.07516616582870483,
0.44735440611839294,
-0.061268918216228485,
0.19017724692821503,
0.01140981912612915,
-0.03884042054414749,
-0.45768457651138306,
0.1959451138973236,
-0.07473284751176834,
0.04759768769145012,
-0.07114357501268387,
0.0807332843542099,
0.0882553905248642,
-0.06675455719232559,
0.718495786190033,
0.22504828870296478,
-0.06621228158473969,
-0.024248193949460983,
-0.33991539478302,
-0.8340396285057068,
-0.013831473886966705,
-0.27823197841644287,
-0.057074785232543945,
0.04007493332028389,
0.17242532968521118,
-0.49052464962005615,
-0.09912491589784622,
-0.18934789299964905,
-0.16268613934516907,
0.06819130480289459,
0.16527393460273743,
-0.3242438733577728,
-0.11752858757972717,
-0.23418593406677246,
0.10246653854846954,
0.3930708169937134,
0.4166416823863983,
0.07237891107797623,
0.18640689551830292,
-0.25309085845947266,
-0.06964681297540665,
0.05651126429438591,
0.04648076742887497,
0.4361877143383026,
-0.16080568730831146,
0.055259376764297485,
0.07910327613353729,
0.3671548664569855,
-0.0054856762290000916,
0.6376227140426636,
0.18200403451919556,
-0.8556132316589355,
0.09358629584312439,
0.07778027653694153,
0.1841108500957489,
-0.11737856268882751,
-0.21510514616966248,
0.132696270942688,
-0.2387053519487381,
0.023384831845760345,
-0.39083680510520935,
-0.007381375879049301,
0.4942101836204529,
-0.1826823353767395,
-0.05021054670214653,
-0.30054232478141785,
0.4798077940940857,
0.05160748213529587,
0.16309425234794617,
0.006000073626637459,
1.0382771492004395,
-0.07405431568622589,
0.5716263055801392,
0.19556033611297607,
0.5652731657028198,
-0.2233593612909317,
0.13003714382648468,
0.4695199131965637,
-0.43532776832580566,
0.6631953716278076,
-0.20386216044425964,
0.1119074821472168,
-0.19924727082252502,
0.14236706495285034,
-0.12076494097709656,
-0.0540260449051857,
0.35178524255752563,
0.17814071476459503,
-0.3683437705039978,
0.013651318848133087,
-0.06607756018638611,
-0.1214323490858078,
-0.18642890453338623,
0.09076545387506485,
-0.2680352032184601,
-0.04683420807123184,
-0.5542470812797546,
0.1113433986902237,
-0.04513793811202049,
-0.22735461592674255,
0.08390355855226517,
-0.08016453683376312,
-0.04552546143531799,
-0.16013798117637634,
-0.3407999873161316,
-0.12523427605628967,
-0.2388758808374405,
-0.058940693736076355,
0.2853381633758545,
-0.08259396255016327,
0.46309414505958557,
0.41096872091293335,
0.20715627074241638,
-0.15141089260578156,
-0.27755090594291687,
-0.09449218958616257,
-0.011212252080440521,
-0.28136682510375977,
-0.09983998537063599,
-0.07942645251750946,
0.14180442690849304,
-0.024740781635046005,
0.07766857743263245,
-0.17458173632621765,
-0.019267994910478592,
0.06438839435577393,
-0.008225589990615845,
0.15524323284626007,
-0.07160738110542297,
-0.4612441956996918,
-0.20946843922138214,
-0.5635542869567871,
0.19257597625255585,
-0.03703829646110535,
0.09621217846870422,
0.10231173038482666,
0.06616123020648956,
-0.21871308982372284,
0.020441005006432533,
-0.07168574631214142,
-0.06777378916740417,
0.10968833416700363,
-0.2659640610218048,
0.42996281385421753,
0.37740302085876465,
0.21425646543502808,
-0.35159140825271606,
0.002625107765197754,
-0.22908002138137817,
0.420737624168396,
-0.3914269208908081,
0.1481291949748993,
0.16586580872535706,
-0.11029859632253647,
0.060873616486787796,
0.3707968294620514,
0.18954689800739288,
-0.21172161400318146,
0.17728830873966217,
-0.43558192253112793,
-0.05445905029773712,
0.4014973044395447,
-0.23180708289146423,
-0.021581605076789856,
0.5051809549331665,
0.17413538694381714,
0.020044520497322083,
-0.15647566318511963,
-0.2798447906970978,
0.2047216296195984,
-0.04424840211868286,
0.09171046316623688,
0.3787393867969513,
-0.15282294154167175,
0.17503759264945984,
0.1801518052816391,
0.15004710853099823,
0.2598145604133606,
0.07804537564516068,
-0.1108713299036026,
-0.05083814635872841,
0.0741894543170929,
0.04354808107018471,
0.2666358947753906,
-0.1173529177904129,
-0.04297483712434769,
-0.2918795347213745,
-0.0614822693169117,
0.0847870409488678,
0.09422503411769867,
-0.19989259541034698,
0.043434254825115204,
0.4416302442550659,
-0.017980754375457764,
-0.00846833735704422,
0.0936708152294159,
-0.15071329474449158,
-0.03702670335769653,
-0.036776602268218994,
-0.003534260904416442,
-0.360785573720932,
0.042213574051856995,
0.10087853670120239,
0.310473769903183,
0.07996118813753128,
-0.04534416273236275,
0.38723933696746826,
-0.13583886623382568,
0.062409721314907074,
0.1783066987991333,
0.48660868406295776,
0.24026572704315186,
0.08309144526720047,
-0.19391180574893951,
0.2908010482788086,
0.08038543909788132,
-0.3014996647834778,
-0.16011452674865723,
0.19678619503974915,
0.3266863524913788,
0.16219529509544373,
0.2776813507080078,
0.11590345203876495,
0.18691939115524292,
-0.2710854709148407,
0.08541136980056763,
0.44702982902526855,
0.06388489156961441,
0.16394956409931183,
0.0839596837759018,
-0.060318723320961,
-0.04282628744840622,
0.14711418747901917,
0.16866344213485718,
0.1388208419084549,
0.2380208820104599,
-0.08630967885255814,
0.04701230674982071,
0.11994391679763794,
-0.038249652832746506,
0.17654800415039062,
-0.33754265308380127,
0.13054609298706055,
0.11013396084308624,
0.2258099466562271,
-0.023585986346006393,
-0.005128789693117142,
0.39979514479637146,
0.2657366693019867,
-0.14418570697307587,
-0.2427893579006195,
0.2887210547924042,
-0.16075743734836578,
-0.047337356954813004,
0.16876649856567383,
-0.23207923769950867,
-0.11525672674179077,
-0.05090245231986046,
-0.18779151141643524,
-0.023482035845518112,
0.07682802528142929,
-0.02623225376009941,
0.3115014433860779,
-0.33180370926856995,
-0.06646447628736496,
-0.027238165959715843,
0.31528085470199585,
-0.1311650425195694,
0.2724405527114868,
0.13928985595703125,
-0.36486461758613586,
0.13467589020729065,
0.2744894027709961,
0.5965859889984131,
0.2164677530527115,
-0.11494973301887512,
-0.05759773403406143,
-0.31083670258522034,
-0.13155889511108398,
0.18677058815956116,
0.07129751145839691,
0.18611417710781097,
0.47037971019744873,
0.40274327993392944,
0.1273161917924881,
0.04153133183717728,
-0.3296956419944763,
0.0058267321437597275,
0.2159140706062317,
-0.21139472723007202,
0.14371562004089355,
-0.13591676950454712,
0.09227066487073898,
-0.15669949352741241,
-0.058654818683862686,
-0.43180030584335327,
-0.4557279646396637,
-0.1574457734823227,
0.05842245742678642,
0.12081960588693619,
-0.11879095435142517,
0.0824909433722496,
0.3132113814353943,
0.43742692470550537,
0.3032170832157135,
-0.04457304626703262,
-0.12881413102149963,
-0.14282426238059998,
-0.5084798336029053,
0.049753542989492416,
-0.1661849319934845,
-0.226470485329628,
0.4137077033519745,
0.2573765516281128,
0.18270227313041687,
0.18920999765396118,
-0.19281329214572906,
0.31290143728256226,
-0.23681403696537018,
0.15212537348270416,
-0.11407220363616943,
-0.20943593978881836,
0.005846225656569004,
-0.3120182752609253,
-0.02526034042239189,
0.2024112045764923,
0.2185799479484558,
-0.07268483191728592,
0.03043949604034424,
-0.015098392963409424,
0.1416952908039093,
-0.3610880970954895,
-0.28920018672943115,
-0.1019616574048996,
0.22302132844924927,
0.1745631843805313,
0.04900035262107849,
-0.07820279151201248,
-0.17177166044712067,
-0.18933190405368805,
-0.23088882863521576,
0.5810200572013855,
-0.11861994862556458,
0.29229021072387695,
-0.305107980966568,
-0.2905067503452301,
-0.11792607605457306,
0.07087436318397522,
-0.04611311852931976,
-0.05421169847249985,
-0.24019373953342438,
0.18587009608745575,
0.16082878410816193,
-0.08625855296850204,
-0.08565138280391693,
0.191035658121109,
0.1209009662270546,
0.25492897629737854,
0.0780114233493805,
-0.48965519666671753,
0.4284687042236328,
-0.4832099676132202,
-0.2350735366344452,
0.16522657871246338,
0.009573161602020264,
0.39178329706192017,
-0.012847625650465488,
-0.38523703813552856,
-0.02024843543767929,
0.1411222666501999,
0.06605831533670425,
0.02197563648223877,
-0.03927989676594734,
-0.04531735181808472,
-0.18241041898727417,
-0.2932910919189453,
0.21277183294296265,
0.07405507564544678,
0.1467665731906891,
0.14264404773712158,
-0.24928566813468933
] |
https://github.com/huggingface/datasets/issues/5706 | Well IIRC you can concatenate two Arrow arrays with different dictionaries together. But for `datasets` would mean updating the `datasets` features when concatenating two arrays of the same type, which is not supported right now. That's why if there is a way to have it without storing the mapping in the feature object it would be nice.
For decoding we do have the string<->integer mapping from the array `dictionary` attribute so we're fine. For encoding I think it can work if we only encode when converting python objects to pyarrow in `TypedSequence.__arrow_array__` in `arow_writer.py`. It can work by converting the python objects to a pyarrow array and then use the `dictionary_encode` method.
Another concern about concatenation: I noticed **pyarrow creates the new dictionary and indices in memory** when concatenating two dictionary encoded arrays. This can be a problem for big datastets, and we should probably use ChunkedArray objects instead. This can surely be taken care of in `array_concat` in `table.py`
cc @mariosasko in case you have other ideas
| Support categorical data types for Parquet | ### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first. | 168 | Support categorical data types for Parquet
### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first.
Well IIRC you can concatenate two Arrow arrays with different dictionaries together. But for `datasets` would mean updating the `datasets` features when concatenating two arrays of the same type, which is not supported right now. That's why if there is a way to have it without storing the mapping in the feature object it would be nice.
For decoding we do have the string<->integer mapping from the array `dictionary` attribute so we're fine. For encoding I think it can work if we only encode when converting python objects to pyarrow in `TypedSequence.__arrow_array__` in `arow_writer.py`. It can work by converting the python objects to a pyarrow array and then use the `dictionary_encode` method.
Another concern about concatenation: I noticed **pyarrow creates the new dictionary and indices in memory** when concatenating two dictionary encoded arrays. This can be a problem for big datastets, and we should probably use ChunkedArray objects instead. This can surely be taken care of in `array_concat` in `table.py`
cc @mariosasko in case you have other ideas
| [
-0.152938574552536,
-0.06370358169078827,
0.07160879671573639,
0.32455649971961975,
0.4551955461502075,
0.06469179689884186,
-0.1901731789112091,
0.22342005372047424,
0.203786700963974,
-0.2283174693584442,
-0.11718685179948807,
0.5124905109405518,
-0.2902349531650543,
0.44914382696151733,
-0.020855922251939774,
-0.2356620728969574,
0.11446522921323776,
-0.05483004450798035,
0.0671464204788208,
0.21519631147384644,
-0.2553243339061737,
0.37052780389785767,
0.021052315831184387,
0.17270562052726746,
-0.005001053214073181,
-0.20741158723831177,
-0.17676939070224762,
0.1230643093585968,
-0.4154319167137146,
-0.648801326751709,
0.38270604610443115,
-0.06258346140384674,
0.07781172543764114,
0.16082338988780975,
-0.00011092540808022022,
0.20099994540214539,
0.22811582684516907,
-0.05094720423221588,
0.07525114715099335,
-0.6103057861328125,
0.25767678022384644,
-0.3289322257041931,
0.5521793961524963,
-0.21667873859405518,
-0.28450876474380493,
-0.5699324011802673,
-0.0010316865518689156,
-0.050077129155397415,
0.13149625062942505,
0.24128347635269165,
0.2137584686279297,
0.12009842693805695,
0.3107171058654785,
-0.026749245822429657,
0.29283881187438965,
0.2815583050251007,
-0.26439225673675537,
0.1390400528907776,
0.19724245369434357,
-0.03920833021402359,
0.10887692123651505,
-0.047020141035318375,
0.07511953264474869,
-0.12355630099773407,
0.26804596185684204,
0.19692714512348175,
0.2707127332687378,
-0.16132812201976776,
-0.1130475103855133,
0.15778645873069763,
0.23117531836032867,
-0.348167359828949,
-0.3780864179134369,
-0.34970414638519287,
-0.08686838299036026,
-0.23116783797740936,
0.3346812129020691,
0.3381064832210541,
-0.03735218942165375,
0.07614102214574814,
0.2864310145378113,
0.10737806558609009,
-0.1368553787469864,
0.15590734779834747,
-0.20811225473880768,
0.051938969641923904,
-0.22799769043922424,
-0.04494556412100792,
0.35474693775177,
-0.27781617641448975,
-0.22969049215316772,
0.05305665358901024,
-0.1878403127193451,
0.0989813357591629,
-0.2532532215118408,
-0.1310701221227646,
-0.18735121190547943,
0.43419149518013,
0.24213898181915283,
-0.08589248359203339,
0.1634422093629837,
-0.06389711052179337,
0.1353231519460678,
0.29720693826675415,
0.47173649072647095,
-0.17446671426296234,
0.038373105227947235,
0.04406629130244255,
-0.26854804158210754,
0.3720489740371704,
0.1295095980167389,
-0.2310546636581421,
0.026296399533748627,
-0.21925373375415802,
-0.208120658993721,
-0.1931491196155548,
0.5561254620552063,
-0.0638805404305458,
-0.1691259890794754,
0.1650553047657013,
0.11396956443786621,
0.18829651176929474,
0.10086981952190399,
0.3479073643684387,
-0.022937806323170662,
0.02642764523625374,
-0.10813335329294205,
0.4272960424423218,
-0.06958991289138794,
-0.26751598715782166,
-0.052012547850608826,
0.18189457058906555,
-0.12289297580718994,
-0.34406009316444397,
0.051090121269226074,
-0.13396772742271423,
-0.016252990812063217,
0.24607893824577332,
0.016065379604697227,
0.11210143566131592,
-0.20609289407730103,
-0.24143250286579132,
-0.099113829433918,
0.210547536611557,
-0.1118248701095581,
-0.042394645512104034,
0.44341424107551575,
-0.5455547571182251,
-0.29060906171798706,
-0.06072327122092247,
-0.17885178327560425,
-0.13254398107528687,
-0.26276135444641113,
0.11716574430465698,
0.04377703368663788,
-0.10584572702646255,
-0.6395193934440613,
0.4424750804901123,
-0.1372944712638855,
-0.1937583088874817,
-0.05611115321516991,
-0.07101194560527802,
-0.1416284441947937,
-0.25209540128707886,
0.052349187433719635,
0.22650232911109924,
-0.42769789695739746,
0.02059689164161682,
0.01941388100385666,
-0.23541375994682312,
0.3803633153438568,
0.3180568814277649,
-0.02763085812330246,
-0.4074193239212036,
-0.03246611729264259,
0.22595669329166412,
0.3833453953266144,
-0.034665364772081375,
0.029156766831874847,
0.10229064524173737,
0.11098361760377884,
0.31626445055007935,
0.18920253217220306,
-0.3239975571632385,
0.50709068775177,
-0.013011213392019272,
-0.02620040625333786,
0.04411611706018448,
-0.20981580018997192,
-0.06783615797758102,
-0.3061771094799042,
-0.14404937624931335,
0.4953615367412567,
0.14524048566818237,
-0.2497681975364685,
-0.10603898763656616,
0.2180664986371994,
-0.26237770915031433,
0.14679385721683502,
-0.031239736825227737,
-0.030373938381671906,
-0.023333575576543808,
0.2688630521297455,
0.6133161187171936,
0.08784923702478409,
-0.3044065237045288,
-0.3224829435348511,
0.2282199114561081,
0.052213676273822784,
0.06213083863258362,
-0.24143855273723602,
-0.30301064252853394,
-0.14496557414531708,
0.1378384530544281,
-0.09390182793140411,
-0.01944703608751297,
0.1721343994140625,
-0.08013330399990082,
0.021914541721343994,
0.29322192072868347,
-0.18580783903598785,
0.22619204223155975,
-0.21847137808799744,
0.2586442530155182,
-0.06182252988219261,
0.18199323117733002,
-0.10379088670015335,
-0.3180977702140808,
0.07615016400814056,
0.21751287579536438,
0.07291470468044281,
-0.10771507024765015,
0.2687312066555023,
0.2809019088745117,
0.2731555104255676,
0.027974411845207214,
-0.09046827256679535,
0.16220802068710327,
0.14152175188064575,
-0.05531177297234535,
-0.1670624315738678,
-0.12894617021083832,
0.1957995593547821,
0.12024074047803879,
-0.05643313378095627,
0.39094457030296326,
-0.035749807953834534,
0.023572636768221855,
-0.11664607375860214,
0.17691445350646973,
0.24842453002929688,
0.32303303480148315,
-0.23134571313858032,
-0.12353555858135223,
0.2530020475387573,
-0.0045946817845106125,
-0.1921282559633255,
-0.07039051502943039,
-0.5973890423774719,
0.01568268984556198,
0.3798612952232361,
0.11977086216211319,
0.1029573604464531,
0.04136619344353676,
0.2032211422920227,
0.08613710105419159,
-0.04918786138296127,
0.27293264865875244,
0.0384262353181839,
0.2379569262266159,
-0.12969478964805603,
0.08426417410373688,
-0.22460967302322388,
0.058242786675691605,
0.2596370577812195,
0.17151939868927002,
-0.05381207540631294,
-0.21425727009773254,
0.2914349436759949,
0.06249687820672989,
-0.37361446022987366,
0.14000560343265533,
0.06541142612695694,
0.10063115507364273,
-0.42535924911499023,
0.10444281250238419,
-0.3702431321144104,
-0.05711374431848526,
-0.13888244330883026,
-0.00012029334902763367,
-0.23791804909706116,
-0.20550847053527832,
-0.10111063718795776,
0.12339800596237183,
-0.09335972368717194,
-0.04076502472162247,
-0.1659088134765625,
0.18208682537078857,
-0.027358591556549072,
-0.12820883095264435,
-0.262002170085907,
-0.36206701397895813,
-0.12342662364244461,
0.09313923120498657,
0.15297982096672058,
-0.14776605367660522,
0.35018548369407654,
-0.042704418301582336,
0.027697138488292694,
-0.25959527492523193,
-0.4133831858634949,
-0.023066453635692596,
-0.39364928007125854,
0.1958536058664322,
0.22667653858661652,
0.09073315560817719,
-0.2696143388748169,
-0.28969186544418335,
0.47491422295570374,
-0.056450508534908295,
-0.20800185203552246,
0.22151446342468262,
-0.0034103170037269592,
-0.0970926433801651,
-0.10649419575929642,
-0.10217826068401337,
-0.29842817783355713,
-0.2879944145679474,
0.4497191607952118,
0.1444402039051056,
-0.034513913094997406,
-0.1965426504611969,
-0.0278362687677145,
-0.01861807331442833,
-0.527838945388794,
0.06636419147253036,
-0.040320198982954025,
-0.002724006772041321,
0.32798123359680176,
-0.1422857940196991,
-0.38700562715530396,
0.19021424651145935,
-0.00631202757358551,
0.18691426515579224,
-0.003984272480010986,
-0.20849883556365967,
-0.08707308024168015,
-0.10268814861774445,
0.19811725616455078,
-0.037180427461862564,
-0.14256322383880615,
0.3516176640987396,
0.06691202521324158,
-0.024691686034202576,
-0.07317157089710236,
-0.06056349724531174,
-0.004815500229597092,
0.184244766831398,
-0.05091938003897667,
-0.04849030077457428,
0.6205022931098938,
0.2456151247024536,
0.17862682044506073,
-0.05995325744152069,
0.14099034667015076,
0.6188872456550598,
-0.32015615701675415,
0.39276546239852905,
-0.04005168378353119,
-0.2920130491256714,
-0.08307938277721405,
-0.25417888164520264,
0.26055699586868286,
0.117622971534729,
-0.05621738359332085,
-0.1948554515838623,
-0.11590456962585449,
-0.07275794446468353,
-0.2815675735473633,
-0.2757439613342285,
-0.057677969336509705,
-0.035767700523138046,
0.06650535762310028,
-0.12679755687713623,
-0.12256654351949692,
-0.010229043662548065,
-0.13874486088752747,
0.07516616582870483,
0.44735440611839294,
-0.061268918216228485,
0.19017724692821503,
0.01140981912612915,
-0.03884042054414749,
-0.45768457651138306,
0.1959451138973236,
-0.07473284751176834,
0.04759768769145012,
-0.07114357501268387,
0.0807332843542099,
0.0882553905248642,
-0.06675455719232559,
0.718495786190033,
0.22504828870296478,
-0.06621228158473969,
-0.024248193949460983,
-0.33991539478302,
-0.8340396285057068,
-0.013831473886966705,
-0.27823197841644287,
-0.057074785232543945,
0.04007493332028389,
0.17242532968521118,
-0.49052464962005615,
-0.09912491589784622,
-0.18934789299964905,
-0.16268613934516907,
0.06819130480289459,
0.16527393460273743,
-0.3242438733577728,
-0.11752858757972717,
-0.23418593406677246,
0.10246653854846954,
0.3930708169937134,
0.4166416823863983,
0.07237891107797623,
0.18640689551830292,
-0.25309085845947266,
-0.06964681297540665,
0.05651126429438591,
0.04648076742887497,
0.4361877143383026,
-0.16080568730831146,
0.055259376764297485,
0.07910327613353729,
0.3671548664569855,
-0.0054856762290000916,
0.6376227140426636,
0.18200403451919556,
-0.8556132316589355,
0.09358629584312439,
0.07778027653694153,
0.1841108500957489,
-0.11737856268882751,
-0.21510514616966248,
0.132696270942688,
-0.2387053519487381,
0.023384831845760345,
-0.39083680510520935,
-0.007381375879049301,
0.4942101836204529,
-0.1826823353767395,
-0.05021054670214653,
-0.30054232478141785,
0.4798077940940857,
0.05160748213529587,
0.16309425234794617,
0.006000073626637459,
1.0382771492004395,
-0.07405431568622589,
0.5716263055801392,
0.19556033611297607,
0.5652731657028198,
-0.2233593612909317,
0.13003714382648468,
0.4695199131965637,
-0.43532776832580566,
0.6631953716278076,
-0.20386216044425964,
0.1119074821472168,
-0.19924727082252502,
0.14236706495285034,
-0.12076494097709656,
-0.0540260449051857,
0.35178524255752563,
0.17814071476459503,
-0.3683437705039978,
0.013651318848133087,
-0.06607756018638611,
-0.1214323490858078,
-0.18642890453338623,
0.09076545387506485,
-0.2680352032184601,
-0.04683420807123184,
-0.5542470812797546,
0.1113433986902237,
-0.04513793811202049,
-0.22735461592674255,
0.08390355855226517,
-0.08016453683376312,
-0.04552546143531799,
-0.16013798117637634,
-0.3407999873161316,
-0.12523427605628967,
-0.2388758808374405,
-0.058940693736076355,
0.2853381633758545,
-0.08259396255016327,
0.46309414505958557,
0.41096872091293335,
0.20715627074241638,
-0.15141089260578156,
-0.27755090594291687,
-0.09449218958616257,
-0.011212252080440521,
-0.28136682510375977,
-0.09983998537063599,
-0.07942645251750946,
0.14180442690849304,
-0.024740781635046005,
0.07766857743263245,
-0.17458173632621765,
-0.019267994910478592,
0.06438839435577393,
-0.008225589990615845,
0.15524323284626007,
-0.07160738110542297,
-0.4612441956996918,
-0.20946843922138214,
-0.5635542869567871,
0.19257597625255585,
-0.03703829646110535,
0.09621217846870422,
0.10231173038482666,
0.06616123020648956,
-0.21871308982372284,
0.020441005006432533,
-0.07168574631214142,
-0.06777378916740417,
0.10968833416700363,
-0.2659640610218048,
0.42996281385421753,
0.37740302085876465,
0.21425646543502808,
-0.35159140825271606,
0.002625107765197754,
-0.22908002138137817,
0.420737624168396,
-0.3914269208908081,
0.1481291949748993,
0.16586580872535706,
-0.11029859632253647,
0.060873616486787796,
0.3707968294620514,
0.18954689800739288,
-0.21172161400318146,
0.17728830873966217,
-0.43558192253112793,
-0.05445905029773712,
0.4014973044395447,
-0.23180708289146423,
-0.021581605076789856,
0.5051809549331665,
0.17413538694381714,
0.020044520497322083,
-0.15647566318511963,
-0.2798447906970978,
0.2047216296195984,
-0.04424840211868286,
0.09171046316623688,
0.3787393867969513,
-0.15282294154167175,
0.17503759264945984,
0.1801518052816391,
0.15004710853099823,
0.2598145604133606,
0.07804537564516068,
-0.1108713299036026,
-0.05083814635872841,
0.0741894543170929,
0.04354808107018471,
0.2666358947753906,
-0.1173529177904129,
-0.04297483712434769,
-0.2918795347213745,
-0.0614822693169117,
0.0847870409488678,
0.09422503411769867,
-0.19989259541034698,
0.043434254825115204,
0.4416302442550659,
-0.017980754375457764,
-0.00846833735704422,
0.0936708152294159,
-0.15071329474449158,
-0.03702670335769653,
-0.036776602268218994,
-0.003534260904416442,
-0.360785573720932,
0.042213574051856995,
0.10087853670120239,
0.310473769903183,
0.07996118813753128,
-0.04534416273236275,
0.38723933696746826,
-0.13583886623382568,
0.062409721314907074,
0.1783066987991333,
0.48660868406295776,
0.24026572704315186,
0.08309144526720047,
-0.19391180574893951,
0.2908010482788086,
0.08038543909788132,
-0.3014996647834778,
-0.16011452674865723,
0.19678619503974915,
0.3266863524913788,
0.16219529509544373,
0.2776813507080078,
0.11590345203876495,
0.18691939115524292,
-0.2710854709148407,
0.08541136980056763,
0.44702982902526855,
0.06388489156961441,
0.16394956409931183,
0.0839596837759018,
-0.060318723320961,
-0.04282628744840622,
0.14711418747901917,
0.16866344213485718,
0.1388208419084549,
0.2380208820104599,
-0.08630967885255814,
0.04701230674982071,
0.11994391679763794,
-0.038249652832746506,
0.17654800415039062,
-0.33754265308380127,
0.13054609298706055,
0.11013396084308624,
0.2258099466562271,
-0.023585986346006393,
-0.005128789693117142,
0.39979514479637146,
0.2657366693019867,
-0.14418570697307587,
-0.2427893579006195,
0.2887210547924042,
-0.16075743734836578,
-0.047337356954813004,
0.16876649856567383,
-0.23207923769950867,
-0.11525672674179077,
-0.05090245231986046,
-0.18779151141643524,
-0.023482035845518112,
0.07682802528142929,
-0.02623225376009941,
0.3115014433860779,
-0.33180370926856995,
-0.06646447628736496,
-0.027238165959715843,
0.31528085470199585,
-0.1311650425195694,
0.2724405527114868,
0.13928985595703125,
-0.36486461758613586,
0.13467589020729065,
0.2744894027709961,
0.5965859889984131,
0.2164677530527115,
-0.11494973301887512,
-0.05759773403406143,
-0.31083670258522034,
-0.13155889511108398,
0.18677058815956116,
0.07129751145839691,
0.18611417710781097,
0.47037971019744873,
0.40274327993392944,
0.1273161917924881,
0.04153133183717728,
-0.3296956419944763,
0.0058267321437597275,
0.2159140706062317,
-0.21139472723007202,
0.14371562004089355,
-0.13591676950454712,
0.09227066487073898,
-0.15669949352741241,
-0.058654818683862686,
-0.43180030584335327,
-0.4557279646396637,
-0.1574457734823227,
0.05842245742678642,
0.12081960588693619,
-0.11879095435142517,
0.0824909433722496,
0.3132113814353943,
0.43742692470550537,
0.3032170832157135,
-0.04457304626703262,
-0.12881413102149963,
-0.14282426238059998,
-0.5084798336029053,
0.049753542989492416,
-0.1661849319934845,
-0.226470485329628,
0.4137077033519745,
0.2573765516281128,
0.18270227313041687,
0.18920999765396118,
-0.19281329214572906,
0.31290143728256226,
-0.23681403696537018,
0.15212537348270416,
-0.11407220363616943,
-0.20943593978881836,
0.005846225656569004,
-0.3120182752609253,
-0.02526034042239189,
0.2024112045764923,
0.2185799479484558,
-0.07268483191728592,
0.03043949604034424,
-0.015098392963409424,
0.1416952908039093,
-0.3610880970954895,
-0.28920018672943115,
-0.1019616574048996,
0.22302132844924927,
0.1745631843805313,
0.04900035262107849,
-0.07820279151201248,
-0.17177166044712067,
-0.18933190405368805,
-0.23088882863521576,
0.5810200572013855,
-0.11861994862556458,
0.29229021072387695,
-0.305107980966568,
-0.2905067503452301,
-0.11792607605457306,
0.07087436318397522,
-0.04611311852931976,
-0.05421169847249985,
-0.24019373953342438,
0.18587009608745575,
0.16082878410816193,
-0.08625855296850204,
-0.08565138280391693,
0.191035658121109,
0.1209009662270546,
0.25492897629737854,
0.0780114233493805,
-0.48965519666671753,
0.4284687042236328,
-0.4832099676132202,
-0.2350735366344452,
0.16522657871246338,
0.009573161602020264,
0.39178329706192017,
-0.012847625650465488,
-0.38523703813552856,
-0.02024843543767929,
0.1411222666501999,
0.06605831533670425,
0.02197563648223877,
-0.03927989676594734,
-0.04531735181808472,
-0.18241041898727417,
-0.2932910919189453,
0.21277183294296265,
0.07405507564544678,
0.1467665731906891,
0.14264404773712158,
-0.24928566813468933
] |
https://github.com/huggingface/datasets/issues/5706 | Hmm, that is a good point. What if we implemented this feature first in a
manner that didn't allow concatenation of arrays with different index to
category maps? Then concatenation would be very straightforward, and I
think this is reasonable if the index to category map is stored in the
schema as well. Obviously, this is limited in how folks could use the
feature, but they can always fall back to raw strings if needed, and as
usage increases we'll have more data to see what the right solution here
is.
On Fri, Sep 8, 2023, 6:49 AM Quentin Lhoest ***@***.***>
wrote:
> Well IIRC you can concatenate two Arrow arrays with different dictionaries
> together. But for datasets would mean updating the datasets features when
> concatenating two arrays of the same type, which is not supported right
> now. That's why if there is a way to have it without storing the mapping in
> the feature object it would be nice.
>
> For decoding we do have the string<->integer mapping from the array
> dictionary attribute so we're fine. For encoding I think it can work if
> we only encode when converting python objects to pyarrow in
> TypedSequence.__arrow_array__ in arow_writer.py. It can work by
> converting the python objects to a pyarrow array and then use the
> dictionary_encode method.
>
> Another concern about concatenation: I noticed *pyarrow creates the new
> dictionary and indices in memory* when concatenating two dictionary
> encoded arrays. This can be a problem for big datastets, and we should
> probably use ChunkedArray objects instead. This can surely be taken care of
> in array_concat in table.py
>
> cc @mariosasko <https://github.com/mariosasko> in case you have other
> ideas
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/5706#issuecomment-1711468806>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AADS5X4E2KC2IXLDPYR3XZLXZLZ2FANCNFSM6AAAAAAWSOUTJ4>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
| Support categorical data types for Parquet | ### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first. | 326 | Support categorical data types for Parquet
### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first.
Hmm, that is a good point. What if we implemented this feature first in a
manner that didn't allow concatenation of arrays with different index to
category maps? Then concatenation would be very straightforward, and I
think this is reasonable if the index to category map is stored in the
schema as well. Obviously, this is limited in how folks could use the
feature, but they can always fall back to raw strings if needed, and as
usage increases we'll have more data to see what the right solution here
is.
On Fri, Sep 8, 2023, 6:49 AM Quentin Lhoest ***@***.***>
wrote:
> Well IIRC you can concatenate two Arrow arrays with different dictionaries
> together. But for datasets would mean updating the datasets features when
> concatenating two arrays of the same type, which is not supported right
> now. That's why if there is a way to have it without storing the mapping in
> the feature object it would be nice.
>
> For decoding we do have the string<->integer mapping from the array
> dictionary attribute so we're fine. For encoding I think it can work if
> we only encode when converting python objects to pyarrow in
> TypedSequence.__arrow_array__ in arow_writer.py. It can work by
> converting the python objects to a pyarrow array and then use the
> dictionary_encode method.
>
> Another concern about concatenation: I noticed *pyarrow creates the new
> dictionary and indices in memory* when concatenating two dictionary
> encoded arrays. This can be a problem for big datastets, and we should
> probably use ChunkedArray objects instead. This can surely be taken care of
> in array_concat in table.py
>
> cc @mariosasko <https://github.com/mariosasko> in case you have other
> ideas
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/5706#issuecomment-1711468806>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AADS5X4E2KC2IXLDPYR3XZLXZLZ2FANCNFSM6AAAAAAWSOUTJ4>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
| [
-0.152938574552536,
-0.06370358169078827,
0.07160879671573639,
0.32455649971961975,
0.4551955461502075,
0.06469179689884186,
-0.1901731789112091,
0.22342005372047424,
0.203786700963974,
-0.2283174693584442,
-0.11718685179948807,
0.5124905109405518,
-0.2902349531650543,
0.44914382696151733,
-0.020855922251939774,
-0.2356620728969574,
0.11446522921323776,
-0.05483004450798035,
0.0671464204788208,
0.21519631147384644,
-0.2553243339061737,
0.37052780389785767,
0.021052315831184387,
0.17270562052726746,
-0.005001053214073181,
-0.20741158723831177,
-0.17676939070224762,
0.1230643093585968,
-0.4154319167137146,
-0.648801326751709,
0.38270604610443115,
-0.06258346140384674,
0.07781172543764114,
0.16082338988780975,
-0.00011092540808022022,
0.20099994540214539,
0.22811582684516907,
-0.05094720423221588,
0.07525114715099335,
-0.6103057861328125,
0.25767678022384644,
-0.3289322257041931,
0.5521793961524963,
-0.21667873859405518,
-0.28450876474380493,
-0.5699324011802673,
-0.0010316865518689156,
-0.050077129155397415,
0.13149625062942505,
0.24128347635269165,
0.2137584686279297,
0.12009842693805695,
0.3107171058654785,
-0.026749245822429657,
0.29283881187438965,
0.2815583050251007,
-0.26439225673675537,
0.1390400528907776,
0.19724245369434357,
-0.03920833021402359,
0.10887692123651505,
-0.047020141035318375,
0.07511953264474869,
-0.12355630099773407,
0.26804596185684204,
0.19692714512348175,
0.2707127332687378,
-0.16132812201976776,
-0.1130475103855133,
0.15778645873069763,
0.23117531836032867,
-0.348167359828949,
-0.3780864179134369,
-0.34970414638519287,
-0.08686838299036026,
-0.23116783797740936,
0.3346812129020691,
0.3381064832210541,
-0.03735218942165375,
0.07614102214574814,
0.2864310145378113,
0.10737806558609009,
-0.1368553787469864,
0.15590734779834747,
-0.20811225473880768,
0.051938969641923904,
-0.22799769043922424,
-0.04494556412100792,
0.35474693775177,
-0.27781617641448975,
-0.22969049215316772,
0.05305665358901024,
-0.1878403127193451,
0.0989813357591629,
-0.2532532215118408,
-0.1310701221227646,
-0.18735121190547943,
0.43419149518013,
0.24213898181915283,
-0.08589248359203339,
0.1634422093629837,
-0.06389711052179337,
0.1353231519460678,
0.29720693826675415,
0.47173649072647095,
-0.17446671426296234,
0.038373105227947235,
0.04406629130244255,
-0.26854804158210754,
0.3720489740371704,
0.1295095980167389,
-0.2310546636581421,
0.026296399533748627,
-0.21925373375415802,
-0.208120658993721,
-0.1931491196155548,
0.5561254620552063,
-0.0638805404305458,
-0.1691259890794754,
0.1650553047657013,
0.11396956443786621,
0.18829651176929474,
0.10086981952190399,
0.3479073643684387,
-0.022937806323170662,
0.02642764523625374,
-0.10813335329294205,
0.4272960424423218,
-0.06958991289138794,
-0.26751598715782166,
-0.052012547850608826,
0.18189457058906555,
-0.12289297580718994,
-0.34406009316444397,
0.051090121269226074,
-0.13396772742271423,
-0.016252990812063217,
0.24607893824577332,
0.016065379604697227,
0.11210143566131592,
-0.20609289407730103,
-0.24143250286579132,
-0.099113829433918,
0.210547536611557,
-0.1118248701095581,
-0.042394645512104034,
0.44341424107551575,
-0.5455547571182251,
-0.29060906171798706,
-0.06072327122092247,
-0.17885178327560425,
-0.13254398107528687,
-0.26276135444641113,
0.11716574430465698,
0.04377703368663788,
-0.10584572702646255,
-0.6395193934440613,
0.4424750804901123,
-0.1372944712638855,
-0.1937583088874817,
-0.05611115321516991,
-0.07101194560527802,
-0.1416284441947937,
-0.25209540128707886,
0.052349187433719635,
0.22650232911109924,
-0.42769789695739746,
0.02059689164161682,
0.01941388100385666,
-0.23541375994682312,
0.3803633153438568,
0.3180568814277649,
-0.02763085812330246,
-0.4074193239212036,
-0.03246611729264259,
0.22595669329166412,
0.3833453953266144,
-0.034665364772081375,
0.029156766831874847,
0.10229064524173737,
0.11098361760377884,
0.31626445055007935,
0.18920253217220306,
-0.3239975571632385,
0.50709068775177,
-0.013011213392019272,
-0.02620040625333786,
0.04411611706018448,
-0.20981580018997192,
-0.06783615797758102,
-0.3061771094799042,
-0.14404937624931335,
0.4953615367412567,
0.14524048566818237,
-0.2497681975364685,
-0.10603898763656616,
0.2180664986371994,
-0.26237770915031433,
0.14679385721683502,
-0.031239736825227737,
-0.030373938381671906,
-0.023333575576543808,
0.2688630521297455,
0.6133161187171936,
0.08784923702478409,
-0.3044065237045288,
-0.3224829435348511,
0.2282199114561081,
0.052213676273822784,
0.06213083863258362,
-0.24143855273723602,
-0.30301064252853394,
-0.14496557414531708,
0.1378384530544281,
-0.09390182793140411,
-0.01944703608751297,
0.1721343994140625,
-0.08013330399990082,
0.021914541721343994,
0.29322192072868347,
-0.18580783903598785,
0.22619204223155975,
-0.21847137808799744,
0.2586442530155182,
-0.06182252988219261,
0.18199323117733002,
-0.10379088670015335,
-0.3180977702140808,
0.07615016400814056,
0.21751287579536438,
0.07291470468044281,
-0.10771507024765015,
0.2687312066555023,
0.2809019088745117,
0.2731555104255676,
0.027974411845207214,
-0.09046827256679535,
0.16220802068710327,
0.14152175188064575,
-0.05531177297234535,
-0.1670624315738678,
-0.12894617021083832,
0.1957995593547821,
0.12024074047803879,
-0.05643313378095627,
0.39094457030296326,
-0.035749807953834534,
0.023572636768221855,
-0.11664607375860214,
0.17691445350646973,
0.24842453002929688,
0.32303303480148315,
-0.23134571313858032,
-0.12353555858135223,
0.2530020475387573,
-0.0045946817845106125,
-0.1921282559633255,
-0.07039051502943039,
-0.5973890423774719,
0.01568268984556198,
0.3798612952232361,
0.11977086216211319,
0.1029573604464531,
0.04136619344353676,
0.2032211422920227,
0.08613710105419159,
-0.04918786138296127,
0.27293264865875244,
0.0384262353181839,
0.2379569262266159,
-0.12969478964805603,
0.08426417410373688,
-0.22460967302322388,
0.058242786675691605,
0.2596370577812195,
0.17151939868927002,
-0.05381207540631294,
-0.21425727009773254,
0.2914349436759949,
0.06249687820672989,
-0.37361446022987366,
0.14000560343265533,
0.06541142612695694,
0.10063115507364273,
-0.42535924911499023,
0.10444281250238419,
-0.3702431321144104,
-0.05711374431848526,
-0.13888244330883026,
-0.00012029334902763367,
-0.23791804909706116,
-0.20550847053527832,
-0.10111063718795776,
0.12339800596237183,
-0.09335972368717194,
-0.04076502472162247,
-0.1659088134765625,
0.18208682537078857,
-0.027358591556549072,
-0.12820883095264435,
-0.262002170085907,
-0.36206701397895813,
-0.12342662364244461,
0.09313923120498657,
0.15297982096672058,
-0.14776605367660522,
0.35018548369407654,
-0.042704418301582336,
0.027697138488292694,
-0.25959527492523193,
-0.4133831858634949,
-0.023066453635692596,
-0.39364928007125854,
0.1958536058664322,
0.22667653858661652,
0.09073315560817719,
-0.2696143388748169,
-0.28969186544418335,
0.47491422295570374,
-0.056450508534908295,
-0.20800185203552246,
0.22151446342468262,
-0.0034103170037269592,
-0.0970926433801651,
-0.10649419575929642,
-0.10217826068401337,
-0.29842817783355713,
-0.2879944145679474,
0.4497191607952118,
0.1444402039051056,
-0.034513913094997406,
-0.1965426504611969,
-0.0278362687677145,
-0.01861807331442833,
-0.527838945388794,
0.06636419147253036,
-0.040320198982954025,
-0.002724006772041321,
0.32798123359680176,
-0.1422857940196991,
-0.38700562715530396,
0.19021424651145935,
-0.00631202757358551,
0.18691426515579224,
-0.003984272480010986,
-0.20849883556365967,
-0.08707308024168015,
-0.10268814861774445,
0.19811725616455078,
-0.037180427461862564,
-0.14256322383880615,
0.3516176640987396,
0.06691202521324158,
-0.024691686034202576,
-0.07317157089710236,
-0.06056349724531174,
-0.004815500229597092,
0.184244766831398,
-0.05091938003897667,
-0.04849030077457428,
0.6205022931098938,
0.2456151247024536,
0.17862682044506073,
-0.05995325744152069,
0.14099034667015076,
0.6188872456550598,
-0.32015615701675415,
0.39276546239852905,
-0.04005168378353119,
-0.2920130491256714,
-0.08307938277721405,
-0.25417888164520264,
0.26055699586868286,
0.117622971534729,
-0.05621738359332085,
-0.1948554515838623,
-0.11590456962585449,
-0.07275794446468353,
-0.2815675735473633,
-0.2757439613342285,
-0.057677969336509705,
-0.035767700523138046,
0.06650535762310028,
-0.12679755687713623,
-0.12256654351949692,
-0.010229043662548065,
-0.13874486088752747,
0.07516616582870483,
0.44735440611839294,
-0.061268918216228485,
0.19017724692821503,
0.01140981912612915,
-0.03884042054414749,
-0.45768457651138306,
0.1959451138973236,
-0.07473284751176834,
0.04759768769145012,
-0.07114357501268387,
0.0807332843542099,
0.0882553905248642,
-0.06675455719232559,
0.718495786190033,
0.22504828870296478,
-0.06621228158473969,
-0.024248193949460983,
-0.33991539478302,
-0.8340396285057068,
-0.013831473886966705,
-0.27823197841644287,
-0.057074785232543945,
0.04007493332028389,
0.17242532968521118,
-0.49052464962005615,
-0.09912491589784622,
-0.18934789299964905,
-0.16268613934516907,
0.06819130480289459,
0.16527393460273743,
-0.3242438733577728,
-0.11752858757972717,
-0.23418593406677246,
0.10246653854846954,
0.3930708169937134,
0.4166416823863983,
0.07237891107797623,
0.18640689551830292,
-0.25309085845947266,
-0.06964681297540665,
0.05651126429438591,
0.04648076742887497,
0.4361877143383026,
-0.16080568730831146,
0.055259376764297485,
0.07910327613353729,
0.3671548664569855,
-0.0054856762290000916,
0.6376227140426636,
0.18200403451919556,
-0.8556132316589355,
0.09358629584312439,
0.07778027653694153,
0.1841108500957489,
-0.11737856268882751,
-0.21510514616966248,
0.132696270942688,
-0.2387053519487381,
0.023384831845760345,
-0.39083680510520935,
-0.007381375879049301,
0.4942101836204529,
-0.1826823353767395,
-0.05021054670214653,
-0.30054232478141785,
0.4798077940940857,
0.05160748213529587,
0.16309425234794617,
0.006000073626637459,
1.0382771492004395,
-0.07405431568622589,
0.5716263055801392,
0.19556033611297607,
0.5652731657028198,
-0.2233593612909317,
0.13003714382648468,
0.4695199131965637,
-0.43532776832580566,
0.6631953716278076,
-0.20386216044425964,
0.1119074821472168,
-0.19924727082252502,
0.14236706495285034,
-0.12076494097709656,
-0.0540260449051857,
0.35178524255752563,
0.17814071476459503,
-0.3683437705039978,
0.013651318848133087,
-0.06607756018638611,
-0.1214323490858078,
-0.18642890453338623,
0.09076545387506485,
-0.2680352032184601,
-0.04683420807123184,
-0.5542470812797546,
0.1113433986902237,
-0.04513793811202049,
-0.22735461592674255,
0.08390355855226517,
-0.08016453683376312,
-0.04552546143531799,
-0.16013798117637634,
-0.3407999873161316,
-0.12523427605628967,
-0.2388758808374405,
-0.058940693736076355,
0.2853381633758545,
-0.08259396255016327,
0.46309414505958557,
0.41096872091293335,
0.20715627074241638,
-0.15141089260578156,
-0.27755090594291687,
-0.09449218958616257,
-0.011212252080440521,
-0.28136682510375977,
-0.09983998537063599,
-0.07942645251750946,
0.14180442690849304,
-0.024740781635046005,
0.07766857743263245,
-0.17458173632621765,
-0.019267994910478592,
0.06438839435577393,
-0.008225589990615845,
0.15524323284626007,
-0.07160738110542297,
-0.4612441956996918,
-0.20946843922138214,
-0.5635542869567871,
0.19257597625255585,
-0.03703829646110535,
0.09621217846870422,
0.10231173038482666,
0.06616123020648956,
-0.21871308982372284,
0.020441005006432533,
-0.07168574631214142,
-0.06777378916740417,
0.10968833416700363,
-0.2659640610218048,
0.42996281385421753,
0.37740302085876465,
0.21425646543502808,
-0.35159140825271606,
0.002625107765197754,
-0.22908002138137817,
0.420737624168396,
-0.3914269208908081,
0.1481291949748993,
0.16586580872535706,
-0.11029859632253647,
0.060873616486787796,
0.3707968294620514,
0.18954689800739288,
-0.21172161400318146,
0.17728830873966217,
-0.43558192253112793,
-0.05445905029773712,
0.4014973044395447,
-0.23180708289146423,
-0.021581605076789856,
0.5051809549331665,
0.17413538694381714,
0.020044520497322083,
-0.15647566318511963,
-0.2798447906970978,
0.2047216296195984,
-0.04424840211868286,
0.09171046316623688,
0.3787393867969513,
-0.15282294154167175,
0.17503759264945984,
0.1801518052816391,
0.15004710853099823,
0.2598145604133606,
0.07804537564516068,
-0.1108713299036026,
-0.05083814635872841,
0.0741894543170929,
0.04354808107018471,
0.2666358947753906,
-0.1173529177904129,
-0.04297483712434769,
-0.2918795347213745,
-0.0614822693169117,
0.0847870409488678,
0.09422503411769867,
-0.19989259541034698,
0.043434254825115204,
0.4416302442550659,
-0.017980754375457764,
-0.00846833735704422,
0.0936708152294159,
-0.15071329474449158,
-0.03702670335769653,
-0.036776602268218994,
-0.003534260904416442,
-0.360785573720932,
0.042213574051856995,
0.10087853670120239,
0.310473769903183,
0.07996118813753128,
-0.04534416273236275,
0.38723933696746826,
-0.13583886623382568,
0.062409721314907074,
0.1783066987991333,
0.48660868406295776,
0.24026572704315186,
0.08309144526720047,
-0.19391180574893951,
0.2908010482788086,
0.08038543909788132,
-0.3014996647834778,
-0.16011452674865723,
0.19678619503974915,
0.3266863524913788,
0.16219529509544373,
0.2776813507080078,
0.11590345203876495,
0.18691939115524292,
-0.2710854709148407,
0.08541136980056763,
0.44702982902526855,
0.06388489156961441,
0.16394956409931183,
0.0839596837759018,
-0.060318723320961,
-0.04282628744840622,
0.14711418747901917,
0.16866344213485718,
0.1388208419084549,
0.2380208820104599,
-0.08630967885255814,
0.04701230674982071,
0.11994391679763794,
-0.038249652832746506,
0.17654800415039062,
-0.33754265308380127,
0.13054609298706055,
0.11013396084308624,
0.2258099466562271,
-0.023585986346006393,
-0.005128789693117142,
0.39979514479637146,
0.2657366693019867,
-0.14418570697307587,
-0.2427893579006195,
0.2887210547924042,
-0.16075743734836578,
-0.047337356954813004,
0.16876649856567383,
-0.23207923769950867,
-0.11525672674179077,
-0.05090245231986046,
-0.18779151141643524,
-0.023482035845518112,
0.07682802528142929,
-0.02623225376009941,
0.3115014433860779,
-0.33180370926856995,
-0.06646447628736496,
-0.027238165959715843,
0.31528085470199585,
-0.1311650425195694,
0.2724405527114868,
0.13928985595703125,
-0.36486461758613586,
0.13467589020729065,
0.2744894027709961,
0.5965859889984131,
0.2164677530527115,
-0.11494973301887512,
-0.05759773403406143,
-0.31083670258522034,
-0.13155889511108398,
0.18677058815956116,
0.07129751145839691,
0.18611417710781097,
0.47037971019744873,
0.40274327993392944,
0.1273161917924881,
0.04153133183717728,
-0.3296956419944763,
0.0058267321437597275,
0.2159140706062317,
-0.21139472723007202,
0.14371562004089355,
-0.13591676950454712,
0.09227066487073898,
-0.15669949352741241,
-0.058654818683862686,
-0.43180030584335327,
-0.4557279646396637,
-0.1574457734823227,
0.05842245742678642,
0.12081960588693619,
-0.11879095435142517,
0.0824909433722496,
0.3132113814353943,
0.43742692470550537,
0.3032170832157135,
-0.04457304626703262,
-0.12881413102149963,
-0.14282426238059998,
-0.5084798336029053,
0.049753542989492416,
-0.1661849319934845,
-0.226470485329628,
0.4137077033519745,
0.2573765516281128,
0.18270227313041687,
0.18920999765396118,
-0.19281329214572906,
0.31290143728256226,
-0.23681403696537018,
0.15212537348270416,
-0.11407220363616943,
-0.20943593978881836,
0.005846225656569004,
-0.3120182752609253,
-0.02526034042239189,
0.2024112045764923,
0.2185799479484558,
-0.07268483191728592,
0.03043949604034424,
-0.015098392963409424,
0.1416952908039093,
-0.3610880970954895,
-0.28920018672943115,
-0.1019616574048996,
0.22302132844924927,
0.1745631843805313,
0.04900035262107849,
-0.07820279151201248,
-0.17177166044712067,
-0.18933190405368805,
-0.23088882863521576,
0.5810200572013855,
-0.11861994862556458,
0.29229021072387695,
-0.305107980966568,
-0.2905067503452301,
-0.11792607605457306,
0.07087436318397522,
-0.04611311852931976,
-0.05421169847249985,
-0.24019373953342438,
0.18587009608745575,
0.16082878410816193,
-0.08625855296850204,
-0.08565138280391693,
0.191035658121109,
0.1209009662270546,
0.25492897629737854,
0.0780114233493805,
-0.48965519666671753,
0.4284687042236328,
-0.4832099676132202,
-0.2350735366344452,
0.16522657871246338,
0.009573161602020264,
0.39178329706192017,
-0.012847625650465488,
-0.38523703813552856,
-0.02024843543767929,
0.1411222666501999,
0.06605831533670425,
0.02197563648223877,
-0.03927989676594734,
-0.04531735181808472,
-0.18241041898727417,
-0.2932910919189453,
0.21277183294296265,
0.07405507564544678,
0.1467665731906891,
0.14264404773712158,
-0.24928566813468933
] |
https://github.com/huggingface/datasets/issues/5706 | @lhoestq @mariosasko just re-pinging on this so I can push forward further here. What are your thoughts on disallowing concatenation of categorical arrays for now such that the index to category map can be stored in the schema metadata? And/or other approaches that should be taken here?
| Support categorical data types for Parquet | ### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first. | 47 | Support categorical data types for Parquet
### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first.
@lhoestq @mariosasko just re-pinging on this so I can push forward further here. What are your thoughts on disallowing concatenation of categorical arrays for now such that the index to category map can be stored in the schema metadata? And/or other approaches that should be taken here?
| [
-0.152938574552536,
-0.06370358169078827,
0.07160879671573639,
0.32455649971961975,
0.4551955461502075,
0.06469179689884186,
-0.1901731789112091,
0.22342005372047424,
0.203786700963974,
-0.2283174693584442,
-0.11718685179948807,
0.5124905109405518,
-0.2902349531650543,
0.44914382696151733,
-0.020855922251939774,
-0.2356620728969574,
0.11446522921323776,
-0.05483004450798035,
0.0671464204788208,
0.21519631147384644,
-0.2553243339061737,
0.37052780389785767,
0.021052315831184387,
0.17270562052726746,
-0.005001053214073181,
-0.20741158723831177,
-0.17676939070224762,
0.1230643093585968,
-0.4154319167137146,
-0.648801326751709,
0.38270604610443115,
-0.06258346140384674,
0.07781172543764114,
0.16082338988780975,
-0.00011092540808022022,
0.20099994540214539,
0.22811582684516907,
-0.05094720423221588,
0.07525114715099335,
-0.6103057861328125,
0.25767678022384644,
-0.3289322257041931,
0.5521793961524963,
-0.21667873859405518,
-0.28450876474380493,
-0.5699324011802673,
-0.0010316865518689156,
-0.050077129155397415,
0.13149625062942505,
0.24128347635269165,
0.2137584686279297,
0.12009842693805695,
0.3107171058654785,
-0.026749245822429657,
0.29283881187438965,
0.2815583050251007,
-0.26439225673675537,
0.1390400528907776,
0.19724245369434357,
-0.03920833021402359,
0.10887692123651505,
-0.047020141035318375,
0.07511953264474869,
-0.12355630099773407,
0.26804596185684204,
0.19692714512348175,
0.2707127332687378,
-0.16132812201976776,
-0.1130475103855133,
0.15778645873069763,
0.23117531836032867,
-0.348167359828949,
-0.3780864179134369,
-0.34970414638519287,
-0.08686838299036026,
-0.23116783797740936,
0.3346812129020691,
0.3381064832210541,
-0.03735218942165375,
0.07614102214574814,
0.2864310145378113,
0.10737806558609009,
-0.1368553787469864,
0.15590734779834747,
-0.20811225473880768,
0.051938969641923904,
-0.22799769043922424,
-0.04494556412100792,
0.35474693775177,
-0.27781617641448975,
-0.22969049215316772,
0.05305665358901024,
-0.1878403127193451,
0.0989813357591629,
-0.2532532215118408,
-0.1310701221227646,
-0.18735121190547943,
0.43419149518013,
0.24213898181915283,
-0.08589248359203339,
0.1634422093629837,
-0.06389711052179337,
0.1353231519460678,
0.29720693826675415,
0.47173649072647095,
-0.17446671426296234,
0.038373105227947235,
0.04406629130244255,
-0.26854804158210754,
0.3720489740371704,
0.1295095980167389,
-0.2310546636581421,
0.026296399533748627,
-0.21925373375415802,
-0.208120658993721,
-0.1931491196155548,
0.5561254620552063,
-0.0638805404305458,
-0.1691259890794754,
0.1650553047657013,
0.11396956443786621,
0.18829651176929474,
0.10086981952190399,
0.3479073643684387,
-0.022937806323170662,
0.02642764523625374,
-0.10813335329294205,
0.4272960424423218,
-0.06958991289138794,
-0.26751598715782166,
-0.052012547850608826,
0.18189457058906555,
-0.12289297580718994,
-0.34406009316444397,
0.051090121269226074,
-0.13396772742271423,
-0.016252990812063217,
0.24607893824577332,
0.016065379604697227,
0.11210143566131592,
-0.20609289407730103,
-0.24143250286579132,
-0.099113829433918,
0.210547536611557,
-0.1118248701095581,
-0.042394645512104034,
0.44341424107551575,
-0.5455547571182251,
-0.29060906171798706,
-0.06072327122092247,
-0.17885178327560425,
-0.13254398107528687,
-0.26276135444641113,
0.11716574430465698,
0.04377703368663788,
-0.10584572702646255,
-0.6395193934440613,
0.4424750804901123,
-0.1372944712638855,
-0.1937583088874817,
-0.05611115321516991,
-0.07101194560527802,
-0.1416284441947937,
-0.25209540128707886,
0.052349187433719635,
0.22650232911109924,
-0.42769789695739746,
0.02059689164161682,
0.01941388100385666,
-0.23541375994682312,
0.3803633153438568,
0.3180568814277649,
-0.02763085812330246,
-0.4074193239212036,
-0.03246611729264259,
0.22595669329166412,
0.3833453953266144,
-0.034665364772081375,
0.029156766831874847,
0.10229064524173737,
0.11098361760377884,
0.31626445055007935,
0.18920253217220306,
-0.3239975571632385,
0.50709068775177,
-0.013011213392019272,
-0.02620040625333786,
0.04411611706018448,
-0.20981580018997192,
-0.06783615797758102,
-0.3061771094799042,
-0.14404937624931335,
0.4953615367412567,
0.14524048566818237,
-0.2497681975364685,
-0.10603898763656616,
0.2180664986371994,
-0.26237770915031433,
0.14679385721683502,
-0.031239736825227737,
-0.030373938381671906,
-0.023333575576543808,
0.2688630521297455,
0.6133161187171936,
0.08784923702478409,
-0.3044065237045288,
-0.3224829435348511,
0.2282199114561081,
0.052213676273822784,
0.06213083863258362,
-0.24143855273723602,
-0.30301064252853394,
-0.14496557414531708,
0.1378384530544281,
-0.09390182793140411,
-0.01944703608751297,
0.1721343994140625,
-0.08013330399990082,
0.021914541721343994,
0.29322192072868347,
-0.18580783903598785,
0.22619204223155975,
-0.21847137808799744,
0.2586442530155182,
-0.06182252988219261,
0.18199323117733002,
-0.10379088670015335,
-0.3180977702140808,
0.07615016400814056,
0.21751287579536438,
0.07291470468044281,
-0.10771507024765015,
0.2687312066555023,
0.2809019088745117,
0.2731555104255676,
0.027974411845207214,
-0.09046827256679535,
0.16220802068710327,
0.14152175188064575,
-0.05531177297234535,
-0.1670624315738678,
-0.12894617021083832,
0.1957995593547821,
0.12024074047803879,
-0.05643313378095627,
0.39094457030296326,
-0.035749807953834534,
0.023572636768221855,
-0.11664607375860214,
0.17691445350646973,
0.24842453002929688,
0.32303303480148315,
-0.23134571313858032,
-0.12353555858135223,
0.2530020475387573,
-0.0045946817845106125,
-0.1921282559633255,
-0.07039051502943039,
-0.5973890423774719,
0.01568268984556198,
0.3798612952232361,
0.11977086216211319,
0.1029573604464531,
0.04136619344353676,
0.2032211422920227,
0.08613710105419159,
-0.04918786138296127,
0.27293264865875244,
0.0384262353181839,
0.2379569262266159,
-0.12969478964805603,
0.08426417410373688,
-0.22460967302322388,
0.058242786675691605,
0.2596370577812195,
0.17151939868927002,
-0.05381207540631294,
-0.21425727009773254,
0.2914349436759949,
0.06249687820672989,
-0.37361446022987366,
0.14000560343265533,
0.06541142612695694,
0.10063115507364273,
-0.42535924911499023,
0.10444281250238419,
-0.3702431321144104,
-0.05711374431848526,
-0.13888244330883026,
-0.00012029334902763367,
-0.23791804909706116,
-0.20550847053527832,
-0.10111063718795776,
0.12339800596237183,
-0.09335972368717194,
-0.04076502472162247,
-0.1659088134765625,
0.18208682537078857,
-0.027358591556549072,
-0.12820883095264435,
-0.262002170085907,
-0.36206701397895813,
-0.12342662364244461,
0.09313923120498657,
0.15297982096672058,
-0.14776605367660522,
0.35018548369407654,
-0.042704418301582336,
0.027697138488292694,
-0.25959527492523193,
-0.4133831858634949,
-0.023066453635692596,
-0.39364928007125854,
0.1958536058664322,
0.22667653858661652,
0.09073315560817719,
-0.2696143388748169,
-0.28969186544418335,
0.47491422295570374,
-0.056450508534908295,
-0.20800185203552246,
0.22151446342468262,
-0.0034103170037269592,
-0.0970926433801651,
-0.10649419575929642,
-0.10217826068401337,
-0.29842817783355713,
-0.2879944145679474,
0.4497191607952118,
0.1444402039051056,
-0.034513913094997406,
-0.1965426504611969,
-0.0278362687677145,
-0.01861807331442833,
-0.527838945388794,
0.06636419147253036,
-0.040320198982954025,
-0.002724006772041321,
0.32798123359680176,
-0.1422857940196991,
-0.38700562715530396,
0.19021424651145935,
-0.00631202757358551,
0.18691426515579224,
-0.003984272480010986,
-0.20849883556365967,
-0.08707308024168015,
-0.10268814861774445,
0.19811725616455078,
-0.037180427461862564,
-0.14256322383880615,
0.3516176640987396,
0.06691202521324158,
-0.024691686034202576,
-0.07317157089710236,
-0.06056349724531174,
-0.004815500229597092,
0.184244766831398,
-0.05091938003897667,
-0.04849030077457428,
0.6205022931098938,
0.2456151247024536,
0.17862682044506073,
-0.05995325744152069,
0.14099034667015076,
0.6188872456550598,
-0.32015615701675415,
0.39276546239852905,
-0.04005168378353119,
-0.2920130491256714,
-0.08307938277721405,
-0.25417888164520264,
0.26055699586868286,
0.117622971534729,
-0.05621738359332085,
-0.1948554515838623,
-0.11590456962585449,
-0.07275794446468353,
-0.2815675735473633,
-0.2757439613342285,
-0.057677969336509705,
-0.035767700523138046,
0.06650535762310028,
-0.12679755687713623,
-0.12256654351949692,
-0.010229043662548065,
-0.13874486088752747,
0.07516616582870483,
0.44735440611839294,
-0.061268918216228485,
0.19017724692821503,
0.01140981912612915,
-0.03884042054414749,
-0.45768457651138306,
0.1959451138973236,
-0.07473284751176834,
0.04759768769145012,
-0.07114357501268387,
0.0807332843542099,
0.0882553905248642,
-0.06675455719232559,
0.718495786190033,
0.22504828870296478,
-0.06621228158473969,
-0.024248193949460983,
-0.33991539478302,
-0.8340396285057068,
-0.013831473886966705,
-0.27823197841644287,
-0.057074785232543945,
0.04007493332028389,
0.17242532968521118,
-0.49052464962005615,
-0.09912491589784622,
-0.18934789299964905,
-0.16268613934516907,
0.06819130480289459,
0.16527393460273743,
-0.3242438733577728,
-0.11752858757972717,
-0.23418593406677246,
0.10246653854846954,
0.3930708169937134,
0.4166416823863983,
0.07237891107797623,
0.18640689551830292,
-0.25309085845947266,
-0.06964681297540665,
0.05651126429438591,
0.04648076742887497,
0.4361877143383026,
-0.16080568730831146,
0.055259376764297485,
0.07910327613353729,
0.3671548664569855,
-0.0054856762290000916,
0.6376227140426636,
0.18200403451919556,
-0.8556132316589355,
0.09358629584312439,
0.07778027653694153,
0.1841108500957489,
-0.11737856268882751,
-0.21510514616966248,
0.132696270942688,
-0.2387053519487381,
0.023384831845760345,
-0.39083680510520935,
-0.007381375879049301,
0.4942101836204529,
-0.1826823353767395,
-0.05021054670214653,
-0.30054232478141785,
0.4798077940940857,
0.05160748213529587,
0.16309425234794617,
0.006000073626637459,
1.0382771492004395,
-0.07405431568622589,
0.5716263055801392,
0.19556033611297607,
0.5652731657028198,
-0.2233593612909317,
0.13003714382648468,
0.4695199131965637,
-0.43532776832580566,
0.6631953716278076,
-0.20386216044425964,
0.1119074821472168,
-0.19924727082252502,
0.14236706495285034,
-0.12076494097709656,
-0.0540260449051857,
0.35178524255752563,
0.17814071476459503,
-0.3683437705039978,
0.013651318848133087,
-0.06607756018638611,
-0.1214323490858078,
-0.18642890453338623,
0.09076545387506485,
-0.2680352032184601,
-0.04683420807123184,
-0.5542470812797546,
0.1113433986902237,
-0.04513793811202049,
-0.22735461592674255,
0.08390355855226517,
-0.08016453683376312,
-0.04552546143531799,
-0.16013798117637634,
-0.3407999873161316,
-0.12523427605628967,
-0.2388758808374405,
-0.058940693736076355,
0.2853381633758545,
-0.08259396255016327,
0.46309414505958557,
0.41096872091293335,
0.20715627074241638,
-0.15141089260578156,
-0.27755090594291687,
-0.09449218958616257,
-0.011212252080440521,
-0.28136682510375977,
-0.09983998537063599,
-0.07942645251750946,
0.14180442690849304,
-0.024740781635046005,
0.07766857743263245,
-0.17458173632621765,
-0.019267994910478592,
0.06438839435577393,
-0.008225589990615845,
0.15524323284626007,
-0.07160738110542297,
-0.4612441956996918,
-0.20946843922138214,
-0.5635542869567871,
0.19257597625255585,
-0.03703829646110535,
0.09621217846870422,
0.10231173038482666,
0.06616123020648956,
-0.21871308982372284,
0.020441005006432533,
-0.07168574631214142,
-0.06777378916740417,
0.10968833416700363,
-0.2659640610218048,
0.42996281385421753,
0.37740302085876465,
0.21425646543502808,
-0.35159140825271606,
0.002625107765197754,
-0.22908002138137817,
0.420737624168396,
-0.3914269208908081,
0.1481291949748993,
0.16586580872535706,
-0.11029859632253647,
0.060873616486787796,
0.3707968294620514,
0.18954689800739288,
-0.21172161400318146,
0.17728830873966217,
-0.43558192253112793,
-0.05445905029773712,
0.4014973044395447,
-0.23180708289146423,
-0.021581605076789856,
0.5051809549331665,
0.17413538694381714,
0.020044520497322083,
-0.15647566318511963,
-0.2798447906970978,
0.2047216296195984,
-0.04424840211868286,
0.09171046316623688,
0.3787393867969513,
-0.15282294154167175,
0.17503759264945984,
0.1801518052816391,
0.15004710853099823,
0.2598145604133606,
0.07804537564516068,
-0.1108713299036026,
-0.05083814635872841,
0.0741894543170929,
0.04354808107018471,
0.2666358947753906,
-0.1173529177904129,
-0.04297483712434769,
-0.2918795347213745,
-0.0614822693169117,
0.0847870409488678,
0.09422503411769867,
-0.19989259541034698,
0.043434254825115204,
0.4416302442550659,
-0.017980754375457764,
-0.00846833735704422,
0.0936708152294159,
-0.15071329474449158,
-0.03702670335769653,
-0.036776602268218994,
-0.003534260904416442,
-0.360785573720932,
0.042213574051856995,
0.10087853670120239,
0.310473769903183,
0.07996118813753128,
-0.04534416273236275,
0.38723933696746826,
-0.13583886623382568,
0.062409721314907074,
0.1783066987991333,
0.48660868406295776,
0.24026572704315186,
0.08309144526720047,
-0.19391180574893951,
0.2908010482788086,
0.08038543909788132,
-0.3014996647834778,
-0.16011452674865723,
0.19678619503974915,
0.3266863524913788,
0.16219529509544373,
0.2776813507080078,
0.11590345203876495,
0.18691939115524292,
-0.2710854709148407,
0.08541136980056763,
0.44702982902526855,
0.06388489156961441,
0.16394956409931183,
0.0839596837759018,
-0.060318723320961,
-0.04282628744840622,
0.14711418747901917,
0.16866344213485718,
0.1388208419084549,
0.2380208820104599,
-0.08630967885255814,
0.04701230674982071,
0.11994391679763794,
-0.038249652832746506,
0.17654800415039062,
-0.33754265308380127,
0.13054609298706055,
0.11013396084308624,
0.2258099466562271,
-0.023585986346006393,
-0.005128789693117142,
0.39979514479637146,
0.2657366693019867,
-0.14418570697307587,
-0.2427893579006195,
0.2887210547924042,
-0.16075743734836578,
-0.047337356954813004,
0.16876649856567383,
-0.23207923769950867,
-0.11525672674179077,
-0.05090245231986046,
-0.18779151141643524,
-0.023482035845518112,
0.07682802528142929,
-0.02623225376009941,
0.3115014433860779,
-0.33180370926856995,
-0.06646447628736496,
-0.027238165959715843,
0.31528085470199585,
-0.1311650425195694,
0.2724405527114868,
0.13928985595703125,
-0.36486461758613586,
0.13467589020729065,
0.2744894027709961,
0.5965859889984131,
0.2164677530527115,
-0.11494973301887512,
-0.05759773403406143,
-0.31083670258522034,
-0.13155889511108398,
0.18677058815956116,
0.07129751145839691,
0.18611417710781097,
0.47037971019744873,
0.40274327993392944,
0.1273161917924881,
0.04153133183717728,
-0.3296956419944763,
0.0058267321437597275,
0.2159140706062317,
-0.21139472723007202,
0.14371562004089355,
-0.13591676950454712,
0.09227066487073898,
-0.15669949352741241,
-0.058654818683862686,
-0.43180030584335327,
-0.4557279646396637,
-0.1574457734823227,
0.05842245742678642,
0.12081960588693619,
-0.11879095435142517,
0.0824909433722496,
0.3132113814353943,
0.43742692470550537,
0.3032170832157135,
-0.04457304626703262,
-0.12881413102149963,
-0.14282426238059998,
-0.5084798336029053,
0.049753542989492416,
-0.1661849319934845,
-0.226470485329628,
0.4137077033519745,
0.2573765516281128,
0.18270227313041687,
0.18920999765396118,
-0.19281329214572906,
0.31290143728256226,
-0.23681403696537018,
0.15212537348270416,
-0.11407220363616943,
-0.20943593978881836,
0.005846225656569004,
-0.3120182752609253,
-0.02526034042239189,
0.2024112045764923,
0.2185799479484558,
-0.07268483191728592,
0.03043949604034424,
-0.015098392963409424,
0.1416952908039093,
-0.3610880970954895,
-0.28920018672943115,
-0.1019616574048996,
0.22302132844924927,
0.1745631843805313,
0.04900035262107849,
-0.07820279151201248,
-0.17177166044712067,
-0.18933190405368805,
-0.23088882863521576,
0.5810200572013855,
-0.11861994862556458,
0.29229021072387695,
-0.305107980966568,
-0.2905067503452301,
-0.11792607605457306,
0.07087436318397522,
-0.04611311852931976,
-0.05421169847249985,
-0.24019373953342438,
0.18587009608745575,
0.16082878410816193,
-0.08625855296850204,
-0.08565138280391693,
0.191035658121109,
0.1209009662270546,
0.25492897629737854,
0.0780114233493805,
-0.48965519666671753,
0.4284687042236328,
-0.4832099676132202,
-0.2350735366344452,
0.16522657871246338,
0.009573161602020264,
0.39178329706192017,
-0.012847625650465488,
-0.38523703813552856,
-0.02024843543767929,
0.1411222666501999,
0.06605831533670425,
0.02197563648223877,
-0.03927989676594734,
-0.04531735181808472,
-0.18241041898727417,
-0.2932910919189453,
0.21277183294296265,
0.07405507564544678,
0.1467665731906891,
0.14264404773712158,
-0.24928566813468933
] |
https://github.com/huggingface/datasets/issues/5706 | I think the easiest for now would be to add a `dictionary_decode` argument to the parquet loaders that would convert the dictionary type back to strings when set to `True`, and make `dictionary_decode=False` raise `NotImplementedError` for now if there are dictionary type columns. Would that be ok as a first step ? | Support categorical data types for Parquet | ### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first. | 52 | Support categorical data types for Parquet
### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first.
I think the easiest for now would be to add a `dictionary_decode` argument to the parquet loaders that would convert the dictionary type back to strings when set to `True`, and make `dictionary_decode=False` raise `NotImplementedError` for now if there are dictionary type columns. Would that be ok as a first step ? | [
-0.152938574552536,
-0.06370358169078827,
0.07160879671573639,
0.32455649971961975,
0.4551955461502075,
0.06469179689884186,
-0.1901731789112091,
0.22342005372047424,
0.203786700963974,
-0.2283174693584442,
-0.11718685179948807,
0.5124905109405518,
-0.2902349531650543,
0.44914382696151733,
-0.020855922251939774,
-0.2356620728969574,
0.11446522921323776,
-0.05483004450798035,
0.0671464204788208,
0.21519631147384644,
-0.2553243339061737,
0.37052780389785767,
0.021052315831184387,
0.17270562052726746,
-0.005001053214073181,
-0.20741158723831177,
-0.17676939070224762,
0.1230643093585968,
-0.4154319167137146,
-0.648801326751709,
0.38270604610443115,
-0.06258346140384674,
0.07781172543764114,
0.16082338988780975,
-0.00011092540808022022,
0.20099994540214539,
0.22811582684516907,
-0.05094720423221588,
0.07525114715099335,
-0.6103057861328125,
0.25767678022384644,
-0.3289322257041931,
0.5521793961524963,
-0.21667873859405518,
-0.28450876474380493,
-0.5699324011802673,
-0.0010316865518689156,
-0.050077129155397415,
0.13149625062942505,
0.24128347635269165,
0.2137584686279297,
0.12009842693805695,
0.3107171058654785,
-0.026749245822429657,
0.29283881187438965,
0.2815583050251007,
-0.26439225673675537,
0.1390400528907776,
0.19724245369434357,
-0.03920833021402359,
0.10887692123651505,
-0.047020141035318375,
0.07511953264474869,
-0.12355630099773407,
0.26804596185684204,
0.19692714512348175,
0.2707127332687378,
-0.16132812201976776,
-0.1130475103855133,
0.15778645873069763,
0.23117531836032867,
-0.348167359828949,
-0.3780864179134369,
-0.34970414638519287,
-0.08686838299036026,
-0.23116783797740936,
0.3346812129020691,
0.3381064832210541,
-0.03735218942165375,
0.07614102214574814,
0.2864310145378113,
0.10737806558609009,
-0.1368553787469864,
0.15590734779834747,
-0.20811225473880768,
0.051938969641923904,
-0.22799769043922424,
-0.04494556412100792,
0.35474693775177,
-0.27781617641448975,
-0.22969049215316772,
0.05305665358901024,
-0.1878403127193451,
0.0989813357591629,
-0.2532532215118408,
-0.1310701221227646,
-0.18735121190547943,
0.43419149518013,
0.24213898181915283,
-0.08589248359203339,
0.1634422093629837,
-0.06389711052179337,
0.1353231519460678,
0.29720693826675415,
0.47173649072647095,
-0.17446671426296234,
0.038373105227947235,
0.04406629130244255,
-0.26854804158210754,
0.3720489740371704,
0.1295095980167389,
-0.2310546636581421,
0.026296399533748627,
-0.21925373375415802,
-0.208120658993721,
-0.1931491196155548,
0.5561254620552063,
-0.0638805404305458,
-0.1691259890794754,
0.1650553047657013,
0.11396956443786621,
0.18829651176929474,
0.10086981952190399,
0.3479073643684387,
-0.022937806323170662,
0.02642764523625374,
-0.10813335329294205,
0.4272960424423218,
-0.06958991289138794,
-0.26751598715782166,
-0.052012547850608826,
0.18189457058906555,
-0.12289297580718994,
-0.34406009316444397,
0.051090121269226074,
-0.13396772742271423,
-0.016252990812063217,
0.24607893824577332,
0.016065379604697227,
0.11210143566131592,
-0.20609289407730103,
-0.24143250286579132,
-0.099113829433918,
0.210547536611557,
-0.1118248701095581,
-0.042394645512104034,
0.44341424107551575,
-0.5455547571182251,
-0.29060906171798706,
-0.06072327122092247,
-0.17885178327560425,
-0.13254398107528687,
-0.26276135444641113,
0.11716574430465698,
0.04377703368663788,
-0.10584572702646255,
-0.6395193934440613,
0.4424750804901123,
-0.1372944712638855,
-0.1937583088874817,
-0.05611115321516991,
-0.07101194560527802,
-0.1416284441947937,
-0.25209540128707886,
0.052349187433719635,
0.22650232911109924,
-0.42769789695739746,
0.02059689164161682,
0.01941388100385666,
-0.23541375994682312,
0.3803633153438568,
0.3180568814277649,
-0.02763085812330246,
-0.4074193239212036,
-0.03246611729264259,
0.22595669329166412,
0.3833453953266144,
-0.034665364772081375,
0.029156766831874847,
0.10229064524173737,
0.11098361760377884,
0.31626445055007935,
0.18920253217220306,
-0.3239975571632385,
0.50709068775177,
-0.013011213392019272,
-0.02620040625333786,
0.04411611706018448,
-0.20981580018997192,
-0.06783615797758102,
-0.3061771094799042,
-0.14404937624931335,
0.4953615367412567,
0.14524048566818237,
-0.2497681975364685,
-0.10603898763656616,
0.2180664986371994,
-0.26237770915031433,
0.14679385721683502,
-0.031239736825227737,
-0.030373938381671906,
-0.023333575576543808,
0.2688630521297455,
0.6133161187171936,
0.08784923702478409,
-0.3044065237045288,
-0.3224829435348511,
0.2282199114561081,
0.052213676273822784,
0.06213083863258362,
-0.24143855273723602,
-0.30301064252853394,
-0.14496557414531708,
0.1378384530544281,
-0.09390182793140411,
-0.01944703608751297,
0.1721343994140625,
-0.08013330399990082,
0.021914541721343994,
0.29322192072868347,
-0.18580783903598785,
0.22619204223155975,
-0.21847137808799744,
0.2586442530155182,
-0.06182252988219261,
0.18199323117733002,
-0.10379088670015335,
-0.3180977702140808,
0.07615016400814056,
0.21751287579536438,
0.07291470468044281,
-0.10771507024765015,
0.2687312066555023,
0.2809019088745117,
0.2731555104255676,
0.027974411845207214,
-0.09046827256679535,
0.16220802068710327,
0.14152175188064575,
-0.05531177297234535,
-0.1670624315738678,
-0.12894617021083832,
0.1957995593547821,
0.12024074047803879,
-0.05643313378095627,
0.39094457030296326,
-0.035749807953834534,
0.023572636768221855,
-0.11664607375860214,
0.17691445350646973,
0.24842453002929688,
0.32303303480148315,
-0.23134571313858032,
-0.12353555858135223,
0.2530020475387573,
-0.0045946817845106125,
-0.1921282559633255,
-0.07039051502943039,
-0.5973890423774719,
0.01568268984556198,
0.3798612952232361,
0.11977086216211319,
0.1029573604464531,
0.04136619344353676,
0.2032211422920227,
0.08613710105419159,
-0.04918786138296127,
0.27293264865875244,
0.0384262353181839,
0.2379569262266159,
-0.12969478964805603,
0.08426417410373688,
-0.22460967302322388,
0.058242786675691605,
0.2596370577812195,
0.17151939868927002,
-0.05381207540631294,
-0.21425727009773254,
0.2914349436759949,
0.06249687820672989,
-0.37361446022987366,
0.14000560343265533,
0.06541142612695694,
0.10063115507364273,
-0.42535924911499023,
0.10444281250238419,
-0.3702431321144104,
-0.05711374431848526,
-0.13888244330883026,
-0.00012029334902763367,
-0.23791804909706116,
-0.20550847053527832,
-0.10111063718795776,
0.12339800596237183,
-0.09335972368717194,
-0.04076502472162247,
-0.1659088134765625,
0.18208682537078857,
-0.027358591556549072,
-0.12820883095264435,
-0.262002170085907,
-0.36206701397895813,
-0.12342662364244461,
0.09313923120498657,
0.15297982096672058,
-0.14776605367660522,
0.35018548369407654,
-0.042704418301582336,
0.027697138488292694,
-0.25959527492523193,
-0.4133831858634949,
-0.023066453635692596,
-0.39364928007125854,
0.1958536058664322,
0.22667653858661652,
0.09073315560817719,
-0.2696143388748169,
-0.28969186544418335,
0.47491422295570374,
-0.056450508534908295,
-0.20800185203552246,
0.22151446342468262,
-0.0034103170037269592,
-0.0970926433801651,
-0.10649419575929642,
-0.10217826068401337,
-0.29842817783355713,
-0.2879944145679474,
0.4497191607952118,
0.1444402039051056,
-0.034513913094997406,
-0.1965426504611969,
-0.0278362687677145,
-0.01861807331442833,
-0.527838945388794,
0.06636419147253036,
-0.040320198982954025,
-0.002724006772041321,
0.32798123359680176,
-0.1422857940196991,
-0.38700562715530396,
0.19021424651145935,
-0.00631202757358551,
0.18691426515579224,
-0.003984272480010986,
-0.20849883556365967,
-0.08707308024168015,
-0.10268814861774445,
0.19811725616455078,
-0.037180427461862564,
-0.14256322383880615,
0.3516176640987396,
0.06691202521324158,
-0.024691686034202576,
-0.07317157089710236,
-0.06056349724531174,
-0.004815500229597092,
0.184244766831398,
-0.05091938003897667,
-0.04849030077457428,
0.6205022931098938,
0.2456151247024536,
0.17862682044506073,
-0.05995325744152069,
0.14099034667015076,
0.6188872456550598,
-0.32015615701675415,
0.39276546239852905,
-0.04005168378353119,
-0.2920130491256714,
-0.08307938277721405,
-0.25417888164520264,
0.26055699586868286,
0.117622971534729,
-0.05621738359332085,
-0.1948554515838623,
-0.11590456962585449,
-0.07275794446468353,
-0.2815675735473633,
-0.2757439613342285,
-0.057677969336509705,
-0.035767700523138046,
0.06650535762310028,
-0.12679755687713623,
-0.12256654351949692,
-0.010229043662548065,
-0.13874486088752747,
0.07516616582870483,
0.44735440611839294,
-0.061268918216228485,
0.19017724692821503,
0.01140981912612915,
-0.03884042054414749,
-0.45768457651138306,
0.1959451138973236,
-0.07473284751176834,
0.04759768769145012,
-0.07114357501268387,
0.0807332843542099,
0.0882553905248642,
-0.06675455719232559,
0.718495786190033,
0.22504828870296478,
-0.06621228158473969,
-0.024248193949460983,
-0.33991539478302,
-0.8340396285057068,
-0.013831473886966705,
-0.27823197841644287,
-0.057074785232543945,
0.04007493332028389,
0.17242532968521118,
-0.49052464962005615,
-0.09912491589784622,
-0.18934789299964905,
-0.16268613934516907,
0.06819130480289459,
0.16527393460273743,
-0.3242438733577728,
-0.11752858757972717,
-0.23418593406677246,
0.10246653854846954,
0.3930708169937134,
0.4166416823863983,
0.07237891107797623,
0.18640689551830292,
-0.25309085845947266,
-0.06964681297540665,
0.05651126429438591,
0.04648076742887497,
0.4361877143383026,
-0.16080568730831146,
0.055259376764297485,
0.07910327613353729,
0.3671548664569855,
-0.0054856762290000916,
0.6376227140426636,
0.18200403451919556,
-0.8556132316589355,
0.09358629584312439,
0.07778027653694153,
0.1841108500957489,
-0.11737856268882751,
-0.21510514616966248,
0.132696270942688,
-0.2387053519487381,
0.023384831845760345,
-0.39083680510520935,
-0.007381375879049301,
0.4942101836204529,
-0.1826823353767395,
-0.05021054670214653,
-0.30054232478141785,
0.4798077940940857,
0.05160748213529587,
0.16309425234794617,
0.006000073626637459,
1.0382771492004395,
-0.07405431568622589,
0.5716263055801392,
0.19556033611297607,
0.5652731657028198,
-0.2233593612909317,
0.13003714382648468,
0.4695199131965637,
-0.43532776832580566,
0.6631953716278076,
-0.20386216044425964,
0.1119074821472168,
-0.19924727082252502,
0.14236706495285034,
-0.12076494097709656,
-0.0540260449051857,
0.35178524255752563,
0.17814071476459503,
-0.3683437705039978,
0.013651318848133087,
-0.06607756018638611,
-0.1214323490858078,
-0.18642890453338623,
0.09076545387506485,
-0.2680352032184601,
-0.04683420807123184,
-0.5542470812797546,
0.1113433986902237,
-0.04513793811202049,
-0.22735461592674255,
0.08390355855226517,
-0.08016453683376312,
-0.04552546143531799,
-0.16013798117637634,
-0.3407999873161316,
-0.12523427605628967,
-0.2388758808374405,
-0.058940693736076355,
0.2853381633758545,
-0.08259396255016327,
0.46309414505958557,
0.41096872091293335,
0.20715627074241638,
-0.15141089260578156,
-0.27755090594291687,
-0.09449218958616257,
-0.011212252080440521,
-0.28136682510375977,
-0.09983998537063599,
-0.07942645251750946,
0.14180442690849304,
-0.024740781635046005,
0.07766857743263245,
-0.17458173632621765,
-0.019267994910478592,
0.06438839435577393,
-0.008225589990615845,
0.15524323284626007,
-0.07160738110542297,
-0.4612441956996918,
-0.20946843922138214,
-0.5635542869567871,
0.19257597625255585,
-0.03703829646110535,
0.09621217846870422,
0.10231173038482666,
0.06616123020648956,
-0.21871308982372284,
0.020441005006432533,
-0.07168574631214142,
-0.06777378916740417,
0.10968833416700363,
-0.2659640610218048,
0.42996281385421753,
0.37740302085876465,
0.21425646543502808,
-0.35159140825271606,
0.002625107765197754,
-0.22908002138137817,
0.420737624168396,
-0.3914269208908081,
0.1481291949748993,
0.16586580872535706,
-0.11029859632253647,
0.060873616486787796,
0.3707968294620514,
0.18954689800739288,
-0.21172161400318146,
0.17728830873966217,
-0.43558192253112793,
-0.05445905029773712,
0.4014973044395447,
-0.23180708289146423,
-0.021581605076789856,
0.5051809549331665,
0.17413538694381714,
0.020044520497322083,
-0.15647566318511963,
-0.2798447906970978,
0.2047216296195984,
-0.04424840211868286,
0.09171046316623688,
0.3787393867969513,
-0.15282294154167175,
0.17503759264945984,
0.1801518052816391,
0.15004710853099823,
0.2598145604133606,
0.07804537564516068,
-0.1108713299036026,
-0.05083814635872841,
0.0741894543170929,
0.04354808107018471,
0.2666358947753906,
-0.1173529177904129,
-0.04297483712434769,
-0.2918795347213745,
-0.0614822693169117,
0.0847870409488678,
0.09422503411769867,
-0.19989259541034698,
0.043434254825115204,
0.4416302442550659,
-0.017980754375457764,
-0.00846833735704422,
0.0936708152294159,
-0.15071329474449158,
-0.03702670335769653,
-0.036776602268218994,
-0.003534260904416442,
-0.360785573720932,
0.042213574051856995,
0.10087853670120239,
0.310473769903183,
0.07996118813753128,
-0.04534416273236275,
0.38723933696746826,
-0.13583886623382568,
0.062409721314907074,
0.1783066987991333,
0.48660868406295776,
0.24026572704315186,
0.08309144526720047,
-0.19391180574893951,
0.2908010482788086,
0.08038543909788132,
-0.3014996647834778,
-0.16011452674865723,
0.19678619503974915,
0.3266863524913788,
0.16219529509544373,
0.2776813507080078,
0.11590345203876495,
0.18691939115524292,
-0.2710854709148407,
0.08541136980056763,
0.44702982902526855,
0.06388489156961441,
0.16394956409931183,
0.0839596837759018,
-0.060318723320961,
-0.04282628744840622,
0.14711418747901917,
0.16866344213485718,
0.1388208419084549,
0.2380208820104599,
-0.08630967885255814,
0.04701230674982071,
0.11994391679763794,
-0.038249652832746506,
0.17654800415039062,
-0.33754265308380127,
0.13054609298706055,
0.11013396084308624,
0.2258099466562271,
-0.023585986346006393,
-0.005128789693117142,
0.39979514479637146,
0.2657366693019867,
-0.14418570697307587,
-0.2427893579006195,
0.2887210547924042,
-0.16075743734836578,
-0.047337356954813004,
0.16876649856567383,
-0.23207923769950867,
-0.11525672674179077,
-0.05090245231986046,
-0.18779151141643524,
-0.023482035845518112,
0.07682802528142929,
-0.02623225376009941,
0.3115014433860779,
-0.33180370926856995,
-0.06646447628736496,
-0.027238165959715843,
0.31528085470199585,
-0.1311650425195694,
0.2724405527114868,
0.13928985595703125,
-0.36486461758613586,
0.13467589020729065,
0.2744894027709961,
0.5965859889984131,
0.2164677530527115,
-0.11494973301887512,
-0.05759773403406143,
-0.31083670258522034,
-0.13155889511108398,
0.18677058815956116,
0.07129751145839691,
0.18611417710781097,
0.47037971019744873,
0.40274327993392944,
0.1273161917924881,
0.04153133183717728,
-0.3296956419944763,
0.0058267321437597275,
0.2159140706062317,
-0.21139472723007202,
0.14371562004089355,
-0.13591676950454712,
0.09227066487073898,
-0.15669949352741241,
-0.058654818683862686,
-0.43180030584335327,
-0.4557279646396637,
-0.1574457734823227,
0.05842245742678642,
0.12081960588693619,
-0.11879095435142517,
0.0824909433722496,
0.3132113814353943,
0.43742692470550537,
0.3032170832157135,
-0.04457304626703262,
-0.12881413102149963,
-0.14282426238059998,
-0.5084798336029053,
0.049753542989492416,
-0.1661849319934845,
-0.226470485329628,
0.4137077033519745,
0.2573765516281128,
0.18270227313041687,
0.18920999765396118,
-0.19281329214572906,
0.31290143728256226,
-0.23681403696537018,
0.15212537348270416,
-0.11407220363616943,
-0.20943593978881836,
0.005846225656569004,
-0.3120182752609253,
-0.02526034042239189,
0.2024112045764923,
0.2185799479484558,
-0.07268483191728592,
0.03043949604034424,
-0.015098392963409424,
0.1416952908039093,
-0.3610880970954895,
-0.28920018672943115,
-0.1019616574048996,
0.22302132844924927,
0.1745631843805313,
0.04900035262107849,
-0.07820279151201248,
-0.17177166044712067,
-0.18933190405368805,
-0.23088882863521576,
0.5810200572013855,
-0.11861994862556458,
0.29229021072387695,
-0.305107980966568,
-0.2905067503452301,
-0.11792607605457306,
0.07087436318397522,
-0.04611311852931976,
-0.05421169847249985,
-0.24019373953342438,
0.18587009608745575,
0.16082878410816193,
-0.08625855296850204,
-0.08565138280391693,
0.191035658121109,
0.1209009662270546,
0.25492897629737854,
0.0780114233493805,
-0.48965519666671753,
0.4284687042236328,
-0.4832099676132202,
-0.2350735366344452,
0.16522657871246338,
0.009573161602020264,
0.39178329706192017,
-0.012847625650465488,
-0.38523703813552856,
-0.02024843543767929,
0.1411222666501999,
0.06605831533670425,
0.02197563648223877,
-0.03927989676594734,
-0.04531735181808472,
-0.18241041898727417,
-0.2932910919189453,
0.21277183294296265,
0.07405507564544678,
0.1467665731906891,
0.14264404773712158,
-0.24928566813468933
] |
https://github.com/huggingface/datasets/issues/5706 | I mean, that would certainly be easiest but I don't think it really solves this issue in a meaningful way. This just changes the burden from string conversion from the user to HF Datasets, but doesn't actually enable HF Datasets to take advantage of the (very significant) storage and associated speed/memory savings offered by using categorical types. Given that those savings are what is of real interest here, I think keeping it explicit that it is not supported (and forcing the user to do the conversion) might actually be better that way this problem stays top of mind.
Is there an objection with supporting categorical types explicitly through the medium I outlined above, where the error is raised if you try to concat two differently typed categorical columns? | Support categorical data types for Parquet | ### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first. | 128 | Support categorical data types for Parquet
### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first.
I mean, that would certainly be easiest but I don't think it really solves this issue in a meaningful way. This just changes the burden from string conversion from the user to HF Datasets, but doesn't actually enable HF Datasets to take advantage of the (very significant) storage and associated speed/memory savings offered by using categorical types. Given that those savings are what is of real interest here, I think keeping it explicit that it is not supported (and forcing the user to do the conversion) might actually be better that way this problem stays top of mind.
Is there an objection with supporting categorical types explicitly through the medium I outlined above, where the error is raised if you try to concat two differently typed categorical columns? | [
-0.152938574552536,
-0.06370358169078827,
0.07160879671573639,
0.32455649971961975,
0.4551955461502075,
0.06469179689884186,
-0.1901731789112091,
0.22342005372047424,
0.203786700963974,
-0.2283174693584442,
-0.11718685179948807,
0.5124905109405518,
-0.2902349531650543,
0.44914382696151733,
-0.020855922251939774,
-0.2356620728969574,
0.11446522921323776,
-0.05483004450798035,
0.0671464204788208,
0.21519631147384644,
-0.2553243339061737,
0.37052780389785767,
0.021052315831184387,
0.17270562052726746,
-0.005001053214073181,
-0.20741158723831177,
-0.17676939070224762,
0.1230643093585968,
-0.4154319167137146,
-0.648801326751709,
0.38270604610443115,
-0.06258346140384674,
0.07781172543764114,
0.16082338988780975,
-0.00011092540808022022,
0.20099994540214539,
0.22811582684516907,
-0.05094720423221588,
0.07525114715099335,
-0.6103057861328125,
0.25767678022384644,
-0.3289322257041931,
0.5521793961524963,
-0.21667873859405518,
-0.28450876474380493,
-0.5699324011802673,
-0.0010316865518689156,
-0.050077129155397415,
0.13149625062942505,
0.24128347635269165,
0.2137584686279297,
0.12009842693805695,
0.3107171058654785,
-0.026749245822429657,
0.29283881187438965,
0.2815583050251007,
-0.26439225673675537,
0.1390400528907776,
0.19724245369434357,
-0.03920833021402359,
0.10887692123651505,
-0.047020141035318375,
0.07511953264474869,
-0.12355630099773407,
0.26804596185684204,
0.19692714512348175,
0.2707127332687378,
-0.16132812201976776,
-0.1130475103855133,
0.15778645873069763,
0.23117531836032867,
-0.348167359828949,
-0.3780864179134369,
-0.34970414638519287,
-0.08686838299036026,
-0.23116783797740936,
0.3346812129020691,
0.3381064832210541,
-0.03735218942165375,
0.07614102214574814,
0.2864310145378113,
0.10737806558609009,
-0.1368553787469864,
0.15590734779834747,
-0.20811225473880768,
0.051938969641923904,
-0.22799769043922424,
-0.04494556412100792,
0.35474693775177,
-0.27781617641448975,
-0.22969049215316772,
0.05305665358901024,
-0.1878403127193451,
0.0989813357591629,
-0.2532532215118408,
-0.1310701221227646,
-0.18735121190547943,
0.43419149518013,
0.24213898181915283,
-0.08589248359203339,
0.1634422093629837,
-0.06389711052179337,
0.1353231519460678,
0.29720693826675415,
0.47173649072647095,
-0.17446671426296234,
0.038373105227947235,
0.04406629130244255,
-0.26854804158210754,
0.3720489740371704,
0.1295095980167389,
-0.2310546636581421,
0.026296399533748627,
-0.21925373375415802,
-0.208120658993721,
-0.1931491196155548,
0.5561254620552063,
-0.0638805404305458,
-0.1691259890794754,
0.1650553047657013,
0.11396956443786621,
0.18829651176929474,
0.10086981952190399,
0.3479073643684387,
-0.022937806323170662,
0.02642764523625374,
-0.10813335329294205,
0.4272960424423218,
-0.06958991289138794,
-0.26751598715782166,
-0.052012547850608826,
0.18189457058906555,
-0.12289297580718994,
-0.34406009316444397,
0.051090121269226074,
-0.13396772742271423,
-0.016252990812063217,
0.24607893824577332,
0.016065379604697227,
0.11210143566131592,
-0.20609289407730103,
-0.24143250286579132,
-0.099113829433918,
0.210547536611557,
-0.1118248701095581,
-0.042394645512104034,
0.44341424107551575,
-0.5455547571182251,
-0.29060906171798706,
-0.06072327122092247,
-0.17885178327560425,
-0.13254398107528687,
-0.26276135444641113,
0.11716574430465698,
0.04377703368663788,
-0.10584572702646255,
-0.6395193934440613,
0.4424750804901123,
-0.1372944712638855,
-0.1937583088874817,
-0.05611115321516991,
-0.07101194560527802,
-0.1416284441947937,
-0.25209540128707886,
0.052349187433719635,
0.22650232911109924,
-0.42769789695739746,
0.02059689164161682,
0.01941388100385666,
-0.23541375994682312,
0.3803633153438568,
0.3180568814277649,
-0.02763085812330246,
-0.4074193239212036,
-0.03246611729264259,
0.22595669329166412,
0.3833453953266144,
-0.034665364772081375,
0.029156766831874847,
0.10229064524173737,
0.11098361760377884,
0.31626445055007935,
0.18920253217220306,
-0.3239975571632385,
0.50709068775177,
-0.013011213392019272,
-0.02620040625333786,
0.04411611706018448,
-0.20981580018997192,
-0.06783615797758102,
-0.3061771094799042,
-0.14404937624931335,
0.4953615367412567,
0.14524048566818237,
-0.2497681975364685,
-0.10603898763656616,
0.2180664986371994,
-0.26237770915031433,
0.14679385721683502,
-0.031239736825227737,
-0.030373938381671906,
-0.023333575576543808,
0.2688630521297455,
0.6133161187171936,
0.08784923702478409,
-0.3044065237045288,
-0.3224829435348511,
0.2282199114561081,
0.052213676273822784,
0.06213083863258362,
-0.24143855273723602,
-0.30301064252853394,
-0.14496557414531708,
0.1378384530544281,
-0.09390182793140411,
-0.01944703608751297,
0.1721343994140625,
-0.08013330399990082,
0.021914541721343994,
0.29322192072868347,
-0.18580783903598785,
0.22619204223155975,
-0.21847137808799744,
0.2586442530155182,
-0.06182252988219261,
0.18199323117733002,
-0.10379088670015335,
-0.3180977702140808,
0.07615016400814056,
0.21751287579536438,
0.07291470468044281,
-0.10771507024765015,
0.2687312066555023,
0.2809019088745117,
0.2731555104255676,
0.027974411845207214,
-0.09046827256679535,
0.16220802068710327,
0.14152175188064575,
-0.05531177297234535,
-0.1670624315738678,
-0.12894617021083832,
0.1957995593547821,
0.12024074047803879,
-0.05643313378095627,
0.39094457030296326,
-0.035749807953834534,
0.023572636768221855,
-0.11664607375860214,
0.17691445350646973,
0.24842453002929688,
0.32303303480148315,
-0.23134571313858032,
-0.12353555858135223,
0.2530020475387573,
-0.0045946817845106125,
-0.1921282559633255,
-0.07039051502943039,
-0.5973890423774719,
0.01568268984556198,
0.3798612952232361,
0.11977086216211319,
0.1029573604464531,
0.04136619344353676,
0.2032211422920227,
0.08613710105419159,
-0.04918786138296127,
0.27293264865875244,
0.0384262353181839,
0.2379569262266159,
-0.12969478964805603,
0.08426417410373688,
-0.22460967302322388,
0.058242786675691605,
0.2596370577812195,
0.17151939868927002,
-0.05381207540631294,
-0.21425727009773254,
0.2914349436759949,
0.06249687820672989,
-0.37361446022987366,
0.14000560343265533,
0.06541142612695694,
0.10063115507364273,
-0.42535924911499023,
0.10444281250238419,
-0.3702431321144104,
-0.05711374431848526,
-0.13888244330883026,
-0.00012029334902763367,
-0.23791804909706116,
-0.20550847053527832,
-0.10111063718795776,
0.12339800596237183,
-0.09335972368717194,
-0.04076502472162247,
-0.1659088134765625,
0.18208682537078857,
-0.027358591556549072,
-0.12820883095264435,
-0.262002170085907,
-0.36206701397895813,
-0.12342662364244461,
0.09313923120498657,
0.15297982096672058,
-0.14776605367660522,
0.35018548369407654,
-0.042704418301582336,
0.027697138488292694,
-0.25959527492523193,
-0.4133831858634949,
-0.023066453635692596,
-0.39364928007125854,
0.1958536058664322,
0.22667653858661652,
0.09073315560817719,
-0.2696143388748169,
-0.28969186544418335,
0.47491422295570374,
-0.056450508534908295,
-0.20800185203552246,
0.22151446342468262,
-0.0034103170037269592,
-0.0970926433801651,
-0.10649419575929642,
-0.10217826068401337,
-0.29842817783355713,
-0.2879944145679474,
0.4497191607952118,
0.1444402039051056,
-0.034513913094997406,
-0.1965426504611969,
-0.0278362687677145,
-0.01861807331442833,
-0.527838945388794,
0.06636419147253036,
-0.040320198982954025,
-0.002724006772041321,
0.32798123359680176,
-0.1422857940196991,
-0.38700562715530396,
0.19021424651145935,
-0.00631202757358551,
0.18691426515579224,
-0.003984272480010986,
-0.20849883556365967,
-0.08707308024168015,
-0.10268814861774445,
0.19811725616455078,
-0.037180427461862564,
-0.14256322383880615,
0.3516176640987396,
0.06691202521324158,
-0.024691686034202576,
-0.07317157089710236,
-0.06056349724531174,
-0.004815500229597092,
0.184244766831398,
-0.05091938003897667,
-0.04849030077457428,
0.6205022931098938,
0.2456151247024536,
0.17862682044506073,
-0.05995325744152069,
0.14099034667015076,
0.6188872456550598,
-0.32015615701675415,
0.39276546239852905,
-0.04005168378353119,
-0.2920130491256714,
-0.08307938277721405,
-0.25417888164520264,
0.26055699586868286,
0.117622971534729,
-0.05621738359332085,
-0.1948554515838623,
-0.11590456962585449,
-0.07275794446468353,
-0.2815675735473633,
-0.2757439613342285,
-0.057677969336509705,
-0.035767700523138046,
0.06650535762310028,
-0.12679755687713623,
-0.12256654351949692,
-0.010229043662548065,
-0.13874486088752747,
0.07516616582870483,
0.44735440611839294,
-0.061268918216228485,
0.19017724692821503,
0.01140981912612915,
-0.03884042054414749,
-0.45768457651138306,
0.1959451138973236,
-0.07473284751176834,
0.04759768769145012,
-0.07114357501268387,
0.0807332843542099,
0.0882553905248642,
-0.06675455719232559,
0.718495786190033,
0.22504828870296478,
-0.06621228158473969,
-0.024248193949460983,
-0.33991539478302,
-0.8340396285057068,
-0.013831473886966705,
-0.27823197841644287,
-0.057074785232543945,
0.04007493332028389,
0.17242532968521118,
-0.49052464962005615,
-0.09912491589784622,
-0.18934789299964905,
-0.16268613934516907,
0.06819130480289459,
0.16527393460273743,
-0.3242438733577728,
-0.11752858757972717,
-0.23418593406677246,
0.10246653854846954,
0.3930708169937134,
0.4166416823863983,
0.07237891107797623,
0.18640689551830292,
-0.25309085845947266,
-0.06964681297540665,
0.05651126429438591,
0.04648076742887497,
0.4361877143383026,
-0.16080568730831146,
0.055259376764297485,
0.07910327613353729,
0.3671548664569855,
-0.0054856762290000916,
0.6376227140426636,
0.18200403451919556,
-0.8556132316589355,
0.09358629584312439,
0.07778027653694153,
0.1841108500957489,
-0.11737856268882751,
-0.21510514616966248,
0.132696270942688,
-0.2387053519487381,
0.023384831845760345,
-0.39083680510520935,
-0.007381375879049301,
0.4942101836204529,
-0.1826823353767395,
-0.05021054670214653,
-0.30054232478141785,
0.4798077940940857,
0.05160748213529587,
0.16309425234794617,
0.006000073626637459,
1.0382771492004395,
-0.07405431568622589,
0.5716263055801392,
0.19556033611297607,
0.5652731657028198,
-0.2233593612909317,
0.13003714382648468,
0.4695199131965637,
-0.43532776832580566,
0.6631953716278076,
-0.20386216044425964,
0.1119074821472168,
-0.19924727082252502,
0.14236706495285034,
-0.12076494097709656,
-0.0540260449051857,
0.35178524255752563,
0.17814071476459503,
-0.3683437705039978,
0.013651318848133087,
-0.06607756018638611,
-0.1214323490858078,
-0.18642890453338623,
0.09076545387506485,
-0.2680352032184601,
-0.04683420807123184,
-0.5542470812797546,
0.1113433986902237,
-0.04513793811202049,
-0.22735461592674255,
0.08390355855226517,
-0.08016453683376312,
-0.04552546143531799,
-0.16013798117637634,
-0.3407999873161316,
-0.12523427605628967,
-0.2388758808374405,
-0.058940693736076355,
0.2853381633758545,
-0.08259396255016327,
0.46309414505958557,
0.41096872091293335,
0.20715627074241638,
-0.15141089260578156,
-0.27755090594291687,
-0.09449218958616257,
-0.011212252080440521,
-0.28136682510375977,
-0.09983998537063599,
-0.07942645251750946,
0.14180442690849304,
-0.024740781635046005,
0.07766857743263245,
-0.17458173632621765,
-0.019267994910478592,
0.06438839435577393,
-0.008225589990615845,
0.15524323284626007,
-0.07160738110542297,
-0.4612441956996918,
-0.20946843922138214,
-0.5635542869567871,
0.19257597625255585,
-0.03703829646110535,
0.09621217846870422,
0.10231173038482666,
0.06616123020648956,
-0.21871308982372284,
0.020441005006432533,
-0.07168574631214142,
-0.06777378916740417,
0.10968833416700363,
-0.2659640610218048,
0.42996281385421753,
0.37740302085876465,
0.21425646543502808,
-0.35159140825271606,
0.002625107765197754,
-0.22908002138137817,
0.420737624168396,
-0.3914269208908081,
0.1481291949748993,
0.16586580872535706,
-0.11029859632253647,
0.060873616486787796,
0.3707968294620514,
0.18954689800739288,
-0.21172161400318146,
0.17728830873966217,
-0.43558192253112793,
-0.05445905029773712,
0.4014973044395447,
-0.23180708289146423,
-0.021581605076789856,
0.5051809549331665,
0.17413538694381714,
0.020044520497322083,
-0.15647566318511963,
-0.2798447906970978,
0.2047216296195984,
-0.04424840211868286,
0.09171046316623688,
0.3787393867969513,
-0.15282294154167175,
0.17503759264945984,
0.1801518052816391,
0.15004710853099823,
0.2598145604133606,
0.07804537564516068,
-0.1108713299036026,
-0.05083814635872841,
0.0741894543170929,
0.04354808107018471,
0.2666358947753906,
-0.1173529177904129,
-0.04297483712434769,
-0.2918795347213745,
-0.0614822693169117,
0.0847870409488678,
0.09422503411769867,
-0.19989259541034698,
0.043434254825115204,
0.4416302442550659,
-0.017980754375457764,
-0.00846833735704422,
0.0936708152294159,
-0.15071329474449158,
-0.03702670335769653,
-0.036776602268218994,
-0.003534260904416442,
-0.360785573720932,
0.042213574051856995,
0.10087853670120239,
0.310473769903183,
0.07996118813753128,
-0.04534416273236275,
0.38723933696746826,
-0.13583886623382568,
0.062409721314907074,
0.1783066987991333,
0.48660868406295776,
0.24026572704315186,
0.08309144526720047,
-0.19391180574893951,
0.2908010482788086,
0.08038543909788132,
-0.3014996647834778,
-0.16011452674865723,
0.19678619503974915,
0.3266863524913788,
0.16219529509544373,
0.2776813507080078,
0.11590345203876495,
0.18691939115524292,
-0.2710854709148407,
0.08541136980056763,
0.44702982902526855,
0.06388489156961441,
0.16394956409931183,
0.0839596837759018,
-0.060318723320961,
-0.04282628744840622,
0.14711418747901917,
0.16866344213485718,
0.1388208419084549,
0.2380208820104599,
-0.08630967885255814,
0.04701230674982071,
0.11994391679763794,
-0.038249652832746506,
0.17654800415039062,
-0.33754265308380127,
0.13054609298706055,
0.11013396084308624,
0.2258099466562271,
-0.023585986346006393,
-0.005128789693117142,
0.39979514479637146,
0.2657366693019867,
-0.14418570697307587,
-0.2427893579006195,
0.2887210547924042,
-0.16075743734836578,
-0.047337356954813004,
0.16876649856567383,
-0.23207923769950867,
-0.11525672674179077,
-0.05090245231986046,
-0.18779151141643524,
-0.023482035845518112,
0.07682802528142929,
-0.02623225376009941,
0.3115014433860779,
-0.33180370926856995,
-0.06646447628736496,
-0.027238165959715843,
0.31528085470199585,
-0.1311650425195694,
0.2724405527114868,
0.13928985595703125,
-0.36486461758613586,
0.13467589020729065,
0.2744894027709961,
0.5965859889984131,
0.2164677530527115,
-0.11494973301887512,
-0.05759773403406143,
-0.31083670258522034,
-0.13155889511108398,
0.18677058815956116,
0.07129751145839691,
0.18611417710781097,
0.47037971019744873,
0.40274327993392944,
0.1273161917924881,
0.04153133183717728,
-0.3296956419944763,
0.0058267321437597275,
0.2159140706062317,
-0.21139472723007202,
0.14371562004089355,
-0.13591676950454712,
0.09227066487073898,
-0.15669949352741241,
-0.058654818683862686,
-0.43180030584335327,
-0.4557279646396637,
-0.1574457734823227,
0.05842245742678642,
0.12081960588693619,
-0.11879095435142517,
0.0824909433722496,
0.3132113814353943,
0.43742692470550537,
0.3032170832157135,
-0.04457304626703262,
-0.12881413102149963,
-0.14282426238059998,
-0.5084798336029053,
0.049753542989492416,
-0.1661849319934845,
-0.226470485329628,
0.4137077033519745,
0.2573765516281128,
0.18270227313041687,
0.18920999765396118,
-0.19281329214572906,
0.31290143728256226,
-0.23681403696537018,
0.15212537348270416,
-0.11407220363616943,
-0.20943593978881836,
0.005846225656569004,
-0.3120182752609253,
-0.02526034042239189,
0.2024112045764923,
0.2185799479484558,
-0.07268483191728592,
0.03043949604034424,
-0.015098392963409424,
0.1416952908039093,
-0.3610880970954895,
-0.28920018672943115,
-0.1019616574048996,
0.22302132844924927,
0.1745631843805313,
0.04900035262107849,
-0.07820279151201248,
-0.17177166044712067,
-0.18933190405368805,
-0.23088882863521576,
0.5810200572013855,
-0.11861994862556458,
0.29229021072387695,
-0.305107980966568,
-0.2905067503452301,
-0.11792607605457306,
0.07087436318397522,
-0.04611311852931976,
-0.05421169847249985,
-0.24019373953342438,
0.18587009608745575,
0.16082878410816193,
-0.08625855296850204,
-0.08565138280391693,
0.191035658121109,
0.1209009662270546,
0.25492897629737854,
0.0780114233493805,
-0.48965519666671753,
0.4284687042236328,
-0.4832099676132202,
-0.2350735366344452,
0.16522657871246338,
0.009573161602020264,
0.39178329706192017,
-0.012847625650465488,
-0.38523703813552856,
-0.02024843543767929,
0.1411222666501999,
0.06605831533670425,
0.02197563648223877,
-0.03927989676594734,
-0.04531735181808472,
-0.18241041898727417,
-0.2932910919189453,
0.21277183294296265,
0.07405507564544678,
0.1467665731906891,
0.14264404773712158,
-0.24928566813468933
] |
https://github.com/huggingface/datasets/issues/5706 | > This just changes the burden from string conversion from the user to HF Datasets, but doesn't actually enable HF Datasets to take advantage of the (very significant) storage and associated speed/memory savings offered by using categorical types.
There's already a ClassLabel type that does pretty much the same thing (store as integer instead of string) if it can help
> Is there an objection with supporting categorical types explicitly through the medium I outlined above, where the error is raised if you try to concat two differently typed categorical columns?
Yea we do concatenation quite often (e.g. in `map`) so I don't think this is a viable option | Support categorical data types for Parquet | ### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first. | 109 | Support categorical data types for Parquet
### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first.
> This just changes the burden from string conversion from the user to HF Datasets, but doesn't actually enable HF Datasets to take advantage of the (very significant) storage and associated speed/memory savings offered by using categorical types.
There's already a ClassLabel type that does pretty much the same thing (store as integer instead of string) if it can help
> Is there an objection with supporting categorical types explicitly through the medium I outlined above, where the error is raised if you try to concat two differently typed categorical columns?
Yea we do concatenation quite often (e.g. in `map`) so I don't think this is a viable option | [
-0.152938574552536,
-0.06370358169078827,
0.07160879671573639,
0.32455649971961975,
0.4551955461502075,
0.06469179689884186,
-0.1901731789112091,
0.22342005372047424,
0.203786700963974,
-0.2283174693584442,
-0.11718685179948807,
0.5124905109405518,
-0.2902349531650543,
0.44914382696151733,
-0.020855922251939774,
-0.2356620728969574,
0.11446522921323776,
-0.05483004450798035,
0.0671464204788208,
0.21519631147384644,
-0.2553243339061737,
0.37052780389785767,
0.021052315831184387,
0.17270562052726746,
-0.005001053214073181,
-0.20741158723831177,
-0.17676939070224762,
0.1230643093585968,
-0.4154319167137146,
-0.648801326751709,
0.38270604610443115,
-0.06258346140384674,
0.07781172543764114,
0.16082338988780975,
-0.00011092540808022022,
0.20099994540214539,
0.22811582684516907,
-0.05094720423221588,
0.07525114715099335,
-0.6103057861328125,
0.25767678022384644,
-0.3289322257041931,
0.5521793961524963,
-0.21667873859405518,
-0.28450876474380493,
-0.5699324011802673,
-0.0010316865518689156,
-0.050077129155397415,
0.13149625062942505,
0.24128347635269165,
0.2137584686279297,
0.12009842693805695,
0.3107171058654785,
-0.026749245822429657,
0.29283881187438965,
0.2815583050251007,
-0.26439225673675537,
0.1390400528907776,
0.19724245369434357,
-0.03920833021402359,
0.10887692123651505,
-0.047020141035318375,
0.07511953264474869,
-0.12355630099773407,
0.26804596185684204,
0.19692714512348175,
0.2707127332687378,
-0.16132812201976776,
-0.1130475103855133,
0.15778645873069763,
0.23117531836032867,
-0.348167359828949,
-0.3780864179134369,
-0.34970414638519287,
-0.08686838299036026,
-0.23116783797740936,
0.3346812129020691,
0.3381064832210541,
-0.03735218942165375,
0.07614102214574814,
0.2864310145378113,
0.10737806558609009,
-0.1368553787469864,
0.15590734779834747,
-0.20811225473880768,
0.051938969641923904,
-0.22799769043922424,
-0.04494556412100792,
0.35474693775177,
-0.27781617641448975,
-0.22969049215316772,
0.05305665358901024,
-0.1878403127193451,
0.0989813357591629,
-0.2532532215118408,
-0.1310701221227646,
-0.18735121190547943,
0.43419149518013,
0.24213898181915283,
-0.08589248359203339,
0.1634422093629837,
-0.06389711052179337,
0.1353231519460678,
0.29720693826675415,
0.47173649072647095,
-0.17446671426296234,
0.038373105227947235,
0.04406629130244255,
-0.26854804158210754,
0.3720489740371704,
0.1295095980167389,
-0.2310546636581421,
0.026296399533748627,
-0.21925373375415802,
-0.208120658993721,
-0.1931491196155548,
0.5561254620552063,
-0.0638805404305458,
-0.1691259890794754,
0.1650553047657013,
0.11396956443786621,
0.18829651176929474,
0.10086981952190399,
0.3479073643684387,
-0.022937806323170662,
0.02642764523625374,
-0.10813335329294205,
0.4272960424423218,
-0.06958991289138794,
-0.26751598715782166,
-0.052012547850608826,
0.18189457058906555,
-0.12289297580718994,
-0.34406009316444397,
0.051090121269226074,
-0.13396772742271423,
-0.016252990812063217,
0.24607893824577332,
0.016065379604697227,
0.11210143566131592,
-0.20609289407730103,
-0.24143250286579132,
-0.099113829433918,
0.210547536611557,
-0.1118248701095581,
-0.042394645512104034,
0.44341424107551575,
-0.5455547571182251,
-0.29060906171798706,
-0.06072327122092247,
-0.17885178327560425,
-0.13254398107528687,
-0.26276135444641113,
0.11716574430465698,
0.04377703368663788,
-0.10584572702646255,
-0.6395193934440613,
0.4424750804901123,
-0.1372944712638855,
-0.1937583088874817,
-0.05611115321516991,
-0.07101194560527802,
-0.1416284441947937,
-0.25209540128707886,
0.052349187433719635,
0.22650232911109924,
-0.42769789695739746,
0.02059689164161682,
0.01941388100385666,
-0.23541375994682312,
0.3803633153438568,
0.3180568814277649,
-0.02763085812330246,
-0.4074193239212036,
-0.03246611729264259,
0.22595669329166412,
0.3833453953266144,
-0.034665364772081375,
0.029156766831874847,
0.10229064524173737,
0.11098361760377884,
0.31626445055007935,
0.18920253217220306,
-0.3239975571632385,
0.50709068775177,
-0.013011213392019272,
-0.02620040625333786,
0.04411611706018448,
-0.20981580018997192,
-0.06783615797758102,
-0.3061771094799042,
-0.14404937624931335,
0.4953615367412567,
0.14524048566818237,
-0.2497681975364685,
-0.10603898763656616,
0.2180664986371994,
-0.26237770915031433,
0.14679385721683502,
-0.031239736825227737,
-0.030373938381671906,
-0.023333575576543808,
0.2688630521297455,
0.6133161187171936,
0.08784923702478409,
-0.3044065237045288,
-0.3224829435348511,
0.2282199114561081,
0.052213676273822784,
0.06213083863258362,
-0.24143855273723602,
-0.30301064252853394,
-0.14496557414531708,
0.1378384530544281,
-0.09390182793140411,
-0.01944703608751297,
0.1721343994140625,
-0.08013330399990082,
0.021914541721343994,
0.29322192072868347,
-0.18580783903598785,
0.22619204223155975,
-0.21847137808799744,
0.2586442530155182,
-0.06182252988219261,
0.18199323117733002,
-0.10379088670015335,
-0.3180977702140808,
0.07615016400814056,
0.21751287579536438,
0.07291470468044281,
-0.10771507024765015,
0.2687312066555023,
0.2809019088745117,
0.2731555104255676,
0.027974411845207214,
-0.09046827256679535,
0.16220802068710327,
0.14152175188064575,
-0.05531177297234535,
-0.1670624315738678,
-0.12894617021083832,
0.1957995593547821,
0.12024074047803879,
-0.05643313378095627,
0.39094457030296326,
-0.035749807953834534,
0.023572636768221855,
-0.11664607375860214,
0.17691445350646973,
0.24842453002929688,
0.32303303480148315,
-0.23134571313858032,
-0.12353555858135223,
0.2530020475387573,
-0.0045946817845106125,
-0.1921282559633255,
-0.07039051502943039,
-0.5973890423774719,
0.01568268984556198,
0.3798612952232361,
0.11977086216211319,
0.1029573604464531,
0.04136619344353676,
0.2032211422920227,
0.08613710105419159,
-0.04918786138296127,
0.27293264865875244,
0.0384262353181839,
0.2379569262266159,
-0.12969478964805603,
0.08426417410373688,
-0.22460967302322388,
0.058242786675691605,
0.2596370577812195,
0.17151939868927002,
-0.05381207540631294,
-0.21425727009773254,
0.2914349436759949,
0.06249687820672989,
-0.37361446022987366,
0.14000560343265533,
0.06541142612695694,
0.10063115507364273,
-0.42535924911499023,
0.10444281250238419,
-0.3702431321144104,
-0.05711374431848526,
-0.13888244330883026,
-0.00012029334902763367,
-0.23791804909706116,
-0.20550847053527832,
-0.10111063718795776,
0.12339800596237183,
-0.09335972368717194,
-0.04076502472162247,
-0.1659088134765625,
0.18208682537078857,
-0.027358591556549072,
-0.12820883095264435,
-0.262002170085907,
-0.36206701397895813,
-0.12342662364244461,
0.09313923120498657,
0.15297982096672058,
-0.14776605367660522,
0.35018548369407654,
-0.042704418301582336,
0.027697138488292694,
-0.25959527492523193,
-0.4133831858634949,
-0.023066453635692596,
-0.39364928007125854,
0.1958536058664322,
0.22667653858661652,
0.09073315560817719,
-0.2696143388748169,
-0.28969186544418335,
0.47491422295570374,
-0.056450508534908295,
-0.20800185203552246,
0.22151446342468262,
-0.0034103170037269592,
-0.0970926433801651,
-0.10649419575929642,
-0.10217826068401337,
-0.29842817783355713,
-0.2879944145679474,
0.4497191607952118,
0.1444402039051056,
-0.034513913094997406,
-0.1965426504611969,
-0.0278362687677145,
-0.01861807331442833,
-0.527838945388794,
0.06636419147253036,
-0.040320198982954025,
-0.002724006772041321,
0.32798123359680176,
-0.1422857940196991,
-0.38700562715530396,
0.19021424651145935,
-0.00631202757358551,
0.18691426515579224,
-0.003984272480010986,
-0.20849883556365967,
-0.08707308024168015,
-0.10268814861774445,
0.19811725616455078,
-0.037180427461862564,
-0.14256322383880615,
0.3516176640987396,
0.06691202521324158,
-0.024691686034202576,
-0.07317157089710236,
-0.06056349724531174,
-0.004815500229597092,
0.184244766831398,
-0.05091938003897667,
-0.04849030077457428,
0.6205022931098938,
0.2456151247024536,
0.17862682044506073,
-0.05995325744152069,
0.14099034667015076,
0.6188872456550598,
-0.32015615701675415,
0.39276546239852905,
-0.04005168378353119,
-0.2920130491256714,
-0.08307938277721405,
-0.25417888164520264,
0.26055699586868286,
0.117622971534729,
-0.05621738359332085,
-0.1948554515838623,
-0.11590456962585449,
-0.07275794446468353,
-0.2815675735473633,
-0.2757439613342285,
-0.057677969336509705,
-0.035767700523138046,
0.06650535762310028,
-0.12679755687713623,
-0.12256654351949692,
-0.010229043662548065,
-0.13874486088752747,
0.07516616582870483,
0.44735440611839294,
-0.061268918216228485,
0.19017724692821503,
0.01140981912612915,
-0.03884042054414749,
-0.45768457651138306,
0.1959451138973236,
-0.07473284751176834,
0.04759768769145012,
-0.07114357501268387,
0.0807332843542099,
0.0882553905248642,
-0.06675455719232559,
0.718495786190033,
0.22504828870296478,
-0.06621228158473969,
-0.024248193949460983,
-0.33991539478302,
-0.8340396285057068,
-0.013831473886966705,
-0.27823197841644287,
-0.057074785232543945,
0.04007493332028389,
0.17242532968521118,
-0.49052464962005615,
-0.09912491589784622,
-0.18934789299964905,
-0.16268613934516907,
0.06819130480289459,
0.16527393460273743,
-0.3242438733577728,
-0.11752858757972717,
-0.23418593406677246,
0.10246653854846954,
0.3930708169937134,
0.4166416823863983,
0.07237891107797623,
0.18640689551830292,
-0.25309085845947266,
-0.06964681297540665,
0.05651126429438591,
0.04648076742887497,
0.4361877143383026,
-0.16080568730831146,
0.055259376764297485,
0.07910327613353729,
0.3671548664569855,
-0.0054856762290000916,
0.6376227140426636,
0.18200403451919556,
-0.8556132316589355,
0.09358629584312439,
0.07778027653694153,
0.1841108500957489,
-0.11737856268882751,
-0.21510514616966248,
0.132696270942688,
-0.2387053519487381,
0.023384831845760345,
-0.39083680510520935,
-0.007381375879049301,
0.4942101836204529,
-0.1826823353767395,
-0.05021054670214653,
-0.30054232478141785,
0.4798077940940857,
0.05160748213529587,
0.16309425234794617,
0.006000073626637459,
1.0382771492004395,
-0.07405431568622589,
0.5716263055801392,
0.19556033611297607,
0.5652731657028198,
-0.2233593612909317,
0.13003714382648468,
0.4695199131965637,
-0.43532776832580566,
0.6631953716278076,
-0.20386216044425964,
0.1119074821472168,
-0.19924727082252502,
0.14236706495285034,
-0.12076494097709656,
-0.0540260449051857,
0.35178524255752563,
0.17814071476459503,
-0.3683437705039978,
0.013651318848133087,
-0.06607756018638611,
-0.1214323490858078,
-0.18642890453338623,
0.09076545387506485,
-0.2680352032184601,
-0.04683420807123184,
-0.5542470812797546,
0.1113433986902237,
-0.04513793811202049,
-0.22735461592674255,
0.08390355855226517,
-0.08016453683376312,
-0.04552546143531799,
-0.16013798117637634,
-0.3407999873161316,
-0.12523427605628967,
-0.2388758808374405,
-0.058940693736076355,
0.2853381633758545,
-0.08259396255016327,
0.46309414505958557,
0.41096872091293335,
0.20715627074241638,
-0.15141089260578156,
-0.27755090594291687,
-0.09449218958616257,
-0.011212252080440521,
-0.28136682510375977,
-0.09983998537063599,
-0.07942645251750946,
0.14180442690849304,
-0.024740781635046005,
0.07766857743263245,
-0.17458173632621765,
-0.019267994910478592,
0.06438839435577393,
-0.008225589990615845,
0.15524323284626007,
-0.07160738110542297,
-0.4612441956996918,
-0.20946843922138214,
-0.5635542869567871,
0.19257597625255585,
-0.03703829646110535,
0.09621217846870422,
0.10231173038482666,
0.06616123020648956,
-0.21871308982372284,
0.020441005006432533,
-0.07168574631214142,
-0.06777378916740417,
0.10968833416700363,
-0.2659640610218048,
0.42996281385421753,
0.37740302085876465,
0.21425646543502808,
-0.35159140825271606,
0.002625107765197754,
-0.22908002138137817,
0.420737624168396,
-0.3914269208908081,
0.1481291949748993,
0.16586580872535706,
-0.11029859632253647,
0.060873616486787796,
0.3707968294620514,
0.18954689800739288,
-0.21172161400318146,
0.17728830873966217,
-0.43558192253112793,
-0.05445905029773712,
0.4014973044395447,
-0.23180708289146423,
-0.021581605076789856,
0.5051809549331665,
0.17413538694381714,
0.020044520497322083,
-0.15647566318511963,
-0.2798447906970978,
0.2047216296195984,
-0.04424840211868286,
0.09171046316623688,
0.3787393867969513,
-0.15282294154167175,
0.17503759264945984,
0.1801518052816391,
0.15004710853099823,
0.2598145604133606,
0.07804537564516068,
-0.1108713299036026,
-0.05083814635872841,
0.0741894543170929,
0.04354808107018471,
0.2666358947753906,
-0.1173529177904129,
-0.04297483712434769,
-0.2918795347213745,
-0.0614822693169117,
0.0847870409488678,
0.09422503411769867,
-0.19989259541034698,
0.043434254825115204,
0.4416302442550659,
-0.017980754375457764,
-0.00846833735704422,
0.0936708152294159,
-0.15071329474449158,
-0.03702670335769653,
-0.036776602268218994,
-0.003534260904416442,
-0.360785573720932,
0.042213574051856995,
0.10087853670120239,
0.310473769903183,
0.07996118813753128,
-0.04534416273236275,
0.38723933696746826,
-0.13583886623382568,
0.062409721314907074,
0.1783066987991333,
0.48660868406295776,
0.24026572704315186,
0.08309144526720047,
-0.19391180574893951,
0.2908010482788086,
0.08038543909788132,
-0.3014996647834778,
-0.16011452674865723,
0.19678619503974915,
0.3266863524913788,
0.16219529509544373,
0.2776813507080078,
0.11590345203876495,
0.18691939115524292,
-0.2710854709148407,
0.08541136980056763,
0.44702982902526855,
0.06388489156961441,
0.16394956409931183,
0.0839596837759018,
-0.060318723320961,
-0.04282628744840622,
0.14711418747901917,
0.16866344213485718,
0.1388208419084549,
0.2380208820104599,
-0.08630967885255814,
0.04701230674982071,
0.11994391679763794,
-0.038249652832746506,
0.17654800415039062,
-0.33754265308380127,
0.13054609298706055,
0.11013396084308624,
0.2258099466562271,
-0.023585986346006393,
-0.005128789693117142,
0.39979514479637146,
0.2657366693019867,
-0.14418570697307587,
-0.2427893579006195,
0.2887210547924042,
-0.16075743734836578,
-0.047337356954813004,
0.16876649856567383,
-0.23207923769950867,
-0.11525672674179077,
-0.05090245231986046,
-0.18779151141643524,
-0.023482035845518112,
0.07682802528142929,
-0.02623225376009941,
0.3115014433860779,
-0.33180370926856995,
-0.06646447628736496,
-0.027238165959715843,
0.31528085470199585,
-0.1311650425195694,
0.2724405527114868,
0.13928985595703125,
-0.36486461758613586,
0.13467589020729065,
0.2744894027709961,
0.5965859889984131,
0.2164677530527115,
-0.11494973301887512,
-0.05759773403406143,
-0.31083670258522034,
-0.13155889511108398,
0.18677058815956116,
0.07129751145839691,
0.18611417710781097,
0.47037971019744873,
0.40274327993392944,
0.1273161917924881,
0.04153133183717728,
-0.3296956419944763,
0.0058267321437597275,
0.2159140706062317,
-0.21139472723007202,
0.14371562004089355,
-0.13591676950454712,
0.09227066487073898,
-0.15669949352741241,
-0.058654818683862686,
-0.43180030584335327,
-0.4557279646396637,
-0.1574457734823227,
0.05842245742678642,
0.12081960588693619,
-0.11879095435142517,
0.0824909433722496,
0.3132113814353943,
0.43742692470550537,
0.3032170832157135,
-0.04457304626703262,
-0.12881413102149963,
-0.14282426238059998,
-0.5084798336029053,
0.049753542989492416,
-0.1661849319934845,
-0.226470485329628,
0.4137077033519745,
0.2573765516281128,
0.18270227313041687,
0.18920999765396118,
-0.19281329214572906,
0.31290143728256226,
-0.23681403696537018,
0.15212537348270416,
-0.11407220363616943,
-0.20943593978881836,
0.005846225656569004,
-0.3120182752609253,
-0.02526034042239189,
0.2024112045764923,
0.2185799479484558,
-0.07268483191728592,
0.03043949604034424,
-0.015098392963409424,
0.1416952908039093,
-0.3610880970954895,
-0.28920018672943115,
-0.1019616574048996,
0.22302132844924927,
0.1745631843805313,
0.04900035262107849,
-0.07820279151201248,
-0.17177166044712067,
-0.18933190405368805,
-0.23088882863521576,
0.5810200572013855,
-0.11861994862556458,
0.29229021072387695,
-0.305107980966568,
-0.2905067503452301,
-0.11792607605457306,
0.07087436318397522,
-0.04611311852931976,
-0.05421169847249985,
-0.24019373953342438,
0.18587009608745575,
0.16082878410816193,
-0.08625855296850204,
-0.08565138280391693,
0.191035658121109,
0.1209009662270546,
0.25492897629737854,
0.0780114233493805,
-0.48965519666671753,
0.4284687042236328,
-0.4832099676132202,
-0.2350735366344452,
0.16522657871246338,
0.009573161602020264,
0.39178329706192017,
-0.012847625650465488,
-0.38523703813552856,
-0.02024843543767929,
0.1411222666501999,
0.06605831533670425,
0.02197563648223877,
-0.03927989676594734,
-0.04531735181808472,
-0.18241041898727417,
-0.2932910919189453,
0.21277183294296265,
0.07405507564544678,
0.1467665731906891,
0.14264404773712158,
-0.24928566813468933
] |
https://github.com/huggingface/datasets/issues/5706 | But how often in the cases where concatenation is done now would the
categorical label vocabulary actually change? I think it would be in
basically none of them. And in such cases, concatenation remains very easy,
no?
On Fri, Sep 22, 2023, 12:02 PM Quentin Lhoest ***@***.***>
wrote:
> This just changes the burden from string conversion from the user to HF
> Datasets, but doesn't actually enable HF Datasets to take advantage of the
> (very significant) storage and associated speed/memory savings offered by
> using categorical types.
>
> There's already a ClassLabel type that does pretty much the same thing
> (store as integer instead of string) if it can help
>
> Is there an objection with supporting categorical types explicitly through
> the medium I outlined above, where the error is raised if you try to concat
> two differently typed categorical columns?
>
> Yea we do concatenation quite often (e.g. in map) so I don't think this
> is a viable option
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/5706#issuecomment-1731667012>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AADS5X5CGWFXDCML6UKCWYLX3WZBXANCNFSM6AAAAAAWSOUTJ4>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
| Support categorical data types for Parquet | ### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first. | 203 | Support categorical data types for Parquet
### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first.
But how often in the cases where concatenation is done now would the
categorical label vocabulary actually change? I think it would be in
basically none of them. And in such cases, concatenation remains very easy,
no?
On Fri, Sep 22, 2023, 12:02 PM Quentin Lhoest ***@***.***>
wrote:
> This just changes the burden from string conversion from the user to HF
> Datasets, but doesn't actually enable HF Datasets to take advantage of the
> (very significant) storage and associated speed/memory savings offered by
> using categorical types.
>
> There's already a ClassLabel type that does pretty much the same thing
> (store as integer instead of string) if it can help
>
> Is there an objection with supporting categorical types explicitly through
> the medium I outlined above, where the error is raised if you try to concat
> two differently typed categorical columns?
>
> Yea we do concatenation quite often (e.g. in map) so I don't think this
> is a viable option
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/5706#issuecomment-1731667012>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AADS5X5CGWFXDCML6UKCWYLX3WZBXANCNFSM6AAAAAAWSOUTJ4>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
| [
-0.152938574552536,
-0.06370358169078827,
0.07160879671573639,
0.32455649971961975,
0.4551955461502075,
0.06469179689884186,
-0.1901731789112091,
0.22342005372047424,
0.203786700963974,
-0.2283174693584442,
-0.11718685179948807,
0.5124905109405518,
-0.2902349531650543,
0.44914382696151733,
-0.020855922251939774,
-0.2356620728969574,
0.11446522921323776,
-0.05483004450798035,
0.0671464204788208,
0.21519631147384644,
-0.2553243339061737,
0.37052780389785767,
0.021052315831184387,
0.17270562052726746,
-0.005001053214073181,
-0.20741158723831177,
-0.17676939070224762,
0.1230643093585968,
-0.4154319167137146,
-0.648801326751709,
0.38270604610443115,
-0.06258346140384674,
0.07781172543764114,
0.16082338988780975,
-0.00011092540808022022,
0.20099994540214539,
0.22811582684516907,
-0.05094720423221588,
0.07525114715099335,
-0.6103057861328125,
0.25767678022384644,
-0.3289322257041931,
0.5521793961524963,
-0.21667873859405518,
-0.28450876474380493,
-0.5699324011802673,
-0.0010316865518689156,
-0.050077129155397415,
0.13149625062942505,
0.24128347635269165,
0.2137584686279297,
0.12009842693805695,
0.3107171058654785,
-0.026749245822429657,
0.29283881187438965,
0.2815583050251007,
-0.26439225673675537,
0.1390400528907776,
0.19724245369434357,
-0.03920833021402359,
0.10887692123651505,
-0.047020141035318375,
0.07511953264474869,
-0.12355630099773407,
0.26804596185684204,
0.19692714512348175,
0.2707127332687378,
-0.16132812201976776,
-0.1130475103855133,
0.15778645873069763,
0.23117531836032867,
-0.348167359828949,
-0.3780864179134369,
-0.34970414638519287,
-0.08686838299036026,
-0.23116783797740936,
0.3346812129020691,
0.3381064832210541,
-0.03735218942165375,
0.07614102214574814,
0.2864310145378113,
0.10737806558609009,
-0.1368553787469864,
0.15590734779834747,
-0.20811225473880768,
0.051938969641923904,
-0.22799769043922424,
-0.04494556412100792,
0.35474693775177,
-0.27781617641448975,
-0.22969049215316772,
0.05305665358901024,
-0.1878403127193451,
0.0989813357591629,
-0.2532532215118408,
-0.1310701221227646,
-0.18735121190547943,
0.43419149518013,
0.24213898181915283,
-0.08589248359203339,
0.1634422093629837,
-0.06389711052179337,
0.1353231519460678,
0.29720693826675415,
0.47173649072647095,
-0.17446671426296234,
0.038373105227947235,
0.04406629130244255,
-0.26854804158210754,
0.3720489740371704,
0.1295095980167389,
-0.2310546636581421,
0.026296399533748627,
-0.21925373375415802,
-0.208120658993721,
-0.1931491196155548,
0.5561254620552063,
-0.0638805404305458,
-0.1691259890794754,
0.1650553047657013,
0.11396956443786621,
0.18829651176929474,
0.10086981952190399,
0.3479073643684387,
-0.022937806323170662,
0.02642764523625374,
-0.10813335329294205,
0.4272960424423218,
-0.06958991289138794,
-0.26751598715782166,
-0.052012547850608826,
0.18189457058906555,
-0.12289297580718994,
-0.34406009316444397,
0.051090121269226074,
-0.13396772742271423,
-0.016252990812063217,
0.24607893824577332,
0.016065379604697227,
0.11210143566131592,
-0.20609289407730103,
-0.24143250286579132,
-0.099113829433918,
0.210547536611557,
-0.1118248701095581,
-0.042394645512104034,
0.44341424107551575,
-0.5455547571182251,
-0.29060906171798706,
-0.06072327122092247,
-0.17885178327560425,
-0.13254398107528687,
-0.26276135444641113,
0.11716574430465698,
0.04377703368663788,
-0.10584572702646255,
-0.6395193934440613,
0.4424750804901123,
-0.1372944712638855,
-0.1937583088874817,
-0.05611115321516991,
-0.07101194560527802,
-0.1416284441947937,
-0.25209540128707886,
0.052349187433719635,
0.22650232911109924,
-0.42769789695739746,
0.02059689164161682,
0.01941388100385666,
-0.23541375994682312,
0.3803633153438568,
0.3180568814277649,
-0.02763085812330246,
-0.4074193239212036,
-0.03246611729264259,
0.22595669329166412,
0.3833453953266144,
-0.034665364772081375,
0.029156766831874847,
0.10229064524173737,
0.11098361760377884,
0.31626445055007935,
0.18920253217220306,
-0.3239975571632385,
0.50709068775177,
-0.013011213392019272,
-0.02620040625333786,
0.04411611706018448,
-0.20981580018997192,
-0.06783615797758102,
-0.3061771094799042,
-0.14404937624931335,
0.4953615367412567,
0.14524048566818237,
-0.2497681975364685,
-0.10603898763656616,
0.2180664986371994,
-0.26237770915031433,
0.14679385721683502,
-0.031239736825227737,
-0.030373938381671906,
-0.023333575576543808,
0.2688630521297455,
0.6133161187171936,
0.08784923702478409,
-0.3044065237045288,
-0.3224829435348511,
0.2282199114561081,
0.052213676273822784,
0.06213083863258362,
-0.24143855273723602,
-0.30301064252853394,
-0.14496557414531708,
0.1378384530544281,
-0.09390182793140411,
-0.01944703608751297,
0.1721343994140625,
-0.08013330399990082,
0.021914541721343994,
0.29322192072868347,
-0.18580783903598785,
0.22619204223155975,
-0.21847137808799744,
0.2586442530155182,
-0.06182252988219261,
0.18199323117733002,
-0.10379088670015335,
-0.3180977702140808,
0.07615016400814056,
0.21751287579536438,
0.07291470468044281,
-0.10771507024765015,
0.2687312066555023,
0.2809019088745117,
0.2731555104255676,
0.027974411845207214,
-0.09046827256679535,
0.16220802068710327,
0.14152175188064575,
-0.05531177297234535,
-0.1670624315738678,
-0.12894617021083832,
0.1957995593547821,
0.12024074047803879,
-0.05643313378095627,
0.39094457030296326,
-0.035749807953834534,
0.023572636768221855,
-0.11664607375860214,
0.17691445350646973,
0.24842453002929688,
0.32303303480148315,
-0.23134571313858032,
-0.12353555858135223,
0.2530020475387573,
-0.0045946817845106125,
-0.1921282559633255,
-0.07039051502943039,
-0.5973890423774719,
0.01568268984556198,
0.3798612952232361,
0.11977086216211319,
0.1029573604464531,
0.04136619344353676,
0.2032211422920227,
0.08613710105419159,
-0.04918786138296127,
0.27293264865875244,
0.0384262353181839,
0.2379569262266159,
-0.12969478964805603,
0.08426417410373688,
-0.22460967302322388,
0.058242786675691605,
0.2596370577812195,
0.17151939868927002,
-0.05381207540631294,
-0.21425727009773254,
0.2914349436759949,
0.06249687820672989,
-0.37361446022987366,
0.14000560343265533,
0.06541142612695694,
0.10063115507364273,
-0.42535924911499023,
0.10444281250238419,
-0.3702431321144104,
-0.05711374431848526,
-0.13888244330883026,
-0.00012029334902763367,
-0.23791804909706116,
-0.20550847053527832,
-0.10111063718795776,
0.12339800596237183,
-0.09335972368717194,
-0.04076502472162247,
-0.1659088134765625,
0.18208682537078857,
-0.027358591556549072,
-0.12820883095264435,
-0.262002170085907,
-0.36206701397895813,
-0.12342662364244461,
0.09313923120498657,
0.15297982096672058,
-0.14776605367660522,
0.35018548369407654,
-0.042704418301582336,
0.027697138488292694,
-0.25959527492523193,
-0.4133831858634949,
-0.023066453635692596,
-0.39364928007125854,
0.1958536058664322,
0.22667653858661652,
0.09073315560817719,
-0.2696143388748169,
-0.28969186544418335,
0.47491422295570374,
-0.056450508534908295,
-0.20800185203552246,
0.22151446342468262,
-0.0034103170037269592,
-0.0970926433801651,
-0.10649419575929642,
-0.10217826068401337,
-0.29842817783355713,
-0.2879944145679474,
0.4497191607952118,
0.1444402039051056,
-0.034513913094997406,
-0.1965426504611969,
-0.0278362687677145,
-0.01861807331442833,
-0.527838945388794,
0.06636419147253036,
-0.040320198982954025,
-0.002724006772041321,
0.32798123359680176,
-0.1422857940196991,
-0.38700562715530396,
0.19021424651145935,
-0.00631202757358551,
0.18691426515579224,
-0.003984272480010986,
-0.20849883556365967,
-0.08707308024168015,
-0.10268814861774445,
0.19811725616455078,
-0.037180427461862564,
-0.14256322383880615,
0.3516176640987396,
0.06691202521324158,
-0.024691686034202576,
-0.07317157089710236,
-0.06056349724531174,
-0.004815500229597092,
0.184244766831398,
-0.05091938003897667,
-0.04849030077457428,
0.6205022931098938,
0.2456151247024536,
0.17862682044506073,
-0.05995325744152069,
0.14099034667015076,
0.6188872456550598,
-0.32015615701675415,
0.39276546239852905,
-0.04005168378353119,
-0.2920130491256714,
-0.08307938277721405,
-0.25417888164520264,
0.26055699586868286,
0.117622971534729,
-0.05621738359332085,
-0.1948554515838623,
-0.11590456962585449,
-0.07275794446468353,
-0.2815675735473633,
-0.2757439613342285,
-0.057677969336509705,
-0.035767700523138046,
0.06650535762310028,
-0.12679755687713623,
-0.12256654351949692,
-0.010229043662548065,
-0.13874486088752747,
0.07516616582870483,
0.44735440611839294,
-0.061268918216228485,
0.19017724692821503,
0.01140981912612915,
-0.03884042054414749,
-0.45768457651138306,
0.1959451138973236,
-0.07473284751176834,
0.04759768769145012,
-0.07114357501268387,
0.0807332843542099,
0.0882553905248642,
-0.06675455719232559,
0.718495786190033,
0.22504828870296478,
-0.06621228158473969,
-0.024248193949460983,
-0.33991539478302,
-0.8340396285057068,
-0.013831473886966705,
-0.27823197841644287,
-0.057074785232543945,
0.04007493332028389,
0.17242532968521118,
-0.49052464962005615,
-0.09912491589784622,
-0.18934789299964905,
-0.16268613934516907,
0.06819130480289459,
0.16527393460273743,
-0.3242438733577728,
-0.11752858757972717,
-0.23418593406677246,
0.10246653854846954,
0.3930708169937134,
0.4166416823863983,
0.07237891107797623,
0.18640689551830292,
-0.25309085845947266,
-0.06964681297540665,
0.05651126429438591,
0.04648076742887497,
0.4361877143383026,
-0.16080568730831146,
0.055259376764297485,
0.07910327613353729,
0.3671548664569855,
-0.0054856762290000916,
0.6376227140426636,
0.18200403451919556,
-0.8556132316589355,
0.09358629584312439,
0.07778027653694153,
0.1841108500957489,
-0.11737856268882751,
-0.21510514616966248,
0.132696270942688,
-0.2387053519487381,
0.023384831845760345,
-0.39083680510520935,
-0.007381375879049301,
0.4942101836204529,
-0.1826823353767395,
-0.05021054670214653,
-0.30054232478141785,
0.4798077940940857,
0.05160748213529587,
0.16309425234794617,
0.006000073626637459,
1.0382771492004395,
-0.07405431568622589,
0.5716263055801392,
0.19556033611297607,
0.5652731657028198,
-0.2233593612909317,
0.13003714382648468,
0.4695199131965637,
-0.43532776832580566,
0.6631953716278076,
-0.20386216044425964,
0.1119074821472168,
-0.19924727082252502,
0.14236706495285034,
-0.12076494097709656,
-0.0540260449051857,
0.35178524255752563,
0.17814071476459503,
-0.3683437705039978,
0.013651318848133087,
-0.06607756018638611,
-0.1214323490858078,
-0.18642890453338623,
0.09076545387506485,
-0.2680352032184601,
-0.04683420807123184,
-0.5542470812797546,
0.1113433986902237,
-0.04513793811202049,
-0.22735461592674255,
0.08390355855226517,
-0.08016453683376312,
-0.04552546143531799,
-0.16013798117637634,
-0.3407999873161316,
-0.12523427605628967,
-0.2388758808374405,
-0.058940693736076355,
0.2853381633758545,
-0.08259396255016327,
0.46309414505958557,
0.41096872091293335,
0.20715627074241638,
-0.15141089260578156,
-0.27755090594291687,
-0.09449218958616257,
-0.011212252080440521,
-0.28136682510375977,
-0.09983998537063599,
-0.07942645251750946,
0.14180442690849304,
-0.024740781635046005,
0.07766857743263245,
-0.17458173632621765,
-0.019267994910478592,
0.06438839435577393,
-0.008225589990615845,
0.15524323284626007,
-0.07160738110542297,
-0.4612441956996918,
-0.20946843922138214,
-0.5635542869567871,
0.19257597625255585,
-0.03703829646110535,
0.09621217846870422,
0.10231173038482666,
0.06616123020648956,
-0.21871308982372284,
0.020441005006432533,
-0.07168574631214142,
-0.06777378916740417,
0.10968833416700363,
-0.2659640610218048,
0.42996281385421753,
0.37740302085876465,
0.21425646543502808,
-0.35159140825271606,
0.002625107765197754,
-0.22908002138137817,
0.420737624168396,
-0.3914269208908081,
0.1481291949748993,
0.16586580872535706,
-0.11029859632253647,
0.060873616486787796,
0.3707968294620514,
0.18954689800739288,
-0.21172161400318146,
0.17728830873966217,
-0.43558192253112793,
-0.05445905029773712,
0.4014973044395447,
-0.23180708289146423,
-0.021581605076789856,
0.5051809549331665,
0.17413538694381714,
0.020044520497322083,
-0.15647566318511963,
-0.2798447906970978,
0.2047216296195984,
-0.04424840211868286,
0.09171046316623688,
0.3787393867969513,
-0.15282294154167175,
0.17503759264945984,
0.1801518052816391,
0.15004710853099823,
0.2598145604133606,
0.07804537564516068,
-0.1108713299036026,
-0.05083814635872841,
0.0741894543170929,
0.04354808107018471,
0.2666358947753906,
-0.1173529177904129,
-0.04297483712434769,
-0.2918795347213745,
-0.0614822693169117,
0.0847870409488678,
0.09422503411769867,
-0.19989259541034698,
0.043434254825115204,
0.4416302442550659,
-0.017980754375457764,
-0.00846833735704422,
0.0936708152294159,
-0.15071329474449158,
-0.03702670335769653,
-0.036776602268218994,
-0.003534260904416442,
-0.360785573720932,
0.042213574051856995,
0.10087853670120239,
0.310473769903183,
0.07996118813753128,
-0.04534416273236275,
0.38723933696746826,
-0.13583886623382568,
0.062409721314907074,
0.1783066987991333,
0.48660868406295776,
0.24026572704315186,
0.08309144526720047,
-0.19391180574893951,
0.2908010482788086,
0.08038543909788132,
-0.3014996647834778,
-0.16011452674865723,
0.19678619503974915,
0.3266863524913788,
0.16219529509544373,
0.2776813507080078,
0.11590345203876495,
0.18691939115524292,
-0.2710854709148407,
0.08541136980056763,
0.44702982902526855,
0.06388489156961441,
0.16394956409931183,
0.0839596837759018,
-0.060318723320961,
-0.04282628744840622,
0.14711418747901917,
0.16866344213485718,
0.1388208419084549,
0.2380208820104599,
-0.08630967885255814,
0.04701230674982071,
0.11994391679763794,
-0.038249652832746506,
0.17654800415039062,
-0.33754265308380127,
0.13054609298706055,
0.11013396084308624,
0.2258099466562271,
-0.023585986346006393,
-0.005128789693117142,
0.39979514479637146,
0.2657366693019867,
-0.14418570697307587,
-0.2427893579006195,
0.2887210547924042,
-0.16075743734836578,
-0.047337356954813004,
0.16876649856567383,
-0.23207923769950867,
-0.11525672674179077,
-0.05090245231986046,
-0.18779151141643524,
-0.023482035845518112,
0.07682802528142929,
-0.02623225376009941,
0.3115014433860779,
-0.33180370926856995,
-0.06646447628736496,
-0.027238165959715843,
0.31528085470199585,
-0.1311650425195694,
0.2724405527114868,
0.13928985595703125,
-0.36486461758613586,
0.13467589020729065,
0.2744894027709961,
0.5965859889984131,
0.2164677530527115,
-0.11494973301887512,
-0.05759773403406143,
-0.31083670258522034,
-0.13155889511108398,
0.18677058815956116,
0.07129751145839691,
0.18611417710781097,
0.47037971019744873,
0.40274327993392944,
0.1273161917924881,
0.04153133183717728,
-0.3296956419944763,
0.0058267321437597275,
0.2159140706062317,
-0.21139472723007202,
0.14371562004089355,
-0.13591676950454712,
0.09227066487073898,
-0.15669949352741241,
-0.058654818683862686,
-0.43180030584335327,
-0.4557279646396637,
-0.1574457734823227,
0.05842245742678642,
0.12081960588693619,
-0.11879095435142517,
0.0824909433722496,
0.3132113814353943,
0.43742692470550537,
0.3032170832157135,
-0.04457304626703262,
-0.12881413102149963,
-0.14282426238059998,
-0.5084798336029053,
0.049753542989492416,
-0.1661849319934845,
-0.226470485329628,
0.4137077033519745,
0.2573765516281128,
0.18270227313041687,
0.18920999765396118,
-0.19281329214572906,
0.31290143728256226,
-0.23681403696537018,
0.15212537348270416,
-0.11407220363616943,
-0.20943593978881836,
0.005846225656569004,
-0.3120182752609253,
-0.02526034042239189,
0.2024112045764923,
0.2185799479484558,
-0.07268483191728592,
0.03043949604034424,
-0.015098392963409424,
0.1416952908039093,
-0.3610880970954895,
-0.28920018672943115,
-0.1019616574048996,
0.22302132844924927,
0.1745631843805313,
0.04900035262107849,
-0.07820279151201248,
-0.17177166044712067,
-0.18933190405368805,
-0.23088882863521576,
0.5810200572013855,
-0.11861994862556458,
0.29229021072387695,
-0.305107980966568,
-0.2905067503452301,
-0.11792607605457306,
0.07087436318397522,
-0.04611311852931976,
-0.05421169847249985,
-0.24019373953342438,
0.18587009608745575,
0.16082878410816193,
-0.08625855296850204,
-0.08565138280391693,
0.191035658121109,
0.1209009662270546,
0.25492897629737854,
0.0780114233493805,
-0.48965519666671753,
0.4284687042236328,
-0.4832099676132202,
-0.2350735366344452,
0.16522657871246338,
0.009573161602020264,
0.39178329706192017,
-0.012847625650465488,
-0.38523703813552856,
-0.02024843543767929,
0.1411222666501999,
0.06605831533670425,
0.02197563648223877,
-0.03927989676594734,
-0.04531735181808472,
-0.18241041898727417,
-0.2932910919189453,
0.21277183294296265,
0.07405507564544678,
0.1467665731906891,
0.14264404773712158,
-0.24928566813468933
] |
https://github.com/huggingface/datasets/issues/5706 | Arrow IPC seems to require unified dictionaries anyway so actually we could surely focus only on this use case indeed @mmcdermott
So defining a new Feature type in `datasets` that contains the dictionary mapping should be fine (and concatenation would work out of the box), and it should also take care of checking that the data it encodes/decodes has the right dictionary. Do you think it can be done without impacting iterating speed for the other types @mariosasko ?
Right now we have little bandwidth to work in this kind of things though | Support categorical data types for Parquet | ### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first. | 93 | Support categorical data types for Parquet
### Feature request
Huggingface datasets does not seem to support categorical / dictionary data types for Parquet as of now. There seems to be a `TODO` in the code for this feature but no implementation yet. Below you can find sample code to reproduce the error that is currently thrown when attempting to read a Parquet file with categorical columns:
```python
import pandas as pd
import pyarrow.parquet as pq
from datasets import load_dataset
# Create categorical sample DataFrame
df = pd.DataFrame({'type': ['foo', 'bar']}).astype('category')
df.to_parquet('data.parquet')
# Read back as pyarrow table
table = pq.read_table('data.parquet')
print(table.schema)
# type: dictionary<values=string, indices=int32, ordered=0>
# Load with huggingface datasets
load_dataset('parquet', data_files='data.parquet')
```
Error:
```
Traceback (most recent call last):
File ".venv/lib/python3.10/site-packages/datasets/builder.py", line 1875, in _prepare_split_single
writer.write_table(table)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 566, in write_table
self._build_writer(inferred_schema=pa_table.schema)
File ".venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 379, in _build_writer
inferred_features = Features.from_arrow_schema(inferred_schema)
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in from_arrow_schema
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1622, in <dictcomp>
obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema}
File ".venv/lib/python3.10/site-packages/datasets/features/features.py", line 1361, in generate_from_arrow_type
raise NotImplementedError # TODO(thom) this will need access to the dictionary as well (for labels). I.e. to the py_table
NotImplementedError
```
### Motivation
Categorical data types, as offered by Pandas and implemented with the `DictionaryType` dtype in `pyarrow` can significantly reduce dataset size and are a handy way to turn textual features into numerical representations and back. Lack of support in Huggingface datasets greatly reduces compatibility with a common Pandas / Parquet feature.
### Your contribution
I could provide a PR. However, it would be nice to have an initial complexity estimate from one of the core developers first.
Arrow IPC seems to require unified dictionaries anyway so actually we could surely focus only on this use case indeed @mmcdermott
So defining a new Feature type in `datasets` that contains the dictionary mapping should be fine (and concatenation would work out of the box), and it should also take care of checking that the data it encodes/decodes has the right dictionary. Do you think it can be done without impacting iterating speed for the other types @mariosasko ?
Right now we have little bandwidth to work in this kind of things though | [
-0.152938574552536,
-0.06370358169078827,
0.07160879671573639,
0.32455649971961975,
0.4551955461502075,
0.06469179689884186,
-0.1901731789112091,
0.22342005372047424,
0.203786700963974,
-0.2283174693584442,
-0.11718685179948807,
0.5124905109405518,
-0.2902349531650543,
0.44914382696151733,
-0.020855922251939774,
-0.2356620728969574,
0.11446522921323776,
-0.05483004450798035,
0.0671464204788208,
0.21519631147384644,
-0.2553243339061737,
0.37052780389785767,
0.021052315831184387,
0.17270562052726746,
-0.005001053214073181,
-0.20741158723831177,
-0.17676939070224762,
0.1230643093585968,
-0.4154319167137146,
-0.648801326751709,
0.38270604610443115,
-0.06258346140384674,
0.07781172543764114,
0.16082338988780975,
-0.00011092540808022022,
0.20099994540214539,
0.22811582684516907,
-0.05094720423221588,
0.07525114715099335,
-0.6103057861328125,
0.25767678022384644,
-0.3289322257041931,
0.5521793961524963,
-0.21667873859405518,
-0.28450876474380493,
-0.5699324011802673,
-0.0010316865518689156,
-0.050077129155397415,
0.13149625062942505,
0.24128347635269165,
0.2137584686279297,
0.12009842693805695,
0.3107171058654785,
-0.026749245822429657,
0.29283881187438965,
0.2815583050251007,
-0.26439225673675537,
0.1390400528907776,
0.19724245369434357,
-0.03920833021402359,
0.10887692123651505,
-0.047020141035318375,
0.07511953264474869,
-0.12355630099773407,
0.26804596185684204,
0.19692714512348175,
0.2707127332687378,
-0.16132812201976776,
-0.1130475103855133,
0.15778645873069763,
0.23117531836032867,
-0.348167359828949,
-0.3780864179134369,
-0.34970414638519287,
-0.08686838299036026,
-0.23116783797740936,
0.3346812129020691,
0.3381064832210541,
-0.03735218942165375,
0.07614102214574814,
0.2864310145378113,
0.10737806558609009,
-0.1368553787469864,
0.15590734779834747,
-0.20811225473880768,
0.051938969641923904,
-0.22799769043922424,
-0.04494556412100792,
0.35474693775177,
-0.27781617641448975,
-0.22969049215316772,
0.05305665358901024,
-0.1878403127193451,
0.0989813357591629,
-0.2532532215118408,
-0.1310701221227646,
-0.18735121190547943,
0.43419149518013,
0.24213898181915283,
-0.08589248359203339,
0.1634422093629837,
-0.06389711052179337,
0.1353231519460678,
0.29720693826675415,
0.47173649072647095,
-0.17446671426296234,
0.038373105227947235,
0.04406629130244255,
-0.26854804158210754,
0.3720489740371704,
0.1295095980167389,
-0.2310546636581421,
0.026296399533748627,
-0.21925373375415802,
-0.208120658993721,
-0.1931491196155548,
0.5561254620552063,
-0.0638805404305458,
-0.1691259890794754,
0.1650553047657013,
0.11396956443786621,
0.18829651176929474,
0.10086981952190399,
0.3479073643684387,
-0.022937806323170662,
0.02642764523625374,
-0.10813335329294205,
0.4272960424423218,
-0.06958991289138794,
-0.26751598715782166,
-0.052012547850608826,
0.18189457058906555,
-0.12289297580718994,
-0.34406009316444397,
0.051090121269226074,
-0.13396772742271423,
-0.016252990812063217,
0.24607893824577332,
0.016065379604697227,
0.11210143566131592,
-0.20609289407730103,
-0.24143250286579132,
-0.099113829433918,
0.210547536611557,
-0.1118248701095581,
-0.042394645512104034,
0.44341424107551575,
-0.5455547571182251,
-0.29060906171798706,
-0.06072327122092247,
-0.17885178327560425,
-0.13254398107528687,
-0.26276135444641113,
0.11716574430465698,
0.04377703368663788,
-0.10584572702646255,
-0.6395193934440613,
0.4424750804901123,
-0.1372944712638855,
-0.1937583088874817,
-0.05611115321516991,
-0.07101194560527802,
-0.1416284441947937,
-0.25209540128707886,
0.052349187433719635,
0.22650232911109924,
-0.42769789695739746,
0.02059689164161682,
0.01941388100385666,
-0.23541375994682312,
0.3803633153438568,
0.3180568814277649,
-0.02763085812330246,
-0.4074193239212036,
-0.03246611729264259,
0.22595669329166412,
0.3833453953266144,
-0.034665364772081375,
0.029156766831874847,
0.10229064524173737,
0.11098361760377884,
0.31626445055007935,
0.18920253217220306,
-0.3239975571632385,
0.50709068775177,
-0.013011213392019272,
-0.02620040625333786,
0.04411611706018448,
-0.20981580018997192,
-0.06783615797758102,
-0.3061771094799042,
-0.14404937624931335,
0.4953615367412567,
0.14524048566818237,
-0.2497681975364685,
-0.10603898763656616,
0.2180664986371994,
-0.26237770915031433,
0.14679385721683502,
-0.031239736825227737,
-0.030373938381671906,
-0.023333575576543808,
0.2688630521297455,
0.6133161187171936,
0.08784923702478409,
-0.3044065237045288,
-0.3224829435348511,
0.2282199114561081,
0.052213676273822784,
0.06213083863258362,
-0.24143855273723602,
-0.30301064252853394,
-0.14496557414531708,
0.1378384530544281,
-0.09390182793140411,
-0.01944703608751297,
0.1721343994140625,
-0.08013330399990082,
0.021914541721343994,
0.29322192072868347,
-0.18580783903598785,
0.22619204223155975,
-0.21847137808799744,
0.2586442530155182,
-0.06182252988219261,
0.18199323117733002,
-0.10379088670015335,
-0.3180977702140808,
0.07615016400814056,
0.21751287579536438,
0.07291470468044281,
-0.10771507024765015,
0.2687312066555023,
0.2809019088745117,
0.2731555104255676,
0.027974411845207214,
-0.09046827256679535,
0.16220802068710327,
0.14152175188064575,
-0.05531177297234535,
-0.1670624315738678,
-0.12894617021083832,
0.1957995593547821,
0.12024074047803879,
-0.05643313378095627,
0.39094457030296326,
-0.035749807953834534,
0.023572636768221855,
-0.11664607375860214,
0.17691445350646973,
0.24842453002929688,
0.32303303480148315,
-0.23134571313858032,
-0.12353555858135223,
0.2530020475387573,
-0.0045946817845106125,
-0.1921282559633255,
-0.07039051502943039,
-0.5973890423774719,
0.01568268984556198,
0.3798612952232361,
0.11977086216211319,
0.1029573604464531,
0.04136619344353676,
0.2032211422920227,
0.08613710105419159,
-0.04918786138296127,
0.27293264865875244,
0.0384262353181839,
0.2379569262266159,
-0.12969478964805603,
0.08426417410373688,
-0.22460967302322388,
0.058242786675691605,
0.2596370577812195,
0.17151939868927002,
-0.05381207540631294,
-0.21425727009773254,
0.2914349436759949,
0.06249687820672989,
-0.37361446022987366,
0.14000560343265533,
0.06541142612695694,
0.10063115507364273,
-0.42535924911499023,
0.10444281250238419,
-0.3702431321144104,
-0.05711374431848526,
-0.13888244330883026,
-0.00012029334902763367,
-0.23791804909706116,
-0.20550847053527832,
-0.10111063718795776,
0.12339800596237183,
-0.09335972368717194,
-0.04076502472162247,
-0.1659088134765625,
0.18208682537078857,
-0.027358591556549072,
-0.12820883095264435,
-0.262002170085907,
-0.36206701397895813,
-0.12342662364244461,
0.09313923120498657,
0.15297982096672058,
-0.14776605367660522,
0.35018548369407654,
-0.042704418301582336,
0.027697138488292694,
-0.25959527492523193,
-0.4133831858634949,
-0.023066453635692596,
-0.39364928007125854,
0.1958536058664322,
0.22667653858661652,
0.09073315560817719,
-0.2696143388748169,
-0.28969186544418335,
0.47491422295570374,
-0.056450508534908295,
-0.20800185203552246,
0.22151446342468262,
-0.0034103170037269592,
-0.0970926433801651,
-0.10649419575929642,
-0.10217826068401337,
-0.29842817783355713,
-0.2879944145679474,
0.4497191607952118,
0.1444402039051056,
-0.034513913094997406,
-0.1965426504611969,
-0.0278362687677145,
-0.01861807331442833,
-0.527838945388794,
0.06636419147253036,
-0.040320198982954025,
-0.002724006772041321,
0.32798123359680176,
-0.1422857940196991,
-0.38700562715530396,
0.19021424651145935,
-0.00631202757358551,
0.18691426515579224,
-0.003984272480010986,
-0.20849883556365967,
-0.08707308024168015,
-0.10268814861774445,
0.19811725616455078,
-0.037180427461862564,
-0.14256322383880615,
0.3516176640987396,
0.06691202521324158,
-0.024691686034202576,
-0.07317157089710236,
-0.06056349724531174,
-0.004815500229597092,
0.184244766831398,
-0.05091938003897667,
-0.04849030077457428,
0.6205022931098938,
0.2456151247024536,
0.17862682044506073,
-0.05995325744152069,
0.14099034667015076,
0.6188872456550598,
-0.32015615701675415,
0.39276546239852905,
-0.04005168378353119,
-0.2920130491256714,
-0.08307938277721405,
-0.25417888164520264,
0.26055699586868286,
0.117622971534729,
-0.05621738359332085,
-0.1948554515838623,
-0.11590456962585449,
-0.07275794446468353,
-0.2815675735473633,
-0.2757439613342285,
-0.057677969336509705,
-0.035767700523138046,
0.06650535762310028,
-0.12679755687713623,
-0.12256654351949692,
-0.010229043662548065,
-0.13874486088752747,
0.07516616582870483,
0.44735440611839294,
-0.061268918216228485,
0.19017724692821503,
0.01140981912612915,
-0.03884042054414749,
-0.45768457651138306,
0.1959451138973236,
-0.07473284751176834,
0.04759768769145012,
-0.07114357501268387,
0.0807332843542099,
0.0882553905248642,
-0.06675455719232559,
0.718495786190033,
0.22504828870296478,
-0.06621228158473969,
-0.024248193949460983,
-0.33991539478302,
-0.8340396285057068,
-0.013831473886966705,
-0.27823197841644287,
-0.057074785232543945,
0.04007493332028389,
0.17242532968521118,
-0.49052464962005615,
-0.09912491589784622,
-0.18934789299964905,
-0.16268613934516907,
0.06819130480289459,
0.16527393460273743,
-0.3242438733577728,
-0.11752858757972717,
-0.23418593406677246,
0.10246653854846954,
0.3930708169937134,
0.4166416823863983,
0.07237891107797623,
0.18640689551830292,
-0.25309085845947266,
-0.06964681297540665,
0.05651126429438591,
0.04648076742887497,
0.4361877143383026,
-0.16080568730831146,
0.055259376764297485,
0.07910327613353729,
0.3671548664569855,
-0.0054856762290000916,
0.6376227140426636,
0.18200403451919556,
-0.8556132316589355,
0.09358629584312439,
0.07778027653694153,
0.1841108500957489,
-0.11737856268882751,
-0.21510514616966248,
0.132696270942688,
-0.2387053519487381,
0.023384831845760345,
-0.39083680510520935,
-0.007381375879049301,
0.4942101836204529,
-0.1826823353767395,
-0.05021054670214653,
-0.30054232478141785,
0.4798077940940857,
0.05160748213529587,
0.16309425234794617,
0.006000073626637459,
1.0382771492004395,
-0.07405431568622589,
0.5716263055801392,
0.19556033611297607,
0.5652731657028198,
-0.2233593612909317,
0.13003714382648468,
0.4695199131965637,
-0.43532776832580566,
0.6631953716278076,
-0.20386216044425964,
0.1119074821472168,
-0.19924727082252502,
0.14236706495285034,
-0.12076494097709656,
-0.0540260449051857,
0.35178524255752563,
0.17814071476459503,
-0.3683437705039978,
0.013651318848133087,
-0.06607756018638611,
-0.1214323490858078,
-0.18642890453338623,
0.09076545387506485,
-0.2680352032184601,
-0.04683420807123184,
-0.5542470812797546,
0.1113433986902237,
-0.04513793811202049,
-0.22735461592674255,
0.08390355855226517,
-0.08016453683376312,
-0.04552546143531799,
-0.16013798117637634,
-0.3407999873161316,
-0.12523427605628967,
-0.2388758808374405,
-0.058940693736076355,
0.2853381633758545,
-0.08259396255016327,
0.46309414505958557,
0.41096872091293335,
0.20715627074241638,
-0.15141089260578156,
-0.27755090594291687,
-0.09449218958616257,
-0.011212252080440521,
-0.28136682510375977,
-0.09983998537063599,
-0.07942645251750946,
0.14180442690849304,
-0.024740781635046005,
0.07766857743263245,
-0.17458173632621765,
-0.019267994910478592,
0.06438839435577393,
-0.008225589990615845,
0.15524323284626007,
-0.07160738110542297,
-0.4612441956996918,
-0.20946843922138214,
-0.5635542869567871,
0.19257597625255585,
-0.03703829646110535,
0.09621217846870422,
0.10231173038482666,
0.06616123020648956,
-0.21871308982372284,
0.020441005006432533,
-0.07168574631214142,
-0.06777378916740417,
0.10968833416700363,
-0.2659640610218048,
0.42996281385421753,
0.37740302085876465,
0.21425646543502808,
-0.35159140825271606,
0.002625107765197754,
-0.22908002138137817,
0.420737624168396,
-0.3914269208908081,
0.1481291949748993,
0.16586580872535706,
-0.11029859632253647,
0.060873616486787796,
0.3707968294620514,
0.18954689800739288,
-0.21172161400318146,
0.17728830873966217,
-0.43558192253112793,
-0.05445905029773712,
0.4014973044395447,
-0.23180708289146423,
-0.021581605076789856,
0.5051809549331665,
0.17413538694381714,
0.020044520497322083,
-0.15647566318511963,
-0.2798447906970978,
0.2047216296195984,
-0.04424840211868286,
0.09171046316623688,
0.3787393867969513,
-0.15282294154167175,
0.17503759264945984,
0.1801518052816391,
0.15004710853099823,
0.2598145604133606,
0.07804537564516068,
-0.1108713299036026,
-0.05083814635872841,
0.0741894543170929,
0.04354808107018471,
0.2666358947753906,
-0.1173529177904129,
-0.04297483712434769,
-0.2918795347213745,
-0.0614822693169117,
0.0847870409488678,
0.09422503411769867,
-0.19989259541034698,
0.043434254825115204,
0.4416302442550659,
-0.017980754375457764,
-0.00846833735704422,
0.0936708152294159,
-0.15071329474449158,
-0.03702670335769653,
-0.036776602268218994,
-0.003534260904416442,
-0.360785573720932,
0.042213574051856995,
0.10087853670120239,
0.310473769903183,
0.07996118813753128,
-0.04534416273236275,
0.38723933696746826,
-0.13583886623382568,
0.062409721314907074,
0.1783066987991333,
0.48660868406295776,
0.24026572704315186,
0.08309144526720047,
-0.19391180574893951,
0.2908010482788086,
0.08038543909788132,
-0.3014996647834778,
-0.16011452674865723,
0.19678619503974915,
0.3266863524913788,
0.16219529509544373,
0.2776813507080078,
0.11590345203876495,
0.18691939115524292,
-0.2710854709148407,
0.08541136980056763,
0.44702982902526855,
0.06388489156961441,
0.16394956409931183,
0.0839596837759018,
-0.060318723320961,
-0.04282628744840622,
0.14711418747901917,
0.16866344213485718,
0.1388208419084549,
0.2380208820104599,
-0.08630967885255814,
0.04701230674982071,
0.11994391679763794,
-0.038249652832746506,
0.17654800415039062,
-0.33754265308380127,
0.13054609298706055,
0.11013396084308624,
0.2258099466562271,
-0.023585986346006393,
-0.005128789693117142,
0.39979514479637146,
0.2657366693019867,
-0.14418570697307587,
-0.2427893579006195,
0.2887210547924042,
-0.16075743734836578,
-0.047337356954813004,
0.16876649856567383,
-0.23207923769950867,
-0.11525672674179077,
-0.05090245231986046,
-0.18779151141643524,
-0.023482035845518112,
0.07682802528142929,
-0.02623225376009941,
0.3115014433860779,
-0.33180370926856995,
-0.06646447628736496,
-0.027238165959715843,
0.31528085470199585,
-0.1311650425195694,
0.2724405527114868,
0.13928985595703125,
-0.36486461758613586,
0.13467589020729065,
0.2744894027709961,
0.5965859889984131,
0.2164677530527115,
-0.11494973301887512,
-0.05759773403406143,
-0.31083670258522034,
-0.13155889511108398,
0.18677058815956116,
0.07129751145839691,
0.18611417710781097,
0.47037971019744873,
0.40274327993392944,
0.1273161917924881,
0.04153133183717728,
-0.3296956419944763,
0.0058267321437597275,
0.2159140706062317,
-0.21139472723007202,
0.14371562004089355,
-0.13591676950454712,
0.09227066487073898,
-0.15669949352741241,
-0.058654818683862686,
-0.43180030584335327,
-0.4557279646396637,
-0.1574457734823227,
0.05842245742678642,
0.12081960588693619,
-0.11879095435142517,
0.0824909433722496,
0.3132113814353943,
0.43742692470550537,
0.3032170832157135,
-0.04457304626703262,
-0.12881413102149963,
-0.14282426238059998,
-0.5084798336029053,
0.049753542989492416,
-0.1661849319934845,
-0.226470485329628,
0.4137077033519745,
0.2573765516281128,
0.18270227313041687,
0.18920999765396118,
-0.19281329214572906,
0.31290143728256226,
-0.23681403696537018,
0.15212537348270416,
-0.11407220363616943,
-0.20943593978881836,
0.005846225656569004,
-0.3120182752609253,
-0.02526034042239189,
0.2024112045764923,
0.2185799479484558,
-0.07268483191728592,
0.03043949604034424,
-0.015098392963409424,
0.1416952908039093,
-0.3610880970954895,
-0.28920018672943115,
-0.1019616574048996,
0.22302132844924927,
0.1745631843805313,
0.04900035262107849,
-0.07820279151201248,
-0.17177166044712067,
-0.18933190405368805,
-0.23088882863521576,
0.5810200572013855,
-0.11861994862556458,
0.29229021072387695,
-0.305107980966568,
-0.2905067503452301,
-0.11792607605457306,
0.07087436318397522,
-0.04611311852931976,
-0.05421169847249985,
-0.24019373953342438,
0.18587009608745575,
0.16082878410816193,
-0.08625855296850204,
-0.08565138280391693,
0.191035658121109,
0.1209009662270546,
0.25492897629737854,
0.0780114233493805,
-0.48965519666671753,
0.4284687042236328,
-0.4832099676132202,
-0.2350735366344452,
0.16522657871246338,
0.009573161602020264,
0.39178329706192017,
-0.012847625650465488,
-0.38523703813552856,
-0.02024843543767929,
0.1411222666501999,
0.06605831533670425,
0.02197563648223877,
-0.03927989676594734,
-0.04531735181808472,
-0.18241041898727417,
-0.2932910919189453,
0.21277183294296265,
0.07405507564544678,
0.1467665731906891,
0.14264404773712158,
-0.24928566813468933
] |
https://github.com/huggingface/datasets/issues/5705 | Hi! It can take some time to iterate over Parquet files as big as yours, convert the samples to Python, and find the first one that matches a filter predicate before yielding it... | Getting next item from IterableDataset took forever. | ### Describe the bug
I have a large dataset, about 500GB. The format of the dataset is parquet.
I then load the dataset and try to get the first item
```python
def get_one_item():
dataset = load_dataset("path/to/datafiles", split="train", cache_dir=".", streaming=True)
dataset = dataset.filter(lambda example: example['text'].startswith('Ar'))
print(next(iter(dataset)))
```
However, this function never finish. I waited ~10mins, the function was still running so I killed the process. I'm now using `line_profiler` to profile how long it would take to return one item. I'll be patient and wait for as long as it needs.
I suspect the filter operation is the reason why it took so long. Can I get some possible reasons behind this?
### Steps to reproduce the bug
Unfortunately without my data files, there is no way to reproduce this bug.
### Expected behavior
With `IteralbeDataset`, I expect the first item to be returned instantly.
### Environment info
- datasets version: 2.11.0
- python: 3.7.12 | 33 | Getting next item from IterableDataset took forever.
### Describe the bug
I have a large dataset, about 500GB. The format of the dataset is parquet.
I then load the dataset and try to get the first item
```python
def get_one_item():
dataset = load_dataset("path/to/datafiles", split="train", cache_dir=".", streaming=True)
dataset = dataset.filter(lambda example: example['text'].startswith('Ar'))
print(next(iter(dataset)))
```
However, this function never finish. I waited ~10mins, the function was still running so I killed the process. I'm now using `line_profiler` to profile how long it would take to return one item. I'll be patient and wait for as long as it needs.
I suspect the filter operation is the reason why it took so long. Can I get some possible reasons behind this?
### Steps to reproduce the bug
Unfortunately without my data files, there is no way to reproduce this bug.
### Expected behavior
With `IteralbeDataset`, I expect the first item to be returned instantly.
### Environment info
- datasets version: 2.11.0
- python: 3.7.12
Hi! It can take some time to iterate over Parquet files as big as yours, convert the samples to Python, and find the first one that matches a filter predicate before yielding it... | [
-0.17987139523029327,
-0.20914414525032043,
-0.07754886150360107,
0.08410445600748062,
0.05860540643334389,
-0.14915384352207184,
0.3101743757724762,
0.061246104538440704,
-0.12543584406375885,
0.10807236284017563,
0.48884737491607666,
0.10770764946937561,
-0.14268681406974792,
0.13011465966701508,
-0.06824107468128204,
0.06139875575900078,
-0.09888379275798798,
0.121013343334198,
0.29279980063438416,
-0.18819670379161835,
-0.05770435929298401,
0.2510058581829071,
-0.31299668550491333,
0.04240678995847702,
0.029087454080581665,
-0.1547827124595642,
-0.08918588608503342,
0.15042653679847717,
-0.05556885898113251,
-0.3697878122329712,
0.524155855178833,
-0.07313306629657745,
-0.1526287943124771,
0.4019497036933899,
-0.00012559350579977036,
-0.2617354393005371,
0.3819928765296936,
0.1189734935760498,
-0.33434033393859863,
-0.3470744490623474,
-0.0810956284403801,
-0.11102592945098877,
0.10401805490255356,
-0.28432828187942505,
-0.12362802028656006,
0.04747726023197174,
-0.018478166311979294,
-0.4401485323905945,
-0.1343582421541214,
0.1824590414762497,
0.022976558655500412,
-0.002483844757080078,
-0.23584115505218506,
0.00063319131731987,
0.2469572275876999,
0.008880909532308578,
0.08395250141620636,
0.0034508854150772095,
0.6044979691505432,
0.01914317160844803,
0.30175289511680603,
0.2342478334903717,
-0.08046016097068787,
0.17315109074115753,
0.2409466803073883,
-0.03735525906085968,
0.11996424198150635,
-0.23929837346076965,
0.27454304695129395,
0.07270989567041397,
0.33056312799453735,
0.08921505510807037,
-0.2320021539926529,
-0.5355414748191833,
-0.10380983352661133,
-0.5743399262428284,
0.15841038525104523,
0.09425541013479233,
-0.31711602210998535,
-0.05306476727128029,
0.0166286900639534,
-0.11877696961164474,
-0.025765031576156616,
0.08789953589439392,
-0.3199771046638489,
0.23199883103370667,
-0.19878874719142914,
0.21046724915504456,
0.19305461645126343,
-0.02656254917383194,
0.19377338886260986,
-0.1346050649881363,
0.30518028140068054,
0.27058956027030945,
-0.37669479846954346,
-0.0974007323384285,
0.2605828046798706,
0.2875957489013672,
0.003943435847759247,
0.2861495614051819,
0.19563709199428558,
-0.08276596665382385,
0.07028654217720032,
-0.18051525950431824,
0.43449199199676514,
0.06774857640266418,
-0.29308897256851196,
0.2183731645345688,
0.052955009043216705,
0.12190799415111542,
-0.36989444494247437,
-0.05663740262389183,
0.21915221214294434,
0.2989991009235382,
0.4335600733757019,
-0.1508912444114685,
0.2802875339984894,
-0.34129267930984497,
-0.28076350688934326,
0.21245792508125305,
-0.5404902696609497,
-0.10898014158010483,
0.017611805349588394,
0.020955629646778107,
-0.15587222576141357,
0.07302448153495789,
-0.10358623415231705,
-0.18037202954292297,
-0.17718589305877686,
0.13834251463413239,
-0.055987343192100525,
-0.21782749891281128,
-0.04082192853093147,
0.11875970661640167,
-0.01740005612373352,
-0.3413664698600769,
0.017199859023094177,
-0.2176770567893982,
-0.14272639155387878,
-0.0438355915248394,
0.36978960037231445,
-0.4735666811466217,
0.4619457423686981,
0.19796212017536163,
-0.2111508846282959,
0.33180519938468933,
-0.08841656893491745,
-0.26627299189567566,
-0.282013475894928,
-0.03957433998584747,
-0.27101144194602966,
-0.39769405126571655,
0.08991380780935287,
0.06283371150493622,
-0.11020714044570923,
0.10468874126672745,
0.06902474910020828,
0.08378098905086517,
-0.0012513287365436554,
-0.22583454847335815,
-0.1390881985425949,
-0.25410911440849304,
-0.6918461322784424,
0.010750088840723038,
0.03659915179014206,
0.3013174831867218,
-0.595698356628418,
0.17734552919864655,
-0.5993508696556091,
0.22310271859169006,
0.35787010192871094,
0.3042686879634857,
0.006088331341743469,
0.4280563294887543,
-0.5300092697143555,
0.19413608312606812,
0.35451096296310425,
0.10995281487703323,
-0.5380861759185791,
0.38765519857406616,
-0.4091743528842926,
0.8039833307266235,
0.009399741888046265,
-0.04604950547218323,
0.48258867859840393,
-0.35068240761756897,
0.29063063859939575,
0.25224563479423523,
-0.3399656116962433,
-0.042701929807662964,
-0.12500989437103271,
0.11375769972801208,
0.10873353481292725,
0.04671269655227661,
-0.08006195724010468,
0.24040648341178894,
0.0544460192322731,
0.01762545481324196,
0.42549699544906616,
0.22350254654884338,
-0.0742870569229126,
0.18575941026210785,
0.26438337564468384,
0.25412753224372864,
0.31414473056793213,
-0.21784543991088867,
-0.05187895521521568,
0.12158931791782379,
0.38304412364959717,
-0.2828831076622009,
-0.07901172339916229,
-0.11116202920675278,
-0.2519642412662506,
0.43647438287734985,
-0.11924902349710464,
-0.194724440574646,
-0.0831487700343132,
0.5602340698242188,
0.08978299796581268,
-0.20649220049381256,
-0.1104959174990654,
0.4683054983615875,
-0.22931629419326782,
-0.16021089255809784,
-0.3268517553806305,
0.035062678158283234,
0.44035181403160095,
-0.03692062199115753,
0.10120870172977448,
0.17465272545814514,
0.18632365763187408,
-0.24784106016159058,
-0.0944896936416626,
0.09210608899593353,
0.2793673276901245,
-0.027691904455423355,
0.2072198987007141,
0.43365317583084106,
-0.02237306348979473,
-0.000002808868885040283,
-0.17314626276493073,
0.429454505443573,
0.22303739190101624,
-0.1706313192844391,
-0.3620576858520508,
0.251764714717865,
-0.07498715817928314,
0.6983276605606079,
0.12547920644283295,
-0.15729033946990967,
0.3267476558685303,
0.1650669276714325,
-0.33885034918785095,
0.10103355348110199,
0.5388030409812927,
-0.2325701117515564,
0.29917624592781067,
0.13590729236602783,
-0.4002348780632019,
0.38285958766937256,
0.7754499912261963,
-0.1092861145734787,
-0.2402636855840683,
0.3899904787540436,
0.3135705590248108,
-0.05425569415092468,
0.1402699053287506,
0.16663381457328796,
0.31331729888916016,
0.08076868951320648,
0.19532686471939087,
-0.1655452400445938,
0.06314326822757721,
-0.006564997136592865,
0.04908871278166771,
0.3077560067176819,
0.24060538411140442,
-0.005693882703781128,
0.30703336000442505,
0.01925045996904373,
-0.12871529161930084,
-0.27636057138442993,
-0.2651212811470032,
0.20594081282615662,
-0.08481311053037643,
0.24097205698490143,
-0.1371961534023285,
0.008849263191223145,
-0.12246326357126236,
0.05869659036397934,
0.19772619009017944,
-0.32552260160446167,
-0.32313254475593567,
0.3054100275039673,
0.22979635000228882,
-0.08516331017017365,
0.14180414378643036,
0.4030371308326721,
0.28835397958755493,
-0.1319698989391327,
-0.33846554160118103,
0.008436638861894608,
-0.38707900047302246,
-0.09580044448375702,
0.07765292376279831,
0.007472440600395203,
0.3295520842075348,
0.21392017602920532,
-0.12017849087715149,
-0.2820970416069031,
-0.3330892324447632,
0.11791560053825378,
0.1791747659444809,
0.3804519772529602,
0.2592325210571289,
0.24787695705890656,
-0.08461566269397736,
0.018419772386550903,
-0.10568618774414062,
0.21583035588264465,
0.015094317495822906,
0.1200883612036705,
-0.14743572473526,
-0.004712976515293121,
0.2887166142463684,
-0.10657243430614471,
-0.20615260303020477,
-0.022534769028425217,
0.2612228989601135,
0.16112294793128967,
0.12623907625675201,
-0.14765413105487823,
-0.259115606546402,
0.06383487582206726,
0.009788040071725845,
0.08484181016683578,
-0.04970806837081909,
-0.35020092129707336,
0.21077534556388855,
0.1264684796333313,
-0.2013798952102661,
-0.2849019765853882,
-0.18543435633182526,
-0.03782442957162857,
0.19507881999015808,
-0.5238367319107056,
0.06566980481147766,
-0.28156453371047974,
-0.08332131803035736,
-0.1931307166814804,
-0.3090614676475525,
0.3537587821483612,
-0.13210871815681458,
0.09818197041749954,
-0.11711248755455017,
-0.18885868787765503,
0.08694259822368622,
-0.10081462562084198,
0.10012321174144745,
0.23793134093284607,
0.7204938530921936,
0.1814957857131958,
0.36363962292671204,
0.39608830213546753,
0.3438025116920471,
0.13998980820178986,
-0.012165647931396961,
-0.11451646685600281,
-0.399189293384552,
-0.5844032168388367,
-0.04269969463348389,
-0.0943112000823021,
-0.3834351599216461,
0.23926647007465363,
-0.00665915384888649,
-0.3654634952545166,
0.013883627951145172,
0.028245367109775543,
-0.08964136987924576,
-0.3158547282218933,
-0.11566413938999176,
-0.03501657396554947,
0.18934452533721924,
0.31943124532699585,
0.10276401787996292,
-0.16227838397026062,
-0.08275201916694641,
-0.11218295991420746,
-0.010519463568925858,
0.24747596681118011,
-0.026220977306365967,
-0.12274381518363953,
-0.14075328409671783,
-0.2862054407596588,
-0.004205450415611267,
0.10066929459571838,
0.22609396278858185,
-0.00474344938993454,
-0.16159576177597046,
0.19958755373954773,
-0.33655065298080444,
0.9729869365692139,
0.06363226473331451,
0.24989007413387299,
0.07045359909534454,
-0.3235076367855072,
-0.21949991583824158,
0.000790908932685852,
-0.21275730431079865,
0.7906367778778076,
0.33088600635528564,
0.4656715989112854,
-0.24142932891845703,
-0.11743147671222687,
0.35308361053466797,
0.24705086648464203,
-0.0030335336923599243,
-0.09257733821868896,
-0.18889379501342773,
-0.16675323247909546,
-0.14560136198997498,
0.21006906032562256,
-0.25117263197898865,
0.36367207765579224,
0.15371322631835938,
-0.4422805905342102,
-0.046870552003383636,
-0.19295606017112732,
0.04282085597515106,
-0.11043746769428253,
0.06247731298208237,
-0.0909435898065567,
0.5206153392791748,
0.1198732852935791,
0.15776723623275757,
-0.34822604060173035,
0.48862236738204956,
0.3228447735309601,
-0.3446463346481323,
0.43658584356307983,
-0.14509423077106476,
0.2530045211315155,
0.5631497502326965,
-0.22926047444343567,
0.09991580247879028,
-0.1723499298095703,
0.4289177358150482,
-0.052246637642383575,
-0.024365287274122238,
0.34890449047088623,
0.11875349283218384,
-0.43474480509757996,
-0.46566903591156006,
0.24234655499458313,
-0.08870886266231537,
-0.10356439650058746,
0.6341106295585632,
0.007335588335990906,
0.016863085329532623,
0.38217222690582275,
-0.14736858010292053,
1.021949291229248,
-0.011816229671239853,
-0.16649146378040314,
-0.007746588438749313,
-0.1336410939693451,
-0.10951098799705505,
-0.08015231788158417,
-0.09307213127613068,
0.005001254379749298,
-0.2702125608921051,
-0.0006345883011817932,
-0.03761014714837074,
-0.03304269164800644,
0.22590765357017517,
-0.02299710363149643,
0.1969752162694931,
0.21779438853263855,
-0.27292197942733765,
0.1248597577214241,
0.4615902900695801,
-0.1277620494365692,
-0.030677083879709244,
-0.2522861063480377,
-0.02986692264676094,
0.2367754578590393,
0.07353746891021729,
0.022808726876974106,
0.1615888625383377,
0.32102102041244507,
-0.13830529153347015,
-0.40620678663253784,
-0.059942591935396194,
-0.3495122790336609,
-0.21064308285713196,
0.01868489943444729,
-0.5151012539863586,
-0.19760647416114807,
-0.2586333751678467,
-0.23921097815036774,
0.24663177132606506,
-0.09192709624767303,
0.29181963205337524,
0.2173081934452057,
0.285348117351532,
0.3108767867088318,
-0.296564519405365,
0.39488762617111206,
0.019184038043022156,
0.11336086690425873,
-0.07061035931110382,
-0.1990177482366562,
-0.2626835107803345,
0.052192553877830505,
0.054362017661333084,
0.4978381395339966,
0.05165399983525276,
-0.2492327094078064,
0.18525858223438263,
-0.05764661729335785,
-0.164999857544899,
-0.025868665426969528,
-0.012914679944515228,
-0.06590916216373444,
0.1631036102771759,
-0.025088390335440636,
-0.4881957173347473,
-0.06694464385509491,
0.1857234239578247,
0.061607152223587036,
0.27011024951934814,
0.5544105768203735,
0.25825774669647217,
-0.19087040424346924,
-0.09442094713449478,
0.045300230383872986,
0.20494839549064636,
-0.10478454828262329,
0.4342212677001953,
-0.1532401293516159,
0.45013463497161865,
0.1093958169221878,
0.14231674373149872,
-0.09995101392269135,
-0.2845717966556549,
-0.5973257422447205,
-0.6345387101173401,
0.1571623980998993,
-0.09134745597839355,
0.19633974134922028,
-0.019347259774804115,
-0.13004322350025177,
-0.2031923532485962,
0.019700728356838226,
-0.10586067289113998,
-0.16173215210437775,
-0.15706193447113037,
-0.155757874250412,
0.0798865556716919,
0.1967637538909912,
0.10946755111217499,
0.16007983684539795,
0.1757526993751526,
0.023332208395004272,
0.17994681000709534,
0.15539337694644928,
-0.1116713359951973,
-0.04724660515785217,
0.21225649118423462,
-0.15966850519180298,
0.10851694643497467,
-0.016627885401248932,
-0.29461830854415894,
-0.2917076051235199,
-0.31806623935699463,
0.11484761536121368,
-0.056285835802555084,
0.2145693004131317,
-0.6331172585487366,
0.3558814823627472,
-0.22866815328598022,
-0.12151457369327545,
-0.05423225834965706,
-0.17203879356384277,
-0.19917869567871094,
0.02394140511751175,
0.1966438889503479,
0.2464773952960968,
-0.005430474877357483,
0.11124648153781891,
0.07552089542150497,
0.07689189165830612,
-0.05018516629934311,
0.382518470287323,
-0.17375092208385468,
0.09169363230466843,
0.306977778673172,
0.39617636799812317,
0.33994606137275696,
-0.0013820566236972809,
-0.1132877767086029,
0.04610871896147728,
-0.008979571983218193,
-0.2700209319591522,
-0.22961261868476868,
-0.03612719476222992,
0.012233775109052658,
-0.11298643052577972,
0.16608035564422607,
-0.3146418333053589,
0.33939117193222046,
0.23235902190208435,
0.12807758152484894,
0.40377742052078247,
-0.3658582866191864,
-0.06293957680463791,
0.19906701147556305,
0.10473091155290604,
-0.04167500138282776,
0.18537017703056335,
0.16101635992527008,
0.013315442949533463,
0.8818395733833313,
0.04652176797389984,
0.356297105550766,
0.31956255435943604,
0.2260194718837738,
-0.07369126379489899,
-0.5157398581504822,
0.009628650732338428,
0.2359504997730255,
-0.008788883686065674,
0.18836389482021332,
0.12193985283374786,
-0.22449879348278046,
0.15964116156101227,
0.03461039438843727,
-0.2881808578968048,
0.049499742686748505,
0.17199793457984924,
0.06499379873275757,
0.021290607750415802,
-0.061636634171009064,
-0.11323678493499756,
0.1337813287973404,
-0.03764425218105316,
0.05361838638782501,
-0.005700506269931793,
-0.07927346229553223,
0.10985852777957916,
-0.31545859575271606,
-0.1706177294254303,
-0.47753021121025085,
0.1984786093235016,
-0.34291282296180725,
0.24524475634098053,
-0.2863934338092804,
0.2416737973690033,
-0.11924439668655396,
-0.17097878456115723,
0.051139429211616516,
0.5533493757247925,
-0.10847955197095871,
0.07608731091022491,
-0.1365920603275299,
-0.3274368643760681,
-0.10164803266525269,
0.3328987956047058,
-0.31007158756256104,
0.22756437957286835,
0.33197715878486633,
-0.08019433915615082,
-0.02892448380589485,
0.20903494954109192,
0.3576243817806244,
0.08726164698600769,
-0.6828234791755676,
0.008640814572572708,
0.06974909454584122,
0.08726769685745239,
-0.42397764325141907,
0.25364115834236145,
-0.2524455487728119,
-0.24478405714035034,
0.16805914044380188,
-0.17976590991020203,
0.06977977603673935,
-0.033061400055885315,
0.039784181863069534,
-0.30046796798706055,
0.10263735055923462,
0.30381834506988525,
0.03612517565488815,
-0.18192876875400543,
-0.25820598006248474,
-0.652972936630249,
-0.16983717679977417,
-0.12288008630275726,
-0.039876747876405716,
0.38985535502433777,
0.49389827251434326,
-0.011027399450540543,
0.09758920967578888,
0.16588884592056274,
0.04163428395986557,
-0.10569414496421814,
0.2523179054260254,
-0.08614569902420044,
-0.43020620942115784,
0.020523307844996452,
-0.05744020640850067,
-0.18494859337806702,
-0.38978680968284607,
0.15506935119628906,
-0.3753059208393097,
-0.04004925116896629,
0.16603827476501465,
-0.48201072216033936,
0.10496567189693451,
0.027228374034166336,
0.1882489174604416,
0.0651860460639,
-0.07870602607727051,
0.1023644208908081,
0.13581064343452454,
-0.18472988903522491,
0.1091223657131195,
-0.07213927805423737,
0.332692950963974,
-0.18907712399959564,
0.23746415972709656,
-0.025761540979146957,
0.11182154715061188,
-0.027553066611289978,
-0.16888132691383362,
-0.024063386023044586,
-0.1463799923658371,
-0.1681108921766281,
0.16844308376312256,
-0.10718101263046265,
0.5582071542739868,
-0.22120222449302673,
0.03563431650400162,
0.08742235600948334,
0.10410983115434647,
-0.25846385955810547,
-0.14520098268985748,
0.6736264228820801,
-0.29025569558143616,
-0.32866570353507996,
-0.13505125045776367,
0.23904940485954285,
0.1428116112947464,
-0.2692670524120331,
-0.14033685624599457,
-0.2821047306060791,
0.5351840853691101,
-0.18125131726264954,
-0.04277176409959793,
0.2817891538143158,
0.015689875930547714,
0.3057265281677246,
-0.254311203956604,
0.19157244265079498,
0.16474509239196777,
-0.2090085744857788,
0.20055851340293884,
-0.11443604528903961
] |
https://github.com/huggingface/datasets/issues/5705 | Thanks @mariosasko, I figured it was the filter operation. I'm closing this issue because it is not a bug, it is the expected beheaviour. | Getting next item from IterableDataset took forever. | ### Describe the bug
I have a large dataset, about 500GB. The format of the dataset is parquet.
I then load the dataset and try to get the first item
```python
def get_one_item():
dataset = load_dataset("path/to/datafiles", split="train", cache_dir=".", streaming=True)
dataset = dataset.filter(lambda example: example['text'].startswith('Ar'))
print(next(iter(dataset)))
```
However, this function never finish. I waited ~10mins, the function was still running so I killed the process. I'm now using `line_profiler` to profile how long it would take to return one item. I'll be patient and wait for as long as it needs.
I suspect the filter operation is the reason why it took so long. Can I get some possible reasons behind this?
### Steps to reproduce the bug
Unfortunately without my data files, there is no way to reproduce this bug.
### Expected behavior
With `IteralbeDataset`, I expect the first item to be returned instantly.
### Environment info
- datasets version: 2.11.0
- python: 3.7.12 | 24 | Getting next item from IterableDataset took forever.
### Describe the bug
I have a large dataset, about 500GB. The format of the dataset is parquet.
I then load the dataset and try to get the first item
```python
def get_one_item():
dataset = load_dataset("path/to/datafiles", split="train", cache_dir=".", streaming=True)
dataset = dataset.filter(lambda example: example['text'].startswith('Ar'))
print(next(iter(dataset)))
```
However, this function never finish. I waited ~10mins, the function was still running so I killed the process. I'm now using `line_profiler` to profile how long it would take to return one item. I'll be patient and wait for as long as it needs.
I suspect the filter operation is the reason why it took so long. Can I get some possible reasons behind this?
### Steps to reproduce the bug
Unfortunately without my data files, there is no way to reproduce this bug.
### Expected behavior
With `IteralbeDataset`, I expect the first item to be returned instantly.
### Environment info
- datasets version: 2.11.0
- python: 3.7.12
Thanks @mariosasko, I figured it was the filter operation. I'm closing this issue because it is not a bug, it is the expected beheaviour. | [
-0.18538573384284973,
-0.2582932412624359,
-0.07853778451681137,
0.1548646092414856,
0.08571982383728027,
-0.11423484981060028,
0.4109131395816803,
0.027603592723608017,
-0.15032730996608734,
0.12063391506671906,
0.4529627561569214,
0.08845274150371552,
-0.08613321185112,
0.05451180785894394,
-0.08846192061901093,
0.025348931550979614,
-0.09177753329277039,
0.14580489695072174,
0.23894469439983368,
-0.2090330421924591,
-0.09473486989736557,
0.19556425511837006,
-0.34912803769111633,
0.03057132102549076,
-0.03545611351728439,
-0.12498171627521515,
-0.09500081837177277,
0.14775066077709198,
-0.010501326993107796,
-0.38314688205718994,
0.5693840980529785,
-0.11923966556787491,
-0.14447087049484253,
0.43808844685554504,
-0.000125504782772623,
-0.28242331743240356,
0.39081472158432007,
0.1407797932624817,
-0.41513749957084656,
-0.3254793882369995,
-0.11350076645612717,
-0.10951295495033264,
0.1145801842212677,
-0.26828432083129883,
-0.13084791600704193,
0.08556997776031494,
-0.032560691237449646,
-0.4030701816082001,
-0.13553713262081146,
0.10001348704099655,
0.02520633675158024,
-0.04643900692462921,
-0.23181043565273285,
-0.01379808597266674,
0.18363504111766815,
-0.03624292463064194,
0.042103350162506104,
0.06410813331604004,
0.554862380027771,
0.08103229105472565,
0.3771970868110657,
0.21940743923187256,
-0.11059553921222687,
0.2948604226112366,
0.2834557294845581,
-0.0405181422829628,
0.01976807229220867,
-0.18419218063354492,
0.283120334148407,
0.09572958946228027,
0.41780948638916016,
0.07947752624750137,
-0.20436395704746246,
-0.5002117156982422,
-0.037033192813396454,
-0.5668203830718994,
0.1841696798801422,
0.035129040479660034,
-0.3484189808368683,
-0.058644115924835205,
-0.07353170961141586,
-0.11811468005180359,
-0.0861811414361,
0.15872055292129517,
-0.3110021948814392,
0.1851222664117813,
-0.16989144682884216,
0.22181184589862823,
0.171676903963089,
0.030328918248414993,
0.2002922147512436,
-0.17928002774715424,
0.3258249759674072,
0.2972700893878937,
-0.3435818552970886,
-0.06503983587026596,
0.19710133969783783,
0.2807268500328064,
0.008177056908607483,
0.24578328430652618,
0.1297169327735901,
-0.08792424201965332,
-0.04763851314783096,
-0.2185397446155548,
0.37209707498550415,
0.08431011438369751,
-0.2579963207244873,
0.25063344836235046,
0.12522205710411072,
0.1406068354845047,
-0.350490927696228,
-0.060019902884960175,
0.19647955894470215,
0.3386027216911316,
0.5035063028335571,
-0.10044807940721512,
0.25867271423339844,
-0.30623680353164673,
-0.2610885500907898,
0.17521898448467255,
-0.5664954781532288,
-0.10844588279724121,
-0.02478659711778164,
0.00008754804730415344,
-0.20861339569091797,
0.050895437598228455,
-0.08357750624418259,
-0.17893221974372864,
-0.13626790046691895,
0.2300926297903061,
-0.029942357912659645,
-0.2855014204978943,
-0.011561743915081024,
0.16691459715366364,
0.023006044328212738,
-0.3631599247455597,
-0.0025999583303928375,
-0.25305086374282837,
-0.2029481679201126,
-0.018703415989875793,
0.3773486912250519,
-0.4915112555027008,
0.48439520597457886,
0.17490118741989136,
-0.17398317158222198,
0.40366876125335693,
-0.10216712951660156,
-0.20145882666110992,
-0.26849228143692017,
0.013627502135932446,
-0.21238555014133453,
-0.41547277569770813,
0.06420484930276871,
0.06407413631677628,
-0.09781981259584427,
0.1495247781276703,
0.11857610940933228,
-0.01112627238035202,
0.057987768203020096,
-0.2109229564666748,
-0.07569774985313416,
-0.18643224239349365,
-0.7819018959999084,
-0.004199709743261337,
0.02930901199579239,
0.3538367748260498,
-0.6042705178260803,
0.14825963973999023,
-0.6074436902999878,
0.21219155192375183,
0.27884146571159363,
0.31809383630752563,
-0.03348477929830551,
0.44804343581199646,
-0.5599972605705261,
0.1708197444677353,
0.2461698055267334,
0.09799879789352417,
-0.6101221442222595,
0.35822248458862305,
-0.4115007817745209,
0.780866265296936,
-0.08728694915771484,
0.05035743862390518,
0.45982009172439575,
-0.34074950218200684,
0.3725682199001312,
0.28973788022994995,
-0.3174508213996887,
-0.04820132255554199,
-0.08447969704866409,
0.04680653661489487,
0.1359773427248001,
0.0336938351392746,
-0.12352441251277924,
0.2667364478111267,
0.03607938066124916,
-0.0029015876352787018,
0.4560590088367462,
0.21476569771766663,
-0.05828090012073517,
0.20993760228157043,
0.2741554379463196,
0.2321387529373169,
0.29710566997528076,
-0.2176813781261444,
-0.14923426508903503,
0.1568225920200348,
0.4361482858657837,
-0.24775220453739166,
-0.11323300749063492,
-0.10110490024089813,
-0.2647703289985657,
0.41245630383491516,
-0.11154451966285706,
-0.16655325889587402,
-0.09259436279535294,
0.5656065344810486,
0.05124273896217346,
-0.17307591438293457,
-0.07447284460067749,
0.47241201996803284,
-0.20005403459072113,
-0.1371295154094696,
-0.33095264434814453,
0.015164338052272797,
0.4557609558105469,
-0.015039151534438133,
0.08952604234218597,
0.17502117156982422,
0.20446224510669708,
-0.2565118670463562,
-0.15235356986522675,
0.10853265225887299,
0.21914874017238617,
-0.0006390213966369629,
0.11046794056892395,
0.3585463762283325,
0.006973301991820335,
0.0759044736623764,
-0.1490032821893692,
0.43498173356056213,
0.22497831284999847,
-0.22355803847312927,
-0.3496285080909729,
0.23207229375839233,
-0.1299114227294922,
0.6537888050079346,
0.12584421038627625,
-0.1437108814716339,
0.3259793817996979,
0.15030355751514435,
-0.286571204662323,
0.0372113361954689,
0.4860175848007202,
-0.18923427164554596,
0.3469310700893402,
0.1911061555147171,
-0.34677785634994507,
0.39773285388946533,
0.855887770652771,
-0.12884891033172607,
-0.18270961940288544,
0.3610834777355194,
0.23548860847949982,
-0.02231675386428833,
0.20394335687160492,
0.20800946652889252,
0.399048388004303,
0.05775636062026024,
0.15207532048225403,
-0.1822993904352188,
0.07074999064207077,
-0.025502748787403107,
0.05307188630104065,
0.24979855120182037,
0.2714044153690338,
0.011250785551965237,
0.28650781512260437,
-0.0017504263669252396,
-0.07927142828702927,
-0.27874094247817993,
-0.2444402575492859,
0.20452088117599487,
-0.05100172013044357,
0.17974461615085602,
-0.1473160684108734,
-0.012788631021976471,
-0.09194332361221313,
-0.07140937447547913,
0.21623477339744568,
-0.2699768543243408,
-0.3321514427661896,
0.3040769100189209,
0.28051042556762695,
0.001021459698677063,
0.12256371974945068,
0.32476502656936646,
0.2972949147224426,
-0.13240332901477814,
-0.3262643814086914,
0.046479951590299606,
-0.3775493800640106,
-0.09322378784418106,
0.036048125475645065,
-0.012546394020318985,
0.34111058712005615,
0.21633034944534302,
-0.15263761579990387,
-0.2028096616268158,
-0.22122541069984436,
0.1398880034685135,
0.17361660301685333,
0.3330708146095276,
0.2574663460254669,
0.3087605834007263,
-0.0649518296122551,
0.053107865154743195,
-0.09147319942712784,
0.20174534618854523,
0.027991168200969696,
0.12639343738555908,
-0.176479771733284,
-0.04896758496761322,
0.26446372270584106,
-0.12664730846881866,
-0.21208326518535614,
0.013866528868675232,
0.29544711112976074,
0.13096866011619568,
0.12887196242809296,
-0.06939394772052765,
-0.2328183352947235,
0.06144322082400322,
0.12343247979879379,
0.052806951105594635,
-0.04551214352250099,
-0.30789583921432495,
0.2301260232925415,
0.13231328129768372,
-0.19129489362239838,
-0.29268699884414673,
-0.1787613034248352,
0.001657766755670309,
0.17383360862731934,
-0.4948539137840271,
0.06515887379646301,
-0.3249976336956024,
-0.024401262402534485,
-0.24602968990802765,
-0.34715667366981506,
0.377103716135025,
-0.11499732732772827,
0.0895046666264534,
-0.1301891952753067,
-0.18288470804691315,
0.08561185002326965,
-0.17980630695819855,
0.035985443741083145,
0.23076102137565613,
0.6971215009689331,
0.1589892953634262,
0.38237661123275757,
0.4293622076511383,
0.3165143132209778,
0.09092523157596588,
-0.03674733266234398,
-0.1447916477918625,
-0.3912871479988098,
-0.6139876246452332,
-0.02423940785229206,
-0.09487420320510864,
-0.39157330989837646,
0.18551655113697052,
0.015543103218078613,
-0.33068639039993286,
0.037031516432762146,
0.007269047200679779,
-0.07491742074489594,
-0.3139781653881073,
-0.15271860361099243,
-0.08363277465105057,
0.18245771527290344,
0.33080238103866577,
0.13894127309322357,
-0.16608107089996338,
-0.12776437401771545,
-0.11839018762111664,
-0.0430002324283123,
0.2635743021965027,
-0.10744039714336395,
-0.13838987052440643,
-0.17047415673732758,
-0.27793484926223755,
0.019965097308158875,
0.15454551577568054,
0.2584332525730133,
0.0015389397740364075,
-0.10894676297903061,
0.18665283918380737,
-0.24768656492233276,
0.8675096035003662,
0.061359770596027374,
0.2562284767627716,
0.04633186012506485,
-0.260804146528244,
-0.24503499269485474,
0.006495773792266846,
-0.16595758497714996,
0.8405011892318726,
0.33532869815826416,
0.46064963936805725,
-0.22955158352851868,
-0.10828298330307007,
0.42024320363998413,
0.29188573360443115,
-0.004177279770374298,
-0.17323067784309387,
-0.1908949911594391,
-0.15130017697811127,
-0.16670289635658264,
0.16511547565460205,
-0.31573301553726196,
0.3034995198249817,
0.07733520865440369,
-0.5359408259391785,
0.005742130801081657,
-0.18060168623924255,
0.01603534445166588,
-0.1385076344013214,
0.004411641508340836,
-0.12219790369272232,
0.5675562620162964,
0.1245361715555191,
0.09081435203552246,
-0.2897661328315735,
0.49406465888023376,
0.313045471906662,
-0.3442701995372772,
0.38578158617019653,
-0.17648693919181824,
0.1487720012664795,
0.5409497618675232,
-0.27353599667549133,
0.16463276743888855,
-0.14052757620811462,
0.43084147572517395,
-0.0020584650337696075,
-0.17034482955932617,
0.36032533645629883,
0.13818934559822083,
-0.4156196415424347,
-0.4892111122608185,
0.21007147431373596,
-0.11454686522483826,
-0.11901465803384781,
0.6828749179840088,
-0.11127393692731857,
0.014245707541704178,
0.28570353984832764,
-0.16080887615680695,
0.9905635118484497,
-0.019002556800842285,
-0.15670515596866608,
0.04373642057180405,
-0.10515300929546356,
-0.14269010722637177,
0.022811606526374817,
-0.08282427489757538,
-0.0672101080417633,
-0.25263431668281555,
-0.021202094852924347,
-0.02525840699672699,
-0.06034758314490318,
0.1832982450723648,
-0.03457599878311157,
0.15175123512744904,
0.16685137152671814,
-0.2008362114429474,
0.08416938781738281,
0.43899205327033997,
-0.19006723165512085,
-0.07669638842344284,
-0.26858001947402954,
-0.02298888750374317,
0.24272170662879944,
0.09637957811355591,
0.0001934729516506195,
0.2036166936159134,
0.2800982594490051,
-0.15386831760406494,
-0.40647396445274353,
-0.03508784994482994,
-0.40705060958862305,
-0.18662285804748535,
0.036968834698200226,
-0.494648814201355,
-0.21884621679782867,
-0.17436841130256653,
-0.1918696016073227,
0.21981805562973022,
-0.125034362077713,
0.26691266894340515,
0.14890286326408386,
0.341348260641098,
0.3221130669116974,
-0.3324008584022522,
0.3740130066871643,
0.02972797304391861,
0.04897764325141907,
-0.05708777904510498,
-0.16979621350765228,
-0.2669767439365387,
0.05685661733150482,
0.04468430578708649,
0.487399697303772,
0.001887105405330658,
-0.23913036286830902,
0.16707423329353333,
-0.023537535220384598,
-0.1772938072681427,
-0.019410528242588043,
0.011172734200954437,
-0.017186494544148445,
0.16730430722236633,
-0.05446288362145424,
-0.4717031717300415,
-0.051834069192409515,
0.24785615503787994,
0.11398945748806,
0.2598159909248352,
0.5836364030838013,
0.28658929467201233,
-0.17160949110984802,
-0.09794621169567108,
0.09086056053638458,
0.1769695281982422,
-0.13390621542930603,
0.421854168176651,
-0.14484523236751556,
0.5486183762550354,
0.055595558136701584,
0.17329666018486023,
-0.11759349703788757,
-0.2684694230556488,
-0.6120443344116211,
-0.6179368495941162,
0.07821544259786606,
-0.06216336414217949,
0.24772444367408752,
0.006570188328623772,
-0.19810280203819275,
-0.18067772686481476,
0.035718925297260284,
-0.08103405684232712,
-0.16342057287693024,
-0.17495694756507874,
-0.1773158311843872,
0.06763485074043274,
0.15845878422260284,
0.060859277844429016,
0.1971878558397293,
0.14284026622772217,
0.04144264757633209,
0.1800096035003662,
0.1560123860836029,
-0.10804452002048492,
-0.06254112720489502,
0.2164325714111328,
-0.16337719559669495,
0.04841236770153046,
-0.0521390438079834,
-0.32846707105636597,
-0.2855164706707001,
-0.31303122639656067,
0.12127499282360077,
0.006669767200946808,
0.19106270372867584,
-0.5710250735282898,
0.29929298162460327,
-0.14123739302158356,
-0.1182422935962677,
-0.027413826435804367,
-0.2559267282485962,
-0.09409680962562561,
-0.006394106894731522,
0.17189443111419678,
0.2813231348991394,
0.018506139516830444,
0.05816081166267395,
0.0658780112862587,
0.08189091831445694,
0.010146025568246841,
0.4059447646141052,
-0.2216842919588089,
0.11477871984243393,
0.26990780234336853,
0.43331220746040344,
0.29165345430374146,
-0.028298908844590187,
-0.07754983007907867,
-0.010583564639091492,
0.01214458979666233,
-0.2570560872554779,
-0.25804296135902405,
-0.018583811819553375,
-0.03859811648726463,
-0.1318555474281311,
0.1789216250181198,
-0.3518603444099426,
0.30275797843933105,
0.25396206974983215,
0.08631813526153564,
0.34334129095077515,
-0.44232457876205444,
-0.1313067376613617,
0.23963281512260437,
0.08297160267829895,
-0.013573242351412773,
0.18898144364356995,
0.17212225496768951,
0.061455149203538895,
0.8911692500114441,
0.08609720319509506,
0.27935174107551575,
0.2761722803115845,
0.23872533440589905,
-0.007954146713018417,
-0.5266134738922119,
-0.020478811115026474,
0.19982588291168213,
-0.13118207454681396,
0.147620290517807,
0.12877951562404633,
-0.20388278365135193,
0.06827148795127869,
0.06393615156412125,
-0.2798803448677063,
-0.01869233325123787,
0.17528720200061798,
0.09965349733829498,
0.007490232586860657,
-0.0036193951964378357,
-0.10771805047988892,
0.1254117339849472,
-0.053788453340530396,
0.10237952321767807,
0.053259722888469696,
-0.07703571021556854,
0.06323867291212082,
-0.32879552245140076,
-0.079374760389328,
-0.3798082768917084,
0.1864785999059677,
-0.33526813983917236,
0.18352049589157104,
-0.26768940687179565,
0.288451611995697,
-0.20474287867546082,
-0.13701878488063812,
0.02241784706711769,
0.5981289148330688,
-0.07039886713027954,
0.14027242362499237,
-0.1243157833814621,
-0.33431321382522583,
-0.10071954131126404,
0.37824544310569763,
-0.2488842010498047,
0.23107841610908508,
0.2838340103626251,
-0.059765711426734924,
-0.03615248575806618,
0.3054703176021576,
0.33149954676628113,
0.09786926209926605,
-0.6684603095054626,
0.05091758444905281,
0.03297250345349312,
-0.022731304168701172,
-0.45348477363586426,
0.23371711373329163,
-0.19462157785892487,
-0.1913776397705078,
0.1791137456893921,
-0.1903224140405655,
0.08312815427780151,
-0.10400377213954926,
0.03367257118225098,
-0.33392930030822754,
0.05681686848402023,
0.32004085183143616,
0.13588128983974457,
-0.1715993583202362,
-0.2477383017539978,
-0.6037541627883911,
-0.14361554384231567,
-0.0876612514257431,
-0.005072750151157379,
0.345283567905426,
0.43539172410964966,
-0.05961078405380249,
0.05918845534324646,
0.22336506843566895,
0.0366414412856102,
-0.07256432622671127,
0.31461450457572937,
-0.06951175630092621,
-0.47218140959739685,
0.023554878309369087,
-0.08747520297765732,
-0.21358050405979156,
-0.45720893144607544,
0.16478899121284485,
-0.36711692810058594,
-0.06275643408298492,
0.1175406277179718,
-0.4572097659111023,
0.15762658417224884,
0.055792685598134995,
0.28593990206718445,
0.1091078370809555,
-0.08406349271535873,
0.11175323277711868,
0.08351963013410568,
-0.14958339929580688,
0.15227478742599487,
-0.047795265913009644,
0.3070179522037506,
-0.1419234722852707,
0.2282894253730774,
-0.007264073938131332,
0.13159093260765076,
-0.04055935889482498,
-0.11457806825637817,
-0.022213414311408997,
-0.08308546245098114,
-0.15827171504497528,
0.167086660861969,
-0.1673814207315445,
0.5697551369667053,
-0.2098797857761383,
0.05089984089136124,
0.0873645544052124,
0.13158252835273743,
-0.29664063453674316,
-0.07363167405128479,
0.6507284641265869,
-0.2199283242225647,
-0.3289233446121216,
-0.1042618602514267,
0.26767879724502563,
0.12520600855350494,
-0.3178158700466156,
-0.17422325909137726,
-0.305992066860199,
0.5967216491699219,
-0.17515188455581665,
-0.07176077365875244,
0.31016069650650024,
0.06970074772834778,
0.31982287764549255,
-0.2457328587770462,
0.32214975357055664,
0.10870890319347382,
-0.2199675738811493,
0.2279408574104309,
-0.08666044473648071
] |
https://github.com/huggingface/datasets/issues/5702 | Hi ! `datasets` uses Apache Arrow as backend to store the data, and it requires each column to have a fixed type. Therefore a column can't have a mix of dicts/lists/strings.
Though it's possible to have one (nullable) field for each type:
```python
features = Features({
"text_alone": Value("string"),
"text_with_idxes": {
"text": Value("string"),
"idxes": Value("int64")
}
})
```
but you'd have to reformat your data fiels or define a [dataset loading script](https://huggingface.co/docs/datasets/dataset_script) to apply the appropriate parsing.
Alternatively we could explore supporting the Arrow [Union](https://arrow.apache.org/docs/python/generated/pyarrow.UnionType.html) type which could solve this issue, but I don't know if it's well supported in python and with the rest of the ecosystem like Parquet | Is it possible or how to define a `datasets.Sequence` that could potentially be either a dict, a str, or None? | ### Feature request
Hello! Apologies if my question sounds naive:
I was wondering if it’s possible, or how one would go about defining a 'datasets.Sequence' element in datasets.Features that could potentially be either a dict, a str, or None?
Specifically, I’d like to define a feature for a list that contains 18 elements, each of which has been pre-defined as either a `dict or None` or `str or None` - as demonstrated in the slightly misaligned data provided below:
```json
[
[
{"text":"老妇人","idxes":[0,1,2]},null,{"text":"跪","idxes":[3]},null,null,null,null,{"text":"在那坑里","idxes":[4,5,6,7]},null,null,null,null,null,null,null,null,null,null],
[
{"text":"那些水","idxes":[13,14,15]},null,{"text":"舀","idxes":[11]},null,null,null,null,null,{"text":"在那坑里","idxes":[4,5,6,7]},null,{"text":"出","idxes":[12]},null,null,null,null,null,null,null],
[
{"text":"水","idxes":[38]},
null,
{"text":"舀","idxes":[40]},
"假", // note this is just a standalone string
null,null,null,{"text":"坑里","idxes":[35,36]},null,null,null,null,null,null,null,null,null,null]]
```
### Motivation
I'm currently working with a dataset of the following structure and I couldn't find a solution in the [documentation](https://huggingface.co/docs/datasets/v2.11.0/en/package_reference/main_classes#datasets.Features).
```json
{"qid":"3-train-1058","context":"桑桑害怕了。从玉米地里走到田埂上,他遥望着他家那幢草房子里的灯光,知道母亲没有让他回家的意思,很伤感,有点想哭。但没哭,转身朝阿恕家走去。","corefs":[[{"text":"桑桑","idxes":[0,1]},{"text":"他","idxes":[17]}]],"non_corefs":[],"outputs":[[{"text":"他","idxes":[17]},null,{"text":"走","idxes":[11]},null,null,null,null,null,{"text":"从玉米地里","idxes":[6,7,8,9,10]},{"text":"到田埂上","idxes":[12,13,14,15]},null,null,null,null,null,null,null,null],[{"text":"他","idxes":[17]},null,{"text":"走","idxes":[66]},null,null,null,null,null,null,null,{"text":"转身朝阿恕家去","idxes":[60,61,62,63,64,65,67]},null,null,null,null,null,null,null],[{"text":"灯光","idxes":[30,31]},null,null,null,null,null,null,{"text":"草房子里","idxes":[25,26,27,28]},null,null,null,null,null,null,null,null,null,null],[{"text":"他","idxes":[17]},{"text":"他家那幢草房子","idxes":[21,22,23,24,25,26,27]},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"远"],[{"text":"他","idxes":[17]},{"text":"阿恕家","idxes":[63,64,65]},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"变近"]]}
```
### Your contribution
I'm going to provide the dataset at https://huggingface.co/datasets/2030NLP/SpaCE2022 . | 109 | Is it possible or how to define a `datasets.Sequence` that could potentially be either a dict, a str, or None?
### Feature request
Hello! Apologies if my question sounds naive:
I was wondering if it’s possible, or how one would go about defining a 'datasets.Sequence' element in datasets.Features that could potentially be either a dict, a str, or None?
Specifically, I’d like to define a feature for a list that contains 18 elements, each of which has been pre-defined as either a `dict or None` or `str or None` - as demonstrated in the slightly misaligned data provided below:
```json
[
[
{"text":"老妇人","idxes":[0,1,2]},null,{"text":"跪","idxes":[3]},null,null,null,null,{"text":"在那坑里","idxes":[4,5,6,7]},null,null,null,null,null,null,null,null,null,null],
[
{"text":"那些水","idxes":[13,14,15]},null,{"text":"舀","idxes":[11]},null,null,null,null,null,{"text":"在那坑里","idxes":[4,5,6,7]},null,{"text":"出","idxes":[12]},null,null,null,null,null,null,null],
[
{"text":"水","idxes":[38]},
null,
{"text":"舀","idxes":[40]},
"假", // note this is just a standalone string
null,null,null,{"text":"坑里","idxes":[35,36]},null,null,null,null,null,null,null,null,null,null]]
```
### Motivation
I'm currently working with a dataset of the following structure and I couldn't find a solution in the [documentation](https://huggingface.co/docs/datasets/v2.11.0/en/package_reference/main_classes#datasets.Features).
```json
{"qid":"3-train-1058","context":"桑桑害怕了。从玉米地里走到田埂上,他遥望着他家那幢草房子里的灯光,知道母亲没有让他回家的意思,很伤感,有点想哭。但没哭,转身朝阿恕家走去。","corefs":[[{"text":"桑桑","idxes":[0,1]},{"text":"他","idxes":[17]}]],"non_corefs":[],"outputs":[[{"text":"他","idxes":[17]},null,{"text":"走","idxes":[11]},null,null,null,null,null,{"text":"从玉米地里","idxes":[6,7,8,9,10]},{"text":"到田埂上","idxes":[12,13,14,15]},null,null,null,null,null,null,null,null],[{"text":"他","idxes":[17]},null,{"text":"走","idxes":[66]},null,null,null,null,null,null,null,{"text":"转身朝阿恕家去","idxes":[60,61,62,63,64,65,67]},null,null,null,null,null,null,null],[{"text":"灯光","idxes":[30,31]},null,null,null,null,null,null,{"text":"草房子里","idxes":[25,26,27,28]},null,null,null,null,null,null,null,null,null,null],[{"text":"他","idxes":[17]},{"text":"他家那幢草房子","idxes":[21,22,23,24,25,26,27]},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"远"],[{"text":"他","idxes":[17]},{"text":"阿恕家","idxes":[63,64,65]},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"变近"]]}
```
### Your contribution
I'm going to provide the dataset at https://huggingface.co/datasets/2030NLP/SpaCE2022 .
Hi ! `datasets` uses Apache Arrow as backend to store the data, and it requires each column to have a fixed type. Therefore a column can't have a mix of dicts/lists/strings.
Though it's possible to have one (nullable) field for each type:
```python
features = Features({
"text_alone": Value("string"),
"text_with_idxes": {
"text": Value("string"),
"idxes": Value("int64")
}
})
```
but you'd have to reformat your data fiels or define a [dataset loading script](https://huggingface.co/docs/datasets/dataset_script) to apply the appropriate parsing.
Alternatively we could explore supporting the Arrow [Union](https://arrow.apache.org/docs/python/generated/pyarrow.UnionType.html) type which could solve this issue, but I don't know if it's well supported in python and with the rest of the ecosystem like Parquet | [
0.0013286545872688293,
-0.11238649487495422,
-0.18370550870895386,
-0.0726836621761322,
0.01916148141026497,
0.018123596906661987,
0.2247791886329651,
-0.04078936576843262,
0.10549765825271606,
-0.12959596514701843,
0.4297468066215515,
0.08127593994140625,
-0.4116147458553314,
0.36901727318763733,
-0.29757338762283325,
0.07396682351827621,
0.11670725792646408,
0.28197598457336426,
0.394260048866272,
0.2274494469165802,
0.011408194899559021,
-0.04512014985084534,
-0.039365775883197784,
0.008863160386681557,
-0.19931238889694214,
-0.12468186020851135,
-0.07911209762096405,
-0.196306973695755,
-0.24389377236366272,
-0.4833894968032837,
0.33193591237068176,
0.5219366550445557,
-0.16256040334701538,
0.16611947119235992,
-0.00011826858826680109,
-0.12274699658155441,
0.4595295488834381,
-0.14057067036628723,
-0.37999752163887024,
-0.4181808531284332,
-0.8047535419464111,
-0.17045068740844727,
0.3488207757472992,
-0.1968783438205719,
-0.11356478929519653,
-0.15940967202186584,
0.006020808592438698,
-0.7096636295318604,
0.10913586616516113,
0.34011363983154297,
0.19133247435092926,
-0.010660111904144287,
-0.11527728289365768,
-0.030489355325698853,
0.32082557678222656,
0.6977832913398743,
-0.22119244933128357,
-0.280385285615921,
0.09845848381519318,
0.030964873731136322,
0.19400955736637115,
-0.11465474963188171,
-0.10038416087627411,
0.022955134510993958,
0.5098036527633667,
0.12339463829994202,
-0.3260034918785095,
-0.2403489649295807,
-0.2131671905517578,
0.41405314207077026,
0.5770474076271057,
-0.13394954800605774,
-0.3518106937408447,
-0.15083087980747223,
-0.10357841104269028,
-0.43473970890045166,
0.4136161208152771,
0.0405396968126297,
-0.20423538982868195,
0.05733378976583481,
-0.07687222212553024,
-0.047216832637786865,
-0.13299775123596191,
0.41747763752937317,
-0.5239792466163635,
0.08425471186637878,
0.01094958558678627,
-0.04393501207232475,
-0.3091064989566803,
-0.39560529589653015,
-0.16214683651924133,
-0.35438260436058044,
0.2027711570262909,
0.2781274914741516,
-0.3137683868408203,
-0.17882126569747925,
0.034585967659950256,
-0.3328208029270172,
0.10447265207767487,
0.22508525848388672,
0.22604990005493164,
0.0077414195984601974,
-0.32778307795524597,
-0.09231264889240265,
0.24259085953235626,
0.11699771136045456,
0.2930876612663269,
-0.35331350564956665,
0.09669069945812225,
0.13197870552539825,
0.08163639158010483,
0.10350467264652252,
0.13768085837364197,
-0.01894032582640648,
0.05767839401960373,
0.05708726868033409,
0.2629013955593109,
0.1852390170097351,
-0.1330917477607727,
0.24818210303783417,
-0.1850656121969223,
0.09840266406536102,
-0.07576973736286163,
-0.10958686470985413,
0.2412012815475464,
0.08178579062223434,
0.031362518668174744,
0.1587582230567932,
0.19766616821289062,
0.1629229635000229,
-0.05868954956531525,
0.23615096509456635,
-0.06812628358602524,
0.0007849298417568207,
0.018786169588565826,
0.04700402915477753,
-0.10457415133714676,
-0.0024818219244480133,
0.16980165243148804,
0.0421697199344635,
-0.07756298035383224,
-0.17273080348968506,
-0.13614919781684875,
0.15916188061237335,
-0.6493965983390808,
0.18911559879779816,
0.04114079475402832,
0.032764121890068054,
-0.146867573261261,
0.11558955162763596,
0.3665982782840729,
0.08071909844875336,
0.005852727219462395,
0.14917747676372528,
-0.5794878005981445,
0.29019445180892944,
-0.005455333739519119,
0.43202173709869385,
0.18917974829673767,
0.13668179512023926,
0.06895898282527924,
-0.0751936137676239,
-0.4131772816181183,
-0.13860216736793518,
-0.29931631684303284,
0.2548372745513916,
-0.37211883068084717,
-0.18708741664886475,
-0.0036829523742198944,
-0.13538137078285217,
-0.21924430131912231,
-0.08164376765489578,
0.04120895266532898,
-0.012148454785346985,
-0.27142640948295593,
0.32810282707214355,
0.296339213848114,
-0.009994082152843475,
0.07701597362756729,
0.1592893898487091,
-0.10851127654314041,
0.2043859362602234,
0.3162243366241455,
0.2834440767765045,
0.1753329336643219,
-0.1521303504705429,
0.18750810623168945,
0.1767895519733429,
0.011950762942433357,
-0.34988677501678467,
0.1503700613975525,
-0.43348923325538635,
0.42896586656570435,
-0.07989893108606339,
-0.09592406451702118,
0.004614613950252533,
-0.27421921491622925,
-0.20526158809661865,
-0.0892120748758316,
-0.20003561675548553,
0.2618680000305176,
0.3778058588504791,
0.1328161358833313,
0.16936835646629333,
-0.2724095582962036,
-0.5586175918579102,
-0.562287449836731,
0.08520981669425964,
0.1391720026731491,
0.05714457482099533,
-0.218892440199852,
-0.18404310941696167,
-0.0808057188987732,
0.06848262995481491,
-0.12145913392305374,
0.35469892621040344,
0.13342267274856567,
0.006993886083364487,
-0.009296774864196777,
0.008667603135108948,
-0.36339062452316284,
0.3776877224445343,
0.21656501293182373,
-0.014297964051365852,
-0.3454705774784088,
0.12996813654899597,
0.23211120069026947,
0.2684832513332367,
-0.00033173710107803345,
0.4091256856918335,
-0.06768664717674255,
0.2381124198436737,
0.1848650574684143,
-0.005406603217124939,
0.623772144317627,
-0.23367568850517273,
-0.10857914388179779,
0.15095576643943787,
0.18202374875545502,
-0.177358478307724,
-0.07182248681783676,
0.42924731969833374,
0.11516766250133514,
-0.11212563514709473,
-0.45628803968429565,
0.4663779139518738,
-0.0676906481385231,
0.3160928189754486,
-0.13646259903907776,
0.15679574012756348,
0.2777641713619232,
-0.006072580814361572,
-0.46708279848098755,
-0.35939130187034607,
0.1726987212896347,
0.16316911578178406,
0.055129870772361755,
0.30451205372810364,
-0.515321671962738,
-0.12896722555160522,
-0.20499807596206665,
0.09186987578868866,
0.16286326944828033,
0.409900963306427,
0.17412760853767395,
-0.11587436497211456,
-0.327125608921051,
-0.06525684893131256,
0.23174649477005005,
-0.09585583955049515,
0.07925431430339813,
-0.05944664031267166,
-0.04898405075073242,
-0.05698000267148018,
0.02779652550816536,
0.04153374955058098,
0.1519315242767334,
0.252038836479187,
0.40870583057403564,
-0.26716795563697815,
0.07554575800895691,
-0.4853360652923584,
0.15686824917793274,
-0.15186594426631927,
-0.22331233322620392,
-0.07242618501186371,
-0.31984952092170715,
-0.04850199446082115,
0.19665801525115967,
-0.3842989504337311,
-0.2867792248725891,
-0.25696876645088196,
0.09119313955307007,
0.004943845793604851,
0.028240568935871124,
-0.08871496468782425,
-0.07870559394359589,
0.08333591371774673,
0.040060676634311676,
-0.24339769780635834,
-0.06656870990991592,
-0.4092459976673126,
0.2796008288860321,
0.093495674431324,
-0.014655224978923798,
0.43297481536865234,
0.1649821400642395,
0.17546549439430237,
-0.26531505584716797,
-0.3692077100276947,
-0.05938434228301048,
-0.07765069603919983,
0.11528985947370529,
0.14931930601596832,
0.6153231263160706,
0.12017945945262909,
0.11888331174850464,
-0.0686279907822609,
0.0031155087053775787,
0.4473891854286194,
-0.39903736114501953,
-0.06523732841014862,
0.05506593734025955,
0.2606997787952423,
-0.03339950367808342,
0.10544230788946152,
-0.38559186458587646,
-0.19735081493854523,
0.3248087167739868,
0.16880947351455688,
0.07660995423793793,
0.08078143000602722,
-0.08338265120983124,
-0.23213139176368713,
0.24697983264923096,
-0.09761370718479156,
-0.2639283835887909,
0.27303868532180786,
0.2790047228336334,
-0.1491788923740387,
-0.1380925476551056,
0.007428593933582306,
-0.4548034071922302,
-0.036740247160196304,
0.3586331903934479,
-0.17990314960479736,
-0.04782242327928543,
-0.014536889269948006,
0.20121702551841736,
0.253944993019104,
-0.4636543095111847,
0.3547734320163727,
0.28026366233825684,
-0.03725464642047882,
-0.11871424317359924,
-0.08887562900781631,
0.22019106149673462,
0.030170012265443802,
-0.12307699024677277,
0.5388632416725159,
0.1697988212108612,
-0.17427559196949005,
0.25953051447868347,
0.10748784244060516,
-0.279982328414917,
0.35475394129753113,
-0.05671650171279907,
-0.09639360010623932,
-0.11878858506679535,
0.10245979577302933,
-0.3803563117980957,
0.10079964995384216,
-0.3455544710159302,
-0.013589054346084595,
-0.0001840554177761078,
0.0673641785979271,
0.005155831575393677,
0.5448271632194519,
0.2853075861930847,
0.014511965215206146,
0.03161352872848511,
-0.5938240885734558,
0.28591758012771606,
-0.0854463279247284,
-0.29109692573547363,
-0.25106483697891235,
-0.1410384327173233,
-0.25930848717689514,
0.19252093136310577,
0.20510269701480865,
-0.06402382999658585,
-0.6915515065193176,
0.012070395052433014,
-0.11481328308582306,
-0.17853303253650665,
0.36538615822792053,
0.4966619312763214,
-0.005475811660289764,
-0.05995848774909973,
-0.13061422109603882,
0.011009931564331055,
0.36552515625953674,
-0.12460896372795105,
-0.08505208790302277,
0.4382286071777344,
-0.1592671275138855,
-0.1402873396873474,
0.10753430426120758,
0.03741493821144104,
0.054911449551582336,
-0.20734889805316925,
0.1425113081932068,
-0.2824685275554657,
-0.16930127143859863,
-0.17292645573616028,
0.2980785369873047,
-0.12386785447597504,
-0.2667688727378845,
-0.10673400014638901,
-0.07002363353967667,
-0.0004116445779800415,
-0.1602512151002884,
0.2260020226240158,
0.137393981218338,
0.1917572021484375,
0.12165091931819916,
-0.4091196656227112,
0.07738730311393738,
0.2364601194858551,
-0.2908611595630646,
0.19107215106487274,
-0.15954485535621643,
0.1290040761232376,
-0.0764046311378479,
-0.04994878172874451,
0.04024457931518555,
0.11202265322208405,
0.2291441410779953,
-0.2747321128845215,
-0.0635678693652153,
-0.34618285298347473,
0.08553524315357208,
0.17320038378238678,
0.04690198227763176,
0.46797096729278564,
-0.09823548048734665,
-0.04240834340453148,
-0.4589942693710327,
-0.060063980519771576,
0.11308087408542633,
-0.09385564923286438,
-0.30588945746421814,
-0.4149457812309265,
0.21539197862148285,
0.20361824333667755,
-0.12390569597482681,
0.0760059654712677,
0.10249990969896317,
-0.2781367003917694,
0.2667427062988281,
0.2784164249897003,
0.7660712003707886,
0.10177990794181824,
0.14828744530677795,
0.060885727405548096,
-0.0767708569765091,
0.42657262086868286,
-0.10051238536834717,
0.0002998039126396179,
-0.20777732133865356,
-0.05714097246527672,
-0.38844966888427734,
-0.27008679509162903,
0.10392571985721588,
0.3138503432273865,
-0.09099030494689941,
0.28230971097946167,
-0.35295701026916504,
0.3944459557533264,
0.13211500644683838,
0.07800664007663727,
0.3781181871891022,
-0.15579676628112793,
-0.040755730122327805,
0.05149330198764801,
0.00017086323350667953,
0.07292909175157547,
-0.0820719450712204,
0.022602852433919907,
-0.0630517527461052,
0.023201607167720795,
-0.30650174617767334,
-0.4883297085762024,
0.1432521641254425,
0.0007531046867370605,
0.06473131477832794,
-0.46620285511016846,
0.4116920232772827,
0.3718913495540619,
0.22652316093444824,
-0.0689857080578804,
0.008158057928085327,
-0.14167681336402893,
0.2170325368642807,
0.12985682487487793,
-0.20972643792629242,
-0.23810262978076935,
0.20390063524246216,
0.1881476640701294,
0.08588710427284241,
0.16334408521652222,
-0.2356584668159485,
-0.10137742757797241,
0.06371572613716125,
0.03833000361919403,
-0.2122328281402588,
-0.20924915373325348,
-0.24398310482501984,
-0.10541192442178726,
0.41600367426872253,
-0.05701194703578949,
0.07378735393285751,
0.31691500544548035,
-0.023629091680049896,
-0.001173514872789383,
-0.16235226392745972,
0.07206770777702332,
0.0005889823660254478,
0.314853698015213,
0.45359596610069275,
-0.11283575743436813,
0.3065757155418396,
0.29256442189216614,
-0.4125487208366394,
-0.22934749722480774,
0.1367483139038086,
0.13221774995326996,
-0.04476681351661682,
0.3710365891456604,
0.043388575315475464,
-0.30899155139923096,
-0.3852527439594269,
0.4467199146747589,
-0.026830198243260384,
0.470181941986084,
0.3545626401901245,
-0.4446486532688141,
-0.2218635082244873,
0.2529105544090271,
0.04043218865990639,
0.41279861330986023,
-0.3642228841781616,
-0.11282867193222046,
-0.08457966148853302,
-0.25950703024864197,
-0.19413605332374573,
0.09247312694787979,
-0.3261963129043579,
0.11976897716522217,
0.20084932446479797,
0.10945172607898712,
-0.11426292359828949,
-0.11328620463609695,
0.11577539145946503,
-0.10528016835451126,
-0.18034468591213226,
-0.1401292085647583,
-0.09662425518035889,
0.17370010912418365,
0.00018965080380439758,
0.040448352694511414,
0.22541508078575134,
0.03423567861318588,
0.017248108983039856,
-0.09987680613994598,
-0.11649206280708313,
0.41890883445739746,
-0.12095325440168381,
0.05233505740761757,
0.15117914974689484,
-0.09164977818727493,
-0.29698508977890015,
0.022449791431427002,
0.3458302915096283,
0.07230669260025024,
-0.050476640462875366,
0.16045871376991272,
-0.20921169221401215,
0.12868821620941162,
-0.13158343732357025,
0.35904330015182495,
-0.21505820751190186,
-0.12753230333328247,
0.02419288083910942,
-0.10307036340236664,
0.13647541403770447,
0.19882798194885254,
0.4092826247215271,
0.3486570417881012,
-0.3227418065071106,
0.21699948608875275,
-0.09927035123109818,
0.10682778805494308,
-0.15454471111297607,
-0.11260154098272324,
0.37528449296951294,
0.057125333696603775,
0.28404536843299866,
0.26337140798568726,
0.2040477842092514,
0.13456638157367706,
-0.1532931625843048,
-0.1682327389717102,
-0.029284216463565826,
-0.05022565275430679,
0.1602911353111267,
0.21432657539844513,
0.19582755863666534,
-0.06883257627487183,
0.3128204047679901,
0.060043033212423325,
0.2967433035373688,
0.5811648368835449,
0.3451354503631592,
0.20588183403015137,
0.7448735237121582,
0.08092252910137177,
0.010582344606518745,
-0.21131284534931183,
0.06367350369691849,
0.4029303789138794,
0.26992833614349365,
-0.2103859782218933,
0.2952639162540436,
-0.25387877225875854,
0.09304365515708923,
0.03378648683428764,
-0.03341558948159218,
-0.07423026859760284,
0.139677956700325,
-0.36647453904151917,
-0.06937051564455032,
-0.38085755705833435,
-0.007547713816165924,
-0.3432232737541199,
0.07125340402126312,
-0.10081791877746582,
0.5724656581878662,
0.04003136232495308,
0.6747604608535767,
-0.3253381550312042,
0.6270232796669006,
-0.09403964132070541,
0.017019886523485184,
-0.08772411942481995,
0.08548792451620102,
0.20958887040615082,
0.1600906252861023,
0.6233978867530823,
-0.004530087113380432,
-0.04945952072739601,
0.0326751209795475,
-0.3505336344242096,
0.05586187541484833,
-0.374580442905426,
-0.29974445700645447,
-0.27140095829963684,
0.14360693097114563,
-0.07633329182863235,
0.1270296722650528,
0.4839472472667694,
0.125259667634964,
-0.029990974813699722,
0.33738836646080017,
0.4085348844528198,
0.03425335884094238,
-0.39666980504989624,
0.38603320717811584,
-0.14160433411598206,
0.022655926644802094,
0.15493839979171753,
0.25072476267814636,
0.008127517998218536,
-0.275726854801178,
0.29537883400917053,
0.18296031653881073,
0.30567362904548645,
0.42501968145370483,
0.07484184950590134,
-0.1579875499010086,
0.19606409966945648,
0.02030889131128788,
0.1530006229877472,
-0.15424564480781555,
-0.15646949410438538,
-0.3422579765319824,
-0.1361338496208191,
-0.1954953372478485,
-0.3301357626914978,
0.0817335993051529,
0.059985920786857605,
-0.20841318368911743,
0.20182275772094727,
-0.24202288687229156,
0.2000737488269806,
-0.40952473878860474,
0.2889111042022705,
-0.19156599044799805,
-0.11908921599388123,
0.24380338191986084,
0.15858742594718933,
-0.1790325939655304,
-0.22134709358215332,
-0.08694639801979065,
0.1503819227218628,
0.056495167315006256,
0.004152391105890274,
-0.0028868168592453003,
-0.12047247588634491,
-0.10153031349182129,
-0.07389430701732635,
0.06014011800289154,
0.39439165592193604,
0.16314199566841125,
-0.1864873468875885,
-0.10719646513462067,
-0.002567969262599945,
-0.08758373558521271,
0.5948059558868408,
0.030903436243534088,
0.641343891620636,
-0.2908652424812317,
0.5169483423233032,
0.10816236585378647,
-0.11659015715122223,
-0.06723656505346298,
0.13263916969299316,
-0.610408365726471,
0.39357104897499084,
-0.4607710838317871,
0.18649177253246307,
-0.00047117844223976135,
0.20513120293617249,
-0.115089550614357,
0.2311171591281891,
0.06758905947208405,
-0.2674331068992615,
0.11127158999443054,
0.028641972690820694,
-0.3292495608329773,
0.09162652492523193,
-0.17921271920204163,
0.2811205983161926,
-0.11963827908039093,
-0.12370553612709045,
0.01888088881969452,
0.3390886187553406,
-0.1775231808423996,
-0.09195668995380402,
-0.21324338018894196,
-0.10815490782260895,
-0.18127895891666412,
-0.2617175579071045,
0.11864878237247467,
-0.19966435432434082,
0.08285768330097198,
-0.2694900929927826,
-0.30330848693847656
] |
https://github.com/huggingface/datasets/issues/5702 | @lhoestq Thank you! I further wonder if it's possible to use list subscripts as keys of a feature? Like
```python
features = Features({
0: Value("string"),
1: {
"text": Value("string"),
"idxes": [Value("int64")]
},
2: Value("string"),
# ...
})
``` | Is it possible or how to define a `datasets.Sequence` that could potentially be either a dict, a str, or None? | ### Feature request
Hello! Apologies if my question sounds naive:
I was wondering if it’s possible, or how one would go about defining a 'datasets.Sequence' element in datasets.Features that could potentially be either a dict, a str, or None?
Specifically, I’d like to define a feature for a list that contains 18 elements, each of which has been pre-defined as either a `dict or None` or `str or None` - as demonstrated in the slightly misaligned data provided below:
```json
[
[
{"text":"老妇人","idxes":[0,1,2]},null,{"text":"跪","idxes":[3]},null,null,null,null,{"text":"在那坑里","idxes":[4,5,6,7]},null,null,null,null,null,null,null,null,null,null],
[
{"text":"那些水","idxes":[13,14,15]},null,{"text":"舀","idxes":[11]},null,null,null,null,null,{"text":"在那坑里","idxes":[4,5,6,7]},null,{"text":"出","idxes":[12]},null,null,null,null,null,null,null],
[
{"text":"水","idxes":[38]},
null,
{"text":"舀","idxes":[40]},
"假", // note this is just a standalone string
null,null,null,{"text":"坑里","idxes":[35,36]},null,null,null,null,null,null,null,null,null,null]]
```
### Motivation
I'm currently working with a dataset of the following structure and I couldn't find a solution in the [documentation](https://huggingface.co/docs/datasets/v2.11.0/en/package_reference/main_classes#datasets.Features).
```json
{"qid":"3-train-1058","context":"桑桑害怕了。从玉米地里走到田埂上,他遥望着他家那幢草房子里的灯光,知道母亲没有让他回家的意思,很伤感,有点想哭。但没哭,转身朝阿恕家走去。","corefs":[[{"text":"桑桑","idxes":[0,1]},{"text":"他","idxes":[17]}]],"non_corefs":[],"outputs":[[{"text":"他","idxes":[17]},null,{"text":"走","idxes":[11]},null,null,null,null,null,{"text":"从玉米地里","idxes":[6,7,8,9,10]},{"text":"到田埂上","idxes":[12,13,14,15]},null,null,null,null,null,null,null,null],[{"text":"他","idxes":[17]},null,{"text":"走","idxes":[66]},null,null,null,null,null,null,null,{"text":"转身朝阿恕家去","idxes":[60,61,62,63,64,65,67]},null,null,null,null,null,null,null],[{"text":"灯光","idxes":[30,31]},null,null,null,null,null,null,{"text":"草房子里","idxes":[25,26,27,28]},null,null,null,null,null,null,null,null,null,null],[{"text":"他","idxes":[17]},{"text":"他家那幢草房子","idxes":[21,22,23,24,25,26,27]},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"远"],[{"text":"他","idxes":[17]},{"text":"阿恕家","idxes":[63,64,65]},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"变近"]]}
```
### Your contribution
I'm going to provide the dataset at https://huggingface.co/datasets/2030NLP/SpaCE2022 . | 38 | Is it possible or how to define a `datasets.Sequence` that could potentially be either a dict, a str, or None?
### Feature request
Hello! Apologies if my question sounds naive:
I was wondering if it’s possible, or how one would go about defining a 'datasets.Sequence' element in datasets.Features that could potentially be either a dict, a str, or None?
Specifically, I’d like to define a feature for a list that contains 18 elements, each of which has been pre-defined as either a `dict or None` or `str or None` - as demonstrated in the slightly misaligned data provided below:
```json
[
[
{"text":"老妇人","idxes":[0,1,2]},null,{"text":"跪","idxes":[3]},null,null,null,null,{"text":"在那坑里","idxes":[4,5,6,7]},null,null,null,null,null,null,null,null,null,null],
[
{"text":"那些水","idxes":[13,14,15]},null,{"text":"舀","idxes":[11]},null,null,null,null,null,{"text":"在那坑里","idxes":[4,5,6,7]},null,{"text":"出","idxes":[12]},null,null,null,null,null,null,null],
[
{"text":"水","idxes":[38]},
null,
{"text":"舀","idxes":[40]},
"假", // note this is just a standalone string
null,null,null,{"text":"坑里","idxes":[35,36]},null,null,null,null,null,null,null,null,null,null]]
```
### Motivation
I'm currently working with a dataset of the following structure and I couldn't find a solution in the [documentation](https://huggingface.co/docs/datasets/v2.11.0/en/package_reference/main_classes#datasets.Features).
```json
{"qid":"3-train-1058","context":"桑桑害怕了。从玉米地里走到田埂上,他遥望着他家那幢草房子里的灯光,知道母亲没有让他回家的意思,很伤感,有点想哭。但没哭,转身朝阿恕家走去。","corefs":[[{"text":"桑桑","idxes":[0,1]},{"text":"他","idxes":[17]}]],"non_corefs":[],"outputs":[[{"text":"他","idxes":[17]},null,{"text":"走","idxes":[11]},null,null,null,null,null,{"text":"从玉米地里","idxes":[6,7,8,9,10]},{"text":"到田埂上","idxes":[12,13,14,15]},null,null,null,null,null,null,null,null],[{"text":"他","idxes":[17]},null,{"text":"走","idxes":[66]},null,null,null,null,null,null,null,{"text":"转身朝阿恕家去","idxes":[60,61,62,63,64,65,67]},null,null,null,null,null,null,null],[{"text":"灯光","idxes":[30,31]},null,null,null,null,null,null,{"text":"草房子里","idxes":[25,26,27,28]},null,null,null,null,null,null,null,null,null,null],[{"text":"他","idxes":[17]},{"text":"他家那幢草房子","idxes":[21,22,23,24,25,26,27]},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"远"],[{"text":"他","idxes":[17]},{"text":"阿恕家","idxes":[63,64,65]},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"变近"]]}
```
### Your contribution
I'm going to provide the dataset at https://huggingface.co/datasets/2030NLP/SpaCE2022 .
@lhoestq Thank you! I further wonder if it's possible to use list subscripts as keys of a feature? Like
```python
features = Features({
0: Value("string"),
1: {
"text": Value("string"),
"idxes": [Value("int64")]
},
2: Value("string"),
# ...
})
``` | [
0.0013286545872688293,
-0.11238649487495422,
-0.18370550870895386,
-0.0726836621761322,
0.01916148141026497,
0.018123596906661987,
0.2247791886329651,
-0.04078936576843262,
0.10549765825271606,
-0.12959596514701843,
0.4297468066215515,
0.08127593994140625,
-0.4116147458553314,
0.36901727318763733,
-0.29757338762283325,
0.07396682351827621,
0.11670725792646408,
0.28197598457336426,
0.394260048866272,
0.2274494469165802,
0.011408194899559021,
-0.04512014985084534,
-0.039365775883197784,
0.008863160386681557,
-0.19931238889694214,
-0.12468186020851135,
-0.07911209762096405,
-0.196306973695755,
-0.24389377236366272,
-0.4833894968032837,
0.33193591237068176,
0.5219366550445557,
-0.16256040334701538,
0.16611947119235992,
-0.00011826858826680109,
-0.12274699658155441,
0.4595295488834381,
-0.14057067036628723,
-0.37999752163887024,
-0.4181808531284332,
-0.8047535419464111,
-0.17045068740844727,
0.3488207757472992,
-0.1968783438205719,
-0.11356478929519653,
-0.15940967202186584,
0.006020808592438698,
-0.7096636295318604,
0.10913586616516113,
0.34011363983154297,
0.19133247435092926,
-0.010660111904144287,
-0.11527728289365768,
-0.030489355325698853,
0.32082557678222656,
0.6977832913398743,
-0.22119244933128357,
-0.280385285615921,
0.09845848381519318,
0.030964873731136322,
0.19400955736637115,
-0.11465474963188171,
-0.10038416087627411,
0.022955134510993958,
0.5098036527633667,
0.12339463829994202,
-0.3260034918785095,
-0.2403489649295807,
-0.2131671905517578,
0.41405314207077026,
0.5770474076271057,
-0.13394954800605774,
-0.3518106937408447,
-0.15083087980747223,
-0.10357841104269028,
-0.43473970890045166,
0.4136161208152771,
0.0405396968126297,
-0.20423538982868195,
0.05733378976583481,
-0.07687222212553024,
-0.047216832637786865,
-0.13299775123596191,
0.41747763752937317,
-0.5239792466163635,
0.08425471186637878,
0.01094958558678627,
-0.04393501207232475,
-0.3091064989566803,
-0.39560529589653015,
-0.16214683651924133,
-0.35438260436058044,
0.2027711570262909,
0.2781274914741516,
-0.3137683868408203,
-0.17882126569747925,
0.034585967659950256,
-0.3328208029270172,
0.10447265207767487,
0.22508525848388672,
0.22604990005493164,
0.0077414195984601974,
-0.32778307795524597,
-0.09231264889240265,
0.24259085953235626,
0.11699771136045456,
0.2930876612663269,
-0.35331350564956665,
0.09669069945812225,
0.13197870552539825,
0.08163639158010483,
0.10350467264652252,
0.13768085837364197,
-0.01894032582640648,
0.05767839401960373,
0.05708726868033409,
0.2629013955593109,
0.1852390170097351,
-0.1330917477607727,
0.24818210303783417,
-0.1850656121969223,
0.09840266406536102,
-0.07576973736286163,
-0.10958686470985413,
0.2412012815475464,
0.08178579062223434,
0.031362518668174744,
0.1587582230567932,
0.19766616821289062,
0.1629229635000229,
-0.05868954956531525,
0.23615096509456635,
-0.06812628358602524,
0.0007849298417568207,
0.018786169588565826,
0.04700402915477753,
-0.10457415133714676,
-0.0024818219244480133,
0.16980165243148804,
0.0421697199344635,
-0.07756298035383224,
-0.17273080348968506,
-0.13614919781684875,
0.15916188061237335,
-0.6493965983390808,
0.18911559879779816,
0.04114079475402832,
0.032764121890068054,
-0.146867573261261,
0.11558955162763596,
0.3665982782840729,
0.08071909844875336,
0.005852727219462395,
0.14917747676372528,
-0.5794878005981445,
0.29019445180892944,
-0.005455333739519119,
0.43202173709869385,
0.18917974829673767,
0.13668179512023926,
0.06895898282527924,
-0.0751936137676239,
-0.4131772816181183,
-0.13860216736793518,
-0.29931631684303284,
0.2548372745513916,
-0.37211883068084717,
-0.18708741664886475,
-0.0036829523742198944,
-0.13538137078285217,
-0.21924430131912231,
-0.08164376765489578,
0.04120895266532898,
-0.012148454785346985,
-0.27142640948295593,
0.32810282707214355,
0.296339213848114,
-0.009994082152843475,
0.07701597362756729,
0.1592893898487091,
-0.10851127654314041,
0.2043859362602234,
0.3162243366241455,
0.2834440767765045,
0.1753329336643219,
-0.1521303504705429,
0.18750810623168945,
0.1767895519733429,
0.011950762942433357,
-0.34988677501678467,
0.1503700613975525,
-0.43348923325538635,
0.42896586656570435,
-0.07989893108606339,
-0.09592406451702118,
0.004614613950252533,
-0.27421921491622925,
-0.20526158809661865,
-0.0892120748758316,
-0.20003561675548553,
0.2618680000305176,
0.3778058588504791,
0.1328161358833313,
0.16936835646629333,
-0.2724095582962036,
-0.5586175918579102,
-0.562287449836731,
0.08520981669425964,
0.1391720026731491,
0.05714457482099533,
-0.218892440199852,
-0.18404310941696167,
-0.0808057188987732,
0.06848262995481491,
-0.12145913392305374,
0.35469892621040344,
0.13342267274856567,
0.006993886083364487,
-0.009296774864196777,
0.008667603135108948,
-0.36339062452316284,
0.3776877224445343,
0.21656501293182373,
-0.014297964051365852,
-0.3454705774784088,
0.12996813654899597,
0.23211120069026947,
0.2684832513332367,
-0.00033173710107803345,
0.4091256856918335,
-0.06768664717674255,
0.2381124198436737,
0.1848650574684143,
-0.005406603217124939,
0.623772144317627,
-0.23367568850517273,
-0.10857914388179779,
0.15095576643943787,
0.18202374875545502,
-0.177358478307724,
-0.07182248681783676,
0.42924731969833374,
0.11516766250133514,
-0.11212563514709473,
-0.45628803968429565,
0.4663779139518738,
-0.0676906481385231,
0.3160928189754486,
-0.13646259903907776,
0.15679574012756348,
0.2777641713619232,
-0.006072580814361572,
-0.46708279848098755,
-0.35939130187034607,
0.1726987212896347,
0.16316911578178406,
0.055129870772361755,
0.30451205372810364,
-0.515321671962738,
-0.12896722555160522,
-0.20499807596206665,
0.09186987578868866,
0.16286326944828033,
0.409900963306427,
0.17412760853767395,
-0.11587436497211456,
-0.327125608921051,
-0.06525684893131256,
0.23174649477005005,
-0.09585583955049515,
0.07925431430339813,
-0.05944664031267166,
-0.04898405075073242,
-0.05698000267148018,
0.02779652550816536,
0.04153374955058098,
0.1519315242767334,
0.252038836479187,
0.40870583057403564,
-0.26716795563697815,
0.07554575800895691,
-0.4853360652923584,
0.15686824917793274,
-0.15186594426631927,
-0.22331233322620392,
-0.07242618501186371,
-0.31984952092170715,
-0.04850199446082115,
0.19665801525115967,
-0.3842989504337311,
-0.2867792248725891,
-0.25696876645088196,
0.09119313955307007,
0.004943845793604851,
0.028240568935871124,
-0.08871496468782425,
-0.07870559394359589,
0.08333591371774673,
0.040060676634311676,
-0.24339769780635834,
-0.06656870990991592,
-0.4092459976673126,
0.2796008288860321,
0.093495674431324,
-0.014655224978923798,
0.43297481536865234,
0.1649821400642395,
0.17546549439430237,
-0.26531505584716797,
-0.3692077100276947,
-0.05938434228301048,
-0.07765069603919983,
0.11528985947370529,
0.14931930601596832,
0.6153231263160706,
0.12017945945262909,
0.11888331174850464,
-0.0686279907822609,
0.0031155087053775787,
0.4473891854286194,
-0.39903736114501953,
-0.06523732841014862,
0.05506593734025955,
0.2606997787952423,
-0.03339950367808342,
0.10544230788946152,
-0.38559186458587646,
-0.19735081493854523,
0.3248087167739868,
0.16880947351455688,
0.07660995423793793,
0.08078143000602722,
-0.08338265120983124,
-0.23213139176368713,
0.24697983264923096,
-0.09761370718479156,
-0.2639283835887909,
0.27303868532180786,
0.2790047228336334,
-0.1491788923740387,
-0.1380925476551056,
0.007428593933582306,
-0.4548034071922302,
-0.036740247160196304,
0.3586331903934479,
-0.17990314960479736,
-0.04782242327928543,
-0.014536889269948006,
0.20121702551841736,
0.253944993019104,
-0.4636543095111847,
0.3547734320163727,
0.28026366233825684,
-0.03725464642047882,
-0.11871424317359924,
-0.08887562900781631,
0.22019106149673462,
0.030170012265443802,
-0.12307699024677277,
0.5388632416725159,
0.1697988212108612,
-0.17427559196949005,
0.25953051447868347,
0.10748784244060516,
-0.279982328414917,
0.35475394129753113,
-0.05671650171279907,
-0.09639360010623932,
-0.11878858506679535,
0.10245979577302933,
-0.3803563117980957,
0.10079964995384216,
-0.3455544710159302,
-0.013589054346084595,
-0.0001840554177761078,
0.0673641785979271,
0.005155831575393677,
0.5448271632194519,
0.2853075861930847,
0.014511965215206146,
0.03161352872848511,
-0.5938240885734558,
0.28591758012771606,
-0.0854463279247284,
-0.29109692573547363,
-0.25106483697891235,
-0.1410384327173233,
-0.25930848717689514,
0.19252093136310577,
0.20510269701480865,
-0.06402382999658585,
-0.6915515065193176,
0.012070395052433014,
-0.11481328308582306,
-0.17853303253650665,
0.36538615822792053,
0.4966619312763214,
-0.005475811660289764,
-0.05995848774909973,
-0.13061422109603882,
0.011009931564331055,
0.36552515625953674,
-0.12460896372795105,
-0.08505208790302277,
0.4382286071777344,
-0.1592671275138855,
-0.1402873396873474,
0.10753430426120758,
0.03741493821144104,
0.054911449551582336,
-0.20734889805316925,
0.1425113081932068,
-0.2824685275554657,
-0.16930127143859863,
-0.17292645573616028,
0.2980785369873047,
-0.12386785447597504,
-0.2667688727378845,
-0.10673400014638901,
-0.07002363353967667,
-0.0004116445779800415,
-0.1602512151002884,
0.2260020226240158,
0.137393981218338,
0.1917572021484375,
0.12165091931819916,
-0.4091196656227112,
0.07738730311393738,
0.2364601194858551,
-0.2908611595630646,
0.19107215106487274,
-0.15954485535621643,
0.1290040761232376,
-0.0764046311378479,
-0.04994878172874451,
0.04024457931518555,
0.11202265322208405,
0.2291441410779953,
-0.2747321128845215,
-0.0635678693652153,
-0.34618285298347473,
0.08553524315357208,
0.17320038378238678,
0.04690198227763176,
0.46797096729278564,
-0.09823548048734665,
-0.04240834340453148,
-0.4589942693710327,
-0.060063980519771576,
0.11308087408542633,
-0.09385564923286438,
-0.30588945746421814,
-0.4149457812309265,
0.21539197862148285,
0.20361824333667755,
-0.12390569597482681,
0.0760059654712677,
0.10249990969896317,
-0.2781367003917694,
0.2667427062988281,
0.2784164249897003,
0.7660712003707886,
0.10177990794181824,
0.14828744530677795,
0.060885727405548096,
-0.0767708569765091,
0.42657262086868286,
-0.10051238536834717,
0.0002998039126396179,
-0.20777732133865356,
-0.05714097246527672,
-0.38844966888427734,
-0.27008679509162903,
0.10392571985721588,
0.3138503432273865,
-0.09099030494689941,
0.28230971097946167,
-0.35295701026916504,
0.3944459557533264,
0.13211500644683838,
0.07800664007663727,
0.3781181871891022,
-0.15579676628112793,
-0.040755730122327805,
0.05149330198764801,
0.00017086323350667953,
0.07292909175157547,
-0.0820719450712204,
0.022602852433919907,
-0.0630517527461052,
0.023201607167720795,
-0.30650174617767334,
-0.4883297085762024,
0.1432521641254425,
0.0007531046867370605,
0.06473131477832794,
-0.46620285511016846,
0.4116920232772827,
0.3718913495540619,
0.22652316093444824,
-0.0689857080578804,
0.008158057928085327,
-0.14167681336402893,
0.2170325368642807,
0.12985682487487793,
-0.20972643792629242,
-0.23810262978076935,
0.20390063524246216,
0.1881476640701294,
0.08588710427284241,
0.16334408521652222,
-0.2356584668159485,
-0.10137742757797241,
0.06371572613716125,
0.03833000361919403,
-0.2122328281402588,
-0.20924915373325348,
-0.24398310482501984,
-0.10541192442178726,
0.41600367426872253,
-0.05701194703578949,
0.07378735393285751,
0.31691500544548035,
-0.023629091680049896,
-0.001173514872789383,
-0.16235226392745972,
0.07206770777702332,
0.0005889823660254478,
0.314853698015213,
0.45359596610069275,
-0.11283575743436813,
0.3065757155418396,
0.29256442189216614,
-0.4125487208366394,
-0.22934749722480774,
0.1367483139038086,
0.13221774995326996,
-0.04476681351661682,
0.3710365891456604,
0.043388575315475464,
-0.30899155139923096,
-0.3852527439594269,
0.4467199146747589,
-0.026830198243260384,
0.470181941986084,
0.3545626401901245,
-0.4446486532688141,
-0.2218635082244873,
0.2529105544090271,
0.04043218865990639,
0.41279861330986023,
-0.3642228841781616,
-0.11282867193222046,
-0.08457966148853302,
-0.25950703024864197,
-0.19413605332374573,
0.09247312694787979,
-0.3261963129043579,
0.11976897716522217,
0.20084932446479797,
0.10945172607898712,
-0.11426292359828949,
-0.11328620463609695,
0.11577539145946503,
-0.10528016835451126,
-0.18034468591213226,
-0.1401292085647583,
-0.09662425518035889,
0.17370010912418365,
0.00018965080380439758,
0.040448352694511414,
0.22541508078575134,
0.03423567861318588,
0.017248108983039856,
-0.09987680613994598,
-0.11649206280708313,
0.41890883445739746,
-0.12095325440168381,
0.05233505740761757,
0.15117914974689484,
-0.09164977818727493,
-0.29698508977890015,
0.022449791431427002,
0.3458302915096283,
0.07230669260025024,
-0.050476640462875366,
0.16045871376991272,
-0.20921169221401215,
0.12868821620941162,
-0.13158343732357025,
0.35904330015182495,
-0.21505820751190186,
-0.12753230333328247,
0.02419288083910942,
-0.10307036340236664,
0.13647541403770447,
0.19882798194885254,
0.4092826247215271,
0.3486570417881012,
-0.3227418065071106,
0.21699948608875275,
-0.09927035123109818,
0.10682778805494308,
-0.15454471111297607,
-0.11260154098272324,
0.37528449296951294,
0.057125333696603775,
0.28404536843299866,
0.26337140798568726,
0.2040477842092514,
0.13456638157367706,
-0.1532931625843048,
-0.1682327389717102,
-0.029284216463565826,
-0.05022565275430679,
0.1602911353111267,
0.21432657539844513,
0.19582755863666534,
-0.06883257627487183,
0.3128204047679901,
0.060043033212423325,
0.2967433035373688,
0.5811648368835449,
0.3451354503631592,
0.20588183403015137,
0.7448735237121582,
0.08092252910137177,
0.010582344606518745,
-0.21131284534931183,
0.06367350369691849,
0.4029303789138794,
0.26992833614349365,
-0.2103859782218933,
0.2952639162540436,
-0.25387877225875854,
0.09304365515708923,
0.03378648683428764,
-0.03341558948159218,
-0.07423026859760284,
0.139677956700325,
-0.36647453904151917,
-0.06937051564455032,
-0.38085755705833435,
-0.007547713816165924,
-0.3432232737541199,
0.07125340402126312,
-0.10081791877746582,
0.5724656581878662,
0.04003136232495308,
0.6747604608535767,
-0.3253381550312042,
0.6270232796669006,
-0.09403964132070541,
0.017019886523485184,
-0.08772411942481995,
0.08548792451620102,
0.20958887040615082,
0.1600906252861023,
0.6233978867530823,
-0.004530087113380432,
-0.04945952072739601,
0.0326751209795475,
-0.3505336344242096,
0.05586187541484833,
-0.374580442905426,
-0.29974445700645447,
-0.27140095829963684,
0.14360693097114563,
-0.07633329182863235,
0.1270296722650528,
0.4839472472667694,
0.125259667634964,
-0.029990974813699722,
0.33738836646080017,
0.4085348844528198,
0.03425335884094238,
-0.39666980504989624,
0.38603320717811584,
-0.14160433411598206,
0.022655926644802094,
0.15493839979171753,
0.25072476267814636,
0.008127517998218536,
-0.275726854801178,
0.29537883400917053,
0.18296031653881073,
0.30567362904548645,
0.42501968145370483,
0.07484184950590134,
-0.1579875499010086,
0.19606409966945648,
0.02030889131128788,
0.1530006229877472,
-0.15424564480781555,
-0.15646949410438538,
-0.3422579765319824,
-0.1361338496208191,
-0.1954953372478485,
-0.3301357626914978,
0.0817335993051529,
0.059985920786857605,
-0.20841318368911743,
0.20182275772094727,
-0.24202288687229156,
0.2000737488269806,
-0.40952473878860474,
0.2889111042022705,
-0.19156599044799805,
-0.11908921599388123,
0.24380338191986084,
0.15858742594718933,
-0.1790325939655304,
-0.22134709358215332,
-0.08694639801979065,
0.1503819227218628,
0.056495167315006256,
0.004152391105890274,
-0.0028868168592453003,
-0.12047247588634491,
-0.10153031349182129,
-0.07389430701732635,
0.06014011800289154,
0.39439165592193604,
0.16314199566841125,
-0.1864873468875885,
-0.10719646513462067,
-0.002567969262599945,
-0.08758373558521271,
0.5948059558868408,
0.030903436243534088,
0.641343891620636,
-0.2908652424812317,
0.5169483423233032,
0.10816236585378647,
-0.11659015715122223,
-0.06723656505346298,
0.13263916969299316,
-0.610408365726471,
0.39357104897499084,
-0.4607710838317871,
0.18649177253246307,
-0.00047117844223976135,
0.20513120293617249,
-0.115089550614357,
0.2311171591281891,
0.06758905947208405,
-0.2674331068992615,
0.11127158999443054,
0.028641972690820694,
-0.3292495608329773,
0.09162652492523193,
-0.17921271920204163,
0.2811205983161926,
-0.11963827908039093,
-0.12370553612709045,
0.01888088881969452,
0.3390886187553406,
-0.1775231808423996,
-0.09195668995380402,
-0.21324338018894196,
-0.10815490782260895,
-0.18127895891666412,
-0.2617175579071045,
0.11864878237247467,
-0.19966435432434082,
0.08285768330097198,
-0.2694900929927826,
-0.30330848693847656
] |
https://github.com/huggingface/datasets/issues/5702 | Column names need to be strings, so you could use "1", "2", etc. or give appropriate column names | Is it possible or how to define a `datasets.Sequence` that could potentially be either a dict, a str, or None? | ### Feature request
Hello! Apologies if my question sounds naive:
I was wondering if it’s possible, or how one would go about defining a 'datasets.Sequence' element in datasets.Features that could potentially be either a dict, a str, or None?
Specifically, I’d like to define a feature for a list that contains 18 elements, each of which has been pre-defined as either a `dict or None` or `str or None` - as demonstrated in the slightly misaligned data provided below:
```json
[
[
{"text":"老妇人","idxes":[0,1,2]},null,{"text":"跪","idxes":[3]},null,null,null,null,{"text":"在那坑里","idxes":[4,5,6,7]},null,null,null,null,null,null,null,null,null,null],
[
{"text":"那些水","idxes":[13,14,15]},null,{"text":"舀","idxes":[11]},null,null,null,null,null,{"text":"在那坑里","idxes":[4,5,6,7]},null,{"text":"出","idxes":[12]},null,null,null,null,null,null,null],
[
{"text":"水","idxes":[38]},
null,
{"text":"舀","idxes":[40]},
"假", // note this is just a standalone string
null,null,null,{"text":"坑里","idxes":[35,36]},null,null,null,null,null,null,null,null,null,null]]
```
### Motivation
I'm currently working with a dataset of the following structure and I couldn't find a solution in the [documentation](https://huggingface.co/docs/datasets/v2.11.0/en/package_reference/main_classes#datasets.Features).
```json
{"qid":"3-train-1058","context":"桑桑害怕了。从玉米地里走到田埂上,他遥望着他家那幢草房子里的灯光,知道母亲没有让他回家的意思,很伤感,有点想哭。但没哭,转身朝阿恕家走去。","corefs":[[{"text":"桑桑","idxes":[0,1]},{"text":"他","idxes":[17]}]],"non_corefs":[],"outputs":[[{"text":"他","idxes":[17]},null,{"text":"走","idxes":[11]},null,null,null,null,null,{"text":"从玉米地里","idxes":[6,7,8,9,10]},{"text":"到田埂上","idxes":[12,13,14,15]},null,null,null,null,null,null,null,null],[{"text":"他","idxes":[17]},null,{"text":"走","idxes":[66]},null,null,null,null,null,null,null,{"text":"转身朝阿恕家去","idxes":[60,61,62,63,64,65,67]},null,null,null,null,null,null,null],[{"text":"灯光","idxes":[30,31]},null,null,null,null,null,null,{"text":"草房子里","idxes":[25,26,27,28]},null,null,null,null,null,null,null,null,null,null],[{"text":"他","idxes":[17]},{"text":"他家那幢草房子","idxes":[21,22,23,24,25,26,27]},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"远"],[{"text":"他","idxes":[17]},{"text":"阿恕家","idxes":[63,64,65]},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"变近"]]}
```
### Your contribution
I'm going to provide the dataset at https://huggingface.co/datasets/2030NLP/SpaCE2022 . | 18 | Is it possible or how to define a `datasets.Sequence` that could potentially be either a dict, a str, or None?
### Feature request
Hello! Apologies if my question sounds naive:
I was wondering if it’s possible, or how one would go about defining a 'datasets.Sequence' element in datasets.Features that could potentially be either a dict, a str, or None?
Specifically, I’d like to define a feature for a list that contains 18 elements, each of which has been pre-defined as either a `dict or None` or `str or None` - as demonstrated in the slightly misaligned data provided below:
```json
[
[
{"text":"老妇人","idxes":[0,1,2]},null,{"text":"跪","idxes":[3]},null,null,null,null,{"text":"在那坑里","idxes":[4,5,6,7]},null,null,null,null,null,null,null,null,null,null],
[
{"text":"那些水","idxes":[13,14,15]},null,{"text":"舀","idxes":[11]},null,null,null,null,null,{"text":"在那坑里","idxes":[4,5,6,7]},null,{"text":"出","idxes":[12]},null,null,null,null,null,null,null],
[
{"text":"水","idxes":[38]},
null,
{"text":"舀","idxes":[40]},
"假", // note this is just a standalone string
null,null,null,{"text":"坑里","idxes":[35,36]},null,null,null,null,null,null,null,null,null,null]]
```
### Motivation
I'm currently working with a dataset of the following structure and I couldn't find a solution in the [documentation](https://huggingface.co/docs/datasets/v2.11.0/en/package_reference/main_classes#datasets.Features).
```json
{"qid":"3-train-1058","context":"桑桑害怕了。从玉米地里走到田埂上,他遥望着他家那幢草房子里的灯光,知道母亲没有让他回家的意思,很伤感,有点想哭。但没哭,转身朝阿恕家走去。","corefs":[[{"text":"桑桑","idxes":[0,1]},{"text":"他","idxes":[17]}]],"non_corefs":[],"outputs":[[{"text":"他","idxes":[17]},null,{"text":"走","idxes":[11]},null,null,null,null,null,{"text":"从玉米地里","idxes":[6,7,8,9,10]},{"text":"到田埂上","idxes":[12,13,14,15]},null,null,null,null,null,null,null,null],[{"text":"他","idxes":[17]},null,{"text":"走","idxes":[66]},null,null,null,null,null,null,null,{"text":"转身朝阿恕家去","idxes":[60,61,62,63,64,65,67]},null,null,null,null,null,null,null],[{"text":"灯光","idxes":[30,31]},null,null,null,null,null,null,{"text":"草房子里","idxes":[25,26,27,28]},null,null,null,null,null,null,null,null,null,null],[{"text":"他","idxes":[17]},{"text":"他家那幢草房子","idxes":[21,22,23,24,25,26,27]},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"远"],[{"text":"他","idxes":[17]},{"text":"阿恕家","idxes":[63,64,65]},null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"变近"]]}
```
### Your contribution
I'm going to provide the dataset at https://huggingface.co/datasets/2030NLP/SpaCE2022 .
Column names need to be strings, so you could use "1", "2", etc. or give appropriate column names | [
0.0013286545872688293,
-0.11238649487495422,
-0.18370550870895386,
-0.0726836621761322,
0.01916148141026497,
0.018123596906661987,
0.2247791886329651,
-0.04078936576843262,
0.10549765825271606,
-0.12959596514701843,
0.4297468066215515,
0.08127593994140625,
-0.4116147458553314,
0.36901727318763733,
-0.29757338762283325,
0.07396682351827621,
0.11670725792646408,
0.28197598457336426,
0.394260048866272,
0.2274494469165802,
0.011408194899559021,
-0.04512014985084534,
-0.039365775883197784,
0.008863160386681557,
-0.19931238889694214,
-0.12468186020851135,
-0.07911209762096405,
-0.196306973695755,
-0.24389377236366272,
-0.4833894968032837,
0.33193591237068176,
0.5219366550445557,
-0.16256040334701538,
0.16611947119235992,
-0.00011826858826680109,
-0.12274699658155441,
0.4595295488834381,
-0.14057067036628723,
-0.37999752163887024,
-0.4181808531284332,
-0.8047535419464111,
-0.17045068740844727,
0.3488207757472992,
-0.1968783438205719,
-0.11356478929519653,
-0.15940967202186584,
0.006020808592438698,
-0.7096636295318604,
0.10913586616516113,
0.34011363983154297,
0.19133247435092926,
-0.010660111904144287,
-0.11527728289365768,
-0.030489355325698853,
0.32082557678222656,
0.6977832913398743,
-0.22119244933128357,
-0.280385285615921,
0.09845848381519318,
0.030964873731136322,
0.19400955736637115,
-0.11465474963188171,
-0.10038416087627411,
0.022955134510993958,
0.5098036527633667,
0.12339463829994202,
-0.3260034918785095,
-0.2403489649295807,
-0.2131671905517578,
0.41405314207077026,
0.5770474076271057,
-0.13394954800605774,
-0.3518106937408447,
-0.15083087980747223,
-0.10357841104269028,
-0.43473970890045166,
0.4136161208152771,
0.0405396968126297,
-0.20423538982868195,
0.05733378976583481,
-0.07687222212553024,
-0.047216832637786865,
-0.13299775123596191,
0.41747763752937317,
-0.5239792466163635,
0.08425471186637878,
0.01094958558678627,
-0.04393501207232475,
-0.3091064989566803,
-0.39560529589653015,
-0.16214683651924133,
-0.35438260436058044,
0.2027711570262909,
0.2781274914741516,
-0.3137683868408203,
-0.17882126569747925,
0.034585967659950256,
-0.3328208029270172,
0.10447265207767487,
0.22508525848388672,
0.22604990005493164,
0.0077414195984601974,
-0.32778307795524597,
-0.09231264889240265,
0.24259085953235626,
0.11699771136045456,
0.2930876612663269,
-0.35331350564956665,
0.09669069945812225,
0.13197870552539825,
0.08163639158010483,
0.10350467264652252,
0.13768085837364197,
-0.01894032582640648,
0.05767839401960373,
0.05708726868033409,
0.2629013955593109,
0.1852390170097351,
-0.1330917477607727,
0.24818210303783417,
-0.1850656121969223,
0.09840266406536102,
-0.07576973736286163,
-0.10958686470985413,
0.2412012815475464,
0.08178579062223434,
0.031362518668174744,
0.1587582230567932,
0.19766616821289062,
0.1629229635000229,
-0.05868954956531525,
0.23615096509456635,
-0.06812628358602524,
0.0007849298417568207,
0.018786169588565826,
0.04700402915477753,
-0.10457415133714676,
-0.0024818219244480133,
0.16980165243148804,
0.0421697199344635,
-0.07756298035383224,
-0.17273080348968506,
-0.13614919781684875,
0.15916188061237335,
-0.6493965983390808,
0.18911559879779816,
0.04114079475402832,
0.032764121890068054,
-0.146867573261261,
0.11558955162763596,
0.3665982782840729,
0.08071909844875336,
0.005852727219462395,
0.14917747676372528,
-0.5794878005981445,
0.29019445180892944,
-0.005455333739519119,
0.43202173709869385,
0.18917974829673767,
0.13668179512023926,
0.06895898282527924,
-0.0751936137676239,
-0.4131772816181183,
-0.13860216736793518,
-0.29931631684303284,
0.2548372745513916,
-0.37211883068084717,
-0.18708741664886475,
-0.0036829523742198944,
-0.13538137078285217,
-0.21924430131912231,
-0.08164376765489578,
0.04120895266532898,
-0.012148454785346985,
-0.27142640948295593,
0.32810282707214355,
0.296339213848114,
-0.009994082152843475,
0.07701597362756729,
0.1592893898487091,
-0.10851127654314041,
0.2043859362602234,
0.3162243366241455,
0.2834440767765045,
0.1753329336643219,
-0.1521303504705429,
0.18750810623168945,
0.1767895519733429,
0.011950762942433357,
-0.34988677501678467,
0.1503700613975525,
-0.43348923325538635,
0.42896586656570435,
-0.07989893108606339,
-0.09592406451702118,
0.004614613950252533,
-0.27421921491622925,
-0.20526158809661865,
-0.0892120748758316,
-0.20003561675548553,
0.2618680000305176,
0.3778058588504791,
0.1328161358833313,
0.16936835646629333,
-0.2724095582962036,
-0.5586175918579102,
-0.562287449836731,
0.08520981669425964,
0.1391720026731491,
0.05714457482099533,
-0.218892440199852,
-0.18404310941696167,
-0.0808057188987732,
0.06848262995481491,
-0.12145913392305374,
0.35469892621040344,
0.13342267274856567,
0.006993886083364487,
-0.009296774864196777,
0.008667603135108948,
-0.36339062452316284,
0.3776877224445343,
0.21656501293182373,
-0.014297964051365852,
-0.3454705774784088,
0.12996813654899597,
0.23211120069026947,
0.2684832513332367,
-0.00033173710107803345,
0.4091256856918335,
-0.06768664717674255,
0.2381124198436737,
0.1848650574684143,
-0.005406603217124939,
0.623772144317627,
-0.23367568850517273,
-0.10857914388179779,
0.15095576643943787,
0.18202374875545502,
-0.177358478307724,
-0.07182248681783676,
0.42924731969833374,
0.11516766250133514,
-0.11212563514709473,
-0.45628803968429565,
0.4663779139518738,
-0.0676906481385231,
0.3160928189754486,
-0.13646259903907776,
0.15679574012756348,
0.2777641713619232,
-0.006072580814361572,
-0.46708279848098755,
-0.35939130187034607,
0.1726987212896347,
0.16316911578178406,
0.055129870772361755,
0.30451205372810364,
-0.515321671962738,
-0.12896722555160522,
-0.20499807596206665,
0.09186987578868866,
0.16286326944828033,
0.409900963306427,
0.17412760853767395,
-0.11587436497211456,
-0.327125608921051,
-0.06525684893131256,
0.23174649477005005,
-0.09585583955049515,
0.07925431430339813,
-0.05944664031267166,
-0.04898405075073242,
-0.05698000267148018,
0.02779652550816536,
0.04153374955058098,
0.1519315242767334,
0.252038836479187,
0.40870583057403564,
-0.26716795563697815,
0.07554575800895691,
-0.4853360652923584,
0.15686824917793274,
-0.15186594426631927,
-0.22331233322620392,
-0.07242618501186371,
-0.31984952092170715,
-0.04850199446082115,
0.19665801525115967,
-0.3842989504337311,
-0.2867792248725891,
-0.25696876645088196,
0.09119313955307007,
0.004943845793604851,
0.028240568935871124,
-0.08871496468782425,
-0.07870559394359589,
0.08333591371774673,
0.040060676634311676,
-0.24339769780635834,
-0.06656870990991592,
-0.4092459976673126,
0.2796008288860321,
0.093495674431324,
-0.014655224978923798,
0.43297481536865234,
0.1649821400642395,
0.17546549439430237,
-0.26531505584716797,
-0.3692077100276947,
-0.05938434228301048,
-0.07765069603919983,
0.11528985947370529,
0.14931930601596832,
0.6153231263160706,
0.12017945945262909,
0.11888331174850464,
-0.0686279907822609,
0.0031155087053775787,
0.4473891854286194,
-0.39903736114501953,
-0.06523732841014862,
0.05506593734025955,
0.2606997787952423,
-0.03339950367808342,
0.10544230788946152,
-0.38559186458587646,
-0.19735081493854523,
0.3248087167739868,
0.16880947351455688,
0.07660995423793793,
0.08078143000602722,
-0.08338265120983124,
-0.23213139176368713,
0.24697983264923096,
-0.09761370718479156,
-0.2639283835887909,
0.27303868532180786,
0.2790047228336334,
-0.1491788923740387,
-0.1380925476551056,
0.007428593933582306,
-0.4548034071922302,
-0.036740247160196304,
0.3586331903934479,
-0.17990314960479736,
-0.04782242327928543,
-0.014536889269948006,
0.20121702551841736,
0.253944993019104,
-0.4636543095111847,
0.3547734320163727,
0.28026366233825684,
-0.03725464642047882,
-0.11871424317359924,
-0.08887562900781631,
0.22019106149673462,
0.030170012265443802,
-0.12307699024677277,
0.5388632416725159,
0.1697988212108612,
-0.17427559196949005,
0.25953051447868347,
0.10748784244060516,
-0.279982328414917,
0.35475394129753113,
-0.05671650171279907,
-0.09639360010623932,
-0.11878858506679535,
0.10245979577302933,
-0.3803563117980957,
0.10079964995384216,
-0.3455544710159302,
-0.013589054346084595,
-0.0001840554177761078,
0.0673641785979271,
0.005155831575393677,
0.5448271632194519,
0.2853075861930847,
0.014511965215206146,
0.03161352872848511,
-0.5938240885734558,
0.28591758012771606,
-0.0854463279247284,
-0.29109692573547363,
-0.25106483697891235,
-0.1410384327173233,
-0.25930848717689514,
0.19252093136310577,
0.20510269701480865,
-0.06402382999658585,
-0.6915515065193176,
0.012070395052433014,
-0.11481328308582306,
-0.17853303253650665,
0.36538615822792053,
0.4966619312763214,
-0.005475811660289764,
-0.05995848774909973,
-0.13061422109603882,
0.011009931564331055,
0.36552515625953674,
-0.12460896372795105,
-0.08505208790302277,
0.4382286071777344,
-0.1592671275138855,
-0.1402873396873474,
0.10753430426120758,
0.03741493821144104,
0.054911449551582336,
-0.20734889805316925,
0.1425113081932068,
-0.2824685275554657,
-0.16930127143859863,
-0.17292645573616028,
0.2980785369873047,
-0.12386785447597504,
-0.2667688727378845,
-0.10673400014638901,
-0.07002363353967667,
-0.0004116445779800415,
-0.1602512151002884,
0.2260020226240158,
0.137393981218338,
0.1917572021484375,
0.12165091931819916,
-0.4091196656227112,
0.07738730311393738,
0.2364601194858551,
-0.2908611595630646,
0.19107215106487274,
-0.15954485535621643,
0.1290040761232376,
-0.0764046311378479,
-0.04994878172874451,
0.04024457931518555,
0.11202265322208405,
0.2291441410779953,
-0.2747321128845215,
-0.0635678693652153,
-0.34618285298347473,
0.08553524315357208,
0.17320038378238678,
0.04690198227763176,
0.46797096729278564,
-0.09823548048734665,
-0.04240834340453148,
-0.4589942693710327,
-0.060063980519771576,
0.11308087408542633,
-0.09385564923286438,
-0.30588945746421814,
-0.4149457812309265,
0.21539197862148285,
0.20361824333667755,
-0.12390569597482681,
0.0760059654712677,
0.10249990969896317,
-0.2781367003917694,
0.2667427062988281,
0.2784164249897003,
0.7660712003707886,
0.10177990794181824,
0.14828744530677795,
0.060885727405548096,
-0.0767708569765091,
0.42657262086868286,
-0.10051238536834717,
0.0002998039126396179,
-0.20777732133865356,
-0.05714097246527672,
-0.38844966888427734,
-0.27008679509162903,
0.10392571985721588,
0.3138503432273865,
-0.09099030494689941,
0.28230971097946167,
-0.35295701026916504,
0.3944459557533264,
0.13211500644683838,
0.07800664007663727,
0.3781181871891022,
-0.15579676628112793,
-0.040755730122327805,
0.05149330198764801,
0.00017086323350667953,
0.07292909175157547,
-0.0820719450712204,
0.022602852433919907,
-0.0630517527461052,
0.023201607167720795,
-0.30650174617767334,
-0.4883297085762024,
0.1432521641254425,
0.0007531046867370605,
0.06473131477832794,
-0.46620285511016846,
0.4116920232772827,
0.3718913495540619,
0.22652316093444824,
-0.0689857080578804,
0.008158057928085327,
-0.14167681336402893,
0.2170325368642807,
0.12985682487487793,
-0.20972643792629242,
-0.23810262978076935,
0.20390063524246216,
0.1881476640701294,
0.08588710427284241,
0.16334408521652222,
-0.2356584668159485,
-0.10137742757797241,
0.06371572613716125,
0.03833000361919403,
-0.2122328281402588,
-0.20924915373325348,
-0.24398310482501984,
-0.10541192442178726,
0.41600367426872253,
-0.05701194703578949,
0.07378735393285751,
0.31691500544548035,
-0.023629091680049896,
-0.001173514872789383,
-0.16235226392745972,
0.07206770777702332,
0.0005889823660254478,
0.314853698015213,
0.45359596610069275,
-0.11283575743436813,
0.3065757155418396,
0.29256442189216614,
-0.4125487208366394,
-0.22934749722480774,
0.1367483139038086,
0.13221774995326996,
-0.04476681351661682,
0.3710365891456604,
0.043388575315475464,
-0.30899155139923096,
-0.3852527439594269,
0.4467199146747589,
-0.026830198243260384,
0.470181941986084,
0.3545626401901245,
-0.4446486532688141,
-0.2218635082244873,
0.2529105544090271,
0.04043218865990639,
0.41279861330986023,
-0.3642228841781616,
-0.11282867193222046,
-0.08457966148853302,
-0.25950703024864197,
-0.19413605332374573,
0.09247312694787979,
-0.3261963129043579,
0.11976897716522217,
0.20084932446479797,
0.10945172607898712,
-0.11426292359828949,
-0.11328620463609695,
0.11577539145946503,
-0.10528016835451126,
-0.18034468591213226,
-0.1401292085647583,
-0.09662425518035889,
0.17370010912418365,
0.00018965080380439758,
0.040448352694511414,
0.22541508078575134,
0.03423567861318588,
0.017248108983039856,
-0.09987680613994598,
-0.11649206280708313,
0.41890883445739746,
-0.12095325440168381,
0.05233505740761757,
0.15117914974689484,
-0.09164977818727493,
-0.29698508977890015,
0.022449791431427002,
0.3458302915096283,
0.07230669260025024,
-0.050476640462875366,
0.16045871376991272,
-0.20921169221401215,
0.12868821620941162,
-0.13158343732357025,
0.35904330015182495,
-0.21505820751190186,
-0.12753230333328247,
0.02419288083910942,
-0.10307036340236664,
0.13647541403770447,
0.19882798194885254,
0.4092826247215271,
0.3486570417881012,
-0.3227418065071106,
0.21699948608875275,
-0.09927035123109818,
0.10682778805494308,
-0.15454471111297607,
-0.11260154098272324,
0.37528449296951294,
0.057125333696603775,
0.28404536843299866,
0.26337140798568726,
0.2040477842092514,
0.13456638157367706,
-0.1532931625843048,
-0.1682327389717102,
-0.029284216463565826,
-0.05022565275430679,
0.1602911353111267,
0.21432657539844513,
0.19582755863666534,
-0.06883257627487183,
0.3128204047679901,
0.060043033212423325,
0.2967433035373688,
0.5811648368835449,
0.3451354503631592,
0.20588183403015137,
0.7448735237121582,
0.08092252910137177,
0.010582344606518745,
-0.21131284534931183,
0.06367350369691849,
0.4029303789138794,
0.26992833614349365,
-0.2103859782218933,
0.2952639162540436,
-0.25387877225875854,
0.09304365515708923,
0.03378648683428764,
-0.03341558948159218,
-0.07423026859760284,
0.139677956700325,
-0.36647453904151917,
-0.06937051564455032,
-0.38085755705833435,
-0.007547713816165924,
-0.3432232737541199,
0.07125340402126312,
-0.10081791877746582,
0.5724656581878662,
0.04003136232495308,
0.6747604608535767,
-0.3253381550312042,
0.6270232796669006,
-0.09403964132070541,
0.017019886523485184,
-0.08772411942481995,
0.08548792451620102,
0.20958887040615082,
0.1600906252861023,
0.6233978867530823,
-0.004530087113380432,
-0.04945952072739601,
0.0326751209795475,
-0.3505336344242096,
0.05586187541484833,
-0.374580442905426,
-0.29974445700645447,
-0.27140095829963684,
0.14360693097114563,
-0.07633329182863235,
0.1270296722650528,
0.4839472472667694,
0.125259667634964,
-0.029990974813699722,
0.33738836646080017,
0.4085348844528198,
0.03425335884094238,
-0.39666980504989624,
0.38603320717811584,
-0.14160433411598206,
0.022655926644802094,
0.15493839979171753,
0.25072476267814636,
0.008127517998218536,
-0.275726854801178,
0.29537883400917053,
0.18296031653881073,
0.30567362904548645,
0.42501968145370483,
0.07484184950590134,
-0.1579875499010086,
0.19606409966945648,
0.02030889131128788,
0.1530006229877472,
-0.15424564480781555,
-0.15646949410438538,
-0.3422579765319824,
-0.1361338496208191,
-0.1954953372478485,
-0.3301357626914978,
0.0817335993051529,
0.059985920786857605,
-0.20841318368911743,
0.20182275772094727,
-0.24202288687229156,
0.2000737488269806,
-0.40952473878860474,
0.2889111042022705,
-0.19156599044799805,
-0.11908921599388123,
0.24380338191986084,
0.15858742594718933,
-0.1790325939655304,
-0.22134709358215332,
-0.08694639801979065,
0.1503819227218628,
0.056495167315006256,
0.004152391105890274,
-0.0028868168592453003,
-0.12047247588634491,
-0.10153031349182129,
-0.07389430701732635,
0.06014011800289154,
0.39439165592193604,
0.16314199566841125,
-0.1864873468875885,
-0.10719646513462067,
-0.002567969262599945,
-0.08758373558521271,
0.5948059558868408,
0.030903436243534088,
0.641343891620636,
-0.2908652424812317,
0.5169483423233032,
0.10816236585378647,
-0.11659015715122223,
-0.06723656505346298,
0.13263916969299316,
-0.610408365726471,
0.39357104897499084,
-0.4607710838317871,
0.18649177253246307,
-0.00047117844223976135,
0.20513120293617249,
-0.115089550614357,
0.2311171591281891,
0.06758905947208405,
-0.2674331068992615,
0.11127158999443054,
0.028641972690820694,
-0.3292495608329773,
0.09162652492523193,
-0.17921271920204163,
0.2811205983161926,
-0.11963827908039093,
-0.12370553612709045,
0.01888088881969452,
0.3390886187553406,
-0.1775231808423996,
-0.09195668995380402,
-0.21324338018894196,
-0.10815490782260895,
-0.18127895891666412,
-0.2617175579071045,
0.11864878237247467,
-0.19966435432434082,
0.08285768330097198,
-0.2694900929927826,
-0.30330848693847656
] |
https://github.com/huggingface/datasets/issues/5695 | Hi ! It looks like an issue with PyArrow: https://issues.apache.org/jira/browse/ARROW-5030
It appears it can happen when you have parquet files with row groups larger than 2GB.
I can see that your parquet files are around 10GB. It is usually advised to keep a value around the default value 500MB to avoid these issues.
Note that currently the row group size is simply defined by the number of rows `datasets.config.DEFAULT_MAX_BATCH_SIZE`, so reducing this value could let you have parquet files bigger than 2GB and with row groups lower than 2GB.
Would it be possible for you to re-upload the dataset with the default shard size 500MB ? | Loading big dataset raises pyarrow.lib.ArrowNotImplementedError | ### Describe the bug
Calling `datasets.load_dataset` to load the (publicly available) dataset `theodor1289/wit` fails with `pyarrow.lib.ArrowNotImplementedError`.
### Steps to reproduce the bug
Steps to reproduce this behavior:
1. `!pip install datasets`
2. `!huggingface-cli login`
3. This step will throw the error (it might take a while as the dataset has ~170GB):
```python
from datasets import load_dataset
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
```
Stack trace:
```
(torch-multimodal) bash-4.2$ python test.py
Downloading and preparing dataset None/None to /cluster/work/cotterell/tamariucai/HuggingfaceDatasets/theodor1289___parquet/theodor1289--wit-7a3e984414a86a0f/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec...
Downloading data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 491.68it/s]
Extracting data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 16.93it/s]
Traceback (most recent call last):
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1860, in _prepare_split_single
for _, table in generator:
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 69, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1323, in iter_batches
File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/cluster/work/cotterell/tamariucai/multimodal-mirror/examples/test.py", line 2, in <module>
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 986, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1748, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1893, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
The dataset is loaded in variable `dataset`.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.10.4
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
| 106 | Loading big dataset raises pyarrow.lib.ArrowNotImplementedError
### Describe the bug
Calling `datasets.load_dataset` to load the (publicly available) dataset `theodor1289/wit` fails with `pyarrow.lib.ArrowNotImplementedError`.
### Steps to reproduce the bug
Steps to reproduce this behavior:
1. `!pip install datasets`
2. `!huggingface-cli login`
3. This step will throw the error (it might take a while as the dataset has ~170GB):
```python
from datasets import load_dataset
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
```
Stack trace:
```
(torch-multimodal) bash-4.2$ python test.py
Downloading and preparing dataset None/None to /cluster/work/cotterell/tamariucai/HuggingfaceDatasets/theodor1289___parquet/theodor1289--wit-7a3e984414a86a0f/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec...
Downloading data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 491.68it/s]
Extracting data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 16.93it/s]
Traceback (most recent call last):
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1860, in _prepare_split_single
for _, table in generator:
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 69, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1323, in iter_batches
File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/cluster/work/cotterell/tamariucai/multimodal-mirror/examples/test.py", line 2, in <module>
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 986, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1748, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1893, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
The dataset is loaded in variable `dataset`.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.10.4
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
Hi ! It looks like an issue with PyArrow: https://issues.apache.org/jira/browse/ARROW-5030
It appears it can happen when you have parquet files with row groups larger than 2GB.
I can see that your parquet files are around 10GB. It is usually advised to keep a value around the default value 500MB to avoid these issues.
Note that currently the row group size is simply defined by the number of rows `datasets.config.DEFAULT_MAX_BATCH_SIZE`, so reducing this value could let you have parquet files bigger than 2GB and with row groups lower than 2GB.
Would it be possible for you to re-upload the dataset with the default shard size 500MB ? | [
-0.36002859473228455,
0.04276201128959656,
0.11041624844074249,
0.5041696429252625,
0.22531577944755554,
-0.20803719758987427,
0.2163711041212082,
0.19029837846755981,
-0.20871645212173462,
0.20421102643013,
-0.09125034511089325,
0.6012040376663208,
-0.11784866452217102,
-0.12901639938354492,
0.1307569146156311,
-0.13230448961257935,
0.06511824578046799,
0.08160844445228577,
-0.08167270570993423,
0.08421698212623596,
-0.10585974156856537,
0.15787310898303986,
-0.2615298330783844,
0.2127004861831665,
-0.18483684957027435,
0.059403203427791595,
0.0026949718594551086,
0.28332793712615967,
-0.11843465268611908,
-0.4641624689102173,
0.2070017158985138,
-0.2581101357936859,
0.16843949258327484,
0.5688139796257019,
-0.00012222885561641306,
0.09924210608005524,
0.3478609621524811,
0.20523172616958618,
-0.31461673974990845,
-0.20816031098365784,
0.17828579246997833,
-0.4556504487991333,
0.41995272040367126,
-0.1822991669178009,
0.05111069977283478,
-0.3134867250919342,
-0.08043865859508514,
0.17829495668411255,
0.2496967315673828,
0.2228722721338272,
0.1525610238313675,
0.5205861330032349,
0.24243271350860596,
0.07011547684669495,
0.5378828048706055,
-0.04438558220863342,
-0.06587961316108704,
0.22352537512779236,
0.2466321885585785,
-0.050944291055202484,
-0.34741440415382385,
0.1250907927751541,
0.01693015545606613,
0.13802210986614227,
0.2163514345884323,
0.06658972799777985,
-0.15904712677001953,
-0.15371432900428772,
0.16561108827590942,
0.29331332445144653,
0.3562414050102234,
-0.4237765371799469,
-0.26516449451446533,
-0.22031861543655396,
0.14786702394485474,
-0.2502976059913635,
0.3048233389854431,
0.3439120650291443,
-0.17914503812789917,
0.028171397745609283,
-0.08233620226383209,
0.008384522050619125,
-0.24206697940826416,
0.12496933341026306,
-0.1453215777873993,
0.2276231199502945,
-0.052333757281303406,
0.14973284304141998,
0.31022366881370544,
-0.15541283786296844,
-0.09776751697063446,
-0.03898927569389343,
-0.11066991835832596,
0.09602604806423187,
-0.49186575412750244,
0.14296302199363708,
-0.04495853930711746,
0.3768194913864136,
0.39765602350234985,
0.35244160890579224,
0.04032406210899353,
0.06492580473423004,
0.2068379819393158,
0.054900508373975754,
0.10590901970863342,
0.05773165449500084,
-0.512406051158905,
-0.0962192714214325,
0.24184538424015045,
0.21204835176467896,
0.07193882763385773,
0.07774411141872406,
-0.11517906188964844,
-0.3209916651248932,
0.10601556301116943,
-0.23691561818122864,
0.4037882387638092,
-0.2381032407283783,
-0.3806278109550476,
0.2215002328157425,
-0.26838576793670654,
0.022125165909528732,
0.054306935518980026,
0.40491873025894165,
-0.2659057080745697,
0.14024797081947327,
-0.04544156789779663,
0.222760409116745,
-0.2143045961856842,
-0.25664016604423523,
-0.2147689014673233,
-0.05940750986337662,
-0.16690292954444885,
0.05292504280805588,
0.22134211659431458,
-0.15889036655426025,
0.11727882921695709,
0.0531352162361145,
0.167011559009552,
-0.13221552968025208,
-0.02609695866703987,
-0.08986175060272217,
-0.0825924351811409,
0.29657965898513794,
-0.19052353501319885,
0.08670100569725037,
0.05251377448439598,
0.06295355409383774,
-0.12377698719501495,
0.20981763303279877,
-0.19945064187049866,
-0.38803520798683167,
-0.31857043504714966,
0.09420591592788696,
-0.3295561373233795,
-0.011543912813067436,
-0.3417505919933319,
0.021293016150593758,
-0.04203684628009796,
-0.02249418944120407,
0.15909811854362488,
-0.144818514585495,
0.026296868920326233,
-0.27168476581573486,
0.4352302849292755,
0.2743813991546631,
-0.4686276912689209,
0.0031767338514328003,
-0.040638137608766556,
-0.24947518110275269,
0.22265881299972534,
0.24165433645248413,
-0.28357404470443726,
0.10262031853199005,
-0.1886805295944214,
0.1709785759449005,
0.2953191101551056,
-0.09699971228837967,
-0.733908474445343,
0.2503823935985565,
-0.34929561614990234,
0.22200652956962585,
0.1602785736322403,
-0.03139661252498627,
-0.2079378068447113,
0.12785851955413818,
0.013798748143017292,
0.34728479385375977,
-0.047942426055669785,
0.19997210800647736,
-0.34799623489379883,
-0.40335842967033386,
0.21267394721508026,
0.35688555240631104,
0.1704360544681549,
-0.30883052945137024,
0.1890818178653717,
-0.2482474446296692,
0.3311004638671875,
-0.20835229754447937,
0.06495591253042221,
0.09328573197126389,
0.12972895801067352,
0.06426744908094406,
0.06922156363725662,
-0.05684662610292435,
-0.5748125314712524,
0.31906577944755554,
-0.04876074939966202,
0.1274321973323822,
-0.466266393661499,
-0.1305573284626007,
-0.08573821187019348,
0.3415827751159668,
-0.2074180692434311,
-0.060552600771188736,
0.013897158205509186,
0.16769680380821228,
0.16146844625473022,
0.06513549387454987,
-0.24808764457702637,
0.0881582647562027,
-0.06934594362974167,
0.3239607512950897,
-0.337843120098114,
0.4175768494606018,
0.07334592938423157,
-0.29762962460517883,
-0.09085657447576523,
0.18601617217063904,
0.04022520035505295,
-0.11527657508850098,
-0.07770346105098724,
0.4499233663082123,
-0.2035689651966095,
0.07779551297426224,
-0.36604416370391846,
-0.13300830125808716,
0.1468675136566162,
-0.4273691177368164,
0.00870027020573616,
0.11158465594053268,
0.07072221487760544,
-0.010740093886852264,
0.16255253553390503,
0.30814260244369507,
0.19526615738868713,
0.3425676226615906,
-0.03847764432430267,
-0.12558408081531525,
0.008251264691352844,
0.005013547837734222,
0.04148346185684204,
-0.06893940269947052,
0.2926688492298126,
0.003580808639526367,
0.365398108959198,
-0.02986047975718975,
-0.3705821633338928,
-0.0996532291173935,
0.0983082503080368,
-0.13442593812942505,
0.12980234622955322,
0.18454593420028687,
-0.4766625761985779,
0.003091089427471161,
0.2593250870704651,
-0.22683146595954895,
0.29273080825805664,
0.20372305810451508,
0.03333945572376251,
0.10461358726024628,
0.08929922431707382,
-0.04461623355746269,
0.08872103691101074,
0.29944851994514465,
0.3114616274833679,
0.21697184443473816,
0.2970501482486725,
-0.04375148192048073,
-0.337129682302475,
-0.19277852773666382,
-0.03779260441660881,
0.2613287568092346,
-0.3466547131538391,
0.12324559688568115,
-0.18967950344085693,
0.1543920636177063,
-0.16777965426445007,
-0.31850987672805786,
-0.2430305778980255,
-0.06692532449960709,
-0.11821331828832626,
0.31710684299468994,
-0.029258977621793747,
0.20156854391098022,
-0.374463826417923,
0.01525677740573883,
-0.02065885066986084,
-0.3291296660900116,
-0.19192621111869812,
-0.12911611795425415,
-0.37569329142570496,
-0.018026473000645638,
0.4828004837036133,
-0.026753567159175873,
0.09510393440723419,
0.012904658913612366,
0.2541850805282593,
-0.4948851764202118,
-0.3675993084907532,
0.1382535696029663,
-0.13097511231899261,
0.23663870990276337,
0.19039353728294373,
-0.12374557554721832,
-0.088723324239254,
-0.23278164863586426,
0.251573383808136,
-0.20342595875263214,
-0.2203892171382904,
0.3732360303401947,
-0.2217811793088913,
0.17489702999591827,
0.005950301885604858,
-0.20553044974803925,
-0.2205798625946045,
-0.3202366828918457,
0.5006443858146667,
0.1682344228029251,
0.03563486039638519,
-0.03520718961954117,
0.17712000012397766,
0.4239635467529297,
-0.08990547060966492,
0.1240590363740921,
0.011604145169258118,
-0.04145336151123047,
0.29569417238235474,
-0.0018043741583824158,
-0.3811092674732208,
-0.03941774368286133,
-0.18604996800422668,
0.09346745908260345,
0.23305906355381012,
-0.7317491769790649,
-0.04618110507726669,
-0.1499202400445938,
0.3552669882774353,
-0.2692868411540985,
0.08781260997056961,
0.16590774059295654,
-0.05762092024087906,
0.009343799203634262,
0.06885471194982529,
-0.05470923334360123,
-0.11719842255115509,
-0.274093896150589,
0.14919081330299377,
-0.16350986063480377,
0.5073177218437195,
0.045611247420310974,
0.6507900357246399,
-0.03800523281097412,
-0.19504320621490479,
0.3407360315322876,
-0.07395381480455399,
0.30440011620521545,
-0.12348110973834991,
-0.1405840665102005,
0.08100640028715134,
-0.050982728600502014,
0.06725557148456573,
0.3393782377243042,
0.030979767441749573,
-0.2547607123851776,
-0.048527609556913376,
-0.26064878702163696,
-0.07214824110269547,
-0.3136461675167084,
0.1375752091407776,
0.044177163392305374,
-0.04539651423692703,
-0.08082074671983719,
0.10513646900653839,
-0.02363697811961174,
-0.30438676476478577,
0.21836665272712708,
-0.012953314930200577,
-0.07787096500396729,
-0.00526316836476326,
-0.27243655920028687,
0.08032029867172241,
-0.4225690960884094,
0.29266494512557983,
0.03706546500325203,
0.18740983307361603,
0.1402803659439087,
-0.37815943360328674,
0.27315041422843933,
-0.31683632731437683,
0.6669288873672485,
0.1357891857624054,
0.09878021478652954,
0.002649948000907898,
0.10594305396080017,
-0.6825571656227112,
-0.0860707089304924,
-0.23677407205104828,
0.1796240359544754,
0.24272245168685913,
0.4616071283817291,
-0.47518283128738403,
-0.1263779252767563,
0.42183536291122437,
0.5109720826148987,
-0.01647607982158661,
-0.21444541215896606,
-0.4147226810455322,
-0.29361677169799805,
-0.18097993731498718,
0.3568427264690399,
-0.13458570837974548,
0.3355751037597656,
-0.001903735101222992,
0.24351900815963745,
-0.24523669481277466,
-0.036125656217336655,
0.006463918834924698,
0.16075843572616577,
0.22914789617061615,
-0.11106209456920624,
0.24329383671283722,
-0.03661264479160309,
0.273629367351532,
0.32431796193122864,
0.7347321510314941,
0.15556971728801727,
-0.639854907989502,
0.12601494789123535,
0.2092236429452896,
0.34131920337677,
0.297465443611145,
-0.10469898581504822,
0.10681594908237457,
0.03954535722732544,
0.25414595007896423,
0.007581595331430435,
0.10382020473480225,
0.25522127747535706,
-0.12779617309570312,
-0.28702956438064575,
0.14220866560935974,
0.6114946603775024,
0.2211814969778061,
0.010352686047554016,
0.09588061273097992,
0.5646122694015503,
-0.1446680724620819,
0.32854825258255005,
0.007375314831733704,
0.9299673438072205,
-0.05551878362894058,
0.28534308075904846,
0.4936719238758087,
-0.19384092092514038,
0.44900059700012207,
-0.1664876490831375,
-0.004104519262909889,
-0.46999678015708923,
-0.040509045124053955,
0.12039994448423386,
-0.19708731770515442,
-0.05187355354428291,
0.057264987379312515,
0.001111932098865509,
0.2197718322277069,
-0.04329180717468262,
0.29162847995758057,
0.10900827497243881,
0.2551395297050476,
-0.08085311949253082,
-0.22903557121753693,
-0.2651006281375885,
0.03898657113313675,
-0.06067580729722977,
0.03268325701355934,
-0.12744209170341492,
-0.028781885281205177,
0.056018419563770294,
-0.27653399109840393,
-0.15491896867752075,
0.31677135825157166,
-0.5567545890808105,
0.10381045937538147,
0.2169172614812851,
-0.6862828731536865,
0.12728926539421082,
0.15535974502563477,
-0.011274877935647964,
-0.08368027210235596,
-0.15931223332881927,
0.050750862807035446,
0.036541178822517395,
-0.02046799473464489,
0.13250210881233215,
-0.04036910831928253,
0.3446243405342102,
-0.01277226209640503,
-0.15278497338294983,
0.1400664746761322,
-0.10374264419078827,
-0.13087216019630432,
0.22601518034934998,
0.18421247601509094,
0.2449198216199875,
-0.1628846824169159,
-0.06356305629014969,
-0.18040335178375244,
0.15170153975486755,
-0.16601958870887756,
0.042029257863759995,
-0.0032871831208467484,
-0.10191754251718521,
-0.06922028213739395,
0.11078964173793793,
-0.4581258296966553,
-0.184848353266716,
0.42548689246177673,
-0.037955112755298615,
-0.16256961226463318,
0.461896151304245,
0.4328024685382843,
-0.12430811673402786,
-0.1272301971912384,
-0.14232505857944489,
0.5597931146621704,
-0.7869177460670471,
-0.10802767425775528,
-0.01294776052236557,
0.198054701089859,
0.03071892261505127,
0.17622950673103333,
0.1954241842031479,
-0.2735710144042969,
-0.07331614196300507,
-0.29664790630340576,
-0.4547753930091858,
0.3515753149986267,
0.050420187413692474,
0.07819397747516632,
0.20098203420639038,
-0.045196495950222015,
-0.09635671973228455,
-0.057422637939453125,
-0.18969634175300598,
0.31628620624542236,
0.04444219172000885,
-0.006121305748820305,
-0.036266542971134186,
-0.02489023469388485,
0.34221258759498596,
0.28769102692604065,
0.08151549100875854,
0.21700595319271088,
-0.10979094356298447,
-0.15229825675487518,
-0.13887593150138855,
0.12081800401210785,
0.0575491227209568,
-0.0821995660662651,
-0.02083965390920639,
-0.07554701715707779,
0.15304318070411682,
-0.14305688440799713,
0.4690489172935486,
0.006285965442657471,
-0.07443996518850327,
-0.32494375109672546,
0.26258236169815063,
0.09110300242900848,
-0.32783547043800354,
0.18049032986164093,
-0.12492211163043976,
0.24853165447711945,
0.12308482080698013,
0.17629002034664154,
-0.09159758687019348,
-0.03171912580728531,
-0.0477607361972332,
0.032174497842788696,
0.2984188199043274,
-0.014502415433526039,
0.0898454338312149,
-0.51108318567276,
-0.388155996799469,
-0.20316696166992188,
0.26995140314102173,
0.40581634640693665,
-0.23531781136989594,
-0.13653649389743805,
0.31357064843177795,
0.16536803543567657,
-0.20174512267112732,
-0.06453581899404526,
0.2855156362056732,
-0.06766875088214874,
0.005038850009441376,
0.2889828383922577,
0.10252051055431366,
-0.0383240282535553,
-0.20823107659816742,
0.1996997892856598,
0.20008011162281036,
0.19817706942558289,
-0.16139787435531616,
0.4024536907672882,
-0.2167302668094635,
-0.09836743772029877,
0.4893497824668884,
0.12983965873718262,
0.38112199306488037,
0.17504914104938507,
-0.33008909225463867,
0.5429539084434509,
-0.17624559998512268,
0.02013286016881466,
0.13309089839458466,
-0.5279762744903564,
-0.11576485633850098,
0.18548178672790527,
0.2053680717945099,
-0.1344650685787201,
-0.04493138566613197,
0.7136262655258179,
0.22087937593460083,
-0.13739676773548126,
-0.3261715769767761,
0.031940799206495285,
-0.24106374382972717,
-0.13509805500507355,
0.012427069246768951,
-0.23201507329940796,
-0.05929291993379593,
0.2354181855916977,
-0.31489238142967224,
-0.2169000804424286,
0.31703516840934753,
0.13821786642074585,
-0.06894408911466599,
-0.3522759675979614,
-0.03426385298371315,
0.377806156873703,
-0.038938138633966446,
-0.23826153576374054,
0.37912535667419434,
0.13838985562324524,
-0.10565653443336487,
-0.0652056485414505,
0.08672424405813217,
0.5123559832572937,
0.26347485184669495,
-0.18122322857379913,
-0.2771204710006714,
-0.04592062532901764,
0.1390828788280487,
-0.15611723065376282,
0.23886319994926453,
0.0834750235080719,
0.25681114196777344,
0.4055262506008148,
0.042542144656181335,
-0.1860365867614746,
0.05434276908636093,
0.09167542308568954,
0.14539049565792084,
-0.32992416620254517,
0.009934578090906143,
-0.23064455389976501,
-0.35697290301322937,
-0.19508405029773712,
-0.06443323194980621,
-0.23884937167167664,
0.03927985951304436,
0.20048655569553375,
0.08693599700927734,
-0.07096482813358307,
-0.16522842645645142,
0.030464861541986465,
-0.04876019060611725,
0.4619767963886261,
0.502947986125946,
0.233500137925148,
-0.21512043476104736,
-0.183317169547081,
-0.7048707604408264,
0.5702226758003235,
-0.3560499846935272,
0.1203530952334404,
0.11824235320091248,
0.21639341115951538,
-0.07751302421092987,
0.3233075439929962,
0.07571964710950851,
0.24460405111312866,
-0.024765022099018097,
0.11944705247879028,
-0.3689011037349701,
-0.11812643706798553,
0.17064723372459412,
-0.0653526782989502,
-0.052955303341150284,
-0.3262892961502075,
0.0037504946812987328,
-0.28102099895477295,
-0.01984010636806488,
-0.10526096075773239,
-0.1328636258840561,
-0.17617058753967285,
-0.04516725242137909,
0.780179500579834,
-0.03779234737157822,
0.37633997201919556,
0.16635343432426453,
-0.22418349981307983,
-0.5434808731079102,
-0.18885588645935059,
-0.06837798655033112,
0.30406883358955383,
-0.11931437253952026,
0.24166284501552582,
-0.03336481377482414,
0.005914379842579365,
-0.20149505138397217,
0.012590397149324417,
0.010974496603012085,
0.04179717227816582,
-0.00400146096944809,
0.1358031928539276,
-0.08068904280662537,
0.2378305196762085,
-0.09566394239664078,
0.14701491594314575,
0.07126200944185257,
0.08328906446695328,
-0.22682449221611023,
-0.4992572069168091,
0.5370686054229736,
-0.7204736471176147,
-0.19175641238689423,
-0.02936163917183876,
0.32382646203041077,
0.2061128467321396,
-0.3609212636947632,
-0.6046025156974792,
0.27889537811279297,
0.22243589162826538,
0.09066900610923767,
-0.3003145754337311,
-0.0028796494007110596,
-0.2511594295501709,
0.041661567986011505,
-0.20269331336021423,
0.32523757219314575,
-0.021042410284280777,
-0.2448698878288269,
0.029283195734024048,
-0.30332833528518677
] |
https://github.com/huggingface/datasets/issues/5695 | Hey, thanks for the reply! I've since switched to working with the locally-saved dataset (which works).
Maybe it makes sense to show a warning for uploads with large shard sizes? Since the functionality completely breaks (due to the PyArrow bug). | Loading big dataset raises pyarrow.lib.ArrowNotImplementedError | ### Describe the bug
Calling `datasets.load_dataset` to load the (publicly available) dataset `theodor1289/wit` fails with `pyarrow.lib.ArrowNotImplementedError`.
### Steps to reproduce the bug
Steps to reproduce this behavior:
1. `!pip install datasets`
2. `!huggingface-cli login`
3. This step will throw the error (it might take a while as the dataset has ~170GB):
```python
from datasets import load_dataset
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
```
Stack trace:
```
(torch-multimodal) bash-4.2$ python test.py
Downloading and preparing dataset None/None to /cluster/work/cotterell/tamariucai/HuggingfaceDatasets/theodor1289___parquet/theodor1289--wit-7a3e984414a86a0f/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec...
Downloading data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 491.68it/s]
Extracting data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 16.93it/s]
Traceback (most recent call last):
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1860, in _prepare_split_single
for _, table in generator:
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 69, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1323, in iter_batches
File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/cluster/work/cotterell/tamariucai/multimodal-mirror/examples/test.py", line 2, in <module>
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 986, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1748, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1893, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
The dataset is loaded in variable `dataset`.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.10.4
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
| 40 | Loading big dataset raises pyarrow.lib.ArrowNotImplementedError
### Describe the bug
Calling `datasets.load_dataset` to load the (publicly available) dataset `theodor1289/wit` fails with `pyarrow.lib.ArrowNotImplementedError`.
### Steps to reproduce the bug
Steps to reproduce this behavior:
1. `!pip install datasets`
2. `!huggingface-cli login`
3. This step will throw the error (it might take a while as the dataset has ~170GB):
```python
from datasets import load_dataset
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
```
Stack trace:
```
(torch-multimodal) bash-4.2$ python test.py
Downloading and preparing dataset None/None to /cluster/work/cotterell/tamariucai/HuggingfaceDatasets/theodor1289___parquet/theodor1289--wit-7a3e984414a86a0f/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec...
Downloading data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 491.68it/s]
Extracting data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 16.93it/s]
Traceback (most recent call last):
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1860, in _prepare_split_single
for _, table in generator:
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 69, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1323, in iter_batches
File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/cluster/work/cotterell/tamariucai/multimodal-mirror/examples/test.py", line 2, in <module>
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 986, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1748, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1893, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
The dataset is loaded in variable `dataset`.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.10.4
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
Hey, thanks for the reply! I've since switched to working with the locally-saved dataset (which works).
Maybe it makes sense to show a warning for uploads with large shard sizes? Since the functionality completely breaks (due to the PyArrow bug). | [
-0.36002859473228455,
0.04276201128959656,
0.11041624844074249,
0.5041696429252625,
0.22531577944755554,
-0.20803719758987427,
0.2163711041212082,
0.19029837846755981,
-0.20871645212173462,
0.20421102643013,
-0.09125034511089325,
0.6012040376663208,
-0.11784866452217102,
-0.12901639938354492,
0.1307569146156311,
-0.13230448961257935,
0.06511824578046799,
0.08160844445228577,
-0.08167270570993423,
0.08421698212623596,
-0.10585974156856537,
0.15787310898303986,
-0.2615298330783844,
0.2127004861831665,
-0.18483684957027435,
0.059403203427791595,
0.0026949718594551086,
0.28332793712615967,
-0.11843465268611908,
-0.4641624689102173,
0.2070017158985138,
-0.2581101357936859,
0.16843949258327484,
0.5688139796257019,
-0.00012222885561641306,
0.09924210608005524,
0.3478609621524811,
0.20523172616958618,
-0.31461673974990845,
-0.20816031098365784,
0.17828579246997833,
-0.4556504487991333,
0.41995272040367126,
-0.1822991669178009,
0.05111069977283478,
-0.3134867250919342,
-0.08043865859508514,
0.17829495668411255,
0.2496967315673828,
0.2228722721338272,
0.1525610238313675,
0.5205861330032349,
0.24243271350860596,
0.07011547684669495,
0.5378828048706055,
-0.04438558220863342,
-0.06587961316108704,
0.22352537512779236,
0.2466321885585785,
-0.050944291055202484,
-0.34741440415382385,
0.1250907927751541,
0.01693015545606613,
0.13802210986614227,
0.2163514345884323,
0.06658972799777985,
-0.15904712677001953,
-0.15371432900428772,
0.16561108827590942,
0.29331332445144653,
0.3562414050102234,
-0.4237765371799469,
-0.26516449451446533,
-0.22031861543655396,
0.14786702394485474,
-0.2502976059913635,
0.3048233389854431,
0.3439120650291443,
-0.17914503812789917,
0.028171397745609283,
-0.08233620226383209,
0.008384522050619125,
-0.24206697940826416,
0.12496933341026306,
-0.1453215777873993,
0.2276231199502945,
-0.052333757281303406,
0.14973284304141998,
0.31022366881370544,
-0.15541283786296844,
-0.09776751697063446,
-0.03898927569389343,
-0.11066991835832596,
0.09602604806423187,
-0.49186575412750244,
0.14296302199363708,
-0.04495853930711746,
0.3768194913864136,
0.39765602350234985,
0.35244160890579224,
0.04032406210899353,
0.06492580473423004,
0.2068379819393158,
0.054900508373975754,
0.10590901970863342,
0.05773165449500084,
-0.512406051158905,
-0.0962192714214325,
0.24184538424015045,
0.21204835176467896,
0.07193882763385773,
0.07774411141872406,
-0.11517906188964844,
-0.3209916651248932,
0.10601556301116943,
-0.23691561818122864,
0.4037882387638092,
-0.2381032407283783,
-0.3806278109550476,
0.2215002328157425,
-0.26838576793670654,
0.022125165909528732,
0.054306935518980026,
0.40491873025894165,
-0.2659057080745697,
0.14024797081947327,
-0.04544156789779663,
0.222760409116745,
-0.2143045961856842,
-0.25664016604423523,
-0.2147689014673233,
-0.05940750986337662,
-0.16690292954444885,
0.05292504280805588,
0.22134211659431458,
-0.15889036655426025,
0.11727882921695709,
0.0531352162361145,
0.167011559009552,
-0.13221552968025208,
-0.02609695866703987,
-0.08986175060272217,
-0.0825924351811409,
0.29657965898513794,
-0.19052353501319885,
0.08670100569725037,
0.05251377448439598,
0.06295355409383774,
-0.12377698719501495,
0.20981763303279877,
-0.19945064187049866,
-0.38803520798683167,
-0.31857043504714966,
0.09420591592788696,
-0.3295561373233795,
-0.011543912813067436,
-0.3417505919933319,
0.021293016150593758,
-0.04203684628009796,
-0.02249418944120407,
0.15909811854362488,
-0.144818514585495,
0.026296868920326233,
-0.27168476581573486,
0.4352302849292755,
0.2743813991546631,
-0.4686276912689209,
0.0031767338514328003,
-0.040638137608766556,
-0.24947518110275269,
0.22265881299972534,
0.24165433645248413,
-0.28357404470443726,
0.10262031853199005,
-0.1886805295944214,
0.1709785759449005,
0.2953191101551056,
-0.09699971228837967,
-0.733908474445343,
0.2503823935985565,
-0.34929561614990234,
0.22200652956962585,
0.1602785736322403,
-0.03139661252498627,
-0.2079378068447113,
0.12785851955413818,
0.013798748143017292,
0.34728479385375977,
-0.047942426055669785,
0.19997210800647736,
-0.34799623489379883,
-0.40335842967033386,
0.21267394721508026,
0.35688555240631104,
0.1704360544681549,
-0.30883052945137024,
0.1890818178653717,
-0.2482474446296692,
0.3311004638671875,
-0.20835229754447937,
0.06495591253042221,
0.09328573197126389,
0.12972895801067352,
0.06426744908094406,
0.06922156363725662,
-0.05684662610292435,
-0.5748125314712524,
0.31906577944755554,
-0.04876074939966202,
0.1274321973323822,
-0.466266393661499,
-0.1305573284626007,
-0.08573821187019348,
0.3415827751159668,
-0.2074180692434311,
-0.060552600771188736,
0.013897158205509186,
0.16769680380821228,
0.16146844625473022,
0.06513549387454987,
-0.24808764457702637,
0.0881582647562027,
-0.06934594362974167,
0.3239607512950897,
-0.337843120098114,
0.4175768494606018,
0.07334592938423157,
-0.29762962460517883,
-0.09085657447576523,
0.18601617217063904,
0.04022520035505295,
-0.11527657508850098,
-0.07770346105098724,
0.4499233663082123,
-0.2035689651966095,
0.07779551297426224,
-0.36604416370391846,
-0.13300830125808716,
0.1468675136566162,
-0.4273691177368164,
0.00870027020573616,
0.11158465594053268,
0.07072221487760544,
-0.010740093886852264,
0.16255253553390503,
0.30814260244369507,
0.19526615738868713,
0.3425676226615906,
-0.03847764432430267,
-0.12558408081531525,
0.008251264691352844,
0.005013547837734222,
0.04148346185684204,
-0.06893940269947052,
0.2926688492298126,
0.003580808639526367,
0.365398108959198,
-0.02986047975718975,
-0.3705821633338928,
-0.0996532291173935,
0.0983082503080368,
-0.13442593812942505,
0.12980234622955322,
0.18454593420028687,
-0.4766625761985779,
0.003091089427471161,
0.2593250870704651,
-0.22683146595954895,
0.29273080825805664,
0.20372305810451508,
0.03333945572376251,
0.10461358726024628,
0.08929922431707382,
-0.04461623355746269,
0.08872103691101074,
0.29944851994514465,
0.3114616274833679,
0.21697184443473816,
0.2970501482486725,
-0.04375148192048073,
-0.337129682302475,
-0.19277852773666382,
-0.03779260441660881,
0.2613287568092346,
-0.3466547131538391,
0.12324559688568115,
-0.18967950344085693,
0.1543920636177063,
-0.16777965426445007,
-0.31850987672805786,
-0.2430305778980255,
-0.06692532449960709,
-0.11821331828832626,
0.31710684299468994,
-0.029258977621793747,
0.20156854391098022,
-0.374463826417923,
0.01525677740573883,
-0.02065885066986084,
-0.3291296660900116,
-0.19192621111869812,
-0.12911611795425415,
-0.37569329142570496,
-0.018026473000645638,
0.4828004837036133,
-0.026753567159175873,
0.09510393440723419,
0.012904658913612366,
0.2541850805282593,
-0.4948851764202118,
-0.3675993084907532,
0.1382535696029663,
-0.13097511231899261,
0.23663870990276337,
0.19039353728294373,
-0.12374557554721832,
-0.088723324239254,
-0.23278164863586426,
0.251573383808136,
-0.20342595875263214,
-0.2203892171382904,
0.3732360303401947,
-0.2217811793088913,
0.17489702999591827,
0.005950301885604858,
-0.20553044974803925,
-0.2205798625946045,
-0.3202366828918457,
0.5006443858146667,
0.1682344228029251,
0.03563486039638519,
-0.03520718961954117,
0.17712000012397766,
0.4239635467529297,
-0.08990547060966492,
0.1240590363740921,
0.011604145169258118,
-0.04145336151123047,
0.29569417238235474,
-0.0018043741583824158,
-0.3811092674732208,
-0.03941774368286133,
-0.18604996800422668,
0.09346745908260345,
0.23305906355381012,
-0.7317491769790649,
-0.04618110507726669,
-0.1499202400445938,
0.3552669882774353,
-0.2692868411540985,
0.08781260997056961,
0.16590774059295654,
-0.05762092024087906,
0.009343799203634262,
0.06885471194982529,
-0.05470923334360123,
-0.11719842255115509,
-0.274093896150589,
0.14919081330299377,
-0.16350986063480377,
0.5073177218437195,
0.045611247420310974,
0.6507900357246399,
-0.03800523281097412,
-0.19504320621490479,
0.3407360315322876,
-0.07395381480455399,
0.30440011620521545,
-0.12348110973834991,
-0.1405840665102005,
0.08100640028715134,
-0.050982728600502014,
0.06725557148456573,
0.3393782377243042,
0.030979767441749573,
-0.2547607123851776,
-0.048527609556913376,
-0.26064878702163696,
-0.07214824110269547,
-0.3136461675167084,
0.1375752091407776,
0.044177163392305374,
-0.04539651423692703,
-0.08082074671983719,
0.10513646900653839,
-0.02363697811961174,
-0.30438676476478577,
0.21836665272712708,
-0.012953314930200577,
-0.07787096500396729,
-0.00526316836476326,
-0.27243655920028687,
0.08032029867172241,
-0.4225690960884094,
0.29266494512557983,
0.03706546500325203,
0.18740983307361603,
0.1402803659439087,
-0.37815943360328674,
0.27315041422843933,
-0.31683632731437683,
0.6669288873672485,
0.1357891857624054,
0.09878021478652954,
0.002649948000907898,
0.10594305396080017,
-0.6825571656227112,
-0.0860707089304924,
-0.23677407205104828,
0.1796240359544754,
0.24272245168685913,
0.4616071283817291,
-0.47518283128738403,
-0.1263779252767563,
0.42183536291122437,
0.5109720826148987,
-0.01647607982158661,
-0.21444541215896606,
-0.4147226810455322,
-0.29361677169799805,
-0.18097993731498718,
0.3568427264690399,
-0.13458570837974548,
0.3355751037597656,
-0.001903735101222992,
0.24351900815963745,
-0.24523669481277466,
-0.036125656217336655,
0.006463918834924698,
0.16075843572616577,
0.22914789617061615,
-0.11106209456920624,
0.24329383671283722,
-0.03661264479160309,
0.273629367351532,
0.32431796193122864,
0.7347321510314941,
0.15556971728801727,
-0.639854907989502,
0.12601494789123535,
0.2092236429452896,
0.34131920337677,
0.297465443611145,
-0.10469898581504822,
0.10681594908237457,
0.03954535722732544,
0.25414595007896423,
0.007581595331430435,
0.10382020473480225,
0.25522127747535706,
-0.12779617309570312,
-0.28702956438064575,
0.14220866560935974,
0.6114946603775024,
0.2211814969778061,
0.010352686047554016,
0.09588061273097992,
0.5646122694015503,
-0.1446680724620819,
0.32854825258255005,
0.007375314831733704,
0.9299673438072205,
-0.05551878362894058,
0.28534308075904846,
0.4936719238758087,
-0.19384092092514038,
0.44900059700012207,
-0.1664876490831375,
-0.004104519262909889,
-0.46999678015708923,
-0.040509045124053955,
0.12039994448423386,
-0.19708731770515442,
-0.05187355354428291,
0.057264987379312515,
0.001111932098865509,
0.2197718322277069,
-0.04329180717468262,
0.29162847995758057,
0.10900827497243881,
0.2551395297050476,
-0.08085311949253082,
-0.22903557121753693,
-0.2651006281375885,
0.03898657113313675,
-0.06067580729722977,
0.03268325701355934,
-0.12744209170341492,
-0.028781885281205177,
0.056018419563770294,
-0.27653399109840393,
-0.15491896867752075,
0.31677135825157166,
-0.5567545890808105,
0.10381045937538147,
0.2169172614812851,
-0.6862828731536865,
0.12728926539421082,
0.15535974502563477,
-0.011274877935647964,
-0.08368027210235596,
-0.15931223332881927,
0.050750862807035446,
0.036541178822517395,
-0.02046799473464489,
0.13250210881233215,
-0.04036910831928253,
0.3446243405342102,
-0.01277226209640503,
-0.15278497338294983,
0.1400664746761322,
-0.10374264419078827,
-0.13087216019630432,
0.22601518034934998,
0.18421247601509094,
0.2449198216199875,
-0.1628846824169159,
-0.06356305629014969,
-0.18040335178375244,
0.15170153975486755,
-0.16601958870887756,
0.042029257863759995,
-0.0032871831208467484,
-0.10191754251718521,
-0.06922028213739395,
0.11078964173793793,
-0.4581258296966553,
-0.184848353266716,
0.42548689246177673,
-0.037955112755298615,
-0.16256961226463318,
0.461896151304245,
0.4328024685382843,
-0.12430811673402786,
-0.1272301971912384,
-0.14232505857944489,
0.5597931146621704,
-0.7869177460670471,
-0.10802767425775528,
-0.01294776052236557,
0.198054701089859,
0.03071892261505127,
0.17622950673103333,
0.1954241842031479,
-0.2735710144042969,
-0.07331614196300507,
-0.29664790630340576,
-0.4547753930091858,
0.3515753149986267,
0.050420187413692474,
0.07819397747516632,
0.20098203420639038,
-0.045196495950222015,
-0.09635671973228455,
-0.057422637939453125,
-0.18969634175300598,
0.31628620624542236,
0.04444219172000885,
-0.006121305748820305,
-0.036266542971134186,
-0.02489023469388485,
0.34221258759498596,
0.28769102692604065,
0.08151549100875854,
0.21700595319271088,
-0.10979094356298447,
-0.15229825675487518,
-0.13887593150138855,
0.12081800401210785,
0.0575491227209568,
-0.0821995660662651,
-0.02083965390920639,
-0.07554701715707779,
0.15304318070411682,
-0.14305688440799713,
0.4690489172935486,
0.006285965442657471,
-0.07443996518850327,
-0.32494375109672546,
0.26258236169815063,
0.09110300242900848,
-0.32783547043800354,
0.18049032986164093,
-0.12492211163043976,
0.24853165447711945,
0.12308482080698013,
0.17629002034664154,
-0.09159758687019348,
-0.03171912580728531,
-0.0477607361972332,
0.032174497842788696,
0.2984188199043274,
-0.014502415433526039,
0.0898454338312149,
-0.51108318567276,
-0.388155996799469,
-0.20316696166992188,
0.26995140314102173,
0.40581634640693665,
-0.23531781136989594,
-0.13653649389743805,
0.31357064843177795,
0.16536803543567657,
-0.20174512267112732,
-0.06453581899404526,
0.2855156362056732,
-0.06766875088214874,
0.005038850009441376,
0.2889828383922577,
0.10252051055431366,
-0.0383240282535553,
-0.20823107659816742,
0.1996997892856598,
0.20008011162281036,
0.19817706942558289,
-0.16139787435531616,
0.4024536907672882,
-0.2167302668094635,
-0.09836743772029877,
0.4893497824668884,
0.12983965873718262,
0.38112199306488037,
0.17504914104938507,
-0.33008909225463867,
0.5429539084434509,
-0.17624559998512268,
0.02013286016881466,
0.13309089839458466,
-0.5279762744903564,
-0.11576485633850098,
0.18548178672790527,
0.2053680717945099,
-0.1344650685787201,
-0.04493138566613197,
0.7136262655258179,
0.22087937593460083,
-0.13739676773548126,
-0.3261715769767761,
0.031940799206495285,
-0.24106374382972717,
-0.13509805500507355,
0.012427069246768951,
-0.23201507329940796,
-0.05929291993379593,
0.2354181855916977,
-0.31489238142967224,
-0.2169000804424286,
0.31703516840934753,
0.13821786642074585,
-0.06894408911466599,
-0.3522759675979614,
-0.03426385298371315,
0.377806156873703,
-0.038938138633966446,
-0.23826153576374054,
0.37912535667419434,
0.13838985562324524,
-0.10565653443336487,
-0.0652056485414505,
0.08672424405813217,
0.5123559832572937,
0.26347485184669495,
-0.18122322857379913,
-0.2771204710006714,
-0.04592062532901764,
0.1390828788280487,
-0.15611723065376282,
0.23886319994926453,
0.0834750235080719,
0.25681114196777344,
0.4055262506008148,
0.042542144656181335,
-0.1860365867614746,
0.05434276908636093,
0.09167542308568954,
0.14539049565792084,
-0.32992416620254517,
0.009934578090906143,
-0.23064455389976501,
-0.35697290301322937,
-0.19508405029773712,
-0.06443323194980621,
-0.23884937167167664,
0.03927985951304436,
0.20048655569553375,
0.08693599700927734,
-0.07096482813358307,
-0.16522842645645142,
0.030464861541986465,
-0.04876019060611725,
0.4619767963886261,
0.502947986125946,
0.233500137925148,
-0.21512043476104736,
-0.183317169547081,
-0.7048707604408264,
0.5702226758003235,
-0.3560499846935272,
0.1203530952334404,
0.11824235320091248,
0.21639341115951538,
-0.07751302421092987,
0.3233075439929962,
0.07571964710950851,
0.24460405111312866,
-0.024765022099018097,
0.11944705247879028,
-0.3689011037349701,
-0.11812643706798553,
0.17064723372459412,
-0.0653526782989502,
-0.052955303341150284,
-0.3262892961502075,
0.0037504946812987328,
-0.28102099895477295,
-0.01984010636806488,
-0.10526096075773239,
-0.1328636258840561,
-0.17617058753967285,
-0.04516725242137909,
0.780179500579834,
-0.03779234737157822,
0.37633997201919556,
0.16635343432426453,
-0.22418349981307983,
-0.5434808731079102,
-0.18885588645935059,
-0.06837798655033112,
0.30406883358955383,
-0.11931437253952026,
0.24166284501552582,
-0.03336481377482414,
0.005914379842579365,
-0.20149505138397217,
0.012590397149324417,
0.010974496603012085,
0.04179717227816582,
-0.00400146096944809,
0.1358031928539276,
-0.08068904280662537,
0.2378305196762085,
-0.09566394239664078,
0.14701491594314575,
0.07126200944185257,
0.08328906446695328,
-0.22682449221611023,
-0.4992572069168091,
0.5370686054229736,
-0.7204736471176147,
-0.19175641238689423,
-0.02936163917183876,
0.32382646203041077,
0.2061128467321396,
-0.3609212636947632,
-0.6046025156974792,
0.27889537811279297,
0.22243589162826538,
0.09066900610923767,
-0.3003145754337311,
-0.0028796494007110596,
-0.2511594295501709,
0.041661567986011505,
-0.20269331336021423,
0.32523757219314575,
-0.021042410284280777,
-0.2448698878288269,
0.029283195734024048,
-0.30332833528518677
] |
https://github.com/huggingface/datasets/issues/5695 | Just tried uploading the same dataset with 500MB shards, I get an errors 4 hours in:
```
Pushing dataset shards to the dataset hub: 25%|██▍ | 358/1453 [4:40:31<14:18:00, 47.01s/it]
Traceback (most recent call last):
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 344, in _inner_upload_lfs_object
return _upload_lfs_object(operation=operation, lfs_batch_action=batch_action, token=token)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 391, in _upload_lfs_object
lfs_upload(
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 254, in lfs_upload
_upload_multi_part(
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 374, in _upload_multi_part
hf_raise_for_status(part_upload_res)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 301, in hf_raise_for_status
raise HfHubHTTPError(str(e), response=response) from e
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 46, in __init__
server_data = response.json()
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/requests/models.py", line 899, in json
return complexjson.loads(
File "/cluster/work/cotterell/tamariucai/miniconda3/envs/torch-multimodal/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/cluster/work/cotterell/tamariucai/miniconda3/envs/torch-multimodal/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/cluster/work/cotterell/tamariucai/miniconda3/envs/torch-multimodal/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "process_wit.py", line 146, in <module>
dataset.push_to_hub(FINAL_PATH, max_shard_size="500MB", private=False)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1534, in push_to_hub
repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub(
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 4804, in _push_parquet_shards_to_hub
_retry(
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 281, in _retry
return func(*func_args, **func_kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn
return fn(*args, **kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2593, in upload_file
commit_info = self.create_commit(
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn
return fn(*args, **kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2411, in create_commit
upload_lfs_files(
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn
return fn(*args, **kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 351, in upload_lfs_files
thread_map(
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map
return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map
return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs))
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/tqdm/std.py", line 1178, in __iter__
for obj in iterable:
File "/cluster/work/cotterell/tamariucai/miniconda3/envs/torch-multimodal/lib/python3.8/concurrent/futures/_base.py", line 619, in result_iterator
yield fs.pop().result()
File "/cluster/work/cotterell/tamariucai/miniconda3/envs/torch-multimodal/lib/python3.8/concurrent/futures/_base.py", line 444, in result
return self.__get_result()
File "/cluster/work/cotterell/tamariucai/miniconda3/envs/torch-multimodal/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
raise self._exception
File "/cluster/work/cotterell/tamariucai/miniconda3/envs/torch-multimodal/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 346, in _inner_upload_lfs_object
raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc
RuntimeError: Error while uploading 'data/train-00358-of-01453-22a5cc8b3eb12be3.parquet' to the Hub.
```
Local saves do work, however. | Loading big dataset raises pyarrow.lib.ArrowNotImplementedError | ### Describe the bug
Calling `datasets.load_dataset` to load the (publicly available) dataset `theodor1289/wit` fails with `pyarrow.lib.ArrowNotImplementedError`.
### Steps to reproduce the bug
Steps to reproduce this behavior:
1. `!pip install datasets`
2. `!huggingface-cli login`
3. This step will throw the error (it might take a while as the dataset has ~170GB):
```python
from datasets import load_dataset
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
```
Stack trace:
```
(torch-multimodal) bash-4.2$ python test.py
Downloading and preparing dataset None/None to /cluster/work/cotterell/tamariucai/HuggingfaceDatasets/theodor1289___parquet/theodor1289--wit-7a3e984414a86a0f/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec...
Downloading data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 491.68it/s]
Extracting data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 16.93it/s]
Traceback (most recent call last):
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1860, in _prepare_split_single
for _, table in generator:
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 69, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1323, in iter_batches
File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/cluster/work/cotterell/tamariucai/multimodal-mirror/examples/test.py", line 2, in <module>
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 986, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1748, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1893, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
The dataset is loaded in variable `dataset`.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.10.4
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
| 336 | Loading big dataset raises pyarrow.lib.ArrowNotImplementedError
### Describe the bug
Calling `datasets.load_dataset` to load the (publicly available) dataset `theodor1289/wit` fails with `pyarrow.lib.ArrowNotImplementedError`.
### Steps to reproduce the bug
Steps to reproduce this behavior:
1. `!pip install datasets`
2. `!huggingface-cli login`
3. This step will throw the error (it might take a while as the dataset has ~170GB):
```python
from datasets import load_dataset
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
```
Stack trace:
```
(torch-multimodal) bash-4.2$ python test.py
Downloading and preparing dataset None/None to /cluster/work/cotterell/tamariucai/HuggingfaceDatasets/theodor1289___parquet/theodor1289--wit-7a3e984414a86a0f/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec...
Downloading data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 491.68it/s]
Extracting data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 16.93it/s]
Traceback (most recent call last):
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1860, in _prepare_split_single
for _, table in generator:
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 69, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1323, in iter_batches
File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/cluster/work/cotterell/tamariucai/multimodal-mirror/examples/test.py", line 2, in <module>
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 986, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1748, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1893, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
The dataset is loaded in variable `dataset`.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.10.4
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
Just tried uploading the same dataset with 500MB shards, I get an errors 4 hours in:
```
Pushing dataset shards to the dataset hub: 25%|██▍ | 358/1453 [4:40:31<14:18:00, 47.01s/it]
Traceback (most recent call last):
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 344, in _inner_upload_lfs_object
return _upload_lfs_object(operation=operation, lfs_batch_action=batch_action, token=token)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 391, in _upload_lfs_object
lfs_upload(
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 254, in lfs_upload
_upload_multi_part(
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 374, in _upload_multi_part
hf_raise_for_status(part_upload_res)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 301, in hf_raise_for_status
raise HfHubHTTPError(str(e), response=response) from e
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py", line 46, in __init__
server_data = response.json()
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/requests/models.py", line 899, in json
return complexjson.loads(
File "/cluster/work/cotterell/tamariucai/miniconda3/envs/torch-multimodal/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/cluster/work/cotterell/tamariucai/miniconda3/envs/torch-multimodal/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/cluster/work/cotterell/tamariucai/miniconda3/envs/torch-multimodal/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "process_wit.py", line 146, in <module>
dataset.push_to_hub(FINAL_PATH, max_shard_size="500MB", private=False)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1534, in push_to_hub
repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub(
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 4804, in _push_parquet_shards_to_hub
_retry(
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 281, in _retry
return func(*func_args, **func_kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn
return fn(*args, **kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2593, in upload_file
commit_info = self.create_commit(
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn
return fn(*args, **kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2411, in create_commit
upload_lfs_files(
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn
return fn(*args, **kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 351, in upload_lfs_files
thread_map(
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map
return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map
return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs))
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/tqdm/std.py", line 1178, in __iter__
for obj in iterable:
File "/cluster/work/cotterell/tamariucai/miniconda3/envs/torch-multimodal/lib/python3.8/concurrent/futures/_base.py", line 619, in result_iterator
yield fs.pop().result()
File "/cluster/work/cotterell/tamariucai/miniconda3/envs/torch-multimodal/lib/python3.8/concurrent/futures/_base.py", line 444, in result
return self.__get_result()
File "/cluster/work/cotterell/tamariucai/miniconda3/envs/torch-multimodal/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
raise self._exception
File "/cluster/work/cotterell/tamariucai/miniconda3/envs/torch-multimodal/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 346, in _inner_upload_lfs_object
raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc
RuntimeError: Error while uploading 'data/train-00358-of-01453-22a5cc8b3eb12be3.parquet' to the Hub.
```
Local saves do work, however. | [
-0.36002859473228455,
0.04276201128959656,
0.11041624844074249,
0.5041696429252625,
0.22531577944755554,
-0.20803719758987427,
0.2163711041212082,
0.19029837846755981,
-0.20871645212173462,
0.20421102643013,
-0.09125034511089325,
0.6012040376663208,
-0.11784866452217102,
-0.12901639938354492,
0.1307569146156311,
-0.13230448961257935,
0.06511824578046799,
0.08160844445228577,
-0.08167270570993423,
0.08421698212623596,
-0.10585974156856537,
0.15787310898303986,
-0.2615298330783844,
0.2127004861831665,
-0.18483684957027435,
0.059403203427791595,
0.0026949718594551086,
0.28332793712615967,
-0.11843465268611908,
-0.4641624689102173,
0.2070017158985138,
-0.2581101357936859,
0.16843949258327484,
0.5688139796257019,
-0.00012222885561641306,
0.09924210608005524,
0.3478609621524811,
0.20523172616958618,
-0.31461673974990845,
-0.20816031098365784,
0.17828579246997833,
-0.4556504487991333,
0.41995272040367126,
-0.1822991669178009,
0.05111069977283478,
-0.3134867250919342,
-0.08043865859508514,
0.17829495668411255,
0.2496967315673828,
0.2228722721338272,
0.1525610238313675,
0.5205861330032349,
0.24243271350860596,
0.07011547684669495,
0.5378828048706055,
-0.04438558220863342,
-0.06587961316108704,
0.22352537512779236,
0.2466321885585785,
-0.050944291055202484,
-0.34741440415382385,
0.1250907927751541,
0.01693015545606613,
0.13802210986614227,
0.2163514345884323,
0.06658972799777985,
-0.15904712677001953,
-0.15371432900428772,
0.16561108827590942,
0.29331332445144653,
0.3562414050102234,
-0.4237765371799469,
-0.26516449451446533,
-0.22031861543655396,
0.14786702394485474,
-0.2502976059913635,
0.3048233389854431,
0.3439120650291443,
-0.17914503812789917,
0.028171397745609283,
-0.08233620226383209,
0.008384522050619125,
-0.24206697940826416,
0.12496933341026306,
-0.1453215777873993,
0.2276231199502945,
-0.052333757281303406,
0.14973284304141998,
0.31022366881370544,
-0.15541283786296844,
-0.09776751697063446,
-0.03898927569389343,
-0.11066991835832596,
0.09602604806423187,
-0.49186575412750244,
0.14296302199363708,
-0.04495853930711746,
0.3768194913864136,
0.39765602350234985,
0.35244160890579224,
0.04032406210899353,
0.06492580473423004,
0.2068379819393158,
0.054900508373975754,
0.10590901970863342,
0.05773165449500084,
-0.512406051158905,
-0.0962192714214325,
0.24184538424015045,
0.21204835176467896,
0.07193882763385773,
0.07774411141872406,
-0.11517906188964844,
-0.3209916651248932,
0.10601556301116943,
-0.23691561818122864,
0.4037882387638092,
-0.2381032407283783,
-0.3806278109550476,
0.2215002328157425,
-0.26838576793670654,
0.022125165909528732,
0.054306935518980026,
0.40491873025894165,
-0.2659057080745697,
0.14024797081947327,
-0.04544156789779663,
0.222760409116745,
-0.2143045961856842,
-0.25664016604423523,
-0.2147689014673233,
-0.05940750986337662,
-0.16690292954444885,
0.05292504280805588,
0.22134211659431458,
-0.15889036655426025,
0.11727882921695709,
0.0531352162361145,
0.167011559009552,
-0.13221552968025208,
-0.02609695866703987,
-0.08986175060272217,
-0.0825924351811409,
0.29657965898513794,
-0.19052353501319885,
0.08670100569725037,
0.05251377448439598,
0.06295355409383774,
-0.12377698719501495,
0.20981763303279877,
-0.19945064187049866,
-0.38803520798683167,
-0.31857043504714966,
0.09420591592788696,
-0.3295561373233795,
-0.011543912813067436,
-0.3417505919933319,
0.021293016150593758,
-0.04203684628009796,
-0.02249418944120407,
0.15909811854362488,
-0.144818514585495,
0.026296868920326233,
-0.27168476581573486,
0.4352302849292755,
0.2743813991546631,
-0.4686276912689209,
0.0031767338514328003,
-0.040638137608766556,
-0.24947518110275269,
0.22265881299972534,
0.24165433645248413,
-0.28357404470443726,
0.10262031853199005,
-0.1886805295944214,
0.1709785759449005,
0.2953191101551056,
-0.09699971228837967,
-0.733908474445343,
0.2503823935985565,
-0.34929561614990234,
0.22200652956962585,
0.1602785736322403,
-0.03139661252498627,
-0.2079378068447113,
0.12785851955413818,
0.013798748143017292,
0.34728479385375977,
-0.047942426055669785,
0.19997210800647736,
-0.34799623489379883,
-0.40335842967033386,
0.21267394721508026,
0.35688555240631104,
0.1704360544681549,
-0.30883052945137024,
0.1890818178653717,
-0.2482474446296692,
0.3311004638671875,
-0.20835229754447937,
0.06495591253042221,
0.09328573197126389,
0.12972895801067352,
0.06426744908094406,
0.06922156363725662,
-0.05684662610292435,
-0.5748125314712524,
0.31906577944755554,
-0.04876074939966202,
0.1274321973323822,
-0.466266393661499,
-0.1305573284626007,
-0.08573821187019348,
0.3415827751159668,
-0.2074180692434311,
-0.060552600771188736,
0.013897158205509186,
0.16769680380821228,
0.16146844625473022,
0.06513549387454987,
-0.24808764457702637,
0.0881582647562027,
-0.06934594362974167,
0.3239607512950897,
-0.337843120098114,
0.4175768494606018,
0.07334592938423157,
-0.29762962460517883,
-0.09085657447576523,
0.18601617217063904,
0.04022520035505295,
-0.11527657508850098,
-0.07770346105098724,
0.4499233663082123,
-0.2035689651966095,
0.07779551297426224,
-0.36604416370391846,
-0.13300830125808716,
0.1468675136566162,
-0.4273691177368164,
0.00870027020573616,
0.11158465594053268,
0.07072221487760544,
-0.010740093886852264,
0.16255253553390503,
0.30814260244369507,
0.19526615738868713,
0.3425676226615906,
-0.03847764432430267,
-0.12558408081531525,
0.008251264691352844,
0.005013547837734222,
0.04148346185684204,
-0.06893940269947052,
0.2926688492298126,
0.003580808639526367,
0.365398108959198,
-0.02986047975718975,
-0.3705821633338928,
-0.0996532291173935,
0.0983082503080368,
-0.13442593812942505,
0.12980234622955322,
0.18454593420028687,
-0.4766625761985779,
0.003091089427471161,
0.2593250870704651,
-0.22683146595954895,
0.29273080825805664,
0.20372305810451508,
0.03333945572376251,
0.10461358726024628,
0.08929922431707382,
-0.04461623355746269,
0.08872103691101074,
0.29944851994514465,
0.3114616274833679,
0.21697184443473816,
0.2970501482486725,
-0.04375148192048073,
-0.337129682302475,
-0.19277852773666382,
-0.03779260441660881,
0.2613287568092346,
-0.3466547131538391,
0.12324559688568115,
-0.18967950344085693,
0.1543920636177063,
-0.16777965426445007,
-0.31850987672805786,
-0.2430305778980255,
-0.06692532449960709,
-0.11821331828832626,
0.31710684299468994,
-0.029258977621793747,
0.20156854391098022,
-0.374463826417923,
0.01525677740573883,
-0.02065885066986084,
-0.3291296660900116,
-0.19192621111869812,
-0.12911611795425415,
-0.37569329142570496,
-0.018026473000645638,
0.4828004837036133,
-0.026753567159175873,
0.09510393440723419,
0.012904658913612366,
0.2541850805282593,
-0.4948851764202118,
-0.3675993084907532,
0.1382535696029663,
-0.13097511231899261,
0.23663870990276337,
0.19039353728294373,
-0.12374557554721832,
-0.088723324239254,
-0.23278164863586426,
0.251573383808136,
-0.20342595875263214,
-0.2203892171382904,
0.3732360303401947,
-0.2217811793088913,
0.17489702999591827,
0.005950301885604858,
-0.20553044974803925,
-0.2205798625946045,
-0.3202366828918457,
0.5006443858146667,
0.1682344228029251,
0.03563486039638519,
-0.03520718961954117,
0.17712000012397766,
0.4239635467529297,
-0.08990547060966492,
0.1240590363740921,
0.011604145169258118,
-0.04145336151123047,
0.29569417238235474,
-0.0018043741583824158,
-0.3811092674732208,
-0.03941774368286133,
-0.18604996800422668,
0.09346745908260345,
0.23305906355381012,
-0.7317491769790649,
-0.04618110507726669,
-0.1499202400445938,
0.3552669882774353,
-0.2692868411540985,
0.08781260997056961,
0.16590774059295654,
-0.05762092024087906,
0.009343799203634262,
0.06885471194982529,
-0.05470923334360123,
-0.11719842255115509,
-0.274093896150589,
0.14919081330299377,
-0.16350986063480377,
0.5073177218437195,
0.045611247420310974,
0.6507900357246399,
-0.03800523281097412,
-0.19504320621490479,
0.3407360315322876,
-0.07395381480455399,
0.30440011620521545,
-0.12348110973834991,
-0.1405840665102005,
0.08100640028715134,
-0.050982728600502014,
0.06725557148456573,
0.3393782377243042,
0.030979767441749573,
-0.2547607123851776,
-0.048527609556913376,
-0.26064878702163696,
-0.07214824110269547,
-0.3136461675167084,
0.1375752091407776,
0.044177163392305374,
-0.04539651423692703,
-0.08082074671983719,
0.10513646900653839,
-0.02363697811961174,
-0.30438676476478577,
0.21836665272712708,
-0.012953314930200577,
-0.07787096500396729,
-0.00526316836476326,
-0.27243655920028687,
0.08032029867172241,
-0.4225690960884094,
0.29266494512557983,
0.03706546500325203,
0.18740983307361603,
0.1402803659439087,
-0.37815943360328674,
0.27315041422843933,
-0.31683632731437683,
0.6669288873672485,
0.1357891857624054,
0.09878021478652954,
0.002649948000907898,
0.10594305396080017,
-0.6825571656227112,
-0.0860707089304924,
-0.23677407205104828,
0.1796240359544754,
0.24272245168685913,
0.4616071283817291,
-0.47518283128738403,
-0.1263779252767563,
0.42183536291122437,
0.5109720826148987,
-0.01647607982158661,
-0.21444541215896606,
-0.4147226810455322,
-0.29361677169799805,
-0.18097993731498718,
0.3568427264690399,
-0.13458570837974548,
0.3355751037597656,
-0.001903735101222992,
0.24351900815963745,
-0.24523669481277466,
-0.036125656217336655,
0.006463918834924698,
0.16075843572616577,
0.22914789617061615,
-0.11106209456920624,
0.24329383671283722,
-0.03661264479160309,
0.273629367351532,
0.32431796193122864,
0.7347321510314941,
0.15556971728801727,
-0.639854907989502,
0.12601494789123535,
0.2092236429452896,
0.34131920337677,
0.297465443611145,
-0.10469898581504822,
0.10681594908237457,
0.03954535722732544,
0.25414595007896423,
0.007581595331430435,
0.10382020473480225,
0.25522127747535706,
-0.12779617309570312,
-0.28702956438064575,
0.14220866560935974,
0.6114946603775024,
0.2211814969778061,
0.010352686047554016,
0.09588061273097992,
0.5646122694015503,
-0.1446680724620819,
0.32854825258255005,
0.007375314831733704,
0.9299673438072205,
-0.05551878362894058,
0.28534308075904846,
0.4936719238758087,
-0.19384092092514038,
0.44900059700012207,
-0.1664876490831375,
-0.004104519262909889,
-0.46999678015708923,
-0.040509045124053955,
0.12039994448423386,
-0.19708731770515442,
-0.05187355354428291,
0.057264987379312515,
0.001111932098865509,
0.2197718322277069,
-0.04329180717468262,
0.29162847995758057,
0.10900827497243881,
0.2551395297050476,
-0.08085311949253082,
-0.22903557121753693,
-0.2651006281375885,
0.03898657113313675,
-0.06067580729722977,
0.03268325701355934,
-0.12744209170341492,
-0.028781885281205177,
0.056018419563770294,
-0.27653399109840393,
-0.15491896867752075,
0.31677135825157166,
-0.5567545890808105,
0.10381045937538147,
0.2169172614812851,
-0.6862828731536865,
0.12728926539421082,
0.15535974502563477,
-0.011274877935647964,
-0.08368027210235596,
-0.15931223332881927,
0.050750862807035446,
0.036541178822517395,
-0.02046799473464489,
0.13250210881233215,
-0.04036910831928253,
0.3446243405342102,
-0.01277226209640503,
-0.15278497338294983,
0.1400664746761322,
-0.10374264419078827,
-0.13087216019630432,
0.22601518034934998,
0.18421247601509094,
0.2449198216199875,
-0.1628846824169159,
-0.06356305629014969,
-0.18040335178375244,
0.15170153975486755,
-0.16601958870887756,
0.042029257863759995,
-0.0032871831208467484,
-0.10191754251718521,
-0.06922028213739395,
0.11078964173793793,
-0.4581258296966553,
-0.184848353266716,
0.42548689246177673,
-0.037955112755298615,
-0.16256961226463318,
0.461896151304245,
0.4328024685382843,
-0.12430811673402786,
-0.1272301971912384,
-0.14232505857944489,
0.5597931146621704,
-0.7869177460670471,
-0.10802767425775528,
-0.01294776052236557,
0.198054701089859,
0.03071892261505127,
0.17622950673103333,
0.1954241842031479,
-0.2735710144042969,
-0.07331614196300507,
-0.29664790630340576,
-0.4547753930091858,
0.3515753149986267,
0.050420187413692474,
0.07819397747516632,
0.20098203420639038,
-0.045196495950222015,
-0.09635671973228455,
-0.057422637939453125,
-0.18969634175300598,
0.31628620624542236,
0.04444219172000885,
-0.006121305748820305,
-0.036266542971134186,
-0.02489023469388485,
0.34221258759498596,
0.28769102692604065,
0.08151549100875854,
0.21700595319271088,
-0.10979094356298447,
-0.15229825675487518,
-0.13887593150138855,
0.12081800401210785,
0.0575491227209568,
-0.0821995660662651,
-0.02083965390920639,
-0.07554701715707779,
0.15304318070411682,
-0.14305688440799713,
0.4690489172935486,
0.006285965442657471,
-0.07443996518850327,
-0.32494375109672546,
0.26258236169815063,
0.09110300242900848,
-0.32783547043800354,
0.18049032986164093,
-0.12492211163043976,
0.24853165447711945,
0.12308482080698013,
0.17629002034664154,
-0.09159758687019348,
-0.03171912580728531,
-0.0477607361972332,
0.032174497842788696,
0.2984188199043274,
-0.014502415433526039,
0.0898454338312149,
-0.51108318567276,
-0.388155996799469,
-0.20316696166992188,
0.26995140314102173,
0.40581634640693665,
-0.23531781136989594,
-0.13653649389743805,
0.31357064843177795,
0.16536803543567657,
-0.20174512267112732,
-0.06453581899404526,
0.2855156362056732,
-0.06766875088214874,
0.005038850009441376,
0.2889828383922577,
0.10252051055431366,
-0.0383240282535553,
-0.20823107659816742,
0.1996997892856598,
0.20008011162281036,
0.19817706942558289,
-0.16139787435531616,
0.4024536907672882,
-0.2167302668094635,
-0.09836743772029877,
0.4893497824668884,
0.12983965873718262,
0.38112199306488037,
0.17504914104938507,
-0.33008909225463867,
0.5429539084434509,
-0.17624559998512268,
0.02013286016881466,
0.13309089839458466,
-0.5279762744903564,
-0.11576485633850098,
0.18548178672790527,
0.2053680717945099,
-0.1344650685787201,
-0.04493138566613197,
0.7136262655258179,
0.22087937593460083,
-0.13739676773548126,
-0.3261715769767761,
0.031940799206495285,
-0.24106374382972717,
-0.13509805500507355,
0.012427069246768951,
-0.23201507329940796,
-0.05929291993379593,
0.2354181855916977,
-0.31489238142967224,
-0.2169000804424286,
0.31703516840934753,
0.13821786642074585,
-0.06894408911466599,
-0.3522759675979614,
-0.03426385298371315,
0.377806156873703,
-0.038938138633966446,
-0.23826153576374054,
0.37912535667419434,
0.13838985562324524,
-0.10565653443336487,
-0.0652056485414505,
0.08672424405813217,
0.5123559832572937,
0.26347485184669495,
-0.18122322857379913,
-0.2771204710006714,
-0.04592062532901764,
0.1390828788280487,
-0.15611723065376282,
0.23886319994926453,
0.0834750235080719,
0.25681114196777344,
0.4055262506008148,
0.042542144656181335,
-0.1860365867614746,
0.05434276908636093,
0.09167542308568954,
0.14539049565792084,
-0.32992416620254517,
0.009934578090906143,
-0.23064455389976501,
-0.35697290301322937,
-0.19508405029773712,
-0.06443323194980621,
-0.23884937167167664,
0.03927985951304436,
0.20048655569553375,
0.08693599700927734,
-0.07096482813358307,
-0.16522842645645142,
0.030464861541986465,
-0.04876019060611725,
0.4619767963886261,
0.502947986125946,
0.233500137925148,
-0.21512043476104736,
-0.183317169547081,
-0.7048707604408264,
0.5702226758003235,
-0.3560499846935272,
0.1203530952334404,
0.11824235320091248,
0.21639341115951538,
-0.07751302421092987,
0.3233075439929962,
0.07571964710950851,
0.24460405111312866,
-0.024765022099018097,
0.11944705247879028,
-0.3689011037349701,
-0.11812643706798553,
0.17064723372459412,
-0.0653526782989502,
-0.052955303341150284,
-0.3262892961502075,
0.0037504946812987328,
-0.28102099895477295,
-0.01984010636806488,
-0.10526096075773239,
-0.1328636258840561,
-0.17617058753967285,
-0.04516725242137909,
0.780179500579834,
-0.03779234737157822,
0.37633997201919556,
0.16635343432426453,
-0.22418349981307983,
-0.5434808731079102,
-0.18885588645935059,
-0.06837798655033112,
0.30406883358955383,
-0.11931437253952026,
0.24166284501552582,
-0.03336481377482414,
0.005914379842579365,
-0.20149505138397217,
0.012590397149324417,
0.010974496603012085,
0.04179717227816582,
-0.00400146096944809,
0.1358031928539276,
-0.08068904280662537,
0.2378305196762085,
-0.09566394239664078,
0.14701491594314575,
0.07126200944185257,
0.08328906446695328,
-0.22682449221611023,
-0.4992572069168091,
0.5370686054229736,
-0.7204736471176147,
-0.19175641238689423,
-0.02936163917183876,
0.32382646203041077,
0.2061128467321396,
-0.3609212636947632,
-0.6046025156974792,
0.27889537811279297,
0.22243589162826538,
0.09066900610923767,
-0.3003145754337311,
-0.0028796494007110596,
-0.2511594295501709,
0.041661567986011505,
-0.20269331336021423,
0.32523757219314575,
-0.021042410284280777,
-0.2448698878288269,
0.029283195734024048,
-0.30332833528518677
] |
https://github.com/huggingface/datasets/issues/5695 | Leaving this other error here for the record, which occurs when I load the +700GB dataset from the hub with shard sizes of 500MB:
```
Traceback (most recent call last):
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1860, in _prepare_split_single
for _, table in generator:
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 69, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1323, in iter_batches
File "pyarrow/error.pxi", line 115, in pyarrow.lib.check_status
OSError: Corrupt snappy compressed data.
```
I will probably switch back to the local big dataset or shrink it. | Loading big dataset raises pyarrow.lib.ArrowNotImplementedError | ### Describe the bug
Calling `datasets.load_dataset` to load the (publicly available) dataset `theodor1289/wit` fails with `pyarrow.lib.ArrowNotImplementedError`.
### Steps to reproduce the bug
Steps to reproduce this behavior:
1. `!pip install datasets`
2. `!huggingface-cli login`
3. This step will throw the error (it might take a while as the dataset has ~170GB):
```python
from datasets import load_dataset
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
```
Stack trace:
```
(torch-multimodal) bash-4.2$ python test.py
Downloading and preparing dataset None/None to /cluster/work/cotterell/tamariucai/HuggingfaceDatasets/theodor1289___parquet/theodor1289--wit-7a3e984414a86a0f/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec...
Downloading data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 491.68it/s]
Extracting data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 16.93it/s]
Traceback (most recent call last):
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1860, in _prepare_split_single
for _, table in generator:
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 69, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1323, in iter_batches
File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/cluster/work/cotterell/tamariucai/multimodal-mirror/examples/test.py", line 2, in <module>
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 986, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1748, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1893, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
The dataset is loaded in variable `dataset`.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.10.4
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
| 83 | Loading big dataset raises pyarrow.lib.ArrowNotImplementedError
### Describe the bug
Calling `datasets.load_dataset` to load the (publicly available) dataset `theodor1289/wit` fails with `pyarrow.lib.ArrowNotImplementedError`.
### Steps to reproduce the bug
Steps to reproduce this behavior:
1. `!pip install datasets`
2. `!huggingface-cli login`
3. This step will throw the error (it might take a while as the dataset has ~170GB):
```python
from datasets import load_dataset
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
```
Stack trace:
```
(torch-multimodal) bash-4.2$ python test.py
Downloading and preparing dataset None/None to /cluster/work/cotterell/tamariucai/HuggingfaceDatasets/theodor1289___parquet/theodor1289--wit-7a3e984414a86a0f/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec...
Downloading data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 491.68it/s]
Extracting data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 16.93it/s]
Traceback (most recent call last):
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1860, in _prepare_split_single
for _, table in generator:
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 69, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1323, in iter_batches
File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/cluster/work/cotterell/tamariucai/multimodal-mirror/examples/test.py", line 2, in <module>
dataset = load_dataset("theodor1289/wit", "train", use_auth_token=True)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset
builder_instance.download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare
self._download_and_prepare(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 986, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1748, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1893, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.builder.DatasetGenerationError: An error occurred while generating the dataset
```
### Expected behavior
The dataset is loaded in variable `dataset`.
### Environment info
- `datasets` version: 2.11.0
- Platform: Linux-3.10.0-1160.80.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.10.4
- Huggingface_hub version: 0.13.3
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
Leaving this other error here for the record, which occurs when I load the +700GB dataset from the hub with shard sizes of 500MB:
```
Traceback (most recent call last):
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/builder.py", line 1860, in _prepare_split_single
for _, table in generator:
File "/cluster/home/tamariucai/.local/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 69, in _generate_tables
for batch_idx, record_batch in enumerate(
File "pyarrow/_parquet.pyx", line 1323, in iter_batches
File "pyarrow/error.pxi", line 115, in pyarrow.lib.check_status
OSError: Corrupt snappy compressed data.
```
I will probably switch back to the local big dataset or shrink it. | [
-0.36002859473228455,
0.04276201128959656,
0.11041624844074249,
0.5041696429252625,
0.22531577944755554,
-0.20803719758987427,
0.2163711041212082,
0.19029837846755981,
-0.20871645212173462,
0.20421102643013,
-0.09125034511089325,
0.6012040376663208,
-0.11784866452217102,
-0.12901639938354492,
0.1307569146156311,
-0.13230448961257935,
0.06511824578046799,
0.08160844445228577,
-0.08167270570993423,
0.08421698212623596,
-0.10585974156856537,
0.15787310898303986,
-0.2615298330783844,
0.2127004861831665,
-0.18483684957027435,
0.059403203427791595,
0.0026949718594551086,
0.28332793712615967,
-0.11843465268611908,
-0.4641624689102173,
0.2070017158985138,
-0.2581101357936859,
0.16843949258327484,
0.5688139796257019,
-0.00012222885561641306,
0.09924210608005524,
0.3478609621524811,
0.20523172616958618,
-0.31461673974990845,
-0.20816031098365784,
0.17828579246997833,
-0.4556504487991333,
0.41995272040367126,
-0.1822991669178009,
0.05111069977283478,
-0.3134867250919342,
-0.08043865859508514,
0.17829495668411255,
0.2496967315673828,
0.2228722721338272,
0.1525610238313675,
0.5205861330032349,
0.24243271350860596,
0.07011547684669495,
0.5378828048706055,
-0.04438558220863342,
-0.06587961316108704,
0.22352537512779236,
0.2466321885585785,
-0.050944291055202484,
-0.34741440415382385,
0.1250907927751541,
0.01693015545606613,
0.13802210986614227,
0.2163514345884323,
0.06658972799777985,
-0.15904712677001953,
-0.15371432900428772,
0.16561108827590942,
0.29331332445144653,
0.3562414050102234,
-0.4237765371799469,
-0.26516449451446533,
-0.22031861543655396,
0.14786702394485474,
-0.2502976059913635,
0.3048233389854431,
0.3439120650291443,
-0.17914503812789917,
0.028171397745609283,
-0.08233620226383209,
0.008384522050619125,
-0.24206697940826416,
0.12496933341026306,
-0.1453215777873993,
0.2276231199502945,
-0.052333757281303406,
0.14973284304141998,
0.31022366881370544,
-0.15541283786296844,
-0.09776751697063446,
-0.03898927569389343,
-0.11066991835832596,
0.09602604806423187,
-0.49186575412750244,
0.14296302199363708,
-0.04495853930711746,
0.3768194913864136,
0.39765602350234985,
0.35244160890579224,
0.04032406210899353,
0.06492580473423004,
0.2068379819393158,
0.054900508373975754,
0.10590901970863342,
0.05773165449500084,
-0.512406051158905,
-0.0962192714214325,
0.24184538424015045,
0.21204835176467896,
0.07193882763385773,
0.07774411141872406,
-0.11517906188964844,
-0.3209916651248932,
0.10601556301116943,
-0.23691561818122864,
0.4037882387638092,
-0.2381032407283783,
-0.3806278109550476,
0.2215002328157425,
-0.26838576793670654,
0.022125165909528732,
0.054306935518980026,
0.40491873025894165,
-0.2659057080745697,
0.14024797081947327,
-0.04544156789779663,
0.222760409116745,
-0.2143045961856842,
-0.25664016604423523,
-0.2147689014673233,
-0.05940750986337662,
-0.16690292954444885,
0.05292504280805588,
0.22134211659431458,
-0.15889036655426025,
0.11727882921695709,
0.0531352162361145,
0.167011559009552,
-0.13221552968025208,
-0.02609695866703987,
-0.08986175060272217,
-0.0825924351811409,
0.29657965898513794,
-0.19052353501319885,
0.08670100569725037,
0.05251377448439598,
0.06295355409383774,
-0.12377698719501495,
0.20981763303279877,
-0.19945064187049866,
-0.38803520798683167,
-0.31857043504714966,
0.09420591592788696,
-0.3295561373233795,
-0.011543912813067436,
-0.3417505919933319,
0.021293016150593758,
-0.04203684628009796,
-0.02249418944120407,
0.15909811854362488,
-0.144818514585495,
0.026296868920326233,
-0.27168476581573486,
0.4352302849292755,
0.2743813991546631,
-0.4686276912689209,
0.0031767338514328003,
-0.040638137608766556,
-0.24947518110275269,
0.22265881299972534,
0.24165433645248413,
-0.28357404470443726,
0.10262031853199005,
-0.1886805295944214,
0.1709785759449005,
0.2953191101551056,
-0.09699971228837967,
-0.733908474445343,
0.2503823935985565,
-0.34929561614990234,
0.22200652956962585,
0.1602785736322403,
-0.03139661252498627,
-0.2079378068447113,
0.12785851955413818,
0.013798748143017292,
0.34728479385375977,
-0.047942426055669785,
0.19997210800647736,
-0.34799623489379883,
-0.40335842967033386,
0.21267394721508026,
0.35688555240631104,
0.1704360544681549,
-0.30883052945137024,
0.1890818178653717,
-0.2482474446296692,
0.3311004638671875,
-0.20835229754447937,
0.06495591253042221,
0.09328573197126389,
0.12972895801067352,
0.06426744908094406,
0.06922156363725662,
-0.05684662610292435,
-0.5748125314712524,
0.31906577944755554,
-0.04876074939966202,
0.1274321973323822,
-0.466266393661499,
-0.1305573284626007,
-0.08573821187019348,
0.3415827751159668,
-0.2074180692434311,
-0.060552600771188736,
0.013897158205509186,
0.16769680380821228,
0.16146844625473022,
0.06513549387454987,
-0.24808764457702637,
0.0881582647562027,
-0.06934594362974167,
0.3239607512950897,
-0.337843120098114,
0.4175768494606018,
0.07334592938423157,
-0.29762962460517883,
-0.09085657447576523,
0.18601617217063904,
0.04022520035505295,
-0.11527657508850098,
-0.07770346105098724,
0.4499233663082123,
-0.2035689651966095,
0.07779551297426224,
-0.36604416370391846,
-0.13300830125808716,
0.1468675136566162,
-0.4273691177368164,
0.00870027020573616,
0.11158465594053268,
0.07072221487760544,
-0.010740093886852264,
0.16255253553390503,
0.30814260244369507,
0.19526615738868713,
0.3425676226615906,
-0.03847764432430267,
-0.12558408081531525,
0.008251264691352844,
0.005013547837734222,
0.04148346185684204,
-0.06893940269947052,
0.2926688492298126,
0.003580808639526367,
0.365398108959198,
-0.02986047975718975,
-0.3705821633338928,
-0.0996532291173935,
0.0983082503080368,
-0.13442593812942505,
0.12980234622955322,
0.18454593420028687,
-0.4766625761985779,
0.003091089427471161,
0.2593250870704651,
-0.22683146595954895,
0.29273080825805664,
0.20372305810451508,
0.03333945572376251,
0.10461358726024628,
0.08929922431707382,
-0.04461623355746269,
0.08872103691101074,
0.29944851994514465,
0.3114616274833679,
0.21697184443473816,
0.2970501482486725,
-0.04375148192048073,
-0.337129682302475,
-0.19277852773666382,
-0.03779260441660881,
0.2613287568092346,
-0.3466547131538391,
0.12324559688568115,
-0.18967950344085693,
0.1543920636177063,
-0.16777965426445007,
-0.31850987672805786,
-0.2430305778980255,
-0.06692532449960709,
-0.11821331828832626,
0.31710684299468994,
-0.029258977621793747,
0.20156854391098022,
-0.374463826417923,
0.01525677740573883,
-0.02065885066986084,
-0.3291296660900116,
-0.19192621111869812,
-0.12911611795425415,
-0.37569329142570496,
-0.018026473000645638,
0.4828004837036133,
-0.026753567159175873,
0.09510393440723419,
0.012904658913612366,
0.2541850805282593,
-0.4948851764202118,
-0.3675993084907532,
0.1382535696029663,
-0.13097511231899261,
0.23663870990276337,
0.19039353728294373,
-0.12374557554721832,
-0.088723324239254,
-0.23278164863586426,
0.251573383808136,
-0.20342595875263214,
-0.2203892171382904,
0.3732360303401947,
-0.2217811793088913,
0.17489702999591827,
0.005950301885604858,
-0.20553044974803925,
-0.2205798625946045,
-0.3202366828918457,
0.5006443858146667,
0.1682344228029251,
0.03563486039638519,
-0.03520718961954117,
0.17712000012397766,
0.4239635467529297,
-0.08990547060966492,
0.1240590363740921,
0.011604145169258118,
-0.04145336151123047,
0.29569417238235474,
-0.0018043741583824158,
-0.3811092674732208,
-0.03941774368286133,
-0.18604996800422668,
0.09346745908260345,
0.23305906355381012,
-0.7317491769790649,
-0.04618110507726669,
-0.1499202400445938,
0.3552669882774353,
-0.2692868411540985,
0.08781260997056961,
0.16590774059295654,
-0.05762092024087906,
0.009343799203634262,
0.06885471194982529,
-0.05470923334360123,
-0.11719842255115509,
-0.274093896150589,
0.14919081330299377,
-0.16350986063480377,
0.5073177218437195,
0.045611247420310974,
0.6507900357246399,
-0.03800523281097412,
-0.19504320621490479,
0.3407360315322876,
-0.07395381480455399,
0.30440011620521545,
-0.12348110973834991,
-0.1405840665102005,
0.08100640028715134,
-0.050982728600502014,
0.06725557148456573,
0.3393782377243042,
0.030979767441749573,
-0.2547607123851776,
-0.048527609556913376,
-0.26064878702163696,
-0.07214824110269547,
-0.3136461675167084,
0.1375752091407776,
0.044177163392305374,
-0.04539651423692703,
-0.08082074671983719,
0.10513646900653839,
-0.02363697811961174,
-0.30438676476478577,
0.21836665272712708,
-0.012953314930200577,
-0.07787096500396729,
-0.00526316836476326,
-0.27243655920028687,
0.08032029867172241,
-0.4225690960884094,
0.29266494512557983,
0.03706546500325203,
0.18740983307361603,
0.1402803659439087,
-0.37815943360328674,
0.27315041422843933,
-0.31683632731437683,
0.6669288873672485,
0.1357891857624054,
0.09878021478652954,
0.002649948000907898,
0.10594305396080017,
-0.6825571656227112,
-0.0860707089304924,
-0.23677407205104828,
0.1796240359544754,
0.24272245168685913,
0.4616071283817291,
-0.47518283128738403,
-0.1263779252767563,
0.42183536291122437,
0.5109720826148987,
-0.01647607982158661,
-0.21444541215896606,
-0.4147226810455322,
-0.29361677169799805,
-0.18097993731498718,
0.3568427264690399,
-0.13458570837974548,
0.3355751037597656,
-0.001903735101222992,
0.24351900815963745,
-0.24523669481277466,
-0.036125656217336655,
0.006463918834924698,
0.16075843572616577,
0.22914789617061615,
-0.11106209456920624,
0.24329383671283722,
-0.03661264479160309,
0.273629367351532,
0.32431796193122864,
0.7347321510314941,
0.15556971728801727,
-0.639854907989502,
0.12601494789123535,
0.2092236429452896,
0.34131920337677,
0.297465443611145,
-0.10469898581504822,
0.10681594908237457,
0.03954535722732544,
0.25414595007896423,
0.007581595331430435,
0.10382020473480225,
0.25522127747535706,
-0.12779617309570312,
-0.28702956438064575,
0.14220866560935974,
0.6114946603775024,
0.2211814969778061,
0.010352686047554016,
0.09588061273097992,
0.5646122694015503,
-0.1446680724620819,
0.32854825258255005,
0.007375314831733704,
0.9299673438072205,
-0.05551878362894058,
0.28534308075904846,
0.4936719238758087,
-0.19384092092514038,
0.44900059700012207,
-0.1664876490831375,
-0.004104519262909889,
-0.46999678015708923,
-0.040509045124053955,
0.12039994448423386,
-0.19708731770515442,
-0.05187355354428291,
0.057264987379312515,
0.001111932098865509,
0.2197718322277069,
-0.04329180717468262,
0.29162847995758057,
0.10900827497243881,
0.2551395297050476,
-0.08085311949253082,
-0.22903557121753693,
-0.2651006281375885,
0.03898657113313675,
-0.06067580729722977,
0.03268325701355934,
-0.12744209170341492,
-0.028781885281205177,
0.056018419563770294,
-0.27653399109840393,
-0.15491896867752075,
0.31677135825157166,
-0.5567545890808105,
0.10381045937538147,
0.2169172614812851,
-0.6862828731536865,
0.12728926539421082,
0.15535974502563477,
-0.011274877935647964,
-0.08368027210235596,
-0.15931223332881927,
0.050750862807035446,
0.036541178822517395,
-0.02046799473464489,
0.13250210881233215,
-0.04036910831928253,
0.3446243405342102,
-0.01277226209640503,
-0.15278497338294983,
0.1400664746761322,
-0.10374264419078827,
-0.13087216019630432,
0.22601518034934998,
0.18421247601509094,
0.2449198216199875,
-0.1628846824169159,
-0.06356305629014969,
-0.18040335178375244,
0.15170153975486755,
-0.16601958870887756,
0.042029257863759995,
-0.0032871831208467484,
-0.10191754251718521,
-0.06922028213739395,
0.11078964173793793,
-0.4581258296966553,
-0.184848353266716,
0.42548689246177673,
-0.037955112755298615,
-0.16256961226463318,
0.461896151304245,
0.4328024685382843,
-0.12430811673402786,
-0.1272301971912384,
-0.14232505857944489,
0.5597931146621704,
-0.7869177460670471,
-0.10802767425775528,
-0.01294776052236557,
0.198054701089859,
0.03071892261505127,
0.17622950673103333,
0.1954241842031479,
-0.2735710144042969,
-0.07331614196300507,
-0.29664790630340576,
-0.4547753930091858,
0.3515753149986267,
0.050420187413692474,
0.07819397747516632,
0.20098203420639038,
-0.045196495950222015,
-0.09635671973228455,
-0.057422637939453125,
-0.18969634175300598,
0.31628620624542236,
0.04444219172000885,
-0.006121305748820305,
-0.036266542971134186,
-0.02489023469388485,
0.34221258759498596,
0.28769102692604065,
0.08151549100875854,
0.21700595319271088,
-0.10979094356298447,
-0.15229825675487518,
-0.13887593150138855,
0.12081800401210785,
0.0575491227209568,
-0.0821995660662651,
-0.02083965390920639,
-0.07554701715707779,
0.15304318070411682,
-0.14305688440799713,
0.4690489172935486,
0.006285965442657471,
-0.07443996518850327,
-0.32494375109672546,
0.26258236169815063,
0.09110300242900848,
-0.32783547043800354,
0.18049032986164093,
-0.12492211163043976,
0.24853165447711945,
0.12308482080698013,
0.17629002034664154,
-0.09159758687019348,
-0.03171912580728531,
-0.0477607361972332,
0.032174497842788696,
0.2984188199043274,
-0.014502415433526039,
0.0898454338312149,
-0.51108318567276,
-0.388155996799469,
-0.20316696166992188,
0.26995140314102173,
0.40581634640693665,
-0.23531781136989594,
-0.13653649389743805,
0.31357064843177795,
0.16536803543567657,
-0.20174512267112732,
-0.06453581899404526,
0.2855156362056732,
-0.06766875088214874,
0.005038850009441376,
0.2889828383922577,
0.10252051055431366,
-0.0383240282535553,
-0.20823107659816742,
0.1996997892856598,
0.20008011162281036,
0.19817706942558289,
-0.16139787435531616,
0.4024536907672882,
-0.2167302668094635,
-0.09836743772029877,
0.4893497824668884,
0.12983965873718262,
0.38112199306488037,
0.17504914104938507,
-0.33008909225463867,
0.5429539084434509,
-0.17624559998512268,
0.02013286016881466,
0.13309089839458466,
-0.5279762744903564,
-0.11576485633850098,
0.18548178672790527,
0.2053680717945099,
-0.1344650685787201,
-0.04493138566613197,
0.7136262655258179,
0.22087937593460083,
-0.13739676773548126,
-0.3261715769767761,
0.031940799206495285,
-0.24106374382972717,
-0.13509805500507355,
0.012427069246768951,
-0.23201507329940796,
-0.05929291993379593,
0.2354181855916977,
-0.31489238142967224,
-0.2169000804424286,
0.31703516840934753,
0.13821786642074585,
-0.06894408911466599,
-0.3522759675979614,
-0.03426385298371315,
0.377806156873703,
-0.038938138633966446,
-0.23826153576374054,
0.37912535667419434,
0.13838985562324524,
-0.10565653443336487,
-0.0652056485414505,
0.08672424405813217,
0.5123559832572937,
0.26347485184669495,
-0.18122322857379913,
-0.2771204710006714,
-0.04592062532901764,
0.1390828788280487,
-0.15611723065376282,
0.23886319994926453,
0.0834750235080719,
0.25681114196777344,
0.4055262506008148,
0.042542144656181335,
-0.1860365867614746,
0.05434276908636093,
0.09167542308568954,
0.14539049565792084,
-0.32992416620254517,
0.009934578090906143,
-0.23064455389976501,
-0.35697290301322937,
-0.19508405029773712,
-0.06443323194980621,
-0.23884937167167664,
0.03927985951304436,
0.20048655569553375,
0.08693599700927734,
-0.07096482813358307,
-0.16522842645645142,
0.030464861541986465,
-0.04876019060611725,
0.4619767963886261,
0.502947986125946,
0.233500137925148,
-0.21512043476104736,
-0.183317169547081,
-0.7048707604408264,
0.5702226758003235,
-0.3560499846935272,
0.1203530952334404,
0.11824235320091248,
0.21639341115951538,
-0.07751302421092987,
0.3233075439929962,
0.07571964710950851,
0.24460405111312866,
-0.024765022099018097,
0.11944705247879028,
-0.3689011037349701,
-0.11812643706798553,
0.17064723372459412,
-0.0653526782989502,
-0.052955303341150284,
-0.3262892961502075,
0.0037504946812987328,
-0.28102099895477295,
-0.01984010636806488,
-0.10526096075773239,
-0.1328636258840561,
-0.17617058753967285,
-0.04516725242137909,
0.780179500579834,
-0.03779234737157822,
0.37633997201919556,
0.16635343432426453,
-0.22418349981307983,
-0.5434808731079102,
-0.18885588645935059,
-0.06837798655033112,
0.30406883358955383,
-0.11931437253952026,
0.24166284501552582,
-0.03336481377482414,
0.005914379842579365,
-0.20149505138397217,
0.012590397149324417,
0.010974496603012085,
0.04179717227816582,
-0.00400146096944809,
0.1358031928539276,
-0.08068904280662537,
0.2378305196762085,
-0.09566394239664078,
0.14701491594314575,
0.07126200944185257,
0.08328906446695328,
-0.22682449221611023,
-0.4992572069168091,
0.5370686054229736,
-0.7204736471176147,
-0.19175641238689423,
-0.02936163917183876,
0.32382646203041077,
0.2061128467321396,
-0.3609212636947632,
-0.6046025156974792,
0.27889537811279297,
0.22243589162826538,
0.09066900610923767,
-0.3003145754337311,
-0.0028796494007110596,
-0.2511594295501709,
0.041661567986011505,
-0.20269331336021423,
0.32523757219314575,
-0.021042410284280777,
-0.2448698878288269,
0.029283195734024048,
-0.30332833528518677
] |
https://github.com/huggingface/datasets/issues/5694 | Originally we also though about adding it to the YAML part of the README.md:
```yaml
builder_config:
data_dir: data
data_files:
- split: train
pattern: "train-[0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*"
```
Having it in the README.md could make it easier to modify it in the UI on HF, and for validation on commit | Dataset configuration | Following discussions from https://github.com/huggingface/datasets/pull/5331
We could have something like `config.json` to define the configuration of a dataset.
```json
{
"data_dir": "data"
"data_files": {
"train": "train-[0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*"
}
}
```
we could also support a list for several configs with a 'config_name' field.
The alternative was to use YAML in the README.md.
I think it could also support a `dataset_type` field to specify which dataset builder class to use, and the other parameters would be the builder's parameters. Some parameters exist for all builders like `data_files` and `data_dir`, but some parameters are builder specific like `sep` for csv.
This format would be used in `push_to_hub` to be able to push multiple configs.
cc @huggingface/datasets
EDIT: actually we're going for the YAML approach in README.md | 47 | Dataset configuration
Following discussions from https://github.com/huggingface/datasets/pull/5331
We could have something like `config.json` to define the configuration of a dataset.
```json
{
"data_dir": "data"
"data_files": {
"train": "train-[0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*"
}
}
```
we could also support a list for several configs with a 'config_name' field.
The alternative was to use YAML in the README.md.
I think it could also support a `dataset_type` field to specify which dataset builder class to use, and the other parameters would be the builder's parameters. Some parameters exist for all builders like `data_files` and `data_dir`, but some parameters are builder specific like `sep` for csv.
This format would be used in `push_to_hub` to be able to push multiple configs.
cc @huggingface/datasets
EDIT: actually we're going for the YAML approach in README.md
Originally we also though about adding it to the YAML part of the README.md:
```yaml
builder_config:
data_dir: data
data_files:
- split: train
pattern: "train-[0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*"
```
Having it in the README.md could make it easier to modify it in the UI on HF, and for validation on commit | [
-0.38154855370521545,
-0.206382155418396,
-0.05068372189998627,
0.06326279789209366,
0.23064163327217102,
0.11939957737922668,
0.3019181787967682,
0.30645936727523804,
0.1979321539402008,
0.18720629811286926,
-0.05301390215754509,
0.19325807690620422,
-0.11306318640708923,
0.4448152780532837,
0.2653408944606781,
0.17170052230358124,
0.04323733597993851,
0.09078815579414368,
-0.11359676718711853,
0.060589879751205444,
0.03556648641824722,
-0.02619832009077072,
0.24195192754268646,
-0.03997892513871193,
-0.26805487275123596,
-0.025103367865085602,
-0.20514723658561707,
0.06149465590715408,
-0.2255401462316513,
-0.43046823143959045,
0.26827123761177063,
0.5350909233093262,
-0.16379356384277344,
0.22276611626148224,
-0.00009974339627660811,
0.19596821069717407,
0.013536626473069191,
-0.1645653247833252,
-0.40607768297195435,
-0.049170538783073425,
-0.2753137946128845,
-0.24665582180023193,
0.030895717442035675,
-0.1953219324350357,
-0.12200815975666046,
-0.08237327635288239,
0.168264701962471,
0.015934355556964874,
0.3526352047920227,
0.014323558658361435,
0.25474029779434204,
0.08132217824459076,
-0.02276911586523056,
-0.07920936495065689,
0.11785586923360825,
0.5046536326408386,
-0.3092263340950012,
-0.027889076620340347,
0.1907913088798523,
0.16020533442497253,
-0.2100699543952942,
0.033674754202365875,
0.1033259853720665,
0.08433153480291367,
0.5516454577445984,
0.09112684428691864,
0.038647353649139404,
-0.08867059648036957,
-0.10246722400188446,
0.45232775807380676,
0.48340123891830444,
-0.5331390500068665,
-0.3705885708332062,
-0.4469437301158905,
0.0010214075446128845,
-0.10617486387491226,
0.058350518345832825,
0.2625010013580322,
-0.14926177263259888,
0.2337637096643448,
-0.24073553085327148,
-0.3295765221118927,
-0.20778165757656097,
0.035106074064970016,
-0.03368014097213745,
0.2807747721672058,
-0.023495249450206757,
-0.07843907922506332,
0.016752783209085464,
-0.0477767288684845,
0.08934397995471954,
-0.37417253851890564,
-0.13894791901111603,
-0.0030749626457691193,
-0.1158287525177002,
-0.30374640226364136,
0.020437242463231087,
-0.07994559407234192,
0.4977338910102844,
0.04435409605503082,
0.07990626990795135,
0.3406895697116852,
-0.0822671577334404,
0.15837422013282776,
0.3588450849056244,
0.11985179036855698,
0.24474096298217773,
-0.04349593073129654,
0.25552383065223694,
0.06681700795888901,
0.10392966866493225,
-0.05155957117676735,
0.00783088430762291,
-0.05147751793265343,
-0.036241546273231506,
-0.10441099852323532,
-0.04667435586452484,
0.08306721597909927,
0.03826092928647995,
-0.18591099977493286,
0.17013703286647797,
-0.07434553653001785,
0.16141724586486816,
0.4060514271259308,
-0.06844441592693329,
-0.07642634212970734,
-0.1871810257434845,
0.14918994903564453,
0.03886907547712326,
0.17124028503894806,
-0.2102360725402832,
-0.02265986241400242,
-0.10216990858316422,
0.25241735577583313,
0.15588127076625824,
-0.23749765753746033,
0.2792379856109619,
0.20635458827018738,
0.2369145005941391,
-0.06384453922510147,
0.11164625734090805,
0.22404679656028748,
0.047427788376808167,
0.21868401765823364,
-0.02069634199142456,
-0.010646261274814606,
-0.07952985167503357,
-0.14613671600818634,
-0.5780366659164429,
-0.19477523863315582,
-0.4295845031738281,
-0.40367189049720764,
0.00043505430221557617,
0.25251081585884094,
-0.16662220656871796,
0.051875337958335876,
-0.29026004672050476,
0.44631925225257874,
-0.08299456536769867,
0.15377259254455566,
-0.04566963389515877,
0.1485207974910736,
-0.015145912766456604,
-0.272673636674881,
0.21219304203987122,
0.229471355676651,
-0.1701027899980545,
-0.22628310322761536,
0.2356206178665161,
-0.16463153064250946,
-0.35184431076049805,
-0.1012151688337326,
-0.4468396008014679,
0.10515795648097992,
-0.09443731606006622,
0.3160248398780823,
0.38222452998161316,
-0.3799019753932953,
-0.06739811599254608,
0.08717258274555206,
0.18847355246543884,
-0.08751006424427032,
0.17421023547649384,
0.040568381547927856,
0.2664588391780853,
-0.11214105784893036,
0.11974506080150604,
0.23061122000217438,
-0.14178889989852905,
0.21198582649230957,
0.018484845757484436,
-0.41041886806488037,
-0.41066989302635193,
0.16566124558448792,
0.04185029864311218,
-0.1970299929380417,
0.14464281499385834,
0.05276736617088318,
0.3185121417045593,
-0.28939375281333923,
0.1942029893398285,
0.20866768062114716,
0.30932730436325073,
0.040908508002758026,
-0.09661133587360382,
-0.1620320975780487,
-0.5731391310691833,
0.25106701254844666,
0.12046609818935394,
0.09412574768066406,
0.1663040816783905,
-0.3864475190639496,
-0.017214559018611908,
-0.008796729147434235,
-0.30575400590896606,
-0.1408286988735199,
0.2599462568759918,
0.0783844143152237,
-0.26778358221054077,
-0.2770604193210602,
-0.40684443712234497,
0.3159409165382385,
-0.010664649307727814,
0.19728200137615204,
-0.25392478704452515,
0.34227195382118225,
-0.07813619077205658,
0.028089091181755066,
0.08125483989715576,
0.10246752202510834,
-0.12675757706165314,
-0.2189110368490219,
0.23695506155490875,
0.3482133746147156,
0.12029653787612915,
0.039357736706733704,
0.21726888418197632,
0.5251007080078125,
0.41019806265830994,
0.19656026363372803,
0.1779213696718216,
-0.21890762448310852,
-0.26757681369781494,
-0.07555504888296127,
-0.46370017528533936,
0.6126898527145386,
0.01974896714091301,
0.1189936101436615,
0.060301877558231354,
-0.036485012620687485,
0.21219655871391296,
-0.004486978054046631,
-0.21690714359283447,
-0.23216435313224792,
-0.2608926296234131,
-0.056928906589746475,
0.09517809748649597,
0.05659838765859604,
-0.294106125831604,
0.2749082148075104,
0.5707007646560669,
0.17847760021686554,
0.04875742644071579,
0.11613479256629944,
-0.21441712975502014,
0.010173968970775604,
0.09977970272302628,
0.21696588397026062,
0.13350608944892883,
0.3103986084461212,
-0.05888110771775246,
0.11318209767341614,
-0.22313456237316132,
-0.06642181426286697,
0.19424843788146973,
-0.09022179991006851,
0.2118954211473465,
0.1903192698955536,
-0.04454105347394943,
-0.17081524431705475,
-0.28579723834991455,
-0.22823919355869293,
-0.020651359111070633,
-0.04860477149486542,
-0.2733444571495056,
-0.010771255940198898,
-0.251905620098114,
0.14508041739463806,
-0.1750580072402954,
-0.10172271728515625,
-0.38644105195999146,
-0.3202946186065674,
0.32270780205726624,
0.04535193741321564,
-0.21368953585624695,
0.24530161917209625,
-0.037206169217824936,
0.2560439109802246,
-0.1534545123577118,
-0.1663907766342163,
-0.09766199439764023,
-0.1444803923368454,
0.04256334900856018,
0.1179446130990982,
0.15629486739635468,
0.0819992795586586,
0.2953457832336426,
0.034499794244766235,
-0.03561260551214218,
-0.29658398032188416,
-0.3336336612701416,
0.3874436616897583,
-0.10442313551902771,
0.4674656093120575,
0.3409026265144348,
0.2613511085510254,
0.08954454958438873,
-0.26037925481796265,
0.29927027225494385,
0.2863446772098541,
-0.24387238919734955,
-0.09421227127313614,
0.006539702415466309,
-0.13498228788375854,
-0.19812634587287903,
-0.1600164771080017,
-0.05278833955526352,
-0.4934639036655426,
0.23694643378257751,
0.09777122735977173,
0.27689093351364136,
0.3210480511188507,
0.19481530785560608,
-0.1466575413942337,
-0.21912722289562225,
0.03388591855764389,
-0.25587043166160583,
-0.42773890495300293,
0.3147696852684021,
-0.39450621604919434,
-0.02440606988966465,
-0.018434152007102966,
0.019604742527008057,
0.17990027368068695,
0.08255761861801147,
-0.29364287853240967,
-0.257965087890625,
-0.06210710108280182,
0.29149580001831055,
0.22512221336364746,
0.05781400203704834,
0.29725873470306396,
0.23793601989746094,
-0.1305014193058014,
-0.10214656591415405,
-0.25421398878097534,
0.23443739116191864,
0.20135414600372314,
0.10857352614402771,
0.02577461674809456,
0.024965431541204453,
-0.04718466103076935,
0.5335938334465027,
0.10007446259260178,
-0.10220792889595032,
0.1891942322254181,
-0.09007285535335541,
0.3298790454864502,
-0.07502104341983795,
-0.03110669180750847,
0.16478319466114044,
0.04601017013192177,
0.06263557076454163,
0.3652563691139221,
0.11763790249824524,
0.06344155967235565,
-0.0320504829287529,
-0.0025961995124816895,
0.02338966727256775,
-0.5843654870986938,
0.3489838242530823,
-0.009233568795025349,
0.008506672456860542,
-0.22898972034454346,
-0.026377469301223755,
-0.15380583703517914,
0.03796762228012085,
0.1263243556022644,
0.4162382483482361,
-0.12244388461112976,
0.04176786541938782,
-0.3247504234313965,
-0.033089809119701385,
-0.3558734655380249,
0.015806518495082855,
-0.1023825854063034,
-0.2503427565097809,
-0.005916185677051544,
0.01761900633573532,
0.004993177950382233,
-0.20405593514442444,
0.5197198390960693,
-0.3341605067253113,
-0.14738953113555908,
-0.02803390845656395,
-0.04495130479335785,
-0.04517840966582298,
-0.006079688668251038,
0.050546273589134216,
0.12391777336597443,
-0.05669168755412102,
0.4951431453227997,
-0.616963267326355,
-0.488097220659256,
-0.016349995508790016,
-0.016173094511032104,
-0.21649029850959778,
-0.15112683176994324,
-0.00465904176235199,
-0.20784319937229156,
-0.28030943870544434,
-0.11926179379224777,
-0.06789612770080566,
-0.03721276670694351,
0.20861715078353882,
-0.17256270349025726,
-0.014545859768986702,
0.06187811493873596,
0.17440932989120483,
0.24017950892448425,
0.21344557404518127,
0.03092600405216217,
-0.04264264926314354,
0.06025725230574608,
0.24751102924346924,
0.463796466588974,
0.35656535625457764,
-0.06664619594812393,
-0.07896570861339569,
-0.03597794473171234,
-0.2010861337184906,
0.16352972388267517,
0.3025495707988739,
0.13275328278541565,
0.2742766737937927,
0.0810987651348114,
0.07822047173976898,
-0.3259223699569702,
0.07173644006252289,
0.18846681714057922,
-0.018518444150686264,
-0.3344610333442688,
-0.44658026099205017,
0.4566231071949005,
-0.11954890191555023,
-0.09953030198812485,
0.19420680403709412,
0.39230477809906006,
-0.49982738494873047,
0.1898193061351776,
0.42206117510795593,
0.746316134929657,
0.01795234903693199,
0.2882719039916992,
0.10306261479854584,
-0.22065669298171997,
0.1621008962392807,
-0.5947145223617554,
0.11189623177051544,
-0.4775215983390808,
0.06047642603516579,
-0.06468262523412704,
0.000652022659778595,
0.1416727751493454,
0.2930358052253723,
-0.33195483684539795,
0.035006072372198105,
0.11319100856781006,
0.31930193305015564,
-0.39239397644996643,
0.22827723622322083,
-0.3364560306072235,
-0.41846510767936707,
-0.29431888461112976,
0.25522229075431824,
-0.07144156098365784,
-0.1464012861251831,
-0.07216351479291916,
-0.2553417980670929,
-0.012157529592514038,
0.057113006711006165,
-0.29640358686447144,
-0.34321048855781555,
-0.14694906771183014,
-0.10621564090251923,
0.21750104427337646,
0.03213346004486084,
0.11349709331989288,
0.014804095029830933,
0.4002317488193512,
0.14351043105125427,
-0.19895035028457642,
0.28545457124710083,
-0.17284227907657623,
0.07201515138149261,
-0.17615467309951782,
-0.19752463698387146,
0.44684383273124695,
-0.09387349337339401,
-0.14260761439800262,
-0.08781668543815613,
-0.0291395653039217,
-0.3426124155521393,
0.04386186599731445,
-0.17201267182826996,
-0.18230457603931427,
-0.39926669001579285,
0.1651988923549652,
0.09706926345825195,
0.033460646867752075,
-0.20947828888893127,
0.21642550826072693,
-0.05340859293937683,
-0.025382544845342636,
0.2690697908401489,
0.07903384417295456,
0.1143774539232254,
-0.15827131271362305,
-0.1144896149635315,
-0.03600682318210602,
-0.09481783211231232,
0.09317037463188171,
-0.04833777993917465,
-0.20056258141994476,
-0.3157568573951721,
0.21391627192497253,
0.4296192228794098,
-0.11389102041721344,
0.03311316296458244,
-0.11188628524541855,
-0.42046040296554565,
0.11595642566680908,
0.36365437507629395,
0.2957879900932312,
0.2163199484348297,
0.019135333597660065,
-0.07740302383899689,
-0.3032401204109192,
0.35131677985191345,
0.04475899040699005,
0.5343655347824097,
-0.22178474068641663,
0.07556109130382538,
-0.02162366732954979,
0.1449621617794037,
-0.4870307445526123,
-0.19861391186714172,
-0.1959080547094345,
0.08377042412757874,
-0.14924128353595734,
0.14779384434223175,
0.16156679391860962,
-0.1722346693277359,
0.1720884144306183,
-0.2717701196670532,
-0.5014780759811401,
-0.27761077880859375,
-0.3523377776145935,
0.12399570643901825,
-0.05175995081663132,
0.2727014124393463,
0.14138244092464447,
0.1472184956073761,
-0.25366201996803284,
-0.3921632766723633,
0.3085858225822449,
0.09094250947237015,
0.020544681698083878,
0.09626414626836777,
0.4321310818195343,
-0.16199366748332977,
-0.07465807348489761,
-0.08458445221185684,
0.41737666726112366,
0.3759429454803467,
0.04450889304280281,
0.08766749501228333,
-0.586253821849823,
-0.13973192870616913,
0.23729635775089264,
0.5924190282821655,
0.11407521367073059,
0.13797464966773987,
0.1964918076992035,
0.08395074307918549,
-0.012075603008270264,
0.2442927211523056,
0.4460800886154175,
0.18921460211277008,
-0.07352066040039062,
0.24023780226707458,
0.07668799161911011,
0.30964967608451843,
-0.061289094388484955,
-0.20444779098033905,
0.30937325954437256,
-0.2137528657913208,
0.291628897190094,
0.3716794550418854,
0.3336522579193115,
0.05765271186828613,
0.04771270975470543,
-0.004213828593492508,
0.33867982029914856,
-0.24091437458992004,
0.14254072308540344,
0.2668405771255493,
-0.17811685800552368,
0.0740608423948288,
0.38776805996894836,
0.15144586563110352,
0.4224889576435089,
0.3729669749736786,
-0.0030952617526054382,
0.07092230767011642,
0.2645420730113983,
-0.16305166482925415,
0.2320604920387268,
-0.09822879731655121,
0.24908339977264404,
0.14255192875862122,
0.12169580906629562,
0.04383103922009468,
0.10426419973373413,
0.2693982720375061,
-0.1041811853647232,
-0.34899207949638367,
-0.1572534739971161,
0.2455788403749466,
-0.10991726815700531,
-0.16523689031600952,
-0.16058290004730225,
-0.2467658519744873,
-0.12946824729442596,
-0.049084197729825974,
-0.02955680340528488,
-0.43456485867500305,
0.15693449974060059,
-0.0987689346075058,
0.3316912055015564,
-0.15271584689617157,
0.5035266876220703,
0.04638640210032463,
0.25852441787719727,
-0.17298777401447296,
0.06598246842622757,
0.08034128695726395,
-0.25220975279808044,
-0.03119734674692154,
0.247694730758667,
0.09166078269481659,
-0.018384713679552078,
0.09438933432102203,
0.15453612804412842,
0.04197922721505165,
-0.023786287754774094,
-0.15145428478717804,
-0.4060628414154053,
0.06000779569149017,
-0.13966912031173706,
0.3639562427997589,
0.2634480595588684,
-0.17699365317821503,
-0.14192326366901398,
-0.21495360136032104,
-0.13666824996471405,
-0.015654414892196655,
0.042010799050331116,
0.3943808972835541,
-0.27153798937797546,
0.17624568939208984,
-0.08894465118646622,
-0.22804591059684753,
-0.20691105723381042,
0.40750113129615784,
-0.032849304378032684,
0.22809872031211853,
-0.09881321340799332,
0.16097211837768555,
0.0711807981133461,
0.5699361562728882,
-0.13615208864212036,
-0.14093871414661407,
0.03340495750308037,
-0.06868483126163483,
-0.43746083974838257,
-0.20443950593471527,
-0.06424583494663239,
-0.1527596116065979,
0.036877766251564026,
0.18439581990242004,
0.23134540021419525,
0.02912924438714981,
-0.007668159902095795,
-0.15790176391601562,
0.27132338285446167,
0.15951499342918396,
-0.22335627675056458,
-0.1349889189004898,
0.10522932559251785,
0.1622961163520813,
0.22655943036079407,
-0.11717261373996735,
0.0018368363380432129,
0.0720691904425621,
0.03712225705385208,
-0.023576801642775536,
0.4387515187263489,
0.2807074189186096,
-0.45814934372901917,
0.031152289360761642,
-0.23184055089950562,
0.16382956504821777,
-0.25173646211624146,
-0.13688592612743378,
-0.11453543603420258,
-0.20008641481399536,
-0.4492824971675873,
-0.01625337451696396,
-0.1867140233516693,
0.34995734691619873,
-0.17952056229114532,
-0.2377462089061737,
-0.2733083665370941,
-0.009795378893613815,
0.22246035933494568,
-0.15060918033123016,
-0.06933862715959549,
0.2024734914302826,
-0.09517395496368408,
0.019412100315093994,
0.21125392615795135,
0.3956410586833954,
-0.017056681215763092,
-0.026927337050437927,
-0.12943029403686523,
-0.40704289078712463,
0.37540656328201294,
0.09073665738105774,
-0.11968238651752472,
0.03674658387899399,
0.03911645710468292,
0.15609881281852722,
0.11792661249637604,
-0.6338540315628052,
0.11930927634239197,
0.3056436777114868,
-0.1539008617401123,
-0.26258763670921326,
0.2888064682483673,
0.060176730155944824,
-0.205783411860466,
-0.1942954808473587,
0.2103925496339798,
0.07268575578927994,
-0.3066175580024719,
-0.3324697017669678,
-0.27441030740737915
] |
https://github.com/huggingface/datasets/issues/5694 | From internal discussions we agreed to go with the YAML approach, since it's the one that seems more appropriate to be modified by a human on the Hub or locally (while JSON e.g. for models are usually created programmatically). | Dataset configuration | Following discussions from https://github.com/huggingface/datasets/pull/5331
We could have something like `config.json` to define the configuration of a dataset.
```json
{
"data_dir": "data"
"data_files": {
"train": "train-[0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*"
}
}
```
we could also support a list for several configs with a 'config_name' field.
The alternative was to use YAML in the README.md.
I think it could also support a `dataset_type` field to specify which dataset builder class to use, and the other parameters would be the builder's parameters. Some parameters exist for all builders like `data_files` and `data_dir`, but some parameters are builder specific like `sep` for csv.
This format would be used in `push_to_hub` to be able to push multiple configs.
cc @huggingface/datasets
EDIT: actually we're going for the YAML approach in README.md | 39 | Dataset configuration
Following discussions from https://github.com/huggingface/datasets/pull/5331
We could have something like `config.json` to define the configuration of a dataset.
```json
{
"data_dir": "data"
"data_files": {
"train": "train-[0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*"
}
}
```
we could also support a list for several configs with a 'config_name' field.
The alternative was to use YAML in the README.md.
I think it could also support a `dataset_type` field to specify which dataset builder class to use, and the other parameters would be the builder's parameters. Some parameters exist for all builders like `data_files` and `data_dir`, but some parameters are builder specific like `sep` for csv.
This format would be used in `push_to_hub` to be able to push multiple configs.
cc @huggingface/datasets
EDIT: actually we're going for the YAML approach in README.md
From internal discussions we agreed to go with the YAML approach, since it's the one that seems more appropriate to be modified by a human on the Hub or locally (while JSON e.g. for models are usually created programmatically). | [
-0.3235020041465759,
-0.33107948303222656,
-0.08555613458156586,
0.14359715580940247,
0.23720470070838928,
0.1515040099620819,
0.2792743742465973,
0.2076961249113083,
0.24624988436698914,
0.1725151538848877,
-0.07195708155632019,
0.3215893805027008,
-0.15135310590267181,
0.5376594662666321,
0.3689543604850769,
0.19545748829841614,
0.08105910569429398,
0.04878116026520729,
-0.07214964926242828,
0.08485527336597443,
-0.03622730076313019,
0.022243758663535118,
0.25953003764152527,
-0.050364263355731964,
-0.23983363807201385,
0.003418153151869774,
-0.19382262229919434,
0.041006118059158325,
-0.2727260887622833,
-0.39109399914741516,
0.255623459815979,
0.46064165234565735,
-0.12112778425216675,
0.1689717322587967,
-0.00009840291750151664,
0.1904185265302658,
-0.005879059433937073,
-0.1981937289237976,
-0.38709819316864014,
-0.08084242045879364,
-0.22425594925880432,
-0.20862257480621338,
0.16091018915176392,
-0.1997373253107071,
-0.1509404480457306,
-0.0678606778383255,
0.2115180790424347,
0.07422779500484467,
0.37661299109458923,
0.004154454916715622,
0.26265281438827515,
0.1356658786535263,
-0.0006147474050521851,
-0.07418100535869598,
-0.025566324591636658,
0.4138568341732025,
-0.32591503858566284,
0.08016061782836914,
0.26465028524398804,
0.2993488907814026,
-0.1866428554058075,
0.053193189203739166,
0.08729857951402664,
0.018158897757530212,
0.5882744789123535,
0.10493375360965729,
0.07082762569189072,
-0.12928146123886108,
-0.12400539219379425,
0.36855608224868774,
0.520671546459198,
-0.5535900592803955,
-0.3808174729347229,
-0.4561685025691986,
0.05543624982237816,
-0.11689281463623047,
0.10286877304315567,
0.25172269344329834,
-0.1405365765094757,
0.3297608196735382,
-0.3476041555404663,
-0.398176372051239,
-0.202423095703125,
-0.03447943180799484,
-0.023029573261737823,
0.2869727611541748,
-0.0740818977355957,
-0.049796465784311295,
-0.09135398268699646,
-0.07796415686607361,
0.13912586867809296,
-0.3743906617164612,
-0.0736050009727478,
-0.046247828751802444,
-0.06712555885314941,
-0.32741403579711914,
0.03626013174653053,
0.025327585637569427,
0.41401106119155884,
0.11643579602241516,
0.21516403555870056,
0.30412888526916504,
-0.07306292653083801,
0.21497449278831482,
0.3273943066596985,
0.08459527790546417,
0.2779204249382019,
-0.11258554458618164,
0.22011059522628784,
0.047842785716056824,
0.13092562556266785,
-0.08296549320220947,
-0.038169924169778824,
0.08172070980072021,
-0.17714178562164307,
-0.10995014756917953,
0.02606121450662613,
0.16808351874351501,
0.07500031590461731,
-0.2020764797925949,
0.22889494895935059,
-0.0022638924419879913,
0.19031192362308502,
0.2678103446960449,
-0.09094315767288208,
-0.08757558465003967,
-0.11496426165103912,
0.10247334837913513,
0.07860661298036575,
0.09393985569477081,
-0.19280549883842468,
-0.0090259350836277,
-0.11618024855852127,
0.2396058738231659,
0.12453896552324295,
-0.2423141896724701,
0.333255410194397,
0.16408827900886536,
0.18215417861938477,
-0.1044495552778244,
0.11924313008785248,
0.3015820384025574,
0.012915316969156265,
0.2068527787923813,
0.03928246349096298,
-0.010004095733165741,
-0.18219318985939026,
-0.15203894674777985,
-0.5906585454940796,
-0.194631427526474,
-0.42225030064582825,
-0.4238421320915222,
0.005498809739947319,
0.25736647844314575,
-0.1854144036769867,
0.029817882925271988,
-0.26355284452438354,
0.4890376329421997,
-0.1187439113855362,
0.11103925853967667,
-0.00423990935087204,
0.22018587589263916,
-0.09624015539884567,
-0.3023594617843628,
0.20118381083011627,
0.2361840456724167,
-0.1458386778831482,
-0.18620148301124573,
0.2574542462825775,
-0.16189520061016083,
-0.4470862150192261,
-0.1493135392665863,
-0.4508479833602905,
0.1521858274936676,
-0.0229828879237175,
0.21624094247817993,
0.36227911710739136,
-0.36206668615341187,
-0.09520982950925827,
0.045046187937259674,
0.14313900470733643,
-0.08442514389753342,
0.1306047886610031,
0.09088076651096344,
0.18626338243484497,
-0.040438901633024216,
0.1916208267211914,
0.21621489524841309,
-0.1439138948917389,
0.2229829728603363,
0.06914316117763519,
-0.458635151386261,
-0.3043418824672699,
0.17521308362483978,
-0.054392728954553604,
-0.15221165120601654,
0.11360125243663788,
0.05555158853530884,
0.22884075343608856,
-0.21953976154327393,
0.16257280111312866,
0.2032104730606079,
0.21124336123466492,
-0.047606322914361954,
-0.08208233118057251,
-0.19645296037197113,
-0.6565902829170227,
0.2955719530582428,
0.11457555741071701,
0.09736524522304535,
0.1374586820602417,
-0.3081340789794922,
0.036964498460292816,
0.033658646047115326,
-0.29152506589889526,
-0.12320838868618011,
0.2651943862438202,
0.06400808691978455,
-0.1875409483909607,
-0.2712702751159668,
-0.45753639936447144,
0.23405702412128448,
-0.02711494266986847,
0.20116421580314636,
-0.5079007148742676,
0.2656121253967285,
-0.02191871777176857,
0.020536795258522034,
0.06904236972332001,
0.020069923251867294,
-0.14957371354103088,
-0.1841176599264145,
0.2815719246864319,
0.3245081305503845,
0.05505149066448212,
0.1673995703458786,
0.2452000230550766,
0.5462453365325928,
0.45535194873809814,
0.23173026740550995,
0.20218642055988312,
-0.19237612187862396,
-0.16903987526893616,
-0.044800277799367905,
-0.5379341244697571,
0.5840944647789001,
0.034190356731414795,
0.08682683110237122,
0.03337360918521881,
0.0041882991790771484,
0.24407222867012024,
0.07066886126995087,
-0.23411166667938232,
-0.1790194809436798,
-0.30487537384033203,
0.07122087478637695,
0.17900550365447998,
0.019937066361308098,
-0.2885439395904541,
0.2786553204059601,
0.4892865717411041,
0.16917607188224792,
0.04048930108547211,
0.10916492342948914,
-0.24947042763233185,
-0.07249613106250763,
0.09322526305913925,
0.19315020740032196,
0.11921696364879608,
0.2986932694911957,
0.008692107163369656,
0.13022109866142273,
-0.17129339277744293,
-0.08517631888389587,
0.22298860549926758,
-0.05854541063308716,
0.1655663102865219,
0.16408394277095795,
-0.03514033555984497,
-0.2063499391078949,
-0.3029414415359497,
-0.19448021054267883,
0.04196574538946152,
-0.020356591790914536,
-0.2190617024898529,
-0.07202225923538208,
-0.15599548816680908,
0.24776026606559753,
-0.15920113027095795,
-0.19231016933918,
-0.42197227478027344,
-0.23992356657981873,
0.29513460397720337,
0.08210766315460205,
-0.2453165352344513,
0.14816196262836456,
0.015690438449382782,
0.3616465926170349,
-0.144048273563385,
-0.03455414995551109,
-0.11807471513748169,
-0.15911448001861572,
0.07596644759178162,
0.1251031756401062,
0.1880502998828888,
0.09109445661306381,
0.24210503697395325,
-0.03230050951242447,
0.0218174010515213,
-0.2500976026058197,
-0.23382966220378876,
0.39317309856414795,
-0.1162615567445755,
0.5314714908599854,
0.3403669595718384,
0.21485909819602966,
0.1353655457496643,
-0.19379553198814392,
0.3148401975631714,
0.2945398688316345,
-0.24202045798301697,
-0.16840647161006927,
0.052593134343624115,
-0.14840614795684814,
-0.1743021458387375,
-0.2222614288330078,
-0.13926002383232117,
-0.4540214240550995,
0.33311209082603455,
0.12052634358406067,
0.2730564475059509,
0.25893738865852356,
0.24359923601150513,
-0.12189654260873795,
-0.22430016100406647,
0.06899654865264893,
-0.15638947486877441,
-0.5112217664718628,
0.31214746832847595,
-0.40279421210289,
-0.03906009718775749,
-0.009705036878585815,
0.1322428584098816,
0.18196062743663788,
0.026984792202711105,
-0.21949289739131927,
-0.2782355844974518,
-0.0797824114561081,
0.17250469326972961,
0.2768387496471405,
0.0678429901599884,
0.3372175693511963,
0.2270646095275879,
-0.10359394550323486,
-0.09494269639253616,
-0.3257988691329956,
0.22172346711158752,
0.2357690930366516,
0.024842187762260437,
0.02884857729077339,
0.03759903088212013,
-0.11714024841785431,
0.3946196138858795,
0.13372831046581268,
-0.12598425149917603,
0.07029357552528381,
-0.08417561650276184,
0.30815231800079346,
-0.09474223107099533,
0.013510145246982574,
0.08471502363681793,
-0.007253587245941162,
-0.007213536649942398,
0.4578244984149933,
0.20746149122714996,
0.0679163783788681,
-0.12998807430267334,
-0.13109533488750458,
-0.06327871233224869,
-0.5205057263374329,
0.3171846866607666,
0.010495646856725216,
-0.028963632881641388,
-0.20510613918304443,
-0.03848487138748169,
-0.220322385430336,
0.048171862959861755,
0.06832142174243927,
0.3478071391582489,
-0.13385163247585297,
0.054363660514354706,
-0.3869689702987671,
-0.07908608019351959,
-0.3972434997558594,
0.028538629412651062,
-0.12171277403831482,
-0.2504873275756836,
0.07590030133724213,
-0.0023437291383743286,
0.033762190490961075,
-0.21508893370628357,
0.4487958252429962,
-0.38882312178611755,
-0.18122312426567078,
-0.10034438222646713,
-0.08758238703012466,
-0.08538772165775299,
0.03740863502025604,
0.04385225474834442,
0.1728673130273819,
-0.05117042362689972,
0.47974544763565063,
-0.4821613132953644,
-0.4701912999153137,
-0.09096112102270126,
-0.0024543628096580505,
-0.2707592844963074,
-0.14955200254917145,
0.026420436799526215,
-0.18923956155776978,
-0.2511003017425537,
-0.13347399234771729,
-0.08354754745960236,
-0.07909604161977768,
0.23308821022510529,
-0.24590708315372467,
-0.0028109997510910034,
0.12629267573356628,
0.18845254182815552,
0.2732495665550232,
0.19115477800369263,
0.015346266329288483,
-0.031605593860149384,
0.12189396470785141,
0.33010098338127136,
0.3858025372028351,
0.39870521426200867,
-0.056795865297317505,
-0.1149127334356308,
-0.003404710441827774,
-0.22483329474925995,
0.14216911792755127,
0.3040304183959961,
0.13136692345142365,
0.2513084411621094,
0.09823612868785858,
-0.010564040392637253,
-0.34007588028907776,
0.002325810492038727,
0.13395686447620392,
-0.020415427163243294,
-0.2601671814918518,
-0.4096807837486267,
0.5316673517227173,
-0.1548600196838379,
-0.1347893625497818,
0.16461440920829773,
0.294380247592926,
-0.5531989932060242,
0.17930883169174194,
0.46088510751724243,
0.756324291229248,
0.0072714947164058685,
0.304055780172348,
0.05496383085846901,
-0.2024504840373993,
0.24861088395118713,
-0.5634721517562866,
0.150819793343544,
-0.45291489362716675,
0.07967276871204376,
-0.10995746403932571,
0.06442201137542725,
0.1001630574464798,
0.3248482346534729,
-0.2749303877353668,
0.014895971864461899,
0.16437864303588867,
0.36058223247528076,
-0.3793555796146393,
0.22934117913246155,
-0.33994051814079285,
-0.3971405327320099,
-0.35320284962654114,
0.25351738929748535,
-0.05307774245738983,
-0.22396215796470642,
-0.10010510683059692,
-0.30842968821525574,
-0.03204180300235748,
0.03244512528181076,
-0.23611053824424744,
-0.31762245297431946,
-0.1251460313796997,
-0.10532450675964355,
0.2257111668586731,
0.04065549373626709,
0.07989457994699478,
0.1130916178226471,
0.3735629916191101,
0.09341760724782944,
-0.3418380320072174,
0.25410065054893494,
-0.2445855289697647,
0.05448935553431511,
-0.21268953382968903,
-0.20380988717079163,
0.3763218820095062,
-0.07488899677991867,
-0.09594016522169113,
-0.08961136639118195,
0.022888265550136566,
-0.3409464955329895,
0.04560111463069916,
-0.06350864470005035,
-0.12340366840362549,
-0.3895114064216614,
0.053255222737789154,
0.12460977584123611,
0.009132906794548035,
-0.255033403635025,
0.2101266086101532,
-0.05599989742040634,
-0.01949821226298809,
0.26433438062667847,
0.06394276022911072,
0.051738545298576355,
-0.11014729738235474,
-0.04790199548006058,
0.005166572518646717,
-0.152908056974411,
0.035649970173835754,
-0.022644057869911194,
-0.22556650638580322,
-0.2968473434448242,
0.22406376898288727,
0.42990824580192566,
-0.16484108567237854,
0.07520584762096405,
-0.1093396246433258,
-0.33527031540870667,
0.09966310113668442,
0.3739580512046814,
0.27009937167167664,
0.14442595839500427,
0.018179871141910553,
-0.06055856868624687,
-0.3156609535217285,
0.39400213956832886,
0.16378748416900635,
0.5341284275054932,
-0.14751307666301727,
-0.0231039896607399,
0.07576148211956024,
0.07892627269029617,
-0.48180243372917175,
-0.17034807801246643,
-0.17842674255371094,
0.10108484327793121,
-0.11675296723842621,
0.14505624771118164,
0.1221783459186554,
-0.14412860572338104,
0.134929358959198,
-0.2645394802093506,
-0.4779944121837616,
-0.2731515169143677,
-0.28712236881256104,
0.1244446337223053,
-0.01227689627557993,
0.23145927488803864,
0.07866908609867096,
0.13912057876586914,
-0.2477702498435974,
-0.40195703506469727,
0.2600715756416321,
0.11021177470684052,
0.046960800886154175,
0.03711007907986641,
0.37867581844329834,
-0.030036024749279022,
-0.10892138630151749,
-0.03951803594827652,
0.3971368670463562,
0.32025617361068726,
0.05554942041635513,
0.08226744830608368,
-0.5360538959503174,
-0.12862041592597961,
0.298461377620697,
0.5845388174057007,
0.09158234298229218,
0.17928454279899597,
0.24127253890037537,
0.15684396028518677,
-0.02202630788087845,
0.2597202658653259,
0.4036501348018646,
0.2534150183200836,
-0.09485393762588501,
0.22690501809120178,
0.026173342019319534,
0.3102017641067505,
-0.0868452936410904,
-0.20030644536018372,
0.3176281750202179,
-0.21149519085884094,
0.24526038765907288,
0.3420675992965698,
0.3788859248161316,
0.06359538435935974,
-0.033015500754117966,
-0.022803425788879395,
0.34376952052116394,
-0.1963868886232376,
0.08502352237701416,
0.25252413749694824,
-0.15854185819625854,
0.04904638230800629,
0.39210692048072815,
0.2505260705947876,
0.39652395248413086,
0.4272037148475647,
0.0006145313382148743,
0.0775860995054245,
0.2748969495296478,
-0.12593640387058258,
0.22526389360427856,
-0.08517686277627945,
0.28833961486816406,
0.013832978904247284,
0.1303108036518097,
0.04759294167160988,
0.10605763643980026,
0.22061020135879517,
-0.12126319855451584,
-0.23590457439422607,
-0.24050065875053406,
0.23210932314395905,
-0.11507411301136017,
-0.24318045377731323,
-0.20611795783042908,
-0.29047757387161255,
-0.08814288675785065,
0.007324695587158203,
-0.06810608506202698,
-0.4339781701564789,
0.16839295625686646,
-0.13366979360580444,
0.325808048248291,
-0.12450135499238968,
0.39881378412246704,
0.10229780524969101,
0.14143812656402588,
-0.23159754276275635,
0.11332397162914276,
0.1656201183795929,
-0.2958050072193146,
-0.09284894168376923,
0.2721049189567566,
0.0559159554541111,
-0.04476814344525337,
0.04405174031853676,
0.27986419200897217,
0.039163265377283096,
-0.010623455047607422,
-0.2027173489332199,
-0.34476953744888306,
0.057133711874485016,
-0.03684375435113907,
0.2842440605163574,
0.2758300304412842,
-0.1533251702785492,
-0.10735161602497101,
-0.21487165987491608,
-0.03318992629647255,
-0.025313958525657654,
-0.028990939259529114,
0.3977271616458893,
-0.2669810354709625,
0.14627975225448608,
-0.020982950925827026,
-0.28434476256370544,
-0.2166125625371933,
0.4324876368045807,
-0.03591196984052658,
0.18982388079166412,
-0.1309754103422165,
0.16178454458713531,
0.0628042072057724,
0.6364630460739136,
-0.06708431243896484,
-0.12657573819160461,
0.08393792808055878,
-0.030699066817760468,
-0.34998834133148193,
-0.163179412484169,
0.018160073086619377,
-0.09817332029342651,
-0.03316096216440201,
0.18848705291748047,
0.25905659794807434,
0.044185418635606766,
-0.11989742517471313,
-0.03670613840222359,
0.14989376068115234,
0.16458731889724731,
-0.156680166721344,
-0.12720373272895813,
0.06454798579216003,
0.1663665473461151,
0.23558704555034637,
-0.04843250662088394,
0.044702719897031784,
0.040494345128536224,
0.02652878314256668,
-0.09164604544639587,
0.43323367834091187,
0.21858718991279602,
-0.4061923325061798,
0.11357514560222626,
-0.2103404402732849,
0.19931206107139587,
-0.262521356344223,
-0.13672548532485962,
-0.1823607087135315,
-0.14160913228988647,
-0.4226846694946289,
-0.006095707416534424,
-0.13149157166481018,
0.258758008480072,
-0.23433071374893188,
-0.2049626260995865,
-0.21191923320293427,
-0.037162166088819504,
0.17453265190124512,
-0.19057603180408478,
-0.10918876528739929,
0.06879550218582153,
-0.16003486514091492,
-0.007793117314577103,
0.23243027925491333,
0.45021921396255493,
-0.04687100276350975,
-0.06744777411222458,
-0.08493544161319733,
-0.3288995921611786,
0.38926276564598083,
0.05719185620546341,
-0.11771593987941742,
0.04614492878317833,
-0.010335467755794525,
0.21208830177783966,
0.11516822129487991,
-0.6831055283546448,
0.10397778451442719,
0.29061344265937805,
-0.21463128924369812,
-0.21898721158504486,
0.31654447317123413,
0.10644711554050446,
-0.23690667748451233,
-0.26852357387542725,
0.19097331166267395,
0.12144085019826889,
-0.27856385707855225,
-0.39114516973495483,
-0.34697556495666504
] |
https://github.com/huggingface/datasets/issues/5692 | Hi! The link pointing to the code that generated the dataset is broken. Can you please fix it to make debugging easier? | pyarrow.lib.ArrowInvalid: Unable to merge: Field <field> has incompatible types | ### Describe the bug
When loading the dataset [wikianc-en](https://huggingface.co/datasets/cyanic-selkie/wikianc-en) which I created using [this](https://github.com/cyanic-selkie/wikianc) code, I get the following error:
```
Traceback (most recent call last):
File "/home/sven/code/rector/answer-detection/train.py", line 106, in <module>
(dataset, weights) = get_dataset(args.dataset, tokenizer, labels, args.padding)
File "/home/sven/code/rector/answer-detection/dataset.py", line 106, in get_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en")
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/load.py", line 1794, in load_dataset
ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1106, in as_dataset
datasets = map_nested(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 443, in map_nested
mapped = [
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 444, in <listcomp>
_single_map_nested((function, obj, types, None, True, None))
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 346, in _single_map_nested
return function(data_struct)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1136, in _build_single_dataset
ds = self._as_dataset(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1207, in _as_dataset
dataset_kwargs = ArrowReader(cache_dir, self.info).read(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 239, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 260, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 203, in _read_files
pa_table = concat_tables(pa_tables) if len(pa_tables) != 1 else pa_tables[0]
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1808, in concat_tables
return ConcatenationTable.from_tables(tables, axis=axis)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1514, in from_tables
return cls.from_blocks(blocks)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1427, in from_blocks
table = cls._concat_blocks(blocks, axis=0)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1373, in _concat_blocks
return pa.concat_tables(pa_tables, promote=True)
File "pyarrow/table.pxi", line 5224, in pyarrow.lib.concat_tables
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Unable to merge: Field paragraph_anchors has incompatible types: list<: struct<start: uint32 not null, end: uint32 not null, qid: uint32, pageid: uint32, title: string not null> not null> vs list<item: struct<start: uint32, end: uint32, qid: uint32, pageid: uint32, title: string>>
```
This only happens when I load the `train` split, indicating that the size of the dataset is the deciding factor.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en", split="train")
```
### Expected behavior
The dataset should load normally without any errors.
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-6.2.8-arch1-1-x86_64-with-glibc2.37
- Python version: 3.10.10
- PyArrow version: 11.0.0
- Pandas version: 1.5.3 | 22 | pyarrow.lib.ArrowInvalid: Unable to merge: Field <field> has incompatible types
### Describe the bug
When loading the dataset [wikianc-en](https://huggingface.co/datasets/cyanic-selkie/wikianc-en) which I created using [this](https://github.com/cyanic-selkie/wikianc) code, I get the following error:
```
Traceback (most recent call last):
File "/home/sven/code/rector/answer-detection/train.py", line 106, in <module>
(dataset, weights) = get_dataset(args.dataset, tokenizer, labels, args.padding)
File "/home/sven/code/rector/answer-detection/dataset.py", line 106, in get_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en")
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/load.py", line 1794, in load_dataset
ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1106, in as_dataset
datasets = map_nested(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 443, in map_nested
mapped = [
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 444, in <listcomp>
_single_map_nested((function, obj, types, None, True, None))
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 346, in _single_map_nested
return function(data_struct)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1136, in _build_single_dataset
ds = self._as_dataset(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1207, in _as_dataset
dataset_kwargs = ArrowReader(cache_dir, self.info).read(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 239, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 260, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 203, in _read_files
pa_table = concat_tables(pa_tables) if len(pa_tables) != 1 else pa_tables[0]
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1808, in concat_tables
return ConcatenationTable.from_tables(tables, axis=axis)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1514, in from_tables
return cls.from_blocks(blocks)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1427, in from_blocks
table = cls._concat_blocks(blocks, axis=0)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1373, in _concat_blocks
return pa.concat_tables(pa_tables, promote=True)
File "pyarrow/table.pxi", line 5224, in pyarrow.lib.concat_tables
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Unable to merge: Field paragraph_anchors has incompatible types: list<: struct<start: uint32 not null, end: uint32 not null, qid: uint32, pageid: uint32, title: string not null> not null> vs list<item: struct<start: uint32, end: uint32, qid: uint32, pageid: uint32, title: string>>
```
This only happens when I load the `train` split, indicating that the size of the dataset is the deciding factor.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en", split="train")
```
### Expected behavior
The dataset should load normally without any errors.
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-6.2.8-arch1-1-x86_64-with-glibc2.37
- Python version: 3.10.10
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
Hi! The link pointing to the code that generated the dataset is broken. Can you please fix it to make debugging easier? | [
-0.2805249094963074,
0.09721410274505615,
-0.010183371603488922,
0.40840592980384827,
0.1494453102350235,
0.06983813643455505,
0.20628100633621216,
0.5558909177780151,
-0.2604309320449829,
-0.011714830994606018,
-0.03858485817909241,
0.6745288372039795,
0.05063933506608009,
-0.11226508021354675,
-0.18011558055877686,
0.05612685903906822,
0.051824990659952164,
0.22459642589092255,
-0.17221274971961975,
0.04517143964767456,
-0.21938717365264893,
0.019802821800112724,
-0.17079420387744904,
0.23620453476905823,
-0.24669858813285828,
-0.2392963171005249,
0.1450224071741104,
0.2811068296432495,
-0.2901458740234375,
-0.5820426344871521,
0.32738611102104187,
-0.22757792472839355,
-0.11271628737449646,
0.21473240852355957,
-0.00011655344860628247,
0.1178947314620018,
0.5897098183631897,
0.2304733693599701,
-0.29012244939804077,
-0.13319078087806702,
-0.025138914585113525,
0.01019328087568283,
0.2890773415565491,
-0.10326239466667175,
0.2928190231323242,
-0.4270164966583252,
-0.27329492568969727,
0.009804435074329376,
0.05866799131035805,
0.28049787878990173,
0.16709986329078674,
0.42194318771362305,
0.4241899847984314,
0.04944324493408203,
0.3522590696811676,
-0.04177304729819298,
0.06171712279319763,
0.3433992266654968,
0.14063403010368347,
-0.07862365990877151,
0.2664812207221985,
0.06186046823859215,
-0.0011341273784637451,
-0.2022867500782013,
0.2845589220523834,
-0.18069934844970703,
-0.050393443554639816,
-0.24394011497497559,
-0.06976811587810516,
0.05107260122895241,
0.18225330114364624,
-0.3696192800998688,
-0.12242267280817032,
0.07568653672933578,
0.17244303226470947,
-0.2561717927455902,
0.23695147037506104,
0.08965767920017242,
-0.1013035923242569,
0.11942008137702942,
0.1009407639503479,
0.1068328469991684,
-0.2211434245109558,
0.27185434103012085,
-0.15967512130737305,
0.38214871287345886,
0.2471078634262085,
0.2811359763145447,
0.014969983138144016,
-0.10734324157238007,
0.250547856092453,
-0.09932820498943329,
-0.23028859496116638,
0.02205902710556984,
-0.2895309031009674,
-0.1330741047859192,
-0.341402143239975,
0.07927781343460083,
0.197422593832016,
-0.02036702260375023,
0.002242792397737503,
-0.10333314538002014,
0.2760816812515259,
0.3583819568157196,
0.20826789736747742,
0.034108519554138184,
-0.03402366489171982,
0.15350311994552612,
0.08144985139369965,
-0.04960152134299278,
0.034794360399246216,
0.18608850240707397,
-0.18437176942825317,
-0.39930373430252075,
0.13665151596069336,
-0.08370788395404816,
0.42032530903816223,
0.029101349413394928,
-0.42175784707069397,
-0.021606698632240295,
-0.39149010181427,
0.0017580054700374603,
0.11320099234580994,
0.3697870075702667,
0.034491945058107376,
0.22917728126049042,
-0.08260026574134827,
0.3244776725769043,
0.07117686420679092,
-0.23562437295913696,
-0.04831912741065025,
0.0054743848741054535,
-0.0811399295926094,
-0.12787222862243652,
0.10012222081422806,
-0.14847277104854584,
0.03875184804201126,
0.3723870515823364,
0.1329813301563263,
0.032785117626190186,
-0.0588047169148922,
-0.06992287188768387,
-0.05724138021469116,
0.21614232659339905,
-0.11396899074316025,
0.11844737827777863,
0.1918967068195343,
-0.21551883220672607,
-0.13088178634643555,
0.24357616901397705,
-0.2250734269618988,
-0.26642704010009766,
-0.4479329586029053,
0.2165040522813797,
0.21837426722049713,
-0.16196294128894806,
-0.05271990969777107,
0.045444946736097336,
0.25191017985343933,
-0.277621328830719,
0.10849808156490326,
-0.142408549785614,
0.08053566515445709,
-0.4153742790222168,
0.14927133917808533,
-0.17377996444702148,
-0.6322271227836609,
-0.03600310534238815,
-0.0780041292309761,
0.04708150029182434,
-0.1614866405725479,
0.22766098380088806,
-0.49806714057922363,
0.13009217381477356,
-0.09243860840797424,
0.374860942363739,
0.4141618013381958,
-0.4940008521080017,
-0.5556289553642273,
-0.09876886010169983,
0.073496013879776,
-0.1125347763299942,
0.028886565938591957,
-0.04602626711130142,
-0.03645618259906769,
-0.0010994337499141693,
-0.06970043480396271,
0.3525669276714325,
-0.1990693360567093,
-0.08479973673820496,
-0.3005053400993347,
-0.4088733494281769,
0.36437031626701355,
0.13155078887939453,
0.09027603268623352,
-0.23659071326255798,
0.2952375113964081,
-0.45968887209892273,
0.12350357323884964,
-0.17304742336273193,
0.05838135629892349,
0.15070943534374237,
0.2092573046684265,
-0.09757940471172333,
0.1514662355184555,
-0.11910393834114075,
-0.6455629467964172,
0.09856367856264114,
-0.4016658365726471,
-0.02046135440468788,
-0.49088895320892334,
-0.2702796757221222,
-0.3079413175582886,
0.15385091304779053,
-0.25793135166168213,
0.13175341486930847,
0.12937524914741516,
-0.0699610710144043,
-0.18740999698638916,
-0.0367407463490963,
-0.2560194730758667,
-0.27959704399108887,
0.03376110643148422,
0.142179936170578,
-0.12595251202583313,
0.3754669427871704,
-0.3712630569934845,
-0.232301265001297,
-0.20842424035072327,
0.246822789311409,
0.20961326360702515,
0.059498876333236694,
-0.10185934603214264,
0.4523555040359497,
-0.20680837333202362,
0.29023629426956177,
-0.09592460840940475,
-0.1255692094564438,
0.24385400116443634,
-0.4258055090904236,
-0.12492357939481735,
0.012456502765417099,
0.14320969581604004,
-0.03382263332605362,
0.30401578545570374,
0.1926567703485489,
0.07509462535381317,
0.2701578736305237,
0.04312938451766968,
-0.09947340190410614,
0.06511339545249939,
0.05495310574769974,
0.0610990971326828,
0.01082109659910202,
-0.11647360771894455,
0.1211426854133606,
0.40850162506103516,
0.17182062566280365,
-0.2261762022972107,
0.24592173099517822,
0.4758453965187073,
0.03003518283367157,
0.04880805313587189,
-0.07515819370746613,
-0.3270900249481201,
-0.02401016652584076,
0.10820481181144714,
-0.052551545202732086,
0.3114812970161438,
0.23333033919334412,
-0.30944469571113586,
0.026720518246293068,
-0.11515772342681885,
0.020407982170581818,
0.3276251554489136,
0.28367239236831665,
0.5039348602294922,
0.43467187881469727,
0.4090934693813324,
0.15100018680095673,
-0.23093822598457336,
0.22423383593559265,
0.17997100949287415,
0.10664553195238113,
-0.28316235542297363,
0.23498943448066711,
-0.33338314294815063,
0.09905806183815002,
-0.23152410984039307,
-0.4866984784603119,
-0.20980583131313324,
-0.19585952162742615,
0.018451716750860214,
0.3519749343395233,
-0.05227909982204437,
0.2953355610370636,
0.06825850903987885,
0.17575009167194366,
0.25046613812446594,
-0.1121440976858139,
-0.39343225955963135,
-0.2317080795764923,
-0.3114180564880371,
0.04076195880770683,
0.4841529130935669,
-0.23373833298683167,
0.2595258355140686,
0.17009788751602173,
0.019579261541366577,
-0.13230960071086884,
-0.5497908592224121,
0.16049498319625854,
-0.10840636491775513,
0.19024568796157837,
0.11073824763298035,
0.0667678639292717,
-0.1426233947277069,
-0.5507011413574219,
0.41317111253738403,
-0.14313656091690063,
-0.34209179878234863,
0.20194149017333984,
-0.3022468388080597,
-0.04356587305665016,
-0.03566350042819977,
-0.3527362048625946,
-0.33615225553512573,
-0.30958765745162964,
-0.030955523252487183,
-0.018699705600738525,
0.057239413261413574,
0.09943832457065582,
0.3169410824775696,
-0.015189465135335922,
-0.20841073989868164,
-0.07954493165016174,
-0.14484520256519318,
0.16177241504192352,
0.26311802864074707,
-0.1541561335325241,
-0.21813470125198364,
0.036447517573833466,
-0.21221888065338135,
0.25414425134658813,
0.17194195091724396,
-0.06042742729187012,
0.10523559153079987,
-0.07237479835748672,
0.5506565570831299,
-0.12302844971418381,
-0.16353099048137665,
0.4070304334163666,
0.19689230620861053,
-0.00022756308317184448,
-0.0897391214966774,
-0.019123487174510956,
-0.029548458755016327,
-0.19369998574256897,
0.1833711713552475,
-0.008959638886153698,
0.41028040647506714,
-0.014948524534702301,
0.798762857913971,
-0.0318855419754982,
-0.25440359115600586,
0.22931215167045593,
-0.14662697911262512,
0.12323306500911713,
-0.17211034893989563,
-0.19774989783763885,
-0.14589695632457733,
-0.1796693056821823,
0.01971692591905594,
0.16596244275569916,
-0.19553691148757935,
-0.3465653359889984,
0.05392392724752426,
0.1599920094013214,
-0.5008524656295776,
-0.09666746854782104,
0.005710741505026817,
0.03130955994129181,
-0.029975377023220062,
0.07297034561634064,
-0.1866912543773651,
0.020845681428909302,
-0.11698275804519653,
0.25926172733306885,
0.011249195784330368,
-0.24125003814697266,
0.052946560084819794,
-0.008065260946750641,
-0.32838746905326843,
-0.1863299459218979,
0.37191295623779297,
0.3340013325214386,
0.18187983334064484,
0.13266804814338684,
-0.22371815145015717,
0.04787983000278473,
-0.18976379930973053,
0.5876075625419617,
-0.07529609650373459,
-0.18781493604183197,
0.06809017062187195,
0.33661261200904846,
-0.48128384351730347,
-0.19534999132156372,
0.03727525472640991,
0.06161653995513916,
0.10892312228679657,
0.36020177602767944,
-0.46826985478401184,
-0.06015139818191528,
0.26079705357551575,
0.1457449048757553,
-0.037366773933172226,
-0.19686247408390045,
-0.23995639383792877,
-0.3020974397659302,
-0.5180811882019043,
-0.12044651806354523,
0.010445214807987213,
0.3553823232650757,
-0.05207039415836334,
-0.14312347769737244,
-0.24309277534484863,
-0.0629151314496994,
-0.07192282378673553,
0.11399300396442413,
0.38915520906448364,
-0.28113752603530884,
-0.03497764468193054,
-0.07253988087177277,
0.30260801315307617,
0.5191702246665955,
0.5508562326431274,
0.23990261554718018,
-0.28244853019714355,
-0.1215737834572792,
-0.007815096527338028,
0.07648930698633194,
0.051180675625801086,
-0.20661547780036926,
0.24853381514549255,
-0.013260000385344028,
-0.18310946226119995,
0.09145965427160263,
0.03734813258051872,
0.45601990818977356,
-0.13083438575267792,
-0.22155031561851501,
0.1258763074874878,
0.5697636008262634,
-0.024999305605888367,
0.032958969473838806,
0.5323403477668762,
0.29262059926986694,
-0.1286107897758484,
0.22773629426956177,
0.1545148342847824,
0.955633282661438,
-0.0044729746878147125,
0.1984023153781891,
0.8571939468383789,
-0.22391170263290405,
0.10521820187568665,
0.038013651967048645,
0.04110762104392052,
-0.5667829513549805,
0.2865973114967346,
0.036597445607185364,
-0.21045374870300293,
-0.04225470870733261,
-0.017735499888658524,
-0.14965087175369263,
-0.14238804578781128,
-0.33277779817581177,
0.5481413006782532,
0.01905268058180809,
0.18991999328136444,
-0.0817129835486412,
0.01924613118171692,
-0.1063026562333107,
0.07306313514709473,
-0.07803705334663391,
-0.2591038644313812,
-0.2297443151473999,
-0.1807204931974411,
-0.1883891224861145,
-0.22765910625457764,
0.003958210349082947,
0.2990093529224396,
-0.24972692131996155,
0.3656841516494751,
0.05120248347520828,
-0.28540030121803284,
0.004141569137573242,
0.11478035897016525,
-0.04065922647714615,
-0.3092220425605774,
-0.0828159973025322,
0.30769577622413635,
0.1588989794254303,
-0.1734340786933899,
-0.14520463347434998,
-0.20108172297477722,
0.17549043893814087,
-0.16989102959632874,
-0.1298629343509674,
0.18978075683116913,
-0.09352460503578186,
-0.31040292978286743,
-0.09871438890695572,
0.14499913156032562,
0.18896915018558502,
-0.23196136951446533,
-0.2190030813217163,
-0.25536632537841797,
-0.054262883961200714,
-0.3031585216522217,
0.08296908438205719,
-0.17297792434692383,
0.12651558220386505,
-0.0011507142335176468,
0.0627068281173706,
-0.1987287700176239,
0.06281179189682007,
0.11082468926906586,
-0.05658240616321564,
0.18367040157318115,
0.6801491975784302,
0.10039064288139343,
-0.13233330845832825,
-0.13857565820217133,
-0.07057762145996094,
0.3419874906539917,
-0.7385729551315308,
0.06928405165672302,
-0.096145860850811,
0.021502628922462463,
0.016130510717630386,
0.41193339228630066,
0.2290061116218567,
0.26523643732070923,
-0.06496630609035492,
-0.3506760597229004,
-0.36191099882125854,
0.41259869933128357,
-0.007398813031613827,
0.15897811949253082,
0.3024086356163025,
0.20944827795028687,
-0.2873428761959076,
0.09834419190883636,
-0.25900572538375854,
0.08116099238395691,
0.06495694071054459,
0.04598744586110115,
-0.4265921413898468,
-0.01901625096797943,
0.08032412827014923,
-0.05940477177500725,
0.11726560443639755,
0.11558686941862106,
0.010643094778060913,
-0.20991268754005432,
-0.11220046132802963,
0.13259471952915192,
0.1762487292289734,
-0.021848401054739952,
-0.06513998657464981,
-0.11233150959014893,
0.09174229204654694,
0.07821574807167053,
0.021301761269569397,
-0.17251349985599518,
-0.11292403936386108,
-0.10445425659418106,
0.2896738350391388,
0.02035953477025032,
-0.4042224586009979,
0.13272210955619812,
-0.030922014266252518,
0.12274264544248581,
0.009871497750282288,
0.26979392766952515,
-0.23091137409210205,
0.12099944800138474,
0.007589280605316162,
0.09182889014482498,
0.21698805689811707,
0.020766671746969223,
0.2068517506122589,
-0.6174875497817993,
-0.15964241325855255,
-0.13168704509735107,
0.309469610452652,
0.3559596538543701,
-0.427062064409256,
-0.09717297554016113,
-0.04422420263290405,
0.21340127289295197,
-0.33639463782310486,
-0.05895724147558212,
-0.09330203384160995,
-0.10206471383571625,
-0.006172731518745422,
-0.0037226080894470215,
0.18802721798419952,
-0.17842406034469604,
-0.15210187435150146,
0.1530742645263672,
0.13091468811035156,
-0.017243796959519386,
0.08648908138275146,
0.5139757394790649,
-0.07253710925579071,
-0.06068848446011543,
0.5155545473098755,
0.18534702062606812,
0.17127317190170288,
0.12307986617088318,
-0.12951374053955078,
0.2077466994524002,
0.05080963298678398,
-0.22884979844093323,
0.21706528961658478,
-0.05067844316363335,
0.19073735177516937,
0.12308456003665924,
0.289934366941452,
-0.25049880146980286,
0.5003089904785156,
0.575588583946228,
0.401724636554718,
-0.466316819190979,
0.11790130287408829,
0.14847756922245026,
-0.09511393308639526,
0.1866244524717331,
-0.45721369981765747,
-0.21642321348190308,
-0.04178231954574585,
-0.07312672585248947,
-0.19703473150730133,
-0.07729646563529968,
0.33033487200737,
0.29047471284866333,
-0.18298549950122833,
-0.5211774706840515,
0.4125295877456665,
0.4564443826675415,
0.1373567283153534,
-0.21868698298931122,
0.395152747631073,
0.3198084235191345,
-0.3118780553340912,
0.023535462096333504,
0.3192533552646637,
0.6272238492965698,
0.4473523199558258,
-0.258579820394516,
-0.20290163159370422,
-0.1657514125108719,
-0.1475560963153839,
0.13042402267456055,
0.041282083839178085,
0.31560254096984863,
0.1289389729499817,
0.1929279863834381,
0.17898298799991608,
-0.12951210141181946,
-0.061141062527894974,
0.12698690593242645,
0.25977203249931335,
-0.07240292429924011,
-0.0752703920006752,
-0.2499585598707199,
-0.31426382064819336,
0.07938362658023834,
0.07239365577697754,
-0.26402485370635986,
0.14668214321136475,
0.43008482456207275,
0.23760180175304413,
0.10937031358480453,
-0.23382879793643951,
0.07903211563825607,
0.23535819351673126,
0.36842015385627747,
0.2705842852592468,
0.13893097639083862,
-0.1374540776014328,
-0.1568821519613266,
-0.5033832788467407,
0.477516770362854,
-0.19568607211112976,
0.09960469603538513,
0.26566004753112793,
0.2177058607339859,
0.05110740661621094,
0.1343696564435959,
0.6175758838653564,
0.11863021552562714,
0.17163239419460297,
0.0982951745390892,
-0.2019122838973999,
0.100876085460186,
0.14891637861728668,
-0.22221581637859344,
0.017268821597099304,
-0.39717939496040344,
0.2679970860481262,
-0.11225526034832001,
0.08720976114273071,
-0.26099997758865356,
-0.1996195912361145,
0.2643544673919678,
-0.2865806519985199,
0.33671891689300537,
0.03994949907064438,
0.47781217098236084,
-0.1051688939332962,
-0.202606201171875,
-0.13109298050403595,
-0.272953599691391,
-0.4558553099632263,
0.3419257700443268,
-0.01704096794128418,
0.20281076431274414,
-0.014016497880220413,
-0.07154650241136551,
-0.2358342558145523,
0.12170659750699997,
-0.18372827768325806,
-0.2935437858104706,
-0.2572168707847595,
-0.017186786979436874,
-0.05068374052643776,
0.01941804215312004,
-0.052788145840168,
0.19951529800891876,
0.11069390922784805,
0.2086472511291504,
-0.34245193004608154,
-0.4723905920982361,
0.42348015308380127,
-0.2783378064632416,
-0.4114033579826355,
0.15224847197532654,
0.0033657103776931763,
0.3836362957954407,
0.06392055004835129,
-0.4184325337409973,
-0.11769618093967438,
0.3167244493961334,
-0.05837753415107727,
0.014603711664676666,
0.10304030776023865,
0.047853734344244,
0.12813541293144226,
-0.1067143976688385,
0.25256428122520447,
0.12266169488430023,
0.05245770514011383,
-0.11069352924823761,
-0.3016446530818939
] |
https://github.com/huggingface/datasets/issues/5692 | > Hi! The link pointing to the code that generated the dataset is broken. Can you please fix it to make debugging easier?
Sorry about that, it's fixed now.
| pyarrow.lib.ArrowInvalid: Unable to merge: Field <field> has incompatible types | ### Describe the bug
When loading the dataset [wikianc-en](https://huggingface.co/datasets/cyanic-selkie/wikianc-en) which I created using [this](https://github.com/cyanic-selkie/wikianc) code, I get the following error:
```
Traceback (most recent call last):
File "/home/sven/code/rector/answer-detection/train.py", line 106, in <module>
(dataset, weights) = get_dataset(args.dataset, tokenizer, labels, args.padding)
File "/home/sven/code/rector/answer-detection/dataset.py", line 106, in get_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en")
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/load.py", line 1794, in load_dataset
ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1106, in as_dataset
datasets = map_nested(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 443, in map_nested
mapped = [
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 444, in <listcomp>
_single_map_nested((function, obj, types, None, True, None))
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 346, in _single_map_nested
return function(data_struct)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1136, in _build_single_dataset
ds = self._as_dataset(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1207, in _as_dataset
dataset_kwargs = ArrowReader(cache_dir, self.info).read(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 239, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 260, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 203, in _read_files
pa_table = concat_tables(pa_tables) if len(pa_tables) != 1 else pa_tables[0]
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1808, in concat_tables
return ConcatenationTable.from_tables(tables, axis=axis)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1514, in from_tables
return cls.from_blocks(blocks)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1427, in from_blocks
table = cls._concat_blocks(blocks, axis=0)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1373, in _concat_blocks
return pa.concat_tables(pa_tables, promote=True)
File "pyarrow/table.pxi", line 5224, in pyarrow.lib.concat_tables
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Unable to merge: Field paragraph_anchors has incompatible types: list<: struct<start: uint32 not null, end: uint32 not null, qid: uint32, pageid: uint32, title: string not null> not null> vs list<item: struct<start: uint32, end: uint32, qid: uint32, pageid: uint32, title: string>>
```
This only happens when I load the `train` split, indicating that the size of the dataset is the deciding factor.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en", split="train")
```
### Expected behavior
The dataset should load normally without any errors.
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-6.2.8-arch1-1-x86_64-with-glibc2.37
- Python version: 3.10.10
- PyArrow version: 11.0.0
- Pandas version: 1.5.3 | 29 | pyarrow.lib.ArrowInvalid: Unable to merge: Field <field> has incompatible types
### Describe the bug
When loading the dataset [wikianc-en](https://huggingface.co/datasets/cyanic-selkie/wikianc-en) which I created using [this](https://github.com/cyanic-selkie/wikianc) code, I get the following error:
```
Traceback (most recent call last):
File "/home/sven/code/rector/answer-detection/train.py", line 106, in <module>
(dataset, weights) = get_dataset(args.dataset, tokenizer, labels, args.padding)
File "/home/sven/code/rector/answer-detection/dataset.py", line 106, in get_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en")
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/load.py", line 1794, in load_dataset
ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1106, in as_dataset
datasets = map_nested(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 443, in map_nested
mapped = [
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 444, in <listcomp>
_single_map_nested((function, obj, types, None, True, None))
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 346, in _single_map_nested
return function(data_struct)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1136, in _build_single_dataset
ds = self._as_dataset(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1207, in _as_dataset
dataset_kwargs = ArrowReader(cache_dir, self.info).read(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 239, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 260, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 203, in _read_files
pa_table = concat_tables(pa_tables) if len(pa_tables) != 1 else pa_tables[0]
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1808, in concat_tables
return ConcatenationTable.from_tables(tables, axis=axis)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1514, in from_tables
return cls.from_blocks(blocks)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1427, in from_blocks
table = cls._concat_blocks(blocks, axis=0)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1373, in _concat_blocks
return pa.concat_tables(pa_tables, promote=True)
File "pyarrow/table.pxi", line 5224, in pyarrow.lib.concat_tables
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Unable to merge: Field paragraph_anchors has incompatible types: list<: struct<start: uint32 not null, end: uint32 not null, qid: uint32, pageid: uint32, title: string not null> not null> vs list<item: struct<start: uint32, end: uint32, qid: uint32, pageid: uint32, title: string>>
```
This only happens when I load the `train` split, indicating that the size of the dataset is the deciding factor.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en", split="train")
```
### Expected behavior
The dataset should load normally without any errors.
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-6.2.8-arch1-1-x86_64-with-glibc2.37
- Python version: 3.10.10
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
> Hi! The link pointing to the code that generated the dataset is broken. Can you please fix it to make debugging easier?
Sorry about that, it's fixed now.
| [
-0.2805249094963074,
0.09721410274505615,
-0.010183371603488922,
0.40840592980384827,
0.1494453102350235,
0.06983813643455505,
0.20628100633621216,
0.5558909177780151,
-0.2604309320449829,
-0.011714830994606018,
-0.03858485817909241,
0.6745288372039795,
0.05063933506608009,
-0.11226508021354675,
-0.18011558055877686,
0.05612685903906822,
0.051824990659952164,
0.22459642589092255,
-0.17221274971961975,
0.04517143964767456,
-0.21938717365264893,
0.019802821800112724,
-0.17079420387744904,
0.23620453476905823,
-0.24669858813285828,
-0.2392963171005249,
0.1450224071741104,
0.2811068296432495,
-0.2901458740234375,
-0.5820426344871521,
0.32738611102104187,
-0.22757792472839355,
-0.11271628737449646,
0.21473240852355957,
-0.00011655344860628247,
0.1178947314620018,
0.5897098183631897,
0.2304733693599701,
-0.29012244939804077,
-0.13319078087806702,
-0.025138914585113525,
0.01019328087568283,
0.2890773415565491,
-0.10326239466667175,
0.2928190231323242,
-0.4270164966583252,
-0.27329492568969727,
0.009804435074329376,
0.05866799131035805,
0.28049787878990173,
0.16709986329078674,
0.42194318771362305,
0.4241899847984314,
0.04944324493408203,
0.3522590696811676,
-0.04177304729819298,
0.06171712279319763,
0.3433992266654968,
0.14063403010368347,
-0.07862365990877151,
0.2664812207221985,
0.06186046823859215,
-0.0011341273784637451,
-0.2022867500782013,
0.2845589220523834,
-0.18069934844970703,
-0.050393443554639816,
-0.24394011497497559,
-0.06976811587810516,
0.05107260122895241,
0.18225330114364624,
-0.3696192800998688,
-0.12242267280817032,
0.07568653672933578,
0.17244303226470947,
-0.2561717927455902,
0.23695147037506104,
0.08965767920017242,
-0.1013035923242569,
0.11942008137702942,
0.1009407639503479,
0.1068328469991684,
-0.2211434245109558,
0.27185434103012085,
-0.15967512130737305,
0.38214871287345886,
0.2471078634262085,
0.2811359763145447,
0.014969983138144016,
-0.10734324157238007,
0.250547856092453,
-0.09932820498943329,
-0.23028859496116638,
0.02205902710556984,
-0.2895309031009674,
-0.1330741047859192,
-0.341402143239975,
0.07927781343460083,
0.197422593832016,
-0.02036702260375023,
0.002242792397737503,
-0.10333314538002014,
0.2760816812515259,
0.3583819568157196,
0.20826789736747742,
0.034108519554138184,
-0.03402366489171982,
0.15350311994552612,
0.08144985139369965,
-0.04960152134299278,
0.034794360399246216,
0.18608850240707397,
-0.18437176942825317,
-0.39930373430252075,
0.13665151596069336,
-0.08370788395404816,
0.42032530903816223,
0.029101349413394928,
-0.42175784707069397,
-0.021606698632240295,
-0.39149010181427,
0.0017580054700374603,
0.11320099234580994,
0.3697870075702667,
0.034491945058107376,
0.22917728126049042,
-0.08260026574134827,
0.3244776725769043,
0.07117686420679092,
-0.23562437295913696,
-0.04831912741065025,
0.0054743848741054535,
-0.0811399295926094,
-0.12787222862243652,
0.10012222081422806,
-0.14847277104854584,
0.03875184804201126,
0.3723870515823364,
0.1329813301563263,
0.032785117626190186,
-0.0588047169148922,
-0.06992287188768387,
-0.05724138021469116,
0.21614232659339905,
-0.11396899074316025,
0.11844737827777863,
0.1918967068195343,
-0.21551883220672607,
-0.13088178634643555,
0.24357616901397705,
-0.2250734269618988,
-0.26642704010009766,
-0.4479329586029053,
0.2165040522813797,
0.21837426722049713,
-0.16196294128894806,
-0.05271990969777107,
0.045444946736097336,
0.25191017985343933,
-0.277621328830719,
0.10849808156490326,
-0.142408549785614,
0.08053566515445709,
-0.4153742790222168,
0.14927133917808533,
-0.17377996444702148,
-0.6322271227836609,
-0.03600310534238815,
-0.0780041292309761,
0.04708150029182434,
-0.1614866405725479,
0.22766098380088806,
-0.49806714057922363,
0.13009217381477356,
-0.09243860840797424,
0.374860942363739,
0.4141618013381958,
-0.4940008521080017,
-0.5556289553642273,
-0.09876886010169983,
0.073496013879776,
-0.1125347763299942,
0.028886565938591957,
-0.04602626711130142,
-0.03645618259906769,
-0.0010994337499141693,
-0.06970043480396271,
0.3525669276714325,
-0.1990693360567093,
-0.08479973673820496,
-0.3005053400993347,
-0.4088733494281769,
0.36437031626701355,
0.13155078887939453,
0.09027603268623352,
-0.23659071326255798,
0.2952375113964081,
-0.45968887209892273,
0.12350357323884964,
-0.17304742336273193,
0.05838135629892349,
0.15070943534374237,
0.2092573046684265,
-0.09757940471172333,
0.1514662355184555,
-0.11910393834114075,
-0.6455629467964172,
0.09856367856264114,
-0.4016658365726471,
-0.02046135440468788,
-0.49088895320892334,
-0.2702796757221222,
-0.3079413175582886,
0.15385091304779053,
-0.25793135166168213,
0.13175341486930847,
0.12937524914741516,
-0.0699610710144043,
-0.18740999698638916,
-0.0367407463490963,
-0.2560194730758667,
-0.27959704399108887,
0.03376110643148422,
0.142179936170578,
-0.12595251202583313,
0.3754669427871704,
-0.3712630569934845,
-0.232301265001297,
-0.20842424035072327,
0.246822789311409,
0.20961326360702515,
0.059498876333236694,
-0.10185934603214264,
0.4523555040359497,
-0.20680837333202362,
0.29023629426956177,
-0.09592460840940475,
-0.1255692094564438,
0.24385400116443634,
-0.4258055090904236,
-0.12492357939481735,
0.012456502765417099,
0.14320969581604004,
-0.03382263332605362,
0.30401578545570374,
0.1926567703485489,
0.07509462535381317,
0.2701578736305237,
0.04312938451766968,
-0.09947340190410614,
0.06511339545249939,
0.05495310574769974,
0.0610990971326828,
0.01082109659910202,
-0.11647360771894455,
0.1211426854133606,
0.40850162506103516,
0.17182062566280365,
-0.2261762022972107,
0.24592173099517822,
0.4758453965187073,
0.03003518283367157,
0.04880805313587189,
-0.07515819370746613,
-0.3270900249481201,
-0.02401016652584076,
0.10820481181144714,
-0.052551545202732086,
0.3114812970161438,
0.23333033919334412,
-0.30944469571113586,
0.026720518246293068,
-0.11515772342681885,
0.020407982170581818,
0.3276251554489136,
0.28367239236831665,
0.5039348602294922,
0.43467187881469727,
0.4090934693813324,
0.15100018680095673,
-0.23093822598457336,
0.22423383593559265,
0.17997100949287415,
0.10664553195238113,
-0.28316235542297363,
0.23498943448066711,
-0.33338314294815063,
0.09905806183815002,
-0.23152410984039307,
-0.4866984784603119,
-0.20980583131313324,
-0.19585952162742615,
0.018451716750860214,
0.3519749343395233,
-0.05227909982204437,
0.2953355610370636,
0.06825850903987885,
0.17575009167194366,
0.25046613812446594,
-0.1121440976858139,
-0.39343225955963135,
-0.2317080795764923,
-0.3114180564880371,
0.04076195880770683,
0.4841529130935669,
-0.23373833298683167,
0.2595258355140686,
0.17009788751602173,
0.019579261541366577,
-0.13230960071086884,
-0.5497908592224121,
0.16049498319625854,
-0.10840636491775513,
0.19024568796157837,
0.11073824763298035,
0.0667678639292717,
-0.1426233947277069,
-0.5507011413574219,
0.41317111253738403,
-0.14313656091690063,
-0.34209179878234863,
0.20194149017333984,
-0.3022468388080597,
-0.04356587305665016,
-0.03566350042819977,
-0.3527362048625946,
-0.33615225553512573,
-0.30958765745162964,
-0.030955523252487183,
-0.018699705600738525,
0.057239413261413574,
0.09943832457065582,
0.3169410824775696,
-0.015189465135335922,
-0.20841073989868164,
-0.07954493165016174,
-0.14484520256519318,
0.16177241504192352,
0.26311802864074707,
-0.1541561335325241,
-0.21813470125198364,
0.036447517573833466,
-0.21221888065338135,
0.25414425134658813,
0.17194195091724396,
-0.06042742729187012,
0.10523559153079987,
-0.07237479835748672,
0.5506565570831299,
-0.12302844971418381,
-0.16353099048137665,
0.4070304334163666,
0.19689230620861053,
-0.00022756308317184448,
-0.0897391214966774,
-0.019123487174510956,
-0.029548458755016327,
-0.19369998574256897,
0.1833711713552475,
-0.008959638886153698,
0.41028040647506714,
-0.014948524534702301,
0.798762857913971,
-0.0318855419754982,
-0.25440359115600586,
0.22931215167045593,
-0.14662697911262512,
0.12323306500911713,
-0.17211034893989563,
-0.19774989783763885,
-0.14589695632457733,
-0.1796693056821823,
0.01971692591905594,
0.16596244275569916,
-0.19553691148757935,
-0.3465653359889984,
0.05392392724752426,
0.1599920094013214,
-0.5008524656295776,
-0.09666746854782104,
0.005710741505026817,
0.03130955994129181,
-0.029975377023220062,
0.07297034561634064,
-0.1866912543773651,
0.020845681428909302,
-0.11698275804519653,
0.25926172733306885,
0.011249195784330368,
-0.24125003814697266,
0.052946560084819794,
-0.008065260946750641,
-0.32838746905326843,
-0.1863299459218979,
0.37191295623779297,
0.3340013325214386,
0.18187983334064484,
0.13266804814338684,
-0.22371815145015717,
0.04787983000278473,
-0.18976379930973053,
0.5876075625419617,
-0.07529609650373459,
-0.18781493604183197,
0.06809017062187195,
0.33661261200904846,
-0.48128384351730347,
-0.19534999132156372,
0.03727525472640991,
0.06161653995513916,
0.10892312228679657,
0.36020177602767944,
-0.46826985478401184,
-0.06015139818191528,
0.26079705357551575,
0.1457449048757553,
-0.037366773933172226,
-0.19686247408390045,
-0.23995639383792877,
-0.3020974397659302,
-0.5180811882019043,
-0.12044651806354523,
0.010445214807987213,
0.3553823232650757,
-0.05207039415836334,
-0.14312347769737244,
-0.24309277534484863,
-0.0629151314496994,
-0.07192282378673553,
0.11399300396442413,
0.38915520906448364,
-0.28113752603530884,
-0.03497764468193054,
-0.07253988087177277,
0.30260801315307617,
0.5191702246665955,
0.5508562326431274,
0.23990261554718018,
-0.28244853019714355,
-0.1215737834572792,
-0.007815096527338028,
0.07648930698633194,
0.051180675625801086,
-0.20661547780036926,
0.24853381514549255,
-0.013260000385344028,
-0.18310946226119995,
0.09145965427160263,
0.03734813258051872,
0.45601990818977356,
-0.13083438575267792,
-0.22155031561851501,
0.1258763074874878,
0.5697636008262634,
-0.024999305605888367,
0.032958969473838806,
0.5323403477668762,
0.29262059926986694,
-0.1286107897758484,
0.22773629426956177,
0.1545148342847824,
0.955633282661438,
-0.0044729746878147125,
0.1984023153781891,
0.8571939468383789,
-0.22391170263290405,
0.10521820187568665,
0.038013651967048645,
0.04110762104392052,
-0.5667829513549805,
0.2865973114967346,
0.036597445607185364,
-0.21045374870300293,
-0.04225470870733261,
-0.017735499888658524,
-0.14965087175369263,
-0.14238804578781128,
-0.33277779817581177,
0.5481413006782532,
0.01905268058180809,
0.18991999328136444,
-0.0817129835486412,
0.01924613118171692,
-0.1063026562333107,
0.07306313514709473,
-0.07803705334663391,
-0.2591038644313812,
-0.2297443151473999,
-0.1807204931974411,
-0.1883891224861145,
-0.22765910625457764,
0.003958210349082947,
0.2990093529224396,
-0.24972692131996155,
0.3656841516494751,
0.05120248347520828,
-0.28540030121803284,
0.004141569137573242,
0.11478035897016525,
-0.04065922647714615,
-0.3092220425605774,
-0.0828159973025322,
0.30769577622413635,
0.1588989794254303,
-0.1734340786933899,
-0.14520463347434998,
-0.20108172297477722,
0.17549043893814087,
-0.16989102959632874,
-0.1298629343509674,
0.18978075683116913,
-0.09352460503578186,
-0.31040292978286743,
-0.09871438890695572,
0.14499913156032562,
0.18896915018558502,
-0.23196136951446533,
-0.2190030813217163,
-0.25536632537841797,
-0.054262883961200714,
-0.3031585216522217,
0.08296908438205719,
-0.17297792434692383,
0.12651558220386505,
-0.0011507142335176468,
0.0627068281173706,
-0.1987287700176239,
0.06281179189682007,
0.11082468926906586,
-0.05658240616321564,
0.18367040157318115,
0.6801491975784302,
0.10039064288139343,
-0.13233330845832825,
-0.13857565820217133,
-0.07057762145996094,
0.3419874906539917,
-0.7385729551315308,
0.06928405165672302,
-0.096145860850811,
0.021502628922462463,
0.016130510717630386,
0.41193339228630066,
0.2290061116218567,
0.26523643732070923,
-0.06496630609035492,
-0.3506760597229004,
-0.36191099882125854,
0.41259869933128357,
-0.007398813031613827,
0.15897811949253082,
0.3024086356163025,
0.20944827795028687,
-0.2873428761959076,
0.09834419190883636,
-0.25900572538375854,
0.08116099238395691,
0.06495694071054459,
0.04598744586110115,
-0.4265921413898468,
-0.01901625096797943,
0.08032412827014923,
-0.05940477177500725,
0.11726560443639755,
0.11558686941862106,
0.010643094778060913,
-0.20991268754005432,
-0.11220046132802963,
0.13259471952915192,
0.1762487292289734,
-0.021848401054739952,
-0.06513998657464981,
-0.11233150959014893,
0.09174229204654694,
0.07821574807167053,
0.021301761269569397,
-0.17251349985599518,
-0.11292403936386108,
-0.10445425659418106,
0.2896738350391388,
0.02035953477025032,
-0.4042224586009979,
0.13272210955619812,
-0.030922014266252518,
0.12274264544248581,
0.009871497750282288,
0.26979392766952515,
-0.23091137409210205,
0.12099944800138474,
0.007589280605316162,
0.09182889014482498,
0.21698805689811707,
0.020766671746969223,
0.2068517506122589,
-0.6174875497817993,
-0.15964241325855255,
-0.13168704509735107,
0.309469610452652,
0.3559596538543701,
-0.427062064409256,
-0.09717297554016113,
-0.04422420263290405,
0.21340127289295197,
-0.33639463782310486,
-0.05895724147558212,
-0.09330203384160995,
-0.10206471383571625,
-0.006172731518745422,
-0.0037226080894470215,
0.18802721798419952,
-0.17842406034469604,
-0.15210187435150146,
0.1530742645263672,
0.13091468811035156,
-0.017243796959519386,
0.08648908138275146,
0.5139757394790649,
-0.07253710925579071,
-0.06068848446011543,
0.5155545473098755,
0.18534702062606812,
0.17127317190170288,
0.12307986617088318,
-0.12951374053955078,
0.2077466994524002,
0.05080963298678398,
-0.22884979844093323,
0.21706528961658478,
-0.05067844316363335,
0.19073735177516937,
0.12308456003665924,
0.289934366941452,
-0.25049880146980286,
0.5003089904785156,
0.575588583946228,
0.401724636554718,
-0.466316819190979,
0.11790130287408829,
0.14847756922245026,
-0.09511393308639526,
0.1866244524717331,
-0.45721369981765747,
-0.21642321348190308,
-0.04178231954574585,
-0.07312672585248947,
-0.19703473150730133,
-0.07729646563529968,
0.33033487200737,
0.29047471284866333,
-0.18298549950122833,
-0.5211774706840515,
0.4125295877456665,
0.4564443826675415,
0.1373567283153534,
-0.21868698298931122,
0.395152747631073,
0.3198084235191345,
-0.3118780553340912,
0.023535462096333504,
0.3192533552646637,
0.6272238492965698,
0.4473523199558258,
-0.258579820394516,
-0.20290163159370422,
-0.1657514125108719,
-0.1475560963153839,
0.13042402267456055,
0.041282083839178085,
0.31560254096984863,
0.1289389729499817,
0.1929279863834381,
0.17898298799991608,
-0.12951210141181946,
-0.061141062527894974,
0.12698690593242645,
0.25977203249931335,
-0.07240292429924011,
-0.0752703920006752,
-0.2499585598707199,
-0.31426382064819336,
0.07938362658023834,
0.07239365577697754,
-0.26402485370635986,
0.14668214321136475,
0.43008482456207275,
0.23760180175304413,
0.10937031358480453,
-0.23382879793643951,
0.07903211563825607,
0.23535819351673126,
0.36842015385627747,
0.2705842852592468,
0.13893097639083862,
-0.1374540776014328,
-0.1568821519613266,
-0.5033832788467407,
0.477516770362854,
-0.19568607211112976,
0.09960469603538513,
0.26566004753112793,
0.2177058607339859,
0.05110740661621094,
0.1343696564435959,
0.6175758838653564,
0.11863021552562714,
0.17163239419460297,
0.0982951745390892,
-0.2019122838973999,
0.100876085460186,
0.14891637861728668,
-0.22221581637859344,
0.017268821597099304,
-0.39717939496040344,
0.2679970860481262,
-0.11225526034832001,
0.08720976114273071,
-0.26099997758865356,
-0.1996195912361145,
0.2643544673919678,
-0.2865806519985199,
0.33671891689300537,
0.03994949907064438,
0.47781217098236084,
-0.1051688939332962,
-0.202606201171875,
-0.13109298050403595,
-0.272953599691391,
-0.4558553099632263,
0.3419257700443268,
-0.01704096794128418,
0.20281076431274414,
-0.014016497880220413,
-0.07154650241136551,
-0.2358342558145523,
0.12170659750699997,
-0.18372827768325806,
-0.2935437858104706,
-0.2572168707847595,
-0.017186786979436874,
-0.05068374052643776,
0.01941804215312004,
-0.052788145840168,
0.19951529800891876,
0.11069390922784805,
0.2086472511291504,
-0.34245193004608154,
-0.4723905920982361,
0.42348015308380127,
-0.2783378064632416,
-0.4114033579826355,
0.15224847197532654,
0.0033657103776931763,
0.3836362957954407,
0.06392055004835129,
-0.4184325337409973,
-0.11769618093967438,
0.3167244493961334,
-0.05837753415107727,
0.014603711664676666,
0.10304030776023865,
0.047853734344244,
0.12813541293144226,
-0.1067143976688385,
0.25256428122520447,
0.12266169488430023,
0.05245770514011383,
-0.11069352924823761,
-0.3016446530818939
] |
https://github.com/huggingface/datasets/issues/5692 | @cyanic-selkie could you explain how you fixed it? I met the same error in loading other datasets, is it due to the version of the library enviroment? | pyarrow.lib.ArrowInvalid: Unable to merge: Field <field> has incompatible types | ### Describe the bug
When loading the dataset [wikianc-en](https://huggingface.co/datasets/cyanic-selkie/wikianc-en) which I created using [this](https://github.com/cyanic-selkie/wikianc) code, I get the following error:
```
Traceback (most recent call last):
File "/home/sven/code/rector/answer-detection/train.py", line 106, in <module>
(dataset, weights) = get_dataset(args.dataset, tokenizer, labels, args.padding)
File "/home/sven/code/rector/answer-detection/dataset.py", line 106, in get_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en")
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/load.py", line 1794, in load_dataset
ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1106, in as_dataset
datasets = map_nested(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 443, in map_nested
mapped = [
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 444, in <listcomp>
_single_map_nested((function, obj, types, None, True, None))
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 346, in _single_map_nested
return function(data_struct)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1136, in _build_single_dataset
ds = self._as_dataset(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1207, in _as_dataset
dataset_kwargs = ArrowReader(cache_dir, self.info).read(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 239, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 260, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 203, in _read_files
pa_table = concat_tables(pa_tables) if len(pa_tables) != 1 else pa_tables[0]
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1808, in concat_tables
return ConcatenationTable.from_tables(tables, axis=axis)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1514, in from_tables
return cls.from_blocks(blocks)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1427, in from_blocks
table = cls._concat_blocks(blocks, axis=0)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1373, in _concat_blocks
return pa.concat_tables(pa_tables, promote=True)
File "pyarrow/table.pxi", line 5224, in pyarrow.lib.concat_tables
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Unable to merge: Field paragraph_anchors has incompatible types: list<: struct<start: uint32 not null, end: uint32 not null, qid: uint32, pageid: uint32, title: string not null> not null> vs list<item: struct<start: uint32, end: uint32, qid: uint32, pageid: uint32, title: string>>
```
This only happens when I load the `train` split, indicating that the size of the dataset is the deciding factor.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en", split="train")
```
### Expected behavior
The dataset should load normally without any errors.
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-6.2.8-arch1-1-x86_64-with-glibc2.37
- Python version: 3.10.10
- PyArrow version: 11.0.0
- Pandas version: 1.5.3 | 27 | pyarrow.lib.ArrowInvalid: Unable to merge: Field <field> has incompatible types
### Describe the bug
When loading the dataset [wikianc-en](https://huggingface.co/datasets/cyanic-selkie/wikianc-en) which I created using [this](https://github.com/cyanic-selkie/wikianc) code, I get the following error:
```
Traceback (most recent call last):
File "/home/sven/code/rector/answer-detection/train.py", line 106, in <module>
(dataset, weights) = get_dataset(args.dataset, tokenizer, labels, args.padding)
File "/home/sven/code/rector/answer-detection/dataset.py", line 106, in get_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en")
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/load.py", line 1794, in load_dataset
ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1106, in as_dataset
datasets = map_nested(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 443, in map_nested
mapped = [
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 444, in <listcomp>
_single_map_nested((function, obj, types, None, True, None))
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 346, in _single_map_nested
return function(data_struct)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1136, in _build_single_dataset
ds = self._as_dataset(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1207, in _as_dataset
dataset_kwargs = ArrowReader(cache_dir, self.info).read(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 239, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 260, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 203, in _read_files
pa_table = concat_tables(pa_tables) if len(pa_tables) != 1 else pa_tables[0]
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1808, in concat_tables
return ConcatenationTable.from_tables(tables, axis=axis)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1514, in from_tables
return cls.from_blocks(blocks)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1427, in from_blocks
table = cls._concat_blocks(blocks, axis=0)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1373, in _concat_blocks
return pa.concat_tables(pa_tables, promote=True)
File "pyarrow/table.pxi", line 5224, in pyarrow.lib.concat_tables
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Unable to merge: Field paragraph_anchors has incompatible types: list<: struct<start: uint32 not null, end: uint32 not null, qid: uint32, pageid: uint32, title: string not null> not null> vs list<item: struct<start: uint32, end: uint32, qid: uint32, pageid: uint32, title: string>>
```
This only happens when I load the `train` split, indicating that the size of the dataset is the deciding factor.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en", split="train")
```
### Expected behavior
The dataset should load normally without any errors.
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-6.2.8-arch1-1-x86_64-with-glibc2.37
- Python version: 3.10.10
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
@cyanic-selkie could you explain how you fixed it? I met the same error in loading other datasets, is it due to the version of the library enviroment? | [
-0.2805249094963074,
0.09721410274505615,
-0.010183371603488922,
0.40840592980384827,
0.1494453102350235,
0.06983813643455505,
0.20628100633621216,
0.5558909177780151,
-0.2604309320449829,
-0.011714830994606018,
-0.03858485817909241,
0.6745288372039795,
0.05063933506608009,
-0.11226508021354675,
-0.18011558055877686,
0.05612685903906822,
0.051824990659952164,
0.22459642589092255,
-0.17221274971961975,
0.04517143964767456,
-0.21938717365264893,
0.019802821800112724,
-0.17079420387744904,
0.23620453476905823,
-0.24669858813285828,
-0.2392963171005249,
0.1450224071741104,
0.2811068296432495,
-0.2901458740234375,
-0.5820426344871521,
0.32738611102104187,
-0.22757792472839355,
-0.11271628737449646,
0.21473240852355957,
-0.00011655344860628247,
0.1178947314620018,
0.5897098183631897,
0.2304733693599701,
-0.29012244939804077,
-0.13319078087806702,
-0.025138914585113525,
0.01019328087568283,
0.2890773415565491,
-0.10326239466667175,
0.2928190231323242,
-0.4270164966583252,
-0.27329492568969727,
0.009804435074329376,
0.05866799131035805,
0.28049787878990173,
0.16709986329078674,
0.42194318771362305,
0.4241899847984314,
0.04944324493408203,
0.3522590696811676,
-0.04177304729819298,
0.06171712279319763,
0.3433992266654968,
0.14063403010368347,
-0.07862365990877151,
0.2664812207221985,
0.06186046823859215,
-0.0011341273784637451,
-0.2022867500782013,
0.2845589220523834,
-0.18069934844970703,
-0.050393443554639816,
-0.24394011497497559,
-0.06976811587810516,
0.05107260122895241,
0.18225330114364624,
-0.3696192800998688,
-0.12242267280817032,
0.07568653672933578,
0.17244303226470947,
-0.2561717927455902,
0.23695147037506104,
0.08965767920017242,
-0.1013035923242569,
0.11942008137702942,
0.1009407639503479,
0.1068328469991684,
-0.2211434245109558,
0.27185434103012085,
-0.15967512130737305,
0.38214871287345886,
0.2471078634262085,
0.2811359763145447,
0.014969983138144016,
-0.10734324157238007,
0.250547856092453,
-0.09932820498943329,
-0.23028859496116638,
0.02205902710556984,
-0.2895309031009674,
-0.1330741047859192,
-0.341402143239975,
0.07927781343460083,
0.197422593832016,
-0.02036702260375023,
0.002242792397737503,
-0.10333314538002014,
0.2760816812515259,
0.3583819568157196,
0.20826789736747742,
0.034108519554138184,
-0.03402366489171982,
0.15350311994552612,
0.08144985139369965,
-0.04960152134299278,
0.034794360399246216,
0.18608850240707397,
-0.18437176942825317,
-0.39930373430252075,
0.13665151596069336,
-0.08370788395404816,
0.42032530903816223,
0.029101349413394928,
-0.42175784707069397,
-0.021606698632240295,
-0.39149010181427,
0.0017580054700374603,
0.11320099234580994,
0.3697870075702667,
0.034491945058107376,
0.22917728126049042,
-0.08260026574134827,
0.3244776725769043,
0.07117686420679092,
-0.23562437295913696,
-0.04831912741065025,
0.0054743848741054535,
-0.0811399295926094,
-0.12787222862243652,
0.10012222081422806,
-0.14847277104854584,
0.03875184804201126,
0.3723870515823364,
0.1329813301563263,
0.032785117626190186,
-0.0588047169148922,
-0.06992287188768387,
-0.05724138021469116,
0.21614232659339905,
-0.11396899074316025,
0.11844737827777863,
0.1918967068195343,
-0.21551883220672607,
-0.13088178634643555,
0.24357616901397705,
-0.2250734269618988,
-0.26642704010009766,
-0.4479329586029053,
0.2165040522813797,
0.21837426722049713,
-0.16196294128894806,
-0.05271990969777107,
0.045444946736097336,
0.25191017985343933,
-0.277621328830719,
0.10849808156490326,
-0.142408549785614,
0.08053566515445709,
-0.4153742790222168,
0.14927133917808533,
-0.17377996444702148,
-0.6322271227836609,
-0.03600310534238815,
-0.0780041292309761,
0.04708150029182434,
-0.1614866405725479,
0.22766098380088806,
-0.49806714057922363,
0.13009217381477356,
-0.09243860840797424,
0.374860942363739,
0.4141618013381958,
-0.4940008521080017,
-0.5556289553642273,
-0.09876886010169983,
0.073496013879776,
-0.1125347763299942,
0.028886565938591957,
-0.04602626711130142,
-0.03645618259906769,
-0.0010994337499141693,
-0.06970043480396271,
0.3525669276714325,
-0.1990693360567093,
-0.08479973673820496,
-0.3005053400993347,
-0.4088733494281769,
0.36437031626701355,
0.13155078887939453,
0.09027603268623352,
-0.23659071326255798,
0.2952375113964081,
-0.45968887209892273,
0.12350357323884964,
-0.17304742336273193,
0.05838135629892349,
0.15070943534374237,
0.2092573046684265,
-0.09757940471172333,
0.1514662355184555,
-0.11910393834114075,
-0.6455629467964172,
0.09856367856264114,
-0.4016658365726471,
-0.02046135440468788,
-0.49088895320892334,
-0.2702796757221222,
-0.3079413175582886,
0.15385091304779053,
-0.25793135166168213,
0.13175341486930847,
0.12937524914741516,
-0.0699610710144043,
-0.18740999698638916,
-0.0367407463490963,
-0.2560194730758667,
-0.27959704399108887,
0.03376110643148422,
0.142179936170578,
-0.12595251202583313,
0.3754669427871704,
-0.3712630569934845,
-0.232301265001297,
-0.20842424035072327,
0.246822789311409,
0.20961326360702515,
0.059498876333236694,
-0.10185934603214264,
0.4523555040359497,
-0.20680837333202362,
0.29023629426956177,
-0.09592460840940475,
-0.1255692094564438,
0.24385400116443634,
-0.4258055090904236,
-0.12492357939481735,
0.012456502765417099,
0.14320969581604004,
-0.03382263332605362,
0.30401578545570374,
0.1926567703485489,
0.07509462535381317,
0.2701578736305237,
0.04312938451766968,
-0.09947340190410614,
0.06511339545249939,
0.05495310574769974,
0.0610990971326828,
0.01082109659910202,
-0.11647360771894455,
0.1211426854133606,
0.40850162506103516,
0.17182062566280365,
-0.2261762022972107,
0.24592173099517822,
0.4758453965187073,
0.03003518283367157,
0.04880805313587189,
-0.07515819370746613,
-0.3270900249481201,
-0.02401016652584076,
0.10820481181144714,
-0.052551545202732086,
0.3114812970161438,
0.23333033919334412,
-0.30944469571113586,
0.026720518246293068,
-0.11515772342681885,
0.020407982170581818,
0.3276251554489136,
0.28367239236831665,
0.5039348602294922,
0.43467187881469727,
0.4090934693813324,
0.15100018680095673,
-0.23093822598457336,
0.22423383593559265,
0.17997100949287415,
0.10664553195238113,
-0.28316235542297363,
0.23498943448066711,
-0.33338314294815063,
0.09905806183815002,
-0.23152410984039307,
-0.4866984784603119,
-0.20980583131313324,
-0.19585952162742615,
0.018451716750860214,
0.3519749343395233,
-0.05227909982204437,
0.2953355610370636,
0.06825850903987885,
0.17575009167194366,
0.25046613812446594,
-0.1121440976858139,
-0.39343225955963135,
-0.2317080795764923,
-0.3114180564880371,
0.04076195880770683,
0.4841529130935669,
-0.23373833298683167,
0.2595258355140686,
0.17009788751602173,
0.019579261541366577,
-0.13230960071086884,
-0.5497908592224121,
0.16049498319625854,
-0.10840636491775513,
0.19024568796157837,
0.11073824763298035,
0.0667678639292717,
-0.1426233947277069,
-0.5507011413574219,
0.41317111253738403,
-0.14313656091690063,
-0.34209179878234863,
0.20194149017333984,
-0.3022468388080597,
-0.04356587305665016,
-0.03566350042819977,
-0.3527362048625946,
-0.33615225553512573,
-0.30958765745162964,
-0.030955523252487183,
-0.018699705600738525,
0.057239413261413574,
0.09943832457065582,
0.3169410824775696,
-0.015189465135335922,
-0.20841073989868164,
-0.07954493165016174,
-0.14484520256519318,
0.16177241504192352,
0.26311802864074707,
-0.1541561335325241,
-0.21813470125198364,
0.036447517573833466,
-0.21221888065338135,
0.25414425134658813,
0.17194195091724396,
-0.06042742729187012,
0.10523559153079987,
-0.07237479835748672,
0.5506565570831299,
-0.12302844971418381,
-0.16353099048137665,
0.4070304334163666,
0.19689230620861053,
-0.00022756308317184448,
-0.0897391214966774,
-0.019123487174510956,
-0.029548458755016327,
-0.19369998574256897,
0.1833711713552475,
-0.008959638886153698,
0.41028040647506714,
-0.014948524534702301,
0.798762857913971,
-0.0318855419754982,
-0.25440359115600586,
0.22931215167045593,
-0.14662697911262512,
0.12323306500911713,
-0.17211034893989563,
-0.19774989783763885,
-0.14589695632457733,
-0.1796693056821823,
0.01971692591905594,
0.16596244275569916,
-0.19553691148757935,
-0.3465653359889984,
0.05392392724752426,
0.1599920094013214,
-0.5008524656295776,
-0.09666746854782104,
0.005710741505026817,
0.03130955994129181,
-0.029975377023220062,
0.07297034561634064,
-0.1866912543773651,
0.020845681428909302,
-0.11698275804519653,
0.25926172733306885,
0.011249195784330368,
-0.24125003814697266,
0.052946560084819794,
-0.008065260946750641,
-0.32838746905326843,
-0.1863299459218979,
0.37191295623779297,
0.3340013325214386,
0.18187983334064484,
0.13266804814338684,
-0.22371815145015717,
0.04787983000278473,
-0.18976379930973053,
0.5876075625419617,
-0.07529609650373459,
-0.18781493604183197,
0.06809017062187195,
0.33661261200904846,
-0.48128384351730347,
-0.19534999132156372,
0.03727525472640991,
0.06161653995513916,
0.10892312228679657,
0.36020177602767944,
-0.46826985478401184,
-0.06015139818191528,
0.26079705357551575,
0.1457449048757553,
-0.037366773933172226,
-0.19686247408390045,
-0.23995639383792877,
-0.3020974397659302,
-0.5180811882019043,
-0.12044651806354523,
0.010445214807987213,
0.3553823232650757,
-0.05207039415836334,
-0.14312347769737244,
-0.24309277534484863,
-0.0629151314496994,
-0.07192282378673553,
0.11399300396442413,
0.38915520906448364,
-0.28113752603530884,
-0.03497764468193054,
-0.07253988087177277,
0.30260801315307617,
0.5191702246665955,
0.5508562326431274,
0.23990261554718018,
-0.28244853019714355,
-0.1215737834572792,
-0.007815096527338028,
0.07648930698633194,
0.051180675625801086,
-0.20661547780036926,
0.24853381514549255,
-0.013260000385344028,
-0.18310946226119995,
0.09145965427160263,
0.03734813258051872,
0.45601990818977356,
-0.13083438575267792,
-0.22155031561851501,
0.1258763074874878,
0.5697636008262634,
-0.024999305605888367,
0.032958969473838806,
0.5323403477668762,
0.29262059926986694,
-0.1286107897758484,
0.22773629426956177,
0.1545148342847824,
0.955633282661438,
-0.0044729746878147125,
0.1984023153781891,
0.8571939468383789,
-0.22391170263290405,
0.10521820187568665,
0.038013651967048645,
0.04110762104392052,
-0.5667829513549805,
0.2865973114967346,
0.036597445607185364,
-0.21045374870300293,
-0.04225470870733261,
-0.017735499888658524,
-0.14965087175369263,
-0.14238804578781128,
-0.33277779817581177,
0.5481413006782532,
0.01905268058180809,
0.18991999328136444,
-0.0817129835486412,
0.01924613118171692,
-0.1063026562333107,
0.07306313514709473,
-0.07803705334663391,
-0.2591038644313812,
-0.2297443151473999,
-0.1807204931974411,
-0.1883891224861145,
-0.22765910625457764,
0.003958210349082947,
0.2990093529224396,
-0.24972692131996155,
0.3656841516494751,
0.05120248347520828,
-0.28540030121803284,
0.004141569137573242,
0.11478035897016525,
-0.04065922647714615,
-0.3092220425605774,
-0.0828159973025322,
0.30769577622413635,
0.1588989794254303,
-0.1734340786933899,
-0.14520463347434998,
-0.20108172297477722,
0.17549043893814087,
-0.16989102959632874,
-0.1298629343509674,
0.18978075683116913,
-0.09352460503578186,
-0.31040292978286743,
-0.09871438890695572,
0.14499913156032562,
0.18896915018558502,
-0.23196136951446533,
-0.2190030813217163,
-0.25536632537841797,
-0.054262883961200714,
-0.3031585216522217,
0.08296908438205719,
-0.17297792434692383,
0.12651558220386505,
-0.0011507142335176468,
0.0627068281173706,
-0.1987287700176239,
0.06281179189682007,
0.11082468926906586,
-0.05658240616321564,
0.18367040157318115,
0.6801491975784302,
0.10039064288139343,
-0.13233330845832825,
-0.13857565820217133,
-0.07057762145996094,
0.3419874906539917,
-0.7385729551315308,
0.06928405165672302,
-0.096145860850811,
0.021502628922462463,
0.016130510717630386,
0.41193339228630066,
0.2290061116218567,
0.26523643732070923,
-0.06496630609035492,
-0.3506760597229004,
-0.36191099882125854,
0.41259869933128357,
-0.007398813031613827,
0.15897811949253082,
0.3024086356163025,
0.20944827795028687,
-0.2873428761959076,
0.09834419190883636,
-0.25900572538375854,
0.08116099238395691,
0.06495694071054459,
0.04598744586110115,
-0.4265921413898468,
-0.01901625096797943,
0.08032412827014923,
-0.05940477177500725,
0.11726560443639755,
0.11558686941862106,
0.010643094778060913,
-0.20991268754005432,
-0.11220046132802963,
0.13259471952915192,
0.1762487292289734,
-0.021848401054739952,
-0.06513998657464981,
-0.11233150959014893,
0.09174229204654694,
0.07821574807167053,
0.021301761269569397,
-0.17251349985599518,
-0.11292403936386108,
-0.10445425659418106,
0.2896738350391388,
0.02035953477025032,
-0.4042224586009979,
0.13272210955619812,
-0.030922014266252518,
0.12274264544248581,
0.009871497750282288,
0.26979392766952515,
-0.23091137409210205,
0.12099944800138474,
0.007589280605316162,
0.09182889014482498,
0.21698805689811707,
0.020766671746969223,
0.2068517506122589,
-0.6174875497817993,
-0.15964241325855255,
-0.13168704509735107,
0.309469610452652,
0.3559596538543701,
-0.427062064409256,
-0.09717297554016113,
-0.04422420263290405,
0.21340127289295197,
-0.33639463782310486,
-0.05895724147558212,
-0.09330203384160995,
-0.10206471383571625,
-0.006172731518745422,
-0.0037226080894470215,
0.18802721798419952,
-0.17842406034469604,
-0.15210187435150146,
0.1530742645263672,
0.13091468811035156,
-0.017243796959519386,
0.08648908138275146,
0.5139757394790649,
-0.07253710925579071,
-0.06068848446011543,
0.5155545473098755,
0.18534702062606812,
0.17127317190170288,
0.12307986617088318,
-0.12951374053955078,
0.2077466994524002,
0.05080963298678398,
-0.22884979844093323,
0.21706528961658478,
-0.05067844316363335,
0.19073735177516937,
0.12308456003665924,
0.289934366941452,
-0.25049880146980286,
0.5003089904785156,
0.575588583946228,
0.401724636554718,
-0.466316819190979,
0.11790130287408829,
0.14847756922245026,
-0.09511393308639526,
0.1866244524717331,
-0.45721369981765747,
-0.21642321348190308,
-0.04178231954574585,
-0.07312672585248947,
-0.19703473150730133,
-0.07729646563529968,
0.33033487200737,
0.29047471284866333,
-0.18298549950122833,
-0.5211774706840515,
0.4125295877456665,
0.4564443826675415,
0.1373567283153534,
-0.21868698298931122,
0.395152747631073,
0.3198084235191345,
-0.3118780553340912,
0.023535462096333504,
0.3192533552646637,
0.6272238492965698,
0.4473523199558258,
-0.258579820394516,
-0.20290163159370422,
-0.1657514125108719,
-0.1475560963153839,
0.13042402267456055,
0.041282083839178085,
0.31560254096984863,
0.1289389729499817,
0.1929279863834381,
0.17898298799991608,
-0.12951210141181946,
-0.061141062527894974,
0.12698690593242645,
0.25977203249931335,
-0.07240292429924011,
-0.0752703920006752,
-0.2499585598707199,
-0.31426382064819336,
0.07938362658023834,
0.07239365577697754,
-0.26402485370635986,
0.14668214321136475,
0.43008482456207275,
0.23760180175304413,
0.10937031358480453,
-0.23382879793643951,
0.07903211563825607,
0.23535819351673126,
0.36842015385627747,
0.2705842852592468,
0.13893097639083862,
-0.1374540776014328,
-0.1568821519613266,
-0.5033832788467407,
0.477516770362854,
-0.19568607211112976,
0.09960469603538513,
0.26566004753112793,
0.2177058607339859,
0.05110740661621094,
0.1343696564435959,
0.6175758838653564,
0.11863021552562714,
0.17163239419460297,
0.0982951745390892,
-0.2019122838973999,
0.100876085460186,
0.14891637861728668,
-0.22221581637859344,
0.017268821597099304,
-0.39717939496040344,
0.2679970860481262,
-0.11225526034832001,
0.08720976114273071,
-0.26099997758865356,
-0.1996195912361145,
0.2643544673919678,
-0.2865806519985199,
0.33671891689300537,
0.03994949907064438,
0.47781217098236084,
-0.1051688939332962,
-0.202606201171875,
-0.13109298050403595,
-0.272953599691391,
-0.4558553099632263,
0.3419257700443268,
-0.01704096794128418,
0.20281076431274414,
-0.014016497880220413,
-0.07154650241136551,
-0.2358342558145523,
0.12170659750699997,
-0.18372827768325806,
-0.2935437858104706,
-0.2572168707847595,
-0.017186786979436874,
-0.05068374052643776,
0.01941804215312004,
-0.052788145840168,
0.19951529800891876,
0.11069390922784805,
0.2086472511291504,
-0.34245193004608154,
-0.4723905920982361,
0.42348015308380127,
-0.2783378064632416,
-0.4114033579826355,
0.15224847197532654,
0.0033657103776931763,
0.3836362957954407,
0.06392055004835129,
-0.4184325337409973,
-0.11769618093967438,
0.3167244493961334,
-0.05837753415107727,
0.014603711664676666,
0.10304030776023865,
0.047853734344244,
0.12813541293144226,
-0.1067143976688385,
0.25256428122520447,
0.12266169488430023,
0.05245770514011383,
-0.11069352924823761,
-0.3016446530818939
] |
https://github.com/huggingface/datasets/issues/5692 | @MingsYang I never fixed it. If you're referring to my comment above, I only meant I fixed the link to my code.
Anyway, I managed to work around the issue by using `streaming` when loading the dataset. | pyarrow.lib.ArrowInvalid: Unable to merge: Field <field> has incompatible types | ### Describe the bug
When loading the dataset [wikianc-en](https://huggingface.co/datasets/cyanic-selkie/wikianc-en) which I created using [this](https://github.com/cyanic-selkie/wikianc) code, I get the following error:
```
Traceback (most recent call last):
File "/home/sven/code/rector/answer-detection/train.py", line 106, in <module>
(dataset, weights) = get_dataset(args.dataset, tokenizer, labels, args.padding)
File "/home/sven/code/rector/answer-detection/dataset.py", line 106, in get_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en")
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/load.py", line 1794, in load_dataset
ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1106, in as_dataset
datasets = map_nested(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 443, in map_nested
mapped = [
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 444, in <listcomp>
_single_map_nested((function, obj, types, None, True, None))
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 346, in _single_map_nested
return function(data_struct)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1136, in _build_single_dataset
ds = self._as_dataset(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1207, in _as_dataset
dataset_kwargs = ArrowReader(cache_dir, self.info).read(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 239, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 260, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 203, in _read_files
pa_table = concat_tables(pa_tables) if len(pa_tables) != 1 else pa_tables[0]
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1808, in concat_tables
return ConcatenationTable.from_tables(tables, axis=axis)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1514, in from_tables
return cls.from_blocks(blocks)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1427, in from_blocks
table = cls._concat_blocks(blocks, axis=0)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1373, in _concat_blocks
return pa.concat_tables(pa_tables, promote=True)
File "pyarrow/table.pxi", line 5224, in pyarrow.lib.concat_tables
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Unable to merge: Field paragraph_anchors has incompatible types: list<: struct<start: uint32 not null, end: uint32 not null, qid: uint32, pageid: uint32, title: string not null> not null> vs list<item: struct<start: uint32, end: uint32, qid: uint32, pageid: uint32, title: string>>
```
This only happens when I load the `train` split, indicating that the size of the dataset is the deciding factor.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en", split="train")
```
### Expected behavior
The dataset should load normally without any errors.
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-6.2.8-arch1-1-x86_64-with-glibc2.37
- Python version: 3.10.10
- PyArrow version: 11.0.0
- Pandas version: 1.5.3 | 37 | pyarrow.lib.ArrowInvalid: Unable to merge: Field <field> has incompatible types
### Describe the bug
When loading the dataset [wikianc-en](https://huggingface.co/datasets/cyanic-selkie/wikianc-en) which I created using [this](https://github.com/cyanic-selkie/wikianc) code, I get the following error:
```
Traceback (most recent call last):
File "/home/sven/code/rector/answer-detection/train.py", line 106, in <module>
(dataset, weights) = get_dataset(args.dataset, tokenizer, labels, args.padding)
File "/home/sven/code/rector/answer-detection/dataset.py", line 106, in get_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en")
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/load.py", line 1794, in load_dataset
ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1106, in as_dataset
datasets = map_nested(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 443, in map_nested
mapped = [
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 444, in <listcomp>
_single_map_nested((function, obj, types, None, True, None))
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 346, in _single_map_nested
return function(data_struct)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1136, in _build_single_dataset
ds = self._as_dataset(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1207, in _as_dataset
dataset_kwargs = ArrowReader(cache_dir, self.info).read(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 239, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 260, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 203, in _read_files
pa_table = concat_tables(pa_tables) if len(pa_tables) != 1 else pa_tables[0]
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1808, in concat_tables
return ConcatenationTable.from_tables(tables, axis=axis)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1514, in from_tables
return cls.from_blocks(blocks)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1427, in from_blocks
table = cls._concat_blocks(blocks, axis=0)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1373, in _concat_blocks
return pa.concat_tables(pa_tables, promote=True)
File "pyarrow/table.pxi", line 5224, in pyarrow.lib.concat_tables
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Unable to merge: Field paragraph_anchors has incompatible types: list<: struct<start: uint32 not null, end: uint32 not null, qid: uint32, pageid: uint32, title: string not null> not null> vs list<item: struct<start: uint32, end: uint32, qid: uint32, pageid: uint32, title: string>>
```
This only happens when I load the `train` split, indicating that the size of the dataset is the deciding factor.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en", split="train")
```
### Expected behavior
The dataset should load normally without any errors.
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-6.2.8-arch1-1-x86_64-with-glibc2.37
- Python version: 3.10.10
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
@MingsYang I never fixed it. If you're referring to my comment above, I only meant I fixed the link to my code.
Anyway, I managed to work around the issue by using `streaming` when loading the dataset. | [
-0.2805249094963074,
0.09721410274505615,
-0.010183371603488922,
0.40840592980384827,
0.1494453102350235,
0.06983813643455505,
0.20628100633621216,
0.5558909177780151,
-0.2604309320449829,
-0.011714830994606018,
-0.03858485817909241,
0.6745288372039795,
0.05063933506608009,
-0.11226508021354675,
-0.18011558055877686,
0.05612685903906822,
0.051824990659952164,
0.22459642589092255,
-0.17221274971961975,
0.04517143964767456,
-0.21938717365264893,
0.019802821800112724,
-0.17079420387744904,
0.23620453476905823,
-0.24669858813285828,
-0.2392963171005249,
0.1450224071741104,
0.2811068296432495,
-0.2901458740234375,
-0.5820426344871521,
0.32738611102104187,
-0.22757792472839355,
-0.11271628737449646,
0.21473240852355957,
-0.00011655344860628247,
0.1178947314620018,
0.5897098183631897,
0.2304733693599701,
-0.29012244939804077,
-0.13319078087806702,
-0.025138914585113525,
0.01019328087568283,
0.2890773415565491,
-0.10326239466667175,
0.2928190231323242,
-0.4270164966583252,
-0.27329492568969727,
0.009804435074329376,
0.05866799131035805,
0.28049787878990173,
0.16709986329078674,
0.42194318771362305,
0.4241899847984314,
0.04944324493408203,
0.3522590696811676,
-0.04177304729819298,
0.06171712279319763,
0.3433992266654968,
0.14063403010368347,
-0.07862365990877151,
0.2664812207221985,
0.06186046823859215,
-0.0011341273784637451,
-0.2022867500782013,
0.2845589220523834,
-0.18069934844970703,
-0.050393443554639816,
-0.24394011497497559,
-0.06976811587810516,
0.05107260122895241,
0.18225330114364624,
-0.3696192800998688,
-0.12242267280817032,
0.07568653672933578,
0.17244303226470947,
-0.2561717927455902,
0.23695147037506104,
0.08965767920017242,
-0.1013035923242569,
0.11942008137702942,
0.1009407639503479,
0.1068328469991684,
-0.2211434245109558,
0.27185434103012085,
-0.15967512130737305,
0.38214871287345886,
0.2471078634262085,
0.2811359763145447,
0.014969983138144016,
-0.10734324157238007,
0.250547856092453,
-0.09932820498943329,
-0.23028859496116638,
0.02205902710556984,
-0.2895309031009674,
-0.1330741047859192,
-0.341402143239975,
0.07927781343460083,
0.197422593832016,
-0.02036702260375023,
0.002242792397737503,
-0.10333314538002014,
0.2760816812515259,
0.3583819568157196,
0.20826789736747742,
0.034108519554138184,
-0.03402366489171982,
0.15350311994552612,
0.08144985139369965,
-0.04960152134299278,
0.034794360399246216,
0.18608850240707397,
-0.18437176942825317,
-0.39930373430252075,
0.13665151596069336,
-0.08370788395404816,
0.42032530903816223,
0.029101349413394928,
-0.42175784707069397,
-0.021606698632240295,
-0.39149010181427,
0.0017580054700374603,
0.11320099234580994,
0.3697870075702667,
0.034491945058107376,
0.22917728126049042,
-0.08260026574134827,
0.3244776725769043,
0.07117686420679092,
-0.23562437295913696,
-0.04831912741065025,
0.0054743848741054535,
-0.0811399295926094,
-0.12787222862243652,
0.10012222081422806,
-0.14847277104854584,
0.03875184804201126,
0.3723870515823364,
0.1329813301563263,
0.032785117626190186,
-0.0588047169148922,
-0.06992287188768387,
-0.05724138021469116,
0.21614232659339905,
-0.11396899074316025,
0.11844737827777863,
0.1918967068195343,
-0.21551883220672607,
-0.13088178634643555,
0.24357616901397705,
-0.2250734269618988,
-0.26642704010009766,
-0.4479329586029053,
0.2165040522813797,
0.21837426722049713,
-0.16196294128894806,
-0.05271990969777107,
0.045444946736097336,
0.25191017985343933,
-0.277621328830719,
0.10849808156490326,
-0.142408549785614,
0.08053566515445709,
-0.4153742790222168,
0.14927133917808533,
-0.17377996444702148,
-0.6322271227836609,
-0.03600310534238815,
-0.0780041292309761,
0.04708150029182434,
-0.1614866405725479,
0.22766098380088806,
-0.49806714057922363,
0.13009217381477356,
-0.09243860840797424,
0.374860942363739,
0.4141618013381958,
-0.4940008521080017,
-0.5556289553642273,
-0.09876886010169983,
0.073496013879776,
-0.1125347763299942,
0.028886565938591957,
-0.04602626711130142,
-0.03645618259906769,
-0.0010994337499141693,
-0.06970043480396271,
0.3525669276714325,
-0.1990693360567093,
-0.08479973673820496,
-0.3005053400993347,
-0.4088733494281769,
0.36437031626701355,
0.13155078887939453,
0.09027603268623352,
-0.23659071326255798,
0.2952375113964081,
-0.45968887209892273,
0.12350357323884964,
-0.17304742336273193,
0.05838135629892349,
0.15070943534374237,
0.2092573046684265,
-0.09757940471172333,
0.1514662355184555,
-0.11910393834114075,
-0.6455629467964172,
0.09856367856264114,
-0.4016658365726471,
-0.02046135440468788,
-0.49088895320892334,
-0.2702796757221222,
-0.3079413175582886,
0.15385091304779053,
-0.25793135166168213,
0.13175341486930847,
0.12937524914741516,
-0.0699610710144043,
-0.18740999698638916,
-0.0367407463490963,
-0.2560194730758667,
-0.27959704399108887,
0.03376110643148422,
0.142179936170578,
-0.12595251202583313,
0.3754669427871704,
-0.3712630569934845,
-0.232301265001297,
-0.20842424035072327,
0.246822789311409,
0.20961326360702515,
0.059498876333236694,
-0.10185934603214264,
0.4523555040359497,
-0.20680837333202362,
0.29023629426956177,
-0.09592460840940475,
-0.1255692094564438,
0.24385400116443634,
-0.4258055090904236,
-0.12492357939481735,
0.012456502765417099,
0.14320969581604004,
-0.03382263332605362,
0.30401578545570374,
0.1926567703485489,
0.07509462535381317,
0.2701578736305237,
0.04312938451766968,
-0.09947340190410614,
0.06511339545249939,
0.05495310574769974,
0.0610990971326828,
0.01082109659910202,
-0.11647360771894455,
0.1211426854133606,
0.40850162506103516,
0.17182062566280365,
-0.2261762022972107,
0.24592173099517822,
0.4758453965187073,
0.03003518283367157,
0.04880805313587189,
-0.07515819370746613,
-0.3270900249481201,
-0.02401016652584076,
0.10820481181144714,
-0.052551545202732086,
0.3114812970161438,
0.23333033919334412,
-0.30944469571113586,
0.026720518246293068,
-0.11515772342681885,
0.020407982170581818,
0.3276251554489136,
0.28367239236831665,
0.5039348602294922,
0.43467187881469727,
0.4090934693813324,
0.15100018680095673,
-0.23093822598457336,
0.22423383593559265,
0.17997100949287415,
0.10664553195238113,
-0.28316235542297363,
0.23498943448066711,
-0.33338314294815063,
0.09905806183815002,
-0.23152410984039307,
-0.4866984784603119,
-0.20980583131313324,
-0.19585952162742615,
0.018451716750860214,
0.3519749343395233,
-0.05227909982204437,
0.2953355610370636,
0.06825850903987885,
0.17575009167194366,
0.25046613812446594,
-0.1121440976858139,
-0.39343225955963135,
-0.2317080795764923,
-0.3114180564880371,
0.04076195880770683,
0.4841529130935669,
-0.23373833298683167,
0.2595258355140686,
0.17009788751602173,
0.019579261541366577,
-0.13230960071086884,
-0.5497908592224121,
0.16049498319625854,
-0.10840636491775513,
0.19024568796157837,
0.11073824763298035,
0.0667678639292717,
-0.1426233947277069,
-0.5507011413574219,
0.41317111253738403,
-0.14313656091690063,
-0.34209179878234863,
0.20194149017333984,
-0.3022468388080597,
-0.04356587305665016,
-0.03566350042819977,
-0.3527362048625946,
-0.33615225553512573,
-0.30958765745162964,
-0.030955523252487183,
-0.018699705600738525,
0.057239413261413574,
0.09943832457065582,
0.3169410824775696,
-0.015189465135335922,
-0.20841073989868164,
-0.07954493165016174,
-0.14484520256519318,
0.16177241504192352,
0.26311802864074707,
-0.1541561335325241,
-0.21813470125198364,
0.036447517573833466,
-0.21221888065338135,
0.25414425134658813,
0.17194195091724396,
-0.06042742729187012,
0.10523559153079987,
-0.07237479835748672,
0.5506565570831299,
-0.12302844971418381,
-0.16353099048137665,
0.4070304334163666,
0.19689230620861053,
-0.00022756308317184448,
-0.0897391214966774,
-0.019123487174510956,
-0.029548458755016327,
-0.19369998574256897,
0.1833711713552475,
-0.008959638886153698,
0.41028040647506714,
-0.014948524534702301,
0.798762857913971,
-0.0318855419754982,
-0.25440359115600586,
0.22931215167045593,
-0.14662697911262512,
0.12323306500911713,
-0.17211034893989563,
-0.19774989783763885,
-0.14589695632457733,
-0.1796693056821823,
0.01971692591905594,
0.16596244275569916,
-0.19553691148757935,
-0.3465653359889984,
0.05392392724752426,
0.1599920094013214,
-0.5008524656295776,
-0.09666746854782104,
0.005710741505026817,
0.03130955994129181,
-0.029975377023220062,
0.07297034561634064,
-0.1866912543773651,
0.020845681428909302,
-0.11698275804519653,
0.25926172733306885,
0.011249195784330368,
-0.24125003814697266,
0.052946560084819794,
-0.008065260946750641,
-0.32838746905326843,
-0.1863299459218979,
0.37191295623779297,
0.3340013325214386,
0.18187983334064484,
0.13266804814338684,
-0.22371815145015717,
0.04787983000278473,
-0.18976379930973053,
0.5876075625419617,
-0.07529609650373459,
-0.18781493604183197,
0.06809017062187195,
0.33661261200904846,
-0.48128384351730347,
-0.19534999132156372,
0.03727525472640991,
0.06161653995513916,
0.10892312228679657,
0.36020177602767944,
-0.46826985478401184,
-0.06015139818191528,
0.26079705357551575,
0.1457449048757553,
-0.037366773933172226,
-0.19686247408390045,
-0.23995639383792877,
-0.3020974397659302,
-0.5180811882019043,
-0.12044651806354523,
0.010445214807987213,
0.3553823232650757,
-0.05207039415836334,
-0.14312347769737244,
-0.24309277534484863,
-0.0629151314496994,
-0.07192282378673553,
0.11399300396442413,
0.38915520906448364,
-0.28113752603530884,
-0.03497764468193054,
-0.07253988087177277,
0.30260801315307617,
0.5191702246665955,
0.5508562326431274,
0.23990261554718018,
-0.28244853019714355,
-0.1215737834572792,
-0.007815096527338028,
0.07648930698633194,
0.051180675625801086,
-0.20661547780036926,
0.24853381514549255,
-0.013260000385344028,
-0.18310946226119995,
0.09145965427160263,
0.03734813258051872,
0.45601990818977356,
-0.13083438575267792,
-0.22155031561851501,
0.1258763074874878,
0.5697636008262634,
-0.024999305605888367,
0.032958969473838806,
0.5323403477668762,
0.29262059926986694,
-0.1286107897758484,
0.22773629426956177,
0.1545148342847824,
0.955633282661438,
-0.0044729746878147125,
0.1984023153781891,
0.8571939468383789,
-0.22391170263290405,
0.10521820187568665,
0.038013651967048645,
0.04110762104392052,
-0.5667829513549805,
0.2865973114967346,
0.036597445607185364,
-0.21045374870300293,
-0.04225470870733261,
-0.017735499888658524,
-0.14965087175369263,
-0.14238804578781128,
-0.33277779817581177,
0.5481413006782532,
0.01905268058180809,
0.18991999328136444,
-0.0817129835486412,
0.01924613118171692,
-0.1063026562333107,
0.07306313514709473,
-0.07803705334663391,
-0.2591038644313812,
-0.2297443151473999,
-0.1807204931974411,
-0.1883891224861145,
-0.22765910625457764,
0.003958210349082947,
0.2990093529224396,
-0.24972692131996155,
0.3656841516494751,
0.05120248347520828,
-0.28540030121803284,
0.004141569137573242,
0.11478035897016525,
-0.04065922647714615,
-0.3092220425605774,
-0.0828159973025322,
0.30769577622413635,
0.1588989794254303,
-0.1734340786933899,
-0.14520463347434998,
-0.20108172297477722,
0.17549043893814087,
-0.16989102959632874,
-0.1298629343509674,
0.18978075683116913,
-0.09352460503578186,
-0.31040292978286743,
-0.09871438890695572,
0.14499913156032562,
0.18896915018558502,
-0.23196136951446533,
-0.2190030813217163,
-0.25536632537841797,
-0.054262883961200714,
-0.3031585216522217,
0.08296908438205719,
-0.17297792434692383,
0.12651558220386505,
-0.0011507142335176468,
0.0627068281173706,
-0.1987287700176239,
0.06281179189682007,
0.11082468926906586,
-0.05658240616321564,
0.18367040157318115,
0.6801491975784302,
0.10039064288139343,
-0.13233330845832825,
-0.13857565820217133,
-0.07057762145996094,
0.3419874906539917,
-0.7385729551315308,
0.06928405165672302,
-0.096145860850811,
0.021502628922462463,
0.016130510717630386,
0.41193339228630066,
0.2290061116218567,
0.26523643732070923,
-0.06496630609035492,
-0.3506760597229004,
-0.36191099882125854,
0.41259869933128357,
-0.007398813031613827,
0.15897811949253082,
0.3024086356163025,
0.20944827795028687,
-0.2873428761959076,
0.09834419190883636,
-0.25900572538375854,
0.08116099238395691,
0.06495694071054459,
0.04598744586110115,
-0.4265921413898468,
-0.01901625096797943,
0.08032412827014923,
-0.05940477177500725,
0.11726560443639755,
0.11558686941862106,
0.010643094778060913,
-0.20991268754005432,
-0.11220046132802963,
0.13259471952915192,
0.1762487292289734,
-0.021848401054739952,
-0.06513998657464981,
-0.11233150959014893,
0.09174229204654694,
0.07821574807167053,
0.021301761269569397,
-0.17251349985599518,
-0.11292403936386108,
-0.10445425659418106,
0.2896738350391388,
0.02035953477025032,
-0.4042224586009979,
0.13272210955619812,
-0.030922014266252518,
0.12274264544248581,
0.009871497750282288,
0.26979392766952515,
-0.23091137409210205,
0.12099944800138474,
0.007589280605316162,
0.09182889014482498,
0.21698805689811707,
0.020766671746969223,
0.2068517506122589,
-0.6174875497817993,
-0.15964241325855255,
-0.13168704509735107,
0.309469610452652,
0.3559596538543701,
-0.427062064409256,
-0.09717297554016113,
-0.04422420263290405,
0.21340127289295197,
-0.33639463782310486,
-0.05895724147558212,
-0.09330203384160995,
-0.10206471383571625,
-0.006172731518745422,
-0.0037226080894470215,
0.18802721798419952,
-0.17842406034469604,
-0.15210187435150146,
0.1530742645263672,
0.13091468811035156,
-0.017243796959519386,
0.08648908138275146,
0.5139757394790649,
-0.07253710925579071,
-0.06068848446011543,
0.5155545473098755,
0.18534702062606812,
0.17127317190170288,
0.12307986617088318,
-0.12951374053955078,
0.2077466994524002,
0.05080963298678398,
-0.22884979844093323,
0.21706528961658478,
-0.05067844316363335,
0.19073735177516937,
0.12308456003665924,
0.289934366941452,
-0.25049880146980286,
0.5003089904785156,
0.575588583946228,
0.401724636554718,
-0.466316819190979,
0.11790130287408829,
0.14847756922245026,
-0.09511393308639526,
0.1866244524717331,
-0.45721369981765747,
-0.21642321348190308,
-0.04178231954574585,
-0.07312672585248947,
-0.19703473150730133,
-0.07729646563529968,
0.33033487200737,
0.29047471284866333,
-0.18298549950122833,
-0.5211774706840515,
0.4125295877456665,
0.4564443826675415,
0.1373567283153534,
-0.21868698298931122,
0.395152747631073,
0.3198084235191345,
-0.3118780553340912,
0.023535462096333504,
0.3192533552646637,
0.6272238492965698,
0.4473523199558258,
-0.258579820394516,
-0.20290163159370422,
-0.1657514125108719,
-0.1475560963153839,
0.13042402267456055,
0.041282083839178085,
0.31560254096984863,
0.1289389729499817,
0.1929279863834381,
0.17898298799991608,
-0.12951210141181946,
-0.061141062527894974,
0.12698690593242645,
0.25977203249931335,
-0.07240292429924011,
-0.0752703920006752,
-0.2499585598707199,
-0.31426382064819336,
0.07938362658023834,
0.07239365577697754,
-0.26402485370635986,
0.14668214321136475,
0.43008482456207275,
0.23760180175304413,
0.10937031358480453,
-0.23382879793643951,
0.07903211563825607,
0.23535819351673126,
0.36842015385627747,
0.2705842852592468,
0.13893097639083862,
-0.1374540776014328,
-0.1568821519613266,
-0.5033832788467407,
0.477516770362854,
-0.19568607211112976,
0.09960469603538513,
0.26566004753112793,
0.2177058607339859,
0.05110740661621094,
0.1343696564435959,
0.6175758838653564,
0.11863021552562714,
0.17163239419460297,
0.0982951745390892,
-0.2019122838973999,
0.100876085460186,
0.14891637861728668,
-0.22221581637859344,
0.017268821597099304,
-0.39717939496040344,
0.2679970860481262,
-0.11225526034832001,
0.08720976114273071,
-0.26099997758865356,
-0.1996195912361145,
0.2643544673919678,
-0.2865806519985199,
0.33671891689300537,
0.03994949907064438,
0.47781217098236084,
-0.1051688939332962,
-0.202606201171875,
-0.13109298050403595,
-0.272953599691391,
-0.4558553099632263,
0.3419257700443268,
-0.01704096794128418,
0.20281076431274414,
-0.014016497880220413,
-0.07154650241136551,
-0.2358342558145523,
0.12170659750699997,
-0.18372827768325806,
-0.2935437858104706,
-0.2572168707847595,
-0.017186786979436874,
-0.05068374052643776,
0.01941804215312004,
-0.052788145840168,
0.19951529800891876,
0.11069390922784805,
0.2086472511291504,
-0.34245193004608154,
-0.4723905920982361,
0.42348015308380127,
-0.2783378064632416,
-0.4114033579826355,
0.15224847197532654,
0.0033657103776931763,
0.3836362957954407,
0.06392055004835129,
-0.4184325337409973,
-0.11769618093967438,
0.3167244493961334,
-0.05837753415107727,
0.014603711664676666,
0.10304030776023865,
0.047853734344244,
0.12813541293144226,
-0.1067143976688385,
0.25256428122520447,
0.12266169488430023,
0.05245770514011383,
-0.11069352924823761,
-0.3016446530818939
] |
https://github.com/huggingface/datasets/issues/5692 | @cyanic-selkie Emm, I get it. I just tried to use a new version python enviroment, and it show no errors anymore. | pyarrow.lib.ArrowInvalid: Unable to merge: Field <field> has incompatible types | ### Describe the bug
When loading the dataset [wikianc-en](https://huggingface.co/datasets/cyanic-selkie/wikianc-en) which I created using [this](https://github.com/cyanic-selkie/wikianc) code, I get the following error:
```
Traceback (most recent call last):
File "/home/sven/code/rector/answer-detection/train.py", line 106, in <module>
(dataset, weights) = get_dataset(args.dataset, tokenizer, labels, args.padding)
File "/home/sven/code/rector/answer-detection/dataset.py", line 106, in get_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en")
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/load.py", line 1794, in load_dataset
ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1106, in as_dataset
datasets = map_nested(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 443, in map_nested
mapped = [
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 444, in <listcomp>
_single_map_nested((function, obj, types, None, True, None))
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 346, in _single_map_nested
return function(data_struct)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1136, in _build_single_dataset
ds = self._as_dataset(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1207, in _as_dataset
dataset_kwargs = ArrowReader(cache_dir, self.info).read(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 239, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 260, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 203, in _read_files
pa_table = concat_tables(pa_tables) if len(pa_tables) != 1 else pa_tables[0]
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1808, in concat_tables
return ConcatenationTable.from_tables(tables, axis=axis)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1514, in from_tables
return cls.from_blocks(blocks)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1427, in from_blocks
table = cls._concat_blocks(blocks, axis=0)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1373, in _concat_blocks
return pa.concat_tables(pa_tables, promote=True)
File "pyarrow/table.pxi", line 5224, in pyarrow.lib.concat_tables
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Unable to merge: Field paragraph_anchors has incompatible types: list<: struct<start: uint32 not null, end: uint32 not null, qid: uint32, pageid: uint32, title: string not null> not null> vs list<item: struct<start: uint32, end: uint32, qid: uint32, pageid: uint32, title: string>>
```
This only happens when I load the `train` split, indicating that the size of the dataset is the deciding factor.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en", split="train")
```
### Expected behavior
The dataset should load normally without any errors.
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-6.2.8-arch1-1-x86_64-with-glibc2.37
- Python version: 3.10.10
- PyArrow version: 11.0.0
- Pandas version: 1.5.3 | 21 | pyarrow.lib.ArrowInvalid: Unable to merge: Field <field> has incompatible types
### Describe the bug
When loading the dataset [wikianc-en](https://huggingface.co/datasets/cyanic-selkie/wikianc-en) which I created using [this](https://github.com/cyanic-selkie/wikianc) code, I get the following error:
```
Traceback (most recent call last):
File "/home/sven/code/rector/answer-detection/train.py", line 106, in <module>
(dataset, weights) = get_dataset(args.dataset, tokenizer, labels, args.padding)
File "/home/sven/code/rector/answer-detection/dataset.py", line 106, in get_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en")
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/load.py", line 1794, in load_dataset
ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1106, in as_dataset
datasets = map_nested(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 443, in map_nested
mapped = [
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 444, in <listcomp>
_single_map_nested((function, obj, types, None, True, None))
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 346, in _single_map_nested
return function(data_struct)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1136, in _build_single_dataset
ds = self._as_dataset(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/builder.py", line 1207, in _as_dataset
dataset_kwargs = ArrowReader(cache_dir, self.info).read(
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 239, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 260, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/arrow_reader.py", line 203, in _read_files
pa_table = concat_tables(pa_tables) if len(pa_tables) != 1 else pa_tables[0]
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1808, in concat_tables
return ConcatenationTable.from_tables(tables, axis=axis)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1514, in from_tables
return cls.from_blocks(blocks)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1427, in from_blocks
table = cls._concat_blocks(blocks, axis=0)
File "/home/sven/.cache/pypoetry/virtualenvs/rector-Z2mdKRnn-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1373, in _concat_blocks
return pa.concat_tables(pa_tables, promote=True)
File "pyarrow/table.pxi", line 5224, in pyarrow.lib.concat_tables
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Unable to merge: Field paragraph_anchors has incompatible types: list<: struct<start: uint32 not null, end: uint32 not null, qid: uint32, pageid: uint32, title: string not null> not null> vs list<item: struct<start: uint32, end: uint32, qid: uint32, pageid: uint32, title: string>>
```
This only happens when I load the `train` split, indicating that the size of the dataset is the deciding factor.
### Steps to reproduce the bug
```python
from datasets import load_dataset
dataset = load_dataset("cyanic-selkie/wikianc-en", split="train")
```
### Expected behavior
The dataset should load normally without any errors.
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-6.2.8-arch1-1-x86_64-with-glibc2.37
- Python version: 3.10.10
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
@cyanic-selkie Emm, I get it. I just tried to use a new version python enviroment, and it show no errors anymore. | [
-0.2805249094963074,
0.09721410274505615,
-0.010183371603488922,
0.40840592980384827,
0.1494453102350235,
0.06983813643455505,
0.20628100633621216,
0.5558909177780151,
-0.2604309320449829,
-0.011714830994606018,
-0.03858485817909241,
0.6745288372039795,
0.05063933506608009,
-0.11226508021354675,
-0.18011558055877686,
0.05612685903906822,
0.051824990659952164,
0.22459642589092255,
-0.17221274971961975,
0.04517143964767456,
-0.21938717365264893,
0.019802821800112724,
-0.17079420387744904,
0.23620453476905823,
-0.24669858813285828,
-0.2392963171005249,
0.1450224071741104,
0.2811068296432495,
-0.2901458740234375,
-0.5820426344871521,
0.32738611102104187,
-0.22757792472839355,
-0.11271628737449646,
0.21473240852355957,
-0.00011655344860628247,
0.1178947314620018,
0.5897098183631897,
0.2304733693599701,
-0.29012244939804077,
-0.13319078087806702,
-0.025138914585113525,
0.01019328087568283,
0.2890773415565491,
-0.10326239466667175,
0.2928190231323242,
-0.4270164966583252,
-0.27329492568969727,
0.009804435074329376,
0.05866799131035805,
0.28049787878990173,
0.16709986329078674,
0.42194318771362305,
0.4241899847984314,
0.04944324493408203,
0.3522590696811676,
-0.04177304729819298,
0.06171712279319763,
0.3433992266654968,
0.14063403010368347,
-0.07862365990877151,
0.2664812207221985,
0.06186046823859215,
-0.0011341273784637451,
-0.2022867500782013,
0.2845589220523834,
-0.18069934844970703,
-0.050393443554639816,
-0.24394011497497559,
-0.06976811587810516,
0.05107260122895241,
0.18225330114364624,
-0.3696192800998688,
-0.12242267280817032,
0.07568653672933578,
0.17244303226470947,
-0.2561717927455902,
0.23695147037506104,
0.08965767920017242,
-0.1013035923242569,
0.11942008137702942,
0.1009407639503479,
0.1068328469991684,
-0.2211434245109558,
0.27185434103012085,
-0.15967512130737305,
0.38214871287345886,
0.2471078634262085,
0.2811359763145447,
0.014969983138144016,
-0.10734324157238007,
0.250547856092453,
-0.09932820498943329,
-0.23028859496116638,
0.02205902710556984,
-0.2895309031009674,
-0.1330741047859192,
-0.341402143239975,
0.07927781343460083,
0.197422593832016,
-0.02036702260375023,
0.002242792397737503,
-0.10333314538002014,
0.2760816812515259,
0.3583819568157196,
0.20826789736747742,
0.034108519554138184,
-0.03402366489171982,
0.15350311994552612,
0.08144985139369965,
-0.04960152134299278,
0.034794360399246216,
0.18608850240707397,
-0.18437176942825317,
-0.39930373430252075,
0.13665151596069336,
-0.08370788395404816,
0.42032530903816223,
0.029101349413394928,
-0.42175784707069397,
-0.021606698632240295,
-0.39149010181427,
0.0017580054700374603,
0.11320099234580994,
0.3697870075702667,
0.034491945058107376,
0.22917728126049042,
-0.08260026574134827,
0.3244776725769043,
0.07117686420679092,
-0.23562437295913696,
-0.04831912741065025,
0.0054743848741054535,
-0.0811399295926094,
-0.12787222862243652,
0.10012222081422806,
-0.14847277104854584,
0.03875184804201126,
0.3723870515823364,
0.1329813301563263,
0.032785117626190186,
-0.0588047169148922,
-0.06992287188768387,
-0.05724138021469116,
0.21614232659339905,
-0.11396899074316025,
0.11844737827777863,
0.1918967068195343,
-0.21551883220672607,
-0.13088178634643555,
0.24357616901397705,
-0.2250734269618988,
-0.26642704010009766,
-0.4479329586029053,
0.2165040522813797,
0.21837426722049713,
-0.16196294128894806,
-0.05271990969777107,
0.045444946736097336,
0.25191017985343933,
-0.277621328830719,
0.10849808156490326,
-0.142408549785614,
0.08053566515445709,
-0.4153742790222168,
0.14927133917808533,
-0.17377996444702148,
-0.6322271227836609,
-0.03600310534238815,
-0.0780041292309761,
0.04708150029182434,
-0.1614866405725479,
0.22766098380088806,
-0.49806714057922363,
0.13009217381477356,
-0.09243860840797424,
0.374860942363739,
0.4141618013381958,
-0.4940008521080017,
-0.5556289553642273,
-0.09876886010169983,
0.073496013879776,
-0.1125347763299942,
0.028886565938591957,
-0.04602626711130142,
-0.03645618259906769,
-0.0010994337499141693,
-0.06970043480396271,
0.3525669276714325,
-0.1990693360567093,
-0.08479973673820496,
-0.3005053400993347,
-0.4088733494281769,
0.36437031626701355,
0.13155078887939453,
0.09027603268623352,
-0.23659071326255798,
0.2952375113964081,
-0.45968887209892273,
0.12350357323884964,
-0.17304742336273193,
0.05838135629892349,
0.15070943534374237,
0.2092573046684265,
-0.09757940471172333,
0.1514662355184555,
-0.11910393834114075,
-0.6455629467964172,
0.09856367856264114,
-0.4016658365726471,
-0.02046135440468788,
-0.49088895320892334,
-0.2702796757221222,
-0.3079413175582886,
0.15385091304779053,
-0.25793135166168213,
0.13175341486930847,
0.12937524914741516,
-0.0699610710144043,
-0.18740999698638916,
-0.0367407463490963,
-0.2560194730758667,
-0.27959704399108887,
0.03376110643148422,
0.142179936170578,
-0.12595251202583313,
0.3754669427871704,
-0.3712630569934845,
-0.232301265001297,
-0.20842424035072327,
0.246822789311409,
0.20961326360702515,
0.059498876333236694,
-0.10185934603214264,
0.4523555040359497,
-0.20680837333202362,
0.29023629426956177,
-0.09592460840940475,
-0.1255692094564438,
0.24385400116443634,
-0.4258055090904236,
-0.12492357939481735,
0.012456502765417099,
0.14320969581604004,
-0.03382263332605362,
0.30401578545570374,
0.1926567703485489,
0.07509462535381317,
0.2701578736305237,
0.04312938451766968,
-0.09947340190410614,
0.06511339545249939,
0.05495310574769974,
0.0610990971326828,
0.01082109659910202,
-0.11647360771894455,
0.1211426854133606,
0.40850162506103516,
0.17182062566280365,
-0.2261762022972107,
0.24592173099517822,
0.4758453965187073,
0.03003518283367157,
0.04880805313587189,
-0.07515819370746613,
-0.3270900249481201,
-0.02401016652584076,
0.10820481181144714,
-0.052551545202732086,
0.3114812970161438,
0.23333033919334412,
-0.30944469571113586,
0.026720518246293068,
-0.11515772342681885,
0.020407982170581818,
0.3276251554489136,
0.28367239236831665,
0.5039348602294922,
0.43467187881469727,
0.4090934693813324,
0.15100018680095673,
-0.23093822598457336,
0.22423383593559265,
0.17997100949287415,
0.10664553195238113,
-0.28316235542297363,
0.23498943448066711,
-0.33338314294815063,
0.09905806183815002,
-0.23152410984039307,
-0.4866984784603119,
-0.20980583131313324,
-0.19585952162742615,
0.018451716750860214,
0.3519749343395233,
-0.05227909982204437,
0.2953355610370636,
0.06825850903987885,
0.17575009167194366,
0.25046613812446594,
-0.1121440976858139,
-0.39343225955963135,
-0.2317080795764923,
-0.3114180564880371,
0.04076195880770683,
0.4841529130935669,
-0.23373833298683167,
0.2595258355140686,
0.17009788751602173,
0.019579261541366577,
-0.13230960071086884,
-0.5497908592224121,
0.16049498319625854,
-0.10840636491775513,
0.19024568796157837,
0.11073824763298035,
0.0667678639292717,
-0.1426233947277069,
-0.5507011413574219,
0.41317111253738403,
-0.14313656091690063,
-0.34209179878234863,
0.20194149017333984,
-0.3022468388080597,
-0.04356587305665016,
-0.03566350042819977,
-0.3527362048625946,
-0.33615225553512573,
-0.30958765745162964,
-0.030955523252487183,
-0.018699705600738525,
0.057239413261413574,
0.09943832457065582,
0.3169410824775696,
-0.015189465135335922,
-0.20841073989868164,
-0.07954493165016174,
-0.14484520256519318,
0.16177241504192352,
0.26311802864074707,
-0.1541561335325241,
-0.21813470125198364,
0.036447517573833466,
-0.21221888065338135,
0.25414425134658813,
0.17194195091724396,
-0.06042742729187012,
0.10523559153079987,
-0.07237479835748672,
0.5506565570831299,
-0.12302844971418381,
-0.16353099048137665,
0.4070304334163666,
0.19689230620861053,
-0.00022756308317184448,
-0.0897391214966774,
-0.019123487174510956,
-0.029548458755016327,
-0.19369998574256897,
0.1833711713552475,
-0.008959638886153698,
0.41028040647506714,
-0.014948524534702301,
0.798762857913971,
-0.0318855419754982,
-0.25440359115600586,
0.22931215167045593,
-0.14662697911262512,
0.12323306500911713,
-0.17211034893989563,
-0.19774989783763885,
-0.14589695632457733,
-0.1796693056821823,
0.01971692591905594,
0.16596244275569916,
-0.19553691148757935,
-0.3465653359889984,
0.05392392724752426,
0.1599920094013214,
-0.5008524656295776,
-0.09666746854782104,
0.005710741505026817,
0.03130955994129181,
-0.029975377023220062,
0.07297034561634064,
-0.1866912543773651,
0.020845681428909302,
-0.11698275804519653,
0.25926172733306885,
0.011249195784330368,
-0.24125003814697266,
0.052946560084819794,
-0.008065260946750641,
-0.32838746905326843,
-0.1863299459218979,
0.37191295623779297,
0.3340013325214386,
0.18187983334064484,
0.13266804814338684,
-0.22371815145015717,
0.04787983000278473,
-0.18976379930973053,
0.5876075625419617,
-0.07529609650373459,
-0.18781493604183197,
0.06809017062187195,
0.33661261200904846,
-0.48128384351730347,
-0.19534999132156372,
0.03727525472640991,
0.06161653995513916,
0.10892312228679657,
0.36020177602767944,
-0.46826985478401184,
-0.06015139818191528,
0.26079705357551575,
0.1457449048757553,
-0.037366773933172226,
-0.19686247408390045,
-0.23995639383792877,
-0.3020974397659302,
-0.5180811882019043,
-0.12044651806354523,
0.010445214807987213,
0.3553823232650757,
-0.05207039415836334,
-0.14312347769737244,
-0.24309277534484863,
-0.0629151314496994,
-0.07192282378673553,
0.11399300396442413,
0.38915520906448364,
-0.28113752603530884,
-0.03497764468193054,
-0.07253988087177277,
0.30260801315307617,
0.5191702246665955,
0.5508562326431274,
0.23990261554718018,
-0.28244853019714355,
-0.1215737834572792,
-0.007815096527338028,
0.07648930698633194,
0.051180675625801086,
-0.20661547780036926,
0.24853381514549255,
-0.013260000385344028,
-0.18310946226119995,
0.09145965427160263,
0.03734813258051872,
0.45601990818977356,
-0.13083438575267792,
-0.22155031561851501,
0.1258763074874878,
0.5697636008262634,
-0.024999305605888367,
0.032958969473838806,
0.5323403477668762,
0.29262059926986694,
-0.1286107897758484,
0.22773629426956177,
0.1545148342847824,
0.955633282661438,
-0.0044729746878147125,
0.1984023153781891,
0.8571939468383789,
-0.22391170263290405,
0.10521820187568665,
0.038013651967048645,
0.04110762104392052,
-0.5667829513549805,
0.2865973114967346,
0.036597445607185364,
-0.21045374870300293,
-0.04225470870733261,
-0.017735499888658524,
-0.14965087175369263,
-0.14238804578781128,
-0.33277779817581177,
0.5481413006782532,
0.01905268058180809,
0.18991999328136444,
-0.0817129835486412,
0.01924613118171692,
-0.1063026562333107,
0.07306313514709473,
-0.07803705334663391,
-0.2591038644313812,
-0.2297443151473999,
-0.1807204931974411,
-0.1883891224861145,
-0.22765910625457764,
0.003958210349082947,
0.2990093529224396,
-0.24972692131996155,
0.3656841516494751,
0.05120248347520828,
-0.28540030121803284,
0.004141569137573242,
0.11478035897016525,
-0.04065922647714615,
-0.3092220425605774,
-0.0828159973025322,
0.30769577622413635,
0.1588989794254303,
-0.1734340786933899,
-0.14520463347434998,
-0.20108172297477722,
0.17549043893814087,
-0.16989102959632874,
-0.1298629343509674,
0.18978075683116913,
-0.09352460503578186,
-0.31040292978286743,
-0.09871438890695572,
0.14499913156032562,
0.18896915018558502,
-0.23196136951446533,
-0.2190030813217163,
-0.25536632537841797,
-0.054262883961200714,
-0.3031585216522217,
0.08296908438205719,
-0.17297792434692383,
0.12651558220386505,
-0.0011507142335176468,
0.0627068281173706,
-0.1987287700176239,
0.06281179189682007,
0.11082468926906586,
-0.05658240616321564,
0.18367040157318115,
0.6801491975784302,
0.10039064288139343,
-0.13233330845832825,
-0.13857565820217133,
-0.07057762145996094,
0.3419874906539917,
-0.7385729551315308,
0.06928405165672302,
-0.096145860850811,
0.021502628922462463,
0.016130510717630386,
0.41193339228630066,
0.2290061116218567,
0.26523643732070923,
-0.06496630609035492,
-0.3506760597229004,
-0.36191099882125854,
0.41259869933128357,
-0.007398813031613827,
0.15897811949253082,
0.3024086356163025,
0.20944827795028687,
-0.2873428761959076,
0.09834419190883636,
-0.25900572538375854,
0.08116099238395691,
0.06495694071054459,
0.04598744586110115,
-0.4265921413898468,
-0.01901625096797943,
0.08032412827014923,
-0.05940477177500725,
0.11726560443639755,
0.11558686941862106,
0.010643094778060913,
-0.20991268754005432,
-0.11220046132802963,
0.13259471952915192,
0.1762487292289734,
-0.021848401054739952,
-0.06513998657464981,
-0.11233150959014893,
0.09174229204654694,
0.07821574807167053,
0.021301761269569397,
-0.17251349985599518,
-0.11292403936386108,
-0.10445425659418106,
0.2896738350391388,
0.02035953477025032,
-0.4042224586009979,
0.13272210955619812,
-0.030922014266252518,
0.12274264544248581,
0.009871497750282288,
0.26979392766952515,
-0.23091137409210205,
0.12099944800138474,
0.007589280605316162,
0.09182889014482498,
0.21698805689811707,
0.020766671746969223,
0.2068517506122589,
-0.6174875497817993,
-0.15964241325855255,
-0.13168704509735107,
0.309469610452652,
0.3559596538543701,
-0.427062064409256,
-0.09717297554016113,
-0.04422420263290405,
0.21340127289295197,
-0.33639463782310486,
-0.05895724147558212,
-0.09330203384160995,
-0.10206471383571625,
-0.006172731518745422,
-0.0037226080894470215,
0.18802721798419952,
-0.17842406034469604,
-0.15210187435150146,
0.1530742645263672,
0.13091468811035156,
-0.017243796959519386,
0.08648908138275146,
0.5139757394790649,
-0.07253710925579071,
-0.06068848446011543,
0.5155545473098755,
0.18534702062606812,
0.17127317190170288,
0.12307986617088318,
-0.12951374053955078,
0.2077466994524002,
0.05080963298678398,
-0.22884979844093323,
0.21706528961658478,
-0.05067844316363335,
0.19073735177516937,
0.12308456003665924,
0.289934366941452,
-0.25049880146980286,
0.5003089904785156,
0.575588583946228,
0.401724636554718,
-0.466316819190979,
0.11790130287408829,
0.14847756922245026,
-0.09511393308639526,
0.1866244524717331,
-0.45721369981765747,
-0.21642321348190308,
-0.04178231954574585,
-0.07312672585248947,
-0.19703473150730133,
-0.07729646563529968,
0.33033487200737,
0.29047471284866333,
-0.18298549950122833,
-0.5211774706840515,
0.4125295877456665,
0.4564443826675415,
0.1373567283153534,
-0.21868698298931122,
0.395152747631073,
0.3198084235191345,
-0.3118780553340912,
0.023535462096333504,
0.3192533552646637,
0.6272238492965698,
0.4473523199558258,
-0.258579820394516,
-0.20290163159370422,
-0.1657514125108719,
-0.1475560963153839,
0.13042402267456055,
0.041282083839178085,
0.31560254096984863,
0.1289389729499817,
0.1929279863834381,
0.17898298799991608,
-0.12951210141181946,
-0.061141062527894974,
0.12698690593242645,
0.25977203249931335,
-0.07240292429924011,
-0.0752703920006752,
-0.2499585598707199,
-0.31426382064819336,
0.07938362658023834,
0.07239365577697754,
-0.26402485370635986,
0.14668214321136475,
0.43008482456207275,
0.23760180175304413,
0.10937031358480453,
-0.23382879793643951,
0.07903211563825607,
0.23535819351673126,
0.36842015385627747,
0.2705842852592468,
0.13893097639083862,
-0.1374540776014328,
-0.1568821519613266,
-0.5033832788467407,
0.477516770362854,
-0.19568607211112976,
0.09960469603538513,
0.26566004753112793,
0.2177058607339859,
0.05110740661621094,
0.1343696564435959,
0.6175758838653564,
0.11863021552562714,
0.17163239419460297,
0.0982951745390892,
-0.2019122838973999,
0.100876085460186,
0.14891637861728668,
-0.22221581637859344,
0.017268821597099304,
-0.39717939496040344,
0.2679970860481262,
-0.11225526034832001,
0.08720976114273071,
-0.26099997758865356,
-0.1996195912361145,
0.2643544673919678,
-0.2865806519985199,
0.33671891689300537,
0.03994949907064438,
0.47781217098236084,
-0.1051688939332962,
-0.202606201171875,
-0.13109298050403595,
-0.272953599691391,
-0.4558553099632263,
0.3419257700443268,
-0.01704096794128418,
0.20281076431274414,
-0.014016497880220413,
-0.07154650241136551,
-0.2358342558145523,
0.12170659750699997,
-0.18372827768325806,
-0.2935437858104706,
-0.2572168707847595,
-0.017186786979436874,
-0.05068374052643776,
0.01941804215312004,
-0.052788145840168,
0.19951529800891876,
0.11069390922784805,
0.2086472511291504,
-0.34245193004608154,
-0.4723905920982361,
0.42348015308380127,
-0.2783378064632416,
-0.4114033579826355,
0.15224847197532654,
0.0033657103776931763,
0.3836362957954407,
0.06392055004835129,
-0.4184325337409973,
-0.11769618093967438,
0.3167244493961334,
-0.05837753415107727,
0.014603711664676666,
0.10304030776023865,
0.047853734344244,
0.12813541293144226,
-0.1067143976688385,
0.25256428122520447,
0.12266169488430023,
0.05245770514011383,
-0.11069352924823761,
-0.3016446530818939
] |
https://github.com/huggingface/datasets/issues/5690 | Hi @wccccp, thanks for reporting.
That's weird since `huggingface_hub` _has_ a module called `hf_api` and you are using a recent version of it.
Which version of `datasets` are you using? And is it a bug that you experienced only recently? (cc @lhoestq can it be somehow related to the recent release of `datasets`?)
~@wccccp what I can suggest you is to uninstall and reinstall completely huggingface_hub and datasets? My first guess is that there is a discrepancy somewhere in your setup 😕~ | raise AttributeError(f"No {package_name} attribute {name}") AttributeError: No huggingface_hub attribute hf_api | ### Describe the bug
rta.sh
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
### Reproduction
_No response_
### Logs
```shell
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
```
### System info
```shell
- huggingface_hub version: 0.13.2
- Platform: Linux-5.4.0-144-generic-x86_64-with-glibc2.10
- Python version: 3.8.5
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Token path ?: /home/appuser/.cache/huggingface/token
- Has saved token ?: False
- Configured git credential helpers:
- FastAI: N/A
- Tensorflow: N/A
- Torch: 1.7.1
- Jinja2: N/A
- Graphviz: N/A
- Pydot: N/A
- Pillow: 9.3.0
- hf_transfer: N/A
- ENDPOINT: https://huggingface.co
- HUGGINGFACE_HUB_CACHE: /home/appuser/.cache/huggingface/hub
- HUGGINGFACE_ASSETS_CACHE: /home/appuser/.cache/huggingface/assets
- HF_TOKEN_PATH: /home/appuser/.cache/huggingface/token
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
```
| 82 | raise AttributeError(f"No {package_name} attribute {name}") AttributeError: No huggingface_hub attribute hf_api
### Describe the bug
rta.sh
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
### Reproduction
_No response_
### Logs
```shell
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
```
### System info
```shell
- huggingface_hub version: 0.13.2
- Platform: Linux-5.4.0-144-generic-x86_64-with-glibc2.10
- Python version: 3.8.5
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Token path ?: /home/appuser/.cache/huggingface/token
- Has saved token ?: False
- Configured git credential helpers:
- FastAI: N/A
- Tensorflow: N/A
- Torch: 1.7.1
- Jinja2: N/A
- Graphviz: N/A
- Pydot: N/A
- Pillow: 9.3.0
- hf_transfer: N/A
- ENDPOINT: https://huggingface.co
- HUGGINGFACE_HUB_CACHE: /home/appuser/.cache/huggingface/hub
- HUGGINGFACE_ASSETS_CACHE: /home/appuser/.cache/huggingface/assets
- HF_TOKEN_PATH: /home/appuser/.cache/huggingface/token
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
```
Hi @wccccp, thanks for reporting.
That's weird since `huggingface_hub` _has_ a module called `hf_api` and you are using a recent version of it.
Which version of `datasets` are you using? And is it a bug that you experienced only recently? (cc @lhoestq can it be somehow related to the recent release of `datasets`?)
~@wccccp what I can suggest you is to uninstall and reinstall completely huggingface_hub and datasets? My first guess is that there is a discrepancy somewhere in your setup 😕~ | [
-0.29969364404678345,
-0.360951691865921,
-0.0473315455019474,
0.36517247557640076,
0.42924559116363525,
-0.0765240490436554,
0.24430179595947266,
0.5703027844429016,
-0.040128376334905624,
0.29361385107040405,
-0.03497811034321785,
0.2826228737831116,
-0.0843978226184845,
0.17554573714733124,
-0.02682824432849884,
-0.19096022844314575,
-0.05914785712957382,
0.25455689430236816,
-0.03866518661379814,
-0.14724645018577576,
-0.2056066393852234,
0.3731883764266968,
0.05612371861934662,
0.13078366219997406,
-0.2853156328201294,
0.02753731794655323,
0.2529347538948059,
0.0238802433013916,
-0.033541932702064514,
-0.489665687084198,
0.02938491851091385,
-0.27412548661231995,
-0.04647703468799591,
0.28895387053489685,
-0.00011611108493525535,
0.19851337373256683,
0.2584739923477173,
0.08023903518915176,
-0.37375783920288086,
-0.07866969704627991,
0.058480799198150635,
-0.085626982152462,
0.11854662001132965,
-0.04772341251373291,
-0.2620267868041992,
-0.2870790362358093,
-0.0878840833902359,
0.01272391527891159,
0.20415039360523224,
0.3090120553970337,
0.24126113951206207,
0.5026150941848755,
0.283448189496994,
-0.15697011351585388,
0.29825788736343384,
0.09043288230895996,
-0.21911989152431488,
0.22013455629348755,
-0.046653930097818375,
0.3931621015071869,
0.02241663821041584,
0.2623996138572693,
0.19847151637077332,
0.12684981524944305,
0.33373576402664185,
-0.007890699431300163,
0.08321906626224518,
-0.17132344841957092,
0.15468163788318634,
0.21474701166152954,
0.31638696789741516,
-0.29171130061149597,
-0.43629831075668335,
-0.04178589582443237,
0.1710101217031479,
-0.22915847599506378,
0.16592265665531158,
-0.15431064367294312,
-0.2251628339290619,
-0.06890222430229187,
0.04603920504450798,
-0.2893056869506836,
-0.13509050011634827,
-0.06226056069135666,
-0.029606133699417114,
0.32936519384384155,
-0.18040181696414948,
0.01646612025797367,
-0.11362311244010925,
-0.20517487823963165,
-0.20587536692619324,
-0.04456590116024017,
-0.05597248673439026,
0.08962525427341461,
-0.4374370276927948,
-0.09517419338226318,
0.15391671657562256,
0.29335033893585205,
0.11527760326862335,
0.33648571372032166,
-0.17608597874641418,
0.08261299133300781,
0.09922656416893005,
0.006125490181148052,
-0.2499818056821823,
0.35728392004966736,
0.07713627815246582,
-0.022004619240760803,
0.19918228685855865,
0.25301387906074524,
-0.16846498847007751,
-0.031977370381355286,
-0.16290497779846191,
-0.0670204684138298,
-0.10171579569578171,
0.023442823439836502,
0.4287319779396057,
-0.010219670832157135,
-0.3510046899318695,
0.18489453196525574,
-0.07995317131280899,
0.07573926448822021,
0.12272020429372787,
0.48695164918899536,
-0.016107551753520966,
0.16402484476566315,
0.10949671268463135,
0.11027195304632187,
-0.22691074013710022,
-0.06569059938192368,
-0.33096185326576233,
0.05522313341498375,
-0.1061006486415863,
-0.0391291081905365,
0.026172354817390442,
-0.39842963218688965,
0.2927667498588562,
-0.04978813976049423,
0.2735527455806732,
0.03474035859107971,
-0.11855195462703705,
-0.09065088629722595,
-0.05966896191239357,
0.3094324767589569,
-0.1371840089559555,
0.20990528166294098,
0.35144177079200745,
-0.1799963116645813,
0.028938472270965576,
-0.2327691912651062,
-0.2573646306991577,
-0.2598334550857544,
-0.3349611759185791,
0.23367688059806824,
0.001190185546875,
-0.020989857614040375,
-0.2401987761259079,
-0.22251909971237183,
0.10403002798557281,
-0.02106615900993347,
0.07214932888746262,
0.057469937950372696,
-0.039882756769657135,
-0.21316394209861755,
0.36665859818458557,
0.36527830362319946,
0.03471112251281738,
-0.15335795283317566,
-0.10271641612052917,
-0.22745931148529053,
-0.012447547167539597,
-0.10422029346227646,
0.1789565533399582,
0.41561558842658997,
-0.36446279287338257,
-0.16134336590766907,
0.3064948320388794,
-0.5216859579086304,
-0.27446448802948,
0.07101894915103912,
-0.2747781574726105,
-0.025112595409154892,
0.3209579885005951,
-0.1389719843864441,
-0.09500323235988617,
0.040774472057819366,
0.15176552534103394,
-0.0817786306142807,
0.07088488340377808,
0.053183987736701965,
-0.17902331054210663,
-0.10872186720371246,
-0.19265371561050415,
0.06066523492336273,
0.22294403612613678,
0.11614128947257996,
0.026364214718341827,
-0.01928003877401352,
0.25042107701301575,
-0.06036687642335892,
0.09164565801620483,
0.08750797063112259,
0.2909906804561615,
-0.12294895946979523,
0.051403798162937164,
-0.21435710787773132,
-0.23453328013420105,
0.22484955191612244,
-0.22768564522266388,
0.15318261086940765,
-0.10081176459789276,
-0.19903069734573364,
-0.3678542971611023,
0.12783271074295044,
-0.18575654923915863,
-0.3284617066383362,
0.21645863354206085,
0.3954618275165558,
-0.1303146332502365,
0.03071735054254532,
-0.27096205949783325,
0.24678100645542145,
-0.142232283949852,
0.1942676603794098,
-0.2743437588214874,
0.38686826825141907,
-0.03905637562274933,
-0.07157404720783234,
-0.04388885572552681,
0.3905086815357208,
0.10940564423799515,
-0.016370683908462524,
-0.019542725756764412,
0.3084239363670349,
0.026739880442619324,
0.22637450695037842,
-0.05918733403086662,
-0.1446184515953064,
0.07953745126724243,
-0.020326033234596252,
-0.12829060852527618,
-0.04051600396633148,
0.18193095922470093,
0.05581919848918915,
0.46952131390571594,
0.22545063495635986,
0.1573638617992401,
0.29507237672805786,
0.2691675126552582,
-0.005775164812803268,
-0.01615557074546814,
0.013827994465827942,
0.07596033811569214,
-0.3035942018032074,
0.22575262188911438,
0.0011287517845630646,
0.23675698041915894,
-0.08208766579627991,
-0.13041740655899048,
0.18962913751602173,
0.6611875295639038,
0.22643063962459564,
0.0914614349603653,
0.03648513928055763,
-0.2986430525779724,
0.12929393351078033,
0.19632825255393982,
0.29482337832450867,
0.4488080143928528,
0.1639544516801834,
-0.28535786271095276,
0.20359782874584198,
0.2073144018650055,
-0.06716994196176529,
0.28197401762008667,
0.032900989055633545,
0.2815844714641571,
0.31332194805145264,
0.0011806972324848175,
0.043400999158620834,
-0.20596778392791748,
-0.4554417133331299,
-0.24151656031608582,
0.21743589639663696,
-0.4095039665699005,
-0.2129843831062317,
-0.15050660073757172,
0.005681812763214111,
-0.2964482307434082,
-0.29656848311424255,
-0.15628977119922638,
-0.3524490296840668,
-0.01992235705256462,
-0.009097620844841003,
-0.06194990128278732,
0.27388840913772583,
-0.08484785258769989,
0.07384216785430908,
-0.08041388541460037,
-0.20722176134586334,
-0.3455277681350708,
0.10861807316541672,
-0.1305142641067505,
0.061422258615493774,
-0.12438899278640747,
-0.009665891528129578,
0.24652938544750214,
-0.29626816511154175,
0.2464676797389984,
-0.2577045261859894,
-0.33934712409973145,
0.2439153492450714,
-0.22514936327934265,
0.11959108710289001,
0.30845752358436584,
0.021522218361496925,
-0.07286149263381958,
-0.42533668875694275,
0.3223522901535034,
-0.19538897275924683,
-0.30086666345596313,
0.22221159934997559,
-0.005048677325248718,
-0.16886906325817108,
-0.11367690563201904,
-0.22106635570526123,
-0.05080444738268852,
-0.5772792100906372,
0.04078662395477295,
0.15290288627147675,
0.19804388284683228,
0.19345276057720184,
-0.15300533175468445,
0.5401797890663147,
-0.32464444637298584,
0.2780669033527374,
-0.0176892951130867,
-0.009241268038749695,
0.11539888381958008,
-0.32098352909088135,
-0.2969074845314026,
-0.09765664488077164,
-0.09720253944396973,
0.5725787878036499,
-0.15846875309944153,
-0.33124637603759766,
-0.4182804822921753,
-0.22205211222171783,
0.11234362423419952,
-0.20712144672870636,
0.21936729550361633,
0.2523218095302582,
0.08523127436637878,
-0.19786396622657776,
-0.1529279351234436,
0.12671296298503876,
0.09678182005882263,
-0.21820750832557678,
-0.06614427268505096,
0.08144094794988632,
0.12166209518909454,
-0.2222018837928772,
0.6714597940444946,
0.35465502738952637,
-0.22577394545078278,
0.45274803042411804,
-0.2919066548347473,
0.44515344500541687,
-0.16965988278388977,
-0.4704485535621643,
0.0030110329389572144,
0.29061514139175415,
0.18668654561042786,
0.23685896396636963,
-0.046010635793209076,
0.4573207199573517,
-0.22460603713989258,
-0.18577393889427185,
-0.09310866892337799,
-0.33272624015808105,
-0.2218465805053711,
-0.21204668283462524,
0.06546932458877563,
-0.20025818049907684,
0.08928771317005157,
-0.14364829659461975,
0.03532934933900833,
0.27318525314331055,
0.23237335681915283,
-0.17678813636302948,
-0.18338191509246826,
-0.17046025395393372,
-0.43847256898880005,
-0.4346930980682373,
0.30717307329177856,
0.06895433366298676,
0.33722078800201416,
-0.002461828291416168,
-0.1707439422607422,
0.04078635200858116,
-0.06782034784555435,
0.5648620128631592,
-0.013176700100302696,
0.30555519461631775,
-0.02624502032995224,
-0.007447034120559692,
-0.3988984227180481,
0.16042178869247437,
-0.11173872649669647,
-0.004100628197193146,
-0.30267229676246643,
0.6093240976333618,
-0.17852257192134857,
-0.47355014085769653,
0.23993024230003357,
-0.0385420061647892,
0.011232279241085052,
0.1891150027513504,
-0.31454354524612427,
-0.28050702810287476,
-0.2763124108314514,
-0.05235349386930466,
-0.05396333336830139,
0.3771185576915741,
0.1592031568288803,
-0.07513627409934998,
-0.2827557325363159,
-0.1262236386537552,
-0.043318383395671844,
0.08763928711414337,
0.2446240335702896,
-0.07648679614067078,
0.12946484982967377,
-0.06447403132915497,
-0.005421480163931847,
0.21335013210773468,
0.6559127569198608,
-0.1366121470928192,
-0.38372376561164856,
-0.13088230788707733,
0.095582515001297,
0.22248539328575134,
0.2574021518230438,
-0.3160611093044281,
0.29104575514793396,
-0.37916627526283264,
0.4417097568511963,
-0.24977943301200867,
-0.04232088476419449,
0.34246134757995605,
-0.0009012296795845032,
0.08685263991355896,
0.0668104737997055,
0.41682493686676025,
-0.11109815537929535,
0.025238320231437683,
0.21443122625350952,
0.8141875267028809,
-0.2216568887233734,
0.36516642570495605,
-0.041441336274147034,
0.7752063274383545,
0.4021630883216858,
0.07162609696388245,
0.536981999874115,
-0.08786240220069885,
0.37209373712539673,
-0.12092255055904388,
0.08879658579826355,
-0.3847739100456238,
-0.4254860579967499,
-0.07040302455425262,
0.023505203425884247,
0.24427558481693268,
-0.21324452757835388,
-0.0894579216837883,
0.08278708159923553,
0.05193248391151428,
0.4754314124584198,
-0.06767939776182175,
0.050174541771411896,
-0.4635295271873474,
-0.1305239200592041,
-0.48943930864334106,
0.09492114186286926,
-0.10091839730739594,
0.298672080039978,
-0.1002783328294754,
0.052423905581235886,
-0.08476525545120239,
-0.400564044713974,
-0.11753848195075989,
0.23006273806095123,
-0.3619738221168518,
-0.1111319437623024,
0.41072240471839905,
0.029218360781669617,
0.17935508489608765,
0.1878916323184967,
0.35131382942199707,
0.20992429554462433,
-0.21131110191345215,
0.18711820244789124,
-0.18165487051010132,
0.1798686683177948,
-0.06962084770202637,
-0.031888801604509354,
0.3489398658275604,
-0.16454435884952545,
-0.26540204882621765,
0.10513276606798172,
0.015182610601186752,
0.18921807408332825,
0.3227779269218445,
-0.034377455711364746,
0.026716478168964386,
-0.1912180334329605,
0.14055490493774414,
0.09246505796909332,
-0.04810204356908798,
-0.1503223478794098,
0.1378857046365738,
-0.17136864364147186,
-0.3547564744949341,
0.01970772072672844,
0.2752266526222229,
-0.3266913592815399,
0.028695151209831238,
0.5683193802833557,
0.07669565826654434,
0.09275073558092117,
0.5376322269439697,
0.016283534467220306,
-0.13566145300865173,
-0.25321951508522034,
0.07581719756126404,
0.3632071316242218,
-0.9609639048576355,
0.14414191246032715,
0.1217431053519249,
-0.07154956459999084,
0.19456419348716736,
0.24321334064006805,
0.04756106808781624,
-0.02629866823554039,
-0.1503039300441742,
-0.34446489810943604,
-0.2291785329580307,
0.3700813949108124,
-0.2446380853652954,
0.18131406605243683,
-0.03197083994746208,
-0.025889482349157333,
-0.05424557626247406,
0.07983604818582535,
-0.34376412630081177,
-0.018953831866383553,
-0.3142659366130829,
0.0899379700422287,
-0.2805965840816498,
-0.05276798829436302,
0.540861189365387,
0.0515664741396904,
0.20445682108402252,
0.12104026973247528,
-0.3802929222583771,
-0.2386394888162613,
-0.13053299486637115,
0.14632435142993927,
0.06529484689235687,
-0.03204525262117386,
0.04271325469017029,
0.0006800815463066101,
-0.07363580167293549,
-0.11462615430355072,
0.4100819230079651,
-0.012167900800704956,
-0.17518508434295654,
0.19027575850486755,
0.2955870032310486,
0.11734861135482788,
-0.1171002984046936,
-0.03524956852197647,
0.05772487819194794,
0.23764462769031525,
-0.005461573600769043,
-0.043166112154722214,
-0.23660922050476074,
-0.04371930658817291,
0.10039760172367096,
0.29365968704223633,
0.13307051360607147,
-0.00020182505249977112,
0.27501675486564636,
-0.07681603729724884,
-0.3121809959411621,
-0.11170560121536255,
0.16336403787136078,
-0.007077725604176521,
-0.09427586197853088,
-0.1355046033859253,
0.2365323007106781,
0.2007124423980713,
-0.3976680636405945,
0.008898619562387466,
0.09721097350120544,
-0.19625675678253174,
0.1974952071905136,
0.2571916878223419,
0.033522829413414,
-0.20206329226493835,
0.12044847011566162,
0.21816369891166687,
0.32123446464538574,
-0.31153252720832825,
0.09231643378734589,
0.4366133213043213,
-0.09491565078496933,
0.11424455046653748,
0.3538491725921631,
0.19445368647575378,
0.2036350667476654,
0.3951096832752228,
-0.19358579814434052,
0.4623432457447052,
-0.2582816183567047,
-0.09433719515800476,
0.2859722971916199,
-0.2775827646255493,
0.25960588455200195,
0.16791120171546936,
-0.015956901013851166,
-0.10749170184135437,
-0.0687050074338913,
0.2255089282989502,
0.104275181889534,
-0.0506751649081707,
-0.10208988189697266,
0.056389663368463516,
-0.08638721704483032,
-0.02836170606315136,
-0.07218780368566513,
-0.19983534514904022,
-0.4720802307128906,
-0.23859789967536926,
0.059471119195222855,
-0.11003459244966507,
0.2311077117919922,
-0.00713072344660759,
-0.05417671799659729,
-0.2468121200799942,
-0.059798359870910645,
0.11835804581642151,
0.19857165217399597,
-0.1996491253376007,
0.31493282318115234,
0.4178912341594696,
0.17218418419361115,
-0.04546940326690674,
0.49039649963378906,
0.41920459270477295,
0.07617531716823578,
0.08367818593978882,
-0.023948583751916885,
0.06941990554332733,
-0.05957501009106636,
-0.05438914895057678,
0.11935193836688995,
-0.12583065032958984,
0.08025055378675461,
0.21468158066272736,
0.2213076800107956,
-0.23082782328128815,
-0.07628099620342255,
-0.07850828021764755,
0.04514163359999657,
-0.18673518300056458,
0.8627412915229797,
-0.24725256860256195,
-0.08079241961240768,
-0.3325366675853729,
0.016186224296689034,
-0.540527880191803,
-0.12435755133628845,
0.2931482791900635,
-0.13562491536140442,
0.011517789214849472,
-0.38202089071273804,
0.09067712724208832,
-0.1491674780845642,
0.44512999057769775,
0.335243284702301,
0.11445727944374084,
-0.1776750087738037,
-0.11068586260080338,
-0.1790514886379242,
0.331706166267395,
0.3283595144748688,
0.005357526242733002,
-0.016259538009762764,
-0.1995924413204193,
-0.14380158483982086,
-0.12783202528953552,
0.3666839301586151,
-0.12321344763040543,
0.18702983856201172,
-0.05400834605097771,
-0.28555917739868164,
-0.1776101142168045,
-0.19494381546974182,
-0.20804791152477264,
0.0047529712319374084,
-0.29169726371765137,
-0.021304190158843994,
-0.222740039229393,
0.060525208711624146,
-0.07071267068386078,
-0.11539676040410995,
0.2167098969221115,
-0.6964043378829956,
0.39160045981407166,
-0.026251869276165962,
0.09804219007492065,
-0.28332558274269104,
-0.22911326587200165,
-0.0455305352807045,
-0.17159512639045715,
-0.2876105308532715,
0.03375754877924919,
0.11354157328605652,
0.44460630416870117,
0.09175034612417221,
-0.27732592821121216,
-0.19268286228179932,
0.17509818077087402,
0.007046818733215332,
0.3076061010360718,
-0.08485721796751022,
0.6034550070762634,
-0.2972681224346161,
-0.1179053783416748,
0.2515428066253662,
0.06692385673522949,
0.0763266533613205,
0.3060338795185089,
-0.47790372371673584,
-0.5714568495750427,
0.7575868368148804,
-0.22998099029064178,
-0.17040567100048065,
0.04427459090948105,
0.5145431160926819,
-0.13101832568645477,
-0.4468151032924652,
-0.6484676599502563,
0.1553839147090912,
0.3070342540740967,
0.12230147421360016,
-0.2227480709552765,
0.38564786314964294,
-0.1350671648979187,
0.03206928074359894,
-0.01694464683532715,
0.21654130518436432,
-0.0270092710852623,
0.09668462723493576,
0.21126756072044373,
-0.14205919206142426
] |
https://github.com/huggingface/datasets/issues/5690 | @wccccp Actually I have also been able to reproduce the error so it's not an issue with your setup.
@huggingface/datasets I found this issue quite weird. Is this a module that is not used very often?
The problematic line is [this one](https://github.com/huggingface/datasets/blame/c33e8ce68b5000988bf6b2e4bca27ffaa469acea/src/datasets/data_files.py#L476) where `huggingface_hub.hf_api.DatasetInfo` is used. `huggingface_hub` is imported [here](https://github.com/huggingface/datasets/blame/c33e8ce68b5000988bf6b2e4bca27ffaa469acea/src/datasets/data_files.py#L6) as `import huggingface_hub`. However since modules are lazy-loaded in `hfh` you need to explicitly import them (i.e. `import huggingface_hub.hf_api`).
What's weird is that nothing has changed for months. Datasets code seems that it didn't change for 2 years when I git-blame this part. And lazy-loading was introduced 1 year ago in `huggingface_hub`. Could it be that `data_files.py` is a file almost never used?
| raise AttributeError(f"No {package_name} attribute {name}") AttributeError: No huggingface_hub attribute hf_api | ### Describe the bug
rta.sh
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
### Reproduction
_No response_
### Logs
```shell
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
```
### System info
```shell
- huggingface_hub version: 0.13.2
- Platform: Linux-5.4.0-144-generic-x86_64-with-glibc2.10
- Python version: 3.8.5
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Token path ?: /home/appuser/.cache/huggingface/token
- Has saved token ?: False
- Configured git credential helpers:
- FastAI: N/A
- Tensorflow: N/A
- Torch: 1.7.1
- Jinja2: N/A
- Graphviz: N/A
- Pydot: N/A
- Pillow: 9.3.0
- hf_transfer: N/A
- ENDPOINT: https://huggingface.co
- HUGGINGFACE_HUB_CACHE: /home/appuser/.cache/huggingface/hub
- HUGGINGFACE_ASSETS_CACHE: /home/appuser/.cache/huggingface/assets
- HF_TOKEN_PATH: /home/appuser/.cache/huggingface/token
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
```
| 113 | raise AttributeError(f"No {package_name} attribute {name}") AttributeError: No huggingface_hub attribute hf_api
### Describe the bug
rta.sh
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
### Reproduction
_No response_
### Logs
```shell
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
```
### System info
```shell
- huggingface_hub version: 0.13.2
- Platform: Linux-5.4.0-144-generic-x86_64-with-glibc2.10
- Python version: 3.8.5
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Token path ?: /home/appuser/.cache/huggingface/token
- Has saved token ?: False
- Configured git credential helpers:
- FastAI: N/A
- Tensorflow: N/A
- Torch: 1.7.1
- Jinja2: N/A
- Graphviz: N/A
- Pydot: N/A
- Pillow: 9.3.0
- hf_transfer: N/A
- ENDPOINT: https://huggingface.co
- HUGGINGFACE_HUB_CACHE: /home/appuser/.cache/huggingface/hub
- HUGGINGFACE_ASSETS_CACHE: /home/appuser/.cache/huggingface/assets
- HF_TOKEN_PATH: /home/appuser/.cache/huggingface/token
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
```
@wccccp Actually I have also been able to reproduce the error so it's not an issue with your setup.
@huggingface/datasets I found this issue quite weird. Is this a module that is not used very often?
The problematic line is [this one](https://github.com/huggingface/datasets/blame/c33e8ce68b5000988bf6b2e4bca27ffaa469acea/src/datasets/data_files.py#L476) where `huggingface_hub.hf_api.DatasetInfo` is used. `huggingface_hub` is imported [here](https://github.com/huggingface/datasets/blame/c33e8ce68b5000988bf6b2e4bca27ffaa469acea/src/datasets/data_files.py#L6) as `import huggingface_hub`. However since modules are lazy-loaded in `hfh` you need to explicitly import them (i.e. `import huggingface_hub.hf_api`).
What's weird is that nothing has changed for months. Datasets code seems that it didn't change for 2 years when I git-blame this part. And lazy-loading was introduced 1 year ago in `huggingface_hub`. Could it be that `data_files.py` is a file almost never used?
| [
-0.29969364404678345,
-0.360951691865921,
-0.0473315455019474,
0.36517247557640076,
0.42924559116363525,
-0.0765240490436554,
0.24430179595947266,
0.5703027844429016,
-0.040128376334905624,
0.29361385107040405,
-0.03497811034321785,
0.2826228737831116,
-0.0843978226184845,
0.17554573714733124,
-0.02682824432849884,
-0.19096022844314575,
-0.05914785712957382,
0.25455689430236816,
-0.03866518661379814,
-0.14724645018577576,
-0.2056066393852234,
0.3731883764266968,
0.05612371861934662,
0.13078366219997406,
-0.2853156328201294,
0.02753731794655323,
0.2529347538948059,
0.0238802433013916,
-0.033541932702064514,
-0.489665687084198,
0.02938491851091385,
-0.27412548661231995,
-0.04647703468799591,
0.28895387053489685,
-0.00011611108493525535,
0.19851337373256683,
0.2584739923477173,
0.08023903518915176,
-0.37375783920288086,
-0.07866969704627991,
0.058480799198150635,
-0.085626982152462,
0.11854662001132965,
-0.04772341251373291,
-0.2620267868041992,
-0.2870790362358093,
-0.0878840833902359,
0.01272391527891159,
0.20415039360523224,
0.3090120553970337,
0.24126113951206207,
0.5026150941848755,
0.283448189496994,
-0.15697011351585388,
0.29825788736343384,
0.09043288230895996,
-0.21911989152431488,
0.22013455629348755,
-0.046653930097818375,
0.3931621015071869,
0.02241663821041584,
0.2623996138572693,
0.19847151637077332,
0.12684981524944305,
0.33373576402664185,
-0.007890699431300163,
0.08321906626224518,
-0.17132344841957092,
0.15468163788318634,
0.21474701166152954,
0.31638696789741516,
-0.29171130061149597,
-0.43629831075668335,
-0.04178589582443237,
0.1710101217031479,
-0.22915847599506378,
0.16592265665531158,
-0.15431064367294312,
-0.2251628339290619,
-0.06890222430229187,
0.04603920504450798,
-0.2893056869506836,
-0.13509050011634827,
-0.06226056069135666,
-0.029606133699417114,
0.32936519384384155,
-0.18040181696414948,
0.01646612025797367,
-0.11362311244010925,
-0.20517487823963165,
-0.20587536692619324,
-0.04456590116024017,
-0.05597248673439026,
0.08962525427341461,
-0.4374370276927948,
-0.09517419338226318,
0.15391671657562256,
0.29335033893585205,
0.11527760326862335,
0.33648571372032166,
-0.17608597874641418,
0.08261299133300781,
0.09922656416893005,
0.006125490181148052,
-0.2499818056821823,
0.35728392004966736,
0.07713627815246582,
-0.022004619240760803,
0.19918228685855865,
0.25301387906074524,
-0.16846498847007751,
-0.031977370381355286,
-0.16290497779846191,
-0.0670204684138298,
-0.10171579569578171,
0.023442823439836502,
0.4287319779396057,
-0.010219670832157135,
-0.3510046899318695,
0.18489453196525574,
-0.07995317131280899,
0.07573926448822021,
0.12272020429372787,
0.48695164918899536,
-0.016107551753520966,
0.16402484476566315,
0.10949671268463135,
0.11027195304632187,
-0.22691074013710022,
-0.06569059938192368,
-0.33096185326576233,
0.05522313341498375,
-0.1061006486415863,
-0.0391291081905365,
0.026172354817390442,
-0.39842963218688965,
0.2927667498588562,
-0.04978813976049423,
0.2735527455806732,
0.03474035859107971,
-0.11855195462703705,
-0.09065088629722595,
-0.05966896191239357,
0.3094324767589569,
-0.1371840089559555,
0.20990528166294098,
0.35144177079200745,
-0.1799963116645813,
0.028938472270965576,
-0.2327691912651062,
-0.2573646306991577,
-0.2598334550857544,
-0.3349611759185791,
0.23367688059806824,
0.001190185546875,
-0.020989857614040375,
-0.2401987761259079,
-0.22251909971237183,
0.10403002798557281,
-0.02106615900993347,
0.07214932888746262,
0.057469937950372696,
-0.039882756769657135,
-0.21316394209861755,
0.36665859818458557,
0.36527830362319946,
0.03471112251281738,
-0.15335795283317566,
-0.10271641612052917,
-0.22745931148529053,
-0.012447547167539597,
-0.10422029346227646,
0.1789565533399582,
0.41561558842658997,
-0.36446279287338257,
-0.16134336590766907,
0.3064948320388794,
-0.5216859579086304,
-0.27446448802948,
0.07101894915103912,
-0.2747781574726105,
-0.025112595409154892,
0.3209579885005951,
-0.1389719843864441,
-0.09500323235988617,
0.040774472057819366,
0.15176552534103394,
-0.0817786306142807,
0.07088488340377808,
0.053183987736701965,
-0.17902331054210663,
-0.10872186720371246,
-0.19265371561050415,
0.06066523492336273,
0.22294403612613678,
0.11614128947257996,
0.026364214718341827,
-0.01928003877401352,
0.25042107701301575,
-0.06036687642335892,
0.09164565801620483,
0.08750797063112259,
0.2909906804561615,
-0.12294895946979523,
0.051403798162937164,
-0.21435710787773132,
-0.23453328013420105,
0.22484955191612244,
-0.22768564522266388,
0.15318261086940765,
-0.10081176459789276,
-0.19903069734573364,
-0.3678542971611023,
0.12783271074295044,
-0.18575654923915863,
-0.3284617066383362,
0.21645863354206085,
0.3954618275165558,
-0.1303146332502365,
0.03071735054254532,
-0.27096205949783325,
0.24678100645542145,
-0.142232283949852,
0.1942676603794098,
-0.2743437588214874,
0.38686826825141907,
-0.03905637562274933,
-0.07157404720783234,
-0.04388885572552681,
0.3905086815357208,
0.10940564423799515,
-0.016370683908462524,
-0.019542725756764412,
0.3084239363670349,
0.026739880442619324,
0.22637450695037842,
-0.05918733403086662,
-0.1446184515953064,
0.07953745126724243,
-0.020326033234596252,
-0.12829060852527618,
-0.04051600396633148,
0.18193095922470093,
0.05581919848918915,
0.46952131390571594,
0.22545063495635986,
0.1573638617992401,
0.29507237672805786,
0.2691675126552582,
-0.005775164812803268,
-0.01615557074546814,
0.013827994465827942,
0.07596033811569214,
-0.3035942018032074,
0.22575262188911438,
0.0011287517845630646,
0.23675698041915894,
-0.08208766579627991,
-0.13041740655899048,
0.18962913751602173,
0.6611875295639038,
0.22643063962459564,
0.0914614349603653,
0.03648513928055763,
-0.2986430525779724,
0.12929393351078033,
0.19632825255393982,
0.29482337832450867,
0.4488080143928528,
0.1639544516801834,
-0.28535786271095276,
0.20359782874584198,
0.2073144018650055,
-0.06716994196176529,
0.28197401762008667,
0.032900989055633545,
0.2815844714641571,
0.31332194805145264,
0.0011806972324848175,
0.043400999158620834,
-0.20596778392791748,
-0.4554417133331299,
-0.24151656031608582,
0.21743589639663696,
-0.4095039665699005,
-0.2129843831062317,
-0.15050660073757172,
0.005681812763214111,
-0.2964482307434082,
-0.29656848311424255,
-0.15628977119922638,
-0.3524490296840668,
-0.01992235705256462,
-0.009097620844841003,
-0.06194990128278732,
0.27388840913772583,
-0.08484785258769989,
0.07384216785430908,
-0.08041388541460037,
-0.20722176134586334,
-0.3455277681350708,
0.10861807316541672,
-0.1305142641067505,
0.061422258615493774,
-0.12438899278640747,
-0.009665891528129578,
0.24652938544750214,
-0.29626816511154175,
0.2464676797389984,
-0.2577045261859894,
-0.33934712409973145,
0.2439153492450714,
-0.22514936327934265,
0.11959108710289001,
0.30845752358436584,
0.021522218361496925,
-0.07286149263381958,
-0.42533668875694275,
0.3223522901535034,
-0.19538897275924683,
-0.30086666345596313,
0.22221159934997559,
-0.005048677325248718,
-0.16886906325817108,
-0.11367690563201904,
-0.22106635570526123,
-0.05080444738268852,
-0.5772792100906372,
0.04078662395477295,
0.15290288627147675,
0.19804388284683228,
0.19345276057720184,
-0.15300533175468445,
0.5401797890663147,
-0.32464444637298584,
0.2780669033527374,
-0.0176892951130867,
-0.009241268038749695,
0.11539888381958008,
-0.32098352909088135,
-0.2969074845314026,
-0.09765664488077164,
-0.09720253944396973,
0.5725787878036499,
-0.15846875309944153,
-0.33124637603759766,
-0.4182804822921753,
-0.22205211222171783,
0.11234362423419952,
-0.20712144672870636,
0.21936729550361633,
0.2523218095302582,
0.08523127436637878,
-0.19786396622657776,
-0.1529279351234436,
0.12671296298503876,
0.09678182005882263,
-0.21820750832557678,
-0.06614427268505096,
0.08144094794988632,
0.12166209518909454,
-0.2222018837928772,
0.6714597940444946,
0.35465502738952637,
-0.22577394545078278,
0.45274803042411804,
-0.2919066548347473,
0.44515344500541687,
-0.16965988278388977,
-0.4704485535621643,
0.0030110329389572144,
0.29061514139175415,
0.18668654561042786,
0.23685896396636963,
-0.046010635793209076,
0.4573207199573517,
-0.22460603713989258,
-0.18577393889427185,
-0.09310866892337799,
-0.33272624015808105,
-0.2218465805053711,
-0.21204668283462524,
0.06546932458877563,
-0.20025818049907684,
0.08928771317005157,
-0.14364829659461975,
0.03532934933900833,
0.27318525314331055,
0.23237335681915283,
-0.17678813636302948,
-0.18338191509246826,
-0.17046025395393372,
-0.43847256898880005,
-0.4346930980682373,
0.30717307329177856,
0.06895433366298676,
0.33722078800201416,
-0.002461828291416168,
-0.1707439422607422,
0.04078635200858116,
-0.06782034784555435,
0.5648620128631592,
-0.013176700100302696,
0.30555519461631775,
-0.02624502032995224,
-0.007447034120559692,
-0.3988984227180481,
0.16042178869247437,
-0.11173872649669647,
-0.004100628197193146,
-0.30267229676246643,
0.6093240976333618,
-0.17852257192134857,
-0.47355014085769653,
0.23993024230003357,
-0.0385420061647892,
0.011232279241085052,
0.1891150027513504,
-0.31454354524612427,
-0.28050702810287476,
-0.2763124108314514,
-0.05235349386930466,
-0.05396333336830139,
0.3771185576915741,
0.1592031568288803,
-0.07513627409934998,
-0.2827557325363159,
-0.1262236386537552,
-0.043318383395671844,
0.08763928711414337,
0.2446240335702896,
-0.07648679614067078,
0.12946484982967377,
-0.06447403132915497,
-0.005421480163931847,
0.21335013210773468,
0.6559127569198608,
-0.1366121470928192,
-0.38372376561164856,
-0.13088230788707733,
0.095582515001297,
0.22248539328575134,
0.2574021518230438,
-0.3160611093044281,
0.29104575514793396,
-0.37916627526283264,
0.4417097568511963,
-0.24977943301200867,
-0.04232088476419449,
0.34246134757995605,
-0.0009012296795845032,
0.08685263991355896,
0.0668104737997055,
0.41682493686676025,
-0.11109815537929535,
0.025238320231437683,
0.21443122625350952,
0.8141875267028809,
-0.2216568887233734,
0.36516642570495605,
-0.041441336274147034,
0.7752063274383545,
0.4021630883216858,
0.07162609696388245,
0.536981999874115,
-0.08786240220069885,
0.37209373712539673,
-0.12092255055904388,
0.08879658579826355,
-0.3847739100456238,
-0.4254860579967499,
-0.07040302455425262,
0.023505203425884247,
0.24427558481693268,
-0.21324452757835388,
-0.0894579216837883,
0.08278708159923553,
0.05193248391151428,
0.4754314124584198,
-0.06767939776182175,
0.050174541771411896,
-0.4635295271873474,
-0.1305239200592041,
-0.48943930864334106,
0.09492114186286926,
-0.10091839730739594,
0.298672080039978,
-0.1002783328294754,
0.052423905581235886,
-0.08476525545120239,
-0.400564044713974,
-0.11753848195075989,
0.23006273806095123,
-0.3619738221168518,
-0.1111319437623024,
0.41072240471839905,
0.029218360781669617,
0.17935508489608765,
0.1878916323184967,
0.35131382942199707,
0.20992429554462433,
-0.21131110191345215,
0.18711820244789124,
-0.18165487051010132,
0.1798686683177948,
-0.06962084770202637,
-0.031888801604509354,
0.3489398658275604,
-0.16454435884952545,
-0.26540204882621765,
0.10513276606798172,
0.015182610601186752,
0.18921807408332825,
0.3227779269218445,
-0.034377455711364746,
0.026716478168964386,
-0.1912180334329605,
0.14055490493774414,
0.09246505796909332,
-0.04810204356908798,
-0.1503223478794098,
0.1378857046365738,
-0.17136864364147186,
-0.3547564744949341,
0.01970772072672844,
0.2752266526222229,
-0.3266913592815399,
0.028695151209831238,
0.5683193802833557,
0.07669565826654434,
0.09275073558092117,
0.5376322269439697,
0.016283534467220306,
-0.13566145300865173,
-0.25321951508522034,
0.07581719756126404,
0.3632071316242218,
-0.9609639048576355,
0.14414191246032715,
0.1217431053519249,
-0.07154956459999084,
0.19456419348716736,
0.24321334064006805,
0.04756106808781624,
-0.02629866823554039,
-0.1503039300441742,
-0.34446489810943604,
-0.2291785329580307,
0.3700813949108124,
-0.2446380853652954,
0.18131406605243683,
-0.03197083994746208,
-0.025889482349157333,
-0.05424557626247406,
0.07983604818582535,
-0.34376412630081177,
-0.018953831866383553,
-0.3142659366130829,
0.0899379700422287,
-0.2805965840816498,
-0.05276798829436302,
0.540861189365387,
0.0515664741396904,
0.20445682108402252,
0.12104026973247528,
-0.3802929222583771,
-0.2386394888162613,
-0.13053299486637115,
0.14632435142993927,
0.06529484689235687,
-0.03204525262117386,
0.04271325469017029,
0.0006800815463066101,
-0.07363580167293549,
-0.11462615430355072,
0.4100819230079651,
-0.012167900800704956,
-0.17518508434295654,
0.19027575850486755,
0.2955870032310486,
0.11734861135482788,
-0.1171002984046936,
-0.03524956852197647,
0.05772487819194794,
0.23764462769031525,
-0.005461573600769043,
-0.043166112154722214,
-0.23660922050476074,
-0.04371930658817291,
0.10039760172367096,
0.29365968704223633,
0.13307051360607147,
-0.00020182505249977112,
0.27501675486564636,
-0.07681603729724884,
-0.3121809959411621,
-0.11170560121536255,
0.16336403787136078,
-0.007077725604176521,
-0.09427586197853088,
-0.1355046033859253,
0.2365323007106781,
0.2007124423980713,
-0.3976680636405945,
0.008898619562387466,
0.09721097350120544,
-0.19625675678253174,
0.1974952071905136,
0.2571916878223419,
0.033522829413414,
-0.20206329226493835,
0.12044847011566162,
0.21816369891166687,
0.32123446464538574,
-0.31153252720832825,
0.09231643378734589,
0.4366133213043213,
-0.09491565078496933,
0.11424455046653748,
0.3538491725921631,
0.19445368647575378,
0.2036350667476654,
0.3951096832752228,
-0.19358579814434052,
0.4623432457447052,
-0.2582816183567047,
-0.09433719515800476,
0.2859722971916199,
-0.2775827646255493,
0.25960588455200195,
0.16791120171546936,
-0.015956901013851166,
-0.10749170184135437,
-0.0687050074338913,
0.2255089282989502,
0.104275181889534,
-0.0506751649081707,
-0.10208988189697266,
0.056389663368463516,
-0.08638721704483032,
-0.02836170606315136,
-0.07218780368566513,
-0.19983534514904022,
-0.4720802307128906,
-0.23859789967536926,
0.059471119195222855,
-0.11003459244966507,
0.2311077117919922,
-0.00713072344660759,
-0.05417671799659729,
-0.2468121200799942,
-0.059798359870910645,
0.11835804581642151,
0.19857165217399597,
-0.1996491253376007,
0.31493282318115234,
0.4178912341594696,
0.17218418419361115,
-0.04546940326690674,
0.49039649963378906,
0.41920459270477295,
0.07617531716823578,
0.08367818593978882,
-0.023948583751916885,
0.06941990554332733,
-0.05957501009106636,
-0.05438914895057678,
0.11935193836688995,
-0.12583065032958984,
0.08025055378675461,
0.21468158066272736,
0.2213076800107956,
-0.23082782328128815,
-0.07628099620342255,
-0.07850828021764755,
0.04514163359999657,
-0.18673518300056458,
0.8627412915229797,
-0.24725256860256195,
-0.08079241961240768,
-0.3325366675853729,
0.016186224296689034,
-0.540527880191803,
-0.12435755133628845,
0.2931482791900635,
-0.13562491536140442,
0.011517789214849472,
-0.38202089071273804,
0.09067712724208832,
-0.1491674780845642,
0.44512999057769775,
0.335243284702301,
0.11445727944374084,
-0.1776750087738037,
-0.11068586260080338,
-0.1790514886379242,
0.331706166267395,
0.3283595144748688,
0.005357526242733002,
-0.016259538009762764,
-0.1995924413204193,
-0.14380158483982086,
-0.12783202528953552,
0.3666839301586151,
-0.12321344763040543,
0.18702983856201172,
-0.05400834605097771,
-0.28555917739868164,
-0.1776101142168045,
-0.19494381546974182,
-0.20804791152477264,
0.0047529712319374084,
-0.29169726371765137,
-0.021304190158843994,
-0.222740039229393,
0.060525208711624146,
-0.07071267068386078,
-0.11539676040410995,
0.2167098969221115,
-0.6964043378829956,
0.39160045981407166,
-0.026251869276165962,
0.09804219007492065,
-0.28332558274269104,
-0.22911326587200165,
-0.0455305352807045,
-0.17159512639045715,
-0.2876105308532715,
0.03375754877924919,
0.11354157328605652,
0.44460630416870117,
0.09175034612417221,
-0.27732592821121216,
-0.19268286228179932,
0.17509818077087402,
0.007046818733215332,
0.3076061010360718,
-0.08485721796751022,
0.6034550070762634,
-0.2972681224346161,
-0.1179053783416748,
0.2515428066253662,
0.06692385673522949,
0.0763266533613205,
0.3060338795185089,
-0.47790372371673584,
-0.5714568495750427,
0.7575868368148804,
-0.22998099029064178,
-0.17040567100048065,
0.04427459090948105,
0.5145431160926819,
-0.13101832568645477,
-0.4468151032924652,
-0.6484676599502563,
0.1553839147090912,
0.3070342540740967,
0.12230147421360016,
-0.2227480709552765,
0.38564786314964294,
-0.1350671648979187,
0.03206928074359894,
-0.01694464683532715,
0.21654130518436432,
-0.0270092710852623,
0.09668462723493576,
0.21126756072044373,
-0.14205919206142426
] |
https://github.com/huggingface/datasets/issues/5690 | For context, I tried to run `import huggingface_hub; huggingface_hub.hf_api.DatasetInfo` in the terminal with different versions of `hfh` and I need to go back to `huggingface_hub==0.7.0` to make it work (latest is 0.13.3). | raise AttributeError(f"No {package_name} attribute {name}") AttributeError: No huggingface_hub attribute hf_api | ### Describe the bug
rta.sh
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
### Reproduction
_No response_
### Logs
```shell
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
```
### System info
```shell
- huggingface_hub version: 0.13.2
- Platform: Linux-5.4.0-144-generic-x86_64-with-glibc2.10
- Python version: 3.8.5
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Token path ?: /home/appuser/.cache/huggingface/token
- Has saved token ?: False
- Configured git credential helpers:
- FastAI: N/A
- Tensorflow: N/A
- Torch: 1.7.1
- Jinja2: N/A
- Graphviz: N/A
- Pydot: N/A
- Pillow: 9.3.0
- hf_transfer: N/A
- ENDPOINT: https://huggingface.co
- HUGGINGFACE_HUB_CACHE: /home/appuser/.cache/huggingface/hub
- HUGGINGFACE_ASSETS_CACHE: /home/appuser/.cache/huggingface/assets
- HF_TOKEN_PATH: /home/appuser/.cache/huggingface/token
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
```
| 32 | raise AttributeError(f"No {package_name} attribute {name}") AttributeError: No huggingface_hub attribute hf_api
### Describe the bug
rta.sh
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
### Reproduction
_No response_
### Logs
```shell
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
```
### System info
```shell
- huggingface_hub version: 0.13.2
- Platform: Linux-5.4.0-144-generic-x86_64-with-glibc2.10
- Python version: 3.8.5
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Token path ?: /home/appuser/.cache/huggingface/token
- Has saved token ?: False
- Configured git credential helpers:
- FastAI: N/A
- Tensorflow: N/A
- Torch: 1.7.1
- Jinja2: N/A
- Graphviz: N/A
- Pydot: N/A
- Pillow: 9.3.0
- hf_transfer: N/A
- ENDPOINT: https://huggingface.co
- HUGGINGFACE_HUB_CACHE: /home/appuser/.cache/huggingface/hub
- HUGGINGFACE_ASSETS_CACHE: /home/appuser/.cache/huggingface/assets
- HF_TOKEN_PATH: /home/appuser/.cache/huggingface/token
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
```
For context, I tried to run `import huggingface_hub; huggingface_hub.hf_api.DatasetInfo` in the terminal with different versions of `hfh` and I need to go back to `huggingface_hub==0.7.0` to make it work (latest is 0.13.3). | [
-0.29969364404678345,
-0.360951691865921,
-0.0473315455019474,
0.36517247557640076,
0.42924559116363525,
-0.0765240490436554,
0.24430179595947266,
0.5703027844429016,
-0.040128376334905624,
0.29361385107040405,
-0.03497811034321785,
0.2826228737831116,
-0.0843978226184845,
0.17554573714733124,
-0.02682824432849884,
-0.19096022844314575,
-0.05914785712957382,
0.25455689430236816,
-0.03866518661379814,
-0.14724645018577576,
-0.2056066393852234,
0.3731883764266968,
0.05612371861934662,
0.13078366219997406,
-0.2853156328201294,
0.02753731794655323,
0.2529347538948059,
0.0238802433013916,
-0.033541932702064514,
-0.489665687084198,
0.02938491851091385,
-0.27412548661231995,
-0.04647703468799591,
0.28895387053489685,
-0.00011611108493525535,
0.19851337373256683,
0.2584739923477173,
0.08023903518915176,
-0.37375783920288086,
-0.07866969704627991,
0.058480799198150635,
-0.085626982152462,
0.11854662001132965,
-0.04772341251373291,
-0.2620267868041992,
-0.2870790362358093,
-0.0878840833902359,
0.01272391527891159,
0.20415039360523224,
0.3090120553970337,
0.24126113951206207,
0.5026150941848755,
0.283448189496994,
-0.15697011351585388,
0.29825788736343384,
0.09043288230895996,
-0.21911989152431488,
0.22013455629348755,
-0.046653930097818375,
0.3931621015071869,
0.02241663821041584,
0.2623996138572693,
0.19847151637077332,
0.12684981524944305,
0.33373576402664185,
-0.007890699431300163,
0.08321906626224518,
-0.17132344841957092,
0.15468163788318634,
0.21474701166152954,
0.31638696789741516,
-0.29171130061149597,
-0.43629831075668335,
-0.04178589582443237,
0.1710101217031479,
-0.22915847599506378,
0.16592265665531158,
-0.15431064367294312,
-0.2251628339290619,
-0.06890222430229187,
0.04603920504450798,
-0.2893056869506836,
-0.13509050011634827,
-0.06226056069135666,
-0.029606133699417114,
0.32936519384384155,
-0.18040181696414948,
0.01646612025797367,
-0.11362311244010925,
-0.20517487823963165,
-0.20587536692619324,
-0.04456590116024017,
-0.05597248673439026,
0.08962525427341461,
-0.4374370276927948,
-0.09517419338226318,
0.15391671657562256,
0.29335033893585205,
0.11527760326862335,
0.33648571372032166,
-0.17608597874641418,
0.08261299133300781,
0.09922656416893005,
0.006125490181148052,
-0.2499818056821823,
0.35728392004966736,
0.07713627815246582,
-0.022004619240760803,
0.19918228685855865,
0.25301387906074524,
-0.16846498847007751,
-0.031977370381355286,
-0.16290497779846191,
-0.0670204684138298,
-0.10171579569578171,
0.023442823439836502,
0.4287319779396057,
-0.010219670832157135,
-0.3510046899318695,
0.18489453196525574,
-0.07995317131280899,
0.07573926448822021,
0.12272020429372787,
0.48695164918899536,
-0.016107551753520966,
0.16402484476566315,
0.10949671268463135,
0.11027195304632187,
-0.22691074013710022,
-0.06569059938192368,
-0.33096185326576233,
0.05522313341498375,
-0.1061006486415863,
-0.0391291081905365,
0.026172354817390442,
-0.39842963218688965,
0.2927667498588562,
-0.04978813976049423,
0.2735527455806732,
0.03474035859107971,
-0.11855195462703705,
-0.09065088629722595,
-0.05966896191239357,
0.3094324767589569,
-0.1371840089559555,
0.20990528166294098,
0.35144177079200745,
-0.1799963116645813,
0.028938472270965576,
-0.2327691912651062,
-0.2573646306991577,
-0.2598334550857544,
-0.3349611759185791,
0.23367688059806824,
0.001190185546875,
-0.020989857614040375,
-0.2401987761259079,
-0.22251909971237183,
0.10403002798557281,
-0.02106615900993347,
0.07214932888746262,
0.057469937950372696,
-0.039882756769657135,
-0.21316394209861755,
0.36665859818458557,
0.36527830362319946,
0.03471112251281738,
-0.15335795283317566,
-0.10271641612052917,
-0.22745931148529053,
-0.012447547167539597,
-0.10422029346227646,
0.1789565533399582,
0.41561558842658997,
-0.36446279287338257,
-0.16134336590766907,
0.3064948320388794,
-0.5216859579086304,
-0.27446448802948,
0.07101894915103912,
-0.2747781574726105,
-0.025112595409154892,
0.3209579885005951,
-0.1389719843864441,
-0.09500323235988617,
0.040774472057819366,
0.15176552534103394,
-0.0817786306142807,
0.07088488340377808,
0.053183987736701965,
-0.17902331054210663,
-0.10872186720371246,
-0.19265371561050415,
0.06066523492336273,
0.22294403612613678,
0.11614128947257996,
0.026364214718341827,
-0.01928003877401352,
0.25042107701301575,
-0.06036687642335892,
0.09164565801620483,
0.08750797063112259,
0.2909906804561615,
-0.12294895946979523,
0.051403798162937164,
-0.21435710787773132,
-0.23453328013420105,
0.22484955191612244,
-0.22768564522266388,
0.15318261086940765,
-0.10081176459789276,
-0.19903069734573364,
-0.3678542971611023,
0.12783271074295044,
-0.18575654923915863,
-0.3284617066383362,
0.21645863354206085,
0.3954618275165558,
-0.1303146332502365,
0.03071735054254532,
-0.27096205949783325,
0.24678100645542145,
-0.142232283949852,
0.1942676603794098,
-0.2743437588214874,
0.38686826825141907,
-0.03905637562274933,
-0.07157404720783234,
-0.04388885572552681,
0.3905086815357208,
0.10940564423799515,
-0.016370683908462524,
-0.019542725756764412,
0.3084239363670349,
0.026739880442619324,
0.22637450695037842,
-0.05918733403086662,
-0.1446184515953064,
0.07953745126724243,
-0.020326033234596252,
-0.12829060852527618,
-0.04051600396633148,
0.18193095922470093,
0.05581919848918915,
0.46952131390571594,
0.22545063495635986,
0.1573638617992401,
0.29507237672805786,
0.2691675126552582,
-0.005775164812803268,
-0.01615557074546814,
0.013827994465827942,
0.07596033811569214,
-0.3035942018032074,
0.22575262188911438,
0.0011287517845630646,
0.23675698041915894,
-0.08208766579627991,
-0.13041740655899048,
0.18962913751602173,
0.6611875295639038,
0.22643063962459564,
0.0914614349603653,
0.03648513928055763,
-0.2986430525779724,
0.12929393351078033,
0.19632825255393982,
0.29482337832450867,
0.4488080143928528,
0.1639544516801834,
-0.28535786271095276,
0.20359782874584198,
0.2073144018650055,
-0.06716994196176529,
0.28197401762008667,
0.032900989055633545,
0.2815844714641571,
0.31332194805145264,
0.0011806972324848175,
0.043400999158620834,
-0.20596778392791748,
-0.4554417133331299,
-0.24151656031608582,
0.21743589639663696,
-0.4095039665699005,
-0.2129843831062317,
-0.15050660073757172,
0.005681812763214111,
-0.2964482307434082,
-0.29656848311424255,
-0.15628977119922638,
-0.3524490296840668,
-0.01992235705256462,
-0.009097620844841003,
-0.06194990128278732,
0.27388840913772583,
-0.08484785258769989,
0.07384216785430908,
-0.08041388541460037,
-0.20722176134586334,
-0.3455277681350708,
0.10861807316541672,
-0.1305142641067505,
0.061422258615493774,
-0.12438899278640747,
-0.009665891528129578,
0.24652938544750214,
-0.29626816511154175,
0.2464676797389984,
-0.2577045261859894,
-0.33934712409973145,
0.2439153492450714,
-0.22514936327934265,
0.11959108710289001,
0.30845752358436584,
0.021522218361496925,
-0.07286149263381958,
-0.42533668875694275,
0.3223522901535034,
-0.19538897275924683,
-0.30086666345596313,
0.22221159934997559,
-0.005048677325248718,
-0.16886906325817108,
-0.11367690563201904,
-0.22106635570526123,
-0.05080444738268852,
-0.5772792100906372,
0.04078662395477295,
0.15290288627147675,
0.19804388284683228,
0.19345276057720184,
-0.15300533175468445,
0.5401797890663147,
-0.32464444637298584,
0.2780669033527374,
-0.0176892951130867,
-0.009241268038749695,
0.11539888381958008,
-0.32098352909088135,
-0.2969074845314026,
-0.09765664488077164,
-0.09720253944396973,
0.5725787878036499,
-0.15846875309944153,
-0.33124637603759766,
-0.4182804822921753,
-0.22205211222171783,
0.11234362423419952,
-0.20712144672870636,
0.21936729550361633,
0.2523218095302582,
0.08523127436637878,
-0.19786396622657776,
-0.1529279351234436,
0.12671296298503876,
0.09678182005882263,
-0.21820750832557678,
-0.06614427268505096,
0.08144094794988632,
0.12166209518909454,
-0.2222018837928772,
0.6714597940444946,
0.35465502738952637,
-0.22577394545078278,
0.45274803042411804,
-0.2919066548347473,
0.44515344500541687,
-0.16965988278388977,
-0.4704485535621643,
0.0030110329389572144,
0.29061514139175415,
0.18668654561042786,
0.23685896396636963,
-0.046010635793209076,
0.4573207199573517,
-0.22460603713989258,
-0.18577393889427185,
-0.09310866892337799,
-0.33272624015808105,
-0.2218465805053711,
-0.21204668283462524,
0.06546932458877563,
-0.20025818049907684,
0.08928771317005157,
-0.14364829659461975,
0.03532934933900833,
0.27318525314331055,
0.23237335681915283,
-0.17678813636302948,
-0.18338191509246826,
-0.17046025395393372,
-0.43847256898880005,
-0.4346930980682373,
0.30717307329177856,
0.06895433366298676,
0.33722078800201416,
-0.002461828291416168,
-0.1707439422607422,
0.04078635200858116,
-0.06782034784555435,
0.5648620128631592,
-0.013176700100302696,
0.30555519461631775,
-0.02624502032995224,
-0.007447034120559692,
-0.3988984227180481,
0.16042178869247437,
-0.11173872649669647,
-0.004100628197193146,
-0.30267229676246643,
0.6093240976333618,
-0.17852257192134857,
-0.47355014085769653,
0.23993024230003357,
-0.0385420061647892,
0.011232279241085052,
0.1891150027513504,
-0.31454354524612427,
-0.28050702810287476,
-0.2763124108314514,
-0.05235349386930466,
-0.05396333336830139,
0.3771185576915741,
0.1592031568288803,
-0.07513627409934998,
-0.2827557325363159,
-0.1262236386537552,
-0.043318383395671844,
0.08763928711414337,
0.2446240335702896,
-0.07648679614067078,
0.12946484982967377,
-0.06447403132915497,
-0.005421480163931847,
0.21335013210773468,
0.6559127569198608,
-0.1366121470928192,
-0.38372376561164856,
-0.13088230788707733,
0.095582515001297,
0.22248539328575134,
0.2574021518230438,
-0.3160611093044281,
0.29104575514793396,
-0.37916627526283264,
0.4417097568511963,
-0.24977943301200867,
-0.04232088476419449,
0.34246134757995605,
-0.0009012296795845032,
0.08685263991355896,
0.0668104737997055,
0.41682493686676025,
-0.11109815537929535,
0.025238320231437683,
0.21443122625350952,
0.8141875267028809,
-0.2216568887233734,
0.36516642570495605,
-0.041441336274147034,
0.7752063274383545,
0.4021630883216858,
0.07162609696388245,
0.536981999874115,
-0.08786240220069885,
0.37209373712539673,
-0.12092255055904388,
0.08879658579826355,
-0.3847739100456238,
-0.4254860579967499,
-0.07040302455425262,
0.023505203425884247,
0.24427558481693268,
-0.21324452757835388,
-0.0894579216837883,
0.08278708159923553,
0.05193248391151428,
0.4754314124584198,
-0.06767939776182175,
0.050174541771411896,
-0.4635295271873474,
-0.1305239200592041,
-0.48943930864334106,
0.09492114186286926,
-0.10091839730739594,
0.298672080039978,
-0.1002783328294754,
0.052423905581235886,
-0.08476525545120239,
-0.400564044713974,
-0.11753848195075989,
0.23006273806095123,
-0.3619738221168518,
-0.1111319437623024,
0.41072240471839905,
0.029218360781669617,
0.17935508489608765,
0.1878916323184967,
0.35131382942199707,
0.20992429554462433,
-0.21131110191345215,
0.18711820244789124,
-0.18165487051010132,
0.1798686683177948,
-0.06962084770202637,
-0.031888801604509354,
0.3489398658275604,
-0.16454435884952545,
-0.26540204882621765,
0.10513276606798172,
0.015182610601186752,
0.18921807408332825,
0.3227779269218445,
-0.034377455711364746,
0.026716478168964386,
-0.1912180334329605,
0.14055490493774414,
0.09246505796909332,
-0.04810204356908798,
-0.1503223478794098,
0.1378857046365738,
-0.17136864364147186,
-0.3547564744949341,
0.01970772072672844,
0.2752266526222229,
-0.3266913592815399,
0.028695151209831238,
0.5683193802833557,
0.07669565826654434,
0.09275073558092117,
0.5376322269439697,
0.016283534467220306,
-0.13566145300865173,
-0.25321951508522034,
0.07581719756126404,
0.3632071316242218,
-0.9609639048576355,
0.14414191246032715,
0.1217431053519249,
-0.07154956459999084,
0.19456419348716736,
0.24321334064006805,
0.04756106808781624,
-0.02629866823554039,
-0.1503039300441742,
-0.34446489810943604,
-0.2291785329580307,
0.3700813949108124,
-0.2446380853652954,
0.18131406605243683,
-0.03197083994746208,
-0.025889482349157333,
-0.05424557626247406,
0.07983604818582535,
-0.34376412630081177,
-0.018953831866383553,
-0.3142659366130829,
0.0899379700422287,
-0.2805965840816498,
-0.05276798829436302,
0.540861189365387,
0.0515664741396904,
0.20445682108402252,
0.12104026973247528,
-0.3802929222583771,
-0.2386394888162613,
-0.13053299486637115,
0.14632435142993927,
0.06529484689235687,
-0.03204525262117386,
0.04271325469017029,
0.0006800815463066101,
-0.07363580167293549,
-0.11462615430355072,
0.4100819230079651,
-0.012167900800704956,
-0.17518508434295654,
0.19027575850486755,
0.2955870032310486,
0.11734861135482788,
-0.1171002984046936,
-0.03524956852197647,
0.05772487819194794,
0.23764462769031525,
-0.005461573600769043,
-0.043166112154722214,
-0.23660922050476074,
-0.04371930658817291,
0.10039760172367096,
0.29365968704223633,
0.13307051360607147,
-0.00020182505249977112,
0.27501675486564636,
-0.07681603729724884,
-0.3121809959411621,
-0.11170560121536255,
0.16336403787136078,
-0.007077725604176521,
-0.09427586197853088,
-0.1355046033859253,
0.2365323007106781,
0.2007124423980713,
-0.3976680636405945,
0.008898619562387466,
0.09721097350120544,
-0.19625675678253174,
0.1974952071905136,
0.2571916878223419,
0.033522829413414,
-0.20206329226493835,
0.12044847011566162,
0.21816369891166687,
0.32123446464538574,
-0.31153252720832825,
0.09231643378734589,
0.4366133213043213,
-0.09491565078496933,
0.11424455046653748,
0.3538491725921631,
0.19445368647575378,
0.2036350667476654,
0.3951096832752228,
-0.19358579814434052,
0.4623432457447052,
-0.2582816183567047,
-0.09433719515800476,
0.2859722971916199,
-0.2775827646255493,
0.25960588455200195,
0.16791120171546936,
-0.015956901013851166,
-0.10749170184135437,
-0.0687050074338913,
0.2255089282989502,
0.104275181889534,
-0.0506751649081707,
-0.10208988189697266,
0.056389663368463516,
-0.08638721704483032,
-0.02836170606315136,
-0.07218780368566513,
-0.19983534514904022,
-0.4720802307128906,
-0.23859789967536926,
0.059471119195222855,
-0.11003459244966507,
0.2311077117919922,
-0.00713072344660759,
-0.05417671799659729,
-0.2468121200799942,
-0.059798359870910645,
0.11835804581642151,
0.19857165217399597,
-0.1996491253376007,
0.31493282318115234,
0.4178912341594696,
0.17218418419361115,
-0.04546940326690674,
0.49039649963378906,
0.41920459270477295,
0.07617531716823578,
0.08367818593978882,
-0.023948583751916885,
0.06941990554332733,
-0.05957501009106636,
-0.05438914895057678,
0.11935193836688995,
-0.12583065032958984,
0.08025055378675461,
0.21468158066272736,
0.2213076800107956,
-0.23082782328128815,
-0.07628099620342255,
-0.07850828021764755,
0.04514163359999657,
-0.18673518300056458,
0.8627412915229797,
-0.24725256860256195,
-0.08079241961240768,
-0.3325366675853729,
0.016186224296689034,
-0.540527880191803,
-0.12435755133628845,
0.2931482791900635,
-0.13562491536140442,
0.011517789214849472,
-0.38202089071273804,
0.09067712724208832,
-0.1491674780845642,
0.44512999057769775,
0.335243284702301,
0.11445727944374084,
-0.1776750087738037,
-0.11068586260080338,
-0.1790514886379242,
0.331706166267395,
0.3283595144748688,
0.005357526242733002,
-0.016259538009762764,
-0.1995924413204193,
-0.14380158483982086,
-0.12783202528953552,
0.3666839301586151,
-0.12321344763040543,
0.18702983856201172,
-0.05400834605097771,
-0.28555917739868164,
-0.1776101142168045,
-0.19494381546974182,
-0.20804791152477264,
0.0047529712319374084,
-0.29169726371765137,
-0.021304190158843994,
-0.222740039229393,
0.060525208711624146,
-0.07071267068386078,
-0.11539676040410995,
0.2167098969221115,
-0.6964043378829956,
0.39160045981407166,
-0.026251869276165962,
0.09804219007492065,
-0.28332558274269104,
-0.22911326587200165,
-0.0455305352807045,
-0.17159512639045715,
-0.2876105308532715,
0.03375754877924919,
0.11354157328605652,
0.44460630416870117,
0.09175034612417221,
-0.27732592821121216,
-0.19268286228179932,
0.17509818077087402,
0.007046818733215332,
0.3076061010360718,
-0.08485721796751022,
0.6034550070762634,
-0.2972681224346161,
-0.1179053783416748,
0.2515428066253662,
0.06692385673522949,
0.0763266533613205,
0.3060338795185089,
-0.47790372371673584,
-0.5714568495750427,
0.7575868368148804,
-0.22998099029064178,
-0.17040567100048065,
0.04427459090948105,
0.5145431160926819,
-0.13101832568645477,
-0.4468151032924652,
-0.6484676599502563,
0.1553839147090912,
0.3070342540740967,
0.12230147421360016,
-0.2227480709552765,
0.38564786314964294,
-0.1350671648979187,
0.03206928074359894,
-0.01694464683532715,
0.21654130518436432,
-0.0270092710852623,
0.09668462723493576,
0.21126756072044373,
-0.14205919206142426
] |
https://github.com/huggingface/datasets/issues/5690 | Before the error happens at line 120 in `data_files.py`, `datasets.filesystems.hffilesystem` is imported at the top of `data_files.py` and this file does `from huggingface_hub.hf_api import DatasetInfo` - so `huggingface_hub.hf_api` is imported. Not sure how the error could happen, what version of `datasets` are you using @wccccp ? | raise AttributeError(f"No {package_name} attribute {name}") AttributeError: No huggingface_hub attribute hf_api | ### Describe the bug
rta.sh
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
### Reproduction
_No response_
### Logs
```shell
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
```
### System info
```shell
- huggingface_hub version: 0.13.2
- Platform: Linux-5.4.0-144-generic-x86_64-with-glibc2.10
- Python version: 3.8.5
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Token path ?: /home/appuser/.cache/huggingface/token
- Has saved token ?: False
- Configured git credential helpers:
- FastAI: N/A
- Tensorflow: N/A
- Torch: 1.7.1
- Jinja2: N/A
- Graphviz: N/A
- Pydot: N/A
- Pillow: 9.3.0
- hf_transfer: N/A
- ENDPOINT: https://huggingface.co
- HUGGINGFACE_HUB_CACHE: /home/appuser/.cache/huggingface/hub
- HUGGINGFACE_ASSETS_CACHE: /home/appuser/.cache/huggingface/assets
- HF_TOKEN_PATH: /home/appuser/.cache/huggingface/token
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
```
| 46 | raise AttributeError(f"No {package_name} attribute {name}") AttributeError: No huggingface_hub attribute hf_api
### Describe the bug
rta.sh
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
### Reproduction
_No response_
### Logs
```shell
Traceback (most recent call last):
File "run.py", line 7, in <module>
import datasets
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/__init__.py", line 37, in <module>
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/builder.py", line 44, in <module>
from .data_files import DataFilesDict, _sanitize_patterns
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/datasets/data_files.py", line 120, in <module>
dataset_info: huggingface_hub.hf_api.DatasetInfo,
File "/home/appuser/miniconda3/envs/pt2/lib/python3.8/site-packages/huggingface_hub/__init__.py", line 290, in __getattr__
raise AttributeError(f"No {package_name} attribute {name}")
AttributeError: No huggingface_hub attribute hf_api
```
### System info
```shell
- huggingface_hub version: 0.13.2
- Platform: Linux-5.4.0-144-generic-x86_64-with-glibc2.10
- Python version: 3.8.5
- Running in iPython ?: No
- Running in notebook ?: No
- Running in Google Colab ?: No
- Token path ?: /home/appuser/.cache/huggingface/token
- Has saved token ?: False
- Configured git credential helpers:
- FastAI: N/A
- Tensorflow: N/A
- Torch: 1.7.1
- Jinja2: N/A
- Graphviz: N/A
- Pydot: N/A
- Pillow: 9.3.0
- hf_transfer: N/A
- ENDPOINT: https://huggingface.co
- HUGGINGFACE_HUB_CACHE: /home/appuser/.cache/huggingface/hub
- HUGGINGFACE_ASSETS_CACHE: /home/appuser/.cache/huggingface/assets
- HF_TOKEN_PATH: /home/appuser/.cache/huggingface/token
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
```
Before the error happens at line 120 in `data_files.py`, `datasets.filesystems.hffilesystem` is imported at the top of `data_files.py` and this file does `from huggingface_hub.hf_api import DatasetInfo` - so `huggingface_hub.hf_api` is imported. Not sure how the error could happen, what version of `datasets` are you using @wccccp ? | [
-0.29969364404678345,
-0.360951691865921,
-0.0473315455019474,
0.36517247557640076,
0.42924559116363525,
-0.0765240490436554,
0.24430179595947266,
0.5703027844429016,
-0.040128376334905624,
0.29361385107040405,
-0.03497811034321785,
0.2826228737831116,
-0.0843978226184845,
0.17554573714733124,
-0.02682824432849884,
-0.19096022844314575,
-0.05914785712957382,
0.25455689430236816,
-0.03866518661379814,
-0.14724645018577576,
-0.2056066393852234,
0.3731883764266968,
0.05612371861934662,
0.13078366219997406,
-0.2853156328201294,
0.02753731794655323,
0.2529347538948059,
0.0238802433013916,
-0.033541932702064514,
-0.489665687084198,
0.02938491851091385,
-0.27412548661231995,
-0.04647703468799591,
0.28895387053489685,
-0.00011611108493525535,
0.19851337373256683,
0.2584739923477173,
0.08023903518915176,
-0.37375783920288086,
-0.07866969704627991,
0.058480799198150635,
-0.085626982152462,
0.11854662001132965,
-0.04772341251373291,
-0.2620267868041992,
-0.2870790362358093,
-0.0878840833902359,
0.01272391527891159,
0.20415039360523224,
0.3090120553970337,
0.24126113951206207,
0.5026150941848755,
0.283448189496994,
-0.15697011351585388,
0.29825788736343384,
0.09043288230895996,
-0.21911989152431488,
0.22013455629348755,
-0.046653930097818375,
0.3931621015071869,
0.02241663821041584,
0.2623996138572693,
0.19847151637077332,
0.12684981524944305,
0.33373576402664185,
-0.007890699431300163,
0.08321906626224518,
-0.17132344841957092,
0.15468163788318634,
0.21474701166152954,
0.31638696789741516,
-0.29171130061149597,
-0.43629831075668335,
-0.04178589582443237,
0.1710101217031479,
-0.22915847599506378,
0.16592265665531158,
-0.15431064367294312,
-0.2251628339290619,
-0.06890222430229187,
0.04603920504450798,
-0.2893056869506836,
-0.13509050011634827,
-0.06226056069135666,
-0.029606133699417114,
0.32936519384384155,
-0.18040181696414948,
0.01646612025797367,
-0.11362311244010925,
-0.20517487823963165,
-0.20587536692619324,
-0.04456590116024017,
-0.05597248673439026,
0.08962525427341461,
-0.4374370276927948,
-0.09517419338226318,
0.15391671657562256,
0.29335033893585205,
0.11527760326862335,
0.33648571372032166,
-0.17608597874641418,
0.08261299133300781,
0.09922656416893005,
0.006125490181148052,
-0.2499818056821823,
0.35728392004966736,
0.07713627815246582,
-0.022004619240760803,
0.19918228685855865,
0.25301387906074524,
-0.16846498847007751,
-0.031977370381355286,
-0.16290497779846191,
-0.0670204684138298,
-0.10171579569578171,
0.023442823439836502,
0.4287319779396057,
-0.010219670832157135,
-0.3510046899318695,
0.18489453196525574,
-0.07995317131280899,
0.07573926448822021,
0.12272020429372787,
0.48695164918899536,
-0.016107551753520966,
0.16402484476566315,
0.10949671268463135,
0.11027195304632187,
-0.22691074013710022,
-0.06569059938192368,
-0.33096185326576233,
0.05522313341498375,
-0.1061006486415863,
-0.0391291081905365,
0.026172354817390442,
-0.39842963218688965,
0.2927667498588562,
-0.04978813976049423,
0.2735527455806732,
0.03474035859107971,
-0.11855195462703705,
-0.09065088629722595,
-0.05966896191239357,
0.3094324767589569,
-0.1371840089559555,
0.20990528166294098,
0.35144177079200745,
-0.1799963116645813,
0.028938472270965576,
-0.2327691912651062,
-0.2573646306991577,
-0.2598334550857544,
-0.3349611759185791,
0.23367688059806824,
0.001190185546875,
-0.020989857614040375,
-0.2401987761259079,
-0.22251909971237183,
0.10403002798557281,
-0.02106615900993347,
0.07214932888746262,
0.057469937950372696,
-0.039882756769657135,
-0.21316394209861755,
0.36665859818458557,
0.36527830362319946,
0.03471112251281738,
-0.15335795283317566,
-0.10271641612052917,
-0.22745931148529053,
-0.012447547167539597,
-0.10422029346227646,
0.1789565533399582,
0.41561558842658997,
-0.36446279287338257,
-0.16134336590766907,
0.3064948320388794,
-0.5216859579086304,
-0.27446448802948,
0.07101894915103912,
-0.2747781574726105,
-0.025112595409154892,
0.3209579885005951,
-0.1389719843864441,
-0.09500323235988617,
0.040774472057819366,
0.15176552534103394,
-0.0817786306142807,
0.07088488340377808,
0.053183987736701965,
-0.17902331054210663,
-0.10872186720371246,
-0.19265371561050415,
0.06066523492336273,
0.22294403612613678,
0.11614128947257996,
0.026364214718341827,
-0.01928003877401352,
0.25042107701301575,
-0.06036687642335892,
0.09164565801620483,
0.08750797063112259,
0.2909906804561615,
-0.12294895946979523,
0.051403798162937164,
-0.21435710787773132,
-0.23453328013420105,
0.22484955191612244,
-0.22768564522266388,
0.15318261086940765,
-0.10081176459789276,
-0.19903069734573364,
-0.3678542971611023,
0.12783271074295044,
-0.18575654923915863,
-0.3284617066383362,
0.21645863354206085,
0.3954618275165558,
-0.1303146332502365,
0.03071735054254532,
-0.27096205949783325,
0.24678100645542145,
-0.142232283949852,
0.1942676603794098,
-0.2743437588214874,
0.38686826825141907,
-0.03905637562274933,
-0.07157404720783234,
-0.04388885572552681,
0.3905086815357208,
0.10940564423799515,
-0.016370683908462524,
-0.019542725756764412,
0.3084239363670349,
0.026739880442619324,
0.22637450695037842,
-0.05918733403086662,
-0.1446184515953064,
0.07953745126724243,
-0.020326033234596252,
-0.12829060852527618,
-0.04051600396633148,
0.18193095922470093,
0.05581919848918915,
0.46952131390571594,
0.22545063495635986,
0.1573638617992401,
0.29507237672805786,
0.2691675126552582,
-0.005775164812803268,
-0.01615557074546814,
0.013827994465827942,
0.07596033811569214,
-0.3035942018032074,
0.22575262188911438,
0.0011287517845630646,
0.23675698041915894,
-0.08208766579627991,
-0.13041740655899048,
0.18962913751602173,
0.6611875295639038,
0.22643063962459564,
0.0914614349603653,
0.03648513928055763,
-0.2986430525779724,
0.12929393351078033,
0.19632825255393982,
0.29482337832450867,
0.4488080143928528,
0.1639544516801834,
-0.28535786271095276,
0.20359782874584198,
0.2073144018650055,
-0.06716994196176529,
0.28197401762008667,
0.032900989055633545,
0.2815844714641571,
0.31332194805145264,
0.0011806972324848175,
0.043400999158620834,
-0.20596778392791748,
-0.4554417133331299,
-0.24151656031608582,
0.21743589639663696,
-0.4095039665699005,
-0.2129843831062317,
-0.15050660073757172,
0.005681812763214111,
-0.2964482307434082,
-0.29656848311424255,
-0.15628977119922638,
-0.3524490296840668,
-0.01992235705256462,
-0.009097620844841003,
-0.06194990128278732,
0.27388840913772583,
-0.08484785258769989,
0.07384216785430908,
-0.08041388541460037,
-0.20722176134586334,
-0.3455277681350708,
0.10861807316541672,
-0.1305142641067505,
0.061422258615493774,
-0.12438899278640747,
-0.009665891528129578,
0.24652938544750214,
-0.29626816511154175,
0.2464676797389984,
-0.2577045261859894,
-0.33934712409973145,
0.2439153492450714,
-0.22514936327934265,
0.11959108710289001,
0.30845752358436584,
0.021522218361496925,
-0.07286149263381958,
-0.42533668875694275,
0.3223522901535034,
-0.19538897275924683,
-0.30086666345596313,
0.22221159934997559,
-0.005048677325248718,
-0.16886906325817108,
-0.11367690563201904,
-0.22106635570526123,
-0.05080444738268852,
-0.5772792100906372,
0.04078662395477295,
0.15290288627147675,
0.19804388284683228,
0.19345276057720184,
-0.15300533175468445,
0.5401797890663147,
-0.32464444637298584,
0.2780669033527374,
-0.0176892951130867,
-0.009241268038749695,
0.11539888381958008,
-0.32098352909088135,
-0.2969074845314026,
-0.09765664488077164,
-0.09720253944396973,
0.5725787878036499,
-0.15846875309944153,
-0.33124637603759766,
-0.4182804822921753,
-0.22205211222171783,
0.11234362423419952,
-0.20712144672870636,
0.21936729550361633,
0.2523218095302582,
0.08523127436637878,
-0.19786396622657776,
-0.1529279351234436,
0.12671296298503876,
0.09678182005882263,
-0.21820750832557678,
-0.06614427268505096,
0.08144094794988632,
0.12166209518909454,
-0.2222018837928772,
0.6714597940444946,
0.35465502738952637,
-0.22577394545078278,
0.45274803042411804,
-0.2919066548347473,
0.44515344500541687,
-0.16965988278388977,
-0.4704485535621643,
0.0030110329389572144,
0.29061514139175415,
0.18668654561042786,
0.23685896396636963,
-0.046010635793209076,
0.4573207199573517,
-0.22460603713989258,
-0.18577393889427185,
-0.09310866892337799,
-0.33272624015808105,
-0.2218465805053711,
-0.21204668283462524,
0.06546932458877563,
-0.20025818049907684,
0.08928771317005157,
-0.14364829659461975,
0.03532934933900833,
0.27318525314331055,
0.23237335681915283,
-0.17678813636302948,
-0.18338191509246826,
-0.17046025395393372,
-0.43847256898880005,
-0.4346930980682373,
0.30717307329177856,
0.06895433366298676,
0.33722078800201416,
-0.002461828291416168,
-0.1707439422607422,
0.04078635200858116,
-0.06782034784555435,
0.5648620128631592,
-0.013176700100302696,
0.30555519461631775,
-0.02624502032995224,
-0.007447034120559692,
-0.3988984227180481,
0.16042178869247437,
-0.11173872649669647,
-0.004100628197193146,
-0.30267229676246643,
0.6093240976333618,
-0.17852257192134857,
-0.47355014085769653,
0.23993024230003357,
-0.0385420061647892,
0.011232279241085052,
0.1891150027513504,
-0.31454354524612427,
-0.28050702810287476,
-0.2763124108314514,
-0.05235349386930466,
-0.05396333336830139,
0.3771185576915741,
0.1592031568288803,
-0.07513627409934998,
-0.2827557325363159,
-0.1262236386537552,
-0.043318383395671844,
0.08763928711414337,
0.2446240335702896,
-0.07648679614067078,
0.12946484982967377,
-0.06447403132915497,
-0.005421480163931847,
0.21335013210773468,
0.6559127569198608,
-0.1366121470928192,
-0.38372376561164856,
-0.13088230788707733,
0.095582515001297,
0.22248539328575134,
0.2574021518230438,
-0.3160611093044281,
0.29104575514793396,
-0.37916627526283264,
0.4417097568511963,
-0.24977943301200867,
-0.04232088476419449,
0.34246134757995605,
-0.0009012296795845032,
0.08685263991355896,
0.0668104737997055,
0.41682493686676025,
-0.11109815537929535,
0.025238320231437683,
0.21443122625350952,
0.8141875267028809,
-0.2216568887233734,
0.36516642570495605,
-0.041441336274147034,
0.7752063274383545,
0.4021630883216858,
0.07162609696388245,
0.536981999874115,
-0.08786240220069885,
0.37209373712539673,
-0.12092255055904388,
0.08879658579826355,
-0.3847739100456238,
-0.4254860579967499,
-0.07040302455425262,
0.023505203425884247,
0.24427558481693268,
-0.21324452757835388,
-0.0894579216837883,
0.08278708159923553,
0.05193248391151428,
0.4754314124584198,
-0.06767939776182175,
0.050174541771411896,
-0.4635295271873474,
-0.1305239200592041,
-0.48943930864334106,
0.09492114186286926,
-0.10091839730739594,
0.298672080039978,
-0.1002783328294754,
0.052423905581235886,
-0.08476525545120239,
-0.400564044713974,
-0.11753848195075989,
0.23006273806095123,
-0.3619738221168518,
-0.1111319437623024,
0.41072240471839905,
0.029218360781669617,
0.17935508489608765,
0.1878916323184967,
0.35131382942199707,
0.20992429554462433,
-0.21131110191345215,
0.18711820244789124,
-0.18165487051010132,
0.1798686683177948,
-0.06962084770202637,
-0.031888801604509354,
0.3489398658275604,
-0.16454435884952545,
-0.26540204882621765,
0.10513276606798172,
0.015182610601186752,
0.18921807408332825,
0.3227779269218445,
-0.034377455711364746,
0.026716478168964386,
-0.1912180334329605,
0.14055490493774414,
0.09246505796909332,
-0.04810204356908798,
-0.1503223478794098,
0.1378857046365738,
-0.17136864364147186,
-0.3547564744949341,
0.01970772072672844,
0.2752266526222229,
-0.3266913592815399,
0.028695151209831238,
0.5683193802833557,
0.07669565826654434,
0.09275073558092117,
0.5376322269439697,
0.016283534467220306,
-0.13566145300865173,
-0.25321951508522034,
0.07581719756126404,
0.3632071316242218,
-0.9609639048576355,
0.14414191246032715,
0.1217431053519249,
-0.07154956459999084,
0.19456419348716736,
0.24321334064006805,
0.04756106808781624,
-0.02629866823554039,
-0.1503039300441742,
-0.34446489810943604,
-0.2291785329580307,
0.3700813949108124,
-0.2446380853652954,
0.18131406605243683,
-0.03197083994746208,
-0.025889482349157333,
-0.05424557626247406,
0.07983604818582535,
-0.34376412630081177,
-0.018953831866383553,
-0.3142659366130829,
0.0899379700422287,
-0.2805965840816498,
-0.05276798829436302,
0.540861189365387,
0.0515664741396904,
0.20445682108402252,
0.12104026973247528,
-0.3802929222583771,
-0.2386394888162613,
-0.13053299486637115,
0.14632435142993927,
0.06529484689235687,
-0.03204525262117386,
0.04271325469017029,
0.0006800815463066101,
-0.07363580167293549,
-0.11462615430355072,
0.4100819230079651,
-0.012167900800704956,
-0.17518508434295654,
0.19027575850486755,
0.2955870032310486,
0.11734861135482788,
-0.1171002984046936,
-0.03524956852197647,
0.05772487819194794,
0.23764462769031525,
-0.005461573600769043,
-0.043166112154722214,
-0.23660922050476074,
-0.04371930658817291,
0.10039760172367096,
0.29365968704223633,
0.13307051360607147,
-0.00020182505249977112,
0.27501675486564636,
-0.07681603729724884,
-0.3121809959411621,
-0.11170560121536255,
0.16336403787136078,
-0.007077725604176521,
-0.09427586197853088,
-0.1355046033859253,
0.2365323007106781,
0.2007124423980713,
-0.3976680636405945,
0.008898619562387466,
0.09721097350120544,
-0.19625675678253174,
0.1974952071905136,
0.2571916878223419,
0.033522829413414,
-0.20206329226493835,
0.12044847011566162,
0.21816369891166687,
0.32123446464538574,
-0.31153252720832825,
0.09231643378734589,
0.4366133213043213,
-0.09491565078496933,
0.11424455046653748,
0.3538491725921631,
0.19445368647575378,
0.2036350667476654,
0.3951096832752228,
-0.19358579814434052,
0.4623432457447052,
-0.2582816183567047,
-0.09433719515800476,
0.2859722971916199,
-0.2775827646255493,
0.25960588455200195,
0.16791120171546936,
-0.015956901013851166,
-0.10749170184135437,
-0.0687050074338913,
0.2255089282989502,
0.104275181889534,
-0.0506751649081707,
-0.10208988189697266,
0.056389663368463516,
-0.08638721704483032,
-0.02836170606315136,
-0.07218780368566513,
-0.19983534514904022,
-0.4720802307128906,
-0.23859789967536926,
0.059471119195222855,
-0.11003459244966507,
0.2311077117919922,
-0.00713072344660759,
-0.05417671799659729,
-0.2468121200799942,
-0.059798359870910645,
0.11835804581642151,
0.19857165217399597,
-0.1996491253376007,
0.31493282318115234,
0.4178912341594696,
0.17218418419361115,
-0.04546940326690674,
0.49039649963378906,
0.41920459270477295,
0.07617531716823578,
0.08367818593978882,
-0.023948583751916885,
0.06941990554332733,
-0.05957501009106636,
-0.05438914895057678,
0.11935193836688995,
-0.12583065032958984,
0.08025055378675461,
0.21468158066272736,
0.2213076800107956,
-0.23082782328128815,
-0.07628099620342255,
-0.07850828021764755,
0.04514163359999657,
-0.18673518300056458,
0.8627412915229797,
-0.24725256860256195,
-0.08079241961240768,
-0.3325366675853729,
0.016186224296689034,
-0.540527880191803,
-0.12435755133628845,
0.2931482791900635,
-0.13562491536140442,
0.011517789214849472,
-0.38202089071273804,
0.09067712724208832,
-0.1491674780845642,
0.44512999057769775,
0.335243284702301,
0.11445727944374084,
-0.1776750087738037,
-0.11068586260080338,
-0.1790514886379242,
0.331706166267395,
0.3283595144748688,
0.005357526242733002,
-0.016259538009762764,
-0.1995924413204193,
-0.14380158483982086,
-0.12783202528953552,
0.3666839301586151,
-0.12321344763040543,
0.18702983856201172,
-0.05400834605097771,
-0.28555917739868164,
-0.1776101142168045,
-0.19494381546974182,
-0.20804791152477264,
0.0047529712319374084,
-0.29169726371765137,
-0.021304190158843994,
-0.222740039229393,
0.060525208711624146,
-0.07071267068386078,
-0.11539676040410995,
0.2167098969221115,
-0.6964043378829956,
0.39160045981407166,
-0.026251869276165962,
0.09804219007492065,
-0.28332558274269104,
-0.22911326587200165,
-0.0455305352807045,
-0.17159512639045715,
-0.2876105308532715,
0.03375754877924919,
0.11354157328605652,
0.44460630416870117,
0.09175034612417221,
-0.27732592821121216,
-0.19268286228179932,
0.17509818077087402,
0.007046818733215332,
0.3076061010360718,
-0.08485721796751022,
0.6034550070762634,
-0.2972681224346161,
-0.1179053783416748,
0.2515428066253662,
0.06692385673522949,
0.0763266533613205,
0.3060338795185089,
-0.47790372371673584,
-0.5714568495750427,
0.7575868368148804,
-0.22998099029064178,
-0.17040567100048065,
0.04427459090948105,
0.5145431160926819,
-0.13101832568645477,
-0.4468151032924652,
-0.6484676599502563,
0.1553839147090912,
0.3070342540740967,
0.12230147421360016,
-0.2227480709552765,
0.38564786314964294,
-0.1350671648979187,
0.03206928074359894,
-0.01694464683532715,
0.21654130518436432,
-0.0270092710852623,
0.09668462723493576,
0.21126756072044373,
-0.14205919206142426
] |
https://github.com/huggingface/datasets/issues/5688 | Hi @adrianfagerland, thanks for reporting.
Please note that "wikipedia" is a special dataset, with an Apache Beam builder: https://beam.apache.org/
You can find more info about Beam datasets in our docs: https://huggingface.co/docs/datasets/beam
It was implemented to be run in parallel processing, using one of the distributed back-ends supported by Apache Beam: https://beam.apache.org/get-started/beam-overview/#apache-beam-pipeline-runners
That is, you are trying to process the source wikipedia data on your machine (not distributed) when passing `beam_runner="DirectRunner"`.
As documented in the wikipedia dataset page (https://huggingface.co/datasets/wikipedia):
Some subsets of Wikipedia have already been processed by HuggingFace, and you can load them just with:
from datasets import load_dataset
load_dataset("wikipedia", "20220301.en")
The list of pre-processed subsets is:
- "20220301.de"
- "20220301.en"
- "20220301.fr"
- "20220301.frr"
- "20220301.it"
- "20220301.simple"
To download the available processed data (in Arrow format):
```python
builder = datasets.load_dataset_builder("wikipedia", "20220301.en")
builder.download_and_prepare(your_path)
``` | Wikipedia download_and_prepare for GCS | ### Describe the bug
I am unable to download the wikipedia dataset onto GCS.
When I run the script provided the memory firstly gets eaten up, then it crashes.
I tried running this on a VM with 128GB RAM and all I got was a two empty files: _data_builder.lock_, _data.incomplete/beam-temp-wikipedia-train-1ab2039acf3611ed87a9893475de0093_
I have troubleshot this for two straight days now, but I am just unable to get the dataset into storage.
### Steps to reproduce the bug
Run this and insert a path:
```
import datasets
builder = datasets.load_dataset_builder(
"wikipedia", language="en", date="20230320", beam_runner="DirectRunner")
builder.download_and_prepare({path}, file_format="parquet")
```
This is where the problem of it eating RAM occurs.
I have also tried several versions of this, based on the docs:
```
import gcsfs
import datasets
storage_options = {"project": "tdt4310", "token": "cloud"}
fs = gcsfs.GCSFileSystem(**storage_options)
output_dir = "gcs://wikipediadata/"
builder = datasets.load_dataset_builder(
"wikipedia", date="20230320", language="en", beam_runner="DirectRunner")
builder.download_and_prepare(
output_dir, storage_options=storage_options, file_format="parquet")
```
The error message that is received here is:
> ValueError: Unable to get filesystem from specified path, please use the correct path or ensure the required dependency is installed, e.g., pip install apache-beam[gcp]. Path specified: gcs://wikipediadata/wikipedia-train [while running 'train/Save to parquet/Write/WriteImpl/InitializeWrite']
I have ran `pip install apache-beam[gcp]`
### Expected behavior
The wikipedia data loaded into GCS
Everything worked when testing with a smaller demo dataset found somewhere in the docs
### Environment info
Newest published version of datasets. Python 3.9. Also tested with Python 3.7. 128GB RAM Google Cloud VM instance. | 135 | Wikipedia download_and_prepare for GCS
### Describe the bug
I am unable to download the wikipedia dataset onto GCS.
When I run the script provided the memory firstly gets eaten up, then it crashes.
I tried running this on a VM with 128GB RAM and all I got was a two empty files: _data_builder.lock_, _data.incomplete/beam-temp-wikipedia-train-1ab2039acf3611ed87a9893475de0093_
I have troubleshot this for two straight days now, but I am just unable to get the dataset into storage.
### Steps to reproduce the bug
Run this and insert a path:
```
import datasets
builder = datasets.load_dataset_builder(
"wikipedia", language="en", date="20230320", beam_runner="DirectRunner")
builder.download_and_prepare({path}, file_format="parquet")
```
This is where the problem of it eating RAM occurs.
I have also tried several versions of this, based on the docs:
```
import gcsfs
import datasets
storage_options = {"project": "tdt4310", "token": "cloud"}
fs = gcsfs.GCSFileSystem(**storage_options)
output_dir = "gcs://wikipediadata/"
builder = datasets.load_dataset_builder(
"wikipedia", date="20230320", language="en", beam_runner="DirectRunner")
builder.download_and_prepare(
output_dir, storage_options=storage_options, file_format="parquet")
```
The error message that is received here is:
> ValueError: Unable to get filesystem from specified path, please use the correct path or ensure the required dependency is installed, e.g., pip install apache-beam[gcp]. Path specified: gcs://wikipediadata/wikipedia-train [while running 'train/Save to parquet/Write/WriteImpl/InitializeWrite']
I have ran `pip install apache-beam[gcp]`
### Expected behavior
The wikipedia data loaded into GCS
Everything worked when testing with a smaller demo dataset found somewhere in the docs
### Environment info
Newest published version of datasets. Python 3.9. Also tested with Python 3.7. 128GB RAM Google Cloud VM instance.
Hi @adrianfagerland, thanks for reporting.
Please note that "wikipedia" is a special dataset, with an Apache Beam builder: https://beam.apache.org/
You can find more info about Beam datasets in our docs: https://huggingface.co/docs/datasets/beam
It was implemented to be run in parallel processing, using one of the distributed back-ends supported by Apache Beam: https://beam.apache.org/get-started/beam-overview/#apache-beam-pipeline-runners
That is, you are trying to process the source wikipedia data on your machine (not distributed) when passing `beam_runner="DirectRunner"`.
As documented in the wikipedia dataset page (https://huggingface.co/datasets/wikipedia):
Some subsets of Wikipedia have already been processed by HuggingFace, and you can load them just with:
from datasets import load_dataset
load_dataset("wikipedia", "20220301.en")
The list of pre-processed subsets is:
- "20220301.de"
- "20220301.en"
- "20220301.fr"
- "20220301.frr"
- "20220301.it"
- "20220301.simple"
To download the available processed data (in Arrow format):
```python
builder = datasets.load_dataset_builder("wikipedia", "20220301.en")
builder.download_and_prepare(your_path)
``` | [
-0.14688315987586975,
0.12495306134223938,
0.043897926807403564,
0.5361847877502441,
0.2786172926425934,
0.15908744931221008,
-0.07821910083293915,
0.18579792976379395,
0.21924205124378204,
0.07019755244255066,
0.4104774296283722,
0.11143122613430023,
-0.12108080834150314,
-0.4063335061073303,
0.021799810230731964,
-0.008368701674044132,
0.23768162727355957,
0.05317286029458046,
-0.37254640460014343,
-0.007802411913871765,
-0.18305110931396484,
0.30794215202331543,
-0.21330180764198303,
-0.4257018268108368,
-0.2578696310520172,
-0.16034452617168427,
-0.07206249237060547,
0.22931577265262604,
-0.2235392928123474,
-0.3408355712890625,
0.09682026505470276,
0.05280456319451332,
-0.10211069136857986,
0.6884121298789978,
-0.00012585883087012917,
-0.09539803862571716,
0.4117857813835144,
-0.19584187865257263,
-0.45476940274238586,
-0.06276576966047287,
-0.07211723923683167,
-0.2671924829483032,
0.07767684757709503,
-0.1593479961156845,
0.07710166275501251,
0.07187534868717194,
0.14879730343818665,
-0.5404037237167358,
0.25540706515312195,
0.11123979091644287,
0.09148065745830536,
-0.144113689661026,
0.23784735798835754,
-0.09616249799728394,
0.5804386138916016,
-0.05883169174194336,
-0.11412692070007324,
0.21564480662345886,
0.057755716145038605,
0.03096465766429901,
0.004351716488599777,
0.38796666264533997,
-0.24223072826862335,
-0.09238237142562866,
0.5627853870391846,
0.04548238590359688,
-0.19228670001029968,
-0.450149804353714,
0.1984265297651291,
-0.07330367714166641,
0.9573918581008911,
-0.2960767447948456,
0.04062394052743912,
-0.1481018215417862,
-0.10143652558326721,
0.11502210050821304,
0.43306368589401245,
0.25732100009918213,
-0.45650261640548706,
-0.005884351208806038,
-0.04539770260453224,
-0.29732802510261536,
-0.15314726531505585,
0.18723410367965698,
0.15503749251365662,
0.0717415139079094,
0.028548788279294968,
0.26888006925582886,
0.35741761326789856,
0.1272987276315689,
-0.12323421239852905,
-0.3015909790992737,
-0.3072950541973114,
0.3574480712413788,
-0.30502036213874817,
0.017976202070713043,
0.03976748511195183,
0.04170675203204155,
0.2455310970544815,
0.006923278793692589,
-0.2885373830795288,
0.023444879800081253,
0.2935318350791931,
-0.03574312850832939,
0.31965282559394836,
0.35542595386505127,
-0.44772520661354065,
0.17102694511413574,
0.1418866366147995,
0.15035982429981232,
-0.10610331594944,
-0.1542970985174179,
0.14622239768505096,
-0.1944243162870407,
-0.20074671506881714,
0.03192915394902229,
0.08439744263887405,
-0.15169067680835724,
-0.16017673909664154,
0.2846786677837372,
0.27170902490615845,
0.2189498096704483,
-0.15561267733573914,
0.5438629984855652,
-0.015198148787021637,
0.2990501821041107,
0.32205575704574585,
0.11135287582874298,
-0.07714344561100006,
-0.020999059081077576,
0.014931801706552505,
0.21535387635231018,
-0.43219590187072754,
0.32134580612182617,
0.28402021527290344,
0.16910797357559204,
0.1666296124458313,
0.014647696167230606,
-0.025219809263944626,
-0.2867663502693176,
-0.17656663060188293,
-0.1852053999900818,
0.08003915101289749,
0.3005920946598053,
0.028620630502700806,
0.472792387008667,
-0.04976198822259903,
-0.0762447789311409,
-0.14549852907657623,
0.11018272489309311,
-0.23260104656219482,
-0.23093442618846893,
-0.09626027196645737,
0.03130624070763588,
0.1218496561050415,
0.22140952944755554,
-0.21295328438282013,
0.13224762678146362,
0.28152215480804443,
-0.09452084451913834,
-0.006010279059410095,
0.04883282631635666,
-0.08815334737300873,
-0.3539391756057739,
0.11548717319965363,
0.6563117504119873,
-0.15293999016284943,
0.2600783705711365,
-0.08844004571437836,
0.2834244668483734,
0.2555861473083496,
0.14299292862415314,
0.02164265140891075,
0.2045213282108307,
-0.174749955534935,
0.0012128949165344238,
0.2362229973077774,
-0.23577654361724854,
-0.4485642910003662,
0.334503173828125,
-0.07491207867860794,
0.10121559351682663,
0.24027866125106812,
0.18430034816265106,
0.12714572250843048,
0.1732587069272995,
-0.09296375513076782,
0.3352498412132263,
-0.09116511791944504,
0.14935776591300964,
-0.42233598232269287,
-0.35224390029907227,
0.12948879599571228,
-0.0704692080616951,
0.20625752210617065,
-0.10679614543914795,
0.010851051658391953,
0.3086216449737549,
0.42381221055984497,
-0.06971417367458344,
0.06697355955839157,
0.4307275414466858,
0.11013719439506531,
-0.024183765053749084,
0.08362847566604614,
-0.060863278806209564,
-0.6595174670219421,
0.2391432374715805,
0.03480397164821625,
0.11287206411361694,
-0.17945988476276398,
-0.19020968675613403,
-0.32507801055908203,
-0.036051079630851746,
0.03658701479434967,
-0.05509965866804123,
-0.0072072409093379974,
0.16559959948062897,
0.019459038972854614,
-0.011816948652267456,
0.011199727654457092,
0.29718050360679626,
-0.05891898646950722,
0.1240009143948555,
-0.05759407579898834,
0.2703052759170532,
-0.20848609507083893,
-0.4145160913467407,
0.07623395323753357,
-0.10465052723884583,
0.3365930914878845,
-0.14795750379562378,
-0.0804552286863327,
0.4644347131252289,
0.21112006902694702,
0.2078770101070404,
-0.3370669186115265,
-0.14443324506282806,
0.10642961412668228,
-0.18254214525222778,
0.05883639305830002,
0.26037275791168213,
0.27810898423194885,
-0.19783610105514526,
-0.06465297937393188,
-0.2876015305519104,
0.11114003509283066,
0.143351748585701,
0.027744293212890625,
0.046034663915634155,
-0.20830801129341125,
0.04454132169485092,
0.33643150329589844,
-0.14404384791851044,
0.22130513191223145,
0.306484192609787,
0.0012367144227027893,
-0.0747142806649208,
-0.13741442561149597,
0.0728355124592781,
0.37376976013183594,
0.06871111690998077,
0.048820652067661285,
-0.09553342312574387,
-0.31320616602897644,
-0.17753487825393677,
0.3540342152118683,
-0.295933336019516,
0.22692018747329712,
0.09383299946784973,
0.0017710737884044647,
0.008286986500024796,
0.0648878812789917,
-0.04902627319097519,
0.266613245010376,
0.07933297753334045,
0.3747991621494293,
0.11402980983257294,
0.06471692025661469,
0.07789114862680435,
-0.1925778090953827,
0.06843675673007965,
-0.026168569922447205,
0.2745479941368103,
-0.27059006690979004,
0.16761894524097443,
-0.28474754095077515,
-0.0606885626912117,
-0.1365298628807068,
0.42505860328674316,
-0.10814604163169861,
-0.3469487726688385,
-0.2206794172525406,
0.3927572965621948,
-0.03309338539838791,
0.023487742990255356,
0.12689726054668427,
0.09268234670162201,
0.14126209914684296,
-0.22965233027935028,
-0.17339405417442322,
-0.15995968878269196,
-0.3201504051685333,
-0.1396777182817459,
0.5417979955673218,
0.040213923901319504,
0.08557447046041489,
0.33107990026474,
-0.2834872007369995,
-0.13234806060791016,
-0.11103028804063797,
0.26039770245552063,
-0.1272176206111908,
0.18458761274814606,
-0.1246214359998703,
0.4473109841346741,
0.0131492018699646,
0.007628574967384338,
-0.21529895067214966,
-0.15285071730613708,
0.07680585235357285,
0.038792043924331665,
0.1409820169210434,
-0.18697747588157654,
-0.18389150500297546,
-0.32119178771972656,
0.0650378167629242,
-0.29393860697746277,
-0.018290232867002487,
0.12070052325725555,
0.06959527730941772,
0.15046997368335724,
0.34013834595680237,
-0.11102347075939178,
-0.0012143850326538086,
0.045496322214603424,
-0.0876285582780838,
-0.12906014919281006,
0.4331165552139282,
-0.13679513335227966,
-0.34813180565834045,
0.24910613894462585,
-0.0063002631068229675,
-0.033780165016651154,
0.27982524037361145,
-0.5587214827537537,
0.39334020018577576,
-0.19555962085723877,
-0.024850063025951385,
0.025515716522932053,
0.11873163282871246,
0.34389805793762207,
-0.12648501992225647,
0.15073472261428833,
-0.11108638346195221,
0.08751906454563141,
-0.17101246118545532,
0.10880282521247864,
0.2652732729911804,
0.0601375550031662,
0.010965805500745773,
0.1966191828250885,
0.9774391055107117,
0.12204807996749878,
0.1541258692741394,
0.2917068898677826,
-0.00723692961037159,
0.36250385642051697,
-0.17297270894050598,
-0.14238549768924713,
0.10387664288282394,
-0.17049334943294525,
-0.35379353165626526,
0.17242853343486786,
-0.027708806097507477,
-0.47638165950775146,
-0.12828168272972107,
0.33670228719711304,
0.009594917297363281,
-0.3107088506221771,
0.24583792686462402,
0.05644785240292549,
0.15541324019432068,
0.07448533177375793,
0.22860512137413025,
0.08811337500810623,
-0.39337649941444397,
0.11166545748710632,
0.2504235804080963,
0.23351353406906128,
0.09563830494880676,
0.2923595607280731,
0.01545797660946846,
-0.5219005346298218,
0.13181990385055542,
-0.02075435034930706,
0.003673788160085678,
-0.10158377885818481,
0.08602682501077652,
0.11067429184913635,
-0.11503088474273682,
0.32198500633239746,
-0.19431711733341217,
-0.0620427243411541,
0.2076038122177124,
0.3443959057331085,
-0.46553558111190796,
-0.03832554444670677,
-0.07039818167686462,
-0.039837583899497986,
0.11810490489006042,
0.09595049917697906,
-0.3414638936519623,
0.018626555800437927,
-0.00020892545580863953,
0.33895623683929443,
-0.16325369477272034,
-0.016016662120819092,
-0.2710227966308594,
-0.322113037109375,
-0.3154071271419525,
-0.10473789274692535,
0.28155481815338135,
0.294405460357666,
0.21248000860214233,
0.03193633258342743,
0.03445691615343094,
0.05676528811454773,
0.03538088500499725,
-0.09275057166814804,
0.49585625529289246,
0.03360014036297798,
0.10865889489650726,
-0.03225173056125641,
-0.03367523476481438,
-0.056499920785427094,
0.5172470211982727,
0.3986329436302185,
0.3314404785633087,
0.15284718573093414,
-0.09410429000854492,
0.07134023308753967,
0.5600569248199463,
-0.2230076789855957,
-0.1566772609949112,
-0.2570592164993286,
0.04131226986646652,
-0.3681793808937073,
0.16259655356407166,
0.07003558427095413,
-0.20591148734092712,
-0.355256587266922,
-0.2934160828590393,
0.6430811285972595,
0.05833183228969574,
-0.2612517476081848,
0.24762025475502014,
0.1307748556137085,
-0.5575965046882629,
0.4297865033149719,
0.3247576653957367,
1.1367549896240234,
-0.22617480158805847,
0.22167542576789856,
0.35478267073631287,
0.08281946182250977,
0.38643547892570496,
-0.8971561193466187,
0.2769477069377899,
-0.31015247106552124,
-0.18482579290866852,
-0.12279713153839111,
-0.14524388313293457,
0.3158234655857086,
0.03997679054737091,
-0.5581866502761841,
0.40921133756637573,
-0.08305562287569046,
0.4596933126449585,
-0.1747795045375824,
0.3808967173099518,
-0.13168469071388245,
-0.27521800994873047,
0.21986350417137146,
0.11370966583490372,
0.05960403382778168,
0.20357783138751984,
-0.21741583943367004,
0.11909380555152893,
-0.09224493056535721,
-0.2982468008995056,
-0.6732563972473145,
0.14742904901504517,
-0.3759428560733795,
0.1207011416554451,
-0.4911971688270569,
-0.294212281703949,
0.2631792426109314,
0.07163068652153015,
-0.0613795667886734,
0.460257887840271,
-0.09710481762886047,
0.3881828188896179,
-0.18031825125217438,
-0.30506646633148193,
-0.01265937089920044,
0.014130514115095139,
0.20699134469032288,
0.011121012270450592,
-0.04738616198301315,
0.18659085035324097,
-0.26493945717811584,
-0.13823331892490387,
-0.34819838404655457,
-0.13706567883491516,
-0.04253384470939636,
0.03804852068424225,
-0.406342089176178,
0.2396615594625473,
0.020864874124526978,
0.06892417371273041,
0.03700898587703705,
-0.1475658118724823,
-0.08866715431213379,
0.29401639103889465,
-0.07174890488386154,
-0.19809749722480774,
-0.11043384671211243,
0.2825061082839966,
0.19742456078529358,
-0.24361853301525116,
0.41700583696365356,
0.34153348207473755,
-0.29986876249313354,
-0.18839429318904877,
-0.2525486946105957,
-0.17237065732479095,
-0.2618916928768158,
-0.036894623190164566,
-0.365620493888855,
0.023356691002845764,
-0.2322043776512146,
0.2145901322364807,
0.09299306571483612,
-0.1654280126094818,
0.029963165521621704,
-0.2489965260028839,
-0.23034074902534485,
0.17494092881679535,
-0.05439300090074539,
0.25026342272758484,
-0.19916094839572906,
-0.38332441449165344,
0.04678264260292053,
0.18715402483940125,
-0.16423296928405762,
0.007787637412548065,
-0.08766733855009079,
0.1741802841424942,
0.38988956809043884,
0.15898527204990387,
0.016234371811151505,
-0.3006962835788727,
-0.008020300418138504,
0.18766069412231445,
0.11570435762405396,
-0.03610082343220711,
0.05741438269615173,
0.20717163383960724,
0.06151259317994118,
0.060064785182476044,
-0.13903596997261047,
-0.5661214590072632,
-0.051183462142944336,
-0.2460302710533142,
0.35984376072883606,
0.018260598182678223,
-0.06423275917768478,
-0.042046766728162766,
0.09260551631450653,
0.2650482654571533,
-0.2757914364337921,
0.2562136650085449,
-0.06019379571080208,
0.542175829410553,
0.2946418523788452,
0.10809807479381561,
0.37723904848098755,
-0.00693657249212265,
-0.4233318865299225,
0.27956902980804443,
-0.06150481849908829,
0.09431876242160797,
0.4300106465816498,
-0.17505423724651337,
-0.08157216757535934,
0.08301123231649399,
0.036810025572776794,
0.28588247299194336,
-0.11645682901144028,
-0.13432258367538452,
0.17871907353401184,
0.07434525340795517,
0.13865503668785095,
0.013695955276489258,
0.17184357345104218,
0.17373868823051453,
-0.16216596961021423,
0.2953340709209442,
0.272821307182312,
-0.22160670161247253,
-0.2644100487232208,
0.2635605037212372,
0.38898783922195435,
0.3400910496711731,
0.24542295932769775,
-0.3050287365913391,
0.1158045083284378,
-0.04895615205168724,
-0.051341310143470764,
0.06667017936706543,
0.11636996269226074,
0.2572714388370514,
-0.2057543843984604,
0.1254543662071228,
0.1068655326962471,
-0.18588252365589142,
-0.3713976740837097,
-0.1425268054008484,
0.13787665963172913,
0.3471229672431946,
0.09837806224822998,
0.3292398154735565,
0.02436089888215065,
-0.05545780062675476,
0.22527490556240082,
-0.35180357098579407,
-0.29962557554244995,
0.11296787112951279,
-0.18592996895313263,
0.06891299784183502,
0.15752360224723816,
-0.1884499341249466,
-0.222385436296463,
0.3575102686882019,
0.009058536030352116,
-0.5023667812347412,
0.35352808237075806,
0.3448791801929474,
-0.21466918289661407,
-0.1305226981639862,
0.5851330757141113,
0.18777935206890106,
0.20911356806755066,
-0.30172717571258545,
0.3000001013278961,
-0.147964745759964,
-0.006757266819477081,
-0.11448293179273605,
-0.14433537423610687,
0.3625158369541168,
0.37760549783706665,
-0.5416686534881592,
-0.06898842006921768,
0.1479504406452179,
0.01266024261713028,
-0.0413743257522583,
0.12027071416378021,
-0.18369801342487335,
0.2934044897556305,
0.13292013108730316,
0.0095771923661232,
-0.07361295819282532,
-0.3569757640361786,
0.41281622648239136,
0.2951757311820984,
-0.279611736536026,
-0.06142998859286308,
-0.13085097074508667,
-0.027053557336330414,
0.09743432700634003,
0.021729858592152596,
-0.43046674132347107,
-0.055228691548109055,
0.24726977944374084,
0.0194673053920269,
0.21446551382541656,
-0.09967382997274399,
-0.027520760893821716,
0.04070824384689331,
0.5138937830924988,
0.03255244344472885,
0.01934869773685932,
-0.6117090582847595,
-0.48193415999412537,
-0.4367371201515198,
0.05825934186577797,
-0.21145592629909515,
-0.3008563220500946,
0.01388159766793251,
0.3542996346950531,
-0.014032535254955292,
0.1911219358444214,
0.21729157865047455,
0.048583537340164185,
-0.06554149836301804,
0.3409494459629059,
-0.20070946216583252,
-0.17400775849819183,
-0.38455843925476074,
-0.08870179951190948,
-0.12208746373653412,
-0.42252302169799805,
0.03311608359217644,
-0.2140101045370102,
-0.09256301820278168,
-0.18962684273719788,
-0.050872158259153366,
-0.007498785853385925,
-0.16084375977516174,
0.6456555128097534,
-0.19913847744464874,
0.33555036783218384,
-0.06098403409123421,
-0.32435399293899536,
-0.5329300165176392,
-0.18847720324993134,
-0.048365518450737,
-0.12120269238948822,
-0.08949406445026398,
0.39417314529418945,
-0.31014877557754517,
0.18147331476211548,
-0.47759008407592773,
0.19032815098762512,
0.1279042810201645,
0.2489413321018219,
-0.11546242237091064,
-0.16536252200603485,
-0.2820572853088379,
0.5089426040649414,
0.12230600416660309,
0.1094115674495697,
-0.05187956243753433,
0.26950743794441223,
-0.3697890043258667,
-0.3682113587856293,
0.3801719546318054,
-0.2096123993396759,
-0.5402869582176208,
0.08884745836257935,
0.12041868269443512,
-0.0017312746495008469,
0.13997942209243774,
-0.6733095645904541,
0.04424309730529785,
0.1190854161977768,
0.026060275733470917,
-0.2379089593887329,
-0.04565420001745224,
-0.12650343775749207,
-0.13905222713947296,
-0.06443275511264801,
0.0764518678188324,
-0.04429087042808533,
-0.1926119029521942,
-0.20788046717643738,
-0.379508376121521
] |
https://github.com/huggingface/datasets/issues/5688 | When running this using :
```
import datasets
from apache_beam.options.pipeline_options import PipelineOptions
from gcsfs import GCSFileSystem
storage_options = {"project":"tdt4310", "token":"cloud"}
fs = GCSFileSystem(**storage_options)
output_dir = "gcs://quiz_transformer/"
beam_options = PipelineOptions(
region="europe-west4",
project="tdt4310",
temp_location=output_dir+"tmp/")
builder = datasets.load_dataset_builder("wikipedia", "20220301.en", beam_runner="dataflow", beam_options=beam_options)
builder.download_and_prepare(
output_dir, storage_options=storage_options, file_format="parquet")
```
I now get this error:
```
raise FileNotFoundError(f"Couldn't find file at {url}")
FileNotFoundError: Couldn't find file at https://dumps.wikimedia.org/enwiki/20220301/dumpstatus.json
Downloading data files: 0%| | 0/1 [00:00<?, ?it/s]
```
I get the same error for this:
```
import datasets
from gcsfs import GCSFileSystem
storage_options = {"project":"tdt4310", "token":"cloud"}
fs = GCSFileSystem(**storage_options)
output_dir = "gcs://quiz_transformer/"
builder = datasets.load_dataset_builder("wikipedia", "20220301.en")
builder.download_and_prepare(
output_dir, storage_options=storage_options, file_format="parquet")
```
| Wikipedia download_and_prepare for GCS | ### Describe the bug
I am unable to download the wikipedia dataset onto GCS.
When I run the script provided the memory firstly gets eaten up, then it crashes.
I tried running this on a VM with 128GB RAM and all I got was a two empty files: _data_builder.lock_, _data.incomplete/beam-temp-wikipedia-train-1ab2039acf3611ed87a9893475de0093_
I have troubleshot this for two straight days now, but I am just unable to get the dataset into storage.
### Steps to reproduce the bug
Run this and insert a path:
```
import datasets
builder = datasets.load_dataset_builder(
"wikipedia", language="en", date="20230320", beam_runner="DirectRunner")
builder.download_and_prepare({path}, file_format="parquet")
```
This is where the problem of it eating RAM occurs.
I have also tried several versions of this, based on the docs:
```
import gcsfs
import datasets
storage_options = {"project": "tdt4310", "token": "cloud"}
fs = gcsfs.GCSFileSystem(**storage_options)
output_dir = "gcs://wikipediadata/"
builder = datasets.load_dataset_builder(
"wikipedia", date="20230320", language="en", beam_runner="DirectRunner")
builder.download_and_prepare(
output_dir, storage_options=storage_options, file_format="parquet")
```
The error message that is received here is:
> ValueError: Unable to get filesystem from specified path, please use the correct path or ensure the required dependency is installed, e.g., pip install apache-beam[gcp]. Path specified: gcs://wikipediadata/wikipedia-train [while running 'train/Save to parquet/Write/WriteImpl/InitializeWrite']
I have ran `pip install apache-beam[gcp]`
### Expected behavior
The wikipedia data loaded into GCS
Everything worked when testing with a smaller demo dataset found somewhere in the docs
### Environment info
Newest published version of datasets. Python 3.9. Also tested with Python 3.7. 128GB RAM Google Cloud VM instance. | 103 | Wikipedia download_and_prepare for GCS
### Describe the bug
I am unable to download the wikipedia dataset onto GCS.
When I run the script provided the memory firstly gets eaten up, then it crashes.
I tried running this on a VM with 128GB RAM and all I got was a two empty files: _data_builder.lock_, _data.incomplete/beam-temp-wikipedia-train-1ab2039acf3611ed87a9893475de0093_
I have troubleshot this for two straight days now, but I am just unable to get the dataset into storage.
### Steps to reproduce the bug
Run this and insert a path:
```
import datasets
builder = datasets.load_dataset_builder(
"wikipedia", language="en", date="20230320", beam_runner="DirectRunner")
builder.download_and_prepare({path}, file_format="parquet")
```
This is where the problem of it eating RAM occurs.
I have also tried several versions of this, based on the docs:
```
import gcsfs
import datasets
storage_options = {"project": "tdt4310", "token": "cloud"}
fs = gcsfs.GCSFileSystem(**storage_options)
output_dir = "gcs://wikipediadata/"
builder = datasets.load_dataset_builder(
"wikipedia", date="20230320", language="en", beam_runner="DirectRunner")
builder.download_and_prepare(
output_dir, storage_options=storage_options, file_format="parquet")
```
The error message that is received here is:
> ValueError: Unable to get filesystem from specified path, please use the correct path or ensure the required dependency is installed, e.g., pip install apache-beam[gcp]. Path specified: gcs://wikipediadata/wikipedia-train [while running 'train/Save to parquet/Write/WriteImpl/InitializeWrite']
I have ran `pip install apache-beam[gcp]`
### Expected behavior
The wikipedia data loaded into GCS
Everything worked when testing with a smaller demo dataset found somewhere in the docs
### Environment info
Newest published version of datasets. Python 3.9. Also tested with Python 3.7. 128GB RAM Google Cloud VM instance.
When running this using :
```
import datasets
from apache_beam.options.pipeline_options import PipelineOptions
from gcsfs import GCSFileSystem
storage_options = {"project":"tdt4310", "token":"cloud"}
fs = GCSFileSystem(**storage_options)
output_dir = "gcs://quiz_transformer/"
beam_options = PipelineOptions(
region="europe-west4",
project="tdt4310",
temp_location=output_dir+"tmp/")
builder = datasets.load_dataset_builder("wikipedia", "20220301.en", beam_runner="dataflow", beam_options=beam_options)
builder.download_and_prepare(
output_dir, storage_options=storage_options, file_format="parquet")
```
I now get this error:
```
raise FileNotFoundError(f"Couldn't find file at {url}")
FileNotFoundError: Couldn't find file at https://dumps.wikimedia.org/enwiki/20220301/dumpstatus.json
Downloading data files: 0%| | 0/1 [00:00<?, ?it/s]
```
I get the same error for this:
```
import datasets
from gcsfs import GCSFileSystem
storage_options = {"project":"tdt4310", "token":"cloud"}
fs = GCSFileSystem(**storage_options)
output_dir = "gcs://quiz_transformer/"
builder = datasets.load_dataset_builder("wikipedia", "20220301.en")
builder.download_and_prepare(
output_dir, storage_options=storage_options, file_format="parquet")
```
| [
-0.14688315987586975,
0.12495306134223938,
0.043897926807403564,
0.5361847877502441,
0.2786172926425934,
0.15908744931221008,
-0.07821910083293915,
0.18579792976379395,
0.21924205124378204,
0.07019755244255066,
0.4104774296283722,
0.11143122613430023,
-0.12108080834150314,
-0.4063335061073303,
0.021799810230731964,
-0.008368701674044132,
0.23768162727355957,
0.05317286029458046,
-0.37254640460014343,
-0.007802411913871765,
-0.18305110931396484,
0.30794215202331543,
-0.21330180764198303,
-0.4257018268108368,
-0.2578696310520172,
-0.16034452617168427,
-0.07206249237060547,
0.22931577265262604,
-0.2235392928123474,
-0.3408355712890625,
0.09682026505470276,
0.05280456319451332,
-0.10211069136857986,
0.6884121298789978,
-0.00012585883087012917,
-0.09539803862571716,
0.4117857813835144,
-0.19584187865257263,
-0.45476940274238586,
-0.06276576966047287,
-0.07211723923683167,
-0.2671924829483032,
0.07767684757709503,
-0.1593479961156845,
0.07710166275501251,
0.07187534868717194,
0.14879730343818665,
-0.5404037237167358,
0.25540706515312195,
0.11123979091644287,
0.09148065745830536,
-0.144113689661026,
0.23784735798835754,
-0.09616249799728394,
0.5804386138916016,
-0.05883169174194336,
-0.11412692070007324,
0.21564480662345886,
0.057755716145038605,
0.03096465766429901,
0.004351716488599777,
0.38796666264533997,
-0.24223072826862335,
-0.09238237142562866,
0.5627853870391846,
0.04548238590359688,
-0.19228670001029968,
-0.450149804353714,
0.1984265297651291,
-0.07330367714166641,
0.9573918581008911,
-0.2960767447948456,
0.04062394052743912,
-0.1481018215417862,
-0.10143652558326721,
0.11502210050821304,
0.43306368589401245,
0.25732100009918213,
-0.45650261640548706,
-0.005884351208806038,
-0.04539770260453224,
-0.29732802510261536,
-0.15314726531505585,
0.18723410367965698,
0.15503749251365662,
0.0717415139079094,
0.028548788279294968,
0.26888006925582886,
0.35741761326789856,
0.1272987276315689,
-0.12323421239852905,
-0.3015909790992737,
-0.3072950541973114,
0.3574480712413788,
-0.30502036213874817,
0.017976202070713043,
0.03976748511195183,
0.04170675203204155,
0.2455310970544815,
0.006923278793692589,
-0.2885373830795288,
0.023444879800081253,
0.2935318350791931,
-0.03574312850832939,
0.31965282559394836,
0.35542595386505127,
-0.44772520661354065,
0.17102694511413574,
0.1418866366147995,
0.15035982429981232,
-0.10610331594944,
-0.1542970985174179,
0.14622239768505096,
-0.1944243162870407,
-0.20074671506881714,
0.03192915394902229,
0.08439744263887405,
-0.15169067680835724,
-0.16017673909664154,
0.2846786677837372,
0.27170902490615845,
0.2189498096704483,
-0.15561267733573914,
0.5438629984855652,
-0.015198148787021637,
0.2990501821041107,
0.32205575704574585,
0.11135287582874298,
-0.07714344561100006,
-0.020999059081077576,
0.014931801706552505,
0.21535387635231018,
-0.43219590187072754,
0.32134580612182617,
0.28402021527290344,
0.16910797357559204,
0.1666296124458313,
0.014647696167230606,
-0.025219809263944626,
-0.2867663502693176,
-0.17656663060188293,
-0.1852053999900818,
0.08003915101289749,
0.3005920946598053,
0.028620630502700806,
0.472792387008667,
-0.04976198822259903,
-0.0762447789311409,
-0.14549852907657623,
0.11018272489309311,
-0.23260104656219482,
-0.23093442618846893,
-0.09626027196645737,
0.03130624070763588,
0.1218496561050415,
0.22140952944755554,
-0.21295328438282013,
0.13224762678146362,
0.28152215480804443,
-0.09452084451913834,
-0.006010279059410095,
0.04883282631635666,
-0.08815334737300873,
-0.3539391756057739,
0.11548717319965363,
0.6563117504119873,
-0.15293999016284943,
0.2600783705711365,
-0.08844004571437836,
0.2834244668483734,
0.2555861473083496,
0.14299292862415314,
0.02164265140891075,
0.2045213282108307,
-0.174749955534935,
0.0012128949165344238,
0.2362229973077774,
-0.23577654361724854,
-0.4485642910003662,
0.334503173828125,
-0.07491207867860794,
0.10121559351682663,
0.24027866125106812,
0.18430034816265106,
0.12714572250843048,
0.1732587069272995,
-0.09296375513076782,
0.3352498412132263,
-0.09116511791944504,
0.14935776591300964,
-0.42233598232269287,
-0.35224390029907227,
0.12948879599571228,
-0.0704692080616951,
0.20625752210617065,
-0.10679614543914795,
0.010851051658391953,
0.3086216449737549,
0.42381221055984497,
-0.06971417367458344,
0.06697355955839157,
0.4307275414466858,
0.11013719439506531,
-0.024183765053749084,
0.08362847566604614,
-0.060863278806209564,
-0.6595174670219421,
0.2391432374715805,
0.03480397164821625,
0.11287206411361694,
-0.17945988476276398,
-0.19020968675613403,
-0.32507801055908203,
-0.036051079630851746,
0.03658701479434967,
-0.05509965866804123,
-0.0072072409093379974,
0.16559959948062897,
0.019459038972854614,
-0.011816948652267456,
0.011199727654457092,
0.29718050360679626,
-0.05891898646950722,
0.1240009143948555,
-0.05759407579898834,
0.2703052759170532,
-0.20848609507083893,
-0.4145160913467407,
0.07623395323753357,
-0.10465052723884583,
0.3365930914878845,
-0.14795750379562378,
-0.0804552286863327,
0.4644347131252289,
0.21112006902694702,
0.2078770101070404,
-0.3370669186115265,
-0.14443324506282806,
0.10642961412668228,
-0.18254214525222778,
0.05883639305830002,
0.26037275791168213,
0.27810898423194885,
-0.19783610105514526,
-0.06465297937393188,
-0.2876015305519104,
0.11114003509283066,
0.143351748585701,
0.027744293212890625,
0.046034663915634155,
-0.20830801129341125,
0.04454132169485092,
0.33643150329589844,
-0.14404384791851044,
0.22130513191223145,
0.306484192609787,
0.0012367144227027893,
-0.0747142806649208,
-0.13741442561149597,
0.0728355124592781,
0.37376976013183594,
0.06871111690998077,
0.048820652067661285,
-0.09553342312574387,
-0.31320616602897644,
-0.17753487825393677,
0.3540342152118683,
-0.295933336019516,
0.22692018747329712,
0.09383299946784973,
0.0017710737884044647,
0.008286986500024796,
0.0648878812789917,
-0.04902627319097519,
0.266613245010376,
0.07933297753334045,
0.3747991621494293,
0.11402980983257294,
0.06471692025661469,
0.07789114862680435,
-0.1925778090953827,
0.06843675673007965,
-0.026168569922447205,
0.2745479941368103,
-0.27059006690979004,
0.16761894524097443,
-0.28474754095077515,
-0.0606885626912117,
-0.1365298628807068,
0.42505860328674316,
-0.10814604163169861,
-0.3469487726688385,
-0.2206794172525406,
0.3927572965621948,
-0.03309338539838791,
0.023487742990255356,
0.12689726054668427,
0.09268234670162201,
0.14126209914684296,
-0.22965233027935028,
-0.17339405417442322,
-0.15995968878269196,
-0.3201504051685333,
-0.1396777182817459,
0.5417979955673218,
0.040213923901319504,
0.08557447046041489,
0.33107990026474,
-0.2834872007369995,
-0.13234806060791016,
-0.11103028804063797,
0.26039770245552063,
-0.1272176206111908,
0.18458761274814606,
-0.1246214359998703,
0.4473109841346741,
0.0131492018699646,
0.007628574967384338,
-0.21529895067214966,
-0.15285071730613708,
0.07680585235357285,
0.038792043924331665,
0.1409820169210434,
-0.18697747588157654,
-0.18389150500297546,
-0.32119178771972656,
0.0650378167629242,
-0.29393860697746277,
-0.018290232867002487,
0.12070052325725555,
0.06959527730941772,
0.15046997368335724,
0.34013834595680237,
-0.11102347075939178,
-0.0012143850326538086,
0.045496322214603424,
-0.0876285582780838,
-0.12906014919281006,
0.4331165552139282,
-0.13679513335227966,
-0.34813180565834045,
0.24910613894462585,
-0.0063002631068229675,
-0.033780165016651154,
0.27982524037361145,
-0.5587214827537537,
0.39334020018577576,
-0.19555962085723877,
-0.024850063025951385,
0.025515716522932053,
0.11873163282871246,
0.34389805793762207,
-0.12648501992225647,
0.15073472261428833,
-0.11108638346195221,
0.08751906454563141,
-0.17101246118545532,
0.10880282521247864,
0.2652732729911804,
0.0601375550031662,
0.010965805500745773,
0.1966191828250885,
0.9774391055107117,
0.12204807996749878,
0.1541258692741394,
0.2917068898677826,
-0.00723692961037159,
0.36250385642051697,
-0.17297270894050598,
-0.14238549768924713,
0.10387664288282394,
-0.17049334943294525,
-0.35379353165626526,
0.17242853343486786,
-0.027708806097507477,
-0.47638165950775146,
-0.12828168272972107,
0.33670228719711304,
0.009594917297363281,
-0.3107088506221771,
0.24583792686462402,
0.05644785240292549,
0.15541324019432068,
0.07448533177375793,
0.22860512137413025,
0.08811337500810623,
-0.39337649941444397,
0.11166545748710632,
0.2504235804080963,
0.23351353406906128,
0.09563830494880676,
0.2923595607280731,
0.01545797660946846,
-0.5219005346298218,
0.13181990385055542,
-0.02075435034930706,
0.003673788160085678,
-0.10158377885818481,
0.08602682501077652,
0.11067429184913635,
-0.11503088474273682,
0.32198500633239746,
-0.19431711733341217,
-0.0620427243411541,
0.2076038122177124,
0.3443959057331085,
-0.46553558111190796,
-0.03832554444670677,
-0.07039818167686462,
-0.039837583899497986,
0.11810490489006042,
0.09595049917697906,
-0.3414638936519623,
0.018626555800437927,
-0.00020892545580863953,
0.33895623683929443,
-0.16325369477272034,
-0.016016662120819092,
-0.2710227966308594,
-0.322113037109375,
-0.3154071271419525,
-0.10473789274692535,
0.28155481815338135,
0.294405460357666,
0.21248000860214233,
0.03193633258342743,
0.03445691615343094,
0.05676528811454773,
0.03538088500499725,
-0.09275057166814804,
0.49585625529289246,
0.03360014036297798,
0.10865889489650726,
-0.03225173056125641,
-0.03367523476481438,
-0.056499920785427094,
0.5172470211982727,
0.3986329436302185,
0.3314404785633087,
0.15284718573093414,
-0.09410429000854492,
0.07134023308753967,
0.5600569248199463,
-0.2230076789855957,
-0.1566772609949112,
-0.2570592164993286,
0.04131226986646652,
-0.3681793808937073,
0.16259655356407166,
0.07003558427095413,
-0.20591148734092712,
-0.355256587266922,
-0.2934160828590393,
0.6430811285972595,
0.05833183228969574,
-0.2612517476081848,
0.24762025475502014,
0.1307748556137085,
-0.5575965046882629,
0.4297865033149719,
0.3247576653957367,
1.1367549896240234,
-0.22617480158805847,
0.22167542576789856,
0.35478267073631287,
0.08281946182250977,
0.38643547892570496,
-0.8971561193466187,
0.2769477069377899,
-0.31015247106552124,
-0.18482579290866852,
-0.12279713153839111,
-0.14524388313293457,
0.3158234655857086,
0.03997679054737091,
-0.5581866502761841,
0.40921133756637573,
-0.08305562287569046,
0.4596933126449585,
-0.1747795045375824,
0.3808967173099518,
-0.13168469071388245,
-0.27521800994873047,
0.21986350417137146,
0.11370966583490372,
0.05960403382778168,
0.20357783138751984,
-0.21741583943367004,
0.11909380555152893,
-0.09224493056535721,
-0.2982468008995056,
-0.6732563972473145,
0.14742904901504517,
-0.3759428560733795,
0.1207011416554451,
-0.4911971688270569,
-0.294212281703949,
0.2631792426109314,
0.07163068652153015,
-0.0613795667886734,
0.460257887840271,
-0.09710481762886047,
0.3881828188896179,
-0.18031825125217438,
-0.30506646633148193,
-0.01265937089920044,
0.014130514115095139,
0.20699134469032288,
0.011121012270450592,
-0.04738616198301315,
0.18659085035324097,
-0.26493945717811584,
-0.13823331892490387,
-0.34819838404655457,
-0.13706567883491516,
-0.04253384470939636,
0.03804852068424225,
-0.406342089176178,
0.2396615594625473,
0.020864874124526978,
0.06892417371273041,
0.03700898587703705,
-0.1475658118724823,
-0.08866715431213379,
0.29401639103889465,
-0.07174890488386154,
-0.19809749722480774,
-0.11043384671211243,
0.2825061082839966,
0.19742456078529358,
-0.24361853301525116,
0.41700583696365356,
0.34153348207473755,
-0.29986876249313354,
-0.18839429318904877,
-0.2525486946105957,
-0.17237065732479095,
-0.2618916928768158,
-0.036894623190164566,
-0.365620493888855,
0.023356691002845764,
-0.2322043776512146,
0.2145901322364807,
0.09299306571483612,
-0.1654280126094818,
0.029963165521621704,
-0.2489965260028839,
-0.23034074902534485,
0.17494092881679535,
-0.05439300090074539,
0.25026342272758484,
-0.19916094839572906,
-0.38332441449165344,
0.04678264260292053,
0.18715402483940125,
-0.16423296928405762,
0.007787637412548065,
-0.08766733855009079,
0.1741802841424942,
0.38988956809043884,
0.15898527204990387,
0.016234371811151505,
-0.3006962835788727,
-0.008020300418138504,
0.18766069412231445,
0.11570435762405396,
-0.03610082343220711,
0.05741438269615173,
0.20717163383960724,
0.06151259317994118,
0.060064785182476044,
-0.13903596997261047,
-0.5661214590072632,
-0.051183462142944336,
-0.2460302710533142,
0.35984376072883606,
0.018260598182678223,
-0.06423275917768478,
-0.042046766728162766,
0.09260551631450653,
0.2650482654571533,
-0.2757914364337921,
0.2562136650085449,
-0.06019379571080208,
0.542175829410553,
0.2946418523788452,
0.10809807479381561,
0.37723904848098755,
-0.00693657249212265,
-0.4233318865299225,
0.27956902980804443,
-0.06150481849908829,
0.09431876242160797,
0.4300106465816498,
-0.17505423724651337,
-0.08157216757535934,
0.08301123231649399,
0.036810025572776794,
0.28588247299194336,
-0.11645682901144028,
-0.13432258367538452,
0.17871907353401184,
0.07434525340795517,
0.13865503668785095,
0.013695955276489258,
0.17184357345104218,
0.17373868823051453,
-0.16216596961021423,
0.2953340709209442,
0.272821307182312,
-0.22160670161247253,
-0.2644100487232208,
0.2635605037212372,
0.38898783922195435,
0.3400910496711731,
0.24542295932769775,
-0.3050287365913391,
0.1158045083284378,
-0.04895615205168724,
-0.051341310143470764,
0.06667017936706543,
0.11636996269226074,
0.2572714388370514,
-0.2057543843984604,
0.1254543662071228,
0.1068655326962471,
-0.18588252365589142,
-0.3713976740837097,
-0.1425268054008484,
0.13787665963172913,
0.3471229672431946,
0.09837806224822998,
0.3292398154735565,
0.02436089888215065,
-0.05545780062675476,
0.22527490556240082,
-0.35180357098579407,
-0.29962557554244995,
0.11296787112951279,
-0.18592996895313263,
0.06891299784183502,
0.15752360224723816,
-0.1884499341249466,
-0.222385436296463,
0.3575102686882019,
0.009058536030352116,
-0.5023667812347412,
0.35352808237075806,
0.3448791801929474,
-0.21466918289661407,
-0.1305226981639862,
0.5851330757141113,
0.18777935206890106,
0.20911356806755066,
-0.30172717571258545,
0.3000001013278961,
-0.147964745759964,
-0.006757266819477081,
-0.11448293179273605,
-0.14433537423610687,
0.3625158369541168,
0.37760549783706665,
-0.5416686534881592,
-0.06898842006921768,
0.1479504406452179,
0.01266024261713028,
-0.0413743257522583,
0.12027071416378021,
-0.18369801342487335,
0.2934044897556305,
0.13292013108730316,
0.0095771923661232,
-0.07361295819282532,
-0.3569757640361786,
0.41281622648239136,
0.2951757311820984,
-0.279611736536026,
-0.06142998859286308,
-0.13085097074508667,
-0.027053557336330414,
0.09743432700634003,
0.021729858592152596,
-0.43046674132347107,
-0.055228691548109055,
0.24726977944374084,
0.0194673053920269,
0.21446551382541656,
-0.09967382997274399,
-0.027520760893821716,
0.04070824384689331,
0.5138937830924988,
0.03255244344472885,
0.01934869773685932,
-0.6117090582847595,
-0.48193415999412537,
-0.4367371201515198,
0.05825934186577797,
-0.21145592629909515,
-0.3008563220500946,
0.01388159766793251,
0.3542996346950531,
-0.014032535254955292,
0.1911219358444214,
0.21729157865047455,
0.048583537340164185,
-0.06554149836301804,
0.3409494459629059,
-0.20070946216583252,
-0.17400775849819183,
-0.38455843925476074,
-0.08870179951190948,
-0.12208746373653412,
-0.42252302169799805,
0.03311608359217644,
-0.2140101045370102,
-0.09256301820278168,
-0.18962684273719788,
-0.050872158259153366,
-0.007498785853385925,
-0.16084375977516174,
0.6456555128097534,
-0.19913847744464874,
0.33555036783218384,
-0.06098403409123421,
-0.32435399293899536,
-0.5329300165176392,
-0.18847720324993134,
-0.048365518450737,
-0.12120269238948822,
-0.08949406445026398,
0.39417314529418945,
-0.31014877557754517,
0.18147331476211548,
-0.47759008407592773,
0.19032815098762512,
0.1279042810201645,
0.2489413321018219,
-0.11546242237091064,
-0.16536252200603485,
-0.2820572853088379,
0.5089426040649414,
0.12230600416660309,
0.1094115674495697,
-0.05187956243753433,
0.26950743794441223,
-0.3697890043258667,
-0.3682113587856293,
0.3801719546318054,
-0.2096123993396759,
-0.5402869582176208,
0.08884745836257935,
0.12041868269443512,
-0.0017312746495008469,
0.13997942209243774,
-0.6733095645904541,
0.04424309730529785,
0.1190854161977768,
0.026060275733470917,
-0.2379089593887329,
-0.04565420001745224,
-0.12650343775749207,
-0.13905222713947296,
-0.06443275511264801,
0.0764518678188324,
-0.04429087042808533,
-0.1926119029521942,
-0.20788046717643738,
-0.379508376121521
] |
https://github.com/huggingface/datasets/issues/5687 | Great idea!
Should we also take this opportunity to include some audio/image file formats? Currently, it still reads very text heavy. Something like:
> We support many text, audio, and image data extensions such as `.zip`, `.rar`, `.mp3`, and `.jpg` among many others. For data extensions like `.csv`, `.json`, `.jsonl`, and `txt`, we recommend compressing them before uploading to the Hub. These file extensions are not tracked by Git LFS by default, and if they're too large, they will not be committed and uploaded. Take a look at the `.gitattributes` file in your repository for a complete list of supported file extensions. | Document to compress data files before uploading | In our docs to [Share a dataset to the Hub](https://huggingface.co/docs/datasets/upload_dataset), we tell users to upload directly their data files, like CSV, JSON, JSON-Lines, text,... However, these extensions are not tracked by Git LFS by default, as they are not in the `.giattributes` file. Therefore, if they are too large, Git will fail to commit/upload them.
I think for those file extensions (.csv, .json, .jsonl, .txt), we should better recommend to **compress** their data files (using ZIP for example) before uploading them to the Hub.
- Compressed files are tracked by Git LFS in our default `.gitattributes` file
What do you think?
CC: @stevhliu
See related issue:
- https://huggingface.co/datasets/tcor0005/langchain-docs-400-chunksize/discussions/1 | 102 | Document to compress data files before uploading
In our docs to [Share a dataset to the Hub](https://huggingface.co/docs/datasets/upload_dataset), we tell users to upload directly their data files, like CSV, JSON, JSON-Lines, text,... However, these extensions are not tracked by Git LFS by default, as they are not in the `.giattributes` file. Therefore, if they are too large, Git will fail to commit/upload them.
I think for those file extensions (.csv, .json, .jsonl, .txt), we should better recommend to **compress** their data files (using ZIP for example) before uploading them to the Hub.
- Compressed files are tracked by Git LFS in our default `.gitattributes` file
What do you think?
CC: @stevhliu
See related issue:
- https://huggingface.co/datasets/tcor0005/langchain-docs-400-chunksize/discussions/1
Great idea!
Should we also take this opportunity to include some audio/image file formats? Currently, it still reads very text heavy. Something like:
> We support many text, audio, and image data extensions such as `.zip`, `.rar`, `.mp3`, and `.jpg` among many others. For data extensions like `.csv`, `.json`, `.jsonl`, and `txt`, we recommend compressing them before uploading to the Hub. These file extensions are not tracked by Git LFS by default, and if they're too large, they will not be committed and uploaded. Take a look at the `.gitattributes` file in your repository for a complete list of supported file extensions. | [
-0.2533719539642334,
0.054745256900787354,
0.005586832761764526,
0.27009162306785583,
0.11869227886199951,
0.05874861776828766,
-0.044740378856658936,
0.4713585376739502,
-0.01798579841852188,
0.14153584837913513,
-0.1133246198296547,
0.055356815457344055,
-0.06797626614570618,
0.22386179864406586,
0.10299848020076752,
-0.04190268740057945,
-0.01004406064748764,
0.2741245925426483,
0.12168485671281815,
0.00624055415391922,
-0.09937308728694916,
0.20620985329151154,
0.22736795246601105,
-0.06411057710647583,
-0.5497575402259827,
0.12335432320833206,
-0.06986160576343536,
0.3472524881362915,
-0.5283297300338745,
-0.21144913136959076,
-0.20179718732833862,
0.48639145493507385,
0.34153515100479126,
0.37668460607528687,
-0.00011917885422008112,
-0.1975354105234146,
0.37863728404045105,
-0.24615561962127686,
-0.3791060149669647,
-0.0318652018904686,
-0.10817622393369675,
-0.44870519638061523,
-0.0031675435602664948,
-0.012967407703399658,
-0.2986670732498169,
-0.2265327274799347,
-0.008453194983303547,
-0.011803634464740753,
0.08887100219726562,
0.06491097807884216,
0.10419696569442749,
0.12458567321300507,
0.23778069019317627,
0.10091671347618103,
0.3957563042640686,
0.4198146164417267,
-0.23438000679016113,
0.22619666159152985,
0.4174431562423706,
0.3313668370246887,
-0.25059032440185547,
0.1794462949037552,
0.1732485592365265,
-0.10018658638000488,
0.36049631237983704,
-0.011042442172765732,
-0.1479775607585907,
-0.3574100732803345,
-0.21119284629821777,
0.23772072792053223,
0.39002731442451477,
-0.010457259602844715,
-0.38945272564888,
-0.5598900318145752,
0.22682547569274902,
-0.3016865849494934,
0.24904696643352509,
0.1815488338470459,
0.07465628534555435,
0.30917197465896606,
-0.13413646817207336,
-0.3182355463504791,
-0.19765940308570862,
0.10735369473695755,
0.18992295861244202,
-0.06483788043260574,
-0.20650610327720642,
-0.122306689620018,
0.38404446840286255,
-0.2400500774383545,
-0.3586370348930359,
-0.3554210364818573,
-0.01761539652943611,
-0.11529922485351562,
0.24592529237270355,
-0.31473392248153687,
-0.00936298817396164,
0.2533208727836609,
0.45763492584228516,
0.0503540076315403,
-0.27881675958633423,
-0.08809326589107513,
-0.23832735419273376,
0.10006209462881088,
0.2275959849357605,
0.24295569956302643,
0.1578007936477661,
-0.007161162793636322,
0.31262141466140747,
0.06267300248146057,
0.260908305644989,
-0.06536087393760681,
-0.2669154107570648,
0.050636403262615204,
-0.3229506313800812,
-0.10806477069854736,
0.22467273473739624,
-0.16748088598251343,
0.11869119852781296,
0.07190147042274475,
0.3976118564605713,
-0.10508760809898376,
0.12636896967887878,
-0.12964031100273132,
0.1791241466999054,
0.2923755645751953,
-0.2801347076892853,
0.22055953741073608,
0.19060227274894714,
-0.2564125061035156,
-0.0469944141805172,
-0.08561446517705917,
-0.007084563374519348,
0.2215215414762497,
0.36124932765960693,
-0.5760645270347595,
0.21732491254806519,
0.0014972463250160217,
0.4287274479866028,
0.04509234428405762,
0.06911490112543106,
-0.09432221949100494,
0.23249685764312744,
0.3465901017189026,
-0.009340770542621613,
0.01989573985338211,
0.1493145227432251,
-0.13956867158412933,
-0.336908221244812,
0.3184767961502075,
-0.7864044904708862,
-0.24907881021499634,
-0.467837929725647,
0.014894022606313229,
-0.13161872327327728,
0.11295299977064133,
-0.426571786403656,
0.28089994192123413,
0.009016234427690506,
0.08897987008094788,
0.16349326074123383,
0.10113218426704407,
-0.08460122346878052,
-0.11300108581781387,
0.24365365505218506,
0.3759424090385437,
-0.05722453072667122,
-0.11897871643304825,
-0.07224123924970627,
-0.02445099875330925,
0.2029455602169037,
0.6135998964309692,
-0.1407608836889267,
0.09891344606876373,
-0.0508016012609005,
0.5521249175071716,
0.46804818511009216,
-0.41610944271087646,
-0.21111920475959778,
0.13716277480125427,
-0.044561974704265594,
0.33068615198135376,
-0.09439244866371155,
-0.08466014266014099,
0.35001474618911743,
-0.16406482458114624,
0.23398257791996002,
0.13207672536373138,
-0.3505103588104248,
0.014312274754047394,
-0.32813796401023865,
-0.538171648979187,
0.3057915270328522,
0.1175110712647438,
-0.2313244640827179,
-0.13273364305496216,
-0.03397463262081146,
-0.043133966624736786,
0.010986520908772945,
-0.2778951823711395,
0.13327378034591675,
0.11621689796447754,
0.18305405974388123,
0.03610486537218094,
0.1241648942232132,
0.04913631081581116,
-0.34132611751556396,
0.02826768159866333,
0.025791801512241364,
0.02522520162165165,
-0.1659538745880127,
-0.3082263469696045,
-0.00556018203496933,
-0.31453555822372437,
0.052442774176597595,
0.06769019365310669,
0.04626638442277908,
-0.15212970972061157,
-0.12757118046283722,
0.25323909521102905,
-0.1870829164981842,
-0.04738442972302437,
-0.08189797401428223,
0.22626841068267822,
-0.2024202197790146,
0.06400116533041,
-0.0450596883893013,
-0.16869458556175232,
0.31264185905456543,
0.07067833840847015,
0.014531397260725498,
-0.3320413827896118,
-0.11366371810436249,
0.18866460025310516,
-0.002482745796442032,
0.5170292854309082,
0.25461921095848083,
0.6284995079040527,
0.5116771459579468,
0.18277767300605774,
0.16299091279506683,
-0.28246957063674927,
-0.12756942212581635,
-0.0769314169883728,
-0.2567366361618042,
0.2685033977031708,
-0.24847176671028137,
-0.1107015609741211,
-0.16988079249858856,
-0.16504785418510437,
0.14268642663955688,
0.12406371533870697,
-0.3496173620223999,
-0.11603818088769913,
0.02564273215830326,
0.07315578311681747,
0.17698656022548676,
0.237055703997612,
0.05869995057582855,
0.11617559939622879,
0.9501367807388306,
-0.20640450716018677,
-0.05504836142063141,
0.7072353363037109,
0.046330321580171585,
-0.20872293412685394,
0.14111009240150452,
-0.3008617162704468,
0.11306001245975494,
0.11525231599807739,
0.12989595532417297,
-0.22879041731357574,
0.15906040370464325,
-0.31318244338035583,
0.30529147386550903,
-0.0670458972454071,
0.16354167461395264,
0.3309350907802582,
0.06353858858346939,
0.14399453997612,
-0.33175191283226013,
0.1379786878824234,
-0.12605559825897217,
0.08093587309122086,
-0.07601355016231537,
-0.12948471307754517,
-0.11759006977081299,
-0.11692894995212555,
0.2863849103450775,
-0.2568488121032715,
-0.4843668043613434,
-0.16837194561958313,
0.34316733479499817,
0.03183440864086151,
-0.26801490783691406,
0.039385005831718445,
0.18377631902694702,
0.6635104417800903,
0.13225293159484863,
-0.10463599115610123,
-0.1392873078584671,
0.10732331871986389,
-0.041523028165102005,
-0.010294817388057709,
0.27224451303482056,
-0.2822045087814331,
0.16184349358081818,
-0.2867240011692047,
0.3097306489944458,
-0.1978474259376526,
-0.3782070279121399,
0.2930886745452881,
-0.3640323579311371,
0.073946014046669,
-0.09314224123954773,
0.02055501751601696,
0.28047752380371094,
-0.23587894439697266,
0.022619031369686127,
0.018735557794570923,
-0.001426607370376587,
0.008192338049411774,
0.03283493593335152,
-0.12852677702903748,
-0.3845731317996979,
0.04030965641140938,
-0.08388318121433258,
-0.46922531723976135,
0.5168207287788391,
0.21753767132759094,
0.1712673455476761,
0.19513541460037231,
0.06739413738250732,
0.18641789257526398,
-0.04399014264345169,
-0.03180035948753357,
0.011517763137817383,
-0.5087285041809082,
0.5053819417953491,
-0.1098371148109436,
-0.2905680537223816,
0.0004794299602508545,
0.4380648136138916,
-0.035971298813819885,
-0.04764655977487564,
-0.2287367582321167,
-0.20011261105537415,
-0.16327600181102753,
0.33844196796417236,
0.1479911208152771,
-0.015202630311250687,
0.10315252840518951,
0.0595884770154953,
-0.028684401884675026,
-0.010390236973762512,
0.009599506855010986,
0.029556915163993835,
0.4137378931045532,
0.05345970392227173,
-0.08669894933700562,
0.02555098757147789,
0.03200916200876236,
0.3986819386482239,
0.5393022894859314,
-0.02469181828200817,
0.17680463194847107,
0.21199369430541992,
0.46616899967193604,
-0.1900210678577423,
0.06811177730560303,
0.21338923275470734,
0.010274432599544525,
-0.006271913647651672,
0.7070320844650269,
0.4757208228111267,
-0.01751701533794403,
0.09255585074424744,
-0.3117676377296448,
0.07540170848369598,
-0.3383142352104187,
0.3238004148006439,
0.04685917869210243,
0.004521300084888935,
-0.2377658486366272,
-0.3771020472049713,
-0.19949272274971008,
-0.401605486869812,
0.10787802934646606,
0.627562403678894,
0.31560370326042175,
0.19146032631397247,
0.09811955690383911,
0.022493351250886917,
-0.6592738628387451,
-0.021273039281368256,
0.0770120620727539,
0.018037889152765274,
-0.30860376358032227,
-0.013459920883178711,
-0.17074835300445557,
0.07959552109241486,
0.2590773105621338,
-0.3660103976726532,
-0.353293240070343,
-0.2211170196533203,
0.2776869237422943,
0.017846569418907166,
-0.018308378756046295,
-0.24862363934516907,
0.25324133038520813,
0.1832541823387146,
0.7014323472976685,
-0.35278743505477905,
-0.35383141040802,
-0.15394671261310577,
0.2367447018623352,
0.1946232169866562,
0.02836425229907036,
-0.07570724934339523,
-0.15835028886795044,
-0.5862314701080322,
-0.08147275447845459,
0.3435989022254944,
-0.08532179892063141,
-0.48682889342308044,
-0.24924948811531067,
0.4720701575279236,
0.13980193436145782,
0.2568698525428772,
0.09479986131191254,
0.08558569103479385,
0.19829927384853363,
-0.1505904197692871,
0.05492628365755081,
0.25592151284217834,
0.5214812159538269,
0.5336938500404358,
0.09665325284004211,
-0.042450591921806335,
0.10642298310995102,
-0.6091102957725525,
-0.03209475800395012,
0.4100876450538635,
0.006385453045368195,
-0.0012813806533813477,
-0.07685782015323639,
0.3083834648132324,
-0.6775049567222595,
0.08452673256397247,
0.19330772757530212,
-0.22106105089187622,
-0.3527090847492218,
0.23385831713676453,
0.26265862584114075,
0.14004340767860413,
0.06374403834342957,
0.5220153331756592,
0.4070384204387665,
-0.22806531190872192,
-0.09954632818698883,
0.16955187916755676,
1.2200751304626465,
-0.14804652333259583,
0.18223059177398682,
-0.07900096476078033,
-0.2514396905899048,
0.3762530982494354,
-0.5863779783248901,
-0.12777161598205566,
0.1356498897075653,
-0.19130069017410278,
-0.07233691960573196,
0.0789346769452095,
0.2020680010318756,
-0.020291637629270554,
-0.5295683145523071,
-0.1734670102596283,
0.032087042927742004,
-0.02219180017709732,
-0.2599216401576996,
0.6864821314811707,
-0.421597957611084,
-0.44653767347335815,
0.035837989300489426,
0.08333932608366013,
-0.11020348966121674,
0.014811636880040169,
0.06209184229373932,
-0.4050355851650238,
-0.22575566172599792,
-0.11626078188419342,
-0.3532162308692932,
-0.08562444150447845,
0.04110926762223244,
-0.21668469905853271,
-0.1880895495414734,
-0.057871900498867035,
0.17724864184856415,
-0.23407523334026337,
0.4226437509059906,
0.07970143854618073,
-0.50076824426651,
-0.169037327170372,
-0.413165420293808,
0.1706826239824295,
-0.19854065775871277,
-0.22960782051086426,
0.14444111287593842,
0.0239274725317955,
0.013181835412979126,
-0.3026098310947418,
0.04535377398133278,
-0.1479736864566803,
-0.005326613783836365,
-0.29883265495300293,
-0.1450566053390503,
-0.29234904050827026,
-0.09511939436197281,
0.021604275330901146,
-0.412558913230896,
0.19119544327259064,
0.039657074958086014,
0.11457516252994537,
0.15910880267620087,
-0.08362653851509094,
0.2601761519908905,
-0.13519710302352905,
-0.14022690057754517,
-0.0008916892111301422,
0.016798578202724457,
-0.02956250309944153,
0.039432112127542496,
0.031007468700408936,
-0.3312870264053345,
-0.04706166312098503,
0.15716633200645447,
0.10584978014230728,
-0.48277589678764343,
0.027975041419267654,
0.009543735533952713,
-0.2438741773366928,
-0.38593587279319763,
0.13313505053520203,
0.23047369718551636,
-0.0736609399318695,
0.10055528581142426,
0.1715790331363678,
-0.33536258339881897,
0.26880431175231934,
-0.14881309866905212,
0.2798628509044647,
-0.1951974630355835,
-0.1973116397857666,
0.1478188931941986,
0.18063224852085114,
-0.22326335310935974,
0.08507878333330154,
-0.010719425976276398,
0.18341931700706482,
0.1519925892353058,
0.052854809910058975,
0.17856447398662567,
-0.3173706531524658,
-0.20899644494056702,
-0.004098508507013321,
-0.25277864933013916,
-0.06725793331861496,
-0.21335271000862122,
0.18064525723457336,
0.21256211400032043,
-0.24535280466079712,
0.07171371579170227,
-0.18119800090789795,
-0.157728374004364,
-0.28038936853408813,
0.26529479026794434,
-0.3076058626174927,
0.03536277636885643,
0.0943162813782692,
0.12981495261192322,
-0.028599396347999573,
0.2573695182800293,
0.07019131630659103,
0.1848161816596985,
0.6810850501060486,
-0.041462648659944534,
0.055253081023693085,
-0.168593168258667,
-0.001289457082748413,
-0.28921735286712646,
0.3775019943714142,
0.3446575403213501,
0.27767398953437805,
0.1080310121178627,
0.1420942097902298,
0.05447453260421753,
0.24294571578502655,
0.16877217590808868,
0.05668555572628975,
-0.3015426993370056,
-0.10809223353862762,
0.03781111165881157,
0.09255728870630264,
0.08966583013534546,
-0.14621885120868683,
0.1940208524465561,
-0.17014554142951965,
-0.03810196369886398,
0.29599788784980774,
0.5235155820846558,
0.24315956234931946,
0.10276739299297333,
-0.06942731887102127,
0.3435691297054291,
0.07432675361633301,
0.2483733743429184,
0.06823664903640747,
-0.10445991903543472,
0.0787474662065506,
0.034284137189388275,
0.12051074206829071,
0.11518736928701401,
-0.239888995885849,
-0.006474092602729797,
0.1241300031542778,
0.34669896960258484,
0.02824031002819538,
0.21512676775455475,
0.02745313197374344,
0.1423420011997223,
0.3067049980163574,
0.32356640696525574,
0.2052735835313797,
0.3378695845603943,
0.19643805921077728,
-0.09734991192817688,
-0.3445885181427002,
-0.08129602670669556,
0.11240041255950928,
-0.08043737709522247,
0.01660512015223503,
0.11405254900455475,
-0.11791545897722244,
-0.5169981718063354,
-0.06493733823299408,
-0.2211875319480896,
0.1706039309501648,
-0.09021972119808197,
0.33537352085113525,
0.11229240149259567,
-0.18386127054691315,
0.294056236743927,
0.028615888208150864,
0.5233107209205627,
-0.17456087470054626,
0.42392367124557495,
0.1716201901435852,
-0.18856438994407654,
0.13448123633861542,
0.44512757658958435,
0.32831045985221863,
0.11853275448083878,
0.28373825550079346,
0.14047518372535706,
0.04160447418689728,
-0.03462022915482521,
0.0005284473299980164,
0.27134883403778076,
0.12947362661361694,
-0.11199948191642761,
0.09870285540819168,
0.06986358016729355,
-0.07168286293745041,
-0.04590221121907234,
-0.25835034251213074,
-0.4326983690261841,
-0.07072076201438904,
0.03295951709151268,
0.15536147356033325,
-0.11345288157463074,
-0.06761078536510468,
-0.22738265991210938,
-0.15501120686531067,
0.20608903467655182,
0.48585349321365356,
-0.07955259084701538,
-0.02902674488723278,
-0.26950177550315857,
0.03544480353593826,
0.13988856971263885,
0.3531980514526367,
0.4939582049846649,
-0.2592347264289856,
-0.017300620675086975,
-0.19377759099006653,
-0.12580130994319916,
0.211154967546463,
-0.22722114622592926,
0.00867868959903717,
0.16918326914310455,
0.1899847388267517,
-0.00044310465455055237,
0.4029001295566559,
0.07267323136329651,
-0.30533379316329956,
-0.08355154097080231,
-0.4741341471672058,
-0.10433115065097809,
-0.0413108766078949,
0.14931508898735046,
0.1540190428495407,
-0.03161488100886345,
-0.06143386662006378,
0.49539613723754883,
0.06742175668478012,
-0.10690701752901077,
-0.35204508900642395,
0.22823050618171692,
-0.09956876933574677,
0.07178386300802231,
0.26575711369514465,
0.3302499055862427,
-0.04610366001725197,
-0.272064745426178,
-0.28256955742836,
-0.07344034314155579,
-0.045568618923425674,
-0.3063421845436096,
-0.06330101191997528,
-0.03872224688529968,
0.23593531548976898,
-0.33877721428871155,
-0.4501180350780487,
-0.35072338581085205,
0.10293029993772507,
-0.202077254652977,
0.13666775822639465,
-0.19250425696372986,
-0.07823759317398071,
-0.04331545531749725,
-0.2613241970539093,
0.16959549486637115,
0.2050655633211136,
0.06642003357410431,
-0.015606343746185303,
-0.07556872069835663,
-0.17003941535949707,
0.418220192193985,
-0.03382959961891174,
-0.11900371313095093,
0.22905871272087097,
0.029645565897226334,
0.49261295795440674,
0.03567168116569519,
-0.5174905061721802,
0.030435696244239807,
0.14706256985664368,
0.10846109688282013,
-0.24183179438114166,
0.40161293745040894,
0.01869272068142891,
-0.1718793660402298,
-0.2399768978357315,
0.05464520677924156,
0.049836415797472,
-0.34586581587791443,
-0.029090363532304764,
-0.17498672008514404
] |
https://github.com/huggingface/datasets/issues/5687 | Hi @stevhliu, thanks for your suggestion.
I agree it is a good opportunity to mention that audio/image file formats are also supported.
Nit:
I would not mention .zip, .rar after "text, audio, and image data extensions". Those are "compression" extensions and not "text, audio, and image data extensions".
What about something similar to:
> We support many text, audio, and image data extensions such as `.csv`, `.mp3`, and `.jpg` among many others. For text data extensions like `.csv`, `.json`, `.jsonl`, and `.txt`, we recommend compressing them before uploading to the Hub (to `.zip` or `.gz` file extension for example).
>
> Note that text file extensions are not tracked by Git LFS by default, and if they're too large, they will not be committed and uploaded. Take a look at the `.gitattributes` file in your repository for a complete list of tracked file extensions by default.
Note that for compressions I have mentioned:
- gz, to compress individual files
- zip, to compress and archive multiple files; zip is preferred rather than tar because it supports streaming out of the box | Document to compress data files before uploading | In our docs to [Share a dataset to the Hub](https://huggingface.co/docs/datasets/upload_dataset), we tell users to upload directly their data files, like CSV, JSON, JSON-Lines, text,... However, these extensions are not tracked by Git LFS by default, as they are not in the `.giattributes` file. Therefore, if they are too large, Git will fail to commit/upload them.
I think for those file extensions (.csv, .json, .jsonl, .txt), we should better recommend to **compress** their data files (using ZIP for example) before uploading them to the Hub.
- Compressed files are tracked by Git LFS in our default `.gitattributes` file
What do you think?
CC: @stevhliu
See related issue:
- https://huggingface.co/datasets/tcor0005/langchain-docs-400-chunksize/discussions/1 | 181 | Document to compress data files before uploading
In our docs to [Share a dataset to the Hub](https://huggingface.co/docs/datasets/upload_dataset), we tell users to upload directly their data files, like CSV, JSON, JSON-Lines, text,... However, these extensions are not tracked by Git LFS by default, as they are not in the `.giattributes` file. Therefore, if they are too large, Git will fail to commit/upload them.
I think for those file extensions (.csv, .json, .jsonl, .txt), we should better recommend to **compress** their data files (using ZIP for example) before uploading them to the Hub.
- Compressed files are tracked by Git LFS in our default `.gitattributes` file
What do you think?
CC: @stevhliu
See related issue:
- https://huggingface.co/datasets/tcor0005/langchain-docs-400-chunksize/discussions/1
Hi @stevhliu, thanks for your suggestion.
I agree it is a good opportunity to mention that audio/image file formats are also supported.
Nit:
I would not mention .zip, .rar after "text, audio, and image data extensions". Those are "compression" extensions and not "text, audio, and image data extensions".
What about something similar to:
> We support many text, audio, and image data extensions such as `.csv`, `.mp3`, and `.jpg` among many others. For text data extensions like `.csv`, `.json`, `.jsonl`, and `.txt`, we recommend compressing them before uploading to the Hub (to `.zip` or `.gz` file extension for example).
>
> Note that text file extensions are not tracked by Git LFS by default, and if they're too large, they will not be committed and uploaded. Take a look at the `.gitattributes` file in your repository for a complete list of tracked file extensions by default.
Note that for compressions I have mentioned:
- gz, to compress individual files
- zip, to compress and archive multiple files; zip is preferred rather than tar because it supports streaming out of the box | [
-0.3402373790740967,
-0.011479124426841736,
-0.006043870002031326,
0.18851113319396973,
0.09288416802883148,
0.03134346008300781,
-0.012564806267619133,
0.41845306754112244,
-0.02043207734823227,
0.10502022504806519,
-0.06398440152406693,
0.03946533426642418,
-0.028320204466581345,
0.12046121805906296,
0.046015992760658264,
-0.041326284408569336,
-0.04603339359164238,
0.27701839804649353,
0.1454162299633026,
0.0742092877626419,
-0.17838293313980103,
0.24850639700889587,
0.18206654489040375,
-0.004964049905538559,
-0.5294039249420166,
0.12180950492620468,
-0.021862871944904327,
0.269930899143219,
-0.47886157035827637,
-0.20180344581604004,
-0.1205127164721489,
0.46810710430145264,
0.4112185537815094,
0.35922151803970337,
-0.00011758266919059679,
-0.14319473505020142,
0.350873202085495,
-0.23904353380203247,
-0.3800770342350006,
-0.09674001485109329,
-0.12491115927696228,
-0.43909817934036255,
-0.043839599937200546,
-0.04154343903064728,
-0.2821922302246094,
-0.23509517312049866,
0.015547061339020729,
-0.11386825144290924,
0.09906859695911407,
0.01898481324315071,
0.1300506591796875,
0.11349731683731079,
0.3325956463813782,
0.02528546005487442,
0.35837242007255554,
0.40503817796707153,
-0.18071331083774567,
0.23634235560894012,
0.3545514941215515,
0.3285823166370392,
-0.25587084889411926,
0.08556029200553894,
0.23291519284248352,
0.002400396391749382,
0.3347375988960266,
-0.05516493692994118,
-0.1656373143196106,
-0.3931301534175873,
-0.19442743062973022,
0.21098098158836365,
0.334082692861557,
0.030653374269604683,
-0.47829946875572205,
-0.5493544340133667,
0.1998775601387024,
-0.3844737410545349,
0.27470260858535767,
0.2435617744922638,
0.04536356031894684,
0.26178768277168274,
-0.13186155259609222,
-0.11306208372116089,
-0.12411710619926453,
0.11084906756877899,
0.07174886018037796,
-0.08856558799743652,
-0.21302327513694763,
-0.05513032525777817,
0.33915501832962036,
-0.3482246696949005,
-0.39726608991622925,
-0.4220423102378845,
0.006775247864425182,
-0.042485080659389496,
0.1428060531616211,
-0.28310543298721313,
-0.01853170245885849,
0.1498224437236786,
0.47652679681777954,
0.09397387504577637,
-0.2539750039577484,
-0.12134343385696411,
-0.20356404781341553,
0.17214907705783844,
0.07614138722419739,
0.3872714340686798,
0.10856024920940399,
0.0015470683574676514,
0.38738110661506653,
0.15093502402305603,
0.15302921831607819,
-0.04292450472712517,
-0.20973697304725647,
-0.0470769889652729,
-0.32762980461120605,
0.0641404241323471,
0.24644264578819275,
-0.15980148315429688,
0.03618701547384262,
0.031555891036987305,
0.4052865505218506,
-0.15687260031700134,
0.08920357376337051,
-0.087532639503479,
0.2551109790802002,
0.2084474116563797,
-0.3177551031112671,
0.2652759552001953,
0.24390292167663574,
-0.20022554695606232,
-0.035108909010887146,
-0.12373898178339005,
-0.01514715701341629,
0.20188520848751068,
0.44112807512283325,
-0.6426530480384827,
0.19117069244384766,
0.036268118768930435,
0.415294885635376,
0.0009095445275306702,
0.1521148979663849,
-0.17416724562644958,
0.20153971016407013,
0.4120728075504303,
0.0009664595127105713,
0.003603920340538025,
0.21377642452716827,
-0.07654228806495667,
-0.36836278438568115,
0.3518441915512085,
-0.8237534761428833,
-0.18807090818881989,
-0.3847629427909851,
0.054905980825424194,
-0.09724199771881104,
0.13869407773017883,
-0.38799676299095154,
0.23239058256149292,
-0.053407471626996994,
0.023864544928073883,
0.1639476716518402,
0.04590938240289688,
0.011784687638282776,
-0.13654854893684387,
0.2505062222480774,
0.2763638496398926,
-0.09066905826330185,
-0.12301380932331085,
-0.15999352931976318,
-0.0659126341342926,
0.24341706931591034,
0.5832549333572388,
-0.16118839383125305,
0.04244711622595787,
-0.13456836342811584,
0.6104289889335632,
0.5129905939102173,
-0.3167174458503723,
-0.21798783540725708,
0.03385085612535477,
-0.028207920491695404,
0.34240615367889404,
-0.12197245657444,
-0.08990488946437836,
0.34895092248916626,
-0.14457224309444427,
0.2007298767566681,
0.20635230839252472,
-0.2109948694705963,
0.05233054608106613,
-0.266574889421463,
-0.5341504812240601,
0.33695170283317566,
0.0665002167224884,
-0.23240430653095245,
-0.10867565125226974,
-0.02216082066297531,
-0.10723748803138733,
-0.15746751427650452,
-0.28898346424102783,
0.1714513897895813,
0.12287517637014389,
0.04039117693901062,
-0.06026017293334007,
0.10456302762031555,
0.023768015205860138,
-0.3611313998699188,
0.09597241878509521,
-0.0990474596619606,
-0.01639886014163494,
-0.2181263267993927,
-0.24535739421844482,
0.0257127583026886,
-0.31970733404159546,
0.061336543411016464,
0.09228944778442383,
0.10779423266649246,
-0.017750084400177002,
-0.049512848258018494,
0.1911393702030182,
-0.20851698517799377,
-0.04712006449699402,
-0.036238301545381546,
0.23680055141448975,
-0.15798021852970123,
0.07277533411979675,
-0.1119031310081482,
-0.15025021135807037,
0.3125396966934204,
0.009832465089857578,
0.08699974417686462,
-0.26515766978263855,
-0.18226176500320435,
0.15843313932418823,
0.04607381299138069,
0.4390222728252411,
0.27641427516937256,
0.5806893706321716,
0.45182669162750244,
0.2398272305727005,
0.12611468136310577,
-0.1917499452829361,
-0.13100816309452057,
-0.026215940713882446,
-0.25451329350471497,
0.36358606815338135,
-0.07030707597732544,
-0.11312638223171234,
-0.09520812332630157,
-0.2082715630531311,
0.16807565093040466,
0.11953870952129364,
-0.28745731711387634,
-0.13442356884479523,
0.006252308376133442,
0.12580569088459015,
0.19008250534534454,
0.1936418116092682,
0.07134180516004562,
0.004178982228040695,
0.9647350907325745,
-0.1613328754901886,
0.015470813028514385,
0.7671704292297363,
0.008406544104218483,
-0.14213451743125916,
0.1531752496957779,
-0.15378756821155548,
0.1907052993774414,
0.1023116409778595,
0.1974252611398697,
-0.2949742078781128,
0.11571857333183289,
-0.32006770372390747,
0.28579020500183105,
-0.13342928886413574,
0.17558050155639648,
0.4141947031021118,
0.14964354038238525,
0.20557597279548645,
-0.23154312372207642,
0.06341511756181717,
-0.11124840378761292,
0.07959342002868652,
-0.06767310202121735,
-0.1671600341796875,
-0.20654407143592834,
-0.12687666714191437,
0.30953389406204224,
-0.2932569980621338,
-0.5769140124320984,
-0.12250042706727982,
0.35501036047935486,
-0.039265893399715424,
-0.23913270235061646,
0.03986252844333649,
0.15895754098892212,
0.6270085573196411,
0.12900012731552124,
-0.1625973880290985,
-0.20943982899188995,
0.17057748138904572,
-0.007537604309618473,
0.010762408375740051,
0.2434365153312683,
-0.3328564465045929,
0.0917215645313263,
-0.1815854012966156,
0.3073962330818176,
-0.16223114728927612,
-0.3165167272090912,
0.3029285967350006,
-0.33091792464256287,
-0.010373340919613838,
-0.14337734878063202,
0.03301699459552765,
0.28937041759490967,
-0.2536713182926178,
0.07391809672117233,
0.05181926488876343,
-0.007079482078552246,
0.02447476238012314,
0.07720871269702911,
-0.08442062139511108,
-0.4591847062110901,
0.15833550691604614,
-0.11122889071702957,
-0.5394002199172974,
0.5139199495315552,
0.22273549437522888,
0.11619904637336731,
0.18975558876991272,
0.057068243622779846,
0.17242124676704407,
0.03346759080886841,
0.08020956814289093,
0.0466294102370739,
-0.4671401381492615,
0.5686720013618469,
-0.1287609040737152,
-0.2795649766921997,
0.03553175926208496,
0.3863106966018677,
-0.05937628448009491,
0.0766613781452179,
-0.14979922771453857,
-0.22671546041965485,
-0.2020462304353714,
0.3525918424129486,
0.15288123488426208,
-0.08915248513221741,
0.13901619613170624,
-0.041504744440317154,
-0.06024887040257454,
-0.03085421770811081,
-0.09035535156726837,
0.03607593849301338,
0.39337942004203796,
0.04944233223795891,
-0.04131149873137474,
0.03472091257572174,
0.06654754281044006,
0.4278459846973419,
0.5511066317558289,
-0.1720370203256607,
0.27367672324180603,
0.2584153115749359,
0.38472113013267517,
-0.24937966465950012,
0.21029207110404968,
0.13834962248802185,
0.037242040038108826,
0.013928405940532684,
0.6480589509010315,
0.4254901111125946,
-0.017755981534719467,
0.01685396581888199,
-0.2199254184961319,
-0.004073284566402435,
-0.3142620325088501,
0.25754615664482117,
0.0833449512720108,
0.10799601674079895,
-0.27320289611816406,
-0.3798125982284546,
-0.15550778806209564,
-0.3398423492908478,
0.0635845959186554,
0.6910926699638367,
0.32697221636772156,
0.17331847548484802,
0.0539541095495224,
-0.006108444184064865,
-0.550189733505249,
0.10805247724056244,
0.02253667265176773,
0.11264444887638092,
-0.35031062364578247,
-0.07703308016061783,
-0.1565171480178833,
0.03135670721530914,
0.17551960051059723,
-0.3323366940021515,
-0.3367905914783478,
-0.22289235889911652,
0.26612937450408936,
0.05624312907457352,
-0.07441484928131104,
-0.15720491111278534,
0.25149568915367126,
0.09348291158676147,
0.7858843803405762,
-0.33991387486457825,
-0.3364814221858978,
-0.282083123922348,
0.24729986488819122,
0.20216219127178192,
-0.042392320930957794,
-0.12185613811016083,
-0.12929624319076538,
-0.6387497186660767,
-0.09184843301773071,
0.32194268703460693,
-0.04690210521221161,
-0.5276778340339661,
-0.24147799611091614,
0.359658420085907,
0.06776043772697449,
0.21594469249248505,
0.12695711851119995,
0.12401869893074036,
0.18689745664596558,
-0.19533365964889526,
-0.013345474377274513,
0.2639915347099304,
0.48931676149368286,
0.4885914921760559,
0.1114002913236618,
-0.03856055811047554,
0.1981179416179657,
-0.543655276298523,
-0.10791534930467606,
0.35812127590179443,
-0.040037788450717926,
0.10478626191616058,
-0.09751416742801666,
0.31311801075935364,
-0.6033146381378174,
0.030572813004255295,
0.2650006413459778,
-0.31687891483306885,
-0.31074681878089905,
0.27899259328842163,
0.26775702834129333,
0.16720165312290192,
0.0668531209230423,
0.5151952505111694,
0.37628504633903503,
-0.15229511260986328,
-0.14664433896541595,
0.19548627734184265,
1.1902008056640625,
-0.14030319452285767,
0.17882144451141357,
-0.18080008029937744,
-0.3276667594909668,
0.3154793977737427,
-0.5315172076225281,
-0.016829000785946846,
0.14106549322605133,
-0.25495272874832153,
-0.08492815494537354,
0.01159784197807312,
0.23284518718719482,
0.022436408326029778,
-0.529443085193634,
-0.13102513551712036,
0.012463018298149109,
0.007584413513541222,
-0.27313515543937683,
0.5957844257354736,
-0.5060797929763794,
-0.49450013041496277,
-0.0063349176198244095,
0.11334696412086487,
-0.2151743769645691,
0.14463645219802856,
0.06645014137029648,
-0.371550589799881,
-0.20404957234859467,
-0.11945152282714844,
-0.38090839982032776,
-0.06879594922065735,
-0.02358182519674301,
-0.1675015091896057,
-0.2084672749042511,
-0.097445547580719,
0.12994244694709778,
-0.2770572602748871,
0.4025484323501587,
0.012762797996401787,
-0.39972826838493347,
-0.1956392228603363,
-0.40312904119491577,
0.23065273463726044,
-0.27123188972473145,
-0.21550652384757996,
0.17690111696720123,
-0.00971173495054245,
0.10823163390159607,
-0.21597693860530853,
0.0397186353802681,
-0.1319664567708969,
0.040510281920433044,
-0.2272118628025055,
-0.2123679220676422,
-0.17754071950912476,
-0.05393635109066963,
0.02155906707048416,
-0.34280580282211304,
0.2252439558506012,
0.07043206691741943,
0.03966083377599716,
0.25070324540138245,
-0.11837384104728699,
0.16757696866989136,
-0.1640423834323883,
-0.1301262527704239,
0.019679153338074684,
-0.042783938348293304,
0.0184294655919075,
0.04302395135164261,
-0.03482156991958618,
-0.3247857093811035,
-0.030104700475931168,
0.05032535642385483,
-0.000920567661523819,
-0.5139436721801758,
0.04182972386479378,
0.013172876089811325,
-0.194162979722023,
-0.3727608323097229,
0.07562308758497238,
0.23878373205661774,
-0.0460343100130558,
0.09745417535305023,
0.06196966767311096,
-0.3332272469997406,
0.2426099330186844,
-0.1889427900314331,
0.2840254604816437,
-0.18162351846694946,
-0.21682196855545044,
0.24494773149490356,
0.13569293916225433,
-0.2394212782382965,
0.12134033441543579,
-0.030656207352876663,
0.14601950347423553,
0.1064428985118866,
0.10034133493900299,
0.1863892525434494,
-0.22946497797966003,
-0.1998262256383896,
0.01056569442152977,
-0.28486260771751404,
-0.09764823317527771,
-0.1693846732378006,
0.16904237866401672,
0.2350497543811798,
-0.24025821685791016,
0.026077765971422195,
-0.2463875710964203,
-0.1208115667104721,
-0.29457247257232666,
0.2620539665222168,
-0.3751201331615448,
-0.025267072021961212,
0.11524468660354614,
0.18722940981388092,
0.011512174271047115,
0.2175484150648117,
0.004402711987495422,
0.2004047930240631,
0.6651462316513062,
0.029134739190340042,
0.0760713741183281,
-0.17167367041110992,
0.06236244738101959,
-0.519984245300293,
0.2851879596710205,
0.3684740662574768,
0.2825971841812134,
0.08091962337493896,
0.14485041797161102,
-0.03499876335263252,
0.09251097589731216,
0.17808668315410614,
0.00615339819341898,
-0.2795749008655548,
-0.027183897793293,
0.06729274988174438,
0.12194675952196121,
0.08482134342193604,
-0.0781998336315155,
0.24701307713985443,
-0.11852630227804184,
-0.016758419573307037,
0.17446234822273254,
0.5504720211029053,
0.3168409466743469,
0.15180540084838867,
-0.04741203039884567,
0.41262972354888916,
0.07650411874055862,
0.28425219655036926,
0.18585717678070068,
0.03471203148365021,
0.1627511829137802,
0.07343877851963043,
0.11252479255199432,
0.19437149167060852,
-0.3590013384819031,
-0.034060779958963394,
0.1884516328573227,
0.31443339586257935,
-0.03864239156246185,
0.3166303336620331,
-0.08535188436508179,
0.1428230255842209,
0.30495479702949524,
0.3606794476509094,
0.20586279034614563,
0.3944343328475952,
0.2227717489004135,
-0.19216924905776978,
-0.32555022835731506,
-0.19517214596271515,
0.10979095846414566,
-0.031849611550569534,
0.010227587074041367,
0.056608594954013824,
-0.11890634894371033,
-0.5536759495735168,
-0.05240504816174507,
-0.2379884123802185,
0.2725767195224762,
-0.07122817635536194,
0.3323133885860443,
0.08901292830705643,
-0.1519603580236435,
0.25602561235427856,
0.07611209899187088,
0.487637996673584,
-0.13153256475925446,
0.4691876471042633,
0.26687705516815186,
-0.19276957213878632,
0.1530947983264923,
0.42880648374557495,
0.35494160652160645,
0.10316051542758942,
0.2464224100112915,
0.05784611031413078,
0.07411376386880875,
0.0016427859663963318,
-0.005655985325574875,
0.290227472782135,
0.13247932493686676,
-0.11700720340013504,
0.1735638678073883,
0.12462858110666275,
-0.08847488462924957,
0.0009445631876587868,
-0.3266810476779938,
-0.3697604238986969,
-0.12340372055768967,
0.08845138549804688,
0.13798463344573975,
-0.0781889408826828,
0.041516587138175964,
-0.2115079164505005,
-0.15496116876602173,
0.19754788279533386,
0.43625932931900024,
-0.0737881064414978,
-0.05344869941473007,
-0.2681830823421478,
0.03760194778442383,
0.16418996453285217,
0.2655350863933563,
0.4735323488712311,
-0.25432491302490234,
-0.022151675075292587,
-0.23043712973594666,
-0.17607629299163818,
0.22736026346683502,
-0.22590257227420807,
0.002628147602081299,
0.11437778174877167,
0.11680399626493454,
-0.0056983307003974915,
0.2646179497241974,
0.0810643658041954,
-0.29789599776268005,
-0.053455278277397156,
-0.40864279866218567,
-0.1055721789598465,
-0.049556437879800797,
0.14868861436843872,
0.04451204836368561,
-0.07561399042606354,
-0.08903373777866364,
0.43392708897590637,
0.10585065186023712,
-0.08957310765981674,
-0.26960262656211853,
0.21375463902950287,
-0.038259562104940414,
0.01924290508031845,
0.40315043926239014,
0.3312154710292816,
0.0504847951233387,
-0.31470227241516113,
-0.23259973526000977,
-0.05684584751725197,
0.0002466067671775818,
-0.30585718154907227,
-0.18137197196483612,
-0.0835966169834137,
0.23377570509910583,
-0.30100348591804504,
-0.4285544455051422,
-0.3772442042827606,
0.062093254178762436,
-0.26283249258995056,
0.09872443974018097,
-0.11848434805870056,
-0.14824849367141724,
-0.07786153256893158,
-0.28620660305023193,
0.2644823491573334,
0.18677528202533722,
0.08774731308221817,
-0.03722556680440903,
-0.14850345253944397,
-0.1766975224018097,
0.36415642499923706,
-0.0762208104133606,
-0.12154293805360794,
0.2367122769355774,
0.019459087401628494,
0.436880886554718,
0.0858430415391922,
-0.39324483275413513,
0.07443709671497345,
0.1903643012046814,
0.10694965720176697,
-0.22847862541675568,
0.39923638105392456,
0.049706362187862396,
-0.22265881299972534,
-0.24602533876895905,
-0.04289193078875542,
0.10975528508424759,
-0.40897563099861145,
-0.07793065905570984,
-0.15786874294281006
] |
https://github.com/huggingface/datasets/issues/5685 | Hi!
You can fix the viewer by adding the `dataset_info` YAML field deleted in https://huggingface.co/datasets/Francesco/cell-towers/commit/b95b59ddd91ebe9c12920f0efe0ed415cd0d4298 back to the metadata section of the card.
To avoid this issue in the feature, you can use `huggingface_hub`'s [RepoCard](https://huggingface.co/docs/huggingface_hub/package_reference/cards) API to update the dataset card instead of `upload_file`:
```python
from huggingface_hub import DatasetCard
# Load card
card = DatasetCard.load("<namespace>/<repo_id>")
# Modify card content
card.content = ...
# Push card to the Hub
card.push_to_hub("<namespace>/<repo_id>")
```
However, the best solution would be to use the features info stored in the header of the Parquet shards generated with `push_to_hub` on the viewer side to avoid unexpected issues such as this one. This shouldn't be too hard to address. | Broken Image render on the hub website | ### Describe the bug
Hi :wave:
Not sure if this is the right place to ask, but I am trying to load a huge amount of datasets on the hub (:partying_face: ) but I am facing a little issue with the `image` type
![image](https://user-images.githubusercontent.com/15908060/228587875-427a37f1-3a31-4e17-8bbe-0f759003910d.png)
See this [dataset](https://huggingface.co/datasets/Francesco/cell-towers), basically for some reason the first image has numerical bytes inside, not sure if that is okay, but the image render feature **doesn't work**
So the dataset is stored in the following way
```python
builder.download_and_prepare(output_dir=str(output_dir))
ds = builder.as_dataset(split="train")
# [NOTE] no idea how to push it from the builder folder
ds.push_to_hub(repo_id=repo_id)
builder.as_dataset(split="validation").push_to_hub(repo_id=repo_id)
ds = builder.as_dataset(split="test")
ds.push_to_hub(repo_id=repo_id)
```
The build is this class
```python
class COCOLikeDatasetBuilder(datasets.GeneratorBasedBuilder):
VERSION = datasets.Version("1.0.0")
def _info(self):
features = datasets.Features(
{
"image_id": datasets.Value("int64"),
"image": datasets.Image(),
"width": datasets.Value("int32"),
"height": datasets.Value("int32"),
"objects": datasets.Sequence(
{
"id": datasets.Value("int64"),
"area": datasets.Value("int64"),
"bbox": datasets.Sequence(
datasets.Value("float32"), length=4
),
"category": datasets.ClassLabel(names=categories),
}
),
}
)
return datasets.DatasetInfo(
description=description,
features=features,
homepage=homepage,
license=license,
citation=citation,
)
def _split_generators(self, dl_manager):
archive = dl_manager.download(url)
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={
"annotation_file_path": "train/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
datasets.SplitGenerator(
name=datasets.Split.VALIDATION,
gen_kwargs={
"annotation_file_path": "test/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
datasets.SplitGenerator(
name=datasets.Split.TEST,
gen_kwargs={
"annotation_file_path": "valid/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
]
def _generate_examples(self, annotation_file_path, files):
def process_annot(annot, category_id_to_category):
return {
"id": annot["id"],
"area": annot["area"],
"bbox": annot["bbox"],
"category": category_id_to_category[annot["category_id"]],
}
image_id_to_image = {}
idx = 0
# This loop relies on the ordering of the files in the archive:
# Annotation files come first, then the images.
for path, f in files:
file_name = os.path.basename(path)
if annotation_file_path in path:
annotations = json.load(f)
category_id_to_category = {
category["id"]: category["name"]
for category in annotations["categories"]
}
print(category_id_to_category)
image_id_to_annotations = collections.defaultdict(list)
for annot in annotations["annotations"]:
image_id_to_annotations[annot["image_id"]].append(annot)
image_id_to_image = {
annot["file_name"]: annot for annot in annotations["images"]
}
elif file_name in image_id_to_image:
image = image_id_to_image[file_name]
objects = [
process_annot(annot, category_id_to_category)
for annot in image_id_to_annotations[image["id"]]
]
print(file_name)
yield idx, {
"image_id": image["id"],
"image": {"path": path, "bytes": f.read()},
"width": image["width"],
"height": image["height"],
"objects": objects,
}
idx += 1
```
Basically, I want to add to the hub every dataset I come across on coco format
Thanks
Fra
### Steps to reproduce the bug
In this case, you can just navigate on the [dataset](https://huggingface.co/datasets/Francesco/cell-towers)
### Expected behavior
I was expecting the image rendering feature to work
### Environment info
Not a lot to share, I am using `datasets` from a fresh venv | 111 | Broken Image render on the hub website
### Describe the bug
Hi :wave:
Not sure if this is the right place to ask, but I am trying to load a huge amount of datasets on the hub (:partying_face: ) but I am facing a little issue with the `image` type
![image](https://user-images.githubusercontent.com/15908060/228587875-427a37f1-3a31-4e17-8bbe-0f759003910d.png)
See this [dataset](https://huggingface.co/datasets/Francesco/cell-towers), basically for some reason the first image has numerical bytes inside, not sure if that is okay, but the image render feature **doesn't work**
So the dataset is stored in the following way
```python
builder.download_and_prepare(output_dir=str(output_dir))
ds = builder.as_dataset(split="train")
# [NOTE] no idea how to push it from the builder folder
ds.push_to_hub(repo_id=repo_id)
builder.as_dataset(split="validation").push_to_hub(repo_id=repo_id)
ds = builder.as_dataset(split="test")
ds.push_to_hub(repo_id=repo_id)
```
The build is this class
```python
class COCOLikeDatasetBuilder(datasets.GeneratorBasedBuilder):
VERSION = datasets.Version("1.0.0")
def _info(self):
features = datasets.Features(
{
"image_id": datasets.Value("int64"),
"image": datasets.Image(),
"width": datasets.Value("int32"),
"height": datasets.Value("int32"),
"objects": datasets.Sequence(
{
"id": datasets.Value("int64"),
"area": datasets.Value("int64"),
"bbox": datasets.Sequence(
datasets.Value("float32"), length=4
),
"category": datasets.ClassLabel(names=categories),
}
),
}
)
return datasets.DatasetInfo(
description=description,
features=features,
homepage=homepage,
license=license,
citation=citation,
)
def _split_generators(self, dl_manager):
archive = dl_manager.download(url)
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={
"annotation_file_path": "train/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
datasets.SplitGenerator(
name=datasets.Split.VALIDATION,
gen_kwargs={
"annotation_file_path": "test/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
datasets.SplitGenerator(
name=datasets.Split.TEST,
gen_kwargs={
"annotation_file_path": "valid/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
]
def _generate_examples(self, annotation_file_path, files):
def process_annot(annot, category_id_to_category):
return {
"id": annot["id"],
"area": annot["area"],
"bbox": annot["bbox"],
"category": category_id_to_category[annot["category_id"]],
}
image_id_to_image = {}
idx = 0
# This loop relies on the ordering of the files in the archive:
# Annotation files come first, then the images.
for path, f in files:
file_name = os.path.basename(path)
if annotation_file_path in path:
annotations = json.load(f)
category_id_to_category = {
category["id"]: category["name"]
for category in annotations["categories"]
}
print(category_id_to_category)
image_id_to_annotations = collections.defaultdict(list)
for annot in annotations["annotations"]:
image_id_to_annotations[annot["image_id"]].append(annot)
image_id_to_image = {
annot["file_name"]: annot for annot in annotations["images"]
}
elif file_name in image_id_to_image:
image = image_id_to_image[file_name]
objects = [
process_annot(annot, category_id_to_category)
for annot in image_id_to_annotations[image["id"]]
]
print(file_name)
yield idx, {
"image_id": image["id"],
"image": {"path": path, "bytes": f.read()},
"width": image["width"],
"height": image["height"],
"objects": objects,
}
idx += 1
```
Basically, I want to add to the hub every dataset I come across on coco format
Thanks
Fra
### Steps to reproduce the bug
In this case, you can just navigate on the [dataset](https://huggingface.co/datasets/Francesco/cell-towers)
### Expected behavior
I was expecting the image rendering feature to work
### Environment info
Not a lot to share, I am using `datasets` from a fresh venv
Hi!
You can fix the viewer by adding the `dataset_info` YAML field deleted in https://huggingface.co/datasets/Francesco/cell-towers/commit/b95b59ddd91ebe9c12920f0efe0ed415cd0d4298 back to the metadata section of the card.
To avoid this issue in the feature, you can use `huggingface_hub`'s [RepoCard](https://huggingface.co/docs/huggingface_hub/package_reference/cards) API to update the dataset card instead of `upload_file`:
```python
from huggingface_hub import DatasetCard
# Load card
card = DatasetCard.load("<namespace>/<repo_id>")
# Modify card content
card.content = ...
# Push card to the Hub
card.push_to_hub("<namespace>/<repo_id>")
```
However, the best solution would be to use the features info stored in the header of the Parquet shards generated with `push_to_hub` on the viewer side to avoid unexpected issues such as this one. This shouldn't be too hard to address. | [
-0.43464988470077515,
-0.4146606922149658,
-0.09680424630641937,
0.5902366638183594,
0.461051881313324,
-0.005445204675197601,
0.29988235235214233,
0.4036051332950592,
0.023893944919109344,
0.15203532576560974,
0.01003292202949524,
0.05818457528948784,
-0.102505162358284,
0.06415857374668121,
0.19887004792690277,
0.06047848239541054,
-0.0016686879098415375,
0.24360716342926025,
0.25261539220809937,
-0.1751006543636322,
-0.18012136220932007,
0.01876281388103962,
0.03229899704456329,
0.04903607815504074,
-0.7926419377326965,
0.08271671831607819,
0.09131783246994019,
0.22453024983406067,
-0.017043326050043106,
-0.1634998321533203,
0.12126474827528,
-0.09951843321323395,
0.09250761568546295,
0.4520472586154938,
-0.00012131304538343102,
0.018199041485786438,
0.7410540580749512,
0.023027390241622925,
-0.26376867294311523,
0.09491229802370071,
-0.5384019613265991,
-0.13567954301834106,
-0.13000082969665527,
-0.12777797877788544,
0.12861871719360352,
0.10175319015979767,
-0.02613675221800804,
0.2836776077747345,
0.5206714868545532,
0.17541852593421936,
0.14513331651687622,
0.12529239058494568,
-0.018267259001731873,
0.1044759601354599,
0.01909882389008999,
0.4297078251838684,
-0.03898722678422928,
0.11319167912006378,
0.12389937043190002,
0.05462267994880676,
0.1183229386806488,
0.1824711263179779,
-0.10348394513130188,
-0.04261571168899536,
0.0974816381931305,
-0.0006509646773338318,
0.03963807597756386,
-0.22535604238510132,
-0.11463923752307892,
0.09909974783658981,
0.0009186416864395142,
-0.027640286833047867,
-0.13412787020206451,
-0.13410577178001404,
-0.3411913812160492,
-0.17578712105751038,
0.22643348574638367,
0.2859198749065399,
-0.31556200981140137,
-0.14760877192020416,
-0.4905593991279602,
-0.3887096345424652,
-0.13441139459609985,
0.09386570751667023,
-0.40436112880706787,
0.21352720260620117,
-0.17455685138702393,
0.08045564591884613,
-0.2240094244480133,
0.25180137157440186,
0.3244004547595978,
-0.2923396825790405,
0.022357048466801643,
-0.01812044531106949,
0.0741719901561737,
0.04346194863319397,
-0.0565103255212307,
0.3167145848274231,
0.2106999158859253,
-0.3044176697731018,
0.08884304761886597,
0.25121328234672546,
-0.33965247869491577,
0.24813710153102875,
0.270078182220459,
0.19476599991321564,
-0.01946142315864563,
0.0992649495601654,
0.34076032042503357,
0.5917086601257324,
0.11012810468673706,
-0.04238668829202652,
-0.15305446088314056,
0.12280865013599396,
0.01953091472387314,
0.03701438382267952,
0.28826963901519775,
-0.08135539293289185,
-0.472909539937973,
0.1605103313922882,
0.4150103032588959,
0.25842127203941345,
0.20746725797653198,
0.12021157145500183,
-0.0253074299544096,
0.3049446642398834,
-0.03520692512392998,
-0.0052685486152768135,
-0.2890409231185913,
-0.307130366563797,
-0.27705827355384827,
-0.13041818141937256,
-0.15492460131645203,
0.1505763828754425,
-0.07346774637699127,
-0.257811963558197,
0.03916710615158081,
0.10408371686935425,
0.33297744393348694,
-0.15052422881126404,
-0.4002595543861389,
-0.21458090841770172,
0.03163599595427513,
0.21741995215415955,
-0.05204911530017853,
0.16080263257026672,
0.18591654300689697,
-0.24161802232265472,
0.01822294294834137,
0.20709946751594543,
-0.6655951738357544,
-0.32905644178390503,
-0.21465520560741425,
0.1009613424539566,
-0.33329659700393677,
0.2334369421005249,
-0.5168341398239136,
-0.0013890834525227547,
0.019621193408966064,
0.014407932758331299,
0.07192260026931763,
-0.024512790143489838,
-0.15000158548355103,
-0.03259586915373802,
0.18505185842514038,
0.2481600046157837,
-0.16446126997470856,
-0.08107249438762665,
-0.1545017659664154,
0.27092796564102173,
0.1717313826084137,
0.2242000699043274,
-0.13862811028957367,
0.19094640016555786,
-0.29105281829833984,
-0.03911706060171127,
0.03315333276987076,
-0.4678491950035095,
-0.4080645740032196,
0.29436200857162476,
0.2320917397737503,
0.12326931953430176,
-0.2759806513786316,
0.09619686007499695,
0.18042655289173126,
-0.1947098970413208,
0.2969835102558136,
0.4187457859516144,
-0.17020823061466217,
0.2107352912425995,
-0.21584101021289825,
-0.21272757649421692,
-0.11543011665344238,
0.18898525834083557,
0.17076462507247925,
0.06912538409233093,
-0.112833172082901,
0.21581953763961792,
0.07869075238704681,
0.04938904568552971,
0.2807537019252777,
-0.01800546422600746,
0.2705560326576233,
-0.2017202228307724,
-0.04718780145049095,
-0.28069084882736206,
-0.19799689948558807,
0.17045800387859344,
0.08205462247133255,
0.05808302015066147,
-0.3691732585430145,
0.10108818113803864,
-0.441506028175354,
0.037923961877822876,
-0.3401091694831848,
-0.0286637544631958,
0.026700183749198914,
-0.1586548388004303,
-0.2491435408592224,
0.0014628320932388306,
-0.04526479169726372,
0.4618415832519531,
-0.02832920104265213,
-0.006693385541439056,
-0.0769914835691452,
0.5660856366157532,
0.13152217864990234,
-0.3142451345920563,
-0.15698030591011047,
0.09273308515548706,
0.22129862010478973,
-0.10428270697593689,
-0.3188309371471405,
0.4110512137413025,
0.02088358998298645,
0.18543016910552979,
-0.07875595986843109,
-0.15743538737297058,
0.41180768609046936,
-0.48052847385406494,
0.19516782462596893,
-0.03619333356618881,
0.1270158886909485,
-0.08893570303916931,
-0.07346602529287338,
0.06719867885112762,
-0.24333181977272034,
0.25630098581314087,
-0.27331483364105225,
0.2678287625312805,
-0.04861956834793091,
0.22539879381656647,
0.003962233662605286,
-0.14413008093833923,
-0.1271958202123642,
0.2706387937068939,
0.039969682693481445,
-0.17954476177692413,
0.21733319759368896,
-0.14160406589508057,
0.18870681524276733,
0.10694136470556259,
0.23271113634109497,
0.0179374348372221,
-0.37876051664352417,
0.19618502259254456,
0.25377634167671204,
-0.13747352361679077,
0.06856691837310791,
-0.050935350358486176,
-0.38446369767189026,
0.011960307136178017,
-0.08588074147701263,
-0.05878308787941933,
0.18301786482334137,
0.3931646943092346,
0.18678316473960876,
0.16318407654762268,
0.1582961082458496,
-0.3044096827507019,
-0.5204719305038452,
-0.18590271472930908,
0.009976327419281006,
0.12149567157030106,
-0.21974849700927734,
0.08260142058134079,
-0.11843524128198624,
-0.012415260076522827,
0.014656491577625275,
-0.24525053799152374,
-0.41313570737838745,
-0.2164779007434845,
0.014188887551426888,
0.001537892036139965,
0.1620246320962906,
0.16617614030838013,
0.1536702811717987,
0.3063925504684448,
0.19545751810073853,
-0.011895274743437767,
-0.44324326515197754,
0.014018353074789047,
-0.0476132333278656,
-0.005837246775627136,
0.2628542482852936,
-0.08974813669919968,
0.1611902266740799,
-0.2750319242477417,
-0.009101592004299164,
-0.18682050704956055,
-0.031179502606391907,
0.29136139154434204,
-0.25561174750328064,
0.4302254021167755,
-0.05265264958143234,
0.30404403805732727,
0.020843006670475006,
0.24388058483600616,
0.6277626752853394,
-0.07115913182497025,
0.005345962941646576,
0.15961968898773193,
-0.047569844871759415,
-0.08709696680307388,
-0.08361352980136871,
0.429706335067749,
-0.0393800362944603,
-0.19165518879890442,
-0.07824411988258362,
0.3172021508216858,
0.24730946123600006,
0.2465883046388626,
0.3399321138858795,
-0.2850017845630646,
0.26975351572036743,
-0.2691049575805664,
-0.331986665725708,
-0.6107125282287598,
0.18541356921195984,
-0.0496005117893219,
-0.1846364587545395,
-0.23346105217933655,
0.20272105932235718,
0.34970349073410034,
0.25768911838531494,
-0.295722633600235,
-0.5453639626502991,
-0.29941216111183167,
0.0862567126750946,
-0.15097291767597198,
0.04071307182312012,
-0.14179538190364838,
0.015084631741046906,
-0.04854360967874527,
-0.07205568999052048,
0.16271501779556274,
-0.3344114124774933,
0.31333744525909424,
0.14848847687244415,
0.10240739583969116,
0.15864863991737366,
0.1439347267150879,
0.20136156678199768,
0.17914138734340668,
-0.13224823772907257,
0.47586992383003235,
-0.014192085713148117,
0.4012601375579834,
-0.07387693226337433,
-0.23866957426071167,
0.1689266562461853,
0.062006931751966476,
-0.1885952353477478,
-0.09819860011339188,
0.021848555654287338,
0.14452938735485077,
-0.09464417397975922,
0.006987027823925018,
-0.43392613530158997,
0.03588085621595383,
0.018668444827198982,
0.23814113438129425,
0.11651185154914856,
0.009725727140903473,
-0.1289636790752411,
-0.2864498794078827,
-0.35674992203712463,
0.28776681423187256,
0.1072024255990982,
0.12136327475309372,
-0.08807221800088882,
0.20953834056854248,
-0.23461641371250153,
-0.2621590197086334,
0.13819217681884766,
0.16377311944961548,
0.244806170463562,
0.03992665559053421,
0.4203285574913025,
0.030283622443675995,
-0.06263338029384613,
0.7615655064582825,
-0.3149665594100952,
0.24997909367084503,
0.04982847720384598,
-0.06954771280288696,
-0.5001453161239624,
-0.0540323369204998,
-0.14738136529922485,
0.49577292799949646,
-0.4543299973011017,
0.6851668953895569,
-0.10165635496377945,
-0.24059687554836273,
0.014492280781269073,
-0.0223712008446455,
-0.4764256477355957,
-0.08113294094800949,
-0.20605719089508057,
-0.07191282510757446,
-0.1419087052345276,
-0.1921231597661972,
0.2871984541416168,
0.2455907016992569,
0.045692503452301025,
-0.3610045909881592,
-0.12553533911705017,
-0.039983734488487244,
0.00804721936583519,
0.03291752189397812,
0.3146388530731201,
-0.16547271609306335,
-0.0718703344464302,
0.1963864415884018,
-0.055573221296072006,
-0.02373097464442253,
0.5032331943511963,
0.3533177375793457,
-0.1846378743648529,
0.04186192527413368,
0.18203634023666382,
-0.18899178504943848,
0.4387931525707245,
-0.0547126904129982,
-0.44172403216362,
-0.07199244201183319,
0.265259712934494,
-0.6485344171524048,
0.3060751259326935,
0.42651328444480896,
0.06532837450504303,
-0.3564511239528656,
-0.18574625253677368,
0.6746714115142822,
0.07386092841625214,
-0.0498662143945694,
0.08027367293834686,
0.3790872097015381,
-0.31064218282699585,
0.07442691922187805,
0.3949035406112671,
0.7777290940284729,
-0.14633432030677795,
0.23599256575107574,
0.001463884487748146,
0.34909456968307495,
0.3182125687599182,
-0.31954121589660645,
-0.01547288615256548,
-0.15163734555244446,
-0.2277393341064453,
-0.17720383405685425,
-0.03163003921508789,
-0.022606831043958664,
-0.027585916221141815,
-0.018256112933158875,
0.2610856890678406,
-0.29821112751960754,
0.5039779543876648,
0.038222894072532654,
-0.04312528297305107,
-0.4613930881023407,
-0.25208231806755066,
-0.16621235013008118,
0.17930439114570618,
-0.2821192741394043,
0.028042934834957123,
-0.17845582962036133,
0.10665228962898254,
-0.1766299307346344,
0.04143288731575012,
-0.32027846574783325,
0.17496858537197113,
0.01459115743637085,
0.2548113465309143,
0.026648204773664474,
-0.1917780339717865,
-0.17471575736999512,
-0.0075846947729587555,
0.26970145106315613,
-0.06759272515773773,
-0.32796528935432434,
0.4738367795944214,
-0.4439159035682678,
0.10805992782115936,
-0.09107705950737,
0.08860220015048981,
0.22883646190166473,
-0.02434493973851204,
-0.17847341299057007,
0.07405924797058105,
0.26379090547561646,
0.02801571786403656,
-0.1344112753868103,
-0.020200565457344055,
0.3587428629398346,
-0.24343876540660858,
-0.10213519632816315,
-0.2752256989479065,
0.04260803759098053,
-0.26760995388031006,
0.06650657951831818,
0.04916221648454666,
-0.030417077243328094,
0.2507699429988861,
0.39285728335380554,
0.018789634108543396,
0.2199484407901764,
0.1657041758298874,
0.010675374418497086,
-0.05774824321269989,
0.015203909948468208,
-0.06807121634483337,
-0.15948700904846191,
-0.16638225317001343,
0.12822484970092773,
0.057530030608177185,
-0.5684505701065063,
0.40296077728271484,
-0.5216122269630432,
-0.19716928899288177,
-0.3390490412712097,
0.19938229024410248,
0.12262991815805435,
-0.09114682674407959,
-0.19585810601711273,
-0.35607820749282837,
-0.12978681921958923,
0.1310950517654419,
0.043501511216163635,
0.3622259497642517,
-0.3571290969848633,
0.12381471693515778,
0.028605356812477112,
-0.01954146847128868,
-0.22342494130134583,
0.2830198407173157,
-0.15480650961399078,
0.28198719024658203,
-0.598262369632721,
0.09454018622636795,
0.19263604283332825,
-0.3041406571865082,
0.017042700201272964,
0.3900909125804901,
-0.08159103244543076,
-0.15325069427490234,
-0.2717362940311432,
0.2186591774225235,
0.402494877576828,
-0.1913663148880005,
0.004879400134086609,
0.07000267505645752,
0.06755559891462326,
-0.1942966729402542,
0.3269307017326355,
-0.046601541340351105,
0.05769631266593933,
0.06671787798404694,
0.6451704502105713,
0.04916851967573166,
0.08061268925666809,
0.2708691656589508,
0.025650689378380775,
0.8383421301841736,
0.0658041313290596,
0.02638254687190056,
0.29230737686157227,
-0.051569633185863495,
-0.06696881353855133,
0.34793564677238464,
0.04045289754867554,
0.10098821669816971,
0.49698469042778015,
-0.4268432557582855,
0.26979658007621765,
0.075924351811409,
0.3614614009857178,
0.19182845950126648,
-0.35687634348869324,
-0.2675815224647522,
-0.014649767428636551,
0.16823618113994598,
0.08118259906768799,
-0.16822804510593414,
0.11804069578647614,
0.021299857646226883,
-0.02692456543445587,
0.11005386710166931,
0.12146338820457458,
-0.03905627131462097,
-0.44504514336586,
0.07183657586574554,
0.7801958322525024,
-0.23755568265914917,
-0.09356182813644409,
0.09263981878757477,
0.0036962032318115234,
0.1981736421585083,
0.08290345966815948,
-0.012492017820477486,
-0.030571050941944122,
0.8368493914604187,
-0.153399258852005,
-0.048260316252708435,
0.3117005228996277,
0.1458774209022522,
0.2572636604309082,
-0.012978322803974152,
-0.10800319910049438,
0.1136312186717987,
0.09602895379066467,
0.18656203150749207,
-0.12544697523117065,
0.20533810555934906,
-0.24483472108840942,
0.044917088001966476,
-0.27903854846954346,
-0.03702235966920853,
0.07871001958847046,
0.15768058598041534,
-0.4358789324760437,
-0.12085824459791183,
-0.395002543926239,
0.21057768166065216,
-0.1381160169839859,
-0.25218528509140015,
0.18098238110542297,
0.2325262725353241,
-0.22067514061927795,
-0.039511773735284805,
-0.1379896104335785,
0.42558979988098145,
0.2794288694858551,
-0.2587926983833313,
0.21365676820278168,
0.3289725184440613,
0.02640301175415516,
0.09947003424167633,
0.5760074853897095,
0.44734081625938416,
0.3122636675834656,
-0.20667165517807007,
0.15033335983753204,
0.13603278994560242,
-0.09937961399555206,
-0.12749914824962616,
-0.04987329989671707,
-0.041512228548526764,
0.30675366520881653,
-0.16615533828735352,
0.18677189946174622,
-0.11775213479995728,
-0.34452104568481445,
0.026377251371741295,
0.014423303306102753,
0.1559247076511383,
0.3423563539981842,
-0.31741073727607727,
-0.07479295134544373,
-0.16284289956092834,
-0.14321237802505493,
-0.39857929944992065,
-0.13547837734222412,
0.2808343768119812,
-0.29233458638191223,
0.18844114243984222,
0.2548920512199402,
0.00012942776083946228,
-0.3933641314506531,
0.34257373213768005,
0.14995795488357544,
-0.07111398875713348,
-0.1748443990945816,
-0.28544849157333374,
-0.256231427192688,
0.34064796566963196,
0.02392171509563923,
-0.36032265424728394,
0.36236488819122314,
0.1984746754169464,
-0.2731969952583313,
0.019388439133763313,
0.12708313763141632,
0.27985259890556335,
0.09190645813941956,
-0.08056492358446121,
-0.37484583258628845,
-0.0463402159512043,
0.01473375502973795,
0.11080503463745117,
-0.11378015577793121,
-0.31074023246765137,
0.3925950527191162,
0.09115934371948242,
0.002632454037666321,
0.023173384368419647,
-0.03344797343015671,
-0.2133496105670929,
-0.32846301794052124,
0.5371675491333008,
0.18277303874492645,
0.15606239438056946,
-0.19932302832603455,
-0.06663333624601364,
-0.29549193382263184,
-0.33207449316978455,
-0.13257883489131927,
0.13135705888271332,
-0.11031461507081985,
0.35074669122695923,
0.03408361226320267,
0.05529855564236641,
-0.4265606999397278,
0.36411166191101074,
0.10497509688138962,
0.07553328573703766,
-0.35155507922172546,
-0.004314728081226349,
-0.4533764123916626,
-0.06934143602848053,
0.06718092411756516,
0.22604940831661224,
-0.02871352806687355,
0.05161371827125549,
-0.16108347475528717,
-0.510549783706665,
0.5495284795761108,
-0.07950562983751297,
-0.6349563002586365,
0.14551101624965668,
0.19123533368110657,
0.1291353404521942,
-0.02178122289478779,
-0.18336153030395508,
0.028146415948867798,
0.2184596061706543,
-0.022771717980504036,
-0.38184574246406555,
0.2806094288825989,
0.16705574095249176,
-0.07202497124671936,
0.052007123827934265,
-0.008560888469219208,
0.09017352759838104,
-0.17712560296058655,
0.19106614589691162,
-0.09750326722860336
] |
https://github.com/huggingface/datasets/issues/5685 | Thanks for reporting @FrancescoSaverioZuppichini.
For future issues with your specific dataset, you can use its "Community" tab to start a conversation: https://huggingface.co/datasets/Francesco/cell-towers/discussions/new | Broken Image render on the hub website | ### Describe the bug
Hi :wave:
Not sure if this is the right place to ask, but I am trying to load a huge amount of datasets on the hub (:partying_face: ) but I am facing a little issue with the `image` type
![image](https://user-images.githubusercontent.com/15908060/228587875-427a37f1-3a31-4e17-8bbe-0f759003910d.png)
See this [dataset](https://huggingface.co/datasets/Francesco/cell-towers), basically for some reason the first image has numerical bytes inside, not sure if that is okay, but the image render feature **doesn't work**
So the dataset is stored in the following way
```python
builder.download_and_prepare(output_dir=str(output_dir))
ds = builder.as_dataset(split="train")
# [NOTE] no idea how to push it from the builder folder
ds.push_to_hub(repo_id=repo_id)
builder.as_dataset(split="validation").push_to_hub(repo_id=repo_id)
ds = builder.as_dataset(split="test")
ds.push_to_hub(repo_id=repo_id)
```
The build is this class
```python
class COCOLikeDatasetBuilder(datasets.GeneratorBasedBuilder):
VERSION = datasets.Version("1.0.0")
def _info(self):
features = datasets.Features(
{
"image_id": datasets.Value("int64"),
"image": datasets.Image(),
"width": datasets.Value("int32"),
"height": datasets.Value("int32"),
"objects": datasets.Sequence(
{
"id": datasets.Value("int64"),
"area": datasets.Value("int64"),
"bbox": datasets.Sequence(
datasets.Value("float32"), length=4
),
"category": datasets.ClassLabel(names=categories),
}
),
}
)
return datasets.DatasetInfo(
description=description,
features=features,
homepage=homepage,
license=license,
citation=citation,
)
def _split_generators(self, dl_manager):
archive = dl_manager.download(url)
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={
"annotation_file_path": "train/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
datasets.SplitGenerator(
name=datasets.Split.VALIDATION,
gen_kwargs={
"annotation_file_path": "test/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
datasets.SplitGenerator(
name=datasets.Split.TEST,
gen_kwargs={
"annotation_file_path": "valid/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
]
def _generate_examples(self, annotation_file_path, files):
def process_annot(annot, category_id_to_category):
return {
"id": annot["id"],
"area": annot["area"],
"bbox": annot["bbox"],
"category": category_id_to_category[annot["category_id"]],
}
image_id_to_image = {}
idx = 0
# This loop relies on the ordering of the files in the archive:
# Annotation files come first, then the images.
for path, f in files:
file_name = os.path.basename(path)
if annotation_file_path in path:
annotations = json.load(f)
category_id_to_category = {
category["id"]: category["name"]
for category in annotations["categories"]
}
print(category_id_to_category)
image_id_to_annotations = collections.defaultdict(list)
for annot in annotations["annotations"]:
image_id_to_annotations[annot["image_id"]].append(annot)
image_id_to_image = {
annot["file_name"]: annot for annot in annotations["images"]
}
elif file_name in image_id_to_image:
image = image_id_to_image[file_name]
objects = [
process_annot(annot, category_id_to_category)
for annot in image_id_to_annotations[image["id"]]
]
print(file_name)
yield idx, {
"image_id": image["id"],
"image": {"path": path, "bytes": f.read()},
"width": image["width"],
"height": image["height"],
"objects": objects,
}
idx += 1
```
Basically, I want to add to the hub every dataset I come across on coco format
Thanks
Fra
### Steps to reproduce the bug
In this case, you can just navigate on the [dataset](https://huggingface.co/datasets/Francesco/cell-towers)
### Expected behavior
I was expecting the image rendering feature to work
### Environment info
Not a lot to share, I am using `datasets` from a fresh venv | 22 | Broken Image render on the hub website
### Describe the bug
Hi :wave:
Not sure if this is the right place to ask, but I am trying to load a huge amount of datasets on the hub (:partying_face: ) but I am facing a little issue with the `image` type
![image](https://user-images.githubusercontent.com/15908060/228587875-427a37f1-3a31-4e17-8bbe-0f759003910d.png)
See this [dataset](https://huggingface.co/datasets/Francesco/cell-towers), basically for some reason the first image has numerical bytes inside, not sure if that is okay, but the image render feature **doesn't work**
So the dataset is stored in the following way
```python
builder.download_and_prepare(output_dir=str(output_dir))
ds = builder.as_dataset(split="train")
# [NOTE] no idea how to push it from the builder folder
ds.push_to_hub(repo_id=repo_id)
builder.as_dataset(split="validation").push_to_hub(repo_id=repo_id)
ds = builder.as_dataset(split="test")
ds.push_to_hub(repo_id=repo_id)
```
The build is this class
```python
class COCOLikeDatasetBuilder(datasets.GeneratorBasedBuilder):
VERSION = datasets.Version("1.0.0")
def _info(self):
features = datasets.Features(
{
"image_id": datasets.Value("int64"),
"image": datasets.Image(),
"width": datasets.Value("int32"),
"height": datasets.Value("int32"),
"objects": datasets.Sequence(
{
"id": datasets.Value("int64"),
"area": datasets.Value("int64"),
"bbox": datasets.Sequence(
datasets.Value("float32"), length=4
),
"category": datasets.ClassLabel(names=categories),
}
),
}
)
return datasets.DatasetInfo(
description=description,
features=features,
homepage=homepage,
license=license,
citation=citation,
)
def _split_generators(self, dl_manager):
archive = dl_manager.download(url)
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={
"annotation_file_path": "train/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
datasets.SplitGenerator(
name=datasets.Split.VALIDATION,
gen_kwargs={
"annotation_file_path": "test/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
datasets.SplitGenerator(
name=datasets.Split.TEST,
gen_kwargs={
"annotation_file_path": "valid/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
]
def _generate_examples(self, annotation_file_path, files):
def process_annot(annot, category_id_to_category):
return {
"id": annot["id"],
"area": annot["area"],
"bbox": annot["bbox"],
"category": category_id_to_category[annot["category_id"]],
}
image_id_to_image = {}
idx = 0
# This loop relies on the ordering of the files in the archive:
# Annotation files come first, then the images.
for path, f in files:
file_name = os.path.basename(path)
if annotation_file_path in path:
annotations = json.load(f)
category_id_to_category = {
category["id"]: category["name"]
for category in annotations["categories"]
}
print(category_id_to_category)
image_id_to_annotations = collections.defaultdict(list)
for annot in annotations["annotations"]:
image_id_to_annotations[annot["image_id"]].append(annot)
image_id_to_image = {
annot["file_name"]: annot for annot in annotations["images"]
}
elif file_name in image_id_to_image:
image = image_id_to_image[file_name]
objects = [
process_annot(annot, category_id_to_category)
for annot in image_id_to_annotations[image["id"]]
]
print(file_name)
yield idx, {
"image_id": image["id"],
"image": {"path": path, "bytes": f.read()},
"width": image["width"],
"height": image["height"],
"objects": objects,
}
idx += 1
```
Basically, I want to add to the hub every dataset I come across on coco format
Thanks
Fra
### Steps to reproduce the bug
In this case, you can just navigate on the [dataset](https://huggingface.co/datasets/Francesco/cell-towers)
### Expected behavior
I was expecting the image rendering feature to work
### Environment info
Not a lot to share, I am using `datasets` from a fresh venv
Thanks for reporting @FrancescoSaverioZuppichini.
For future issues with your specific dataset, you can use its "Community" tab to start a conversation: https://huggingface.co/datasets/Francesco/cell-towers/discussions/new | [
-0.43464988470077515,
-0.4146606922149658,
-0.09680424630641937,
0.5902366638183594,
0.461051881313324,
-0.005445204675197601,
0.29988235235214233,
0.4036051332950592,
0.023893944919109344,
0.15203532576560974,
0.01003292202949524,
0.05818457528948784,
-0.102505162358284,
0.06415857374668121,
0.19887004792690277,
0.06047848239541054,
-0.0016686879098415375,
0.24360716342926025,
0.25261539220809937,
-0.1751006543636322,
-0.18012136220932007,
0.01876281388103962,
0.03229899704456329,
0.04903607815504074,
-0.7926419377326965,
0.08271671831607819,
0.09131783246994019,
0.22453024983406067,
-0.017043326050043106,
-0.1634998321533203,
0.12126474827528,
-0.09951843321323395,
0.09250761568546295,
0.4520472586154938,
-0.00012131304538343102,
0.018199041485786438,
0.7410540580749512,
0.023027390241622925,
-0.26376867294311523,
0.09491229802370071,
-0.5384019613265991,
-0.13567954301834106,
-0.13000082969665527,
-0.12777797877788544,
0.12861871719360352,
0.10175319015979767,
-0.02613675221800804,
0.2836776077747345,
0.5206714868545532,
0.17541852593421936,
0.14513331651687622,
0.12529239058494568,
-0.018267259001731873,
0.1044759601354599,
0.01909882389008999,
0.4297078251838684,
-0.03898722678422928,
0.11319167912006378,
0.12389937043190002,
0.05462267994880676,
0.1183229386806488,
0.1824711263179779,
-0.10348394513130188,
-0.04261571168899536,
0.0974816381931305,
-0.0006509646773338318,
0.03963807597756386,
-0.22535604238510132,
-0.11463923752307892,
0.09909974783658981,
0.0009186416864395142,
-0.027640286833047867,
-0.13412787020206451,
-0.13410577178001404,
-0.3411913812160492,
-0.17578712105751038,
0.22643348574638367,
0.2859198749065399,
-0.31556200981140137,
-0.14760877192020416,
-0.4905593991279602,
-0.3887096345424652,
-0.13441139459609985,
0.09386570751667023,
-0.40436112880706787,
0.21352720260620117,
-0.17455685138702393,
0.08045564591884613,
-0.2240094244480133,
0.25180137157440186,
0.3244004547595978,
-0.2923396825790405,
0.022357048466801643,
-0.01812044531106949,
0.0741719901561737,
0.04346194863319397,
-0.0565103255212307,
0.3167145848274231,
0.2106999158859253,
-0.3044176697731018,
0.08884304761886597,
0.25121328234672546,
-0.33965247869491577,
0.24813710153102875,
0.270078182220459,
0.19476599991321564,
-0.01946142315864563,
0.0992649495601654,
0.34076032042503357,
0.5917086601257324,
0.11012810468673706,
-0.04238668829202652,
-0.15305446088314056,
0.12280865013599396,
0.01953091472387314,
0.03701438382267952,
0.28826963901519775,
-0.08135539293289185,
-0.472909539937973,
0.1605103313922882,
0.4150103032588959,
0.25842127203941345,
0.20746725797653198,
0.12021157145500183,
-0.0253074299544096,
0.3049446642398834,
-0.03520692512392998,
-0.0052685486152768135,
-0.2890409231185913,
-0.307130366563797,
-0.27705827355384827,
-0.13041818141937256,
-0.15492460131645203,
0.1505763828754425,
-0.07346774637699127,
-0.257811963558197,
0.03916710615158081,
0.10408371686935425,
0.33297744393348694,
-0.15052422881126404,
-0.4002595543861389,
-0.21458090841770172,
0.03163599595427513,
0.21741995215415955,
-0.05204911530017853,
0.16080263257026672,
0.18591654300689697,
-0.24161802232265472,
0.01822294294834137,
0.20709946751594543,
-0.6655951738357544,
-0.32905644178390503,
-0.21465520560741425,
0.1009613424539566,
-0.33329659700393677,
0.2334369421005249,
-0.5168341398239136,
-0.0013890834525227547,
0.019621193408966064,
0.014407932758331299,
0.07192260026931763,
-0.024512790143489838,
-0.15000158548355103,
-0.03259586915373802,
0.18505185842514038,
0.2481600046157837,
-0.16446126997470856,
-0.08107249438762665,
-0.1545017659664154,
0.27092796564102173,
0.1717313826084137,
0.2242000699043274,
-0.13862811028957367,
0.19094640016555786,
-0.29105281829833984,
-0.03911706060171127,
0.03315333276987076,
-0.4678491950035095,
-0.4080645740032196,
0.29436200857162476,
0.2320917397737503,
0.12326931953430176,
-0.2759806513786316,
0.09619686007499695,
0.18042655289173126,
-0.1947098970413208,
0.2969835102558136,
0.4187457859516144,
-0.17020823061466217,
0.2107352912425995,
-0.21584101021289825,
-0.21272757649421692,
-0.11543011665344238,
0.18898525834083557,
0.17076462507247925,
0.06912538409233093,
-0.112833172082901,
0.21581953763961792,
0.07869075238704681,
0.04938904568552971,
0.2807537019252777,
-0.01800546422600746,
0.2705560326576233,
-0.2017202228307724,
-0.04718780145049095,
-0.28069084882736206,
-0.19799689948558807,
0.17045800387859344,
0.08205462247133255,
0.05808302015066147,
-0.3691732585430145,
0.10108818113803864,
-0.441506028175354,
0.037923961877822876,
-0.3401091694831848,
-0.0286637544631958,
0.026700183749198914,
-0.1586548388004303,
-0.2491435408592224,
0.0014628320932388306,
-0.04526479169726372,
0.4618415832519531,
-0.02832920104265213,
-0.006693385541439056,
-0.0769914835691452,
0.5660856366157532,
0.13152217864990234,
-0.3142451345920563,
-0.15698030591011047,
0.09273308515548706,
0.22129862010478973,
-0.10428270697593689,
-0.3188309371471405,
0.4110512137413025,
0.02088358998298645,
0.18543016910552979,
-0.07875595986843109,
-0.15743538737297058,
0.41180768609046936,
-0.48052847385406494,
0.19516782462596893,
-0.03619333356618881,
0.1270158886909485,
-0.08893570303916931,
-0.07346602529287338,
0.06719867885112762,
-0.24333181977272034,
0.25630098581314087,
-0.27331483364105225,
0.2678287625312805,
-0.04861956834793091,
0.22539879381656647,
0.003962233662605286,
-0.14413008093833923,
-0.1271958202123642,
0.2706387937068939,
0.039969682693481445,
-0.17954476177692413,
0.21733319759368896,
-0.14160406589508057,
0.18870681524276733,
0.10694136470556259,
0.23271113634109497,
0.0179374348372221,
-0.37876051664352417,
0.19618502259254456,
0.25377634167671204,
-0.13747352361679077,
0.06856691837310791,
-0.050935350358486176,
-0.38446369767189026,
0.011960307136178017,
-0.08588074147701263,
-0.05878308787941933,
0.18301786482334137,
0.3931646943092346,
0.18678316473960876,
0.16318407654762268,
0.1582961082458496,
-0.3044096827507019,
-0.5204719305038452,
-0.18590271472930908,
0.009976327419281006,
0.12149567157030106,
-0.21974849700927734,
0.08260142058134079,
-0.11843524128198624,
-0.012415260076522827,
0.014656491577625275,
-0.24525053799152374,
-0.41313570737838745,
-0.2164779007434845,
0.014188887551426888,
0.001537892036139965,
0.1620246320962906,
0.16617614030838013,
0.1536702811717987,
0.3063925504684448,
0.19545751810073853,
-0.011895274743437767,
-0.44324326515197754,
0.014018353074789047,
-0.0476132333278656,
-0.005837246775627136,
0.2628542482852936,
-0.08974813669919968,
0.1611902266740799,
-0.2750319242477417,
-0.009101592004299164,
-0.18682050704956055,
-0.031179502606391907,
0.29136139154434204,
-0.25561174750328064,
0.4302254021167755,
-0.05265264958143234,
0.30404403805732727,
0.020843006670475006,
0.24388058483600616,
0.6277626752853394,
-0.07115913182497025,
0.005345962941646576,
0.15961968898773193,
-0.047569844871759415,
-0.08709696680307388,
-0.08361352980136871,
0.429706335067749,
-0.0393800362944603,
-0.19165518879890442,
-0.07824411988258362,
0.3172021508216858,
0.24730946123600006,
0.2465883046388626,
0.3399321138858795,
-0.2850017845630646,
0.26975351572036743,
-0.2691049575805664,
-0.331986665725708,
-0.6107125282287598,
0.18541356921195984,
-0.0496005117893219,
-0.1846364587545395,
-0.23346105217933655,
0.20272105932235718,
0.34970349073410034,
0.25768911838531494,
-0.295722633600235,
-0.5453639626502991,
-0.29941216111183167,
0.0862567126750946,
-0.15097291767597198,
0.04071307182312012,
-0.14179538190364838,
0.015084631741046906,
-0.04854360967874527,
-0.07205568999052048,
0.16271501779556274,
-0.3344114124774933,
0.31333744525909424,
0.14848847687244415,
0.10240739583969116,
0.15864863991737366,
0.1439347267150879,
0.20136156678199768,
0.17914138734340668,
-0.13224823772907257,
0.47586992383003235,
-0.014192085713148117,
0.4012601375579834,
-0.07387693226337433,
-0.23866957426071167,
0.1689266562461853,
0.062006931751966476,
-0.1885952353477478,
-0.09819860011339188,
0.021848555654287338,
0.14452938735485077,
-0.09464417397975922,
0.006987027823925018,
-0.43392613530158997,
0.03588085621595383,
0.018668444827198982,
0.23814113438129425,
0.11651185154914856,
0.009725727140903473,
-0.1289636790752411,
-0.2864498794078827,
-0.35674992203712463,
0.28776681423187256,
0.1072024255990982,
0.12136327475309372,
-0.08807221800088882,
0.20953834056854248,
-0.23461641371250153,
-0.2621590197086334,
0.13819217681884766,
0.16377311944961548,
0.244806170463562,
0.03992665559053421,
0.4203285574913025,
0.030283622443675995,
-0.06263338029384613,
0.7615655064582825,
-0.3149665594100952,
0.24997909367084503,
0.04982847720384598,
-0.06954771280288696,
-0.5001453161239624,
-0.0540323369204998,
-0.14738136529922485,
0.49577292799949646,
-0.4543299973011017,
0.6851668953895569,
-0.10165635496377945,
-0.24059687554836273,
0.014492280781269073,
-0.0223712008446455,
-0.4764256477355957,
-0.08113294094800949,
-0.20605719089508057,
-0.07191282510757446,
-0.1419087052345276,
-0.1921231597661972,
0.2871984541416168,
0.2455907016992569,
0.045692503452301025,
-0.3610045909881592,
-0.12553533911705017,
-0.039983734488487244,
0.00804721936583519,
0.03291752189397812,
0.3146388530731201,
-0.16547271609306335,
-0.0718703344464302,
0.1963864415884018,
-0.055573221296072006,
-0.02373097464442253,
0.5032331943511963,
0.3533177375793457,
-0.1846378743648529,
0.04186192527413368,
0.18203634023666382,
-0.18899178504943848,
0.4387931525707245,
-0.0547126904129982,
-0.44172403216362,
-0.07199244201183319,
0.265259712934494,
-0.6485344171524048,
0.3060751259326935,
0.42651328444480896,
0.06532837450504303,
-0.3564511239528656,
-0.18574625253677368,
0.6746714115142822,
0.07386092841625214,
-0.0498662143945694,
0.08027367293834686,
0.3790872097015381,
-0.31064218282699585,
0.07442691922187805,
0.3949035406112671,
0.7777290940284729,
-0.14633432030677795,
0.23599256575107574,
0.001463884487748146,
0.34909456968307495,
0.3182125687599182,
-0.31954121589660645,
-0.01547288615256548,
-0.15163734555244446,
-0.2277393341064453,
-0.17720383405685425,
-0.03163003921508789,
-0.022606831043958664,
-0.027585916221141815,
-0.018256112933158875,
0.2610856890678406,
-0.29821112751960754,
0.5039779543876648,
0.038222894072532654,
-0.04312528297305107,
-0.4613930881023407,
-0.25208231806755066,
-0.16621235013008118,
0.17930439114570618,
-0.2821192741394043,
0.028042934834957123,
-0.17845582962036133,
0.10665228962898254,
-0.1766299307346344,
0.04143288731575012,
-0.32027846574783325,
0.17496858537197113,
0.01459115743637085,
0.2548113465309143,
0.026648204773664474,
-0.1917780339717865,
-0.17471575736999512,
-0.0075846947729587555,
0.26970145106315613,
-0.06759272515773773,
-0.32796528935432434,
0.4738367795944214,
-0.4439159035682678,
0.10805992782115936,
-0.09107705950737,
0.08860220015048981,
0.22883646190166473,
-0.02434493973851204,
-0.17847341299057007,
0.07405924797058105,
0.26379090547561646,
0.02801571786403656,
-0.1344112753868103,
-0.020200565457344055,
0.3587428629398346,
-0.24343876540660858,
-0.10213519632816315,
-0.2752256989479065,
0.04260803759098053,
-0.26760995388031006,
0.06650657951831818,
0.04916221648454666,
-0.030417077243328094,
0.2507699429988861,
0.39285728335380554,
0.018789634108543396,
0.2199484407901764,
0.1657041758298874,
0.010675374418497086,
-0.05774824321269989,
0.015203909948468208,
-0.06807121634483337,
-0.15948700904846191,
-0.16638225317001343,
0.12822484970092773,
0.057530030608177185,
-0.5684505701065063,
0.40296077728271484,
-0.5216122269630432,
-0.19716928899288177,
-0.3390490412712097,
0.19938229024410248,
0.12262991815805435,
-0.09114682674407959,
-0.19585810601711273,
-0.35607820749282837,
-0.12978681921958923,
0.1310950517654419,
0.043501511216163635,
0.3622259497642517,
-0.3571290969848633,
0.12381471693515778,
0.028605356812477112,
-0.01954146847128868,
-0.22342494130134583,
0.2830198407173157,
-0.15480650961399078,
0.28198719024658203,
-0.598262369632721,
0.09454018622636795,
0.19263604283332825,
-0.3041406571865082,
0.017042700201272964,
0.3900909125804901,
-0.08159103244543076,
-0.15325069427490234,
-0.2717362940311432,
0.2186591774225235,
0.402494877576828,
-0.1913663148880005,
0.004879400134086609,
0.07000267505645752,
0.06755559891462326,
-0.1942966729402542,
0.3269307017326355,
-0.046601541340351105,
0.05769631266593933,
0.06671787798404694,
0.6451704502105713,
0.04916851967573166,
0.08061268925666809,
0.2708691656589508,
0.025650689378380775,
0.8383421301841736,
0.0658041313290596,
0.02638254687190056,
0.29230737686157227,
-0.051569633185863495,
-0.06696881353855133,
0.34793564677238464,
0.04045289754867554,
0.10098821669816971,
0.49698469042778015,
-0.4268432557582855,
0.26979658007621765,
0.075924351811409,
0.3614614009857178,
0.19182845950126648,
-0.35687634348869324,
-0.2675815224647522,
-0.014649767428636551,
0.16823618113994598,
0.08118259906768799,
-0.16822804510593414,
0.11804069578647614,
0.021299857646226883,
-0.02692456543445587,
0.11005386710166931,
0.12146338820457458,
-0.03905627131462097,
-0.44504514336586,
0.07183657586574554,
0.7801958322525024,
-0.23755568265914917,
-0.09356182813644409,
0.09263981878757477,
0.0036962032318115234,
0.1981736421585083,
0.08290345966815948,
-0.012492017820477486,
-0.030571050941944122,
0.8368493914604187,
-0.153399258852005,
-0.048260316252708435,
0.3117005228996277,
0.1458774209022522,
0.2572636604309082,
-0.012978322803974152,
-0.10800319910049438,
0.1136312186717987,
0.09602895379066467,
0.18656203150749207,
-0.12544697523117065,
0.20533810555934906,
-0.24483472108840942,
0.044917088001966476,
-0.27903854846954346,
-0.03702235966920853,
0.07871001958847046,
0.15768058598041534,
-0.4358789324760437,
-0.12085824459791183,
-0.395002543926239,
0.21057768166065216,
-0.1381160169839859,
-0.25218528509140015,
0.18098238110542297,
0.2325262725353241,
-0.22067514061927795,
-0.039511773735284805,
-0.1379896104335785,
0.42558979988098145,
0.2794288694858551,
-0.2587926983833313,
0.21365676820278168,
0.3289725184440613,
0.02640301175415516,
0.09947003424167633,
0.5760074853897095,
0.44734081625938416,
0.3122636675834656,
-0.20667165517807007,
0.15033335983753204,
0.13603278994560242,
-0.09937961399555206,
-0.12749914824962616,
-0.04987329989671707,
-0.041512228548526764,
0.30675366520881653,
-0.16615533828735352,
0.18677189946174622,
-0.11775213479995728,
-0.34452104568481445,
0.026377251371741295,
0.014423303306102753,
0.1559247076511383,
0.3423563539981842,
-0.31741073727607727,
-0.07479295134544373,
-0.16284289956092834,
-0.14321237802505493,
-0.39857929944992065,
-0.13547837734222412,
0.2808343768119812,
-0.29233458638191223,
0.18844114243984222,
0.2548920512199402,
0.00012942776083946228,
-0.3933641314506531,
0.34257373213768005,
0.14995795488357544,
-0.07111398875713348,
-0.1748443990945816,
-0.28544849157333374,
-0.256231427192688,
0.34064796566963196,
0.02392171509563923,
-0.36032265424728394,
0.36236488819122314,
0.1984746754169464,
-0.2731969952583313,
0.019388439133763313,
0.12708313763141632,
0.27985259890556335,
0.09190645813941956,
-0.08056492358446121,
-0.37484583258628845,
-0.0463402159512043,
0.01473375502973795,
0.11080503463745117,
-0.11378015577793121,
-0.31074023246765137,
0.3925950527191162,
0.09115934371948242,
0.002632454037666321,
0.023173384368419647,
-0.03344797343015671,
-0.2133496105670929,
-0.32846301794052124,
0.5371675491333008,
0.18277303874492645,
0.15606239438056946,
-0.19932302832603455,
-0.06663333624601364,
-0.29549193382263184,
-0.33207449316978455,
-0.13257883489131927,
0.13135705888271332,
-0.11031461507081985,
0.35074669122695923,
0.03408361226320267,
0.05529855564236641,
-0.4265606999397278,
0.36411166191101074,
0.10497509688138962,
0.07553328573703766,
-0.35155507922172546,
-0.004314728081226349,
-0.4533764123916626,
-0.06934143602848053,
0.06718092411756516,
0.22604940831661224,
-0.02871352806687355,
0.05161371827125549,
-0.16108347475528717,
-0.510549783706665,
0.5495284795761108,
-0.07950562983751297,
-0.6349563002586365,
0.14551101624965668,
0.19123533368110657,
0.1291353404521942,
-0.02178122289478779,
-0.18336153030395508,
0.028146415948867798,
0.2184596061706543,
-0.022771717980504036,
-0.38184574246406555,
0.2806094288825989,
0.16705574095249176,
-0.07202497124671936,
0.052007123827934265,
-0.008560888469219208,
0.09017352759838104,
-0.17712560296058655,
0.19106614589691162,
-0.09750326722860336
] |
https://github.com/huggingface/datasets/issues/5685 | Thanks @albertvillanova , @mariosasko I was not aware of this requirement from the doc (must have skipped :sweat_smile: )
Confirmed, adding back `dataset_info` fixed the issu | Broken Image render on the hub website | ### Describe the bug
Hi :wave:
Not sure if this is the right place to ask, but I am trying to load a huge amount of datasets on the hub (:partying_face: ) but I am facing a little issue with the `image` type
![image](https://user-images.githubusercontent.com/15908060/228587875-427a37f1-3a31-4e17-8bbe-0f759003910d.png)
See this [dataset](https://huggingface.co/datasets/Francesco/cell-towers), basically for some reason the first image has numerical bytes inside, not sure if that is okay, but the image render feature **doesn't work**
So the dataset is stored in the following way
```python
builder.download_and_prepare(output_dir=str(output_dir))
ds = builder.as_dataset(split="train")
# [NOTE] no idea how to push it from the builder folder
ds.push_to_hub(repo_id=repo_id)
builder.as_dataset(split="validation").push_to_hub(repo_id=repo_id)
ds = builder.as_dataset(split="test")
ds.push_to_hub(repo_id=repo_id)
```
The build is this class
```python
class COCOLikeDatasetBuilder(datasets.GeneratorBasedBuilder):
VERSION = datasets.Version("1.0.0")
def _info(self):
features = datasets.Features(
{
"image_id": datasets.Value("int64"),
"image": datasets.Image(),
"width": datasets.Value("int32"),
"height": datasets.Value("int32"),
"objects": datasets.Sequence(
{
"id": datasets.Value("int64"),
"area": datasets.Value("int64"),
"bbox": datasets.Sequence(
datasets.Value("float32"), length=4
),
"category": datasets.ClassLabel(names=categories),
}
),
}
)
return datasets.DatasetInfo(
description=description,
features=features,
homepage=homepage,
license=license,
citation=citation,
)
def _split_generators(self, dl_manager):
archive = dl_manager.download(url)
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={
"annotation_file_path": "train/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
datasets.SplitGenerator(
name=datasets.Split.VALIDATION,
gen_kwargs={
"annotation_file_path": "test/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
datasets.SplitGenerator(
name=datasets.Split.TEST,
gen_kwargs={
"annotation_file_path": "valid/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
]
def _generate_examples(self, annotation_file_path, files):
def process_annot(annot, category_id_to_category):
return {
"id": annot["id"],
"area": annot["area"],
"bbox": annot["bbox"],
"category": category_id_to_category[annot["category_id"]],
}
image_id_to_image = {}
idx = 0
# This loop relies on the ordering of the files in the archive:
# Annotation files come first, then the images.
for path, f in files:
file_name = os.path.basename(path)
if annotation_file_path in path:
annotations = json.load(f)
category_id_to_category = {
category["id"]: category["name"]
for category in annotations["categories"]
}
print(category_id_to_category)
image_id_to_annotations = collections.defaultdict(list)
for annot in annotations["annotations"]:
image_id_to_annotations[annot["image_id"]].append(annot)
image_id_to_image = {
annot["file_name"]: annot for annot in annotations["images"]
}
elif file_name in image_id_to_image:
image = image_id_to_image[file_name]
objects = [
process_annot(annot, category_id_to_category)
for annot in image_id_to_annotations[image["id"]]
]
print(file_name)
yield idx, {
"image_id": image["id"],
"image": {"path": path, "bytes": f.read()},
"width": image["width"],
"height": image["height"],
"objects": objects,
}
idx += 1
```
Basically, I want to add to the hub every dataset I come across on coco format
Thanks
Fra
### Steps to reproduce the bug
In this case, you can just navigate on the [dataset](https://huggingface.co/datasets/Francesco/cell-towers)
### Expected behavior
I was expecting the image rendering feature to work
### Environment info
Not a lot to share, I am using `datasets` from a fresh venv | 26 | Broken Image render on the hub website
### Describe the bug
Hi :wave:
Not sure if this is the right place to ask, but I am trying to load a huge amount of datasets on the hub (:partying_face: ) but I am facing a little issue with the `image` type
![image](https://user-images.githubusercontent.com/15908060/228587875-427a37f1-3a31-4e17-8bbe-0f759003910d.png)
See this [dataset](https://huggingface.co/datasets/Francesco/cell-towers), basically for some reason the first image has numerical bytes inside, not sure if that is okay, but the image render feature **doesn't work**
So the dataset is stored in the following way
```python
builder.download_and_prepare(output_dir=str(output_dir))
ds = builder.as_dataset(split="train")
# [NOTE] no idea how to push it from the builder folder
ds.push_to_hub(repo_id=repo_id)
builder.as_dataset(split="validation").push_to_hub(repo_id=repo_id)
ds = builder.as_dataset(split="test")
ds.push_to_hub(repo_id=repo_id)
```
The build is this class
```python
class COCOLikeDatasetBuilder(datasets.GeneratorBasedBuilder):
VERSION = datasets.Version("1.0.0")
def _info(self):
features = datasets.Features(
{
"image_id": datasets.Value("int64"),
"image": datasets.Image(),
"width": datasets.Value("int32"),
"height": datasets.Value("int32"),
"objects": datasets.Sequence(
{
"id": datasets.Value("int64"),
"area": datasets.Value("int64"),
"bbox": datasets.Sequence(
datasets.Value("float32"), length=4
),
"category": datasets.ClassLabel(names=categories),
}
),
}
)
return datasets.DatasetInfo(
description=description,
features=features,
homepage=homepage,
license=license,
citation=citation,
)
def _split_generators(self, dl_manager):
archive = dl_manager.download(url)
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={
"annotation_file_path": "train/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
datasets.SplitGenerator(
name=datasets.Split.VALIDATION,
gen_kwargs={
"annotation_file_path": "test/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
datasets.SplitGenerator(
name=datasets.Split.TEST,
gen_kwargs={
"annotation_file_path": "valid/_annotations.coco.json",
"files": dl_manager.iter_archive(archive),
},
),
]
def _generate_examples(self, annotation_file_path, files):
def process_annot(annot, category_id_to_category):
return {
"id": annot["id"],
"area": annot["area"],
"bbox": annot["bbox"],
"category": category_id_to_category[annot["category_id"]],
}
image_id_to_image = {}
idx = 0
# This loop relies on the ordering of the files in the archive:
# Annotation files come first, then the images.
for path, f in files:
file_name = os.path.basename(path)
if annotation_file_path in path:
annotations = json.load(f)
category_id_to_category = {
category["id"]: category["name"]
for category in annotations["categories"]
}
print(category_id_to_category)
image_id_to_annotations = collections.defaultdict(list)
for annot in annotations["annotations"]:
image_id_to_annotations[annot["image_id"]].append(annot)
image_id_to_image = {
annot["file_name"]: annot for annot in annotations["images"]
}
elif file_name in image_id_to_image:
image = image_id_to_image[file_name]
objects = [
process_annot(annot, category_id_to_category)
for annot in image_id_to_annotations[image["id"]]
]
print(file_name)
yield idx, {
"image_id": image["id"],
"image": {"path": path, "bytes": f.read()},
"width": image["width"],
"height": image["height"],
"objects": objects,
}
idx += 1
```
Basically, I want to add to the hub every dataset I come across on coco format
Thanks
Fra
### Steps to reproduce the bug
In this case, you can just navigate on the [dataset](https://huggingface.co/datasets/Francesco/cell-towers)
### Expected behavior
I was expecting the image rendering feature to work
### Environment info
Not a lot to share, I am using `datasets` from a fresh venv
Thanks @albertvillanova , @mariosasko I was not aware of this requirement from the doc (must have skipped :sweat_smile: )
Confirmed, adding back `dataset_info` fixed the issu | [
-0.43464988470077515,
-0.4146606922149658,
-0.09680424630641937,
0.5902366638183594,
0.461051881313324,
-0.005445204675197601,
0.29988235235214233,
0.4036051332950592,
0.023893944919109344,
0.15203532576560974,
0.01003292202949524,
0.05818457528948784,
-0.102505162358284,
0.06415857374668121,
0.19887004792690277,
0.06047848239541054,
-0.0016686879098415375,
0.24360716342926025,
0.25261539220809937,
-0.1751006543636322,
-0.18012136220932007,
0.01876281388103962,
0.03229899704456329,
0.04903607815504074,
-0.7926419377326965,
0.08271671831607819,
0.09131783246994019,
0.22453024983406067,
-0.017043326050043106,
-0.1634998321533203,
0.12126474827528,
-0.09951843321323395,
0.09250761568546295,
0.4520472586154938,
-0.00012131304538343102,
0.018199041485786438,
0.7410540580749512,
0.023027390241622925,
-0.26376867294311523,
0.09491229802370071,
-0.5384019613265991,
-0.13567954301834106,
-0.13000082969665527,
-0.12777797877788544,
0.12861871719360352,
0.10175319015979767,
-0.02613675221800804,
0.2836776077747345,
0.5206714868545532,
0.17541852593421936,
0.14513331651687622,
0.12529239058494568,
-0.018267259001731873,
0.1044759601354599,
0.01909882389008999,
0.4297078251838684,
-0.03898722678422928,
0.11319167912006378,
0.12389937043190002,
0.05462267994880676,
0.1183229386806488,
0.1824711263179779,
-0.10348394513130188,
-0.04261571168899536,
0.0974816381931305,
-0.0006509646773338318,
0.03963807597756386,
-0.22535604238510132,
-0.11463923752307892,
0.09909974783658981,
0.0009186416864395142,
-0.027640286833047867,
-0.13412787020206451,
-0.13410577178001404,
-0.3411913812160492,
-0.17578712105751038,
0.22643348574638367,
0.2859198749065399,
-0.31556200981140137,
-0.14760877192020416,
-0.4905593991279602,
-0.3887096345424652,
-0.13441139459609985,
0.09386570751667023,
-0.40436112880706787,
0.21352720260620117,
-0.17455685138702393,
0.08045564591884613,
-0.2240094244480133,
0.25180137157440186,
0.3244004547595978,
-0.2923396825790405,
0.022357048466801643,
-0.01812044531106949,
0.0741719901561737,
0.04346194863319397,
-0.0565103255212307,
0.3167145848274231,
0.2106999158859253,
-0.3044176697731018,
0.08884304761886597,
0.25121328234672546,
-0.33965247869491577,
0.24813710153102875,
0.270078182220459,
0.19476599991321564,
-0.01946142315864563,
0.0992649495601654,
0.34076032042503357,
0.5917086601257324,
0.11012810468673706,
-0.04238668829202652,
-0.15305446088314056,
0.12280865013599396,
0.01953091472387314,
0.03701438382267952,
0.28826963901519775,
-0.08135539293289185,
-0.472909539937973,
0.1605103313922882,
0.4150103032588959,
0.25842127203941345,
0.20746725797653198,
0.12021157145500183,
-0.0253074299544096,
0.3049446642398834,
-0.03520692512392998,
-0.0052685486152768135,
-0.2890409231185913,
-0.307130366563797,
-0.27705827355384827,
-0.13041818141937256,
-0.15492460131645203,
0.1505763828754425,
-0.07346774637699127,
-0.257811963558197,
0.03916710615158081,
0.10408371686935425,
0.33297744393348694,
-0.15052422881126404,
-0.4002595543861389,
-0.21458090841770172,
0.03163599595427513,
0.21741995215415955,
-0.05204911530017853,
0.16080263257026672,
0.18591654300689697,
-0.24161802232265472,
0.01822294294834137,
0.20709946751594543,
-0.6655951738357544,
-0.32905644178390503,
-0.21465520560741425,
0.1009613424539566,
-0.33329659700393677,
0.2334369421005249,
-0.5168341398239136,
-0.0013890834525227547,
0.019621193408966064,
0.014407932758331299,
0.07192260026931763,
-0.024512790143489838,
-0.15000158548355103,
-0.03259586915373802,
0.18505185842514038,
0.2481600046157837,
-0.16446126997470856,
-0.08107249438762665,
-0.1545017659664154,
0.27092796564102173,
0.1717313826084137,
0.2242000699043274,
-0.13862811028957367,
0.19094640016555786,
-0.29105281829833984,
-0.03911706060171127,
0.03315333276987076,
-0.4678491950035095,
-0.4080645740032196,
0.29436200857162476,
0.2320917397737503,
0.12326931953430176,
-0.2759806513786316,
0.09619686007499695,
0.18042655289173126,
-0.1947098970413208,
0.2969835102558136,
0.4187457859516144,
-0.17020823061466217,
0.2107352912425995,
-0.21584101021289825,
-0.21272757649421692,
-0.11543011665344238,
0.18898525834083557,
0.17076462507247925,
0.06912538409233093,
-0.112833172082901,
0.21581953763961792,
0.07869075238704681,
0.04938904568552971,
0.2807537019252777,
-0.01800546422600746,
0.2705560326576233,
-0.2017202228307724,
-0.04718780145049095,
-0.28069084882736206,
-0.19799689948558807,
0.17045800387859344,
0.08205462247133255,
0.05808302015066147,
-0.3691732585430145,
0.10108818113803864,
-0.441506028175354,
0.037923961877822876,
-0.3401091694831848,
-0.0286637544631958,
0.026700183749198914,
-0.1586548388004303,
-0.2491435408592224,
0.0014628320932388306,
-0.04526479169726372,
0.4618415832519531,
-0.02832920104265213,
-0.006693385541439056,
-0.0769914835691452,
0.5660856366157532,
0.13152217864990234,
-0.3142451345920563,
-0.15698030591011047,
0.09273308515548706,
0.22129862010478973,
-0.10428270697593689,
-0.3188309371471405,
0.4110512137413025,
0.02088358998298645,
0.18543016910552979,
-0.07875595986843109,
-0.15743538737297058,
0.41180768609046936,
-0.48052847385406494,
0.19516782462596893,
-0.03619333356618881,
0.1270158886909485,
-0.08893570303916931,
-0.07346602529287338,
0.06719867885112762,
-0.24333181977272034,
0.25630098581314087,
-0.27331483364105225,
0.2678287625312805,
-0.04861956834793091,
0.22539879381656647,
0.003962233662605286,
-0.14413008093833923,
-0.1271958202123642,
0.2706387937068939,
0.039969682693481445,
-0.17954476177692413,
0.21733319759368896,
-0.14160406589508057,
0.18870681524276733,
0.10694136470556259,
0.23271113634109497,
0.0179374348372221,
-0.37876051664352417,
0.19618502259254456,
0.25377634167671204,
-0.13747352361679077,
0.06856691837310791,
-0.050935350358486176,
-0.38446369767189026,
0.011960307136178017,
-0.08588074147701263,
-0.05878308787941933,
0.18301786482334137,
0.3931646943092346,
0.18678316473960876,
0.16318407654762268,
0.1582961082458496,
-0.3044096827507019,
-0.5204719305038452,
-0.18590271472930908,
0.009976327419281006,
0.12149567157030106,
-0.21974849700927734,
0.08260142058134079,
-0.11843524128198624,
-0.012415260076522827,
0.014656491577625275,
-0.24525053799152374,
-0.41313570737838745,
-0.2164779007434845,
0.014188887551426888,
0.001537892036139965,
0.1620246320962906,
0.16617614030838013,
0.1536702811717987,
0.3063925504684448,
0.19545751810073853,
-0.011895274743437767,
-0.44324326515197754,
0.014018353074789047,
-0.0476132333278656,
-0.005837246775627136,
0.2628542482852936,
-0.08974813669919968,
0.1611902266740799,
-0.2750319242477417,
-0.009101592004299164,
-0.18682050704956055,
-0.031179502606391907,
0.29136139154434204,
-0.25561174750328064,
0.4302254021167755,
-0.05265264958143234,
0.30404403805732727,
0.020843006670475006,
0.24388058483600616,
0.6277626752853394,
-0.07115913182497025,
0.005345962941646576,
0.15961968898773193,
-0.047569844871759415,
-0.08709696680307388,
-0.08361352980136871,
0.429706335067749,
-0.0393800362944603,
-0.19165518879890442,
-0.07824411988258362,
0.3172021508216858,
0.24730946123600006,
0.2465883046388626,
0.3399321138858795,
-0.2850017845630646,
0.26975351572036743,
-0.2691049575805664,
-0.331986665725708,
-0.6107125282287598,
0.18541356921195984,
-0.0496005117893219,
-0.1846364587545395,
-0.23346105217933655,
0.20272105932235718,
0.34970349073410034,
0.25768911838531494,
-0.295722633600235,
-0.5453639626502991,
-0.29941216111183167,
0.0862567126750946,
-0.15097291767597198,
0.04071307182312012,
-0.14179538190364838,
0.015084631741046906,
-0.04854360967874527,
-0.07205568999052048,
0.16271501779556274,
-0.3344114124774933,
0.31333744525909424,
0.14848847687244415,
0.10240739583969116,
0.15864863991737366,
0.1439347267150879,
0.20136156678199768,
0.17914138734340668,
-0.13224823772907257,
0.47586992383003235,
-0.014192085713148117,
0.4012601375579834,
-0.07387693226337433,
-0.23866957426071167,
0.1689266562461853,
0.062006931751966476,
-0.1885952353477478,
-0.09819860011339188,
0.021848555654287338,
0.14452938735485077,
-0.09464417397975922,
0.006987027823925018,
-0.43392613530158997,
0.03588085621595383,
0.018668444827198982,
0.23814113438129425,
0.11651185154914856,
0.009725727140903473,
-0.1289636790752411,
-0.2864498794078827,
-0.35674992203712463,
0.28776681423187256,
0.1072024255990982,
0.12136327475309372,
-0.08807221800088882,
0.20953834056854248,
-0.23461641371250153,
-0.2621590197086334,
0.13819217681884766,
0.16377311944961548,
0.244806170463562,
0.03992665559053421,
0.4203285574913025,
0.030283622443675995,
-0.06263338029384613,
0.7615655064582825,
-0.3149665594100952,
0.24997909367084503,
0.04982847720384598,
-0.06954771280288696,
-0.5001453161239624,
-0.0540323369204998,
-0.14738136529922485,
0.49577292799949646,
-0.4543299973011017,
0.6851668953895569,
-0.10165635496377945,
-0.24059687554836273,
0.014492280781269073,
-0.0223712008446455,
-0.4764256477355957,
-0.08113294094800949,
-0.20605719089508057,
-0.07191282510757446,
-0.1419087052345276,
-0.1921231597661972,
0.2871984541416168,
0.2455907016992569,
0.045692503452301025,
-0.3610045909881592,
-0.12553533911705017,
-0.039983734488487244,
0.00804721936583519,
0.03291752189397812,
0.3146388530731201,
-0.16547271609306335,
-0.0718703344464302,
0.1963864415884018,
-0.055573221296072006,
-0.02373097464442253,
0.5032331943511963,
0.3533177375793457,
-0.1846378743648529,
0.04186192527413368,
0.18203634023666382,
-0.18899178504943848,
0.4387931525707245,
-0.0547126904129982,
-0.44172403216362,
-0.07199244201183319,
0.265259712934494,
-0.6485344171524048,
0.3060751259326935,
0.42651328444480896,
0.06532837450504303,
-0.3564511239528656,
-0.18574625253677368,
0.6746714115142822,
0.07386092841625214,
-0.0498662143945694,
0.08027367293834686,
0.3790872097015381,
-0.31064218282699585,
0.07442691922187805,
0.3949035406112671,
0.7777290940284729,
-0.14633432030677795,
0.23599256575107574,
0.001463884487748146,
0.34909456968307495,
0.3182125687599182,
-0.31954121589660645,
-0.01547288615256548,
-0.15163734555244446,
-0.2277393341064453,
-0.17720383405685425,
-0.03163003921508789,
-0.022606831043958664,
-0.027585916221141815,
-0.018256112933158875,
0.2610856890678406,
-0.29821112751960754,
0.5039779543876648,
0.038222894072532654,
-0.04312528297305107,
-0.4613930881023407,
-0.25208231806755066,
-0.16621235013008118,
0.17930439114570618,
-0.2821192741394043,
0.028042934834957123,
-0.17845582962036133,
0.10665228962898254,
-0.1766299307346344,
0.04143288731575012,
-0.32027846574783325,
0.17496858537197113,
0.01459115743637085,
0.2548113465309143,
0.026648204773664474,
-0.1917780339717865,
-0.17471575736999512,
-0.0075846947729587555,
0.26970145106315613,
-0.06759272515773773,
-0.32796528935432434,
0.4738367795944214,
-0.4439159035682678,
0.10805992782115936,
-0.09107705950737,
0.08860220015048981,
0.22883646190166473,
-0.02434493973851204,
-0.17847341299057007,
0.07405924797058105,
0.26379090547561646,
0.02801571786403656,
-0.1344112753868103,
-0.020200565457344055,
0.3587428629398346,
-0.24343876540660858,
-0.10213519632816315,
-0.2752256989479065,
0.04260803759098053,
-0.26760995388031006,
0.06650657951831818,
0.04916221648454666,
-0.030417077243328094,
0.2507699429988861,
0.39285728335380554,
0.018789634108543396,
0.2199484407901764,
0.1657041758298874,
0.010675374418497086,
-0.05774824321269989,
0.015203909948468208,
-0.06807121634483337,
-0.15948700904846191,
-0.16638225317001343,
0.12822484970092773,
0.057530030608177185,
-0.5684505701065063,
0.40296077728271484,
-0.5216122269630432,
-0.19716928899288177,
-0.3390490412712097,
0.19938229024410248,
0.12262991815805435,
-0.09114682674407959,
-0.19585810601711273,
-0.35607820749282837,
-0.12978681921958923,
0.1310950517654419,
0.043501511216163635,
0.3622259497642517,
-0.3571290969848633,
0.12381471693515778,
0.028605356812477112,
-0.01954146847128868,
-0.22342494130134583,
0.2830198407173157,
-0.15480650961399078,
0.28198719024658203,
-0.598262369632721,
0.09454018622636795,
0.19263604283332825,
-0.3041406571865082,
0.017042700201272964,
0.3900909125804901,
-0.08159103244543076,
-0.15325069427490234,
-0.2717362940311432,
0.2186591774225235,
0.402494877576828,
-0.1913663148880005,
0.004879400134086609,
0.07000267505645752,
0.06755559891462326,
-0.1942966729402542,
0.3269307017326355,
-0.046601541340351105,
0.05769631266593933,
0.06671787798404694,
0.6451704502105713,
0.04916851967573166,
0.08061268925666809,
0.2708691656589508,
0.025650689378380775,
0.8383421301841736,
0.0658041313290596,
0.02638254687190056,
0.29230737686157227,
-0.051569633185863495,
-0.06696881353855133,
0.34793564677238464,
0.04045289754867554,
0.10098821669816971,
0.49698469042778015,
-0.4268432557582855,
0.26979658007621765,
0.075924351811409,
0.3614614009857178,
0.19182845950126648,
-0.35687634348869324,
-0.2675815224647522,
-0.014649767428636551,
0.16823618113994598,
0.08118259906768799,
-0.16822804510593414,
0.11804069578647614,
0.021299857646226883,
-0.02692456543445587,
0.11005386710166931,
0.12146338820457458,
-0.03905627131462097,
-0.44504514336586,
0.07183657586574554,
0.7801958322525024,
-0.23755568265914917,
-0.09356182813644409,
0.09263981878757477,
0.0036962032318115234,
0.1981736421585083,
0.08290345966815948,
-0.012492017820477486,
-0.030571050941944122,
0.8368493914604187,
-0.153399258852005,
-0.048260316252708435,
0.3117005228996277,
0.1458774209022522,
0.2572636604309082,
-0.012978322803974152,
-0.10800319910049438,
0.1136312186717987,
0.09602895379066467,
0.18656203150749207,
-0.12544697523117065,
0.20533810555934906,
-0.24483472108840942,
0.044917088001966476,
-0.27903854846954346,
-0.03702235966920853,
0.07871001958847046,
0.15768058598041534,
-0.4358789324760437,
-0.12085824459791183,
-0.395002543926239,
0.21057768166065216,
-0.1381160169839859,
-0.25218528509140015,
0.18098238110542297,
0.2325262725353241,
-0.22067514061927795,
-0.039511773735284805,
-0.1379896104335785,
0.42558979988098145,
0.2794288694858551,
-0.2587926983833313,
0.21365676820278168,
0.3289725184440613,
0.02640301175415516,
0.09947003424167633,
0.5760074853897095,
0.44734081625938416,
0.3122636675834656,
-0.20667165517807007,
0.15033335983753204,
0.13603278994560242,
-0.09937961399555206,
-0.12749914824962616,
-0.04987329989671707,
-0.041512228548526764,
0.30675366520881653,
-0.16615533828735352,
0.18677189946174622,
-0.11775213479995728,
-0.34452104568481445,
0.026377251371741295,
0.014423303306102753,
0.1559247076511383,
0.3423563539981842,
-0.31741073727607727,
-0.07479295134544373,
-0.16284289956092834,
-0.14321237802505493,
-0.39857929944992065,
-0.13547837734222412,
0.2808343768119812,
-0.29233458638191223,
0.18844114243984222,
0.2548920512199402,
0.00012942776083946228,
-0.3933641314506531,
0.34257373213768005,
0.14995795488357544,
-0.07111398875713348,
-0.1748443990945816,
-0.28544849157333374,
-0.256231427192688,
0.34064796566963196,
0.02392171509563923,
-0.36032265424728394,
0.36236488819122314,
0.1984746754169464,
-0.2731969952583313,
0.019388439133763313,
0.12708313763141632,
0.27985259890556335,
0.09190645813941956,
-0.08056492358446121,
-0.37484583258628845,
-0.0463402159512043,
0.01473375502973795,
0.11080503463745117,
-0.11378015577793121,
-0.31074023246765137,
0.3925950527191162,
0.09115934371948242,
0.002632454037666321,
0.023173384368419647,
-0.03344797343015671,
-0.2133496105670929,
-0.32846301794052124,
0.5371675491333008,
0.18277303874492645,
0.15606239438056946,
-0.19932302832603455,
-0.06663333624601364,
-0.29549193382263184,
-0.33207449316978455,
-0.13257883489131927,
0.13135705888271332,
-0.11031461507081985,
0.35074669122695923,
0.03408361226320267,
0.05529855564236641,
-0.4265606999397278,
0.36411166191101074,
0.10497509688138962,
0.07553328573703766,
-0.35155507922172546,
-0.004314728081226349,
-0.4533764123916626,
-0.06934143602848053,
0.06718092411756516,
0.22604940831661224,
-0.02871352806687355,
0.05161371827125549,
-0.16108347475528717,
-0.510549783706665,
0.5495284795761108,
-0.07950562983751297,
-0.6349563002586365,
0.14551101624965668,
0.19123533368110657,
0.1291353404521942,
-0.02178122289478779,
-0.18336153030395508,
0.028146415948867798,
0.2184596061706543,
-0.022771717980504036,
-0.38184574246406555,
0.2806094288825989,
0.16705574095249176,
-0.07202497124671936,
0.052007123827934265,
-0.008560888469219208,
0.09017352759838104,
-0.17712560296058655,
0.19106614589691162,
-0.09750326722860336
] |
https://github.com/huggingface/datasets/issues/5681 | Good idea, I think I've seen this a couple of times before too on the forums. I can work on this :) | Add information about patterns search order to the doc about structuring repo | Following [this](https://github.com/huggingface/datasets/issues/5650) issue I think we should add a note about the order of patterns that is used to find splits, see [my comment](https://github.com/huggingface/datasets/issues/5650#issuecomment-1488412527). Also we should reference this page in pages about packaged loaders.
I have a déjà vu that it had already been discussed as some point but I don't remember.... | 22 | Add information about patterns search order to the doc about structuring repo
Following [this](https://github.com/huggingface/datasets/issues/5650) issue I think we should add a note about the order of patterns that is used to find splits, see [my comment](https://github.com/huggingface/datasets/issues/5650#issuecomment-1488412527). Also we should reference this page in pages about packaged loaders.
I have a déjà vu that it had already been discussed as some point but I don't remember....
Good idea, I think I've seen this a couple of times before too on the forums. I can work on this :) | [
-0.03904266655445099,
-0.3705797493457794,
-0.1258505880832672,
0.17808911204338074,
0.1903303861618042,
-0.36044180393218994,
0.18976858258247375,
0.0783003568649292,
0.15238475799560547,
0.1930197924375534,
-0.13044577836990356,
0.2470816820859909,
0.16735267639160156,
0.5323824286460876,
-0.008417045697569847,
-0.21778443455696106,
-0.05827582627534866,
0.3387299180030823,
-0.1583768129348755,
0.042181022465229034,
-0.08116757124662399,
0.2466375231742859,
0.06682997941970825,
0.016241559758782387,
-0.09364201128482819,
-0.13780562579631805,
-0.07588361203670502,
0.23367661237716675,
-0.25375300645828247,
-0.3060903549194336,
0.11848606914281845,
0.28355151414871216,
-0.08842970430850983,
0.38673222064971924,
-0.00011008880392182618,
-0.018454261124134064,
0.12757885456085205,
-0.031123559921979904,
-0.13686078786849976,
0.24041104316711426,
-0.30861929059028625,
-0.0037518516182899475,
0.02542080730199814,
-0.18958508968353271,
-0.23337364196777344,
0.3517667055130005,
-0.1048080176115036,
-0.06551072001457214,
0.4308638870716095,
-0.007320627570152283,
0.2592901289463043,
0.1992853879928589,
0.19904495775699615,
-0.246921107172966,
0.4948853850364685,
0.43729346990585327,
-0.34504586458206177,
0.21915994584560394,
0.5124490261077881,
0.0650782361626625,
-0.2950095236301422,
0.49170175194740295,
0.2230587899684906,
0.06746243685483932,
0.11562104523181915,
0.06732761859893799,
0.05067247524857521,
-0.15867704153060913,
-0.19943803548812866,
0.17460446059703827,
0.2977216839790344,
0.002163965255022049,
-0.34460389614105225,
-0.43639081716537476,
-0.08507443964481354,
-0.15732291340827942,
0.30186378955841064,
0.09618310630321503,
0.06632403284311295,
0.2822220027446747,
-0.11637689918279648,
-0.17704342305660248,
-0.05043860524892807,
-0.08004386723041534,
-0.12646879255771637,
0.3068320155143738,
-0.23320764303207397,
-0.3113696277141571,
0.34031346440315247,
-0.007886272855103016,
-0.5047286748886108,
0.32293182611465454,
-0.18460536003112793,
-0.08520621806383133,
0.10542388260364532,
-0.36729729175567627,
0.04967168718576431,
0.06980276107788086,
0.38275599479675293,
0.45459094643592834,
-0.13522006571292877,
0.17964623868465424,
-0.03550814092159271,
-0.13405245542526245,
0.2364276647567749,
0.16161634027957916,
0.0033831465989351273,
0.2784750163555145,
0.34857550263404846,
0.3719695508480072,
0.08691388368606567,
0.04250800237059593,
0.0349920354783535,
-0.06759590655565262,
-0.3587106764316559,
-0.09150922298431396,
0.08894863724708557,
-0.2537889778614044,
-0.12452013790607452,
-0.3368516266345978,
0.001166030764579773,
-0.3142363131046295,
0.178218275308609,
0.42385685443878174,
-0.0010516718029975891,
0.023553095757961273,
-0.21673983335494995,
0.148896723985672,
-0.1866070032119751,
0.04447398707270622,
-0.14854271709918976,
-0.28207194805145264,
-0.4118306636810303,
0.31022536754608154,
0.026518039405345917,
-0.3329140543937683,
0.19764959812164307,
0.1810951679944992,
0.24318277835845947,
-0.14013035595417023,
-0.08412516862154007,
0.2347588837146759,
-0.11334182322025299,
0.3779509961605072,
-0.2502892017364502,
0.013223297894001007,
-0.009106501936912537,
0.20832793414592743,
-0.36951711773872375,
-0.13640445470809937,
-0.5230740904808044,
-0.5803504586219788,
-0.024563588201999664,
0.23528937995433807,
-0.12899048626422882,
-0.0627189427614212,
-0.22553923726081848,
-0.07313549518585205,
0.03035546839237213,
-0.05324821546673775,
-0.07433825731277466,
0.386094331741333,
-0.10462594777345657,
-0.0931088849902153,
-0.028689101338386536,
0.113162562251091,
0.06918391585350037,
-0.3047497272491455,
-0.056521572172641754,
-0.17161297798156738,
0.40776896476745605,
0.29909926652908325,
-0.20764340460300446,
-0.031723182648420334,
-0.4927874505519867,
0.3560757040977478,
0.1319759488105774,
-0.148552805185318,
-0.09767410904169083,
0.4754857122898102,
-0.3231539726257324,
0.07783576101064682,
0.3207545876502991,
-0.2920975685119629,
0.14111478626728058,
-0.32225313782691956,
-0.1610645353794098,
0.2406652271747589,
-0.18910686671733856,
0.38213402032852173,
-0.2084299921989441,
-0.16164599359035492,
-0.0746401771903038,
0.10738236457109451,
-0.15085305273532867,
-0.023146796971559525,
-0.03895789384841919,
0.038089215755462646,
0.19427374005317688,
-0.07471324503421783,
-0.1831621527671814,
0.03444144129753113,
0.4731174111366272,
0.28303906321525574,
0.1457715928554535,
0.06658752262592316,
-0.3450295925140381,
0.08720587939023972,
-0.305971622467041,
-0.07965303957462311,
-0.14175699651241302,
-0.4628971219062805,
-0.326861172914505,
-0.20034372806549072,
-0.11125563085079193,
-0.12185851484537125,
0.14945665001869202,
0.041810471564531326,
-0.13850295543670654,
-0.12453196942806244,
-0.20527905225753784,
0.3524377942085266,
-0.08456576615571976,
0.3365139365196228,
0.05652068182826042,
0.476539671421051,
-0.18430623412132263,
0.12777981162071228,
0.20175549387931824,
0.25544464588165283,
0.07413402199745178,
-0.25143668055534363,
0.07158149778842926,
0.30987828969955444,
0.1064276397228241,
0.3031053841114044,
0.22019870579242706,
0.06404727697372437,
0.4013337790966034,
-0.1333737075328827,
-0.11061452329158783,
-0.06607453525066376,
-0.35929539799690247,
-0.07349924743175507,
-0.30733722448349,
0.31381702423095703,
-0.053462207317352295,
0.2356589287519455,
0.024680741131305695,
-0.11314369738101959,
0.2005142867565155,
-0.16526608169078827,
-0.1199599876999855,
-0.27742800116539,
0.18827790021896362,
-0.014643022790551186,
0.10418117791414261,
0.2854570150375366,
-0.1912255734205246,
0.3766975998878479,
0.4718600809574127,
-0.12236388027667999,
-0.002925148233771324,
0.2812849283218384,
0.4193896949291229,
-0.15751996636390686,
-0.021653786301612854,
0.3773767948150635,
0.08755026012659073,
0.34686586260795593,
0.019414715468883514,
-0.32438236474990845,
0.031857024878263474,
-0.24722476303577423,
-0.03822595626115799,
0.25127097964286804,
0.2706702947616577,
0.08249232172966003,
-0.0342000387609005,
-0.083685502409935,
0.02011435478925705,
-0.012595921754837036,
0.02149328589439392,
-0.11752720922231674,
-0.17705893516540527,
-0.19177213311195374,
-0.05136881023645401,
-0.21097756922245026,
-0.28555288910865784,
-0.29079705476760864,
-0.36885905265808105,
-0.20359210669994354,
0.39239558577537537,
-0.12268179655075073,
-0.4514414072036743,
0.17654527723789215,
0.33431360125541687,
0.5303889513015747,
-0.007997415959835052,
0.24990633130073547,
-0.19225433468818665,
0.07578454166650772,
0.0340147390961647,
0.1405647099018097,
0.2100045382976532,
-0.029179397970438004,
0.5543935298919678,
-0.3958934545516968,
-0.058914944529533386,
-0.19709153473377228,
-0.4550035893917084,
0.14733237028121948,
-0.08213885128498077,
-0.31463539600372314,
0.21819666028022766,
0.02379794977605343,
0.19649863243103027,
-0.35775166749954224,
0.010307028889656067,
0.00016120821237564087,
-0.279966801404953,
-0.1137331873178482,
0.0756462812423706,
0.3702070415019989,
-0.3870411515235901,
-0.4336467683315277,
0.02845996432006359,
-0.6251951456069946,
0.2266152799129486,
0.07793661206960678,
0.162436842918396,
-0.06915322691202164,
-0.14906193315982819,
-0.03883277252316475,
-0.06167173013091087,
0.11540161818265915,
-0.06797903031110764,
-0.34118276834487915,
0.1626679003238678,
-0.3389749228954315,
-0.06019316613674164,
-0.0353018119931221,
-0.1653881072998047,
-0.08075475692749023,
-0.023506993427872658,
-0.29460442066192627,
-0.11575320363044739,
-0.27499452233314514,
0.09169460088014603,
-0.017490580677986145,
0.04679843783378601,
0.30208978056907654,
0.08508138358592987,
-0.19222524762153625,
-0.06313800811767578,
-0.11237899959087372,
0.27588212490081787,
-0.2545381784439087,
0.1806073635816574,
-0.14092406630516052,
0.18260754644870758,
-0.06281059235334396,
0.7734360098838806,
0.013092674314975739,
0.17687784135341644,
-0.020598243921995163,
0.21929767727851868,
0.19453474879264832,
-0.07840079069137573,
0.13466103374958038,
0.08737561851739883,
0.005673117935657501,
0.388590931892395,
0.5075896978378296,
0.45448988676071167,
-0.10277600586414337,
0.060937657952308655,
0.07869866490364075,
-0.07541617006063461,
-0.35280632972717285,
0.11571958661079407,
0.14147323369979858,
0.1472751945257187,
-0.3234884738922119,
-0.007868729531764984,
0.08134879916906357,
0.13616293668746948,
0.10124930739402771,
0.21585574746131897,
0.11115813255310059,
-0.08751797676086426,
-0.21714681386947632,
0.22265642881393433,
-0.21009023487567902,
-0.1396617293357849,
0.07463814318180084,
-0.4191381633281708,
-0.16020166873931885,
-0.28130006790161133,
-0.04079696536064148,
-0.10158416628837585,
0.31719961762428284,
0.235858753323555,
0.014201642945408821,
-0.06234881281852722,
-0.3407401144504547,
0.2972729802131653,
-0.03944425284862518,
-0.2744053602218628,
0.11063658446073532,
0.3473178446292877,
0.5387966632843018,
-0.6889393329620361,
-0.3902673125267029,
0.4413561224937439,
-0.15596386790275574,
0.022462673485279083,
-0.3365035355091095,
-0.1403108388185501,
-0.05432875454425812,
-0.2575872838497162,
0.2185826301574707,
0.30820852518081665,
-0.1768375039100647,
-0.47608277201652527,
-0.21850354969501495,
0.29456639289855957,
-0.20334355533123016,
-0.028758671134710312,
-0.008135087788105011,
0.47025880217552185,
-0.0297318734228611,
-0.02801676094532013,
0.4875451624393463,
0.3472250998020172,
0.2257264107465744,
0.5160080790519714,
-0.33324846625328064,
0.010519225150346756,
-0.01764620468020439,
-0.32134169340133667,
-0.013216018676757812,
0.4515194892883301,
0.1416836529970169,
0.036257270723581314,
-0.07355250418186188,
0.26647645235061646,
-0.37723103165626526,
0.01951025053858757,
0.263092041015625,
-0.004791859537363052,
-0.32053142786026,
-0.2929818034172058,
0.34624746441841125,
-0.04852278158068657,
-0.2280745506286621,
0.22631171345710754,
0.7625409960746765,
-0.2625807225704193,
0.2263628989458084,
-0.03409850224852562,
1.0381646156311035,
0.02063816972076893,
0.05518919974565506,
0.27054622769355774,
-0.2896524667739868,
0.20894752442836761,
-0.32138997316360474,
0.0502203032374382,
-0.17951789498329163,
0.038833923637866974,
0.09905366599559784,
-0.11217770725488663,
0.008771592751145363,
-0.03298214077949524,
-0.5600371360778809,
-0.18939462304115295,
-0.04838661849498749,
0.044011279940605164,
-0.22372373938560486,
0.19334997236728668,
-0.020419148728251457,
-0.24623827636241913,
-0.24393105506896973,
0.1207708865404129,
0.07640491425991058,
0.35424545407295227,
-0.14873281121253967,
-0.1523505300283432,
0.10810144990682602,
-0.15844668447971344,
-0.2585958242416382,
0.03854789584875107,
0.08572809398174286,
0.11521750688552856,
0.3050786256790161,
0.15705299377441406,
0.23412391543388367,
0.11308808624744415,
0.19655317068099976,
0.10782782733440399,
-0.14472052454948425,
0.13076144456863403,
-0.1460128128528595,
0.014742221683263779,
0.04707595705986023,
-0.021150726824998856,
0.2459689974784851,
-0.20166808366775513,
-0.1021016538143158,
-0.4314813017845154,
-0.05177208408713341,
-0.38622766733169556,
-0.2769884467124939,
-0.04512159898877144,
-0.12288622558116913,
-0.4604478180408478,
0.14853441715240479,
0.21762339770793915,
-0.07960953563451767,
-0.23609697818756104,
0.1733843982219696,
0.32081788778305054,
-0.33538618683815,
0.0795230120420456,
0.08692467212677002,
-0.09271347522735596,
-0.3067614436149597,
-0.004650380462408066,
-0.03178401291370392,
-0.1528298556804657,
0.030002251267433167,
0.10298049449920654,
-0.37576574087142944,
-0.3734644055366516,
-0.051048487424850464,
0.16982170939445496,
-0.3637844920158386,
0.20504872500896454,
-0.058134905993938446,
-0.47657662630081177,
0.21864520013332367,
0.15314018726348877,
0.1925329566001892,
-0.0798938125371933,
-0.11711044609546661,
-0.16373655200004578,
-0.19652658700942993,
0.18409135937690735,
-0.14556185901165009,
0.2701795995235443,
-0.17334000766277313,
0.11028243601322174,
0.07111800462007523,
0.3648955225944519,
-0.4216465353965759,
0.06015510857105255,
-0.24955816566944122,
-0.026802629232406616,
0.061351172626018524,
-0.12091495096683502,
0.44999924302101135,
0.07797697186470032,
0.12798413634300232,
0.033989954739809036,
-0.14421746134757996,
-0.17723631858825684,
-0.08229786157608032,
0.09631190448999405,
-0.32248419523239136,
0.16565412282943726,
0.3879932463169098,
0.25315338373184204,
0.04008066654205322,
-0.0019474290311336517,
0.35530850291252136,
0.05246806889772415,
0.20862184464931488,
-0.0191495418548584,
0.6374322175979614,
-0.037581149488687515,
-0.00523751974105835,
0.13433997333049774,
0.007196683436632156,
0.2772565186023712,
-0.08549992740154266,
0.01971745491027832,
-0.5083624124526978,
-0.20989283919334412,
0.43841665983200073,
0.20135335624217987,
0.4412822127342224,
0.28283926844596863,
0.10255218297243118,
-0.18776626884937286,
0.032034993171691895,
0.2845877408981323,
0.45641669631004333,
-0.023573748767375946,
0.0009469017386436462,
-0.06244301795959473,
0.09957262873649597,
0.32949522137641907,
-0.20184426009655,
0.020797371864318848,
0.2984180152416229,
0.0963374599814415,
0.1890280544757843,
0.3230782747268677,
0.14364618062973022,
0.3256731629371643,
0.31688904762268066,
0.2714845538139343,
0.18772557377815247,
0.21585200726985931,
0.45020437240600586,
0.043152038007974625,
-0.12236438691616058,
-0.000047050416469573975,
0.22063128650188446,
-0.0491490364074707,
0.2839457392692566,
-0.22903861105442047,
-0.12462349981069565,
0.5235880017280579,
-0.09442266821861267,
0.29050925374031067,
0.3781961500644684,
-0.1722089648246765,
-0.059055011719465256,
0.33504223823547363,
0.17177511751651764,
-0.01964731514453888,
0.1985480785369873,
0.5843774080276489,
-0.21498528122901917,
-0.33114564418792725,
-0.2886427640914917,
0.09182979166507721,
-0.12311947345733643,
0.019047711044549942,
0.11364367604255676,
-0.20766976475715637,
-0.2830502986907959,
-0.1819784939289093,
0.05236419290304184,
0.007723867893218994,
0.3665972948074341,
-0.040649380534887314,
0.1305939257144928,
-0.2849316895008087,
-0.062143854796886444,
-0.19624432921409607,
0.503158450126648,
-0.045460063964128494,
0.19408676028251648,
-0.035778991878032684,
-0.09768186509609222,
0.2494301199913025,
0.33324456214904785,
0.11500196158885956,
0.20735350251197815,
0.2785528600215912,
-0.16380470991134644,
0.052402619272470474,
0.038775987923145294,
-0.06473209708929062,
0.016973476856946945,
-0.35150083899497986,
-0.01758965104818344,
0.2425018697977066,
0.1779434084892273,
-0.32953941822052,
0.010524681769311428,
-0.03509482368826866,
-0.05599866807460785,
0.14186698198318481,
0.32688602805137634,
-0.07957902550697327,
-0.24929802119731903,
-0.24433153867721558,
-0.054848700761795044,
-0.33805274963378906,
-0.030532341450452805,
0.0891823023557663,
-0.1270749270915985,
-0.07466120272874832,
-0.07842470705509186,
0.1331891119480133,
0.45398062467575073,
0.4078162908554077,
0.11973804235458374,
-0.026299674063920975,
-0.17875789105892181,
-0.380045622587204,
-0.22761251032352448,
0.15867160260677338,
-0.24940922856330872,
-0.09073200076818466,
0.03759247809648514,
0.17904038727283478,
-0.059842534363269806,
0.030970454216003418,
0.19427108764648438,
-0.36052677035331726,
0.24570591747760773,
-0.2508695125579834,
-0.5424090027809143,
0.00807457696646452,
-0.05134008824825287,
-0.0378732867538929,
0.07931165397167206,
-0.2058229148387909,
0.0981893390417099,
0.27960148453712463,
0.09155737608671188,
0.1936556100845337,
0.25719812512397766,
0.15179301798343658,
-0.1952970027923584,
-0.3037092983722687,
0.14127174019813538,
-0.07225054502487183,
0.027242720127105713,
-0.24974465370178223,
-0.01645476743578911,
-0.498198926448822,
-0.1584482043981552,
-0.08503095805644989,
0.17908109724521637,
0.28901389241218567,
-0.2700382471084595,
-0.17137666046619415,
-0.47353702783584595,
0.10027483850717545,
0.11698069423437119,
0.12855032086372375,
-0.1828031837940216,
0.24992921948432922,
0.20116472244262695,
-0.30967313051223755,
0.17699098587036133,
0.3937363624572754,
-0.01425105519592762,
-0.2549419105052948,
-0.08687487244606018,
-0.4229385256767273,
0.39541271328926086,
-0.18392711877822876,
-0.023744072765111923,
0.05811676010489464,
0.3095588684082031,
0.418242871761322,
-0.00384422205388546,
-0.5138297080993652,
0.04869657754898071,
0.0447310209274292,
0.04667511209845543,
-0.06965235620737076,
0.22911998629570007,
0.32120755314826965,
-0.2261853665113449,
-0.17141452431678772,
0.19280341267585754,
0.2394145429134369,
-0.3508493900299072,
0.03722122311592102,
-0.06269831210374832
] |
https://github.com/huggingface/datasets/issues/5679 | Hi ! AFAIK a dataset must be present on a local disk to be able to efficiently memory map the datasets Arrow files. What makes you think that it is possible to load from a cloud storage and have good performance ?
Anyway it's already possible to download_and_prepare a dataset as Arrow files in a cloud storage with:
```python
builder = load_dataset_builder(..., cache_dir="/temp/dir")
builder.download_and_prepare("/cloud_dir")
```
but then
```python
ds = builder.as_dataset()
```
would fail if "/cloud_dir" is not a local directory. | Allow load_dataset to take a working dir for intermediate data | ### Feature request
As a user, I can set a working dir for intermediate data creation. The processed files will be moved to the cache dir, like
```
load_dataset(…, working_dir=”/temp/dir”, cache_dir=”/cloud_dir”).
```
### Motivation
This will help the use case for using datasets with cloud storage as cache. It will help boost the performance.
### Your contribution
I can provide a PR to fix this if the proposal seems reasonable. | 81 | Allow load_dataset to take a working dir for intermediate data
### Feature request
As a user, I can set a working dir for intermediate data creation. The processed files will be moved to the cache dir, like
```
load_dataset(…, working_dir=”/temp/dir”, cache_dir=”/cloud_dir”).
```
### Motivation
This will help the use case for using datasets with cloud storage as cache. It will help boost the performance.
### Your contribution
I can provide a PR to fix this if the proposal seems reasonable.
Hi ! AFAIK a dataset must be present on a local disk to be able to efficiently memory map the datasets Arrow files. What makes you think that it is possible to load from a cloud storage and have good performance ?
Anyway it's already possible to download_and_prepare a dataset as Arrow files in a cloud storage with:
```python
builder = load_dataset_builder(..., cache_dir="/temp/dir")
builder.download_and_prepare("/cloud_dir")
```
but then
```python
ds = builder.as_dataset()
```
would fail if "/cloud_dir" is not a local directory. | [
-0.22743752598762512,
0.12301477789878845,
-0.09564196318387985,
0.038734182715415955,
0.24622029066085815,
0.15327858924865723,
0.2675952911376953,
0.1366892158985138,
0.27905985713005066,
-0.035340793430805206,
0.1501983255147934,
0.10304774343967438,
-0.23229822516441345,
0.14160697162151337,
0.1133592426776886,
-0.11755628138780594,
-0.034975163638591766,
0.11642876267433167,
-0.24796199798583984,
0.03407751023769379,
-0.2018490731716156,
-0.004995046183466911,
0.02493348717689514,
-0.22320425510406494,
-0.23469474911689758,
0.06580229103565216,
-0.03865187242627144,
0.21107472479343414,
-0.10321851074695587,
-0.2437492460012436,
0.5192106366157532,
0.04393751174211502,
0.24623912572860718,
0.38231968879699707,
-0.0001182547930511646,
0.12490791082382202,
0.23163455724716187,
-0.19038061797618866,
-0.6907698512077332,
-0.42195022106170654,
-0.21253713965415955,
-0.2247723639011383,
0.09621142596006393,
-0.13408857583999634,
0.07205274701118469,
-0.04514835774898529,
0.033119164407253265,
-0.868800163269043,
0.17194607853889465,
0.08334869891405106,
0.13676398992538452,
-0.14293208718299866,
-0.3864632248878479,
0.20061013102531433,
-0.04616154730319977,
0.249001607298851,
-0.3307214677333832,
0.4960806369781494,
0.22176770865917206,
0.01419220119714737,
0.06914383172988892,
0.1234225481748581,
-0.003539949655532837,
0.1879003345966339,
0.44957053661346436,
0.18857771158218384,
0.2493066042661667,
-0.21427655220031738,
0.09021031856536865,
0.01137174479663372,
0.9772746562957764,
-0.3732720911502838,
-0.4338309168815613,
-0.3450082540512085,
-0.1952708214521408,
-0.027088016271591187,
0.17406757175922394,
0.37401098012924194,
-0.14975321292877197,
0.25420573353767395,
-0.06008566543459892,
-0.4202061593532562,
-0.32716262340545654,
0.1657578945159912,
0.2028106451034546,
0.13492606580257416,
-0.08632632344961166,
-0.03209349513053894,
0.1831366866827011,
0.25900810956954956,
0.5547565221786499,
-0.24440401792526245,
0.13809534907341003,
0.2268408238887787,
-0.19060032069683075,
0.07417097687721252,
-0.21518142521381378,
0.06383605301380157,
0.166498064994812,
0.2474871575832367,
0.46755099296569824,
0.08081777393817902,
0.04796392098069191,
0.16238205134868622,
0.13436450064182281,
0.23181621730327606,
-0.053493987768888474,
0.09753314405679703,
0.16198864579200745,
-0.15683065354824066,
0.1117134541273117,
-0.2284279763698578,
-0.10960263758897781,
-0.25459885597229004,
0.058246299624443054,
-0.06737703830003738,
-0.04118684306740761,
0.05501487851142883,
0.19491685926914215,
0.016872037202119827,
0.2640135586261749,
-0.1095341220498085,
0.20741786062717438,
0.3825724124908447,
0.13370341062545776,
0.2013261318206787,
-0.03970959782600403,
0.31024762988090515,
0.09008973836898804,
0.2164703905582428,
0.07871353626251221,
-0.09042907506227493,
-0.11882178485393524,
0.18895164132118225,
0.33550241589546204,
-0.05963541194796562,
0.2842745780944824,
-0.2319546937942505,
0.17680269479751587,
0.18127429485321045,
0.43080371618270874,
-0.1484794020652771,
0.13574036955833435,
0.16233690083026886,
-0.12687188386917114,
0.07949598133563995,
0.030779432505369186,
0.19925642013549805,
-0.3853938579559326,
0.3170708417892456,
-0.39363589882850647,
-0.7551841735839844,
-0.2863005995750427,
0.05339716747403145,
-0.0756165161728859,
0.19397014379501343,
-0.6475657224655151,
-0.08885692059993744,
0.1337185800075531,
-0.056301865726709366,
0.1672576516866684,
0.2051900029182434,
-0.3451448380947113,
-0.22532595694065094,
0.06619205325841904,
0.405856728553772,
-0.23251740634441376,
0.04048831760883331,
-0.3447294533252716,
0.19284428656101227,
0.14481808245182037,
0.04538879543542862,
-0.29362139105796814,
0.15902724862098694,
-0.42686235904693604,
-0.07323449105024338,
0.3877626657485962,
-0.41543978452682495,
-0.4353533387184143,
0.5727726817131042,
-0.04226486384868622,
-0.1164637953042984,
0.11206913739442825,
0.3191808760166168,
-0.09494340419769287,
-0.009022489190101624,
-0.006845865398645401,
0.6371264457702637,
0.07814878225326538,
0.15321701765060425,
-0.34900224208831787,
-0.32952502369880676,
-0.026049556210637093,
0.22755254805088043,
-0.220540851354599,
0.20776644349098206,
-0.03121160715818405,
-0.11662326753139496,
0.1399562656879425,
-0.19290633499622345,
0.3382900357246399,
0.05168430507183075,
0.0005222233012318611,
-0.24086683988571167,
0.036112669855356216,
0.15055112540721893,
-0.692307710647583,
0.38044872879981995,
0.07707539200782776,
-0.2600250542163849,
-0.30843377113342285,
-0.08549347519874573,
-0.06369037181138992,
0.047396719455718994,
-0.3317740261554718,
-0.08597052097320557,
-0.045781269669532776,
-0.14837247133255005,
0.2408551424741745,
-0.2312605232000351,
-0.35796332359313965,
0.1667812019586563,
-0.031180772930383682,
-0.0877852588891983,
0.01141747459769249,
0.4649282395839691,
0.14649035036563873,
0.12803351879119873,
-0.26145321130752563,
-0.09479428827762604,
-0.16808584332466125,
-0.20167803764343262,
-0.2711919844150543,
0.29661059379577637,
-0.03533012419939041,
0.5422651767730713,
0.16074103116989136,
0.4585117697715759,
0.08551286160945892,
0.016464628279209137,
0.3110208511352539,
-0.02719707041978836,
0.1262095868587494,
0.0804135650396347,
-0.2572963237762451,
0.5204603672027588,
-0.43109145760536194,
0.24993649125099182,
0.006601184606552124,
-0.06918414682149887,
0.04780197888612747,
0.05051916092634201,
0.090418241918087,
-0.1775943785905838,
0.2424190640449524,
-0.00804596021771431,
0.5876574516296387,
-0.009121590293943882,
-0.10670799762010574,
0.03248068690299988,
-0.2625787854194641,
0.0808255597949028,
0.24957896769046783,
0.29439786076545715,
0.10022648423910141,
-0.18413186073303223,
0.2148410826921463,
0.3008963465690613,
0.6105501651763916,
0.08960004150867462,
0.18448084592819214,
-0.16959567368030548,
0.28080594539642334,
-0.2703498601913452,
0.32937750220298767,
-0.15881375968456268,
0.2958327829837799,
0.34272146224975586,
0.08941516280174255,
-0.19047416746616364,
-0.18298503756523132,
-0.01856069266796112,
0.15498283505439758,
0.1860606074333191,
-0.12146048247814178,
0.08382626622915268,
0.06349106132984161,
-0.2962777614593506,
-0.14920172095298767,
-0.16369177401065826,
0.2114008665084839,
-0.06767246872186661,
-0.02676999196410179,
0.30162084102630615,
-0.1160714253783226,
-0.019404780119657516,
-0.3733645975589752,
0.27570366859436035,
-0.20174503326416016,
-0.7043771147727966,
-0.5779623985290527,
0.10260017216205597,
0.23973365128040314,
-0.022673649713397026,
0.3810652196407318,
0.025109071284532547,
0.043993718922138214,
0.11785775423049927,
-0.03696875274181366,
-0.5061226487159729,
0.166875958442688,
0.07085247337818146,
0.2741013765335083,
0.4430791437625885,
0.16375571489334106,
0.21592259407043457,
0.023731820285320282,
-0.027935856953263283,
0.15829400718212128,
-0.14672087132930756,
-0.0042399875819683075,
-0.07102242112159729,
0.09101679921150208,
0.24861614406108856,
-0.21023248136043549,
-0.09624922275543213,
-0.4074426591396332,
-0.40546178817749023,
0.12650452554225922,
0.06873725354671478,
0.26666849851608276,
-0.2964491546154022,
0.16385185718536377,
-0.2667599618434906,
0.4916728138923645,
-0.20952272415161133,
-0.12814658880233765,
-0.7722318172454834,
0.2940528094768524,
-0.34120574593544006,
0.076758474111557,
-0.16951940953731537,
-0.2735919952392578,
0.473172664642334,
0.09537288546562195,
-0.38283899426460266,
-0.17866027355194092,
-0.11679022759199142,
0.44414132833480835,
-0.25618135929107666,
-0.07040977478027344,
0.3644758462905884,
0.15968818962574005,
0.06316453963518143,
-0.04999053478240967,
-0.022059019654989243,
-0.0864381194114685,
0.18897753953933716,
-0.0392303466796875,
0.3295237421989441,
0.07591670006513596,
0.17686159908771515,
1.0026650428771973,
-0.12412726879119873,
0.18427154421806335,
0.4372491240501404,
-0.016564739868044853,
0.09018522500991821,
-0.27488499879837036,
-0.18107905983924866,
-0.03255751356482506,
-0.20559117197990417,
-0.4491591453552246,
0.05441535264253616,
0.2314748764038086,
-0.1847747564315796,
-0.0584704726934433,
-0.15103405714035034,
-0.2377614974975586,
-0.05671471357345581,
0.2938302755355835,
-0.5103667974472046,
0.23111005127429962,
-0.05636908859014511,
-0.10002502799034119,
-0.24648216366767883,
-0.01846974343061447,
0.041809167712926865,
0.1732819676399231,
0.4650995135307312,
0.028818264603614807,
0.15132874250411987,
0.13568128645420074,
-0.5222398042678833,
0.18888629972934723,
0.22167281806468964,
0.03132360428571701,
0.04848715662956238,
0.11190871894359589,
0.10723138600587845,
-0.01121911033987999,
0.47462114691734314,
-0.360049307346344,
0.00499327527359128,
-0.12959861755371094,
-0.04478340223431587,
-0.3129703998565674,
0.11233463138341904,
0.470975399017334,
0.19381573796272278,
-0.2486809492111206,
0.21124252676963806,
-0.10050877928733826,
-0.21550613641738892,
-0.38772183656692505,
0.15944795310497284,
-0.1414322555065155,
-0.20308484137058258,
-0.157013937830925,
-0.1402970850467682,
-0.370852530002594,
-0.07510463893413544,
0.07929456233978271,
-0.151847243309021,
0.03430873900651932,
0.11925056576728821,
-0.16590847074985504,
0.15393072366714478,
-0.08236142992973328,
-0.17885762453079224,
0.3050968050956726,
-0.2182382345199585,
0.26131993532180786,
0.34156081080436707,
0.025303686037659645,
0.4455573260784149,
0.7447396516799927,
-0.09170996397733688,
0.18686440587043762,
0.12638936936855316,
0.14573968946933746,
0.23788020014762878,
0.317801833152771,
-0.17319266498088837,
0.022382233291864395,
-0.03889407962560654,
-0.067969411611557,
-0.4452417492866516,
-0.08933670818805695,
-0.0982789471745491,
-0.018942326307296753,
-0.12432935833930969,
-0.6471702456474304,
0.8159909248352051,
0.10130298137664795,
-0.20012831687927246,
0.24924905598163605,
-0.21585704386234283,
-0.34394779801368713,
0.3523311913013458,
0.26342707872390747,
0.7938355803489685,
-0.04549470543861389,
0.40579840540885925,
-0.11313402652740479,
-0.075045645236969,
0.0029002390801906586,
-0.2703673839569092,
0.07194679975509644,
-0.21921764314174652,
-0.06689254939556122,
-0.2328033447265625,
-0.3067549169063568,
-0.022080760449171066,
0.15899242460727692,
-0.18603509664535522,
0.18945136666297913,
-0.2242252230644226,
-0.12331375479698181,
-0.06254443526268005,
0.36323487758636475,
-0.5544347167015076,
-0.4543733596801758,
-0.10015732049942017,
0.04399382323026657,
0.14465254545211792,
0.1233363077044487,
-0.1120682954788208,
-0.19877997040748596,
-0.1807490885257721,
-0.0038894489407539368,
0.06857381761074066,
-0.008309029042720795,
-0.2844248414039612,
0.19940851628780365,
-0.29744815826416016,
-0.27751636505126953,
0.22086629271507263,
0.32911384105682373,
0.13819535076618195,
-0.18976838886737823,
-0.30303168296813965,
0.07157479971647263,
0.0678369402885437,
0.2083975225687027,
-0.04290499538183212,
-0.27853918075561523,
0.015284759923815727,
-0.18187686800956726,
-0.002066180109977722,
-0.19743295013904572,
-0.2271418273448944,
-0.5185936093330383,
-0.19141916930675507,
-0.043334104120731354,
0.3238489031791687,
-0.06593509018421173,
-0.3638363182544708,
0.06572738289833069,
-0.20392361283302307,
-0.07286042720079422,
0.0603264644742012,
0.1989651918411255,
0.12120941281318665,
0.06403253972530365,
-0.16190169751644135,
-0.04446636885404587,
-0.08294440805912018,
0.17221739888191223,
0.03801814839243889,
0.09573590755462646,
0.4149989187717438,
-0.23676010966300964,
-0.11913445591926575,
-0.13210156559944153,
0.13481269776821136,
0.08471520245075226,
-0.24710555374622345,
0.1461244374513626,
0.014553721994161606,
0.00760863721370697,
-0.137446790933609,
0.06673355400562286,
0.35194796323776245,
0.05275854840874672,
-0.12757617235183716,
-0.2464432418346405,
-0.33049246668815613,
0.24651841819286346,
-0.07332881540060043,
0.3122176229953766,
-0.18106196820735931,
-0.15324318408966064,
0.06907038390636444,
0.031044134870171547,
-0.23020291328430176,
0.2597824037075043,
0.12843403220176697,
-0.02199043706059456,
-0.0013647843152284622,
0.2873574495315552,
0.1350821852684021,
-0.1862408071756363,
-0.07610777020454407,
-0.04696528613567352,
-0.20375129580497742,
-0.08966927230358124,
-0.04056980460882187,
0.2185390740633011,
0.001840684562921524,
-0.15606796741485596,
-0.08780653029680252,
-0.3355890214443207,
-0.120481476187706,
-0.12452344596385956,
-0.04784046858549118,
0.22789455950260162,
-0.2648374140262604,
0.03198922052979469,
0.05343569442629814,
0.03799568861722946,
-0.48688364028930664,
0.14703021943569183,
-0.03366289287805557,
0.24996231496334076,
-0.23775646090507507,
0.33661341667175293,
-0.00819740816950798,
-0.08452719449996948,
0.15507228672504425,
0.010154295712709427,
0.14198455214500427,
0.19780407845973969,
0.2832512855529785,
-0.11868445575237274,
0.017928466200828552,
-0.08855488151311874,
0.3641160726547241,
0.09212076663970947,
-0.12103520333766937,
0.09021031111478806,
0.25917983055114746,
0.14230065047740936,
-0.10994592308998108,
-0.2667224705219269,
-0.25210559368133545,
-0.1098012626171112,
0.040665969252586365,
0.28971296548843384,
0.6499097943305969,
0.009328022599220276,
-0.22942674160003662,
0.030522994697093964,
0.10479001700878143,
-0.3923461437225342,
0.005226802080869675,
0.13395152986049652,
-0.021407216787338257,
0.10377578437328339,
0.17043934762477875,
0.20213940739631653,
0.2828887104988098,
0.36650052666664124,
-0.2152082324028015,
0.2980741262435913,
0.4578254520893097,
0.1275039166212082,
-0.3213053345680237,
-0.21923205256462097,
0.04268283396959305,
0.011607430875301361,
-0.06388941407203674,
0.2807961702346802,
0.03648234158754349,
0.4438542425632477,
-0.03687820956110954,
-0.1610044687986374,
-0.14109820127487183,
-0.1811433732509613,
0.01757494919002056,
-0.2671259939670563,
-0.2233680635690689,
-0.26491254568099976,
0.0041631609201431274,
0.031910642981529236,
-0.14003269374370575,
-0.24803388118743896,
0.25576508045196533,
0.18139095604419708,
0.29580622911453247,
-0.021527595818042755,
0.4476083815097809,
0.5342226624488831,
0.23434002697467804,
-0.20828095078468323,
0.11019355803728104,
-0.041762374341487885,
-0.18316125869750977,
-0.045877981930971146,
0.09292995929718018,
0.36265110969543457,
0.25383976101875305,
-0.12421576678752899,
0.02281489595770836,
0.03214946389198303,
0.08185534179210663,
-0.17146217823028564,
0.2373734712600708,
0.09998034685850143,
-0.16191856563091278,
0.2618215084075928,
0.12355636060237885,
-0.06714405864477158,
0.37749791145324707,
0.04958061873912811,
0.2036709189414978,
-0.2742674648761749,
0.014606628566980362,
0.23074108362197876,
-0.114329993724823,
0.1449584811925888,
0.11950580775737762,
-0.04780076816678047,
0.01873708888888359,
0.3684188425540924,
-0.28568899631500244,
-0.008525125682353973,
0.03506835177540779,
0.0036418773233890533,
0.18481887876987457,
0.5370985865592957,
0.21170420944690704,
0.251588374376297,
-0.4882550835609436,
-0.10503566265106201,
-0.4358046054840088,
-0.20867636799812317,
0.006162402220070362,
0.25633394718170166,
-0.029731007292866707,
0.15272468328475952,
0.2214651256799698,
0.31011664867401123,
-0.1455872654914856,
-0.19008080661296844,
0.07080189883708954,
0.4097822904586792,
-0.1796564757823944,
-0.02965550124645233,
-0.024696987122297287,
0.46970805525779724,
0.014428451657295227,
-0.7503339648246765,
-0.08616523444652557,
-0.06868180632591248,
-0.020022615790367126,
0.030678346753120422,
0.15456438064575195,
0.2584756910800934,
0.18456335365772247,
0.5525472164154053,
-0.04120882228016853,
0.03326817601919174,
-0.0458393432199955,
0.06435972452163696,
-0.20807522535324097,
-0.27116918563842773,
-0.09574727714061737,
-0.05351030454039574,
0.17660632729530334,
0.32976943254470825,
-0.43714579939842224,
0.008222267962992191,
-0.5466210246086121,
-0.13922035694122314,
0.21052196621894836,
0.21792003512382507,
-0.04344522953033447,
0.07142159342765808,
-0.2661588191986084,
0.15579204261302948,
-0.08852165937423706,
0.22296641767024994,
-0.1061064749956131,
0.07898522168397903,
-0.28525060415267944,
-0.08385463058948517,
0.41913312673568726,
-0.006444733589887619,
-0.12006926536560059,
0.0640779435634613,
0.1699400693178177,
0.3331584930419922,
0.09696430712938309,
-0.3220711052417755,
-0.051539793610572815,
0.30436617136001587,
-0.06823529303073883,
0.1273786425590515,
0.14240700006484985,
0.1906605362892151,
0.009862065315246582,
-0.16625873744487762,
0.46205654740333557,
-0.1586400270462036,
-0.22083589434623718,
-0.2357894480228424,
-0.43391913175582886
] |
https://github.com/huggingface/datasets/issues/5679 | In my use case, I am trying to mount the S3 bucket as local system with S3FS-FUSE / [goofys](https://github.com/kahing/goofys). I want to use S3 to save the download data and save checkpoint for training for persistent. Setting the s3 location as cache directory is not fast enough. That is why I want to set a work directory for temp data for memory map and only save the final result to s3 cache. | Allow load_dataset to take a working dir for intermediate data | ### Feature request
As a user, I can set a working dir for intermediate data creation. The processed files will be moved to the cache dir, like
```
load_dataset(…, working_dir=”/temp/dir”, cache_dir=”/cloud_dir”).
```
### Motivation
This will help the use case for using datasets with cloud storage as cache. It will help boost the performance.
### Your contribution
I can provide a PR to fix this if the proposal seems reasonable. | 72 | Allow load_dataset to take a working dir for intermediate data
### Feature request
As a user, I can set a working dir for intermediate data creation. The processed files will be moved to the cache dir, like
```
load_dataset(…, working_dir=”/temp/dir”, cache_dir=”/cloud_dir”).
```
### Motivation
This will help the use case for using datasets with cloud storage as cache. It will help boost the performance.
### Your contribution
I can provide a PR to fix this if the proposal seems reasonable.
In my use case, I am trying to mount the S3 bucket as local system with S3FS-FUSE / [goofys](https://github.com/kahing/goofys). I want to use S3 to save the download data and save checkpoint for training for persistent. Setting the s3 location as cache directory is not fast enough. That is why I want to set a work directory for temp data for memory map and only save the final result to s3 cache. | [
-0.2566339671611786,
0.023805156350135803,
-0.053285229951143265,
0.0076834531500935555,
0.3601284921169281,
0.07705654948949814,
0.29493626952171326,
0.07726917415857315,
0.20917001366615295,
0.01784486696124077,
-0.18246030807495117,
0.20428483188152313,
-0.2562048137187958,
0.2634580433368683,
0.030520949512720108,
0.25218665599823,
-0.09178687632083893,
0.1060556024312973,
-0.2470424622297287,
0.18000543117523193,
-0.2257952094078064,
0.05634135752916336,
0.08248130977153778,
-0.19678515195846558,
-0.1477000117301941,
0.16032260656356812,
-0.022098980844020844,
0.21495667099952698,
0.017342593520879745,
-0.1566932201385498,
0.5155801177024841,
0.2106066644191742,
0.2644299268722534,
0.5266085267066956,
-0.00011865398846566677,
0.025957554578781128,
0.21806049346923828,
-0.31576666235923767,
-0.6361623406410217,
-0.4789704382419586,
-0.4414730370044708,
-0.05091586709022522,
-0.10748130083084106,
-0.0741460993885994,
-0.017055504024028778,
0.23909664154052734,
0.23915062844753265,
-0.7160839438438416,
0.19908204674720764,
0.029774390161037445,
0.1132577657699585,
-0.281563937664032,
-0.669217586517334,
0.21428047120571136,
0.2133878469467163,
0.3205973505973816,
-0.302715539932251,
0.5107958316802979,
0.08789001405239105,
-0.04140721261501312,
0.17386727035045624,
0.022686835378408432,
-0.13803771138191223,
0.1650414764881134,
0.3501236140727997,
0.19130373001098633,
0.1675882488489151,
-0.09213798493146896,
0.1727830320596695,
0.12059833109378815,
0.8573073148727417,
-0.49878743290901184,
-0.38925108313560486,
-0.24655114114284515,
-0.19849039614200592,
-0.0567391961812973,
0.23484830558300018,
0.1483738273382187,
-0.0067261941730976105,
0.23074735701084137,
-0.15579578280448914,
-0.3744381368160248,
-0.22357304394245148,
0.267132043838501,
0.1246296614408493,
0.0899357795715332,
-0.27053090929985046,
-0.09717592597007751,
0.21638387441635132,
0.2810719609260559,
0.6635522842407227,
-0.30469292402267456,
0.1251835972070694,
0.11086364090442657,
-0.2055944949388504,
-0.006057292222976685,
-0.2567552924156189,
0.06961362063884735,
0.07155973464250565,
0.17793425917625427,
0.30577850341796875,
0.07243463397026062,
0.06516806781291962,
0.159707173705101,
-0.01068729255348444,
0.05378078669309616,
0.20414330065250397,
0.10315021872520447,
0.18977417051792145,
-0.038582924753427505,
0.21558788418769836,
-0.2803477346897125,
-0.10776759684085846,
-0.2693783938884735,
0.03233499079942703,
0.08011312782764435,
-0.0013799071311950684,
0.12017534673213959,
0.2791258692741394,
-0.08817538619041443,
0.2011193335056305,
-0.09659861028194427,
0.27741339802742004,
0.38776057958602905,
0.015252944082021713,
-0.06336916238069534,
-0.20987121760845184,
0.2817509174346924,
0.13308942317962646,
0.4012920558452606,
0.07469093799591064,
-0.017655327916145325,
-0.20440572500228882,
0.2773618996143341,
0.42029279470443726,
-0.13833877444267273,
0.30486002564430237,
-0.18063165247440338,
-0.03153129294514656,
0.16272634267807007,
0.4152664542198181,
-0.1692867875099182,
0.3316490352153778,
0.10209265351295471,
0.03700567036867142,
0.2905290126800537,
-0.3121636211872101,
0.2330312728881836,
-0.37460213899612427,
0.2998288571834564,
-0.34710195660591125,
-0.7197084426879883,
-0.0895877406001091,
0.003100696951150894,
-0.17101901769638062,
0.21875374019145966,
-0.4497528672218323,
-0.061052002012729645,
0.28338414430618286,
-0.1490834355354309,
0.25013554096221924,
0.30805283784866333,
-0.5076961517333984,
-0.22719481587409973,
0.14209270477294922,
0.43718230724334717,
-0.03990983963012695,
-0.011175215244293213,
-0.2616334855556488,
0.2298186719417572,
0.09171240776777267,
-0.07764233648777008,
-0.018594985827803612,
0.09633788466453552,
-0.48622697591781616,
0.13194195926189423,
0.25005465745925903,
-0.4107826054096222,
-0.4515973925590515,
0.5087195038795471,
0.025593213737010956,
-0.2319805771112442,
0.08671726286411285,
0.3608141541481018,
-0.053376246243715286,
-0.1590183973312378,
-0.1656101793050766,
0.5845005512237549,
0.10121195018291473,
0.16281133890151978,
-0.16437537968158722,
-0.2916567623615265,
-0.10499763488769531,
0.11998005211353302,
-0.20313534140586853,
0.21259476244449615,
-0.011420968919992447,
0.10728201270103455,
0.04343016818165779,
-0.06375224888324738,
0.4499368369579315,
0.060772284865379333,
0.14437319338321686,
-0.15110039710998535,
-0.14509744942188263,
0.019022241234779358,
-0.6508795619010925,
0.22405460476875305,
0.1919032335281372,
-0.37063825130462646,
-0.17770785093307495,
-0.090794138610363,
-0.038659222424030304,
-0.22545737028121948,
-0.29379719495773315,
-0.15197333693504333,
-0.016160357743501663,
-0.0036689862608909607,
0.1980881690979004,
-0.2746095657348633,
-0.12600331008434296,
0.21091477572917938,
0.06836250424385071,
-0.13753418624401093,
-0.09755944460630417,
0.41525065898895264,
0.12845373153686523,
0.002180393785238266,
-0.3054373264312744,
-0.10980723798274994,
-0.09956404566764832,
-0.29372549057006836,
-0.1714172214269638,
0.4069366753101349,
0.166701540350914,
0.5653426051139832,
0.11507146060466766,
0.6287973523139954,
-0.018923593685030937,
0.1740027666091919,
0.16185112297534943,
-0.28701290488243103,
0.028505384922027588,
0.04204182326793671,
-0.2493162900209427,
0.36889320611953735,
-0.5166047811508179,
0.11793510615825653,
-0.11578042805194855,
-0.2310766577720642,
-0.02294011414051056,
-0.17062941193580627,
0.09689807146787643,
-0.16461245715618134,
0.18616759777069092,
0.1299569010734558,
0.2424776554107666,
-0.07041060924530029,
0.029450133442878723,
-0.0882345587015152,
-0.14876089990139008,
-0.017284609377384186,
0.2649240791797638,
0.22348612546920776,
0.1392097920179367,
-0.17832159996032715,
0.20586180686950684,
0.3573160767555237,
0.6865807175636292,
0.0630258321762085,
0.34857386350631714,
-0.13753511011600494,
0.31415852904319763,
-0.21063555777072906,
0.3603248596191406,
-0.15069331228733063,
0.31122463941574097,
0.4149273931980133,
0.14206652343273163,
-0.1945209503173828,
0.0015689656138420105,
0.16601069271564484,
0.21766583621501923,
0.13592122495174408,
-0.2241518497467041,
0.0632050409913063,
-0.005973994731903076,
-0.38835832476615906,
0.05508173257112503,
-0.06747274100780487,
0.14725874364376068,
-0.003037523478269577,
-0.10545472800731659,
0.46809422969818115,
0.0027779191732406616,
0.1923379898071289,
-0.028460711240768433,
0.19061721861362457,
-0.22221769392490387,
-0.6072366833686829,
-0.6948976516723633,
0.12921923398971558,
0.19442497193813324,
-0.01150999590754509,
0.33375290036201477,
-0.12217433750629425,
0.03342868387699127,
-0.012802433222532272,
-0.11239726841449738,
-0.49131742119789124,
0.07956771552562714,
0.15778906643390656,
0.2852603793144226,
0.5130855441093445,
0.33478623628616333,
0.3202098608016968,
0.03255520761013031,
0.08812720328569412,
0.07884504646062851,
-0.2959677278995514,
-0.06352628022432327,
-0.10411693155765533,
-0.03915899619460106,
0.45874500274658203,
-0.3440242409706116,
0.029104571789503098,
-0.14725160598754883,
-0.44527941942214966,
0.10059035569429398,
-0.1532297432422638,
0.18266776204109192,
-0.14335766434669495,
0.059616703540086746,
-0.22530563175678253,
0.39988821744918823,
-0.33290165662765503,
-0.3299180567264557,
-0.7973428964614868,
0.325750470161438,
-0.3680244982242584,
0.2222231924533844,
-0.19028377532958984,
-0.24102626740932465,
0.521820604801178,
0.09304507821798325,
-0.32374677062034607,
-0.37056753039360046,
0.05933256447315216,
0.38983866572380066,
-0.30170029401779175,
-0.015166583471000195,
0.39566612243652344,
0.026890669018030167,
0.0995003879070282,
-0.13364188373088837,
-0.13118880987167358,
-0.07289987802505493,
0.2875785231590271,
0.1410100907087326,
0.3003469407558441,
0.14230823516845703,
0.33446407318115234,
0.7753294706344604,
-0.11831379681825638,
0.09678420424461365,
0.40389981865882874,
-0.0426502525806427,
0.23485738039016724,
-0.14694002270698547,
-0.10820606350898743,
-0.09314168989658356,
-0.1574268788099289,
-0.28672999143600464,
0.10476054251194,
0.11084245145320892,
-0.1548868715763092,
-0.06776629388332367,
-0.23216894268989563,
-0.3075311779975891,
-0.01499253511428833,
0.2005646973848343,
-0.38514167070388794,
0.19322733581066132,
-0.05833432823419571,
-0.16843362152576447,
-0.18284498155117035,
-0.19137494266033173,
0.22916698455810547,
0.3279746174812317,
0.37362486124038696,
0.1065191775560379,
0.28680214285850525,
0.21167059242725372,
-0.4941452145576477,
0.17150741815567017,
0.21919573843479156,
-0.021869612857699394,
0.02064508944749832,
0.199472576379776,
0.011088922619819641,
0.04640236496925354,
0.702163577079773,
-0.6596312522888184,
0.050055403262376785,
-0.2755579948425293,
-0.0825498104095459,
-0.2194187343120575,
0.10515107214450836,
0.295146107673645,
0.1789311319589615,
0.06932072341442108,
0.3020247220993042,
-0.14678198099136353,
-0.13824665546417236,
-0.45410048961639404,
-0.12918853759765625,
-0.00644693523645401,
-0.37381577491760254,
-0.022099874913692474,
-0.1212366372346878,
-0.3361237049102783,
-0.17684610188007355,
0.1845637857913971,
-0.28424501419067383,
0.203278586268425,
0.07853464782238007,
-0.009982118383049965,
0.17902909219264984,
0.061134565621614456,
-0.20035047829151154,
0.07026161998510361,
0.11211998760700226,
0.24629801511764526,
0.3736935555934906,
-0.22225257754325867,
0.3538520634174347,
0.5116066336631775,
-0.18033242225646973,
0.3613678514957428,
0.3241029679775238,
0.15137261152267456,
0.3476719856262207,
0.23106375336647034,
-0.08536000549793243,
-0.012164294719696045,
-0.19563278555870056,
-0.14876365661621094,
-0.5370633602142334,
0.15015868842601776,
-0.04705557972192764,
0.10868306457996368,
-0.07596549391746521,
-0.5124983191490173,
0.49546074867248535,
0.0871332436800003,
-0.2472614347934723,
0.1764175295829773,
-0.44166722893714905,
-0.4523117244243622,
0.2594102621078491,
0.2745642364025116,
0.8144899606704712,
-0.07852217555046082,
0.3664940893650055,
-0.13180920481681824,
-0.2717224359512329,
0.056580521166324615,
-0.3056239187717438,
0.020227354019880295,
-0.2574729323387146,
-0.07405024766921997,
-0.18373462557792664,
-0.34850186109542847,
-0.20073306560516357,
0.18867382407188416,
-0.2787923812866211,
0.10837072879076004,
-0.0740986242890358,
0.053705696016550064,
-0.16002553701400757,
0.27073490619659424,
-0.47676828503608704,
-0.43291395902633667,
0.030201278626918793,
0.028593212366104126,
-0.0012925304472446442,
0.15722332894802094,
-0.063251793384552,
-0.19058284163475037,
-0.12722104787826538,
0.17236095666885376,
0.07780304551124573,
-0.0013752952218055725,
-0.25554025173187256,
0.09530047327280045,
-0.3584690988063812,
-0.08866006135940552,
0.12176735699176788,
0.24341708421707153,
0.21795910596847534,
-0.05567914992570877,
-0.22256208956241608,
-0.03680283576250076,
0.1979447901248932,
0.23417700827121735,
-0.14207372069358826,
-0.34926721453666687,
-0.1104046031832695,
-0.02339646965265274,
0.10686710476875305,
-0.22360330820083618,
0.058627136051654816,
-0.2527717351913452,
-0.09980281442403793,
-0.20209620893001556,
0.20366795361042023,
-0.2568940222263336,
-0.25805801153182983,
0.00845346786081791,
-0.020672667771577835,
-0.03420259803533554,
0.05619589239358902,
0.1550169289112091,
0.21046176552772522,
0.009022427722811699,
-0.4522079825401306,
-0.017467260360717773,
-0.1856444925069809,
0.310639888048172,
-0.08069077134132385,
0.29977932572364807,
0.24867144227027893,
-0.21664100885391235,
-0.11270709335803986,
-0.09253348410129547,
0.1471014767885208,
-0.06965760141611099,
-0.0891665667295456,
0.152906134724617,
-0.016984619200229645,
-0.26820459961891174,
-0.10475149005651474,
-0.13571952283382416,
0.28261998295783997,
0.07987646758556366,
0.029230937361717224,
-0.15934699773788452,
-0.24476760625839233,
0.07226355373859406,
-0.03508191555738449,
0.5028843879699707,
-0.07176195830106735,
-0.030519643798470497,
-0.002732492983341217,
0.0670398622751236,
-0.21924610435962677,
0.16368991136550903,
0.07839176058769226,
0.07386493682861328,
0.06272416561841965,
0.1324281394481659,
0.17264431715011597,
-0.27892836928367615,
-0.0982537716627121,
0.10395864397287369,
-0.28321290016174316,
-0.07796186953783035,
-0.1578071415424347,
0.210307776927948,
0.07016704976558685,
-0.11004798114299774,
-0.022845245897769928,
-0.18343448638916016,
-0.13665184378623962,
-0.2716641426086426,
-0.13544759154319763,
0.45674610137939453,
-0.15849488973617554,
0.2870836555957794,
0.03278125450015068,
-0.08721476793289185,
-0.3734380006790161,
0.07279349863529205,
-0.12118593603372574,
0.03860832750797272,
-0.30868276953697205,
0.5066258907318115,
-0.04763919860124588,
-0.040227435529232025,
-0.0007977001368999481,
-0.027964003384113312,
0.3043232560157776,
0.126942977309227,
0.2011008858680725,
0.0603332556784153,
-0.08748473227024078,
-0.04549011215567589,
0.2898285984992981,
-0.09451514482498169,
-0.16853943467140198,
-0.059985093772411346,
0.20939669013023376,
0.07717693597078323,
0.05468694865703583,
-0.16345477104187012,
-0.2461819350719452,
-0.23255684971809387,
0.008957937359809875,
0.3312615156173706,
0.4157222509384155,
0.08876655995845795,
-0.05641769617795944,
-0.018969394266605377,
0.1056562066078186,
-0.43214553594589233,
-0.04035009816288948,
0.014525563456118107,
-0.11873293668031693,
0.05390249937772751,
0.3712078630924225,
0.13138464093208313,
0.16872283816337585,
0.2681388258934021,
0.14398223161697388,
0.2849155366420746,
0.07256737351417542,
0.22648727893829346,
-0.24124306440353394,
-0.3361392915248871,
-0.10358119755983353,
-0.0352931022644043,
-0.2990707457065582,
0.2721419632434845,
0.025683589279651642,
0.23430553078651428,
-0.057759590446949005,
-0.03694503754377365,
-0.052360836416482925,
-0.07956557720899582,
-0.02560645155608654,
-0.360617458820343,
-0.04007318243384361,
-0.14398570358753204,
0.11183087527751923,
-0.05981273204088211,
0.017883872613310814,
-0.18467840552330017,
0.3620315194129944,
0.14200669527053833,
0.36027535796165466,
0.21837837994098663,
0.36195069551467896,
0.4042639434337616,
0.13828012347221375,
-0.28026819229125977,
0.0970001071691513,
-0.36860111355781555,
-0.12279200553894043,
-0.11921717971563339,
0.055775657296180725,
0.3114576041698456,
0.13109055161476135,
0.022827118635177612,
-0.02506914548575878,
0.19218683242797852,
0.048128217458724976,
-0.20164024829864502,
0.29883506894111633,
0.13654768466949463,
-0.14112187922000885,
0.23007717728614807,
0.12337473779916763,
-0.07356645166873932,
0.28651857376098633,
0.03086989000439644,
-0.04779493808746338,
-0.05512748286128044,
-0.06523554027080536,
0.4370701014995575,
-0.09106612205505371,
0.30979159474372864,
0.17996513843536377,
-0.039216190576553345,
0.11741341650485992,
0.2410888671875,
-0.31223660707473755,
0.15141066908836365,
0.044806525111198425,
0.004599381238222122,
0.13719552755355835,
0.48353004455566406,
-0.009299378842115402,
0.16271720826625824,
-0.4759613275527954,
-0.03377614915370941,
-0.2358734905719757,
-0.2140892744064331,
0.22771623730659485,
0.3570740520954132,
-0.15066422522068024,
0.051001906394958496,
0.20887038111686707,
0.08313024044036865,
-0.26230525970458984,
-0.10848876088857651,
0.06689255684614182,
0.34812143445014954,
-0.10517644882202148,
-0.18269097805023193,
-0.10118061304092407,
0.32472023367881775,
0.16982947289943695,
-0.5752511024475098,
-0.1911575347185135,
0.013435866683721542,
-0.004619717597961426,
-0.021141016855835915,
0.09518274664878845,
0.24611839652061462,
0.2732687294483185,
0.5206139087677002,
0.036402247846126556,
-0.016926687210798264,
-0.2893941402435303,
0.14817586541175842,
-0.06332501769065857,
-0.20997413992881775,
-0.05524006485939026,
-0.14426720142364502,
0.08704162389039993,
0.2383933663368225,
-0.525100588798523,
-0.011813396587967873,
-0.5777365565299988,
-0.1431625783443451,
0.21848754584789276,
0.36051926016807556,
0.1043570414185524,
0.09320508688688278,
-0.3100988566875458,
0.30486854910850525,
-0.11042483896017075,
0.23181059956550598,
-0.09042782336473465,
0.20339824259281158,
-0.38518190383911133,
-0.0935315489768982,
0.43997785449028015,
-0.10593408346176147,
-0.14485342800617218,
-0.013992507010698318,
0.2423442155122757,
0.16801293194293976,
0.08532857894897461,
-0.3779563307762146,
0.05357028543949127,
0.35233163833618164,
-0.08945391327142715,
0.06491987407207489,
0.2002643495798111,
0.1032932698726654,
0.131639763712883,
-0.12504984438419342,
0.5126025676727295,
0.05880073085427284,
-0.36363306641578674,
-0.11975604295730591,
-0.3750903010368347
] |
https://github.com/huggingface/datasets/issues/5679 | You can try setting `HF_DATASETS_DOWNLOADED_DATASETS_PATH` and `HF_DATASETS_EXTRACTED_DATASETS_PATH` to S3, and `HF_DATASETS_CACHE` to your local disk.
This way all your downloaded and extracted data are on your mounted S3, but the datasets Arrow files are on your local disk | Allow load_dataset to take a working dir for intermediate data | ### Feature request
As a user, I can set a working dir for intermediate data creation. The processed files will be moved to the cache dir, like
```
load_dataset(…, working_dir=”/temp/dir”, cache_dir=”/cloud_dir”).
```
### Motivation
This will help the use case for using datasets with cloud storage as cache. It will help boost the performance.
### Your contribution
I can provide a PR to fix this if the proposal seems reasonable. | 38 | Allow load_dataset to take a working dir for intermediate data
### Feature request
As a user, I can set a working dir for intermediate data creation. The processed files will be moved to the cache dir, like
```
load_dataset(…, working_dir=”/temp/dir”, cache_dir=”/cloud_dir”).
```
### Motivation
This will help the use case for using datasets with cloud storage as cache. It will help boost the performance.
### Your contribution
I can provide a PR to fix this if the proposal seems reasonable.
You can try setting `HF_DATASETS_DOWNLOADED_DATASETS_PATH` and `HF_DATASETS_EXTRACTED_DATASETS_PATH` to S3, and `HF_DATASETS_CACHE` to your local disk.
This way all your downloaded and extracted data are on your mounted S3, but the datasets Arrow files are on your local disk | [
-0.19982753694057465,
0.03733693063259125,
-0.08418058604001999,
0.1201605424284935,
0.2349478006362915,
-0.006300181150436401,
0.28975820541381836,
0.13399635255336761,
0.19774851202964783,
0.10961408913135529,
-0.2626340687274933,
0.25090765953063965,
0.010908156633377075,
0.2295624315738678,
-0.12119348347187042,
0.20294979214668274,
-0.027441538870334625,
0.13327069580554962,
-0.29233524203300476,
-0.019715458154678345,
-0.17055489122867584,
0.13525117933750153,
0.16135574877262115,
-0.12638092041015625,
-0.0034781694412231445,
0.1800357848405838,
-0.03186102584004402,
0.19090881943702698,
0.06842271983623505,
-0.23581698536872864,
0.4824615716934204,
0.36709949374198914,
0.3219921290874481,
0.6125143766403198,
-0.00010602775728330016,
0.004781670868396759,
0.2265394926071167,
-0.14426948130130768,
-0.6671948432922363,
-0.2942490577697754,
-0.2648898959159851,
-0.05967319756746292,
0.033839985728263855,
-0.058777421712875366,
-0.07675892114639282,
-0.028792085126042366,
-0.12502402067184448,
-0.6358686685562134,
0.20179060101509094,
-0.08280125260353088,
0.26189935207366943,
0.01149854063987732,
-0.5896447896957397,
-0.027622323483228683,
0.36721229553222656,
0.3043384850025177,
-0.3206941485404968,
0.3836522400379181,
0.013670144602656364,
0.046135202050209045,
0.09030771255493164,
0.3898624777793884,
-0.023579001426696777,
0.3740692734718323,
0.44526559114456177,
0.08319998532533646,
-0.0005994345992803574,
-0.06117795780301094,
0.08355560898780823,
0.25505203008651733,
0.7910892367362976,
-0.2962782382965088,
-0.533476710319519,
-0.3882112205028534,
-0.26720505952835083,
-0.14467482268810272,
0.3215692937374115,
0.019037507474422455,
0.06565140932798386,
0.09736549854278564,
-0.035307977348566055,
-0.30924275517463684,
-0.210857093334198,
0.2750343382358551,
-0.021940626204013824,
-0.09908957779407501,
-0.3094593286514282,
-0.08514004200696945,
0.2886514365673065,
0.11446509510278702,
0.6201905012130737,
-0.2595619261264801,
-0.020050758495926857,
-0.04319710284471512,
-0.3063434362411499,
0.03455628454685211,
-0.19711630046367645,
-0.04745202139019966,
0.01419181376695633,
0.1604759395122528,
0.20946002006530762,
0.2387755811214447,
0.12732498347759247,
0.08009400218725204,
0.09286681562662125,
0.004091911017894745,
0.041855067014694214,
0.03139214217662811,
0.2719652056694031,
0.12525981664657593,
0.17735737562179565,
-0.3446017801761627,
-0.07284291088581085,
-0.2704997658729553,
-0.17593634128570557,
-0.09903746843338013,
0.06140477955341339,
-0.15898652374744415,
0.22203987836837769,
-0.10565514862537384,
0.3824673295021057,
-0.004415467381477356,
0.12192195653915405,
0.5393018126487732,
0.11565671861171722,
0.05400994047522545,
-0.08919821679592133,
0.25275930762290955,
-0.08221255987882614,
0.28495198488235474,
-0.04427675902843475,
-0.10396304726600647,
-0.09685845673084259,
0.3695136308670044,
0.22219595313072205,
-0.07774163037538528,
0.22055497765541077,
-0.18091720342636108,
0.10373000800609589,
0.2605043649673462,
0.3691028356552124,
-0.24487745761871338,
0.35816705226898193,
0.22389265894889832,
0.17096129059791565,
0.3980475664138794,
-0.14754682779312134,
0.2753283381462097,
-0.23062220215797424,
0.0012875404208898544,
-0.3414692282676697,
-0.5388360023498535,
-0.2609211206436157,
0.19362865388393402,
-0.1425594985485077,
0.16739347577095032,
-0.6062372922897339,
-0.08744476735591888,
0.06586820632219315,
-0.12153104692697525,
0.1265701949596405,
0.09887409955263138,
-0.322715163230896,
-0.0927225723862648,
0.14674228429794312,
0.3321525752544403,
-0.21808481216430664,
0.014632262289524078,
-0.41420817375183105,
0.12430359423160553,
0.06911012530326843,
0.012211564928293228,
-0.23528382182121277,
-0.0018234476447105408,
-0.5159359574317932,
0.2789113223552704,
0.20036056637763977,
-0.4764983654022217,
-0.4453635811805725,
0.505632758140564,
0.005522444844245911,
0.004313625395298004,
0.03534814715385437,
0.16489380598068237,
0.05781228467822075,
-0.11870411038398743,
-0.31680697202682495,
0.5255458950996399,
0.24576367437839508,
0.06845718622207642,
-0.24992913007736206,
-0.21640250086784363,
-0.3007879853248596,
0.1460326761007309,
-0.1449011117219925,
0.19186918437480927,
0.14846166968345642,
-0.0656527727842331,
0.11216409504413605,
-0.26412901282310486,
0.39341479539871216,
0.3409394323825836,
0.3437996804714203,
0.10657291114330292,
-0.13429903984069824,
0.184462308883667,
-0.5535220503807068,
0.2996518611907959,
0.0077558159828186035,
-0.32446950674057007,
-0.14318545162677765,
-0.23861005902290344,
-0.003753628581762314,
-0.2364576756954193,
-0.34554287791252136,
-0.06430657207965851,
0.13470622897148132,
0.16259407997131348,
0.11271796375513077,
-0.2581630051136017,
-0.06912285089492798,
0.19370658695697784,
0.0960477888584137,
-0.07237053662538528,
-0.01467599906027317,
0.4623115658760071,
0.07080850005149841,
-0.03371373191475868,
-0.06051946431398392,
-0.18527981638908386,
0.012284142896533012,
-0.25539177656173706,
-0.22034943103790283,
0.36856767535209656,
0.1077609732747078,
0.523815393447876,
0.1860457956790924,
0.19674542546272278,
0.011338511481881142,
0.1693137288093567,
0.1441604495048523,
-0.2695598304271698,
0.02642964944243431,
0.2010442167520523,
-0.25451135635375977,
0.39238351583480835,
-0.31815823912620544,
0.19222937524318695,
0.06853893399238586,
-0.1837414801120758,
0.16612033545970917,
-0.1021605059504509,
0.12311020493507385,
-0.3063132166862488,
0.17044591903686523,
0.08124936372041702,
0.23442360758781433,
-0.05194346606731415,
0.0263822078704834,
0.29382097721099854,
0.1999334692955017,
0.17726047337055206,
0.11053304374217987,
0.3041406273841858,
-0.07591144740581512,
-0.08187995851039886,
0.2795456647872925,
0.4884387254714966,
0.5922713875770569,
0.26447421312332153,
0.38360196352005005,
-0.14528097212314606,
0.37252506613731384,
-0.19184045493602753,
0.20970630645751953,
-0.005398083478212357,
0.38199251890182495,
0.33160197734832764,
0.08544015884399414,
-0.18267467617988586,
-0.1730606108903885,
0.028029412031173706,
0.11530075967311859,
0.030896389856934547,
-0.2551211714744568,
0.14478784799575806,
-0.228849858045578,
-0.2984160780906677,
0.08471833169460297,
-0.1839010864496231,
0.003756508231163025,
-0.2232658714056015,
0.1000264585018158,
0.54057377576828,
-0.19158491492271423,
0.11529698967933655,
-0.05985752493143082,
0.0946260318160057,
-0.1465519368648529,
-0.34883859753608704,
-0.42703112959861755,
0.08703340590000153,
-0.10021017491817474,
0.05898638069629669,
0.18005028367042542,
-0.020940914750099182,
0.1461581438779831,
0.1248663067817688,
-0.016039226204156876,
-0.5708272457122803,
0.0036665797233581543,
0.19725638628005981,
0.31549638509750366,
0.39605051279067993,
0.19504860043525696,
0.22456642985343933,
-0.01966284215450287,
-0.03515492379665375,
0.15918192267417908,
-0.12372016906738281,
-0.1472707986831665,
0.03754096478223801,
-0.07066019624471664,
0.21041101217269897,
-0.21654102206230164,
-0.03415835648775101,
-0.18994662165641785,
-0.5218914151191711,
0.0008576828986406326,
-0.16251516342163086,
0.1960386484861374,
-0.06978636980056763,
0.10931865870952606,
-0.18315094709396362,
0.15162155032157898,
-0.22116468846797943,
-0.38011643290519714,
-0.7234771847724915,
0.3202427327632904,
-0.45609188079833984,
-0.003010333050042391,
-0.11960867792367935,
-0.055827584117650986,
0.32235264778137207,
0.055027492344379425,
-0.5207204222679138,
-0.43777477741241455,
-0.0048598116263747215,
0.32726171612739563,
-0.1798858940601349,
-0.08731880784034729,
0.40832364559173584,
-0.036256495863199234,
-0.116896852850914,
-0.16800880432128906,
-0.05226494371891022,
0.05649830773472786,
0.10055717825889587,
0.12157390266656876,
0.0014737173914909363,
0.162736177444458,
0.26787135004997253,
0.6783208847045898,
-0.017368458211421967,
0.02477298490703106,
0.5862868428230286,
0.15513768792152405,
0.3442959785461426,
-0.21864643692970276,
-0.10696721822023392,
-0.07449842989444733,
-0.21388408541679382,
-0.036958374083042145,
0.19933336973190308,
0.06665131449699402,
-0.09324301779270172,
-0.038421303033828735,
-0.16816097497940063,
-0.3021232783794403,
-0.16795441508293152,
0.1906728744506836,
-0.3803716003894806,
0.07918804883956909,
0.022506125271320343,
-0.13119542598724365,
-0.23468650877475739,
-0.02067294903099537,
0.2978121042251587,
0.2230565845966339,
0.3735406994819641,
0.13910451531410217,
0.025247156620025635,
0.06574802100658417,
-0.3891916573047638,
0.23720593750476837,
-0.015053845942020416,
-0.05329123139381409,
-0.1679137647151947,
0.007531464099884033,
0.007535479962825775,
-0.2356157749891281,
0.6891614198684692,
-0.5024533271789551,
-0.0012062126770615578,
-0.09201586991548538,
-0.17520707845687866,
-0.4298841953277588,
-0.057351164519786835,
0.2531239092350006,
0.07816458493471146,
-0.04130304232239723,
0.3673861622810364,
-0.2189958393573761,
-0.2677834928035736,
-0.4098624289035797,
-0.13923922181129456,
-0.13474810123443604,
-0.3039570450782776,
-0.14011389017105103,
-0.1591862142086029,
-0.2745714485645294,
-0.17923767864704132,
-0.05060074105858803,
-0.297433078289032,
-0.04064164310693741,
-0.19723068177700043,
-0.044409919530153275,
0.1606295108795166,
-0.11481546610593796,
0.12109723687171936,
0.3533291518688202,
0.06308270990848541,
0.268490731716156,
0.35150471329689026,
0.08805300295352936,
0.6339117884635925,
0.7061059474945068,
0.013114595785737038,
0.12145064771175385,
0.32298463582992554,
-0.08699000626802444,
0.06268955022096634,
0.2205885648727417,
-0.006544832140207291,
0.20579899847507477,
-0.06535933911800385,
0.11961367726325989,
-0.402671217918396,
0.07783777266740799,
-0.011098312214016914,
-0.08166084438562393,
0.14593100547790527,
-0.2567582130432129,
0.46798524260520935,
0.002509087324142456,
-0.2156352400779724,
0.06788918375968933,
-0.024857524782419205,
-0.32852447032928467,
0.25575292110443115,
0.19071920216083527,
0.6979681253433228,
0.022016616538167,
0.2794673442840576,
0.057141680270433426,
-0.3726189136505127,
0.1900574415922165,
-0.27520108222961426,
-0.18419396877288818,
-0.2771936058998108,
-0.2427220642566681,
-0.14040504395961761,
-0.22216840088367462,
-0.1311199963092804,
0.127604678273201,
-0.13082046806812286,
0.1792278289794922,
-0.13712897896766663,
-0.030577808618545532,
-0.25245964527130127,
0.3375014662742615,
-0.27284863591194153,
-0.5468297004699707,
-0.21762233972549438,
0.20753079652786255,
0.04463600367307663,
0.24166667461395264,
-0.07796262204647064,
-0.20554156601428986,
-0.09437467157840729,
0.06301422417163849,
0.2404353767633438,
0.10029713809490204,
-0.08861684054136276,
0.020519550889730453,
-0.29833364486694336,
-0.22256645560264587,
0.10442948341369629,
-0.11275908350944519,
0.2745353877544403,
-0.1336331069469452,
-0.19605977833271027,
0.07902894914150238,
0.230067640542984,
0.17074701189994812,
-0.24367547035217285,
-0.4747369885444641,
-0.016721703112125397,
-0.2278575897216797,
0.0063230544328689575,
-0.2029537558555603,
0.05159774422645569,
-0.4296203851699829,
0.2501862645149231,
-0.2358315885066986,
0.10767492651939392,
-0.10237684845924377,
-0.10811124742031097,
0.0013728514313697815,
-0.04292777553200722,
-0.16848357021808624,
0.1773725152015686,
0.07975782454013824,
0.009294237941503525,
0.04609221965074539,
-0.1616382747888565,
0.03259894251823425,
-0.22636446356773376,
0.5061724185943604,
-0.11140638589859009,
0.14961184561252594,
0.3781374394893646,
0.02001851797103882,
-0.16443367302417755,
-0.20520053803920746,
0.013471856713294983,
0.17192724347114563,
-0.1644902229309082,
0.10269631445407867,
-0.07064890116453171,
-0.20635151863098145,
-0.05638178437948227,
-0.10000530630350113,
0.2723676562309265,
-0.12312081456184387,
-0.09049835056066513,
-0.24059922993183136,
-0.11671077460050583,
0.07258305698633194,
-0.26249945163726807,
0.4238457977771759,
0.012863650918006897,
-0.07872173190116882,
-0.026829160749912262,
0.11349695920944214,
-0.3870376944541931,
0.19382834434509277,
0.0261489599943161,
0.026721835136413574,
-0.10743565112352371,
-0.015365244820713997,
0.19295597076416016,
-0.3143380582332611,
0.031122200191020966,
-0.015060625970363617,
-0.3298873007297516,
-0.24504047632217407,
-0.18254485726356506,
0.09580621123313904,
0.023755360394716263,
-0.04688280075788498,
0.04032574221491814,
-0.1819014847278595,
-0.16766953468322754,
-0.17483285069465637,
0.15628232061862946,
0.20929697155952454,
-0.14747850596904755,
0.0674770325422287,
0.007407512050122023,
-0.1572456657886505,
-0.28930094838142395,
0.12481454014778137,
0.05457097291946411,
0.04883391037583351,
-0.22929887473583221,
0.2826250493526459,
-0.13524168729782104,
-0.09375003725290298,
-0.019605785608291626,
0.016936691477894783,
0.14622004330158234,
0.1519489288330078,
0.17994095385074615,
-0.22992905974388123,
-0.10171626508235931,
0.034959640353918076,
0.3962341547012329,
-0.07970760017633438,
-0.08835460245609283,
-0.1733161211013794,
0.11040230095386505,
0.26671701669692993,
-0.08870229125022888,
-0.3231727182865143,
-0.42208242416381836,
-0.18880939483642578,
0.12815386056900024,
0.1169314831495285,
0.4846893548965454,
0.026948869228363037,
0.016724945977330208,
0.11156885325908661,
0.15387791395187378,
-0.15941065549850464,
0.01675783097743988,
0.016652025282382965,
-0.1561703085899353,
0.18400345742702484,
0.3206390142440796,
0.08942938596010208,
0.15898939967155457,
0.4751054048538208,
0.025638848543167114,
0.2230851650238037,
0.27517569065093994,
0.17079688608646393,
-0.19939753413200378,
-0.4754777252674103,
-0.08688725531101227,
0.02258046716451645,
0.027583012357354164,
0.17865070700645447,
-0.02842024341225624,
0.16526171565055847,
-0.053720202296972275,
-0.4258599877357483,
-0.21206927299499512,
-0.04680081829428673,
-0.03496628254652023,
-0.27956873178482056,
-0.27483272552490234,
-0.09318847954273224,
0.07771006226539612,
0.018681064248085022,
-0.0597207210958004,
-0.21735599637031555,
0.29370033740997314,
0.11299270391464233,
0.3137695789337158,
-0.08206877112388611,
0.2206757366657257,
0.33347436785697937,
0.12966422736644745,
-0.05896788462996483,
0.2617391049861908,
-0.028572719544172287,
-0.06538420170545578,
-0.023843780159950256,
0.11653200536966324,
0.2758684456348419,
0.08419542014598846,
-0.05645013600587845,
-0.07530473172664642,
0.24110542237758636,
-0.026042595505714417,
-0.20021450519561768,
-0.022084204480051994,
0.09643670171499252,
-0.10837560147047043,
0.4024757742881775,
0.27147790789604187,
-0.2140202820301056,
0.33066287636756897,
-0.15952688455581665,
0.2296999841928482,
-0.07674892991781235,
0.00400698184967041,
0.3171626925468445,
0.031222276389598846,
0.17412759363651276,
0.0631624385714531,
-0.1914309412240982,
0.12920024991035461,
0.40103334188461304,
-0.23092494904994965,
0.22378483414649963,
-0.020514490082859993,
0.09694797545671463,
0.09275981038808823,
0.4800088405609131,
0.015415279194712639,
0.10074502229690552,
-0.39795613288879395,
-0.05870644748210907,
-0.3138172924518585,
-0.05466596037149429,
-0.10504473745822906,
0.3017028570175171,
-0.06106382608413696,
0.3254619538784027,
0.2410551905632019,
0.031186535954475403,
0.05794714018702507,
-0.08088965713977814,
-0.034660451114177704,
0.2694493234157562,
-0.39860254526138306,
-0.03654421865940094,
-0.17660003900527954,
0.19663146138191223,
0.04294024407863617,
-0.5707575678825378,
-0.08767461776733398,
0.11315323412418365,
0.08203530311584473,
0.14605367183685303,
0.13233037292957306,
0.3155292570590973,
0.04875696450471878,
0.5714708566665649,
-0.06374609470367432,
-0.06092335656285286,
-0.2569614052772522,
0.038036465644836426,
-0.1713327169418335,
-0.24549801647663116,
-0.16927865147590637,
-0.12421518564224243,
0.019492249935865402,
0.42593106627464294,
-0.21332423388957977,
0.09682656824588776,
-0.475702702999115,
-0.058409128338098526,
0.2741354703903198,
0.32312190532684326,
0.12180083245038986,
0.40624159574508667,
-0.11052758246660233,
0.27103403210639954,
0.033335670828819275,
0.1261809766292572,
0.014036979526281357,
0.06181696057319641,
-0.44401296973228455,
-0.2670747935771942,
0.464830219745636,
-0.14858165383338928,
-0.07034487277269363,
0.09493142366409302,
0.4427894949913025,
0.2859326899051666,
-0.07592940330505371,
-0.2946625053882599,
0.15323293209075928,
0.29320597648620605,
-0.08629867434501648,
0.03412456810474396,
0.208394855260849,
0.037325065582990646,
0.059762440621852875,
-0.13399922847747803,
0.5409625768661499,
0.09261064231395721,
-0.3461115062236786,
-0.1978451907634735,
-0.2557821273803711
] |
https://github.com/huggingface/datasets/issues/5679 | If we hope to also persist the Arrow files on the mounted S3 but work with the efficiency of local disk, is there any recommended way to do this, other than copying the Arrow files from local disk to S3? | Allow load_dataset to take a working dir for intermediate data | ### Feature request
As a user, I can set a working dir for intermediate data creation. The processed files will be moved to the cache dir, like
```
load_dataset(…, working_dir=”/temp/dir”, cache_dir=”/cloud_dir”).
```
### Motivation
This will help the use case for using datasets with cloud storage as cache. It will help boost the performance.
### Your contribution
I can provide a PR to fix this if the proposal seems reasonable. | 40 | Allow load_dataset to take a working dir for intermediate data
### Feature request
As a user, I can set a working dir for intermediate data creation. The processed files will be moved to the cache dir, like
```
load_dataset(…, working_dir=”/temp/dir”, cache_dir=”/cloud_dir”).
```
### Motivation
This will help the use case for using datasets with cloud storage as cache. It will help boost the performance.
### Your contribution
I can provide a PR to fix this if the proposal seems reasonable.
If we hope to also persist the Arrow files on the mounted S3 but work with the efficiency of local disk, is there any recommended way to do this, other than copying the Arrow files from local disk to S3? | [
-0.08383795619010925,
-0.033123135566711426,
-0.07087063789367676,
0.20988696813583374,
0.22888898849487305,
-0.08875510096549988,
0.3452471196651459,
-0.048271454870700836,
0.09551674127578735,
0.07929646968841553,
-0.05972505360841751,
0.4497453272342682,
-0.21414722502231598,
0.1562022566795349,
-0.08961990475654602,
0.015393083915114403,
0.016640249639749527,
0.1530683934688568,
-0.20474232733249664,
-0.02094532549381256,
-0.13378538191318512,
0.016410956159234047,
0.12699085474014282,
-0.2698977291584015,
-0.03140357881784439,
0.16460156440734863,
-0.03841546177864075,
0.10214565694332123,
0.024689186364412308,
-0.22872218489646912,
0.38988783955574036,
0.24714776873588562,
0.3041098713874817,
0.589197039604187,
-0.00011934227222809568,
-0.018176667392253876,
0.29334360361099243,
-0.2606031894683838,
-0.6186693906784058,
-0.269417941570282,
-0.27339065074920654,
-0.0780954658985138,
0.10408524423837662,
-0.09112706035375595,
0.009251035749912262,
-0.04922408610582352,
-0.07093314081430435,
-0.8017836213111877,
0.335882306098938,
-0.16223230957984924,
0.14233845472335815,
-0.14446234703063965,
-0.5945096015930176,
0.12929895520210266,
0.2637007236480713,
0.4638611972332001,
-0.35065823793411255,
0.5728181004524231,
0.1785334050655365,
0.21507275104522705,
0.1070362776517868,
0.27479517459869385,
0.04439380019903183,
0.13634538650512695,
0.44261083006858826,
-0.03703852742910385,
0.0845378190279007,
0.0014969902113080025,
0.06200534105300903,
0.11668051779270172,
0.9525971412658691,
-0.29366740584373474,
-0.4103758633136749,
-0.3581564426422119,
-0.17175228893756866,
-0.07184578478336334,
0.17191407084465027,
0.02339164912700653,
0.06542278826236725,
0.18858055770397186,
-0.10712843388319016,
-0.5299659967422485,
-0.3202570080757141,
0.22079674899578094,
0.12775126099586487,
-0.1408131867647171,
-0.2702704668045044,
-0.05924577638506889,
0.1105470284819603,
0.15960800647735596,
0.6162986159324646,
-0.20587268471717834,
0.12027999758720398,
0.021111249923706055,
-0.11578628420829773,
0.07502420246601105,
-0.3364131450653076,
0.023932168260216713,
-0.030436836183071136,
0.3184177577495575,
0.38136881589889526,
0.1751093566417694,
0.16463226079940796,
0.203771710395813,
0.06374146044254303,
0.22950050234794617,
0.20749109983444214,
-0.009201187640428543,
0.14669981598854065,
-0.06491737067699432,
0.12479321658611298,
-0.34453701972961426,
-0.20605029165744781,
-0.3093990683555603,
-0.05946721136569977,
-0.03345821425318718,
0.014313317835330963,
-0.06558583676815033,
0.3566129505634308,
-0.03151398524641991,
0.31064969301223755,
-0.023410286754369736,
0.28447023034095764,
0.39837995171546936,
0.26450949907302856,
0.1598372757434845,
-0.02617257460951805,
0.2762416899204254,
0.1403077244758606,
0.16784749925136566,
0.10144397616386414,
-0.1750965118408203,
-0.14741358160972595,
0.2730541527271271,
0.19931097328662872,
-0.10749136656522751,
0.22466108202934265,
-0.3341768682003021,
0.1053590178489685,
0.3047603368759155,
0.3754538297653198,
-0.15983237326145172,
0.41073936223983765,
0.06461743265390396,
-0.12005637586116791,
0.24917203187942505,
-0.23432675004005432,
0.37180769443511963,
-0.25095781683921814,
0.2752276062965393,
-0.26147228479385376,
-0.7437822222709656,
-0.27022191882133484,
0.05213353410363197,
-0.32985031604766846,
0.2104301005601883,
-0.6792787909507751,
-0.024160394445061684,
0.14016588032245636,
-0.07793227583169937,
0.28672322630882263,
0.11547501385211945,
-0.36206936836242676,
-0.19818922877311707,
0.0833410918712616,
0.34089794754981995,
-0.26408475637435913,
-0.02897452563047409,
-0.4156343936920166,
0.11999572813510895,
-0.03839562088251114,
0.09569932520389557,
-0.23344099521636963,
0.008899316191673279,
-0.4466423988342285,
0.17965427041053772,
0.423136830329895,
-0.5116228461265564,
-0.40979278087615967,
0.35288938879966736,
0.028228074312210083,
-0.11884980648756027,
0.10094809532165527,
0.1054162010550499,
-0.05481959134340286,
-0.18284302949905396,
-0.33128273487091064,
0.47339215874671936,
0.22197510302066803,
0.03260429948568344,
-0.29411137104034424,
-0.3097013533115387,
-0.2964671850204468,
0.18597786128520966,
-0.21250545978546143,
0.054474376142024994,
0.14125223457813263,
-0.26919910311698914,
0.04572700336575508,
-0.15738850831985474,
0.3977697193622589,
0.13064926862716675,
0.4497610032558441,
-0.01795916259288788,
-0.025326602160930634,
0.263420432806015,
-0.615394115447998,
0.2610713243484497,
0.03841164708137512,
-0.5305030345916748,
-0.19178403913974762,
-0.1342759132385254,
-0.024836454540491104,
-0.10974058508872986,
-0.30028295516967773,
0.061868827790021896,
-0.00669555738568306,
0.07008039951324463,
0.1706075668334961,
-0.23893700540065765,
-0.20978206396102905,
-0.2083009034395218,
0.03504049777984619,
-0.19437718391418457,
0.02849070355296135,
0.44848453998565674,
0.09409911185503006,
-0.06885877996683121,
-0.2143099457025528,
-0.08247126638889313,
-0.0017331549897789955,
-0.32057493925094604,
-0.190256729722023,
0.27639010548591614,
0.06289675831794739,
0.7683215141296387,
0.15678870677947998,
0.3766261041164398,
0.015531221404671669,
-0.0578276552259922,
0.25482359528541565,
-0.2181788980960846,
-0.01765122450888157,
0.21228113770484924,
-0.3267824649810791,
0.3850627541542053,
-0.4766223132610321,
0.16743648052215576,
-0.07153153419494629,
-0.11208285391330719,
0.06867785006761551,
-0.0767492726445198,
-0.012661628425121307,
-0.2836788594722748,
0.20601698756217957,
0.31937870383262634,
0.30409032106399536,
0.09381281584501266,
-0.0532742440700531,
0.17566025257110596,
0.09987623989582062,
0.10098923742771149,
0.14420849084854126,
0.2588304579257965,
-0.03938829526305199,
-0.14131788909435272,
0.3424238860607147,
0.44948431849479675,
0.6070601940155029,
0.18543697893619537,
0.4680270850658417,
-0.25689032673835754,
0.5476211905479431,
-0.2882387936115265,
0.371446430683136,
-0.048120755702257156,
0.4883955121040344,
0.45172765851020813,
0.15030962228775024,
-0.10732254385948181,
-0.10117877274751663,
-0.0288400761783123,
0.20373691618442535,
-0.059436265379190445,
-0.20242837071418762,
-0.00821569561958313,
-0.02883027493953705,
-0.2436496466398239,
-0.13355842232704163,
-0.3041347861289978,
0.14023134112358093,
0.024157077074050903,
0.0690588727593422,
0.31746572256088257,
-0.2503661513328552,
0.1338866949081421,
-0.0888020470738411,
0.3935829997062683,
-0.1810319721698761,
-0.4773143529891968,
-0.6077190041542053,
0.02553597092628479,
0.053630586713552475,
-0.04558954015374184,
0.4036787748336792,
-0.1095176637172699,
0.08514662086963654,
0.1940438449382782,
0.06504417955875397,
-0.4980209767818451,
0.03560695797204971,
0.14779658615589142,
0.42892614006996155,
0.4098075032234192,
0.20100857317447662,
0.10222673416137695,
-0.005344226956367493,
-0.0003871209919452667,
0.1809285581111908,
-0.14744475483894348,
-0.14054960012435913,
-0.17309145629405975,
-0.06254540383815765,
0.3329048752784729,
-0.3089269995689392,
0.0660056322813034,
-0.203923299908638,
-0.4897027611732483,
0.33425381779670715,
-0.06533205509185791,
0.21716584265232086,
-0.1321181356906891,
0.17786939442157745,
-0.09432011842727661,
0.21565018594264984,
-0.050316084176301956,
-0.24990375339984894,
-0.7327252626419067,
0.35151243209838867,
-0.44552183151245117,
0.06133219599723816,
-0.19575189054012299,
-0.19304952025413513,
0.45177552103996277,
0.023250766098499298,
-0.4235674738883972,
-0.38603678345680237,
0.04265281558036804,
0.3682914972305298,
-0.26341474056243896,
-0.04898206889629364,
0.4048067331314087,
0.10504224896430969,
0.01646341383457184,
-0.18261238932609558,
0.007045447826385498,
0.06603731960058212,
0.23582807183265686,
0.06801490485668182,
0.1550382375717163,
0.12099039554595947,
0.29211363196372986,
0.7688854932785034,
-0.14517931640148163,
0.0729321762919426,
0.4133084714412689,
0.1854744404554367,
0.2837340235710144,
-0.14176280796527863,
-0.043137673288583755,
-0.05551555007696152,
-0.1861077845096588,
-0.2672516703605652,
0.07668571919202805,
0.1500129997730255,
-0.09525980800390244,
-0.0351480171084404,
-0.295725017786026,
-0.25483787059783936,
-0.11841137707233429,
0.2339153289794922,
-0.4876636862754822,
0.11890476942062378,
-0.09739206731319427,
-0.22135551273822784,
-0.1730390191078186,
0.14667433500289917,
0.2475559562444687,
0.17084184288978577,
0.44936835765838623,
0.0026633478701114655,
0.048554062843322754,
0.10373523086309433,
-0.35671553015708923,
0.18215824663639069,
0.06118696928024292,
-0.012128133326768875,
-0.06759712100028992,
-0.008506573736667633,
0.030585668981075287,
-0.12310505658388138,
0.4943018853664398,
-0.419117271900177,
-0.051316916942596436,
-0.22807921469211578,
-0.07416586577892303,
-0.5277040004730225,
0.050046682357788086,
0.36117005348205566,
0.0910259336233139,
-0.0625794306397438,
0.43477389216423035,
-0.03918713331222534,
-0.1967467963695526,
-0.5297921895980835,
-0.053897637873888016,
-0.11695405095815659,
-0.279522180557251,
-0.048482611775398254,
-0.11646031588315964,
-0.254035621881485,
-0.07880457490682602,
0.04048984497785568,
-0.26960405707359314,
0.05562672019004822,
-0.07376706600189209,
-0.1388685554265976,
0.01843767613172531,
-0.17942729592323303,
-0.03792886435985565,
0.3665456473827362,
-0.07336414605379105,
0.1608898788690567,
0.3574676513671875,
-0.003092271275818348,
0.572769820690155,
0.6342617869377136,
-0.05877897888422012,
0.19017571210861206,
0.1559668332338333,
-0.12717977166175842,
0.25841397047042847,
0.29683491587638855,
-0.049631040543317795,
0.10047203302383423,
-0.16412414610385895,
-0.024332594126462936,
-0.3358195126056671,
-0.1816716343164444,
-0.2502743601799011,
-0.07940182834863663,
0.2909255921840668,
-0.23822271823883057,
0.521030604839325,
-0.05439335107803345,
-0.2199901044368744,
0.08910021930932999,
-0.11562596261501312,
-0.3601970970630646,
0.3195379376411438,
0.4219537675380707,
0.9034613370895386,
0.086846262216568,
0.2861500084400177,
0.03758040815591812,
-0.38962459564208984,
0.141683891415596,
0.03110554814338684,
-0.2539263069629669,
-0.2098260223865509,
-0.11145098507404327,
-0.11218875646591187,
-0.29549139738082886,
-0.1224365085363388,
0.154107004404068,
-0.24601522088050842,
-0.053629159927368164,
-0.12098563462495804,
-0.21987615525722504,
-0.16025999188423157,
0.33918702602386475,
-0.34364911913871765,
-0.43424174189567566,
-0.3066837787628174,
0.042104192078113556,
0.14019036293029785,
0.12654271721839905,
-0.08410501480102539,
-0.2018880844116211,
-0.1892702877521515,
0.08667376637458801,
0.25627511739730835,
0.020055457949638367,
-0.21574246883392334,
0.09508569538593292,
-0.2297111451625824,
-0.4759303629398346,
0.2547791004180908,
0.1735135018825531,
0.17193859815597534,
-0.27087822556495667,
-0.2567877769470215,
0.07664431631565094,
0.38544172048568726,
0.0622616708278656,
-0.2384273111820221,
-0.4625399112701416,
-0.05730195343494415,
-0.14794141054153442,
0.07846812903881073,
-0.2283921241760254,
0.04527846723794937,
-0.44909870624542236,
0.13996289670467377,
-0.1625557392835617,
0.15484142303466797,
-0.0278212521225214,
-0.270067423582077,
-0.088234543800354,
-0.19074663519859314,
-0.07215793430805206,
0.07137291878461838,
0.22800064086914062,
0.043266233056783676,
0.06464296579360962,
-0.14655530452728271,
0.13338153064250946,
-0.04117687791585922,
0.34987109899520874,
-0.10252858698368073,
0.15471826493740082,
0.36041128635406494,
-0.07920362055301666,
-0.1376885324716568,
-0.17354033887386322,
0.2041400521993637,
0.16330546140670776,
-0.362842857837677,
0.03564423695206642,
-0.08118089288473129,
-0.18492573499679565,
-0.13946153223514557,
-0.010887624695897102,
0.39583563804626465,
0.08852812647819519,
-0.1063351258635521,
-0.12353871017694473,
-0.25730252265930176,
0.22993150353431702,
-0.08435063064098358,
0.49852824211120605,
-0.13516120612621307,
-0.35614630579948425,
0.031377553939819336,
0.0997215211391449,
-0.2588673532009125,
0.40939539670944214,
0.11064974218606949,
0.07354359328746796,
-0.06304515898227692,
-0.005850996822118759,
0.16210579872131348,
-0.34681716561317444,
-0.08853074163198471,
-0.027890847995877266,
-0.20156927406787872,
-0.09272453188896179,
-0.2153785526752472,
0.19516833126544952,
0.03665663301944733,
-0.06767969578504562,
-0.07551300525665283,
-0.2526324391365051,
-0.09289480000734329,
-0.1343788504600525,
-0.125383198261261,
0.24621644616127014,
-0.24799133837223053,
0.1418597400188446,
0.008429408073425293,
-0.054539114236831665,
-0.4462556838989258,
0.11244478821754456,
0.10902538895606995,
0.05940359830856323,
-0.19870784878730774,
0.4097102880477905,
-0.0949007198214531,
-0.10087590664625168,
0.10731549561023712,
0.03957849740982056,
0.15181061625480652,
0.217038094997406,
0.07094484567642212,
-0.06408020853996277,
-0.09899819642305374,
-0.015628252178430557,
0.36619919538497925,
-0.033491309732198715,
-0.15174555778503418,
-0.009087815880775452,
0.18809133768081665,
0.1519499272108078,
-0.01950433850288391,
-0.20580123364925385,
-0.34696218371391296,
-0.22597600519657135,
0.04413667321205139,
0.19366639852523804,
0.5679389834403992,
-0.00922819972038269,
-0.01454198732972145,
0.05501198023557663,
-0.018228888511657715,
-0.15976934134960175,
0.06575533747673035,
-0.021551551297307014,
-0.10638752579689026,
0.03957885503768921,
0.2988645136356354,
0.11449681967496872,
0.3452444076538086,
0.21179962158203125,
-0.0894288718700409,
0.23309746384620667,
0.3958899676799774,
0.24464136362075806,
-0.137790247797966,
-0.29215121269226074,
-0.09423831105232239,
0.0059475526213645935,
-0.003209102898836136,
0.2168148010969162,
0.004071246832609177,
0.405591756105423,
0.05266560614109039,
-0.25029057264328003,
0.011653117835521698,
-0.11063729971647263,
0.028599444776773453,
-0.33004194498062134,
-0.3964015245437622,
-0.22390426695346832,
0.03426828980445862,
0.022020742297172546,
-0.05489526316523552,
-0.11991972476243973,
0.24281899631023407,
0.27776455879211426,
0.41086545586586,
0.03555651754140854,
0.3498101532459259,
0.5280940532684326,
0.18819788098335266,
-0.16638082265853882,
0.261214017868042,
-0.06177592650055885,
-0.09691537171602249,
0.01465015858411789,
0.0985855981707573,
0.24430352449417114,
0.07145437598228455,
-0.06844349205493927,
0.03452889993786812,
0.22809086740016937,
-0.011839639395475388,
-0.3067474067211151,
0.0998154878616333,
0.20674657821655273,
-0.13328523933887482,
0.3052957057952881,
0.19074738025665283,
-0.1219014972448349,
0.39544352889060974,
-0.0283750481903553,
0.04318057373166084,
-0.1323878914117813,
-0.125579372048378,
0.2706587612628937,
-0.20740392804145813,
0.17685365676879883,
0.027991462498903275,
-0.011705420911312103,
0.02371961995959282,
0.33462703227996826,
-0.2484683245420456,
0.046585798263549805,
-0.00289042666554451,
0.021651212126016617,
0.07002279162406921,
0.4827425181865692,
0.06597501784563065,
0.25474855303764343,
-0.34269458055496216,
-0.19038663804531097,
-0.3061816990375519,
-0.08162286877632141,
0.23097458481788635,
0.29636043310165405,
0.02815588191151619,
0.34477829933166504,
0.24795939028263092,
0.16837690770626068,
0.01591213420033455,
-0.003512326627969742,
0.13471004366874695,
0.28342878818511963,
-0.26935863494873047,
0.049622830003499985,
0.16929040849208832,
0.2587239742279053,
0.1003475934267044,
-0.5186871290206909,
-0.16000379621982574,
0.02998220920562744,
-0.012256477028131485,
0.10595991462469101,
0.006674259901046753,
0.16705067455768585,
0.3878577947616577,
0.5984310507774353,
-0.129408597946167,
-0.07982169091701508,
-0.136714369058609,
0.0021936073899269104,
-0.08286706358194351,
-0.24477660655975342,
-0.08410593867301941,
0.0014249328523874283,
0.022923681885004044,
0.33904534578323364,
-0.48266685009002686,
0.23830488324165344,
-0.5147631168365479,
-0.13915017247200012,
0.13109387457370758,
0.34142741560935974,
0.05323237180709839,
0.29648688435554504,
-0.2596173882484436,
0.1903555691242218,
-0.04133367910981178,
0.11696085333824158,
-0.1335720717906952,
0.061242617666721344,
-0.545259952545166,
-0.05930129438638687,
0.46914052963256836,
-0.27293604612350464,
0.01066163182258606,
0.14891110360622406,
0.32954418659210205,
0.39746442437171936,
0.038353532552719116,
-0.3618646264076233,
0.027219027280807495,
0.337603360414505,
-0.06337255239486694,
0.057340651750564575,
0.1281827986240387,
0.10698169469833374,
0.10153380036354065,
-0.19324159622192383,
0.7332403659820557,
-0.005538349039852619,
-0.1722400188446045,
-0.31977003812789917,
-0.392392635345459
] |
https://github.com/huggingface/datasets/issues/5678 | if i read spark Dataframe , got an error on multi-node Spark cluster.
Did the Api (Dataset.from_spark) support Spark cluster, read dataframe and save_to_disk?
Error:
_pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transforma
tion. SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063.
23/06/16 21:17:20 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.)
| Add support to create a Dataset from spark dataframe | ### Feature request
Add a new API `Dataset.from_spark` to create a Dataset from Spark DataFrame.
### Motivation
Spark is a distributed computing framework that can handle large datasets. By supporting loading Spark DataFrames directly into Hugging Face Datasets, we enable take the advantages of spark to processing the data in parallel.
By providing a seamless integration between these two frameworks, we make it easier for data scientists and developers to work with both Spark and Hugging Face in the same workflow.
### Your contribution
We can discuss about the ideas and I can help preparing a PR for this feature. | 87 | Add support to create a Dataset from spark dataframe
### Feature request
Add a new API `Dataset.from_spark` to create a Dataset from Spark DataFrame.
### Motivation
Spark is a distributed computing framework that can handle large datasets. By supporting loading Spark DataFrames directly into Hugging Face Datasets, we enable take the advantages of spark to processing the data in parallel.
By providing a seamless integration between these two frameworks, we make it easier for data scientists and developers to work with both Spark and Hugging Face in the same workflow.
### Your contribution
We can discuss about the ideas and I can help preparing a PR for this feature.
if i read spark Dataframe , got an error on multi-node Spark cluster.
Did the Api (Dataset.from_spark) support Spark cluster, read dataframe and save_to_disk?
Error:
_pickle.PicklingError: Could not serialize object: RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transforma
tion. SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063.
23/06/16 21:17:20 WARN ExecutorPodsWatchSnapshotSource: Kubernetes client has been closed (this is expected if the application is shutting down.)
| [
-0.6102316379547119,
-0.3675934076309204,
-0.06564702093601227,
0.3130309581756592,
0.1362481266260147,
0.16130802035331726,
0.30632686614990234,
0.08133542537689209,
0.29441624879837036,
0.24111407995224,
0.023319222033023834,
0.5314666032791138,
-0.2611978352069855,
0.6833664178848267,
-0.03817034140229225,
-0.23937343060970306,
0.10215852409601212,
-0.054045479744672775,
-0.11014370620250702,
0.15188182890415192,
-0.23061391711235046,
0.17317906022071838,
0.15618453919887543,
0.0048646703362464905,
-0.36905619502067566,
-0.3192102909088135,
-0.15904781222343445,
-0.07972802221775055,
-0.12908612191677094,
-0.32392460107803345,
0.047818057239055634,
-0.21843361854553223,
0.24785743653774261,
0.3368615210056305,
-0.00010097365156980231,
-0.04936008155345917,
0.2463562786579132,
-0.01847275346517563,
-0.004363503307104111,
-0.3324504494667053,
0.22551974654197693,
-0.23250225186347961,
0.3257979154586792,
-0.3249549865722656,
-0.16287925839424133,
0.27047398686408997,
-0.041851431131362915,
-0.15681733191013336,
0.5638546347618103,
0.19469884037971497,
0.25731736421585083,
0.15266269445419312,
0.21859252452850342,
-0.04711392894387245,
-0.14519914984703064,
0.2085760086774826,
-0.3447617292404175,
0.029467180371284485,
0.07572765648365021,
0.19556176662445068,
-0.2084447145462036,
0.06473265588283539,
-0.13660213351249695,
-0.09470729529857635,
0.4226571023464203,
-0.11783629655838013,
-0.3832018971443176,
-0.6703882813453674,
-0.03879556059837341,
0.1054307147860527,
0.8429248332977295,
-0.3176867365837097,
-0.3919500708580017,
-0.11637546867132187,
0.008302602916955948,
0.07815352827310562,
0.23216721415519714,
0.15639996528625488,
-0.09885594993829727,
0.12753956019878387,
-0.06777259707450867,
-0.34263479709625244,
-0.23480463027954102,
-0.10293468832969666,
0.16835491359233856,
0.4137701392173767,
-0.04121982306241989,
0.2905789613723755,
0.20025044679641724,
0.04290475696325302,
-0.03510245308279991,
-0.11972083151340485,
0.19881653785705566,
-0.19516520202159882,
-0.27491286396980286,
-0.22855107486248016,
-0.017454572021961212,
-0.19514977931976318,
0.06656002253293991,
0.17443504929542542,
-0.018036872148513794,
0.11212508380413055,
-0.12491635233163834,
0.18071678280830383,
0.11345475912094116,
-0.1154821366071701,
0.13958513736724854,
-0.11200942099094391,
0.20312853157520294,
-0.2220401018857956,
0.16490565240383148,
-0.10418875515460968,
-0.07446850091218948,
0.1544783115386963,
-0.24718475341796875,
-0.0037443898618221283,
0.03862723708152771,
0.20770448446273804,
-0.07529367506504059,
-0.05766277015209198,
0.021190352737903595,
-0.013159260153770447,
-0.10040949285030365,
0.07751625776290894,
-0.06521781533956528,
-0.19489215314388275,
-0.13687101006507874,
0.16706252098083496,
0.15665166079998016,
-0.17331509292125702,
-0.10441571474075317,
0.13178659975528717,
0.04707998037338257,
0.2452523410320282,
0.012235529720783234,
-0.23749801516532898,
0.2432595044374466,
0.00016033649444580078,
-0.18775427341461182,
0.1738821417093277,
0.20150285959243774,
-0.16981734335422516,
-0.13751915097236633,
0.06558740139007568,
0.2215937077999115,
0.04790101200342178,
0.12960268557071686,
0.03177438676357269,
-0.2671617269515991,
0.1639936864376068,
-0.15080013871192932,
-0.1738845556974411,
-0.5348061919212341,
0.19279050827026367,
-0.17955420911312103,
0.048882778733968735,
-0.46982935070991516,
0.4169849455356598,
-0.22452925145626068,
-0.18223734200000763,
0.2108033448457718,
0.2406332939863205,
-0.2257252335548401,
-0.39357295632362366,
0.11016462743282318,
0.41489505767822266,
-0.49252721667289734,
0.052502259612083435,
0.011400409042835236,
-0.1542360782623291,
-0.05768159031867981,
-0.01601632498204708,
-0.23161035776138306,
0.14441901445388794,
-0.18930062651634216,
0.24000205099582672,
0.03274004906415939,
-0.3089105486869812,
-0.17381452023983002,
0.3579033315181732,
-0.4518699645996094,
-0.003952004015445709,
0.07854664325714111,
0.24878264963626862,
0.28919264674186707,
0.016478903591632843,
0.14343096315860748,
0.15495815873146057,
-0.07071300595998764,
-0.005841992795467377,
-0.11350946873426437,
-0.3690394163131714,
0.05629590526223183,
-0.06981261819601059,
0.09085804224014282,
-0.09942370653152466,
0.17477285861968994,
0.057339075952768326,
0.11424257606267929,
-0.04469886049628258,
0.16929885745048523,
0.1505896896123886,
0.20840522646903992,
-0.0893976092338562,
-0.20611201226711273,
-0.2900410294532776,
-0.318275511264801,
0.22576212882995605,
0.4456833004951477,
0.17581290006637573,
0.08824796974658966,
-0.3524881601333618,
0.025404181331396103,
0.0711008608341217,
-0.019637219607830048,
0.0761643648147583,
0.15579114854335785,
-0.15474092960357666,
0.17849674820899963,
0.09753799438476562,
-0.07988161593675613,
0.21339051425457,
-0.1188226193189621,
0.03289839252829552,
-0.14201417565345764,
0.33296075463294983,
-0.23212528228759766,
-0.0966060534119606,
0.11911092698574066,
-0.07495179772377014,
-0.029209334403276443,
-0.05303506925702095,
0.007083557546138763,
0.31566983461380005,
-0.0728091299533844,
0.3184753954410553,
-0.10447736084461212,
0.3705381751060486,
0.2478947788476944,
0.02296900749206543,
0.11310052126646042,
0.007789229974150658,
0.07302869856357574,
-0.06899948418140411,
-0.25414881110191345,
0.25802525877952576,
-0.19414350390434265,
-0.15360230207443237,
-0.17668494582176208,
0.0824182853102684,
0.24821089208126068,
0.10653020441532135,
-0.20300011336803436,
-0.0009757578372955322,
-0.2768975496292114,
-0.13101251423358917,
0.007722377777099609,
-0.021706951782107353,
-0.5068760514259338,
0.10979560762643814,
0.17564474046230316,
0.08856850862503052,
0.26632899045944214,
0.097974494099617,
-0.20847991108894348,
-0.20233212411403656,
0.48474740982055664,
0.07417906820774078,
0.20571759343147278,
0.19142134487628937,
-0.21819746494293213,
-0.054026804864406586,
0.12529993057250977,
-0.1318497359752655,
0.19334182143211365,
0.18459267914295197,
0.39470306038856506,
0.16715788841247559,
0.043837081640958786,
0.09542451798915863,
-0.07033857703208923,
-0.10682858526706696,
0.1716802567243576,
0.08088935911655426,
-0.20446859300136566,
-0.1236824169754982,
0.09163501858711243,
-0.1611417829990387,
0.12648476660251617,
0.22736477851867676,
-0.07379430532455444,
-0.07187400758266449,
-0.005152965430170298,
0.5516302585601807,
0.04848014563322067,
0.0069068968296051025,
-0.07739108055830002,
0.36484473943710327,
0.07465652376413345,
0.009919000789523125,
-0.340445339679718,
-0.19569101929664612,
-0.02013060636818409,
0.2146880030632019,
0.14358828961849213,
0.10107366740703583,
0.35850274562835693,
0.24883054196834564,
0.25857770442962646,
-0.5580341815948486,
-0.06824727356433868,
0.06371282786130905,
-0.35439532995224,
0.32179731130599976,
0.07151715457439423,
0.11270709335803986,
-0.4357551634311676,
-0.5167663097381592,
0.10148218274116516,
-0.1803208887577057,
-0.17382216453552246,
-0.1839197725057602,
0.08596949279308319,
0.011508528143167496,
0.011145628988742828,
-0.1652134358882904,
-0.3151877522468567,
-0.4701935052871704,
0.4872158467769623,
0.09355069696903229,
0.012351550161838531,
-0.2115931212902069,
0.10286280512809753,
0.19112642109394073,
0.30753713846206665,
-0.4058760106563568,
-0.08458282053470612,
-0.11212287843227386,
0.17284102737903595,
-0.30351442098617554,
-0.3640148937702179,
0.2457253634929657,
-0.001656949520111084,
0.14832952618598938,
-0.14083488285541534,
-0.39574307203292847,
-0.4240852892398834,
0.14300322532653809,
0.41359251737594604,
-0.07828358560800552,
-0.10546641796827316,
0.3681454658508301,
0.30440300703048706,
-0.0420130118727684,
0.03817467391490936,
-0.192295640707016,
0.0508681945502758,
0.16869769990444183,
0.0076816268265247345,
0.17415976524353027,
0.4478440284729004,
-0.05295201763510704,
0.5424441695213318,
0.009552352130413055,
-0.10797972977161407,
0.3428768515586853,
-0.16927751898765564,
0.14967021346092224,
-0.18175308406352997,
-0.319373220205307,
0.15115338563919067,
-0.3060179352760315,
-0.19582462310791016,
0.20947304368019104,
-0.20764479041099548,
-0.05309424549341202,
-0.18952515721321106,
-0.32037150859832764,
-0.20097589492797852,
-0.09306791424751282,
0.029833821579813957,
-0.23752620816230774,
0.156463623046875,
-0.1557449996471405,
0.09935598075389862,
-0.29076942801475525,
-0.12070880085229874,
0.11356087028980255,
-0.20867720246315002,
0.5770147442817688,
-0.16749687492847443,
-0.42112231254577637,
-0.0825859010219574,
-0.6252845525741577,
0.1965455710887909,
0.1860693395137787,
-0.15528462827205658,
-0.05747545510530472,
0.12034853547811508,
0.009772460907697678,
0.03849652782082558,
0.7348803281784058,
-0.4013550281524658,
-0.33112430572509766,
0.05709007382392883,
-0.16235363483428955,
-0.3654547333717346,
0.2014375925064087,
-0.13272082805633545,
0.2850709557533264,
-0.03757660835981369,
0.6767836213111877,
-0.13659118115901947,
-0.02334553562104702,
-0.05528267100453377,
0.10918308794498444,
-0.2056286633014679,
0.026851486414670944,
0.08762620389461517,
-0.1469462662935257,
-0.45529791712760925,
0.0911584198474884,
0.08671601861715317,
0.06163886561989784,
-0.0440172404050827,
-0.09989798069000244,
-0.03849954530596733,
0.1075587347149849,
-0.07493863999843597,
0.04727977514266968,
0.25813788175582886,
0.1299954503774643,
0.1990947127342224,
0.10186618566513062,
-0.014468442648649216,
0.1493729203939438,
0.1615642011165619,
0.07210466265678406,
-0.10290880501270294,
0.1540309637784958,
-0.0027564987540245056,
0.2235535979270935,
0.11884252727031708,
0.08489297330379486,
0.11754906177520752,
-0.2031824290752411,
-0.004076026380062103,
-0.3261542022228241,
0.06665314733982086,
0.07159080356359482,
0.0647670328617096,
-0.28723570704460144,
-0.3644888997077942,
0.4704146385192871,
0.1673503816127777,
-0.020855695009231567,
0.22646905481815338,
0.37055498361587524,
-0.17565099895000458,
0.6394639611244202,
0.273989200592041,
0.7566297054290771,
-0.08410915732383728,
0.03326423093676567,
0.16149601340293884,
0.23497456312179565,
0.8642579317092896,
-0.23640432953834534,
0.2905412018299103,
-0.39990198612213135,
-0.09336236119270325,
-0.16041818261146545,
0.1759682595729828,
0.12120052427053452,
0.11023357510566711,
-0.33662742376327515,
-0.033777978271245956,
0.18945783376693726,
0.20027953386306763,
-0.3279902935028076,
0.6137455701828003,
-0.21865233778953552,
-0.34263134002685547,
0.16190332174301147,
0.18980619311332703,
-0.10368891060352325,
0.08257024735212326,
-0.05620059370994568,
-0.277529239654541,
-0.02216172218322754,
-0.08045177161693573,
-0.4885217845439911,
-0.11336976289749146,
-0.19357842206954956,
0.43708470463752747,
-0.24503064155578613,
-0.24719330668449402,
0.23615704476833344,
0.4615713655948639,
0.2987971603870392,
0.07769554853439331,
-0.3549635708332062,
-0.08073222637176514,
-0.2980918884277344,
-0.22745656967163086,
0.015854068100452423,
-0.20664040744304657,
0.3275509178638458,
-0.12681803107261658,
-0.3526268005371094,
0.2623128294944763,
0.07432686537504196,
-0.24676935374736786,
-0.021491900086402893,
-0.0970691442489624,
0.026729293167591095,
-0.47942250967025757,
-0.320243239402771,
-0.06404802948236465,
-0.33671674132347107,
-0.25896498560905457,
0.13709956407546997,
-0.10170048475265503,
0.15783017873764038,
0.07551653683185577,
0.09992985427379608,
0.23115402460098267,
-0.05211089923977852,
0.2416738122701645,
-0.034998420625925064,
0.014730975031852722,
0.08189813047647476,
0.19686849415302277,
-0.19193974137306213,
-0.1676875352859497,
0.011715002357959747,
0.15851819515228271,
-0.16970407962799072,
-0.012994261458516121,
0.05300990864634514,
-0.03562198579311371,
0.013101406395435333,
0.5684001445770264,
0.3337212800979614,
0.18415170907974243,
-0.06989780813455582,
0.04466867446899414,
-0.34144535660743713,
0.4193991422653198,
0.011795633472502232,
0.14112237095832825,
0.34129470586776733,
-0.1833079606294632,
0.07159540802240372,
0.11627532541751862,
-0.37723562121391296,
-0.17695927619934082,
-0.26595452427864075,
-0.10238528251647949,
0.4834575653076172,
-0.09532706439495087,
-0.1005060002207756,
-0.2263357788324356,
0.10191857814788818,
0.24511142075061798,
-0.010950706899166107,
-0.19132204353809357,
0.1564214527606964,
0.09753822535276413,
0.12870195508003235,
-0.06634916365146637,
-0.19626250863075256,
-0.19563935697078705,
-0.20485973358154297,
-0.2036450207233429,
0.026916444301605225,
0.3250332474708557,
-0.10190224647521973,
-0.11158688366413116,
0.22519859671592712,
0.22937294840812683,
-0.2945813834667206,
0.013040177524089813,
0.12937714159488678,
0.2307487577199936,
-0.2294614017009735,
0.07262089848518372,
0.2910529673099518,
-0.06992143392562866,
-0.07326458394527435,
0.1788673996925354,
0.3469666838645935,
0.24166712164878845,
0.3871408998966217,
0.027425672858953476,
-0.20050203800201416,
0.22635740041732788,
0.3654395639896393,
-0.14627471566200256,
0.058527350425720215,
0.019298464059829712,
0.3538266122341156,
0.24492010474205017,
-0.24812908470630646,
-0.18833337724208832,
0.2540210485458374,
-0.28460225462913513,
0.19988159835338593,
0.13608238101005554,
0.4695429801940918,
0.25407493114471436,
-0.3773428499698639,
0.22544333338737488,
0.6699168682098389,
-0.14861539006233215,
0.10111409425735474,
0.19999544322490692,
-0.03324458748102188,
0.02629561349749565,
0.3173159956932068,
0.21023854613304138,
0.34738409519195557,
0.12306271493434906,
0.13471375405788422,
0.2925539016723633,
0.32832181453704834,
0.12061208486557007,
0.32458406686782837,
-0.3221997320652008,
0.18825210630893707,
-0.6043732166290283,
-0.3289833664894104,
-0.01862667128443718,
-0.04797525331377983,
-0.001245930790901184,
-0.3742929697036743,
-0.26727095246315,
-0.3918270170688629,
0.3888026177883148,
-0.35237395763397217,
0.08959425985813141,
0.04394576698541641,
-0.17321999371051788,
0.35151851177215576,
0.10224534571170807,
0.00036059506237506866,
-0.27639925479888916,
0.403252512216568,
-0.1266232430934906,
-0.0023860223591327667,
0.3803176283836365,
-0.012550614774227142,
0.15771035850048065,
0.19308698177337646,
-0.16571098566055298,
-0.1384311020374298,
-0.012059569358825684,
-0.1731927990913391,
-0.5516188144683838,
0.15159320831298828,
0.4140838384628296,
-0.10245560109615326,
0.046151790767908096,
0.3386722207069397,
-0.0864877700805664,
-0.07895607501268387,
0.10748410224914551,
0.04692286252975464,
0.19983166456222534,
0.18631014227867126,
0.22455772757530212,
0.22965791821479797,
-0.10829167068004608,
0.1760663539171219,
0.0151157071813941,
0.14583127200603485,
-0.24946996569633484,
0.008103158324956894,
0.08747424185276031,
-0.34326714277267456,
-0.12455405294895172,
-0.005885131657123566,
-0.22283965349197388,
-0.07280820608139038,
0.3028850257396698,
-0.07207003235816956,
0.051124103367328644,
-0.22575628757476807,
0.13804540038108826,
-0.0542939268052578,
0.2907651662826538,
0.252768874168396,
-0.04920864850282669,
-0.16060206294059753,
0.15838491916656494,
-0.32085978984832764,
0.06484361737966537,
0.09804454445838928,
-0.10775993019342422,
-0.09443899989128113,
0.00001619011163711548,
0.36386972665786743,
0.11513504385948181,
-0.37414997816085815,
-0.07706093788146973,
0.08117229491472244,
0.2337619662284851,
-0.1639251708984375,
0.1237599328160286,
-0.12694725394248962,
0.06670286506414413,
0.05218253284692764,
-0.12047985941171646,
0.437136709690094,
0.23626494407653809,
0.06896518915891647,
-0.3083120882511139,
-0.1050109788775444,
0.1343575417995453,
-0.44885683059692383,
0.5656915903091431,
-0.08030339330434799,
0.4274479150772095,
-0.4238605499267578,
0.07395265251398087,
0.056750182062387466,
-0.04641113057732582,
-0.21888309717178345,
0.1780565083026886,
0.09597424417734146,
0.45031338930130005,
-0.14630767703056335,
0.09879575669765472,
-0.31060752272605896,
-0.007973559200763702,
-0.14932124316692352,
0.2124827802181244,
-0.23153682053089142,
-0.0879138708114624,
-0.39405614137649536,
-0.2707001864910126,
0.29218176007270813,
0.20910048484802246,
0.10012661665678024,
0.007501393556594849,
-0.06342774629592896,
-0.3123524785041809,
0.36043256521224976,
-0.3821074962615967,
-0.08972781151533127,
-0.20730601251125336,
-0.08710341155529022,
0.3069866895675659,
0.14319416880607605,
-0.18854612112045288,
-0.18167953193187714,
0.2759511470794678,
0.1492396891117096,
0.20550218224525452,
0.09886844456195831,
0.011339012533426285,
-0.10036119073629379,
-0.09892795979976654,
-0.0679871141910553,
-0.16649885475635529,
-0.20065107941627502,
0.007933154702186584,
-0.22187069058418274
] |
https://github.com/huggingface/datasets/issues/5675 | The dataset still can be found, if instead of using the search form you just enter the language code in the url, like https://huggingface.co/datasets?language=language:myv.
But of course having a more complete list of languages in the search form (or just a fallback to the language codes, if they are missing from the code=>language mapping) would be much more convenient! | Filter datasets by language code | Hi! I use the language search field on https://huggingface.co/datasets
However, some of the datasets tagged by ISO language code are not accessible by this search form.
For example, [myv_ru_2022](https://huggingface.co/datasets/slone/myv_ru_2022) is has `myv` language tag but it is not included in Languages search form.
I've also noticed the same problem with `mhr` (see https://huggingface.co/datasets/AigizK/mari-russian-parallel-corpora) | 59 | Filter datasets by language code
Hi! I use the language search field on https://huggingface.co/datasets
However, some of the datasets tagged by ISO language code are not accessible by this search form.
For example, [myv_ru_2022](https://huggingface.co/datasets/slone/myv_ru_2022) is has `myv` language tag but it is not included in Languages search form.
I've also noticed the same problem with `mhr` (see https://huggingface.co/datasets/AigizK/mari-russian-parallel-corpora)
The dataset still can be found, if instead of using the search form you just enter the language code in the url, like https://huggingface.co/datasets?language=language:myv.
But of course having a more complete list of languages in the search form (or just a fallback to the language codes, if they are missing from the code=>language mapping) would be much more convenient! | [
-0.06282593309879303,
-0.20659342408180237,
-0.17733187973499298,
0.23492112755775452,
0.07310470938682556,
-0.2612895369529724,
-0.009905064478516579,
0.3076384663581848,
0.44437944889068604,
0.15708518028259277,
-0.44240567088127136,
-0.1137557327747345,
-0.27763545513153076,
0.29990094900131226,
0.2964824140071869,
0.16404107213020325,
-0.020210526883602142,
-0.1692112237215042,
0.01707848161458969,
-0.219722181558609,
-0.2343570590019226,
0.2362818419933319,
-0.002726040780544281,
0.04628986492753029,
-0.12251054495573044,
0.3327702581882477,
0.3682873249053955,
0.02056674286723137,
-0.1717538833618164,
-0.00330912321805954,
0.14625594019889832,
0.04806356132030487,
0.08921802788972855,
0.13531069457530975,
-0.00011606793850660324,
0.11208537220954895,
-0.060784801840782166,
-0.22003650665283203,
-0.30533167719841003,
-0.5413578152656555,
-0.19370155036449432,
0.1011655405163765,
-0.06611203402280807,
0.26418226957321167,
-0.2941133379936218,
0.016287244856357574,
0.14257457852363586,
-0.6034826636314392,
0.336247980594635,
0.5812084674835205,
0.16380074620246887,
0.28653067350387573,
-0.07468193024396896,
0.1224638819694519,
0.24936628341674805,
0.28169211745262146,
-0.14779074490070343,
0.06291642785072327,
0.6064860820770264,
0.22004878520965576,
0.23858265578746796,
0.5765582323074341,
0.08307453244924545,
-0.47296249866485596,
-0.1608521044254303,
-0.012047329917550087,
-0.5245141386985779,
-0.4303275942802429,
0.41580435633659363,
0.0746690183877945,
0.3960093557834625,
-0.15496820211410522,
-0.4995861053466797,
-0.20921488106250763,
-0.3247128129005432,
-0.027959536761045456,
0.22046028077602386,
0.13666535913944244,
-0.09159912914037704,
0.3980907201766968,
-0.18462440371513367,
-0.2725265622138977,
0.17988841235637665,
0.19969554245471954,
-0.0903533548116684,
0.7633774280548096,
-0.1651536524295807,
-0.0817963182926178,
0.20804493129253387,
-0.2515133321285248,
-0.042642541229724884,
-0.06539970636367798,
0.3500540554523468,
0.46418455243110657,
-0.15351766347885132,
0.008703157305717468,
-0.08710230886936188,
0.3659353256225586,
0.2755991518497467,
-0.10611328482627869,
0.02919779345393181,
0.24828916788101196,
-0.24430681765079498,
-0.03459055349230766,
0.09603086113929749,
-0.21710583567619324,
0.3193540573120117,
-0.20050503313541412,
0.29239803552627563,
-0.2762807607650757,
-0.10945489257574081,
-0.216443732380867,
-0.05641453340649605,
-0.20203271508216858,
-0.25857436656951904,
-0.013379882089793682,
0.3117935359477997,
-0.2476925253868103,
-0.24041908979415894,
-0.16249345242977142,
-0.14947199821472168,
-0.40534263849258423,
0.32219910621643066,
0.12714895606040955,
0.2709481716156006,
-0.11758556962013245,
-0.15786507725715637,
-0.009024792350828648,
-0.26246774196624756,
-0.5184425711631775,
-0.030582398176193237,
-0.07030453532934189,
0.016277097165584564,
0.06647562235593796,
0.312144011259079,
-0.5598866939544678,
0.22272615134716034,
-0.009377554059028625,
0.10896044969558716,
-0.17612871527671814,
-0.04516572505235672,
-0.055835939943790436,
0.35986948013305664,
0.08774545788764954,
-0.18109890818595886,
-0.007007423788309097,
0.12851382791996002,
-0.6172101497650146,
-0.3093394935131073,
-0.03990383446216583,
-0.29233068227767944,
-0.03536941111087799,
-0.16872066259384155,
0.10432358086109161,
-0.31537914276123047,
-0.07728394120931625,
0.03881027549505234,
0.5541767477989197,
-0.26302632689476013,
-0.009300097823143005,
0.17662771046161652,
0.04631530120968819,
-0.020366348326206207,
0.3570268750190735,
0.2803179919719696,
0.3180387616157532,
-0.32522648572921753,
-0.23670488595962524,
0.03595902398228645,
-0.20225518941879272,
0.14138484001159668,
0.16303561627864838,
-0.08020022511482239,
0.09430058300495148,
-0.1404169201850891,
-0.05511627346277237,
0.5970926284790039,
-0.28253117203712463,
-0.36002665758132935,
-0.11262445151805878,
0.03969144821166992,
-0.040104594081640244,
0.08213061839342117,
-0.07965613901615143,
0.41341954469680786,
0.11944560706615448,
0.0880492553114891,
0.12729303538799286,
-0.09214598685503006,
-0.13423138856887817,
-0.076048344373703,
0.15794721245765686,
0.1544506996870041,
0.43177899718284607,
0.29139071702957153,
-0.12540414929389954,
0.4811883568763733,
0.290243923664093,
0.21375586092472076,
-0.05159533768892288,
0.15466779470443726,
-0.01573285087943077,
0.13637804985046387,
0.09229349344968796,
0.09277977049350739,
-0.45917046070098877,
-0.11555047333240509,
0.09135109186172485,
0.05009610950946808,
0.10835063457489014,
-0.1474878191947937,
-0.002052202820777893,
-0.1389375478029251,
-0.1223050206899643,
-0.23413057625293732,
-0.04853082820773125,
0.08416632562875748,
-0.10292163491249084,
-0.160165935754776,
0.05152483284473419,
-0.23775862157344818,
0.12212857604026794,
0.10254725068807602,
0.16380588710308075,
-0.3685852289199829,
0.18472662568092346,
0.0962391123175621,
0.150129497051239,
-0.18396881222724915,
0.3350154459476471,
0.09249738603830338,
-0.1151057630777359,
0.06988129019737244,
-0.12992876768112183,
0.4084397852420807,
-0.36502715945243835,
0.624075174331665,
0.2093341201543808,
0.29283908009529114,
-0.39677584171295166,
-0.061976104974746704,
0.15014275908470154,
0.045149337500333786,
0.2878628075122833,
-0.0950273647904396,
0.09983053803443909,
0.07911096513271332,
0.38130396604537964,
0.18381154537200928,
0.03326793015003204,
0.5002596378326416,
0.12471287697553635,
-0.37396836280822754,
-0.4487835168838501,
0.21581950783729553,
-0.2255226969718933,
0.537269115447998,
0.29651114344596863,
-0.5689271092414856,
0.07944981753826141,
0.5275264382362366,
0.021276362240314484,
0.10104578733444214,
0.38985446095466614,
-0.05878868326544762,
0.2240990400314331,
-0.026064494624733925,
-0.04374697804450989,
-0.09288259595632553,
0.35421574115753174,
0.1607137769460678,
-0.18097041547298431,
0.11801961064338684,
-0.1536790430545807,
0.13538393378257751,
0.07452317327260971,
-0.14448611438274384,
-0.1332467496395111,
0.07903068512678146,
-0.09605897963047028,
-0.47037333250045776,
-0.044854603707790375,
-0.2810697853565216,
-0.31293755769729614,
0.004776611924171448,
0.0947813168168068,
-0.6045886278152466,
-0.09774608165025711,
-0.3984415829181671,
0.18358032405376434,
-0.5636658668518066,
0.05774052441120148,
0.29403185844421387,
-0.39443063735961914,
0.029291555285453796,
-0.001107487827539444,
-0.19063130021095276,
0.3355274200439453,
-0.4197697937488556,
-0.14845572412014008,
0.1866111159324646,
-0.052078597247600555,
-0.14236977696418762,
0.06384044885635376,
0.22026509046554565,
0.15492884814739227,
0.5293763875961304,
-0.3325313925743103,
0.23126965761184692,
-0.3023168444633484,
-0.6905136704444885,
0.16270767152309418,
0.02755456045269966,
-0.04331926256418228,
-0.19989830255508423,
-0.07805050909519196,
0.02066177874803543,
0.06669938564300537,
0.11435416340827942,
0.14828860759735107,
-0.1369592249393463,
0.017731748521327972,
-0.040480419993400574,
0.26634877920150757,
-0.015236496925354004,
-0.14767791330814362,
-0.5305250287055969,
-0.09492805600166321,
-0.09710259735584259,
-0.20805075764656067,
0.11641687154769897,
-0.005511712282896042,
-0.14826908707618713,
0.07408290356397629,
-0.49559545516967773,
-0.07987953722476959,
-0.20620164275169373,
-0.06270574033260345,
0.256362646818161,
-0.16819506883621216,
0.04014713317155838,
0.3183920681476593,
0.08035443723201752,
0.1377669721841812,
0.17212902009487152,
-0.02004273235797882,
0.12244151532649994,
-0.19009774923324585,
-0.043482858687639236,
0.29275012016296387,
0.1394236832857132,
0.31419065594673157,
-0.10391838103532791,
0.06006245315074921,
-0.2149796336889267,
-0.2758002281188965,
0.038732435554265976,
-0.29144635796546936,
0.6274479627609253,
0.06236598268151283,
0.22152625024318695,
0.04884609580039978,
0.42855384945869446,
0.19359007477760315,
0.19645951688289642,
0.35512006282806396,
0.3130696713924408,
0.4076229929924011,
-0.1666548252105713,
-0.2494063675403595,
-0.03579210117459297,
-0.098654605448246,
-0.028813127428293228,
0.20803263783454895,
0.39534690976142883,
0.11588715016841888,
-0.30259978771209717,
-0.15445435047149658,
-0.35856783390045166,
-0.1506880819797516,
0.03777877241373062,
0.36784806847572327,
0.4149245321750641,
0.26927614212036133,
-0.06511276960372925,
-0.01859387382864952,
-0.14435476064682007,
-0.25031593441963196,
0.34210774302482605,
0.34355777502059937,
0.2570388615131378,
-0.14147916436195374,
-0.4348001480102539,
-0.24453866481781006,
0.2753223180770874,
0.1582665741443634,
0.19210298359394073,
-0.24146386981010437,
0.010448813438415527,
0.2279573678970337,
0.25553908944129944,
0.18122941255569458,
-0.19606080651283264,
-0.2656037211418152,
-0.24659353494644165,
-0.287777841091156,
0.002942986786365509,
0.22361916303634644,
-0.06271819025278091,
-0.03801703825592995,
0.3960113525390625,
0.39877304434776306,
-0.18368235230445862,
-0.41960009932518005,
0.009155113250017166,
0.32719686627388,
-0.1438562422990799,
-0.02391163259744644,
-0.21477854251861572,
-0.1653268039226532,
-0.10563986003398895,
0.03561652824282646,
0.25192496180534363,
-0.02073514088988304,
0.02470005303621292,
0.03174058347940445,
0.10534394532442093,
-0.06123531609773636,
0.27072572708129883,
0.12373322248458862,
0.13371962308883667,
0.26623624563217163,
0.060363076627254486,
0.4080583155155182,
0.26841315627098083,
-0.05488809198141098,
0.6856345534324646,
-0.25086814165115356,
-0.44583940505981445,
0.0492219477891922,
-0.24830342829227448,
0.4380949139595032,
0.3528701066970825,
-0.006288439035415649,
0.3631821870803833,
0.20782142877578735,
-0.07282834500074387,
-0.08888252079486847,
0.10950472205877304,
-0.11439486593008041,
0.14216181635856628,
-0.5235445499420166,
-0.3606477975845337,
0.21192610263824463,
-0.09271814674139023,
-0.062468744814395905,
0.024995919317007065,
0.5963813066482544,
-0.37810084223747253,
0.12518873810768127,
0.03327280655503273,
0.8000400066375732,
-0.11442233622074127,
-0.0767723098397255,
-0.5390214323997498,
-0.25477325916290283,
0.16638639569282532,
0.11594538390636444,
-0.09828110039234161,
0.10784800350666046,
-0.17499615252017975,
-0.022365298122167587,
0.06861909478902817,
0.2082788050174713,
0.23428764939308167,
0.0424521267414093,
0.2197090983390808,
0.04222525656223297,
0.14024022221565247,
0.2281438112258911,
0.18566107749938965,
0.09673134237527847,
-0.2621152400970459,
-0.27646681666374207,
0.07830092310905457,
-0.11290352046489716,
0.3206474781036377,
0.1215314120054245,
-0.21752378344535828,
0.0785449743270874,
-0.278325617313385,
-0.26868391036987305,
-0.2696346044540405,
-0.12727400660514832,
-0.2261039763689041,
0.11747413873672485,
-0.22272679209709167,
0.6030474305152893,
-0.06663502752780914,
0.5832449793815613,
0.2880353331565857,
-0.18243978917598724,
0.25707492232322693,
-0.04716084897518158,
0.08124828338623047,
-0.163221538066864,
0.03027379885315895,
-0.06514343619346619,
-0.0021084770560264587,
-0.2620164752006531,
0.061411626636981964,
0.15791355073451996,
-0.3564301133155823,
-0.3664728105068207,
0.23403716087341309,
-0.4554910659790039,
0.2780866026878357,
-0.0044852010905742645,
-0.11812672019004822,
-0.09617091715335846,
-0.16302421689033508,
0.09848958253860474,
0.05279719829559326,
0.25163158774375916,
-0.2234879434108734,
0.230686217546463,
-0.036653004586696625,
-0.25938576459884644,
0.1474624127149582,
-0.1463434100151062,
0.12388081848621368,
0.20837436616420746,
0.002196282148361206,
-0.36932629346847534,
-0.1164243072271347,
0.1615978479385376,
0.33686983585357666,
-0.38508105278015137,
-0.31202659010887146,
-0.17506441473960876,
-0.01571694016456604,
-0.019193319603800774,
-0.06988120079040527,
-0.01759018562734127,
-0.43602341413497925,
-0.1680472195148468,
-0.169492706656456,
0.05381212383508682,
0.3534071743488312,
-0.03854522481560707,
-0.16378836333751678,
-0.10571057349443436,
0.3064226806163788,
0.007381901144981384,
0.008619898930191994,
-0.25026464462280273,
-0.06654900312423706,
-0.05174960941076279,
0.10100136697292328,
0.007218848913908005,
0.19276629388332367,
0.09313976019620895,
-0.2857109606266022,
-0.039406683295965195,
0.0041883476078510284,
-0.03433897718787193,
-0.1440717577934265,
-0.10450215637683868,
0.03922455012798309,
0.01779613271355629,
-0.129738450050354,
0.056083571165800095,
0.01709931343793869,
0.233836829662323,
-0.2958216071128845,
-0.040572620928287506,
0.20208925008773804,
0.36417993903160095,
-0.025583084672689438,
-0.2673344314098358,
-0.21750853955745697,
0.2521654963493347,
-0.027722515165805817,
0.15461933612823486,
0.4706794023513794,
0.3953789472579956,
0.023896431550383568,
0.06336204707622528,
0.08874659240245819,
0.010432004928588867,
0.08013533800840378,
0.11867013573646545,
0.1330605298280716,
0.02792903035879135,
-0.14145691692829132,
0.21082863211631775,
0.43422502279281616,
0.24881207942962646,
0.0278534684330225,
-0.02456660009920597,
0.2278193235397339,
0.3861962854862213,
0.08667369186878204,
-0.3809833824634552,
-0.09031142294406891,
0.25879961252212524,
-0.008529752492904663,
0.09137676656246185,
0.27465546131134033,
0.24851447343826294,
0.43146154284477234,
0.559537410736084,
-0.1592709869146347,
0.1641460806131363,
0.1686629354953766,
0.20572923123836517,
-0.0017454931512475014,
0.5221904516220093,
0.2154984474182129,
0.24022212624549866,
0.10409891605377197,
-0.2516707181930542,
0.25808924436569214,
-0.35025840997695923,
0.28816449642181396,
-0.3272436261177063,
0.2586999833583832,
0.08123670518398285,
-0.24563902616500854,
-0.10121249407529831,
-0.19397594034671783,
-0.23713821172714233,
0.1507800668478012,
-0.2476813793182373,
0.026896879076957703,
0.021135546267032623,
-0.1264459192752838,
0.07741132378578186,
0.03941855952143669,
0.15625189244747162,
-0.038329340517520905,
0.004305131733417511,
-0.2542756199836731,
-0.2257070094347,
-0.03471488878130913,
-0.019369227811694145,
-0.23237572610378265,
-0.2524046003818512,
-0.11990925669670105,
0.1964261531829834,
-0.20800040662288666,
-0.4665105938911438,
0.03913335129618645,
-0.17434632778167725,
-0.030710596591234207,
0.32322385907173157,
-0.13841208815574646,
0.050364114344120026,
0.30153852701187134,
0.007119316607713699,
-0.216654971241951,
-0.00019516516476869583,
0.2116132229566574,
-0.012424984946846962,
-0.40855225920677185,
-0.06979680806398392,
-0.1554892361164093,
0.2055993527173996,
0.16249127686023712,
-0.00020145904272794724,
0.2771763205528259,
0.055634185671806335,
0.001860789954662323,
-0.03784547001123428,
0.1347232460975647,
0.07995957881212234,
-0.1215287446975708,
-0.18453580141067505,
-0.13603614270687103,
0.4025968909263611,
-0.2654419541358948,
-0.23014508187770844,
-0.5314797759056091,
0.3869081735610962,
0.19722767174243927,
0.11562450230121613,
0.19585749506950378,
-0.00738312304019928,
0.033086635172367096,
0.31526026129722595,
0.2307092398405075,
0.03606385737657547,
0.2540847063064575,
0.029387980699539185,
-0.26477938890457153,
-0.544745922088623,
-0.3769778609275818,
-0.4688383936882019,
0.23375168442726135,
0.04998686537146568,
-0.08590972423553467,
0.3289783298969269,
0.16150163114070892,
0.3704846203327179,
0.025183603167533875,
0.33870574831962585,
-0.13439804315567017,
0.020798280835151672,
-0.29984062910079956,
0.05888638272881508,
0.4619452655315399,
-0.08808818459510803,
0.06787140667438507,
0.2990366816520691,
-0.26545536518096924,
-0.06539279967546463,
-0.3142105042934418,
0.23928341269493103,
-0.12139637768268585,
-0.2886241674423218,
0.11129651963710785,
0.06303414702415466,
0.37845873832702637,
-0.25205913186073303,
0.23123395442962646,
-0.21073269844055176,
-0.1184597760438919,
-0.05629676952958107,
0.16295623779296875,
0.14384879171848297,
0.14061366021633148,
-0.16077986359596252,
-0.5107739567756653,
-0.004074733704328537,
0.4610477387905121,
-0.13739877939224243,
-0.08022406697273254,
-0.03362301364541054,
-0.16080395877361298,
0.06979905068874359,
-0.13868899643421173,
-0.06500964611768723,
0.35261109471321106,
-0.15598660707473755,
-0.24150040745735168,
-0.02794066071510315,
-0.11559177190065384,
0.3617374897003174,
-0.33447760343551636,
-0.3232145309448242,
-0.16179679334163666,
0.15924322605133057,
0.5859810709953308,
-0.09508621692657471,
-0.1501743197441101,
-0.07429299503564835,
0.12005345523357391,
0.02056019753217697,
0.18943409621715546,
0.1160796657204628,
0.26109644770622253,
0.014407388865947723,
-0.13606776297092438,
-0.19791854918003082,
0.38888290524482727,
0.040784403681755066,
-0.05405045673251152,
-0.11479276418685913
] |
https://github.com/huggingface/datasets/issues/5675 | Thanks @mariosasko!
Do you think it is possible to turn this into a more scalable pipeline? Such as:
1. Looping through all the datasets on the hub and collecting the set of all their language codes;
2. Selecting the codes not covered yet in `Language.ts`
3. Looking up their codes at https://iso639-3.sil.org/code_tables/639/data
4. Adding all the newly found language codes to `Language.ts` | Filter datasets by language code | Hi! I use the language search field on https://huggingface.co/datasets
However, some of the datasets tagged by ISO language code are not accessible by this search form.
For example, [myv_ru_2022](https://huggingface.co/datasets/slone/myv_ru_2022) is has `myv` language tag but it is not included in Languages search form.
I've also noticed the same problem with `mhr` (see https://huggingface.co/datasets/AigizK/mari-russian-parallel-corpora) | 62 | Filter datasets by language code
Hi! I use the language search field on https://huggingface.co/datasets
However, some of the datasets tagged by ISO language code are not accessible by this search form.
For example, [myv_ru_2022](https://huggingface.co/datasets/slone/myv_ru_2022) is has `myv` language tag but it is not included in Languages search form.
I've also noticed the same problem with `mhr` (see https://huggingface.co/datasets/AigizK/mari-russian-parallel-corpora)
Thanks @mariosasko!
Do you think it is possible to turn this into a more scalable pipeline? Such as:
1. Looping through all the datasets on the hub and collecting the set of all their language codes;
2. Selecting the codes not covered yet in `Language.ts`
3. Looking up their codes at https://iso639-3.sil.org/code_tables/639/data
4. Adding all the newly found language codes to `Language.ts` | [
-0.23549909889698029,
-0.3141016364097595,
-0.16945230960845947,
0.31763502955436707,
0.04180864617228508,
-0.19436626136302948,
-0.02594975009560585,
0.31811797618865967,
0.4529891312122345,
0.14891573786735535,
-0.3567380905151367,
-0.07253128290176392,
-0.27924197912216187,
0.4948565363883972,
0.20387639105319977,
-0.007875122129917145,
-0.011359930038452148,
-0.23771710693836212,
0.13701751828193665,
-0.08302731812000275,
-0.08534584194421768,
0.12838798761367798,
-0.02671029418706894,
-0.12914611399173737,
-0.0993027538061142,
0.2429409921169281,
0.39031243324279785,
-0.011733664199709892,
-0.37656623125076294,
0.020773790776729584,
0.08524199575185776,
0.15146756172180176,
0.18752503395080566,
0.17660942673683167,
-0.0001299408177146688,
-0.038779616355895996,
-0.021432776004076004,
-0.27411532402038574,
-0.11342774331569672,
-0.41639983654022217,
-0.16475404798984528,
0.10197844356298447,
-0.08478710055351257,
0.23725266754627228,
-0.1434451937675476,
0.2710843086242676,
0.16887392103672028,
-0.5439006090164185,
0.4582471549510956,
0.37602347135543823,
0.035266321152448654,
0.3280850052833557,
-0.05967685207724571,
0.23204278945922852,
0.243545264005661,
0.2065660059452057,
-0.22901901602745056,
0.020145606249570847,
0.7807228565216064,
0.2138950675725937,
0.22599758207798004,
0.5543957352638245,
0.032108090817928314,
-0.4812936782836914,
-0.04955798014998436,
-0.26420602202415466,
-0.47690433263778687,
-0.4432333707809448,
0.32580992579460144,
0.14234383404254913,
0.1966312676668167,
-0.1064460426568985,
-0.5829046964645386,
-0.33848387002944946,
-0.39774277806282043,
-0.12804505228996277,
-0.0037879329174757004,
-0.04715295135974884,
-0.006015196442604065,
0.13564997911453247,
-0.16946233808994293,
-0.509107768535614,
0.00810793787240982,
0.024031445384025574,
-0.10350560396909714,
0.8470381498336792,
-0.04426472634077072,
-0.11194401234388351,
0.236623153090477,
-0.08914799988269806,
0.24050724506378174,
-0.09033875167369843,
0.4575279951095581,
0.3274935483932495,
-0.30528947710990906,
0.15748505294322968,
0.15922705829143524,
0.49913910031318665,
0.2668064832687378,
-0.10222768783569336,
-0.025051333010196686,
0.2983185648918152,
-0.1358226090669632,
-0.0803423523902893,
0.18312928080558777,
-0.10560613125562668,
0.24893411993980408,
-0.04918443784117699,
0.14376413822174072,
-0.23410364985466003,
-0.1972588300704956,
-0.1810503751039505,
-0.21835260093212128,
-0.2397119700908661,
-0.41981562972068787,
0.24244429171085358,
0.049366578459739685,
-0.2713538408279419,
-0.3850654065608978,
-0.09462445974349976,
0.07574712485074997,
-0.4007641077041626,
0.4204103946685791,
0.08077619969844818,
0.2922983169555664,
0.04703478515148163,
-0.05246075615286827,
0.0651278868317604,
-0.3466835618019104,
-0.5291312336921692,
0.01233365386724472,
0.0054535288363695145,
-0.030181385576725006,
0.1126471757888794,
0.22057057917118073,
-0.50080806016922,
0.09321942925453186,
-0.2499965876340866,
0.3242286145687103,
-0.21531382203102112,
0.003769516944885254,
0.00707588717341423,
0.20300953090190887,
0.11921845376491547,
0.04987512528896332,
0.03355497121810913,
0.028171855956315994,
-0.4103843867778778,
-0.31767207384109497,
-0.14693467319011688,
-0.2888326644897461,
-0.21630993485450745,
0.04362332820892334,
-0.07380368560552597,
-0.3151770234107971,
0.04722517356276512,
-0.20712082087993622,
0.6218454241752625,
-0.01721769943833351,
-0.0308983251452446,
-0.03335411846637726,
0.04794907942414284,
-0.16709940135478973,
0.3192460238933563,
0.15380114316940308,
0.42298218607902527,
-0.3477696180343628,
-0.21170350909233093,
-0.027975091710686684,
-0.06962007284164429,
0.18429270386695862,
0.037756357342004776,
-0.03555251657962799,
0.3587632179260254,
-0.08904360234737396,
0.012759983539581299,
0.608249306678772,
-0.6402444243431091,
-0.3329564034938812,
-0.06145415082573891,
-0.0359964445233345,
-0.11188526451587677,
0.2227635532617569,
-0.15226027369499207,
0.6120946407318115,
-0.05210728570818901,
0.1208452433347702,
0.1944848746061325,
-0.2736859917640686,
-0.1492433398962021,
-0.08380818367004395,
0.15338757634162903,
0.17004898190498352,
0.36679893732070923,
0.5411146879196167,
-0.10640616714954376,
0.2768856883049011,
0.3912317156791687,
0.19123806059360504,
-0.10282932221889496,
0.30271053314208984,
0.043066322803497314,
0.025004947558045387,
0.07995389401912689,
0.15761396288871765,
-0.4854491651058197,
0.077296182513237,
0.05896032601594925,
-0.05486959218978882,
0.0073731932789087296,
-0.056405890733003616,
-0.10613038390874863,
-0.08622846007347107,
-0.09037607908248901,
-0.23553043603897095,
0.14601795375347137,
-0.0258469358086586,
-0.12301404774188995,
-0.08963970839977264,
-0.26961493492126465,
-0.2637650668621063,
0.1822464019060135,
-0.09628377109766006,
0.014382787048816681,
-0.4252655506134033,
0.40662020444869995,
0.11274813115596771,
0.10563299059867859,
-0.17184163630008698,
0.2839498519897461,
0.099630206823349,
-0.0399765707552433,
0.05229678377509117,
-0.22704488039016724,
0.33778515458106995,
-0.18469372391700745,
0.6880320310592651,
0.3489157259464264,
0.2870517373085022,
-0.18480980396270752,
0.016218526288866997,
-0.11402760446071625,
-0.03970007225871086,
0.16821029782295227,
0.038327887654304504,
0.2868273854255676,
-0.10281333327293396,
0.5704455971717834,
0.3400852084159851,
-0.019965816289186478,
0.3854723274707794,
0.2628079652786255,
-0.43551909923553467,
-0.203752338886261,
0.4066337049007416,
-0.2320096790790558,
0.38936060667037964,
0.1687740683555603,
-0.38201650977134705,
0.3768739104270935,
0.41798141598701477,
0.09042702615261078,
-0.008725730702280998,
0.27133649587631226,
0.1547270268201828,
0.21078278124332428,
-0.003622502088546753,
-0.10659456998109818,
-0.02511344850063324,
0.236138716340065,
0.2843483090400696,
-0.1540607064962387,
0.2200917899608612,
-0.04511869698762894,
0.015564627945423126,
0.15326307713985443,
0.07912696897983551,
0.2674364447593689,
0.0921623706817627,
-0.18703293800354004,
-0.4321710765361786,
-0.24865682423114777,
-0.0952206701040268,
-0.18808774650096893,
-0.011930041015148163,
0.16369587182998657,
-0.385326087474823,
0.03083273023366928,
-0.27928823232650757,
0.02993108704686165,
-0.3654839098453522,
-0.034317366778850555,
0.22201216220855713,
-0.14833572506904602,
-0.02579721435904503,
-0.08841680735349655,
-0.0928976982831955,
0.38287854194641113,
-0.28374361991882324,
-0.24540196359157562,
0.05169098824262619,
-0.12427957355976105,
0.015407521277666092,
-0.0653957650065422,
0.37615376710891724,
0.15112464129924774,
0.5020781755447388,
-0.30859375,
0.30595919489860535,
-0.3350013196468353,
-0.6413934230804443,
0.12626516819000244,
0.05655878782272339,
0.05752518028020859,
-0.17004935443401337,
-0.019960906356573105,
0.010597050189971924,
-0.009074963629245758,
0.04128796607255936,
0.025806128978729248,
-0.17767664790153503,
-0.013901803642511368,
-0.17916958034038544,
0.04503824561834335,
0.1587592512369156,
-0.10024650394916534,
-0.5942659974098206,
-0.13164196908473969,
0.047075022011995316,
-0.1779291331768036,
0.12842091917991638,
-0.21660766005516052,
-0.19595566391944885,
-0.1057608425617218,
-0.44655340909957886,
-0.06515613198280334,
-0.11490325629711151,
-0.052788302302360535,
0.23790201544761658,
-0.17789876461029053,
0.04970601573586464,
0.14862869679927826,
-0.06066596508026123,
0.41157376766204834,
0.23026025295257568,
0.01664874702692032,
0.05826566368341446,
-0.015163443982601166,
-0.08406884968280792,
0.14371249079704285,
0.25683826208114624,
0.502186119556427,
-0.03580543398857117,
0.2765752673149109,
-0.2562059164047241,
-0.1280040144920349,
-0.09596726298332214,
-0.22381643950939178,
0.5383313894271851,
0.007482897490262985,
0.3431369662284851,
0.10855120420455933,
0.39459314942359924,
0.3309192359447479,
0.3719019591808319,
0.39949262142181396,
0.3336767852306366,
0.16341565549373627,
-0.1657024323940277,
-0.3170720040798187,
0.015892010182142258,
-0.15578898787498474,
-0.32418450713157654,
0.22923369705677032,
0.32898855209350586,
0.11316137760877609,
-0.2740756869316101,
-0.21312348544597626,
-0.25754401087760925,
-0.18033456802368164,
0.10431915521621704,
0.26703086495399475,
0.5784026384353638,
0.2995882034301758,
-0.13796882331371307,
-0.36905762553215027,
-0.06064185872673988,
-0.2883826494216919,
0.3089330494403839,
0.5306321382522583,
0.1688707023859024,
-0.18314871191978455,
-0.5472089052200317,
-0.3579022288322449,
0.18868134915828705,
0.28636977076530457,
0.21043643355369568,
-0.16607794165611267,
0.15249159932136536,
0.2501962184906006,
0.008188281208276749,
0.3226115107536316,
-0.32948583364486694,
-0.22118863463401794,
-0.12310867756605148,
-0.33064764738082886,
-0.041022226214408875,
0.18849925696849823,
-0.09133129566907883,
0.06279852986335754,
0.5161861777305603,
0.34286218881607056,
-0.3257565498352051,
-0.36480024456977844,
0.04443081468343735,
0.324153333902359,
-0.15832608938217163,
-0.006228592246770859,
-0.269081175327301,
-0.26717618107795715,
-0.1986895501613617,
0.23385602235794067,
0.29480403661727905,
0.015002958476543427,
-0.022856900468468666,
-0.04963928833603859,
0.07289352267980576,
0.006063647568225861,
0.3341258466243744,
0.08322754502296448,
0.11051072925329208,
0.25110283493995667,
0.1849835067987442,
0.2630018889904022,
0.025623835623264313,
-0.00931558571755886,
0.7173976302146912,
-0.26207229495048523,
-0.3232039511203766,
0.10305288434028625,
-0.08201976865530014,
0.3434877395629883,
0.5546904802322388,
-0.11789937317371368,
0.37826788425445557,
0.03169722482562065,
0.07235349714756012,
-0.22583283483982086,
0.10830526053905487,
-0.08803807199001312,
0.21836254000663757,
-0.4709603488445282,
-0.3323826193809509,
0.24070590734481812,
0.0075998082756996155,
-0.17502695322036743,
0.2117280811071396,
0.47065362334251404,
-0.3379529118537903,
0.2423209697008133,
0.11922848224639893,
1.034591794013977,
-0.25813186168670654,
-0.14760662615299225,
-0.5216799974441528,
-0.17819885909557343,
0.021704241633415222,
-0.210999995470047,
-0.04526650905609131,
-0.05753912404179573,
-0.27030715346336365,
-0.1120358556509018,
0.032218754291534424,
0.20265565812587738,
0.2805745601654053,
0.08524306118488312,
0.28310245275497437,
0.0700782835483551,
0.20061078667640686,
0.16682583093643188,
0.2524775266647339,
0.023478930816054344,
-0.2229558378458023,
-0.31106802821159363,
-0.06332514435052872,
-0.05322613567113876,
0.22665166854858398,
-0.060278840363025665,
-0.24540020525455475,
0.06767654418945312,
-0.20044264197349548,
-0.38480114936828613,
-0.3532290756702423,
-0.03797134757041931,
-0.269512802362442,
0.08086170256137848,
-0.14133483171463013,
0.5392457246780396,
-0.19310247898101807,
0.5682622194290161,
0.22406134009361267,
-0.2723674178123474,
0.20711883902549744,
-0.19013787806034088,
-0.07549245655536652,
-0.0744875967502594,
-0.045579444617033005,
-0.08722922205924988,
-0.03504505008459091,
-0.3179285526275635,
-0.06303825229406357,
0.24381482601165771,
-0.437080979347229,
-0.39336323738098145,
0.2777782082557678,
-0.0986083596944809,
0.18846802413463593,
0.010255351662635803,
0.16361185908317566,
-0.24740763008594513,
-0.19385719299316406,
-0.01574154943227768,
0.10640422999858856,
0.12321589887142181,
0.1867579221725464,
0.22017699480056763,
-0.05346136540174484,
0.013953838497400284,
0.08680972456932068,
-0.01748020574450493,
-0.026475317776203156,
0.013923628255724907,
0.06460961699485779,
-0.429498553276062,
-0.03758833929896355,
0.05577585846185684,
0.26850423216819763,
-0.3757970333099365,
-0.13124772906303406,
-0.20764145255088806,
-0.2516379654407501,
-0.06405652314424515,
-0.10865675657987595,
0.05965849384665489,
-0.44009989500045776,
-0.0939970463514328,
-0.2414904087781906,
0.05483287572860718,
0.4250544309616089,
-0.07067206501960754,
-0.12494990229606628,
-0.18756917119026184,
0.2710876762866974,
-0.2336878627538681,
0.214773029088974,
-0.117324598133564,
-0.0742914229631424,
-0.06931543350219727,
0.20718584954738617,
-0.1015843003988266,
0.024349138140678406,
-0.034023065119981766,
-0.13487200438976288,
-0.18074637651443481,
0.12665024399757385,
-0.025756623595952988,
-0.044487982988357544,
0.03507637977600098,
0.19229041039943695,
0.06142992526292801,
0.01679113507270813,
0.15561087429523468,
-0.002527177333831787,
0.009340249001979828,
-0.34360694885253906,
0.001445278525352478,
0.20083540678024292,
0.3618103861808777,
-0.20164185762405396,
-0.024694040417671204,
-0.22127112746238708,
0.3383481502532959,
0.07735425233840942,
0.4222319722175598,
0.623281717300415,
0.11834181100130081,
0.24641147255897522,
0.27924585342407227,
0.08488059788942337,
-0.01285146176815033,
0.15468566119670868,
0.4061189591884613,
0.034910641610622406,
0.11148790270090103,
-0.08236326277256012,
0.2639086842536926,
0.37850403785705566,
0.3195701837539673,
0.27523308992385864,
0.1364837884902954,
0.43651092052459717,
0.14803382754325867,
-0.04535948112607002,
-0.3788660168647766,
-0.12949112057685852,
0.3581540286540985,
0.05862724408507347,
0.04727278649806976,
0.3155004680156708,
0.431629478931427,
0.3342350125312805,
0.565907895565033,
-0.12475790828466415,
0.10082662105560303,
0.18125441670417786,
0.1608392298221588,
-0.06247952580451965,
0.44825243949890137,
0.035342663526535034,
0.23518824577331543,
0.09549252688884735,
-0.11041098833084106,
0.4411930441856384,
-0.16033600270748138,
0.4318443536758423,
-0.28154051303863525,
0.34816622734069824,
0.00877886638045311,
-0.2711247205734253,
-0.3166288137435913,
-0.30103573203086853,
0.09079563617706299,
0.08238387852907181,
-0.3095043897628784,
-0.02563582733273506,
0.1338070034980774,
-0.2487057000398636,
-0.01416364312171936,
0.0900455191731453,
0.164200097322464,
-0.21251291036605835,
-0.02524503692984581,
-0.39870792627334595,
-0.26287201046943665,
0.02396361529827118,
0.08461502194404602,
-0.23029042780399323,
-0.22548842430114746,
-0.04210977256298065,
0.35339194536209106,
-0.14774908125400543,
-0.18169493973255157,
0.1322101503610611,
-0.07456053793430328,
-0.10133964568376541,
0.4822251498699188,
0.05441419780254364,
0.27230116724967957,
0.18090268969535828,
0.015470648184418678,
-0.0709104984998703,
0.09968198835849762,
-0.025671713054180145,
0.059063706547021866,
-0.4460490643978119,
-0.08494093269109726,
-0.16369269788265228,
0.268545001745224,
0.08623190224170685,
0.08242657035589218,
0.25378623604774475,
-0.11189939081668854,
0.004876226186752319,
-0.12400061637163162,
0.07764948904514313,
-0.14462974667549133,
-0.01606910303235054,
0.17591863870620728,
-0.10243315994739532,
0.39564740657806396,
-0.3411538600921631,
-0.1261729598045349,
-0.6143742203712463,
0.19592109322547913,
0.2953478693962097,
-0.11970841884613037,
0.16767634451389313,
0.04621957615017891,
-0.06573524326086044,
0.09467419981956482,
0.17884264886379242,
-0.026492442935705185,
0.48254823684692383,
-0.09631229937076569,
-0.28025487065315247,
-0.3659026324748993,
-0.28241443634033203,
-0.3559247553348541,
0.12633705139160156,
0.04990918189287186,
0.14654149115085602,
0.12593674659729004,
0.18192951381206512,
0.3296719789505005,
-0.18254022300243378,
0.4660138487815857,
0.09901751577854156,
-0.1244560107588768,
-0.25114670395851135,
0.1665661334991455,
0.3082249164581299,
-0.03873410075902939,
-0.21288135647773743,
0.22581815719604492,
-0.16725096106529236,
-0.19872310757637024,
-0.2896350920200348,
0.11396603286266327,
-0.1036212295293808,
-0.2671714723110199,
0.06849940121173859,
0.0844559445977211,
0.5753758549690247,
-0.22010672092437744,
0.24336346983909607,
-0.3945143520832062,
-0.12115926295518875,
-0.12920859456062317,
0.1251077950000763,
0.08961960673332214,
0.1428961306810379,
-0.2411448061466217,
-0.5593712329864502,
-0.035651423037052155,
0.2684316039085388,
-0.16022177040576935,
-0.0753960907459259,
-0.1911037713289261,
-0.0449710339307785,
-0.14003054797649384,
0.2484651356935501,
-0.15383413434028625,
0.3339877426624298,
-0.011573541909456253,
-0.03313000872731209,
-0.07471004128456116,
-0.16291163861751556,
0.5012181997299194,
-0.23445376753807068,
-0.49614983797073364,
-0.16087478399276733,
0.12051153182983398,
0.7539772987365723,
-0.19642822444438934,
-0.23286762833595276,
-0.14909422397613525,
0.07225892692804337,
-0.004133423790335655,
0.301985502243042,
0.30656832456588745,
0.22296656668186188,
-0.06942009925842285,
-0.12348824739456177,
-0.33126601576805115,
0.2597751021385193,
0.12186174839735031,
-0.1182827278971672,
-0.19094613194465637
] |
https://github.com/huggingface/datasets/issues/5675 | @avidale This has been discussed in https://github.com/huggingface/datasets/issues/4881, so also feel free to share your opinion there. | Filter datasets by language code | Hi! I use the language search field on https://huggingface.co/datasets
However, some of the datasets tagged by ISO language code are not accessible by this search form.
For example, [myv_ru_2022](https://huggingface.co/datasets/slone/myv_ru_2022) is has `myv` language tag but it is not included in Languages search form.
I've also noticed the same problem with `mhr` (see https://huggingface.co/datasets/AigizK/mari-russian-parallel-corpora) | 16 | Filter datasets by language code
Hi! I use the language search field on https://huggingface.co/datasets
However, some of the datasets tagged by ISO language code are not accessible by this search form.
For example, [myv_ru_2022](https://huggingface.co/datasets/slone/myv_ru_2022) is has `myv` language tag but it is not included in Languages search form.
I've also noticed the same problem with `mhr` (see https://huggingface.co/datasets/AigizK/mari-russian-parallel-corpora)
@avidale This has been discussed in https://github.com/huggingface/datasets/issues/4881, so also feel free to share your opinion there. | [
-0.055522847920656204,
-0.318469762802124,
-0.17925629019737244,
0.3371954560279846,
0.19591617584228516,
-0.26104849576950073,
0.01392504945397377,
0.2177552729845047,
0.4539124071598053,
0.12786586582660675,
-0.5019581317901611,
-0.06373956054449081,
-0.30710846185684204,
0.4141940474510193,
0.3374640643596649,
0.0973028838634491,
0.026400111615657806,
-0.2504705786705017,
0.09073562920093536,
-0.2081986963748932,
-0.1748063713312149,
0.27517080307006836,
-0.09122996032238007,
0.019470008090138435,
-0.21897929906845093,
0.3248368501663208,
0.37858736515045166,
-0.0101336520165205,
-0.2123619019985199,
0.0003990940749645233,
0.17346924543380737,
0.08419688045978546,
0.08576279878616333,
0.23194420337677002,
-0.00011977138638030738,
0.082442507147789,
-0.08609293401241302,
-0.21571291983127594,
-0.23137648403644562,
-0.5410863161087036,
-0.08423711359500885,
0.12713618576526642,
-0.03941211476922035,
0.3523954153060913,
-0.35185882449150085,
-0.04053906723856926,
0.0520024374127388,
-0.6363725066184998,
0.4056122899055481,
0.5470316410064697,
0.13063250482082367,
0.3326180577278137,
0.02151632308959961,
0.12718841433525085,
0.22370204329490662,
0.30982911586761475,
-0.1618773639202118,
0.15336687862873077,
0.6091717481613159,
0.1982831358909607,
0.21446937322616577,
0.5063722133636475,
0.18571192026138306,
-0.3968436121940613,
-0.13053375482559204,
-0.04126138985157013,
-0.624733567237854,
-0.3783259093761444,
0.4145934283733368,
0.0693904459476471,
0.4397274851799011,
-0.23612293601036072,
-0.5359220504760742,
-0.20590448379516602,
-0.33309173583984375,
-0.13801851868629456,
0.2365996390581131,
0.09154246002435684,
0.052503690123558044,
0.3324868083000183,
-0.1847364753484726,
-0.28799009323120117,
0.10196217894554138,
0.16635137796401978,
-0.1279512643814087,
0.7275911569595337,
-0.24936434626579285,
-0.07232139259576797,
0.2111661583185196,
-0.23687905073165894,
-0.11202606558799744,
-0.034042373299598694,
0.25792935490608215,
0.4617297351360321,
-0.22807390987873077,
0.09691904485225677,
-0.11617574840784073,
0.36917048692703247,
0.238104909658432,
-0.01651066541671753,
-0.11528386175632477,
0.2060103714466095,
-0.20102879405021667,
-0.05126464366912842,
0.13443611562252045,
-0.13989317417144775,
0.34978848695755005,
-0.09291364252567291,
0.25807785987854004,
-0.3437340259552002,
-0.2296919822692871,
-0.20577514171600342,
-0.1601775884628296,
-0.16301189363002777,
-0.18047256767749786,
-0.02726106159389019,
0.16045570373535156,
-0.33551764488220215,
-0.21648377180099487,
-0.10859217494726181,
-0.140949085354805,
-0.47430989146232605,
0.325452983379364,
0.13232186436653137,
0.3366886377334595,
-0.23253491520881653,
-0.12204435467720032,
0.14443592727184296,
-0.26596328616142273,
-0.45532748103141785,
-0.05649309977889061,
-0.06599365174770355,
-0.04841700196266174,
0.047007814049720764,
0.30564892292022705,
-0.5970556139945984,
0.23274843394756317,
0.02921377494931221,
0.18669086694717407,
-0.23670314252376556,
-0.0924912542104721,
-0.12344247102737427,
0.3158135414123535,
0.12257785350084305,
-0.19454890489578247,
0.013536617159843445,
0.14353027939796448,
-0.5060283541679382,
-0.2638636827468872,
-0.1698206067085266,
-0.24952712655067444,
-0.011898688971996307,
-0.1864026039838791,
0.024107329547405243,
-0.3517228364944458,
-0.12406399846076965,
-0.054100584238767624,
0.5690711736679077,
-0.13839037716388702,
-0.014206506311893463,
0.15197771787643433,
0.016745975241065025,
-0.06952887773513794,
0.33532318472862244,
0.2451343536376953,
0.2672210931777954,
-0.398625910282135,
-0.21384483575820923,
0.0912289172410965,
-0.23679213225841522,
0.1680493950843811,
0.20400646328926086,
-0.052409760653972626,
-0.001545928418636322,
-0.16695977747440338,
0.02094513177871704,
0.5468557476997375,
-0.3003905415534973,
-0.3553331792354584,
-0.09710484743118286,
0.08702057600021362,
-0.057266443967819214,
0.07953786104917526,
-0.20767775177955627,
0.33942246437072754,
0.09652251750230789,
0.08705326169729233,
0.13444343209266663,
-0.010749995708465576,
-0.19977548718452454,
-0.01847825199365616,
0.2209497094154358,
0.1742420643568039,
0.37949809432029724,
0.3496447503566742,
-0.1070195734500885,
0.4631137251853943,
0.19094492495059967,
0.1890263855457306,
0.017673026770353317,
0.12422757595777512,
0.0406978540122509,
0.13555243611335754,
0.2124183177947998,
0.12587282061576843,
-0.4594849646091461,
-0.00811614841222763,
0.11182232946157455,
0.02593722939491272,
0.06182219460606575,
-0.08876526355743408,
0.032219596207141876,
-0.17081202566623688,
-0.11650502681732178,
-0.2601430416107178,
-0.0861688107252121,
0.05602560564875603,
-0.031877972185611725,
-0.10990495979785919,
0.06656308472156525,
-0.2551082372665405,
0.2294800728559494,
0.11742417514324188,
0.16678044199943542,
-0.28885987401008606,
0.25430622696876526,
0.04609750956296921,
-0.07340716570615768,
-0.15182487666606903,
0.3804819881916046,
0.14242571592330933,
-0.08096276968717575,
0.0023973844945430756,
-0.13814732432365417,
0.42965736985206604,
-0.33342447876930237,
0.5626839399337769,
0.19196593761444092,
0.23834802210330963,
-0.36866509914398193,
-0.023837387561798096,
0.05041160434484482,
0.03461000323295593,
0.22798974812030792,
-0.07395032048225403,
0.11238884180784225,
0.09071359783411026,
0.3500730097293854,
0.2019209861755371,
-0.01390378549695015,
0.4703297019004822,
0.24264049530029297,
-0.2882339358329773,
-0.4190868139266968,
0.3200805187225342,
-0.269736647605896,
0.5532550811767578,
0.33101972937583923,
-0.5730801224708557,
0.06072969734668732,
0.5710907578468323,
0.06428787112236023,
0.03738584369421005,
0.3071593642234802,
-0.08161984384059906,
0.22246335446834564,
0.0038902927190065384,
-0.09390752017498016,
-0.03860161453485489,
0.3443320691585541,
0.14724580943584442,
-0.19116328656673431,
0.15176746249198914,
-0.13463465869426727,
0.0833619013428688,
0.07354283332824707,
-0.07659660279750824,
-0.08392088115215302,
0.12284906208515167,
-0.12637314200401306,
-0.47012779116630554,
0.08691740781068802,
-0.22123992443084717,
-0.32620301842689514,
-0.06914719194173813,
0.17690561711788177,
-0.6477752923965454,
-0.12115442752838135,
-0.39708733558654785,
0.10584908723831177,
-0.6304421424865723,
0.08122147619724274,
0.13457809388637543,
-0.3520369529724121,
0.16219696402549744,
-0.05057802423834801,
-0.10618168860673904,
0.22734811902046204,
-0.4380902647972107,
-0.18720243871212006,
0.1192815750837326,
-0.06174784526228905,
-0.10752362757921219,
0.031679052859544754,
0.19650687277317047,
0.1637677550315857,
0.5648062825202942,
-0.3006431758403778,
0.20402470231056213,
-0.1824251413345337,
-0.649016261100769,
0.1643723100423813,
-0.06276974827051163,
0.04592731595039368,
-0.22152811288833618,
-0.1085391640663147,
-0.05816937983036041,
0.1579102724790573,
0.16577887535095215,
0.07118059694766998,
-0.12763233482837677,
0.02528875321149826,
-0.023936575278639793,
0.2290859818458557,
-0.049771688878536224,
-0.1475314497947693,
-0.5199913382530212,
-0.07476909458637238,
0.033318012952804565,
-0.16461312770843506,
-0.004124799743294716,
0.05094566568732262,
-0.14008690416812897,
0.0678100511431694,
-0.46671393513679504,
-0.06302134692668915,
-0.1934731900691986,
-0.0844573974609375,
0.28503191471099854,
-0.1805913895368576,
-0.004407596308737993,
0.3459510803222656,
0.17589996755123138,
0.12722882628440857,
0.06244683638215065,
0.06116398423910141,
0.18400554358959198,
-0.15066812932491302,
-0.03835460916161537,
0.25414830446243286,
0.1424138844013214,
0.2887539565563202,
-0.17664970457553864,
0.15502649545669556,
-0.2934242784976959,
-0.35614949464797974,
0.09917674958705902,
-0.3172486424446106,
0.5513342022895813,
0.01894444227218628,
0.24414598941802979,
-0.011305160820484161,
0.3855210244655609,
0.18136341869831085,
0.14618396759033203,
0.43036913871765137,
0.2695615887641907,
0.37520551681518555,
-0.19954341650009155,
-0.3010805547237396,
0.06188223138451576,
-0.07985331118106842,
0.006941415369510651,
0.2003941833972931,
0.3807213306427002,
0.18491630256175995,
-0.2950946092605591,
-0.1527421772480011,
-0.379957914352417,
-0.06084698438644409,
-0.06662633270025253,
0.37650346755981445,
0.34198665618896484,
0.2052280753850937,
-0.02093668282032013,
-0.10540580004453659,
-0.13072699308395386,
-0.2880069613456726,
0.3820286989212036,
0.3165689706802368,
0.21719281375408173,
-0.0977257639169693,
-0.3974764347076416,
-0.2921437621116638,
0.20192186534404755,
0.17217987775802612,
0.17859667539596558,
-0.3008158504962921,
0.042513832449913025,
0.3375418186187744,
0.2698831856250763,
0.24658861756324768,
-0.08815741539001465,
-0.2411338835954666,
-0.17047236859798431,
-0.420493483543396,
-0.01686490699648857,
0.1783951222896576,
-0.15365883708000183,
-0.060891829431056976,
0.4045116901397705,
0.40506142377853394,
-0.2449679672718048,
-0.4742283523082733,
-0.0038037383928894997,
0.32749542593955994,
-0.08732855319976807,
-0.09966357052326202,
-0.26903510093688965,
-0.012316413223743439,
-0.13965964317321777,
0.01732027158141136,
0.27315187454223633,
0.05331030115485191,
-0.09446778893470764,
0.08716140687465668,
0.09226258099079132,
-0.04862293228507042,
0.32752561569213867,
0.10815919935703278,
0.1990203708410263,
0.19988304376602173,
0.07178732752799988,
0.36870431900024414,
0.22761866450309753,
0.011768640950322151,
0.6314756870269775,
-0.2988635301589966,
-0.4340156316757202,
0.07461495697498322,
-0.2491656243801117,
0.44019487500190735,
0.22059078514575958,
-0.09375470876693726,
0.39083796739578247,
0.10193394124507904,
-0.12123947590589523,
-0.11277520656585693,
0.06766942143440247,
-0.000786956399679184,
0.2006405144929886,
-0.43849560618400574,
-0.33925342559814453,
0.24231895804405212,
-0.034517671912908554,
-0.10006609559059143,
0.049380794167518616,
0.6104256510734558,
-0.3151123523712158,
0.1372487097978592,
-0.025046896189451218,
0.693479061126709,
-0.1330612152814865,
-0.11231869459152222,
-0.4727455973625183,
-0.295416921377182,
0.10206621140241623,
0.10025906562805176,
-0.06914956867694855,
0.02317967265844345,
-0.24474050104618073,
-0.008179962635040283,
0.03415124863386154,
0.2034691870212555,
0.1886294037103653,
0.054527461528778076,
0.13056889176368713,
-0.04525511711835861,
0.14747002720832825,
0.1068139299750328,
0.1833844780921936,
0.12252829968929291,
-0.11583858728408813,
-0.33624371886253357,
0.061586543917655945,
-0.05458018183708191,
0.37309378385543823,
0.11841137707233429,
-0.23639991879463196,
0.03312240540981293,
-0.173289492726326,
-0.3489488661289215,
-0.2575231194496155,
-0.07724614441394806,
-0.19215580821037292,
0.24901963770389557,
-0.25695931911468506,
0.6768224239349365,
-0.006896999664604664,
0.6363962292671204,
0.23547647893428802,
-0.18392661213874817,
0.19760286808013916,
-0.049960941076278687,
0.05288401246070862,
-0.166178360581398,
0.09210444241762161,
-0.10636226087808609,
-0.0241507887840271,
-0.3122287392616272,
0.04368342459201813,
0.2490798532962799,
-0.3099827766418457,
-0.3364657163619995,
0.20744195580482483,
-0.45539921522140503,
0.18793730437755585,
0.039748724550008774,
-0.1747138351202011,
0.019167527556419373,
-0.12937624752521515,
0.06700440496206284,
0.11767537891864777,
0.25620582699775696,
-0.21165823936462402,
0.1436871737241745,
-0.0649806559085846,
-0.28075259923934937,
0.2565428912639618,
-0.21450629830360413,
0.14053401350975037,
0.22853031754493713,
0.17422720789909363,
-0.41674792766571045,
-0.1105240136384964,
0.11155296862125397,
0.40569961071014404,
-0.3604491949081421,
-0.3034537732601166,
-0.017998840659856796,
-0.08231332153081894,
0.00908687338232994,
-0.04142897203564644,
0.02501937747001648,
-0.4965016543865204,
-0.13025203347206116,
-0.19139526784420013,
-0.0048798322677612305,
0.2817957401275635,
-0.17451536655426025,
-0.17060720920562744,
-0.10111553221940994,
0.28235676884651184,
0.04909113794565201,
0.07991007715463638,
-0.20614367723464966,
-0.09885522723197937,
-0.06300096958875656,
0.02774311974644661,
0.08561599254608154,
0.12957480549812317,
0.10192857682704926,
-0.2580176293849945,
-0.06514324247837067,
0.03046748787164688,
-0.010496493428945541,
-0.09477794170379639,
-0.08351293951272964,
0.047591306269168854,
-0.02524808794260025,
-0.06821012496948242,
0.07600469887256622,
-0.00899951159954071,
0.16605624556541443,
-0.2610830068588257,
0.011031299829483032,
0.25239166617393494,
0.3423265516757965,
0.0757293626666069,
-0.2220630794763565,
-0.20091195404529572,
0.254278302192688,
-0.005736536346375942,
0.16335521638393402,
0.4028026759624481,
0.3146562874317169,
-0.0291685089468956,
0.16177797317504883,
0.10537414997816086,
-0.00888531282544136,
0.018468283116817474,
0.107607901096344,
0.08336536586284637,
-0.002990027889609337,
-0.16086824238300323,
0.22734540700912476,
0.37424778938293457,
0.24658478796482086,
0.05597945675253868,
0.04465257376432419,
0.20399659872055054,
0.3083799481391907,
0.025250375270843506,
-0.3282564580440521,
-0.13269224762916565,
0.33213192224502563,
0.1340773105621338,
0.02384241670370102,
0.29982149600982666,
0.2623831033706665,
0.4668685793876648,
0.49947866797447205,
-0.0911407545208931,
0.17034606635570526,
0.23950281739234924,
0.218548983335495,
0.05510253831744194,
0.5412600636482239,
0.15413963794708252,
0.322757363319397,
0.24166905879974365,
-0.26080721616744995,
0.2808675169944763,
-0.29950132966041565,
0.30587589740753174,
-0.4513401985168457,
0.2923882007598877,
0.12821269035339355,
-0.2450667917728424,
-0.20238640904426575,
-0.15979185700416565,
-0.1945771723985672,
0.09364397823810577,
-0.3344697654247284,
0.17455443739891052,
0.06616005301475525,
-0.19762907922267914,
-0.009657524526119232,
0.05348996818065643,
0.12470516562461853,
-0.1082625687122345,
0.08759472519159317,
-0.25170472264289856,
-0.1986788660287857,
-0.05501215532422066,
-0.010078196413815022,
-0.17727030813694,
-0.24348901212215424,
-0.12056374549865723,
0.23658406734466553,
-0.1884770691394806,
-0.4476150870323181,
0.01811731979250908,
-0.2033635824918747,
0.014399699866771698,
0.3846052885055542,
-0.21143043041229248,
0.1095605343580246,
0.3832850456237793,
0.03199151158332825,
-0.10656163096427917,
-0.009429529309272766,
0.22586992383003235,
-0.10409237444400787,
-0.44280967116355896,
-0.11527574062347412,
-0.09103486686944962,
0.3405947685241699,
0.09538491070270538,
0.05280977860093117,
0.257407009601593,
0.007175792008638382,
-0.0006216838955879211,
-0.12006796896457672,
0.14523518085479736,
0.09298732131719589,
-0.16761401295661926,
-0.1333671361207962,
-0.2320796549320221,
0.3671119809150696,
-0.30204591155052185,
-0.2603655457496643,
-0.5406434535980225,
0.43767818808555603,
0.18023140728473663,
0.1862601339817047,
0.14680248498916626,
-0.0033016130328178406,
0.0012565739452838898,
0.26057156920433044,
0.28923898935317993,
-0.0036397799849510193,
0.3117451071739197,
0.037924811244010925,
-0.2616778314113617,
-0.5167257189750671,
-0.32195115089416504,
-0.3278053402900696,
0.18886320292949677,
0.002326149493455887,
-0.13563311100006104,
0.2533971965312958,
0.041632965207099915,
0.35567593574523926,
0.11522344499826431,
0.4125474989414215,
-0.05892286077141762,
-0.06642655283212662,
-0.30830493569374084,
0.03417280316352844,
0.336265504360199,
-0.03976047784090042,
0.18405187129974365,
0.3121680021286011,
-0.2709049582481384,
-0.08352931588888168,
-0.3333035111427307,
0.2616366744041443,
-0.1634598672389984,
-0.3406105637550354,
0.13698998093605042,
0.041834428906440735,
0.5195257067680359,
-0.1938319355249405,
0.3132672905921936,
-0.1420895755290985,
-0.11889146268367767,
-0.07273418456315994,
0.18893538415431976,
0.05840783566236496,
0.1890067160129547,
-0.26336485147476196,
-0.48786109685897827,
0.01637432351708412,
0.4708251655101776,
-0.1558564305305481,
-0.11929649114608765,
-0.02684769779443741,
-0.13517600297927856,
0.03437695652246475,
-0.11565379053354263,
-0.0010036900639533997,
0.3059198558330536,
-0.11101561784744263,
-0.19568130373954773,
-0.01638054847717285,
-0.06101912260055542,
0.40638673305511475,
-0.4127591550350189,
-0.3191159963607788,
-0.1924540102481842,
0.11574474722146988,
0.6683258414268494,
-0.24754445254802704,
-0.28786700963974,
-0.04223264753818512,
0.05553486943244934,
0.069487564265728,
0.24368643760681152,
0.19849428534507751,
0.2277141809463501,
0.08608955144882202,
-0.06550808995962143,
-0.1463087499141693,
0.3759465515613556,
0.12162446975708008,
-0.0177001953125,
0.004037253558635712
] |
https://github.com/huggingface/datasets/issues/5672 | Hi ! It's been fixed by https://github.com/huggingface/datasets/pull/5598. We're doing a new release tomorrow with the fix and you'll be able to push your 100k images ;)
Basically `push_to_hub` used to fail if the remote repository already exists and has a README.md without dataset_info in the YAML tags.
In the meantime you can install datasets from source | Pushing dataset to hub crash | ### Describe the bug
Uploading a dataset with `push_to_hub()` fails without error description.
### Steps to reproduce the bug
Hey there,
I've built a image dataset of 100k images + text pair as described here https://huggingface.co/docs/datasets/image_dataset#imagefolder
Now I'm trying to push it to the hub but I'm running into issues. First, I tried doing it via git directly, I added all the files in git lfs and pushed but I got hit with an error saying huggingface only accept up to 10k files in a folder.
So I'm now trying with the `push_to_hub()` func as follow:
```python
from datasets import load_dataset
import os
dataset = load_dataset("imagefolder", data_dir="./data", split="train")
dataset.push_to_hub("tzvc/organization-logos", token=os.environ.get('HF_TOKEN'))
```
But again, this produces an error:
```
Resolving data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████| 100212/100212 [00:00<00:00, 439108.61it/s]
Downloading and preparing dataset imagefolder/default to /home/contact_theochampion/.cache/huggingface/datasets/imagefolder/default-20567ffc703aa314/0.0.0/37fbb85cc714a338bea574ac6c7d0b5be5aff46c1862c1989b20e0771199e93f...
Downloading data files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 100211/100211 [00:00<00:00, 149323.73it/s]
Downloading data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15947.92it/s]
Extracting data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 2245.34it/s]
Dataset imagefolder downloaded and prepared to /home/contact_theochampion/.cache/huggingface/datasets/imagefolder/default-20567ffc703aa314/0.0.0/37fbb85cc714a338bea574ac6c7d0b5be5aff46c1862c1989b20e0771199e93f. Subsequent calls will reuse this data.
Resuming upload of the dataset shards.
Pushing dataset shards to the dataset hub: 100%|██████████████████████████████████████████████████████████████████████████████████████████████| 14/14 [00:31<00:00, 2.24s/it]
Downloading metadata: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 118/118 [00:00<00:00, 225kB/s]
Traceback (most recent call last):
File "/home/contact_theochampion/organization-logos/push_to_hub.py", line 5, in <module>
dataset.push_to_hub("tzvc/organization-logos", token=os.environ.get('HF_TOKEN'))
File "/home/contact_theochampion/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 5245, in push_to_hub
repo_info = dataset_infos[next(iter(dataset_infos))]
StopIteration
```
What could be happening here ?
### Expected behavior
The dataset is pushed to the hub
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-5.10.0-21-cloud-amd64-x86_64-with-glibc2.31
- Python version: 3.9.2
- PyArrow version: 11.0.0
- Pandas version: 1.5.3 | 56 | Pushing dataset to hub crash
### Describe the bug
Uploading a dataset with `push_to_hub()` fails without error description.
### Steps to reproduce the bug
Hey there,
I've built a image dataset of 100k images + text pair as described here https://huggingface.co/docs/datasets/image_dataset#imagefolder
Now I'm trying to push it to the hub but I'm running into issues. First, I tried doing it via git directly, I added all the files in git lfs and pushed but I got hit with an error saying huggingface only accept up to 10k files in a folder.
So I'm now trying with the `push_to_hub()` func as follow:
```python
from datasets import load_dataset
import os
dataset = load_dataset("imagefolder", data_dir="./data", split="train")
dataset.push_to_hub("tzvc/organization-logos", token=os.environ.get('HF_TOKEN'))
```
But again, this produces an error:
```
Resolving data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████| 100212/100212 [00:00<00:00, 439108.61it/s]
Downloading and preparing dataset imagefolder/default to /home/contact_theochampion/.cache/huggingface/datasets/imagefolder/default-20567ffc703aa314/0.0.0/37fbb85cc714a338bea574ac6c7d0b5be5aff46c1862c1989b20e0771199e93f...
Downloading data files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 100211/100211 [00:00<00:00, 149323.73it/s]
Downloading data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15947.92it/s]
Extracting data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 2245.34it/s]
Dataset imagefolder downloaded and prepared to /home/contact_theochampion/.cache/huggingface/datasets/imagefolder/default-20567ffc703aa314/0.0.0/37fbb85cc714a338bea574ac6c7d0b5be5aff46c1862c1989b20e0771199e93f. Subsequent calls will reuse this data.
Resuming upload of the dataset shards.
Pushing dataset shards to the dataset hub: 100%|██████████████████████████████████████████████████████████████████████████████████████████████| 14/14 [00:31<00:00, 2.24s/it]
Downloading metadata: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 118/118 [00:00<00:00, 225kB/s]
Traceback (most recent call last):
File "/home/contact_theochampion/organization-logos/push_to_hub.py", line 5, in <module>
dataset.push_to_hub("tzvc/organization-logos", token=os.environ.get('HF_TOKEN'))
File "/home/contact_theochampion/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 5245, in push_to_hub
repo_info = dataset_infos[next(iter(dataset_infos))]
StopIteration
```
What could be happening here ?
### Expected behavior
The dataset is pushed to the hub
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-5.10.0-21-cloud-amd64-x86_64-with-glibc2.31
- Python version: 3.9.2
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
Hi ! It's been fixed by https://github.com/huggingface/datasets/pull/5598. We're doing a new release tomorrow with the fix and you'll be able to push your 100k images ;)
Basically `push_to_hub` used to fail if the remote repository already exists and has a README.md without dataset_info in the YAML tags.
In the meantime you can install datasets from source | [
-0.3978685140609741,
-0.49170318245887756,
0.0054841674864292145,
0.4743315875530243,
0.26180773973464966,
0.009896665811538696,
-0.0037007853388786316,
0.22173283994197845,
0.23481225967407227,
0.11129070073366165,
-0.04022059962153435,
0.032485585659742355,
-0.4445820450782776,
0.287078857421875,
0.06074102595448494,
0.10398919880390167,
0.23912623524665833,
-0.21342241764068604,
-0.04471306502819061,
-0.02598724514245987,
-0.11198623478412628,
0.08557497709989548,
0.030457302927970886,
-0.09915882349014282,
-0.5556386709213257,
-0.14968052506446838,
-0.04929765313863754,
0.5366048216819763,
-0.1309737116098404,
-0.024688206613063812,
0.10790548473596573,
-0.00994975958019495,
-0.04997590184211731,
0.7522773742675781,
-0.00012023843009956181,
-0.04225771874189377,
0.25187739729881287,
-0.17662063241004944,
-0.19731175899505615,
-0.16617649793624878,
-0.10898497700691223,
-0.1942877173423767,
-0.15499916672706604,
0.009270593523979187,
0.1802605390548706,
0.3187761604785919,
0.0424572229385376,
0.15931740403175354,
0.4307970404624939,
0.21898843348026276,
0.1678951382637024,
0.30424201488494873,
0.41754934191703796,
-0.10592232644557953,
0.15869121253490448,
0.3085094690322876,
-0.16895733773708344,
0.28756535053253174,
0.24595384299755096,
0.02111518383026123,
-0.16646650433540344,
0.0329822413623333,
0.11881326138973236,
-0.15397508442401886,
0.30501505732536316,
-0.11022729426622391,
-0.5197669267654419,
-0.3239467740058899,
-0.0680026262998581,
-0.020985690876841545,
-0.09771448373794556,
-0.5107748508453369,
-0.45807772874832153,
-0.514870822429657,
-0.17147906124591827,
-0.2693420648574829,
0.24709908664226532,
0.19165027141571045,
-0.3358915448188782,
-0.05881938710808754,
-0.34426385164260864,
-0.5229716300964355,
-0.07708239555358887,
0.026096660643815994,
-0.0010171383619308472,
-0.02128436788916588,
-0.17027828097343445,
0.016640787944197655,
0.1871090829372406,
-0.07088674604892731,
-0.06680132448673248,
-0.05575857311487198,
-0.009347429499030113,
-0.03436870500445366,
-0.25812482833862305,
-0.010395646095275879,
0.03451903909444809,
0.26497989892959595,
0.3693345785140991,
-0.06573501974344254,
-0.2223891168832779,
-0.0025733765214681625,
-0.4224076271057129,
0.016895737498998642,
0.23513612151145935,
0.218702495098114,
-0.06100359186530113,
0.09832519292831421,
0.06902575492858887,
0.24074389040470123,
0.051585614681243896,
0.01804053597152233,
-0.008931674063205719,
-0.08750928193330765,
-0.10970550775527954,
-0.0323268361389637,
0.23177795112133026,
-0.02687721699476242,
-0.21029570698738098,
0.02741323411464691,
0.18460115790367126,
0.23746131360530853,
0.07167442888021469,
0.08952470868825912,
0.04954850301146507,
0.06777852773666382,
-0.14629441499710083,
0.18404847383499146,
-0.18610569834709167,
0.12738215923309326,
-0.20306061208248138,
0.22163009643554688,
-0.028031624853610992,
0.1604941338300705,
0.13386283814907074,
-0.617581844329834,
0.1874649077653885,
0.10207823663949966,
0.2229960709810257,
-0.11602345108985901,
-0.31252357363700867,
-0.11078979074954987,
0.04743168503046036,
0.24913136661052704,
0.11244902014732361,
0.258208304643631,
0.07161267101764679,
-0.10239896923303604,
-0.06493741273880005,
-0.06637124717235565,
-0.5312355160713196,
-0.34548693895339966,
-0.10372717678546906,
0.0878157913684845,
-0.30002105236053467,
0.14080318808555603,
-0.7221450805664062,
0.1560163050889969,
-0.05325702950358391,
0.09773193299770355,
0.07738115638494492,
0.09609320759773254,
-0.13276225328445435,
-0.12366920709609985,
0.27330875396728516,
0.5933367609977722,
-0.08484021574258804,
0.0395163893699646,
0.2403019666671753,
0.23261673748493195,
-0.21450045704841614,
0.27818000316619873,
-0.02195928432047367,
0.2645130753517151,
-0.292010635137558,
0.24369433522224426,
-0.11356817185878754,
-0.6017710566520691,
-0.4359705150127411,
-0.010447178035974503,
-0.15264534950256348,
0.009074553847312927,
-0.29205945134162903,
0.016204625368118286,
0.13325467705726624,
-0.0623147077858448,
0.11900029331445694,
0.20877128839492798,
-0.24007843434810638,
0.18113593757152557,
-0.23817026615142822,
-0.3470971882343292,
-0.23262150585651398,
0.18545863032341003,
0.11475522816181183,
0.02154846489429474,
0.21318179368972778,
0.3263508081436157,
0.20244520902633667,
-0.024947773665189743,
0.1899614930152893,
0.3201923966407776,
0.4501115083694458,
-0.0993412435054779,
-0.09271000325679779,
-0.209877610206604,
-0.6323097944259644,
0.2846708297729492,
0.16794399917125702,
0.053234368562698364,
-0.3494599461555481,
0.1946372091770172,
-0.27439168095588684,
-0.029308509081602097,
-0.19482798874378204,
0.04175327345728874,
0.04028390347957611,
-0.36031365394592285,
-0.029241975396871567,
0.11036791652441025,
-0.14898817241191864,
0.6183378100395203,
-0.19458910822868347,
0.3542884886264801,
-0.6337026357650757,
0.512210488319397,
0.02683228813111782,
-0.4411138594150543,
0.02382359653711319,
0.08215193450450897,
0.05386305972933769,
-0.3092927932739258,
-0.11693159490823746,
0.4038989245891571,
0.01920926570892334,
0.26811349391937256,
0.03603087365627289,
0.04488556832075119,
0.43833500146865845,
-0.27537840604782104,
-0.05240587890148163,
-0.19956858456134796,
0.1170160174369812,
-0.046354249119758606,
-0.22886250913143158,
-0.015591345727443695,
-0.292125403881073,
0.06825841963291168,
0.03214183449745178,
0.05413682013750076,
-0.17377158999443054,
0.12186754494905472,
0.10225207358598709,
0.1227358877658844,
0.25725916028022766,
0.13950002193450928,
0.11911283433437347,
-0.225267231464386,
0.14668068289756775,
-0.030953899025917053,
0.2970823049545288,
0.22183498740196228,
0.11994533985853195,
0.252066045999527,
-0.04785723239183426,
0.03723821043968201,
0.26402363181114197,
-0.0697721391916275,
0.1346370279788971,
0.018654540181159973,
-0.20413906872272491,
0.11079168319702148,
-0.04652320593595505,
-0.05337470769882202,
-0.027989991009235382,
0.04291684553027153,
0.2546132504940033,
0.09395167231559753,
0.12477453052997589,
0.14583691954612732,
-0.4397120177745819,
-0.2553316652774811,
-0.042554259300231934,
0.40854835510253906,
-0.3298245072364807,
-0.14427585899829865,
0.11875172704458237,
-0.008917205035686493,
0.09222322702407837,
-0.027045825496315956,
-0.5220124125480652,
-0.32780539989471436,
-0.0982920452952385,
0.39484238624572754,
0.04321974515914917,
0.06527012586593628,
0.20583929121494293,
0.20363575220108032,
0.10573390871286392,
-0.0074197594076395035,
-0.09950751066207886,
0.09459062665700912,
0.047340694814920425,
-0.035258907824754715,
0.3584125339984894,
-0.03736160695552826,
0.3393814265727997,
0.050835900008678436,
0.0314900279045105,
-0.21055413782596588,
-0.11323153227567673,
0.20359939336776733,
-0.3246883451938629,
0.11790333688259125,
0.043149564415216446,
0.3193013072013855,
-0.042569033801555634,
-0.13946633040905,
0.16523510217666626,
-0.07734128087759018,
-0.3081868290901184,
-0.06822795420885086,
0.033812154084444046,
-0.032184623181819916,
-0.05262061208486557,
0.23472391068935394,
-0.07345215976238251,
-0.4297168254852295,
0.38194549083709717,
0.15659058094024658,
0.17148330807685852,
0.483079731464386,
0.3417435884475708,
-0.009210161864757538,
-0.03066141903400421,
-0.4256892800331116,
0.0514705553650856,
-0.3874303996562958,
0.08062152564525604,
-0.09590399265289307,
-0.2702370584011078,
-0.13980653882026672,
0.2721305191516876,
-0.02699693664908409,
0.10512184351682663,
-0.5243523120880127,
-0.5751792192459106,
-0.24467390775680542,
0.28564533591270447,
-0.027803344652056694,
0.17378860712051392,
0.15669988095760345,
-0.11969583481550217,
0.058047279715538025,
-0.05026472359895706,
-0.18546104431152344,
0.08594837039709091,
0.3592475354671478,
-0.04376325011253357,
-0.03935525193810463,
0.1076287180185318,
0.23274271190166473,
0.3025320768356323,
0.38447141647338867,
-0.06413505971431732,
0.603260338306427,
-0.06518713384866714,
0.43277978897094727,
-0.31850114464759827,
-0.41036632657051086,
0.266403466463089,
0.03472559154033661,
-0.01174316555261612,
0.04970796778798103,
0.13876767456531525,
0.3257814347743988,
-0.053483352065086365,
-0.3194538950920105,
-0.16987380385398865,
-0.20972302556037903,
-0.06483224034309387,
0.038625363260507584,
-0.08944937586784363,
-0.24166688323020935,
-0.23586171865463257,
-0.1604452133178711,
-0.27703341841697693,
0.29135948419570923,
-0.07025625556707382,
0.2298131287097931,
0.09152474999427795,
-0.11015103757381439,
-0.03925098478794098,
-0.5846925973892212,
-0.01435282826423645,
0.06988397240638733,
0.15210939943790436,
-0.053901784121990204,
0.2401951253414154,
-0.0113607719540596,
-0.02619013376533985,
0.8798772096633911,
-0.23083390295505524,
0.1403200328350067,
-0.3226342499256134,
0.0014874860644340515,
-0.6607033014297485,
0.07847639918327332,
-0.11351621150970459,
0.4571097791194916,
0.04774307459592819,
0.8296194672584534,
-0.29395726323127747,
0.0025595612823963165,
-0.07985639572143555,
0.12555313110351562,
-0.11742071807384491,
-0.1574724018573761,
-0.05943873152136803,
-0.39749839901924133,
-0.3311919867992401,
0.07506689429283142,
0.3896030783653259,
0.29317983984947205,
0.017850108444690704,
-0.11632426828145981,
0.1731264591217041,
-0.14237108826637268,
0.11382658779621124,
-0.14550068974494934,
0.22223830223083496,
0.09718342125415802,
0.20221774280071259,
-0.0034335339441895485,
0.15254449844360352,
0.11766233295202255,
0.6614497900009155,
0.0808553621172905,
-0.1729193925857544,
0.08807238936424255,
0.04985087737441063,
-0.01666727289557457,
0.5244397521018982,
0.1491088569164276,
0.1704937219619751,
-0.13868996500968933,
0.3023982048034668,
-0.5109803676605225,
0.20389172434806824,
0.2384829819202423,
-0.03798309713602066,
-0.36966121196746826,
0.2746676802635193,
0.519271969795227,
-0.0331600159406662,
0.20878064632415771,
0.36948591470718384,
0.5697070360183716,
-0.29717496037483215,
0.15353402495384216,
0.008300311863422394,
0.8701192140579224,
-0.09938997030258179,
0.19040876626968384,
0.019225072115659714,
-0.01896502822637558,
0.6253466010093689,
-0.06607910245656967,
-0.16006605327129364,
-0.25171416997909546,
-0.18982991576194763,
0.0402802973985672,
0.10505568236112595,
-0.03816571831703186,
-0.17729789018630981,
-0.0447271503508091,
0.22227640450000763,
-0.1341124325990677,
0.27329951524734497,
-0.18283143639564514,
0.3496757745742798,
-0.5536091923713684,
-0.41370344161987305,
-0.1962343156337738,
0.13400566577911377,
-0.007176969200372696,
0.14847227931022644,
0.03440478816628456,
-0.044361039996147156,
-0.19828379154205322,
-0.15195637941360474,
-0.653756856918335,
-0.010885316878557205,
-0.03458782657980919,
-0.022365953773260117,
0.04027659818530083,
-0.17083700001239777,
0.047833673655986786,
0.06817078590393066,
0.5800436735153198,
0.08742250502109528,
-0.4310028553009033,
0.11103767156600952,
-0.47648051381111145,
-0.06469129025936127,
0.014861255884170532,
0.03122718259692192,
0.10943131148815155,
-0.03735861927270889,
-0.046567656099796295,
-0.04980785772204399,
0.10153643786907196,
-0.14995034039020538,
-0.16936521232128143,
-0.004205130040645599,
-0.22128821909427643,
-0.16098816692829132,
-0.19646504521369934,
-0.0076362453401088715,
-0.01928769052028656,
-0.14961843192577362,
0.028436124324798584,
0.16876310110092163,
-0.01841077208518982,
0.1615733951330185,
0.11432363092899323,
0.014308199286460876,
-0.04106147959828377,
0.37982168793678284,
-0.28330135345458984,
-0.3355764150619507,
0.10353942215442657,
0.3509056568145752,
0.010236196219921112,
-0.028705623000860214,
0.25394004583358765,
0.5137038230895996,
-0.7918705940246582,
0.14956530928611755,
-0.26024749875068665,
0.05395394563674927,
-0.15535974502563477,
0.15329793095588684,
0.29688718914985657,
-0.0376284196972847,
-0.0011574923992156982,
-0.06025040149688721,
-0.31003332138061523,
0.20248137414455414,
0.08444711565971375,
0.196979820728302,
-0.27705666422843933,
-0.08124331384897232,
0.2240292727947235,
0.20599865913391113,
-0.2326822578907013,
0.403881311416626,
-0.3076285719871521,
0.14081308245658875,
-0.21610647439956665,
-0.10694904625415802,
0.12148316204547882,
-0.46267712116241455,
0.022208496928215027,
0.2259952872991562,
-0.20433735847473145,
-0.10855148732662201,
-0.2228391170501709,
0.1152925044298172,
0.26226338744163513,
-0.20873095095157623,
-0.06715291738510132,
-0.1532229781150818,
-0.06474802643060684,
-0.1910955309867859,
0.33402103185653687,
0.39458420872688293,
-0.10424572229385376,
-0.15621285140514374,
0.5975620150566101,
0.1576196551322937,
0.03865561634302139,
0.21306385099887848,
0.21502487361431122,
0.45959192514419556,
0.0917322188615799,
0.06278257071971893,
0.21763913333415985,
-0.0012707486748695374,
-0.19054916501045227,
0.3807227909564972,
0.1327081322669983,
0.1182388961315155,
0.20982636511325836,
-0.30695703625679016,
0.04175242781639099,
-0.01454995572566986,
0.5627243518829346,
0.12137836217880249,
-0.3051614463329315,
-0.04960160702466965,
0.09305965155363083,
0.14602024853229523,
0.05562698841094971,
-0.16879144310951233,
0.3829447031021118,
-0.07288634032011032,
0.003163248300552368,
0.2138090878725052,
0.12759093940258026,
-0.030850648880004883,
-0.16774070262908936,
0.10259933769702911,
0.7401980757713318,
0.07701914757490158,
-0.10951830446720123,
0.046770595014095306,
-0.09025086462497711,
0.05177834630012512,
0.014631452038884163,
0.05903574824333191,
0.1639782339334488,
0.53267902135849,
-0.11151492595672607,
0.3597628176212311,
-0.11338520050048828,
-0.1331799030303955,
0.3579523265361786,
-0.3008936643600464,
-0.15908299386501312,
-0.07426005601882935,
-0.026896338909864426,
0.17069968581199646,
-0.18293654918670654,
0.5134492516517639,
-0.2859840393066406,
-0.27599069476127625,
-0.17344114184379578,
0.059171922504901886,
-0.06092366203665733,
0.15411317348480225,
-0.018420524895191193,
-0.16028989851474762,
-0.22288724780082703,
0.15642498433589935,
-0.17298339307308197,
-0.5086225867271423,
0.2644920349121094,
0.17572082579135895,
-0.238808274269104,
-0.02755093201994896,
-0.15017327666282654,
0.17559728026390076,
0.19712398946285248,
-0.05690678954124451,
0.4266086220741272,
0.2859242856502533,
-0.2691148817539215,
-0.06891300529241562,
0.5010249614715576,
0.4501245617866516,
0.12178727984428406,
0.0585838183760643,
0.3645893633365631,
0.33709293603897095,
0.11736869066953659,
0.12791812419891357,
0.026200667023658752,
-0.13303126394748688,
0.24419429898262024,
0.002224944531917572,
0.12433058023452759,
-0.06354418396949768,
-0.14879316091537476,
0.04084515944123268,
-0.009158633649349213,
-0.02886251173913479,
0.25815051794052124,
-0.38825523853302,
-0.18968167901039124,
-0.12541162967681885,
0.06251485645771027,
-0.34143489599227905,
0.10964497923851013,
0.25164636969566345,
-0.275725781917572,
0.07314199209213257,
-0.11082448065280914,
0.02519330009818077,
-0.15901148319244385,
0.49280187487602234,
0.5523576736450195,
0.13529163599014282,
-0.168351948261261,
-0.1900160014629364,
-0.30823448300361633,
0.25160548090934753,
-0.21203896403312683,
0.0033906102180480957,
0.08323238044977188,
-0.03478375822305679,
-0.12437035143375397,
-0.00695650652050972,
-0.005539432168006897,
0.15126600861549377,
-0.07057398557662964,
0.16730739176273346,
-0.3014064431190491,
0.05482150614261627,
0.16848048567771912,
0.08784686774015427,
0.03623409569263458,
-0.10443533957004547,
0.5327133536338806,
-0.14628316462039948,
-0.031133044511079788,
-0.046246521174907684,
0.22646579146385193,
-0.12741288542747498,
-0.42799490690231323,
0.1401699036359787,
0.003934506326913834,
0.12498311698436737,
-0.1652386486530304,
-0.2723782956600189,
-0.3330349326133728,
-0.20363323390483856,
-0.19995248317718506,
-0.1601690798997879,
-0.08435362577438354,
0.47047409415245056,
-0.09058649837970734,
-0.46778440475463867,
-0.16596710681915283,
0.2467823475599289,
0.02067536860704422,
0.30588898062705994,
-0.0819665789604187,
0.04492922127246857,
-0.0822303518652916,
0.08640117198228836,
0.28952550888061523,
0.24616344273090363,
-0.0155886709690094,
0.2206456959247589,
-0.2443140149116516,
-0.3616321086883545,
0.3929228186607361,
-0.09498864412307739,
-0.20235489308834076,
0.023585528135299683,
0.23584333062171936,
0.301608145236969,
-0.25231415033340454,
-0.3969235420227051,
-0.03404586762189865,
0.1511625498533249,
0.002982199192047119,
-0.39437398314476013,
0.3542637526988983,
-0.12558256089687347,
-0.20020803809165955,
0.1343485563993454,
0.10167814046144485,
0.15848390758037567,
-0.25118812918663025,
0.6088979840278625,
-0.012556314468383789
] |
https://github.com/huggingface/datasets/issues/5672 | Hi @lhoestq ,
What version of datasets library fix this case? I am using the last `v2.10.1` and I get the same error. | Pushing dataset to hub crash | ### Describe the bug
Uploading a dataset with `push_to_hub()` fails without error description.
### Steps to reproduce the bug
Hey there,
I've built a image dataset of 100k images + text pair as described here https://huggingface.co/docs/datasets/image_dataset#imagefolder
Now I'm trying to push it to the hub but I'm running into issues. First, I tried doing it via git directly, I added all the files in git lfs and pushed but I got hit with an error saying huggingface only accept up to 10k files in a folder.
So I'm now trying with the `push_to_hub()` func as follow:
```python
from datasets import load_dataset
import os
dataset = load_dataset("imagefolder", data_dir="./data", split="train")
dataset.push_to_hub("tzvc/organization-logos", token=os.environ.get('HF_TOKEN'))
```
But again, this produces an error:
```
Resolving data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████| 100212/100212 [00:00<00:00, 439108.61it/s]
Downloading and preparing dataset imagefolder/default to /home/contact_theochampion/.cache/huggingface/datasets/imagefolder/default-20567ffc703aa314/0.0.0/37fbb85cc714a338bea574ac6c7d0b5be5aff46c1862c1989b20e0771199e93f...
Downloading data files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 100211/100211 [00:00<00:00, 149323.73it/s]
Downloading data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15947.92it/s]
Extracting data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 2245.34it/s]
Dataset imagefolder downloaded and prepared to /home/contact_theochampion/.cache/huggingface/datasets/imagefolder/default-20567ffc703aa314/0.0.0/37fbb85cc714a338bea574ac6c7d0b5be5aff46c1862c1989b20e0771199e93f. Subsequent calls will reuse this data.
Resuming upload of the dataset shards.
Pushing dataset shards to the dataset hub: 100%|██████████████████████████████████████████████████████████████████████████████████████████████| 14/14 [00:31<00:00, 2.24s/it]
Downloading metadata: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 118/118 [00:00<00:00, 225kB/s]
Traceback (most recent call last):
File "/home/contact_theochampion/organization-logos/push_to_hub.py", line 5, in <module>
dataset.push_to_hub("tzvc/organization-logos", token=os.environ.get('HF_TOKEN'))
File "/home/contact_theochampion/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 5245, in push_to_hub
repo_info = dataset_infos[next(iter(dataset_infos))]
StopIteration
```
What could be happening here ?
### Expected behavior
The dataset is pushed to the hub
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-5.10.0-21-cloud-amd64-x86_64-with-glibc2.31
- Python version: 3.9.2
- PyArrow version: 11.0.0
- Pandas version: 1.5.3 | 23 | Pushing dataset to hub crash
### Describe the bug
Uploading a dataset with `push_to_hub()` fails without error description.
### Steps to reproduce the bug
Hey there,
I've built a image dataset of 100k images + text pair as described here https://huggingface.co/docs/datasets/image_dataset#imagefolder
Now I'm trying to push it to the hub but I'm running into issues. First, I tried doing it via git directly, I added all the files in git lfs and pushed but I got hit with an error saying huggingface only accept up to 10k files in a folder.
So I'm now trying with the `push_to_hub()` func as follow:
```python
from datasets import load_dataset
import os
dataset = load_dataset("imagefolder", data_dir="./data", split="train")
dataset.push_to_hub("tzvc/organization-logos", token=os.environ.get('HF_TOKEN'))
```
But again, this produces an error:
```
Resolving data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████| 100212/100212 [00:00<00:00, 439108.61it/s]
Downloading and preparing dataset imagefolder/default to /home/contact_theochampion/.cache/huggingface/datasets/imagefolder/default-20567ffc703aa314/0.0.0/37fbb85cc714a338bea574ac6c7d0b5be5aff46c1862c1989b20e0771199e93f...
Downloading data files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 100211/100211 [00:00<00:00, 149323.73it/s]
Downloading data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15947.92it/s]
Extracting data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 2245.34it/s]
Dataset imagefolder downloaded and prepared to /home/contact_theochampion/.cache/huggingface/datasets/imagefolder/default-20567ffc703aa314/0.0.0/37fbb85cc714a338bea574ac6c7d0b5be5aff46c1862c1989b20e0771199e93f. Subsequent calls will reuse this data.
Resuming upload of the dataset shards.
Pushing dataset shards to the dataset hub: 100%|██████████████████████████████████████████████████████████████████████████████████████████████| 14/14 [00:31<00:00, 2.24s/it]
Downloading metadata: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 118/118 [00:00<00:00, 225kB/s]
Traceback (most recent call last):
File "/home/contact_theochampion/organization-logos/push_to_hub.py", line 5, in <module>
dataset.push_to_hub("tzvc/organization-logos", token=os.environ.get('HF_TOKEN'))
File "/home/contact_theochampion/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 5245, in push_to_hub
repo_info = dataset_infos[next(iter(dataset_infos))]
StopIteration
```
What could be happening here ?
### Expected behavior
The dataset is pushed to the hub
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-5.10.0-21-cloud-amd64-x86_64-with-glibc2.31
- Python version: 3.9.2
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
Hi @lhoestq ,
What version of datasets library fix this case? I am using the last `v2.10.1` and I get the same error. | [
-0.3978685140609741,
-0.49170318245887756,
0.0054841674864292145,
0.4743315875530243,
0.26180773973464966,
0.009896665811538696,
-0.0037007853388786316,
0.22173283994197845,
0.23481225967407227,
0.11129070073366165,
-0.04022059962153435,
0.032485585659742355,
-0.4445820450782776,
0.287078857421875,
0.06074102595448494,
0.10398919880390167,
0.23912623524665833,
-0.21342241764068604,
-0.04471306502819061,
-0.02598724514245987,
-0.11198623478412628,
0.08557497709989548,
0.030457302927970886,
-0.09915882349014282,
-0.5556386709213257,
-0.14968052506446838,
-0.04929765313863754,
0.5366048216819763,
-0.1309737116098404,
-0.024688206613063812,
0.10790548473596573,
-0.00994975958019495,
-0.04997590184211731,
0.7522773742675781,
-0.00012023843009956181,
-0.04225771874189377,
0.25187739729881287,
-0.17662063241004944,
-0.19731175899505615,
-0.16617649793624878,
-0.10898497700691223,
-0.1942877173423767,
-0.15499916672706604,
0.009270593523979187,
0.1802605390548706,
0.3187761604785919,
0.0424572229385376,
0.15931740403175354,
0.4307970404624939,
0.21898843348026276,
0.1678951382637024,
0.30424201488494873,
0.41754934191703796,
-0.10592232644557953,
0.15869121253490448,
0.3085094690322876,
-0.16895733773708344,
0.28756535053253174,
0.24595384299755096,
0.02111518383026123,
-0.16646650433540344,
0.0329822413623333,
0.11881326138973236,
-0.15397508442401886,
0.30501505732536316,
-0.11022729426622391,
-0.5197669267654419,
-0.3239467740058899,
-0.0680026262998581,
-0.020985690876841545,
-0.09771448373794556,
-0.5107748508453369,
-0.45807772874832153,
-0.514870822429657,
-0.17147906124591827,
-0.2693420648574829,
0.24709908664226532,
0.19165027141571045,
-0.3358915448188782,
-0.05881938710808754,
-0.34426385164260864,
-0.5229716300964355,
-0.07708239555358887,
0.026096660643815994,
-0.0010171383619308472,
-0.02128436788916588,
-0.17027828097343445,
0.016640787944197655,
0.1871090829372406,
-0.07088674604892731,
-0.06680132448673248,
-0.05575857311487198,
-0.009347429499030113,
-0.03436870500445366,
-0.25812482833862305,
-0.010395646095275879,
0.03451903909444809,
0.26497989892959595,
0.3693345785140991,
-0.06573501974344254,
-0.2223891168832779,
-0.0025733765214681625,
-0.4224076271057129,
0.016895737498998642,
0.23513612151145935,
0.218702495098114,
-0.06100359186530113,
0.09832519292831421,
0.06902575492858887,
0.24074389040470123,
0.051585614681243896,
0.01804053597152233,
-0.008931674063205719,
-0.08750928193330765,
-0.10970550775527954,
-0.0323268361389637,
0.23177795112133026,
-0.02687721699476242,
-0.21029570698738098,
0.02741323411464691,
0.18460115790367126,
0.23746131360530853,
0.07167442888021469,
0.08952470868825912,
0.04954850301146507,
0.06777852773666382,
-0.14629441499710083,
0.18404847383499146,
-0.18610569834709167,
0.12738215923309326,
-0.20306061208248138,
0.22163009643554688,
-0.028031624853610992,
0.1604941338300705,
0.13386283814907074,
-0.617581844329834,
0.1874649077653885,
0.10207823663949966,
0.2229960709810257,
-0.11602345108985901,
-0.31252357363700867,
-0.11078979074954987,
0.04743168503046036,
0.24913136661052704,
0.11244902014732361,
0.258208304643631,
0.07161267101764679,
-0.10239896923303604,
-0.06493741273880005,
-0.06637124717235565,
-0.5312355160713196,
-0.34548693895339966,
-0.10372717678546906,
0.0878157913684845,
-0.30002105236053467,
0.14080318808555603,
-0.7221450805664062,
0.1560163050889969,
-0.05325702950358391,
0.09773193299770355,
0.07738115638494492,
0.09609320759773254,
-0.13276225328445435,
-0.12366920709609985,
0.27330875396728516,
0.5933367609977722,
-0.08484021574258804,
0.0395163893699646,
0.2403019666671753,
0.23261673748493195,
-0.21450045704841614,
0.27818000316619873,
-0.02195928432047367,
0.2645130753517151,
-0.292010635137558,
0.24369433522224426,
-0.11356817185878754,
-0.6017710566520691,
-0.4359705150127411,
-0.010447178035974503,
-0.15264534950256348,
0.009074553847312927,
-0.29205945134162903,
0.016204625368118286,
0.13325467705726624,
-0.0623147077858448,
0.11900029331445694,
0.20877128839492798,
-0.24007843434810638,
0.18113593757152557,
-0.23817026615142822,
-0.3470971882343292,
-0.23262150585651398,
0.18545863032341003,
0.11475522816181183,
0.02154846489429474,
0.21318179368972778,
0.3263508081436157,
0.20244520902633667,
-0.024947773665189743,
0.1899614930152893,
0.3201923966407776,
0.4501115083694458,
-0.0993412435054779,
-0.09271000325679779,
-0.209877610206604,
-0.6323097944259644,
0.2846708297729492,
0.16794399917125702,
0.053234368562698364,
-0.3494599461555481,
0.1946372091770172,
-0.27439168095588684,
-0.029308509081602097,
-0.19482798874378204,
0.04175327345728874,
0.04028390347957611,
-0.36031365394592285,
-0.029241975396871567,
0.11036791652441025,
-0.14898817241191864,
0.6183378100395203,
-0.19458910822868347,
0.3542884886264801,
-0.6337026357650757,
0.512210488319397,
0.02683228813111782,
-0.4411138594150543,
0.02382359653711319,
0.08215193450450897,
0.05386305972933769,
-0.3092927932739258,
-0.11693159490823746,
0.4038989245891571,
0.01920926570892334,
0.26811349391937256,
0.03603087365627289,
0.04488556832075119,
0.43833500146865845,
-0.27537840604782104,
-0.05240587890148163,
-0.19956858456134796,
0.1170160174369812,
-0.046354249119758606,
-0.22886250913143158,
-0.015591345727443695,
-0.292125403881073,
0.06825841963291168,
0.03214183449745178,
0.05413682013750076,
-0.17377158999443054,
0.12186754494905472,
0.10225207358598709,
0.1227358877658844,
0.25725916028022766,
0.13950002193450928,
0.11911283433437347,
-0.225267231464386,
0.14668068289756775,
-0.030953899025917053,
0.2970823049545288,
0.22183498740196228,
0.11994533985853195,
0.252066045999527,
-0.04785723239183426,
0.03723821043968201,
0.26402363181114197,
-0.0697721391916275,
0.1346370279788971,
0.018654540181159973,
-0.20413906872272491,
0.11079168319702148,
-0.04652320593595505,
-0.05337470769882202,
-0.027989991009235382,
0.04291684553027153,
0.2546132504940033,
0.09395167231559753,
0.12477453052997589,
0.14583691954612732,
-0.4397120177745819,
-0.2553316652774811,
-0.042554259300231934,
0.40854835510253906,
-0.3298245072364807,
-0.14427585899829865,
0.11875172704458237,
-0.008917205035686493,
0.09222322702407837,
-0.027045825496315956,
-0.5220124125480652,
-0.32780539989471436,
-0.0982920452952385,
0.39484238624572754,
0.04321974515914917,
0.06527012586593628,
0.20583929121494293,
0.20363575220108032,
0.10573390871286392,
-0.0074197594076395035,
-0.09950751066207886,
0.09459062665700912,
0.047340694814920425,
-0.035258907824754715,
0.3584125339984894,
-0.03736160695552826,
0.3393814265727997,
0.050835900008678436,
0.0314900279045105,
-0.21055413782596588,
-0.11323153227567673,
0.20359939336776733,
-0.3246883451938629,
0.11790333688259125,
0.043149564415216446,
0.3193013072013855,
-0.042569033801555634,
-0.13946633040905,
0.16523510217666626,
-0.07734128087759018,
-0.3081868290901184,
-0.06822795420885086,
0.033812154084444046,
-0.032184623181819916,
-0.05262061208486557,
0.23472391068935394,
-0.07345215976238251,
-0.4297168254852295,
0.38194549083709717,
0.15659058094024658,
0.17148330807685852,
0.483079731464386,
0.3417435884475708,
-0.009210161864757538,
-0.03066141903400421,
-0.4256892800331116,
0.0514705553650856,
-0.3874303996562958,
0.08062152564525604,
-0.09590399265289307,
-0.2702370584011078,
-0.13980653882026672,
0.2721305191516876,
-0.02699693664908409,
0.10512184351682663,
-0.5243523120880127,
-0.5751792192459106,
-0.24467390775680542,
0.28564533591270447,
-0.027803344652056694,
0.17378860712051392,
0.15669988095760345,
-0.11969583481550217,
0.058047279715538025,
-0.05026472359895706,
-0.18546104431152344,
0.08594837039709091,
0.3592475354671478,
-0.04376325011253357,
-0.03935525193810463,
0.1076287180185318,
0.23274271190166473,
0.3025320768356323,
0.38447141647338867,
-0.06413505971431732,
0.603260338306427,
-0.06518713384866714,
0.43277978897094727,
-0.31850114464759827,
-0.41036632657051086,
0.266403466463089,
0.03472559154033661,
-0.01174316555261612,
0.04970796778798103,
0.13876767456531525,
0.3257814347743988,
-0.053483352065086365,
-0.3194538950920105,
-0.16987380385398865,
-0.20972302556037903,
-0.06483224034309387,
0.038625363260507584,
-0.08944937586784363,
-0.24166688323020935,
-0.23586171865463257,
-0.1604452133178711,
-0.27703341841697693,
0.29135948419570923,
-0.07025625556707382,
0.2298131287097931,
0.09152474999427795,
-0.11015103757381439,
-0.03925098478794098,
-0.5846925973892212,
-0.01435282826423645,
0.06988397240638733,
0.15210939943790436,
-0.053901784121990204,
0.2401951253414154,
-0.0113607719540596,
-0.02619013376533985,
0.8798772096633911,
-0.23083390295505524,
0.1403200328350067,
-0.3226342499256134,
0.0014874860644340515,
-0.6607033014297485,
0.07847639918327332,
-0.11351621150970459,
0.4571097791194916,
0.04774307459592819,
0.8296194672584534,
-0.29395726323127747,
0.0025595612823963165,
-0.07985639572143555,
0.12555313110351562,
-0.11742071807384491,
-0.1574724018573761,
-0.05943873152136803,
-0.39749839901924133,
-0.3311919867992401,
0.07506689429283142,
0.3896030783653259,
0.29317983984947205,
0.017850108444690704,
-0.11632426828145981,
0.1731264591217041,
-0.14237108826637268,
0.11382658779621124,
-0.14550068974494934,
0.22223830223083496,
0.09718342125415802,
0.20221774280071259,
-0.0034335339441895485,
0.15254449844360352,
0.11766233295202255,
0.6614497900009155,
0.0808553621172905,
-0.1729193925857544,
0.08807238936424255,
0.04985087737441063,
-0.01666727289557457,
0.5244397521018982,
0.1491088569164276,
0.1704937219619751,
-0.13868996500968933,
0.3023982048034668,
-0.5109803676605225,
0.20389172434806824,
0.2384829819202423,
-0.03798309713602066,
-0.36966121196746826,
0.2746676802635193,
0.519271969795227,
-0.0331600159406662,
0.20878064632415771,
0.36948591470718384,
0.5697070360183716,
-0.29717496037483215,
0.15353402495384216,
0.008300311863422394,
0.8701192140579224,
-0.09938997030258179,
0.19040876626968384,
0.019225072115659714,
-0.01896502822637558,
0.6253466010093689,
-0.06607910245656967,
-0.16006605327129364,
-0.25171416997909546,
-0.18982991576194763,
0.0402802973985672,
0.10505568236112595,
-0.03816571831703186,
-0.17729789018630981,
-0.0447271503508091,
0.22227640450000763,
-0.1341124325990677,
0.27329951524734497,
-0.18283143639564514,
0.3496757745742798,
-0.5536091923713684,
-0.41370344161987305,
-0.1962343156337738,
0.13400566577911377,
-0.007176969200372696,
0.14847227931022644,
0.03440478816628456,
-0.044361039996147156,
-0.19828379154205322,
-0.15195637941360474,
-0.653756856918335,
-0.010885316878557205,
-0.03458782657980919,
-0.022365953773260117,
0.04027659818530083,
-0.17083700001239777,
0.047833673655986786,
0.06817078590393066,
0.5800436735153198,
0.08742250502109528,
-0.4310028553009033,
0.11103767156600952,
-0.47648051381111145,
-0.06469129025936127,
0.014861255884170532,
0.03122718259692192,
0.10943131148815155,
-0.03735861927270889,
-0.046567656099796295,
-0.04980785772204399,
0.10153643786907196,
-0.14995034039020538,
-0.16936521232128143,
-0.004205130040645599,
-0.22128821909427643,
-0.16098816692829132,
-0.19646504521369934,
-0.0076362453401088715,
-0.01928769052028656,
-0.14961843192577362,
0.028436124324798584,
0.16876310110092163,
-0.01841077208518982,
0.1615733951330185,
0.11432363092899323,
0.014308199286460876,
-0.04106147959828377,
0.37982168793678284,
-0.28330135345458984,
-0.3355764150619507,
0.10353942215442657,
0.3509056568145752,
0.010236196219921112,
-0.028705623000860214,
0.25394004583358765,
0.5137038230895996,
-0.7918705940246582,
0.14956530928611755,
-0.26024749875068665,
0.05395394563674927,
-0.15535974502563477,
0.15329793095588684,
0.29688718914985657,
-0.0376284196972847,
-0.0011574923992156982,
-0.06025040149688721,
-0.31003332138061523,
0.20248137414455414,
0.08444711565971375,
0.196979820728302,
-0.27705666422843933,
-0.08124331384897232,
0.2240292727947235,
0.20599865913391113,
-0.2326822578907013,
0.403881311416626,
-0.3076285719871521,
0.14081308245658875,
-0.21610647439956665,
-0.10694904625415802,
0.12148316204547882,
-0.46267712116241455,
0.022208496928215027,
0.2259952872991562,
-0.20433735847473145,
-0.10855148732662201,
-0.2228391170501709,
0.1152925044298172,
0.26226338744163513,
-0.20873095095157623,
-0.06715291738510132,
-0.1532229781150818,
-0.06474802643060684,
-0.1910955309867859,
0.33402103185653687,
0.39458420872688293,
-0.10424572229385376,
-0.15621285140514374,
0.5975620150566101,
0.1576196551322937,
0.03865561634302139,
0.21306385099887848,
0.21502487361431122,
0.45959192514419556,
0.0917322188615799,
0.06278257071971893,
0.21763913333415985,
-0.0012707486748695374,
-0.19054916501045227,
0.3807227909564972,
0.1327081322669983,
0.1182388961315155,
0.20982636511325836,
-0.30695703625679016,
0.04175242781639099,
-0.01454995572566986,
0.5627243518829346,
0.12137836217880249,
-0.3051614463329315,
-0.04960160702466965,
0.09305965155363083,
0.14602024853229523,
0.05562698841094971,
-0.16879144310951233,
0.3829447031021118,
-0.07288634032011032,
0.003163248300552368,
0.2138090878725052,
0.12759093940258026,
-0.030850648880004883,
-0.16774070262908936,
0.10259933769702911,
0.7401980757713318,
0.07701914757490158,
-0.10951830446720123,
0.046770595014095306,
-0.09025086462497711,
0.05177834630012512,
0.014631452038884163,
0.05903574824333191,
0.1639782339334488,
0.53267902135849,
-0.11151492595672607,
0.3597628176212311,
-0.11338520050048828,
-0.1331799030303955,
0.3579523265361786,
-0.3008936643600464,
-0.15908299386501312,
-0.07426005601882935,
-0.026896338909864426,
0.17069968581199646,
-0.18293654918670654,
0.5134492516517639,
-0.2859840393066406,
-0.27599069476127625,
-0.17344114184379578,
0.059171922504901886,
-0.06092366203665733,
0.15411317348480225,
-0.018420524895191193,
-0.16028989851474762,
-0.22288724780082703,
0.15642498433589935,
-0.17298339307308197,
-0.5086225867271423,
0.2644920349121094,
0.17572082579135895,
-0.238808274269104,
-0.02755093201994896,
-0.15017327666282654,
0.17559728026390076,
0.19712398946285248,
-0.05690678954124451,
0.4266086220741272,
0.2859242856502533,
-0.2691148817539215,
-0.06891300529241562,
0.5010249614715576,
0.4501245617866516,
0.12178727984428406,
0.0585838183760643,
0.3645893633365631,
0.33709293603897095,
0.11736869066953659,
0.12791812419891357,
0.026200667023658752,
-0.13303126394748688,
0.24419429898262024,
0.002224944531917572,
0.12433058023452759,
-0.06354418396949768,
-0.14879316091537476,
0.04084515944123268,
-0.009158633649349213,
-0.02886251173913479,
0.25815051794052124,
-0.38825523853302,
-0.18968167901039124,
-0.12541162967681885,
0.06251485645771027,
-0.34143489599227905,
0.10964497923851013,
0.25164636969566345,
-0.275725781917572,
0.07314199209213257,
-0.11082448065280914,
0.02519330009818077,
-0.15901148319244385,
0.49280187487602234,
0.5523576736450195,
0.13529163599014282,
-0.168351948261261,
-0.1900160014629364,
-0.30823448300361633,
0.25160548090934753,
-0.21203896403312683,
0.0033906102180480957,
0.08323238044977188,
-0.03478375822305679,
-0.12437035143375397,
-0.00695650652050972,
-0.005539432168006897,
0.15126600861549377,
-0.07057398557662964,
0.16730739176273346,
-0.3014064431190491,
0.05482150614261627,
0.16848048567771912,
0.08784686774015427,
0.03623409569263458,
-0.10443533957004547,
0.5327133536338806,
-0.14628316462039948,
-0.031133044511079788,
-0.046246521174907684,
0.22646579146385193,
-0.12741288542747498,
-0.42799490690231323,
0.1401699036359787,
0.003934506326913834,
0.12498311698436737,
-0.1652386486530304,
-0.2723782956600189,
-0.3330349326133728,
-0.20363323390483856,
-0.19995248317718506,
-0.1601690798997879,
-0.08435362577438354,
0.47047409415245056,
-0.09058649837970734,
-0.46778440475463867,
-0.16596710681915283,
0.2467823475599289,
0.02067536860704422,
0.30588898062705994,
-0.0819665789604187,
0.04492922127246857,
-0.0822303518652916,
0.08640117198228836,
0.28952550888061523,
0.24616344273090363,
-0.0155886709690094,
0.2206456959247589,
-0.2443140149116516,
-0.3616321086883545,
0.3929228186607361,
-0.09498864412307739,
-0.20235489308834076,
0.023585528135299683,
0.23584333062171936,
0.301608145236969,
-0.25231415033340454,
-0.3969235420227051,
-0.03404586762189865,
0.1511625498533249,
0.002982199192047119,
-0.39437398314476013,
0.3542637526988983,
-0.12558256089687347,
-0.20020803809165955,
0.1343485563993454,
0.10167814046144485,
0.15848390758037567,
-0.25118812918663025,
0.6088979840278625,
-0.012556314468383789
] |
https://github.com/huggingface/datasets/issues/5671 | Sounds like an issue with incompatible `transformers` dependencies versions.
Can you try to update `transformers` ?
EDIT: I checked the `transformers` dependencies and it seems like you need `tokenizers>=0.10.1,<0.11` with `transformers==4.5.1`
EDIT2: this old version of `datasets` seems to import `transformers` but it's no longer the case, so you could also simply update `datasets` and `transformers` won't be imported | How to use `load_dataset('glue', 'cola')` | ### Describe the bug
I'm new to use HuggingFace datasets but I cannot use `load_dataset('glue', 'cola')`.
- I was stacked by the following problem:
```python
from datasets import load_dataset
cola_dataset = load_dataset('glue', 'cola')
---------------------------------------------------------------------------
InvalidVersion Traceback (most recent call last)
File <timed exec>:1
(Omit because of long error message)
File /usr/local/lib/python3.8/site-packages/packaging/version.py:197, in Version.__init__(self, version)
195 match = self._regex.search(version)
196 if not match:
--> 197 raise InvalidVersion(f"Invalid version: '{version}'")
199 # Store the parsed out pieces of the version
200 self._version = _Version(
201 epoch=int(match.group("epoch")) if match.group("epoch") else 0,
202 release=tuple(int(i) for i in match.group("release").split(".")),
(...)
208 local=_parse_local_version(match.group("local")),
209 )
InvalidVersion: Invalid version: '0.10.1,<0.11'
```
- You can check this full error message in my repository: [MLOps-Basics/week_0_project_setup/experimental_notebooks/data_exploration.ipynb](https://github.com/makinzm/MLOps-Basics/blob/eabab4b837880607d9968d3fa687c70177b2affd/week_0_project_setup/experimental_notebooks/data_exploration.ipynb)
### Steps to reproduce the bug
- This is my repository to reproduce: [MLOps-Basics/week_0_project_setup](https://github.com/makinzm/MLOps-Basics/tree/eabab4b837880607d9968d3fa687c70177b2affd/week_0_project_setup)
1. cd `/DockerImage` and command `docker build . -t week0`
2. cd `/` and command `docker-compose up`
3. Run `experimental_notebooks/data_exploration.ipynb`
----
Just to be sure, I wrote down Dockerfile and requirements.txt
- Dockerfile
```Dockerfile
FROM python:3.8
WORKDIR /root/working
RUN apt-get update && \
apt-get install -y python3-dev python3-pip python3-venv && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip3 install --no-cache-dir jupyter notebook && pip install --no-cache-dir -r requirements.txt
CMD ["bash"]
```
- requirements.txt
```txt
pytorch-lightning==1.2.10
datasets==1.6.2
transformers==4.5.1
scikit-learn==0.24.2
```
### Expected behavior
There is no bug to implement `load_dataset('glue', 'cola')`
### Environment info
I already wrote it. | 59 | How to use `load_dataset('glue', 'cola')`
### Describe the bug
I'm new to use HuggingFace datasets but I cannot use `load_dataset('glue', 'cola')`.
- I was stacked by the following problem:
```python
from datasets import load_dataset
cola_dataset = load_dataset('glue', 'cola')
---------------------------------------------------------------------------
InvalidVersion Traceback (most recent call last)
File <timed exec>:1
(Omit because of long error message)
File /usr/local/lib/python3.8/site-packages/packaging/version.py:197, in Version.__init__(self, version)
195 match = self._regex.search(version)
196 if not match:
--> 197 raise InvalidVersion(f"Invalid version: '{version}'")
199 # Store the parsed out pieces of the version
200 self._version = _Version(
201 epoch=int(match.group("epoch")) if match.group("epoch") else 0,
202 release=tuple(int(i) for i in match.group("release").split(".")),
(...)
208 local=_parse_local_version(match.group("local")),
209 )
InvalidVersion: Invalid version: '0.10.1,<0.11'
```
- You can check this full error message in my repository: [MLOps-Basics/week_0_project_setup/experimental_notebooks/data_exploration.ipynb](https://github.com/makinzm/MLOps-Basics/blob/eabab4b837880607d9968d3fa687c70177b2affd/week_0_project_setup/experimental_notebooks/data_exploration.ipynb)
### Steps to reproduce the bug
- This is my repository to reproduce: [MLOps-Basics/week_0_project_setup](https://github.com/makinzm/MLOps-Basics/tree/eabab4b837880607d9968d3fa687c70177b2affd/week_0_project_setup)
1. cd `/DockerImage` and command `docker build . -t week0`
2. cd `/` and command `docker-compose up`
3. Run `experimental_notebooks/data_exploration.ipynb`
----
Just to be sure, I wrote down Dockerfile and requirements.txt
- Dockerfile
```Dockerfile
FROM python:3.8
WORKDIR /root/working
RUN apt-get update && \
apt-get install -y python3-dev python3-pip python3-venv && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip3 install --no-cache-dir jupyter notebook && pip install --no-cache-dir -r requirements.txt
CMD ["bash"]
```
- requirements.txt
```txt
pytorch-lightning==1.2.10
datasets==1.6.2
transformers==4.5.1
scikit-learn==0.24.2
```
### Expected behavior
There is no bug to implement `load_dataset('glue', 'cola')`
### Environment info
I already wrote it.
Sounds like an issue with incompatible `transformers` dependencies versions.
Can you try to update `transformers` ?
EDIT: I checked the `transformers` dependencies and it seems like you need `tokenizers>=0.10.1,<0.11` with `transformers==4.5.1`
EDIT2: this old version of `datasets` seems to import `transformers` but it's no longer the case, so you could also simply update `datasets` and `transformers` won't be imported | [
-0.22955703735351562,
-0.36152297258377075,
0.02578902244567871,
0.3840595781803131,
0.17230817675590515,
0.07655145227909088,
0.31120720505714417,
-0.01677183248102665,
0.4112164378166199,
0.025528445839881897,
-0.3663536012172699,
0.050917595624923706,
0.02579551562666893,
0.28582367300987244,
-0.14273345470428467,
-0.23819458484649658,
0.0791148990392685,
0.17409393191337585,
-0.15148577094078064,
0.14911021292209625,
-0.3921705484390259,
0.27387478947639465,
-0.2541559934616089,
0.03857022523880005,
-0.10840544104576111,
-0.36754903197288513,
-0.0720086470246315,
0.31197869777679443,
-0.24261316657066345,
-0.12243713438510895,
0.3612155020236969,
0.07714040577411652,
0.30369460582733154,
0.4733152389526367,
-0.00012102051550755277,
0.12304375320672989,
0.34071648120880127,
-0.10841090977191925,
-0.27077287435531616,
-0.27401286363601685,
-0.21026968955993652,
-0.06702636927366257,
0.15336504578590393,
-0.22621889412403107,
-0.32113391160964966,
0.2426084280014038,
-0.04786594957113266,
-0.48352140188217163,
0.6340827941894531,
0.18585211038589478,
0.18082356452941895,
0.46188443899154663,
0.1781502664089203,
-0.17928659915924072,
0.1972050666809082,
-0.13090887665748596,
-0.0335845947265625,
0.5596613883972168,
0.19365324079990387,
0.08017604798078537,
0.3797239661216736,
0.27794361114501953,
-0.2604685425758362,
0.017868772149086,
0.16919833421707153,
0.03907902166247368,
0.18155494332313538,
-0.3164764940738678,
0.16039933264255524,
0.20110414922237396,
0.2637341320514679,
-0.2232346087694168,
-0.25704437494277954,
-0.11190050840377808,
-0.12061944603919983,
-0.43852710723876953,
0.18859826028347015,
0.08478855341672897,
0.1449769288301468,
0.47014713287353516,
-0.19765017926692963,
-0.19911085069179535,
-0.06318799406290054,
0.15746399760246277,
-0.032500095665454865,
0.1802423596382141,
-0.2835197150707245,
0.18935328722000122,
0.33277904987335205,
-0.21353177726268768,
-0.11722344160079956,
-0.03352731838822365,
-0.03569489344954491,
0.11585986614227295,
-0.21209484338760376,
0.06379737704992294,
-0.1360660046339035,
0.5093762874603271,
0.2567223906517029,
-0.07837730646133423,
-0.09677116572856903,
-0.16642975807189941,
0.09131305664777756,
0.17552825808525085,
0.05522264912724495,
0.28514087200164795,
0.35784846544265747,
-0.010381992906332016,
0.17718327045440674,
0.20356658101081848,
0.10323230177164078,
-0.03636854887008667,
0.09162819385528564,
-0.2678077220916748,
-0.08157256990671158,
-0.02144855260848999,
0.4384731352329254,
-0.2390221208333969,
-0.2916918992996216,
-0.09605038911104202,
-0.44393476843833923,
0.05204145610332489,
0.1716850996017456,
0.41492408514022827,
-0.20229940116405487,
0.06706268340349197,
0.21372506022453308,
0.2579965889453888,
-0.1960175335407257,
-0.20091450214385986,
-0.15071649849414825,
0.11023152619600296,
-0.13578280806541443,
0.14727438986301422,
0.11476374417543411,
-0.5891348123550415,
0.15796998143196106,
-0.1554027497768402,
-0.21668699383735657,
0.04713338613510132,
-0.09495115280151367,
-0.34982699155807495,
0.022234519943594933,
0.214450865983963,
0.1300048828125,
0.09121809154748917,
0.04598677158355713,
-0.5849251747131348,
-0.11033570766448975,
-0.02683708816766739,
-0.16076132655143738,
-0.32077157497406006,
-0.1887577921152115,
0.10924727469682693,
-0.42403578758239746,
0.20642495155334473,
-0.4555826187133789,
0.21484431624412537,
0.11997470259666443,
0.03309229761362076,
-0.050932951271533966,
-0.022133732214570045,
-0.4727294445037842,
-0.2834615707397461,
0.36394476890563965,
0.6502658128738403,
-0.22152100503444672,
-0.15937946736812592,
-0.06588368117809296,
-0.16426725685596466,
-0.09244231134653091,
0.3035300672054291,
0.10133868455886841,
0.060569338500499725,
-0.1921716332435608,
-0.2190380096435547,
0.2222737967967987,
-0.5523386001586914,
-0.4957563281059265,
0.09960198402404785,
-0.003904372453689575,
0.06417687982320786,
0.18387560546398163,
-0.1722012162208557,
0.15446710586547852,
-0.12458071857690811,
0.20380467176437378,
0.42936593294143677,
0.07307901978492737,
-0.15433762967586517,
-0.1978786289691925,
-0.25950491428375244,
0.18739008903503418,
0.07444733381271362,
-0.19411614537239075,
0.17912811040878296,
0.2856019139289856,
0.03957498073577881,
0.07672838866710663,
-0.03521496802568436,
-0.06379793584346771,
0.10131438076496124,
0.2309785783290863,
0.09121140837669373,
-0.08379833400249481,
-0.13965122401714325,
-0.6961754560470581,
0.19406941533088684,
0.03135643154382706,
-0.06452381610870361,
0.05646763741970062,
-0.13576124608516693,
-0.3840029239654541,
0.019205018877983093,
-0.18709862232208252,
-0.07372542470693588,
-0.009066667407751083,
0.04370137304067612,
0.45165765285491943,
0.18688195943832397,
0.09544668346643448,
0.5380361676216125,
0.03586719185113907,
0.168379008769989,
-0.6525776982307434,
0.4661604166030884,
-0.05760112404823303,
-0.05155481398105621,
-0.007997699081897736,
0.208436980843544,
0.3996463119983673,
-0.33030593395233154,
0.13839633762836456,
0.3781161904335022,
-0.11013660579919815,
0.05027633160352707,
-0.1432160884141922,
0.13421086966991425,
0.2894997000694275,
-0.1283506602048874,
0.15177172422409058,
-0.14895008504390717,
0.16799622774124146,
0.08416140079498291,
0.08909677714109421,
0.27434495091438293,
-0.01239437609910965,
0.13457897305488586,
-0.05034887418150902,
0.07744200527667999,
0.21163228154182434,
-0.13067857921123505,
-0.25920727849006653,
-0.34231576323509216,
0.1811087727546692,
0.07955634593963623,
0.4235764145851135,
-0.003737381659448147,
-0.31164178252220154,
-0.14997604489326477,
0.14480473101139069,
-0.13556179404258728,
0.19991256296634674,
-0.11092320084571838,
-0.2939532995223999,
0.13371090590953827,
0.2560582458972931,
0.17065218091011047,
0.4940639138221741,
0.18830393254756927,
-0.20639973878860474,
0.09629490971565247,
0.037969786673784256,
0.008934680372476578,
0.12259626388549805,
0.07650311291217804,
0.3042260706424713,
-0.10430113971233368,
0.15906170010566711,
0.1569766253232956,
-0.08929762989282608,
0.012931615114212036,
0.014255069196224213,
0.1012837365269661,
-0.5062037110328674,
0.08559834957122803,
-0.3282846510410309,
-0.47077035903930664,
-0.26114195585250854,
-0.1771785169839859,
-0.22716820240020752,
-0.11968983709812164,
-0.2800459563732147,
0.2678680419921875,
0.2280571162700653,
0.14702436327934265,
0.4440058469772339,
0.2580668330192566,
0.09382529556751251,
-0.10288681834936142,
-0.16532766819000244,
0.04068430885672569,
-0.10925029218196869,
-0.031417712569236755,
0.09360001236200333,
0.19959770143032074,
0.47264841198921204,
-0.4759044945240021,
-0.2694839835166931,
-0.3000013530254364,
-0.3095836639404297,
0.36491864919662476,
-0.20283620059490204,
0.5723055601119995,
0.43432873487472534,
0.12110184133052826,
0.15112552046775818,
-0.12839099764823914,
0.3864676058292389,
-0.285089373588562,
-0.041181206703186035,
-0.15817156434059143,
-0.07872679084539413,
-0.039273884147405624,
-0.09048186242580414,
-0.1997712254524231,
-0.4693892002105713,
-0.2477835714817047,
0.37834325432777405,
0.07503922283649445,
0.010950963944196701,
0.3992561399936676,
-0.021542511880397797,
0.2501410245895386,
0.007188465446233749,
0.09522739797830582,
-0.30020007491111755,
-0.1507381945848465,
0.26863962411880493,
-0.17575068771839142,
-0.3241255283355713,
-0.08733703941106796,
-0.034984998404979706,
-0.13072863221168518,
-0.006715346127748489,
-0.2836438715457916,
-0.61215740442276,
-0.05328305810689926,
0.07959090173244476,
-0.06048724055290222,
0.30377089977264404,
0.05918758735060692,
-0.18498489260673523,
0.20856362581253052,
-0.1103743463754654,
-0.5180071592330933,
0.08415291458368301,
0.07970736920833588,
0.36536115407943726,
0.41907867789268494,
0.6304250955581665,
-0.12634000182151794,
0.5049529671669006,
0.10932600498199463,
-0.24799518287181854,
0.29843270778656006,
-0.20244792103767395,
0.42809146642684937,
-0.1555524468421936,
-0.43863049149513245,
-0.046315986663103104,
-0.01730027049779892,
0.07837818562984467,
0.056490976363420486,
0.05413946509361267,
0.12293724715709686,
-0.4024598002433777,
-0.16073718667030334,
-0.28381723165512085,
-0.0726107656955719,
-0.13276147842407227,
0.10702437162399292,
0.03222115710377693,
0.07144935429096222,
0.05009113997220993,
0.00995047390460968,
-0.11264115571975708,
0.028369754552841187,
0.41688668727874756,
-0.0850568413734436,
0.18941953778266907,
0.06643586605787277,
-0.049057167023420334,
-0.6214500665664673,
0.678101122379303,
0.015611033886671066,
0.04077404737472534,
-0.020659111440181732,
0.06244280934333801,
0.025848206132650375,
0.03792488947510719,
0.5683903694152832,
-0.20580615103244781,
0.2787342071533203,
0.13826388120651245,
-0.39059847593307495,
-0.5030261278152466,
-0.05955888703465462,
-0.38567960262298584,
0.012499690055847168,
0.3496204912662506,
0.5352662205696106,
-0.3749350905418396,
-0.1709379404783249,
0.3507574498653412,
0.11330989003181458,
-0.19082143902778625,
-0.23138415813446045,
-0.24672560393810272,
-0.3312339186668396,
-0.29540741443634033,
-0.17059659957885742,
0.056143201887607574,
0.19270431995391846,
0.07101710140705109,
0.17794574797153473,
-0.07787330448627472,
-0.1415269672870636,
-0.013950563967227936,
0.24973823130130768,
0.4115704298019409,
0.14207084476947784,
0.11596782505512238,
0.2961343228816986,
0.32406824827194214,
0.1491527557373047,
0.6474003195762634,
-0.19233739376068115,
-0.14585204422473907,
-0.09174606204032898,
0.19351108372211456,
0.24257434904575348,
0.17050012946128845,
-0.2630906105041504,
-0.1337357759475708,
-0.14725440740585327,
0.18329282104969025,
-0.09955078363418579,
0.21306410431861877,
0.23314696550369263,
0.11347539722919464,
-0.38199368119239807,
-0.30609315633773804,
0.3454027473926544,
0.24842411279678345,
-0.17698895931243896,
0.0549250952899456,
0.26353567838668823,
-0.3695024251937866,
0.35603585839271545,
-0.14973987638950348,
0.8845188617706299,
-0.12728382647037506,
-0.010340213775634766,
0.3208596110343933,
-0.14468833804130554,
0.7692082524299622,
0.2916826009750366,
-0.11614486575126648,
-0.27381637692451477,
-0.25033408403396606,
-0.03848392143845558,
-0.06038467586040497,
0.2921887934207916,
-0.04767797887325287,
-0.5432040691375732,
0.5064112544059753,
0.1889425665140152,
-0.04540561884641647,
-0.08222444355487823,
0.34642481803894043,
0.03482577204704285,
-0.13621653616428375,
-0.7260339856147766,
0.05542265623807907,
-0.03360597416758537,
0.23003441095352173,
-0.12340882420539856,
0.0766168013215065,
0.015692755579948425,
-0.39285755157470703,
-0.3059665262699127,
-0.11254274845123291,
-0.7953397035598755,
0.13094782829284668,
0.3306942582130432,
-0.3219338059425354,
0.1210961788892746,
0.22776715457439423,
0.20415757596492767,
0.2711997628211975,
-0.18289227783679962,
-0.07589485496282578,
0.15498822927474976,
-0.24324318766593933,
-0.1450643241405487,
-0.105097696185112,
0.379329115152359,
-0.032062750309705734,
-0.07770323008298874,
-0.03974459692835808,
-0.09244469553232193,
-0.1379108875989914,
0.13025876879692078,
-0.0316002257168293,
0.008651726879179478,
-0.20004209876060486,
-0.27007725834846497,
-0.029409408569335938,
0.2947181761264801,
-0.06204153597354889,
0.03746379539370537,
0.09752172976732254,
-0.08587464690208435,
-0.10081946849822998,
-0.08359746634960175,
-0.22921760380268097,
-0.175676167011261,
0.5161117911338806,
-0.25542986392974854,
0.039760321378707886,
0.204865500330925,
0.13139241933822632,
-0.08810711652040482,
-0.034662507474422455,
-0.04143562912940979,
0.13970787823200226,
-0.29214200377464294,
0.07324500381946564,
0.1363195776939392,
-0.14370810985565186,
-0.12086768448352814,
0.43882715702056885,
0.37383511662483215,
-0.16757522523403168,
0.1810912787914276,
-0.46791279315948486,
-0.14990052580833435,
0.20061199367046356,
-0.06646712124347687,
0.011138777248561382,
0.48123833537101746,
0.0886717438697815,
0.07204443961381912,
0.06800411641597748,
-0.23064137995243073,
0.047984711825847626,
-0.12939810752868652,
-0.05169512704014778,
0.6232167482376099,
-0.1367403268814087,
0.23166579008102417,
-0.07187153398990631,
0.03583722561597824,
0.1371602565050125,
-0.19781944155693054,
-0.12367399036884308,
-0.25332167744636536,
0.17469727993011475,
-0.11130093783140182,
-0.24712517857551575,
-0.027999956160783768,
-0.1543891429901123,
-0.027841541916131973,
-0.11549530923366547,
0.3447171151638031,
0.4859251081943512,
0.05736539140343666,
-0.07646289467811584,
0.29569125175476074,
-0.0953727513551712,
-0.19327619671821594,
0.20662248134613037,
-0.013884630054235458,
0.020996080711483955,
0.15575619041919708,
0.2655797600746155,
-0.10640788823366165,
-0.054434098303318024,
0.049170561134815216,
-0.0493895560503006,
0.16524438560009003,
-0.024484550580382347,
0.30855754017829895,
-0.12822477519512177,
-0.16170985996723175,
0.2809083163738251,
0.35603392124176025,
0.18997615575790405,
-0.2716277241706848,
0.03837026655673981,
0.07029516994953156,
0.06988264620304108,
-0.22375747561454773,
0.07775503396987915,
0.46482664346694946,
0.1035182923078537,
0.06304045021533966,
0.5426120162010193,
0.11223536729812622,
0.3301418423652649,
-0.14165771007537842,
0.029922567307949066,
0.4650992155075073,
0.22586335241794586,
0.03774142265319824,
-0.16035372018814087,
-0.05276463180780411,
0.12484455108642578,
0.19339661300182343,
0.16661590337753296,
0.2957909405231476,
-0.12918566167354584,
-0.07481768727302551,
0.20072683691978455,
-0.14403915405273438,
0.26972073316574097,
0.22240540385246277,
-0.319825679063797,
0.05275889113545418,
0.13333043456077576,
-0.3410724997520447,
0.10033918172121048,
-0.14251136779785156,
0.7525185942649841,
-0.33158034086227417,
-0.14115093648433685,
-0.23665542900562286,
0.32910382747650146,
-0.12885072827339172,
-0.2201649248600006,
0.10851740837097168,
-0.03652466833591461,
-0.3173665404319763,
-0.018885537981987,
-0.07326371967792511,
-0.2733434736728668,
0.3929460048675537,
-0.07505781948566437,
0.006492443382740021,
-0.18123939633369446,
-0.23818182945251465,
0.24955928325653076,
0.03530025854706764,
-0.10600253939628601,
0.4841880202293396,
-0.06832820177078247,
-0.003810930997133255,
0.18689730763435364,
0.5273452997207642,
0.5166782736778259,
0.05805140733718872,
0.010295461863279343,
-0.03782324865460396,
0.03978722542524338,
-0.011774469166994095,
-0.06022161245346069,
0.13879871368408203,
0.00041409581899642944,
0.10109326988458633,
0.449344664812088,
0.12258027493953705,
-0.12172773480415344,
0.18857385218143463,
-0.17821088433265686,
0.2385416477918625,
-0.40147045254707336,
0.12206809222698212,
-0.35371533036231995,
-0.012023165822029114,
-0.28617289662361145,
0.1923922896385193,
-0.3950071930885315,
0.2680332362651825,
0.05367998406291008,
-0.08756858110427856,
0.20087647438049316,
-0.021952174603939056,
0.024044327437877655,
0.03220384567975998,
0.44238027930259705,
0.4098002314567566,
0.1773853898048401,
-0.26569926738739014,
-0.1237080991268158,
-0.6859099268913269,
0.012245140969753265,
-0.07425475865602493,
-0.05619820952415466,
-0.000748269259929657,
-0.05232998728752136,
0.04342632740736008,
0.32090499997138977,
0.059962380677461624,
0.20620331168174744,
-0.00036994367837905884,
-0.32803887128829956,
-0.27168673276901245,
-0.21314868330955505,
-0.03420845419168472,
-0.12788337469100952,
0.18529480695724487,
-0.37819167971611023,
0.07246541976928711,
-0.05153466761112213,
-0.08601078391075134,
-0.12742489576339722,
-0.013790160417556763,
-0.03161001577973366,
-0.1259932518005371,
0.23764266073703766,
0.2617766261100769,
0.3513570725917816,
-0.12496142089366913,
0.10303594917058945,
-0.05925668030977249,
-0.15669037401676178,
-0.2539103925228119,
0.15789742767810822,
-0.052029214799404144,
0.16268610954284668,
-0.3297818601131439,
-0.12406691163778305,
-0.20084942877292633,
0.21885278820991516,
0.1037878543138504,
-0.09227314591407776,
-0.3335023820400238,
0.1234431117773056,
-0.2167818397283554,
-0.056248899549245834,
0.07822388410568237,
0.30373892188072205,
-0.1640070080757141,
0.2793753743171692,
-0.16432490944862366,
-0.2712860405445099,
0.6312525272369385,
-0.407733678817749,
-0.03270452469587326,
0.11961063742637634,
0.1255837082862854,
0.27276068925857544,
-0.29502981901168823,
-0.5494273900985718,
0.04407113790512085,
0.2307448536157608,
-0.08669622242450714,
-0.40301257371902466,
0.220657616853714,
-0.21369436383247375,
-0.06679201126098633,
0.035769350826740265,
0.22065843641757965,
0.2637675702571869,
-0.36493349075317383,
0.07430216670036316,
-0.18482166528701782
] |
https://github.com/huggingface/datasets/issues/5671 | Thank you for advising me to update these libraries versions.
I can implement codes using `datasets==2.10.1` and `transformers==4.27.3` | How to use `load_dataset('glue', 'cola')` | ### Describe the bug
I'm new to use HuggingFace datasets but I cannot use `load_dataset('glue', 'cola')`.
- I was stacked by the following problem:
```python
from datasets import load_dataset
cola_dataset = load_dataset('glue', 'cola')
---------------------------------------------------------------------------
InvalidVersion Traceback (most recent call last)
File <timed exec>:1
(Omit because of long error message)
File /usr/local/lib/python3.8/site-packages/packaging/version.py:197, in Version.__init__(self, version)
195 match = self._regex.search(version)
196 if not match:
--> 197 raise InvalidVersion(f"Invalid version: '{version}'")
199 # Store the parsed out pieces of the version
200 self._version = _Version(
201 epoch=int(match.group("epoch")) if match.group("epoch") else 0,
202 release=tuple(int(i) for i in match.group("release").split(".")),
(...)
208 local=_parse_local_version(match.group("local")),
209 )
InvalidVersion: Invalid version: '0.10.1,<0.11'
```
- You can check this full error message in my repository: [MLOps-Basics/week_0_project_setup/experimental_notebooks/data_exploration.ipynb](https://github.com/makinzm/MLOps-Basics/blob/eabab4b837880607d9968d3fa687c70177b2affd/week_0_project_setup/experimental_notebooks/data_exploration.ipynb)
### Steps to reproduce the bug
- This is my repository to reproduce: [MLOps-Basics/week_0_project_setup](https://github.com/makinzm/MLOps-Basics/tree/eabab4b837880607d9968d3fa687c70177b2affd/week_0_project_setup)
1. cd `/DockerImage` and command `docker build . -t week0`
2. cd `/` and command `docker-compose up`
3. Run `experimental_notebooks/data_exploration.ipynb`
----
Just to be sure, I wrote down Dockerfile and requirements.txt
- Dockerfile
```Dockerfile
FROM python:3.8
WORKDIR /root/working
RUN apt-get update && \
apt-get install -y python3-dev python3-pip python3-venv && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip3 install --no-cache-dir jupyter notebook && pip install --no-cache-dir -r requirements.txt
CMD ["bash"]
```
- requirements.txt
```txt
pytorch-lightning==1.2.10
datasets==1.6.2
transformers==4.5.1
scikit-learn==0.24.2
```
### Expected behavior
There is no bug to implement `load_dataset('glue', 'cola')`
### Environment info
I already wrote it. | 18 | How to use `load_dataset('glue', 'cola')`
### Describe the bug
I'm new to use HuggingFace datasets but I cannot use `load_dataset('glue', 'cola')`.
- I was stacked by the following problem:
```python
from datasets import load_dataset
cola_dataset = load_dataset('glue', 'cola')
---------------------------------------------------------------------------
InvalidVersion Traceback (most recent call last)
File <timed exec>:1
(Omit because of long error message)
File /usr/local/lib/python3.8/site-packages/packaging/version.py:197, in Version.__init__(self, version)
195 match = self._regex.search(version)
196 if not match:
--> 197 raise InvalidVersion(f"Invalid version: '{version}'")
199 # Store the parsed out pieces of the version
200 self._version = _Version(
201 epoch=int(match.group("epoch")) if match.group("epoch") else 0,
202 release=tuple(int(i) for i in match.group("release").split(".")),
(...)
208 local=_parse_local_version(match.group("local")),
209 )
InvalidVersion: Invalid version: '0.10.1,<0.11'
```
- You can check this full error message in my repository: [MLOps-Basics/week_0_project_setup/experimental_notebooks/data_exploration.ipynb](https://github.com/makinzm/MLOps-Basics/blob/eabab4b837880607d9968d3fa687c70177b2affd/week_0_project_setup/experimental_notebooks/data_exploration.ipynb)
### Steps to reproduce the bug
- This is my repository to reproduce: [MLOps-Basics/week_0_project_setup](https://github.com/makinzm/MLOps-Basics/tree/eabab4b837880607d9968d3fa687c70177b2affd/week_0_project_setup)
1. cd `/DockerImage` and command `docker build . -t week0`
2. cd `/` and command `docker-compose up`
3. Run `experimental_notebooks/data_exploration.ipynb`
----
Just to be sure, I wrote down Dockerfile and requirements.txt
- Dockerfile
```Dockerfile
FROM python:3.8
WORKDIR /root/working
RUN apt-get update && \
apt-get install -y python3-dev python3-pip python3-venv && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip3 install --no-cache-dir jupyter notebook && pip install --no-cache-dir -r requirements.txt
CMD ["bash"]
```
- requirements.txt
```txt
pytorch-lightning==1.2.10
datasets==1.6.2
transformers==4.5.1
scikit-learn==0.24.2
```
### Expected behavior
There is no bug to implement `load_dataset('glue', 'cola')`
### Environment info
I already wrote it.
Thank you for advising me to update these libraries versions.
I can implement codes using `datasets==2.10.1` and `transformers==4.27.3` | [
-0.22955703735351562,
-0.36152297258377075,
0.02578902244567871,
0.3840595781803131,
0.17230817675590515,
0.07655145227909088,
0.31120720505714417,
-0.01677183248102665,
0.4112164378166199,
0.025528445839881897,
-0.3663536012172699,
0.050917595624923706,
0.02579551562666893,
0.28582367300987244,
-0.14273345470428467,
-0.23819458484649658,
0.0791148990392685,
0.17409393191337585,
-0.15148577094078064,
0.14911021292209625,
-0.3921705484390259,
0.27387478947639465,
-0.2541559934616089,
0.03857022523880005,
-0.10840544104576111,
-0.36754903197288513,
-0.0720086470246315,
0.31197869777679443,
-0.24261316657066345,
-0.12243713438510895,
0.3612155020236969,
0.07714040577411652,
0.30369460582733154,
0.4733152389526367,
-0.00012102051550755277,
0.12304375320672989,
0.34071648120880127,
-0.10841090977191925,
-0.27077287435531616,
-0.27401286363601685,
-0.21026968955993652,
-0.06702636927366257,
0.15336504578590393,
-0.22621889412403107,
-0.32113391160964966,
0.2426084280014038,
-0.04786594957113266,
-0.48352140188217163,
0.6340827941894531,
0.18585211038589478,
0.18082356452941895,
0.46188443899154663,
0.1781502664089203,
-0.17928659915924072,
0.1972050666809082,
-0.13090887665748596,
-0.0335845947265625,
0.5596613883972168,
0.19365324079990387,
0.08017604798078537,
0.3797239661216736,
0.27794361114501953,
-0.2604685425758362,
0.017868772149086,
0.16919833421707153,
0.03907902166247368,
0.18155494332313538,
-0.3164764940738678,
0.16039933264255524,
0.20110414922237396,
0.2637341320514679,
-0.2232346087694168,
-0.25704437494277954,
-0.11190050840377808,
-0.12061944603919983,
-0.43852710723876953,
0.18859826028347015,
0.08478855341672897,
0.1449769288301468,
0.47014713287353516,
-0.19765017926692963,
-0.19911085069179535,
-0.06318799406290054,
0.15746399760246277,
-0.032500095665454865,
0.1802423596382141,
-0.2835197150707245,
0.18935328722000122,
0.33277904987335205,
-0.21353177726268768,
-0.11722344160079956,
-0.03352731838822365,
-0.03569489344954491,
0.11585986614227295,
-0.21209484338760376,
0.06379737704992294,
-0.1360660046339035,
0.5093762874603271,
0.2567223906517029,
-0.07837730646133423,
-0.09677116572856903,
-0.16642975807189941,
0.09131305664777756,
0.17552825808525085,
0.05522264912724495,
0.28514087200164795,
0.35784846544265747,
-0.010381992906332016,
0.17718327045440674,
0.20356658101081848,
0.10323230177164078,
-0.03636854887008667,
0.09162819385528564,
-0.2678077220916748,
-0.08157256990671158,
-0.02144855260848999,
0.4384731352329254,
-0.2390221208333969,
-0.2916918992996216,
-0.09605038911104202,
-0.44393476843833923,
0.05204145610332489,
0.1716850996017456,
0.41492408514022827,
-0.20229940116405487,
0.06706268340349197,
0.21372506022453308,
0.2579965889453888,
-0.1960175335407257,
-0.20091450214385986,
-0.15071649849414825,
0.11023152619600296,
-0.13578280806541443,
0.14727438986301422,
0.11476374417543411,
-0.5891348123550415,
0.15796998143196106,
-0.1554027497768402,
-0.21668699383735657,
0.04713338613510132,
-0.09495115280151367,
-0.34982699155807495,
0.022234519943594933,
0.214450865983963,
0.1300048828125,
0.09121809154748917,
0.04598677158355713,
-0.5849251747131348,
-0.11033570766448975,
-0.02683708816766739,
-0.16076132655143738,
-0.32077157497406006,
-0.1887577921152115,
0.10924727469682693,
-0.42403578758239746,
0.20642495155334473,
-0.4555826187133789,
0.21484431624412537,
0.11997470259666443,
0.03309229761362076,
-0.050932951271533966,
-0.022133732214570045,
-0.4727294445037842,
-0.2834615707397461,
0.36394476890563965,
0.6502658128738403,
-0.22152100503444672,
-0.15937946736812592,
-0.06588368117809296,
-0.16426725685596466,
-0.09244231134653091,
0.3035300672054291,
0.10133868455886841,
0.060569338500499725,
-0.1921716332435608,
-0.2190380096435547,
0.2222737967967987,
-0.5523386001586914,
-0.4957563281059265,
0.09960198402404785,
-0.003904372453689575,
0.06417687982320786,
0.18387560546398163,
-0.1722012162208557,
0.15446710586547852,
-0.12458071857690811,
0.20380467176437378,
0.42936593294143677,
0.07307901978492737,
-0.15433762967586517,
-0.1978786289691925,
-0.25950491428375244,
0.18739008903503418,
0.07444733381271362,
-0.19411614537239075,
0.17912811040878296,
0.2856019139289856,
0.03957498073577881,
0.07672838866710663,
-0.03521496802568436,
-0.06379793584346771,
0.10131438076496124,
0.2309785783290863,
0.09121140837669373,
-0.08379833400249481,
-0.13965122401714325,
-0.6961754560470581,
0.19406941533088684,
0.03135643154382706,
-0.06452381610870361,
0.05646763741970062,
-0.13576124608516693,
-0.3840029239654541,
0.019205018877983093,
-0.18709862232208252,
-0.07372542470693588,
-0.009066667407751083,
0.04370137304067612,
0.45165765285491943,
0.18688195943832397,
0.09544668346643448,
0.5380361676216125,
0.03586719185113907,
0.168379008769989,
-0.6525776982307434,
0.4661604166030884,
-0.05760112404823303,
-0.05155481398105621,
-0.007997699081897736,
0.208436980843544,
0.3996463119983673,
-0.33030593395233154,
0.13839633762836456,
0.3781161904335022,
-0.11013660579919815,
0.05027633160352707,
-0.1432160884141922,
0.13421086966991425,
0.2894997000694275,
-0.1283506602048874,
0.15177172422409058,
-0.14895008504390717,
0.16799622774124146,
0.08416140079498291,
0.08909677714109421,
0.27434495091438293,
-0.01239437609910965,
0.13457897305488586,
-0.05034887418150902,
0.07744200527667999,
0.21163228154182434,
-0.13067857921123505,
-0.25920727849006653,
-0.34231576323509216,
0.1811087727546692,
0.07955634593963623,
0.4235764145851135,
-0.003737381659448147,
-0.31164178252220154,
-0.14997604489326477,
0.14480473101139069,
-0.13556179404258728,
0.19991256296634674,
-0.11092320084571838,
-0.2939532995223999,
0.13371090590953827,
0.2560582458972931,
0.17065218091011047,
0.4940639138221741,
0.18830393254756927,
-0.20639973878860474,
0.09629490971565247,
0.037969786673784256,
0.008934680372476578,
0.12259626388549805,
0.07650311291217804,
0.3042260706424713,
-0.10430113971233368,
0.15906170010566711,
0.1569766253232956,
-0.08929762989282608,
0.012931615114212036,
0.014255069196224213,
0.1012837365269661,
-0.5062037110328674,
0.08559834957122803,
-0.3282846510410309,
-0.47077035903930664,
-0.26114195585250854,
-0.1771785169839859,
-0.22716820240020752,
-0.11968983709812164,
-0.2800459563732147,
0.2678680419921875,
0.2280571162700653,
0.14702436327934265,
0.4440058469772339,
0.2580668330192566,
0.09382529556751251,
-0.10288681834936142,
-0.16532766819000244,
0.04068430885672569,
-0.10925029218196869,
-0.031417712569236755,
0.09360001236200333,
0.19959770143032074,
0.47264841198921204,
-0.4759044945240021,
-0.2694839835166931,
-0.3000013530254364,
-0.3095836639404297,
0.36491864919662476,
-0.20283620059490204,
0.5723055601119995,
0.43432873487472534,
0.12110184133052826,
0.15112552046775818,
-0.12839099764823914,
0.3864676058292389,
-0.285089373588562,
-0.041181206703186035,
-0.15817156434059143,
-0.07872679084539413,
-0.039273884147405624,
-0.09048186242580414,
-0.1997712254524231,
-0.4693892002105713,
-0.2477835714817047,
0.37834325432777405,
0.07503922283649445,
0.010950963944196701,
0.3992561399936676,
-0.021542511880397797,
0.2501410245895386,
0.007188465446233749,
0.09522739797830582,
-0.30020007491111755,
-0.1507381945848465,
0.26863962411880493,
-0.17575068771839142,
-0.3241255283355713,
-0.08733703941106796,
-0.034984998404979706,
-0.13072863221168518,
-0.006715346127748489,
-0.2836438715457916,
-0.61215740442276,
-0.05328305810689926,
0.07959090173244476,
-0.06048724055290222,
0.30377089977264404,
0.05918758735060692,
-0.18498489260673523,
0.20856362581253052,
-0.1103743463754654,
-0.5180071592330933,
0.08415291458368301,
0.07970736920833588,
0.36536115407943726,
0.41907867789268494,
0.6304250955581665,
-0.12634000182151794,
0.5049529671669006,
0.10932600498199463,
-0.24799518287181854,
0.29843270778656006,
-0.20244792103767395,
0.42809146642684937,
-0.1555524468421936,
-0.43863049149513245,
-0.046315986663103104,
-0.01730027049779892,
0.07837818562984467,
0.056490976363420486,
0.05413946509361267,
0.12293724715709686,
-0.4024598002433777,
-0.16073718667030334,
-0.28381723165512085,
-0.0726107656955719,
-0.13276147842407227,
0.10702437162399292,
0.03222115710377693,
0.07144935429096222,
0.05009113997220993,
0.00995047390460968,
-0.11264115571975708,
0.028369754552841187,
0.41688668727874756,
-0.0850568413734436,
0.18941953778266907,
0.06643586605787277,
-0.049057167023420334,
-0.6214500665664673,
0.678101122379303,
0.015611033886671066,
0.04077404737472534,
-0.020659111440181732,
0.06244280934333801,
0.025848206132650375,
0.03792488947510719,
0.5683903694152832,
-0.20580615103244781,
0.2787342071533203,
0.13826388120651245,
-0.39059847593307495,
-0.5030261278152466,
-0.05955888703465462,
-0.38567960262298584,
0.012499690055847168,
0.3496204912662506,
0.5352662205696106,
-0.3749350905418396,
-0.1709379404783249,
0.3507574498653412,
0.11330989003181458,
-0.19082143902778625,
-0.23138415813446045,
-0.24672560393810272,
-0.3312339186668396,
-0.29540741443634033,
-0.17059659957885742,
0.056143201887607574,
0.19270431995391846,
0.07101710140705109,
0.17794574797153473,
-0.07787330448627472,
-0.1415269672870636,
-0.013950563967227936,
0.24973823130130768,
0.4115704298019409,
0.14207084476947784,
0.11596782505512238,
0.2961343228816986,
0.32406824827194214,
0.1491527557373047,
0.6474003195762634,
-0.19233739376068115,
-0.14585204422473907,
-0.09174606204032898,
0.19351108372211456,
0.24257434904575348,
0.17050012946128845,
-0.2630906105041504,
-0.1337357759475708,
-0.14725440740585327,
0.18329282104969025,
-0.09955078363418579,
0.21306410431861877,
0.23314696550369263,
0.11347539722919464,
-0.38199368119239807,
-0.30609315633773804,
0.3454027473926544,
0.24842411279678345,
-0.17698895931243896,
0.0549250952899456,
0.26353567838668823,
-0.3695024251937866,
0.35603585839271545,
-0.14973987638950348,
0.8845188617706299,
-0.12728382647037506,
-0.010340213775634766,
0.3208596110343933,
-0.14468833804130554,
0.7692082524299622,
0.2916826009750366,
-0.11614486575126648,
-0.27381637692451477,
-0.25033408403396606,
-0.03848392143845558,
-0.06038467586040497,
0.2921887934207916,
-0.04767797887325287,
-0.5432040691375732,
0.5064112544059753,
0.1889425665140152,
-0.04540561884641647,
-0.08222444355487823,
0.34642481803894043,
0.03482577204704285,
-0.13621653616428375,
-0.7260339856147766,
0.05542265623807907,
-0.03360597416758537,
0.23003441095352173,
-0.12340882420539856,
0.0766168013215065,
0.015692755579948425,
-0.39285755157470703,
-0.3059665262699127,
-0.11254274845123291,
-0.7953397035598755,
0.13094782829284668,
0.3306942582130432,
-0.3219338059425354,
0.1210961788892746,
0.22776715457439423,
0.20415757596492767,
0.2711997628211975,
-0.18289227783679962,
-0.07589485496282578,
0.15498822927474976,
-0.24324318766593933,
-0.1450643241405487,
-0.105097696185112,
0.379329115152359,
-0.032062750309705734,
-0.07770323008298874,
-0.03974459692835808,
-0.09244469553232193,
-0.1379108875989914,
0.13025876879692078,
-0.0316002257168293,
0.008651726879179478,
-0.20004209876060486,
-0.27007725834846497,
-0.029409408569335938,
0.2947181761264801,
-0.06204153597354889,
0.03746379539370537,
0.09752172976732254,
-0.08587464690208435,
-0.10081946849822998,
-0.08359746634960175,
-0.22921760380268097,
-0.175676167011261,
0.5161117911338806,
-0.25542986392974854,
0.039760321378707886,
0.204865500330925,
0.13139241933822632,
-0.08810711652040482,
-0.034662507474422455,
-0.04143562912940979,
0.13970787823200226,
-0.29214200377464294,
0.07324500381946564,
0.1363195776939392,
-0.14370810985565186,
-0.12086768448352814,
0.43882715702056885,
0.37383511662483215,
-0.16757522523403168,
0.1810912787914276,
-0.46791279315948486,
-0.14990052580833435,
0.20061199367046356,
-0.06646712124347687,
0.011138777248561382,
0.48123833537101746,
0.0886717438697815,
0.07204443961381912,
0.06800411641597748,
-0.23064137995243073,
0.047984711825847626,
-0.12939810752868652,
-0.05169512704014778,
0.6232167482376099,
-0.1367403268814087,
0.23166579008102417,
-0.07187153398990631,
0.03583722561597824,
0.1371602565050125,
-0.19781944155693054,
-0.12367399036884308,
-0.25332167744636536,
0.17469727993011475,
-0.11130093783140182,
-0.24712517857551575,
-0.027999956160783768,
-0.1543891429901123,
-0.027841541916131973,
-0.11549530923366547,
0.3447171151638031,
0.4859251081943512,
0.05736539140343666,
-0.07646289467811584,
0.29569125175476074,
-0.0953727513551712,
-0.19327619671821594,
0.20662248134613037,
-0.013884630054235458,
0.020996080711483955,
0.15575619041919708,
0.2655797600746155,
-0.10640788823366165,
-0.054434098303318024,
0.049170561134815216,
-0.0493895560503006,
0.16524438560009003,
-0.024484550580382347,
0.30855754017829895,
-0.12822477519512177,
-0.16170985996723175,
0.2809083163738251,
0.35603392124176025,
0.18997615575790405,
-0.2716277241706848,
0.03837026655673981,
0.07029516994953156,
0.06988264620304108,
-0.22375747561454773,
0.07775503396987915,
0.46482664346694946,
0.1035182923078537,
0.06304045021533966,
0.5426120162010193,
0.11223536729812622,
0.3301418423652649,
-0.14165771007537842,
0.029922567307949066,
0.4650992155075073,
0.22586335241794586,
0.03774142265319824,
-0.16035372018814087,
-0.05276463180780411,
0.12484455108642578,
0.19339661300182343,
0.16661590337753296,
0.2957909405231476,
-0.12918566167354584,
-0.07481768727302551,
0.20072683691978455,
-0.14403915405273438,
0.26972073316574097,
0.22240540385246277,
-0.319825679063797,
0.05275889113545418,
0.13333043456077576,
-0.3410724997520447,
0.10033918172121048,
-0.14251136779785156,
0.7525185942649841,
-0.33158034086227417,
-0.14115093648433685,
-0.23665542900562286,
0.32910382747650146,
-0.12885072827339172,
-0.2201649248600006,
0.10851740837097168,
-0.03652466833591461,
-0.3173665404319763,
-0.018885537981987,
-0.07326371967792511,
-0.2733434736728668,
0.3929460048675537,
-0.07505781948566437,
0.006492443382740021,
-0.18123939633369446,
-0.23818182945251465,
0.24955928325653076,
0.03530025854706764,
-0.10600253939628601,
0.4841880202293396,
-0.06832820177078247,
-0.003810930997133255,
0.18689730763435364,
0.5273452997207642,
0.5166782736778259,
0.05805140733718872,
0.010295461863279343,
-0.03782324865460396,
0.03978722542524338,
-0.011774469166994095,
-0.06022161245346069,
0.13879871368408203,
0.00041409581899642944,
0.10109326988458633,
0.449344664812088,
0.12258027493953705,
-0.12172773480415344,
0.18857385218143463,
-0.17821088433265686,
0.2385416477918625,
-0.40147045254707336,
0.12206809222698212,
-0.35371533036231995,
-0.012023165822029114,
-0.28617289662361145,
0.1923922896385193,
-0.3950071930885315,
0.2680332362651825,
0.05367998406291008,
-0.08756858110427856,
0.20087647438049316,
-0.021952174603939056,
0.024044327437877655,
0.03220384567975998,
0.44238027930259705,
0.4098002314567566,
0.1773853898048401,
-0.26569926738739014,
-0.1237080991268158,
-0.6859099268913269,
0.012245140969753265,
-0.07425475865602493,
-0.05619820952415466,
-0.000748269259929657,
-0.05232998728752136,
0.04342632740736008,
0.32090499997138977,
0.059962380677461624,
0.20620331168174744,
-0.00036994367837905884,
-0.32803887128829956,
-0.27168673276901245,
-0.21314868330955505,
-0.03420845419168472,
-0.12788337469100952,
0.18529480695724487,
-0.37819167971611023,
0.07246541976928711,
-0.05153466761112213,
-0.08601078391075134,
-0.12742489576339722,
-0.013790160417556763,
-0.03161001577973366,
-0.1259932518005371,
0.23764266073703766,
0.2617766261100769,
0.3513570725917816,
-0.12496142089366913,
0.10303594917058945,
-0.05925668030977249,
-0.15669037401676178,
-0.2539103925228119,
0.15789742767810822,
-0.052029214799404144,
0.16268610954284668,
-0.3297818601131439,
-0.12406691163778305,
-0.20084942877292633,
0.21885278820991516,
0.1037878543138504,
-0.09227314591407776,
-0.3335023820400238,
0.1234431117773056,
-0.2167818397283554,
-0.056248899549245834,
0.07822388410568237,
0.30373892188072205,
-0.1640070080757141,
0.2793753743171692,
-0.16432490944862366,
-0.2712860405445099,
0.6312525272369385,
-0.407733678817749,
-0.03270452469587326,
0.11961063742637634,
0.1255837082862854,
0.27276068925857544,
-0.29502981901168823,
-0.5494273900985718,
0.04407113790512085,
0.2307448536157608,
-0.08669622242450714,
-0.40301257371902466,
0.220657616853714,
-0.21369436383247375,
-0.06679201126098633,
0.035769350826740265,
0.22065843641757965,
0.2637675702571869,
-0.36493349075317383,
0.07430216670036316,
-0.18482166528701782
] |
https://github.com/huggingface/datasets/issues/5669 | Hi!
The first dataset stores images as bytes (the "image" column type is `datasets.Image()`) and decodes them as `PIL.Image` objects and the second dataset stores them as variable-length lists (the "image" column type is `datasets.Sequence(...)`)), so I guess going from `arrow bytes -> NumPy -> decoding as PIL.Image -> PyTorch` is faster than going from `arrow list -> NumPy -> PyTorch`.
To store image bytes in the second example, you can do the following:
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"])
return example
features = dataset.features.copy()
del features["image"]
features["image2"] = datasets.Image()
dataset2 = dataset.map(transform, remove_columns=["image"], features=features)
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
``` | Almost identical datasets, huge performance difference | ### Describe the bug
I am struggling to understand (huge) performance difference between two datasets that are almost identical.
### Steps to reproduce the bug
# Fast (normal) dataset speed:
```python
import cv2
from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("beans", split="train")
for x in DataLoader(dataset.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
The above pass over the dataset takes about 1.5 seconds on my computer.
However, if I re-create (almost) the same dataset, the sweep takes HUGE amount of time: 15 minutes. Steps to reproduce:
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"])
return example
dataset2 = dataset.map(transform, remove_columns=["image"])
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
### Expected behavior
Same timings
### Environment info
python==3.10.9
datasets==2.10.1 | 104 | Almost identical datasets, huge performance difference
### Describe the bug
I am struggling to understand (huge) performance difference between two datasets that are almost identical.
### Steps to reproduce the bug
# Fast (normal) dataset speed:
```python
import cv2
from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("beans", split="train")
for x in DataLoader(dataset.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
The above pass over the dataset takes about 1.5 seconds on my computer.
However, if I re-create (almost) the same dataset, the sweep takes HUGE amount of time: 15 minutes. Steps to reproduce:
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"])
return example
dataset2 = dataset.map(transform, remove_columns=["image"])
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
### Expected behavior
Same timings
### Environment info
python==3.10.9
datasets==2.10.1
Hi!
The first dataset stores images as bytes (the "image" column type is `datasets.Image()`) and decodes them as `PIL.Image` objects and the second dataset stores them as variable-length lists (the "image" column type is `datasets.Sequence(...)`)), so I guess going from `arrow bytes -> NumPy -> decoding as PIL.Image -> PyTorch` is faster than going from `arrow list -> NumPy -> PyTorch`.
To store image bytes in the second example, you can do the following:
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"])
return example
features = dataset.features.copy()
del features["image"]
features["image2"] = datasets.Image()
dataset2 = dataset.map(transform, remove_columns=["image"], features=features)
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
``` | [
-0.12182904034852982,
-0.2700640559196472,
-0.0735313817858696,
0.2854200005531311,
0.14487147331237793,
0.04311932623386383,
0.1386280208826065,
0.35452738404273987,
-0.22428296506404877,
0.2321704626083374,
-0.019009819254279137,
0.6346409320831299,
-0.1887723207473755,
-0.28684741258621216,
-0.1602500081062317,
-0.19445843994617462,
0.4264400601387024,
0.058036718517541885,
-0.18861255049705505,
-0.3739088773727417,
-0.07330138981342316,
-0.260162353515625,
-0.15351875126361847,
-0.32877424359321594,
-0.2049665004014969,
-0.008537915535271168,
0.0029287412762641907,
-0.1107478141784668,
-0.07567846775054932,
-0.11103017628192902,
0.3007497787475586,
-0.13008376955986023,
0.03377270698547363,
0.5814133882522583,
-0.00012162725761299953,
0.015243366360664368,
0.11739499866962433,
0.12892597913742065,
-0.013863380998373032,
0.2023831307888031,
0.39683836698532104,
-0.4053071141242981,
-0.030558139085769653,
-0.2995845377445221,
0.024012885987758636,
-0.051985085010528564,
-0.21392785012722015,
-0.5470716953277588,
0.061749644577503204,
-0.058340538293123245,
0.12188385426998138,
0.251701682806015,
-0.7174693942070007,
0.04248529672622681,
0.32756251096725464,
-0.04062498360872269,
-0.34529462456703186,
-0.07194732874631882,
0.44019457697868347,
0.07550308853387833,
-0.16012467443943024,
0.4911728799343109,
-0.2886885702610016,
0.1503240466117859,
0.4872371256351471,
0.03836170583963394,
-0.5674439072608948,
-0.215973362326622,
0.12875913083553314,
0.18808743357658386,
-0.17030087113380432,
-0.10243378579616547,
-0.28609660267829895,
-0.4626610279083252,
-0.35675451159477234,
0.008474111557006836,
0.041332345455884933,
0.1738230139017105,
-0.03655602037906647,
-0.19432391226291656,
-0.6531649827957153,
0.36772480607032776,
0.13517111539840698,
-0.019840016961097717,
-0.18117977678775787,
-0.15769656002521515,
0.0968596413731575,
0.3259918987751007,
0.16681966185569763,
-0.0062684896402060986,
0.35199522972106934,
-0.3037532567977905,
0.26786985993385315,
0.12529121339321136,
-0.3701792061328888,
-0.12128966301679611,
0.15764835476875305,
-0.06567389518022537,
-0.08657117933034897,
0.020976055413484573,
0.15312226116657257,
0.11995062977075577,
-0.1488114595413208,
-0.1994718313217163,
-0.13420070707798004,
0.29664310812950134,
-0.5236273407936096,
0.3627677857875824,
-0.018110264092683792,
-0.1826389580965042,
-0.2713136672973633,
0.04732519015669823,
0.11999420076608658,
-0.21686941385269165,
0.35548025369644165,
-0.032424259930849075,
0.126781165599823,
-0.12286040931940079,
-0.5063018202781677,
-0.02149215340614319,
-0.21345360577106476,
-0.044207215309143066,
-0.05407711863517761,
0.27826085686683655,
-0.25551143288612366,
0.179605171084404,
0.08931727707386017,
0.07957963645458221,
-0.36174896359443665,
0.12553814053535461,
-0.1619032621383667,
-0.06126720830798149,
-0.19242218136787415,
-0.0069563910365104675,
0.020308755338191986,
-0.26641619205474854,
0.1260938048362732,
0.28537753224372864,
0.1862500011920929,
0.32680729031562805,
0.3518490791320801,
-0.32053014636039734,
0.3618859350681305,
-0.1324770748615265,
-0.11295711994171143,
0.32978445291519165,
0.14925193786621094,
0.6049870848655701,
-0.19587241113185883,
0.25958943367004395,
-0.2909645140171051,
-0.047079380601644516,
0.2856801450252533,
0.09637586027383804,
-0.040779583156108856,
-0.06249677762389183,
-0.19699761271476746,
-0.06354987621307373,
-0.12961721420288086,
-0.05103810131549835,
0.2668571174144745,
-0.16809330880641937,
-0.2701385021209717,
-0.299511581659317,
-0.10271725058555603,
0.11282891780138016,
-0.09425275772809982,
0.1446259766817093,
0.3017048239707947,
0.36229410767555237,
0.45250359177589417,
0.46703195571899414,
-0.2942015826702118,
-0.12773512303829193,
-0.22219783067703247,
-0.3039514422416687,
0.14079996943473816,
-0.24229294061660767,
-0.30218422412872314,
0.27152520418167114,
-0.004442200064659119,
0.3180360496044159,
0.26238924264907837,
0.3792029321193695,
0.4820955991744995,
-0.19585725665092468,
-0.19780875742435455,
0.3476278781890869,
0.0423038974404335,
0.30831167101860046,
-0.2962842285633087,
-0.41004225611686707,
0.402872771024704,
-0.015266433358192444,
-0.08175356686115265,
-0.08338887244462967,
0.030177606269717216,
0.0001112520694732666,
0.2969646453857422,
-0.19822631776332855,
-0.08360043913125992,
0.12933532893657684,
0.13258036971092224,
-0.11703019589185715,
-0.04625871777534485,
0.029543370008468628,
0.024368692189455032,
0.347845196723938,
0.2225048691034317,
-0.20391587913036346,
0.0014784932136535645,
-0.12396305054426193,
-0.14200681447982788,
-0.20591416954994202,
-0.20275583863258362,
-0.3105987310409546,
-0.06378766894340515,
0.10735028982162476,
0.2525006830692291,
-0.16322524845600128,
0.07741457223892212,
0.2430741786956787,
-0.062178049236536026,
-0.005648903548717499,
-0.2618851363658905,
0.24358925223350525,
0.1697292923927307,
-0.11138227581977844,
-0.21188819408416748,
0.03147290647029877,
0.16165143251419067,
-0.12169639766216278,
-0.19700375199317932,
0.02427665889263153,
0.038907792419195175,
0.2522799074649811,
-0.05209871754050255,
0.17669983208179474,
0.21745653450489044,
-0.1929152011871338,
0.5725197792053223,
0.5377610921859741,
0.2645743489265442,
0.06653334200382233,
-0.42256462574005127,
0.6321420669555664,
-0.15110941231250763,
0.28864118456840515,
0.08561530709266663,
-0.21523934602737427,
-0.029618188738822937,
0.14465035498142242,
0.19850319623947144,
0.03252413868904114,
0.3865179717540741,
0.2784111201763153,
0.6026071906089783,
0.31426289677619934,
-0.12364441156387329,
0.34403690695762634,
0.39032718539237976,
0.16286282241344452,
-0.3230430781841278,
0.06317310035228729,
-0.15850293636322021,
0.0458000972867012,
0.0729488879442215,
0.14734257757663727,
0.5112757682800293,
0.09307306259870529,
0.08714483678340912,
0.1014140173792839,
0.006932027637958527,
0.003643833100795746,
0.22290682792663574,
-0.10260936617851257,
0.19606636464595795,
-0.09838172048330307,
0.3488602936267853,
0.26584768295288086,
-0.22649693489074707,
-0.11189035326242447,
0.05324466526508331,
0.045647263526916504,
0.1612538993358612,
0.31288132071495056,
-0.18473277986049652,
0.03534827381372452,
-0.37306877970695496,
0.06288217753171921,
-0.04102330654859543,
-0.12902754545211792,
-0.19619306921958923,
0.1272680163383484,
-0.017779238522052765,
0.07767130434513092,
-0.3165256381034851,
-0.013021513819694519,
0.155889093875885,
-0.1498686969280243,
0.01739668846130371,
0.11836633086204529,
-0.1806303858757019,
-0.05375650152564049,
-0.040363609790802,
-0.14802810549736023,
0.39675775170326233,
-0.07175379246473312,
0.01678898185491562,
-0.3577738106250763,
-0.3618431091308594,
0.04989219084382057,
-0.050325099378824234,
-0.011663287878036499,
-0.03162863478064537,
-0.0388435423374176,
0.01559542864561081,
-0.24941235780715942,
0.19563589990139008,
-0.29340922832489014,
-0.30026715993881226,
-0.017275936901569366,
-0.004644133150577545,
-0.06013547629117966,
0.055757924914360046,
-0.340305894613266,
-0.125369131565094,
-0.11991721391677856,
-0.08765557408332825,
-0.096182681620121,
-0.010131778195500374,
0.088685542345047,
0.19079157710075378,
-0.10766517370939255,
0.050285838544368744,
0.1972995549440384,
-0.16142912209033966,
-0.44074955582618713,
0.2388152778148651,
0.08658592402935028,
-0.3191186785697937,
-0.3915378451347351,
-0.19139182567596436,
-0.1680593192577362,
0.5553533434867859,
-0.4637787938117981,
-0.17142894864082336,
-0.7555080652236938,
0.3212395906448364,
-0.03763663396239281,
0.10306298732757568,
0.2671303153038025,
0.022143706679344177,
-0.033579375594854355,
-0.30227115750312805,
-0.18895629048347473,
-0.3188878297805786,
0.006589146330952644,
0.17617002129554749,
-0.09597642719745636,
0.3586668372154236,
0.2530122697353363,
0.8703603744506836,
0.21047261357307434,
-0.23993746936321259,
0.14442259073257446,
-0.006054351106286049,
0.3156101405620575,
-0.3355349004268646,
-0.5031734108924866,
0.23943327367305756,
-0.132054403424263,
-0.2851606607437134,
0.03479895368218422,
-0.10411761701107025,
-0.2209034264087677,
0.0998014509677887,
-0.10374674201011658,
-0.03251069039106369,
-0.07449574768543243,
0.24098049104213715,
-0.1620546281337738,
-0.018356729298830032,
0.16274979710578918,
0.3963673412799835,
-0.5616742968559265,
-0.11285997927188873,
0.10312741994857788,
-0.09057711064815521,
0.16198840737342834,
-0.08645482361316681,
-0.30045178532600403,
-0.09741583466529846,
-0.36396318674087524,
0.19042658805847168,
0.11020561307668686,
0.27229371666908264,
0.3358316421508789,
-0.32865995168685913,
0.2582387924194336,
0.0014779195189476013,
0.6121354699134827,
0.12851198017597198,
0.10201451182365417,
-0.08635587990283966,
-0.48163968324661255,
-0.4782927632331848,
-0.2364412248134613,
-0.20938751101493835,
0.03650984168052673,
0.2796328067779541,
0.24633437395095825,
0.047276049852371216,
-0.14344249665737152,
0.08752406388521194,
0.35452932119369507,
0.016924366354942322,
0.07780900597572327,
-0.2781563997268677,
-0.1528533548116684,
-0.12702609598636627,
-0.16357669234275818,
-0.21963630616664886,
0.06262814998626709,
-0.24822819232940674,
-0.030361149460077286,
-0.3281325697898865,
0.022288694977760315,
0.11351805925369263,
0.22573097050189972,
0.4133513569831848,
0.01707114651799202,
0.5071829557418823,
-0.041092123836278915,
0.5245802402496338,
0.008939830586314201,
0.5562955737113953,
-0.20231075584888458,
-0.34400373697280884,
-0.10539135336875916,
-0.03323240578174591,
0.05634503811597824,
0.5288493037223816,
-0.04848968982696533,
0.22501759231090546,
-0.27260053157806396,
0.019269181415438652,
-0.300738126039505,
0.0194241926074028,
0.4418843984603882,
0.20040945708751678,
-0.07171478122472763,
-0.41160014271736145,
0.3529951274394989,
0.5363318920135498,
-0.19275207817554474,
0.30481794476509094,
-0.332923948764801,
0.09537003189325333,
0.38502565026283264,
0.06816814094781876,
0.9375787973403931,
-0.002047528512775898,
0.45326706767082214,
0.09615150094032288,
-0.10979634523391724,
0.3356797695159912,
0.14033129811286926,
0.1985340118408203,
-0.2554987072944641,
-0.3545907437801361,
0.02533772587776184,
-0.26666128635406494,
0.03633679449558258,
-0.1604059338569641,
0.14985933899879456,
0.2555316388607025,
-0.10731345415115356,
0.15630999207496643,
-0.3067050278186798,
-0.14670419692993164,
-0.1863524168729782,
-0.10096825659275055,
0.02821769192814827,
0.06449969112873077,
0.13066402077674866,
0.25071781873703003,
0.06230783835053444,
0.08120287209749222,
-0.4785160422325134,
-0.12344542145729065,
-0.23565459251403809,
0.058270230889320374,
-0.19351080060005188,
0.36735960841178894,
0.03712120279669762,
-0.6060332655906677,
0.007350422441959381,
0.047251682728528976,
0.11861039698123932,
-0.15909837186336517,
0.10817195475101471,
0.23479610681533813,
0.14303363859653473,
0.46589022874832153,
0.36447060108184814,
-0.5446107983589172,
0.2589028477668762,
0.07213172316551208,
-0.04309868812561035,
-0.06116582080721855,
-0.1744019091129303,
-0.2270313948392868,
-0.19367782771587372,
0.5113369226455688,
0.17297959327697754,
-0.13501189649105072,
-0.3255001902580261,
-0.008051279932260513,
-0.06173982471227646,
-0.19195520877838135,
0.015013488940894604,
0.03578262776136398,
0.07462462037801743,
0.5343068242073059,
0.027221107855439186,
-0.5475817918777466,
0.03958864510059357,
0.2757596969604492,
0.3929689824581146,
-0.2538206875324249,
0.4204235076904297,
-0.2648581862449646,
-0.15599554777145386,
0.029759183526039124,
0.2641599774360657,
0.16440537571907043,
-0.44545257091522217,
0.24470184743404388,
-0.4784926474094391,
-0.003698587417602539,
0.1278672218322754,
0.0534612238407135,
-0.04710851237177849,
0.2091807872056961,
-0.2634561061859131,
-0.07600093632936478,
-0.09718485176563263,
-0.0569491945207119,
-0.07024485617876053,
0.10516320914030075,
-0.296609491109848,
0.049911417067050934,
-0.10731536895036697,
-0.06084815412759781,
-0.19202858209609985,
0.28574123978614807,
0.21007442474365234,
0.31214311718940735,
-0.21140019595623016,
-0.0939178541302681,
-0.05549026280641556,
-0.08565613627433777,
-0.05401993170380592,
0.10563814640045166,
-0.11168552935123444,
-0.09134282171726227,
-0.226079523563385,
0.17471210658550262,
-0.11734268069267273,
-0.37218233942985535,
-0.15316525101661682,
-0.2118256390094757,
0.19655197858810425,
-0.20214390754699707,
0.25328344106674194,
0.32227301597595215,
0.11851993948221207,
-0.2257467359304428,
0.13805782794952393,
-0.10534794628620148,
0.08167716860771179,
0.032948728650808334,
-0.266813188791275,
0.3330397605895996,
0.11222466826438904,
0.07671694457530975,
0.19502468407154083,
-0.1118985041975975,
0.0465642586350441,
-0.21704289317131042,
0.07217493653297424,
0.21481667459011078,
0.22811691462993622,
-0.15522807836532593,
0.2544517517089844,
0.20212489366531372,
0.17689162492752075,
0.5216363668441772,
-0.09400218725204468,
-0.3004724979400635,
0.06575296819210052,
0.08062711358070374,
-0.16234427690505981,
-0.21421988308429718,
-0.005732733756303787,
0.14996016025543213,
0.16139918565750122,
0.167051762342453,
0.04287548363208771,
0.3047712743282318,
-0.01489817351102829,
-0.15040704607963562,
0.460861474275589,
-0.23283329606056213,
0.1546047329902649,
0.3782990276813507,
0.3255915939807892,
-0.09558083117008209,
0.23945637047290802,
-0.03760083019733429,
0.07923518866300583,
0.5972480773925781,
0.023142129182815552,
0.6911885738372803,
0.45084038376808167,
0.02477158233523369,
0.12289111316204071,
-0.17716443538665771,
-0.0789584293961525,
0.24395769834518433,
-0.2483169138431549,
0.200461283326149,
0.14587032794952393,
-0.03500760719180107,
0.10354774445295334,
-0.3110990822315216,
-0.05177387595176697,
0.15864194929599762,
-0.0340694934129715,
-0.14022769033908844,
-0.033167578279972076,
-0.12361960113048553,
0.0020283758640289307,
0.3242952227592468,
-0.2599591016769409,
-0.12626419961452484,
0.6214007139205933,
0.19800326228141785,
-0.19624364376068115,
-0.18545544147491455,
-0.13063637912273407,
-0.09833481907844543,
0.31045660376548767,
-0.0009893402457237244,
0.06511876732110977,
0.3325340747833252,
-0.014238227158784866,
0.23612187802791595,
0.4878028333187103,
0.5550805330276489,
0.30589306354522705,
-0.14798690378665924,
0.12550322711467743,
0.04657559469342232,
0.05342414975166321,
-0.009619977325201035,
0.01589440554380417,
-0.2832934558391571,
0.020006507635116577,
-0.046864841133356094,
0.02095739170908928,
-0.1434718370437622,
-0.09900307655334473,
-0.07036256045103073,
-0.0627281591296196,
-0.33805495500564575,
0.28737306594848633,
-0.28562474250793457,
0.13337716460227966,
-0.3006393015384674,
0.2244129180908203,
-0.475443959236145,
-0.07930763065814972,
0.39421769976615906,
-0.0476803332567215,
0.15207122266292572,
0.04459298402070999,
0.006327953189611435,
-0.1436789482831955,
0.25075069069862366,
0.29164135456085205,
0.18523310124874115,
-0.24922055006027222,
-0.05211975425481796,
-0.3459886908531189,
0.043041929602622986,
-0.41788482666015625,
-0.0023185089230537415,
-0.2186201810836792,
0.4255443811416626,
-0.03158589452505112,
-0.025696393102407455,
0.4154551029205322,
0.14600062370300293,
0.12089057266712189,
0.24712851643562317,
-0.4122929871082306,
-0.18368232250213623,
0.04920417070388794,
-0.08753331005573273,
-0.0375797376036644,
-0.5837656855583191,
0.13696549832820892,
0.1100119799375534,
0.014895036816596985,
-0.059798020869493484,
-0.03847207874059677,
0.0826117992401123,
0.21919754147529602,
0.3485049605369568,
0.23391412198543549,
0.32903188467025757,
0.03352943807840347,
-0.29904332756996155,
-0.14652715623378754,
0.05192558094859123,
-0.03457040712237358,
0.2516692578792572,
0.19170182943344116,
0.20893999934196472,
-0.13099460303783417,
-0.17857739329338074,
0.06166693940758705,
0.3570610582828522,
-0.030460260808467865,
-0.25464022159576416,
-0.22577625513076782,
0.13976570963859558,
-0.31495779752731323,
0.37753504514694214,
-0.21301032602787018,
0.42997920513153076,
0.0819520428776741,
0.12992382049560547,
-0.3690761625766754,
-0.47128555178642273,
0.5796442627906799,
-0.4154515862464905,
-0.3287406265735626,
-0.18556267023086548,
0.042822591960430145,
-0.08033666759729385,
0.18822172284126282,
-0.31516772508621216,
-0.010743394494056702,
0.16578394174575806,
-0.17585954070091248,
0.13976378738880157,
0.16919177770614624,
0.12194561958312988,
-0.0552879199385643,
0.003360860049724579,
0.47136253118515015,
-0.0469796322286129,
-0.17482799291610718,
0.23819851875305176,
0.010434925556182861
] |
https://github.com/huggingface/datasets/issues/5669 | Thanks, @mariosasko. I could not understand why a (decoded) sequence should be MUCH slower than an encoded image (that must be decoded every time). At any rate, I tried you suggestion. It made the `map` step to run extremely slow (consumes all the 16GB of memory and starts swapping)
I tried also the easiest (as I see it) scenario, where images are kept as bytes, but it made things even worse: not only it was extremely slow, but also crashes
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"]).tobytes()
return example
dataset2 = dataset.map(transform, remove_columns=["image"])
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
Resource temporarily unavailable (src/thread.cpp:269)
Output exceeds the size limit. Open the full output data in a text editor
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
File ~/virtenvs/py310/lib/python3.10/site-packages/torch/utils/data/dataloader.py:1133, in _MultiProcessingDataLoaderIter._try_get_data(self, timeout)
1132 try:
-> 1133 data = self._data_queue.get(timeout=timeout)
1134 return (True, data)
File ~/virtenvs/py310/lib/python3.10/multiprocessing/queues.py:113, in Queue.get(self, block, timeout)
112 timeout = deadline - time.monotonic()
--> 113 if not self._poll(timeout):
114 raise Empty
File ~/virtenvs/py310/lib/python3.10/multiprocessing/connection.py:257, in _ConnectionBase.poll(self, timeout)
256 self._check_readable()
--> 257 return self._poll(timeout)
File ~/virtenvs/py310/lib/python3.10/multiprocessing/connection.py:424, in Connection._poll(self, timeout)
423 def _poll(self, timeout):
--> 424 r = wait([self], timeout)
425 return bool(r)
File ~/virtenvs/py310/lib/python3.10/multiprocessing/connection.py:931, in wait(object_list, timeout)
930 while True:
--> 931 ready = selector.select(timeout)
932 if ready:
...
-> 1146 raise RuntimeError('DataLoader worker (pid(s) {}) exited unexpectedly'.format(pids_str)) from e
1147 if isinstance(e, queue.Empty):
1148 return (False, None)
RuntimeError: DataLoader worker (pid(s) 195393) exited unexpectedly
Resource temporarily unavailable (src/thread.cpp:269)
Resource temporarily unavailable (src/thread.cpp:269)
Resource temporarily unavailable (src/thread.cpp:269)
Resource temporarily unavailable (src/thread.cpp:269)
Resource temporarily unavailable (src/thread.cpp:269)
```
| Almost identical datasets, huge performance difference | ### Describe the bug
I am struggling to understand (huge) performance difference between two datasets that are almost identical.
### Steps to reproduce the bug
# Fast (normal) dataset speed:
```python
import cv2
from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("beans", split="train")
for x in DataLoader(dataset.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
The above pass over the dataset takes about 1.5 seconds on my computer.
However, if I re-create (almost) the same dataset, the sweep takes HUGE amount of time: 15 minutes. Steps to reproduce:
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"])
return example
dataset2 = dataset.map(transform, remove_columns=["image"])
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
### Expected behavior
Same timings
### Environment info
python==3.10.9
datasets==2.10.1 | 254 | Almost identical datasets, huge performance difference
### Describe the bug
I am struggling to understand (huge) performance difference between two datasets that are almost identical.
### Steps to reproduce the bug
# Fast (normal) dataset speed:
```python
import cv2
from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("beans", split="train")
for x in DataLoader(dataset.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
The above pass over the dataset takes about 1.5 seconds on my computer.
However, if I re-create (almost) the same dataset, the sweep takes HUGE amount of time: 15 minutes. Steps to reproduce:
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"])
return example
dataset2 = dataset.map(transform, remove_columns=["image"])
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
### Expected behavior
Same timings
### Environment info
python==3.10.9
datasets==2.10.1
Thanks, @mariosasko. I could not understand why a (decoded) sequence should be MUCH slower than an encoded image (that must be decoded every time). At any rate, I tried you suggestion. It made the `map` step to run extremely slow (consumes all the 16GB of memory and starts swapping)
I tried also the easiest (as I see it) scenario, where images are kept as bytes, but it made things even worse: not only it was extremely slow, but also crashes
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"]).tobytes()
return example
dataset2 = dataset.map(transform, remove_columns=["image"])
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
Resource temporarily unavailable (src/thread.cpp:269)
Output exceeds the size limit. Open the full output data in a text editor
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
File ~/virtenvs/py310/lib/python3.10/site-packages/torch/utils/data/dataloader.py:1133, in _MultiProcessingDataLoaderIter._try_get_data(self, timeout)
1132 try:
-> 1133 data = self._data_queue.get(timeout=timeout)
1134 return (True, data)
File ~/virtenvs/py310/lib/python3.10/multiprocessing/queues.py:113, in Queue.get(self, block, timeout)
112 timeout = deadline - time.monotonic()
--> 113 if not self._poll(timeout):
114 raise Empty
File ~/virtenvs/py310/lib/python3.10/multiprocessing/connection.py:257, in _ConnectionBase.poll(self, timeout)
256 self._check_readable()
--> 257 return self._poll(timeout)
File ~/virtenvs/py310/lib/python3.10/multiprocessing/connection.py:424, in Connection._poll(self, timeout)
423 def _poll(self, timeout):
--> 424 r = wait([self], timeout)
425 return bool(r)
File ~/virtenvs/py310/lib/python3.10/multiprocessing/connection.py:931, in wait(object_list, timeout)
930 while True:
--> 931 ready = selector.select(timeout)
932 if ready:
...
-> 1146 raise RuntimeError('DataLoader worker (pid(s) {}) exited unexpectedly'.format(pids_str)) from e
1147 if isinstance(e, queue.Empty):
1148 return (False, None)
RuntimeError: DataLoader worker (pid(s) 195393) exited unexpectedly
Resource temporarily unavailable (src/thread.cpp:269)
Resource temporarily unavailable (src/thread.cpp:269)
Resource temporarily unavailable (src/thread.cpp:269)
Resource temporarily unavailable (src/thread.cpp:269)
Resource temporarily unavailable (src/thread.cpp:269)
```
| [
-0.1453673094511032,
-0.3491884768009186,
-0.06639406085014343,
0.33127361536026,
0.20194268226623535,
0.09923874586820602,
0.10682331770658493,
0.3263128697872162,
-0.21502655744552612,
0.2893214225769043,
0.0024473294615745544,
0.5300883650779724,
-0.1816093623638153,
-0.30507877469062805,
-0.20754025876522064,
-0.20178242027759552,
0.43119367957115173,
0.046555519104003906,
-0.17890921235084534,
-0.3762645721435547,
-0.06412503868341446,
-0.22592352330684662,
-0.18577316403388977,
-0.41323935985565186,
-0.22024819254875183,
-0.016833556815981865,
0.007374882698059082,
-0.14204081892967224,
-0.0886082872748375,
-0.16296468675136566,
0.22912797331809998,
-0.11344029754400253,
0.08142329752445221,
0.6424041390419006,
-0.0001237545657204464,
0.009396016597747803,
0.18918243050575256,
0.10245655477046967,
0.03391638398170471,
0.24854552745819092,
0.25062888860702515,
-0.2732529640197754,
-0.10465559363365173,
-0.2870313823223114,
-0.043884653598070145,
-0.00324297696352005,
-0.14018960297107697,
-0.5842074751853943,
0.23448598384857178,
-0.07305650413036346,
0.09589999169111252,
0.058822646737098694,
-0.7099969387054443,
0.020791959017515182,
0.311722993850708,
-0.048152148723602295,
-0.277794748544693,
-0.02182842791080475,
0.38497278094291687,
0.07800110429525375,
-0.13711941242218018,
0.5154946446418762,
-0.2104385793209076,
0.10899294912815094,
0.4675712585449219,
-0.033355746418237686,
-0.5068095326423645,
-0.24342496693134308,
0.16119197010993958,
0.1634787917137146,
-0.17514999210834503,
-0.09077903628349304,
-0.2817321717739105,
-0.36536890268325806,
-0.3441358804702759,
-0.06279250979423523,
0.08236312121152878,
0.15990446507930756,
-0.04180484265089035,
-0.1480833739042282,
-0.7843292355537415,
0.38107767701148987,
0.1260688304901123,
0.009768172167241573,
-0.22021621465682983,
-0.17019103467464447,
0.07422716915607452,
0.34424465894699097,
0.2147909700870514,
0.1078445240855217,
0.295971542596817,
-0.32759448885917664,
0.13318322598934174,
0.15834654867649078,
-0.38504713773727417,
-0.11938131600618362,
0.007356009446084499,
0.03764893114566803,
-0.05577415972948074,
-0.0441116988658905,
0.06259690225124359,
0.12430073320865631,
-0.12590418756008148,
-0.16643154621124268,
-0.16747568547725677,
0.29482555389404297,
-0.5640286803245544,
0.3274393379688263,
-0.01181197352707386,
-0.21268221735954285,
-0.3427819609642029,
0.0030725710093975067,
0.10178220272064209,
-0.2290690690279007,
0.23815959692001343,
0.07058185338973999,
-0.007084272801876068,
-0.13869835436344147,
-0.4610746502876282,
0.015259262174367905,
-0.26119112968444824,
-0.08496776968240738,
-0.17779529094696045,
0.2812589704990387,
-0.2485123872756958,
0.05516548082232475,
0.060874179005622864,
0.07058548927307129,
-0.30121463537216187,
0.07910996675491333,
-0.12320663034915924,
-0.10562498867511749,
-0.28477805852890015,
0.10521568357944489,
-0.09450935572385788,
-0.3399975299835205,
0.12004141509532928,
0.33917078375816345,
0.02043616957962513,
0.2913990318775177,
0.320972204208374,
-0.3472362458705902,
0.41411536931991577,
-0.15597903728485107,
-0.04184046387672424,
0.4071968197822571,
0.152549609541893,
0.48914921283721924,
-0.1676691621541977,
0.22972097992897034,
-0.3317652642726898,
-0.02311640977859497,
0.341806024312973,
0.05886320397257805,
-0.06412406265735626,
0.027196351438760757,
-0.2486160546541214,
0.01190623827278614,
-0.14074814319610596,
-0.06610555201768875,
0.2234506905078888,
-0.1160229817032814,
-0.3444230258464813,
-0.26940932869911194,
-0.1360316425561905,
0.18828630447387695,
-0.12803000211715698,
0.15980513393878937,
0.34105801582336426,
0.38909971714019775,
0.48446547985076904,
0.47107210755348206,
-0.3000251054763794,
-0.09705378115177155,
-0.28943660855293274,
-0.3830661177635193,
0.10533520579338074,
-0.30226612091064453,
-0.28016647696495056,
0.4295641779899597,
-0.0036806464195251465,
0.34066152572631836,
0.26019906997680664,
0.326576828956604,
0.5042418241500854,
-0.1937309056520462,
-0.1452895849943161,
0.3673616349697113,
0.010304274037480354,
0.3293682634830475,
-0.2977067828178406,
-0.37118294835090637,
0.3879459500312805,
-0.012653432786464691,
-0.1388094127178192,
0.02657780610024929,
0.03648540377616882,
-0.052477795630693436,
0.32036614418029785,
-0.22106614708900452,
-0.07200782001018524,
0.21196812391281128,
0.03176034614443779,
-0.11203159391880035,
-0.024393409490585327,
0.09216908365488052,
0.11741166561841965,
0.3217232823371887,
0.22389376163482666,
-0.22425654530525208,
0.06294630467891693,
-0.12699919939041138,
-0.15609543025493622,
-0.36810120940208435,
-0.24864515662193298,
-0.2793481945991516,
-0.08986464887857437,
0.11442875117063522,
0.2645495533943176,
-0.007093265652656555,
0.10286934673786163,
0.3049858808517456,
-0.029473617672920227,
-0.04593910649418831,
-0.2576369345188141,
0.1713007390499115,
0.19966565072536469,
-0.08350381255149841,
-0.1322592794895172,
-0.0343581959605217,
0.16757559776306152,
-0.1361483335494995,
-0.23300126194953918,
0.06822992116212845,
0.05874697491526604,
0.34227797389030457,
-0.10222120583057404,
0.08118438720703125,
0.22022207081317902,
-0.24823665618896484,
0.5235084891319275,
0.5080444812774658,
0.2643783688545227,
0.01865125447511673,
-0.34882551431655884,
0.5292644500732422,
-0.10337306559085846,
0.2998063862323761,
0.051306307315826416,
-0.2640998363494873,
-0.06058112904429436,
0.09656614065170288,
0.10353594273328781,
0.03132963925600052,
0.3859848082065582,
0.19274753332138062,
0.6135444641113281,
0.22988462448120117,
-0.003672175109386444,
0.2274342179298401,
0.36824551224708557,
0.19483022391796112,
-0.38471856713294983,
0.09046891331672668,
-0.19192790985107422,
0.11899834871292114,
0.008683962747454643,
0.2233460396528244,
0.5065247416496277,
0.10331599414348602,
0.0735572874546051,
0.14529068768024445,
0.08600892871618271,
0.05812689661979675,
0.20301447808742523,
-0.06557899713516235,
0.30058154463768005,
-0.07535312324762344,
0.27116426825523376,
0.24219545722007751,
-0.17744788527488708,
-0.15342682600021362,
0.05437853932380676,
0.07408048212528229,
0.18173715472221375,
0.3432461619377136,
-0.20593968033790588,
-0.02592659741640091,
-0.42329537868499756,
0.0996747761964798,
0.07070420682430267,
-0.09450240433216095,
-0.2492004632949829,
-0.0027930005453526974,
0.03973943740129471,
0.11767594516277313,
-0.24950063228607178,
-0.03508490324020386,
0.15411993861198425,
-0.07990042865276337,
0.005795292556285858,
0.056072480976581573,
-0.13336250185966492,
-0.08879244327545166,
0.03896522894501686,
-0.19511455297470093,
0.39565715193748474,
-0.12120567262172699,
-0.04538053274154663,
-0.2548178434371948,
-0.36556780338287354,
0.032228030264377594,
-0.08394274860620499,
-0.055863335728645325,
-0.12478121370077133,
0.04616221785545349,
-0.04290701076388359,
-0.2382650524377823,
0.2144359052181244,
-0.2001648247241974,
-0.23025771975517273,
-0.09944161772727966,
-0.0006151758134365082,
-0.09639395773410797,
0.07846987247467041,
-0.280283659696579,
-0.1409241259098053,
-0.11844322085380554,
-0.07957345247268677,
-0.11151386052370071,
-0.07409195601940155,
0.036111019551754,
0.18969395756721497,
-0.24887454509735107,
0.0319497212767601,
0.14066651463508606,
-0.19556103646755219,
-0.5173680782318115,
0.19810281693935394,
-0.0004837512969970703,
-0.3281257748603821,
-0.3263482451438904,
-0.17557935416698456,
-0.17024317383766174,
0.593470573425293,
-0.5150989294052124,
-0.05292072147130966,
-0.7069998979568481,
0.07774985581636429,
-0.05420524999499321,
0.11429306864738464,
0.18255296349525452,
-0.014669541269540787,
0.01611918956041336,
-0.31326714158058167,
-0.14267800748348236,
-0.3428574204444885,
-0.12312833964824677,
0.22320565581321716,
-0.05516233295202255,
0.5382065176963806,
0.25045108795166016,
0.7497597932815552,
0.33916330337524414,
-0.2057982236146927,
0.1452258825302124,
-0.03224988654255867,
0.31974169611930847,
-0.3536229729652405,
-0.3830586075782776,
0.2429848611354828,
-0.11991541087627411,
-0.2813010811805725,
0.0650261864066124,
-0.1361720860004425,
-0.20410385727882385,
0.034930869936943054,
-0.1267431676387787,
-0.05291968211531639,
-0.09029766917228699,
0.24413618445396423,
-0.2057313770055771,
0.010592782869935036,
0.1494503915309906,
0.37733250856399536,
-0.4757498800754547,
-0.1351495385169983,
0.169444277882576,
-0.08151345700025558,
0.24643611907958984,
-0.08834196627140045,
-0.29001903533935547,
-0.13574367761611938,
-0.36788156628608704,
0.21087908744812012,
0.16993144154548645,
0.2822628319263458,
0.314907431602478,
-0.20109760761260986,
0.24059486389160156,
0.03809482976794243,
0.629568874835968,
-0.00484243780374527,
0.09614508599042892,
-0.10704170167446136,
-0.4620056748390198,
-0.45196738839149475,
-0.21744197607040405,
-0.17254149913787842,
0.055824439972639084,
0.18709903955459595,
0.22982507944107056,
0.10477596521377563,
-0.09308505058288574,
0.15589827299118042,
0.4254656136035919,
0.00714874267578125,
-0.02947073057293892,
-0.2933088541030884,
-0.08652234077453613,
-0.16345441341400146,
-0.1813649833202362,
-0.197373628616333,
0.013132203370332718,
-0.2498476207256317,
-0.10831783711910248,
-0.32998210191726685,
0.1494380533695221,
0.168317973613739,
0.2317906767129898,
0.4692506492137909,
0.04689668491482735,
0.5312011241912842,
0.0016689710319042206,
0.41600993275642395,
-0.0012022331357002258,
0.5562915205955505,
-0.13080941140651703,
-0.290036141872406,
-0.05002927407622337,
-0.0677308663725853,
0.042295053601264954,
0.5702565312385559,
0.0007339529693126678,
0.17857833206653595,
-0.22141240537166595,
0.012533921748399734,
-0.46415847539901733,
0.05015282332897186,
0.47385644912719727,
0.192363902926445,
-0.2557009160518646,
-0.49569404125213623,
0.4045279920101166,
0.5153722167015076,
-0.20499283075332642,
0.29222676157951355,
-0.287254273891449,
0.04263056069612503,
0.48908787965774536,
0.023180149495601654,
0.9885715246200562,
-0.03338328376412392,
0.42277291417121887,
0.006742499768733978,
-0.0017468035221099854,
0.169978529214859,
0.03648316115140915,
0.17881518602371216,
-0.2758742570877075,
-0.4190644919872284,
-0.011347200721502304,
-0.23533889651298523,
0.07162146270275116,
-0.08168783783912659,
0.12033675611019135,
0.28343647718429565,
-0.06753182411193848,
0.16226154565811157,
-0.3831369876861572,
-0.2047012895345688,
-0.1979387402534485,
-0.10100661963224411,
0.053241681307554245,
0.04269818216562271,
0.20967605710029602,
0.2654326260089874,
0.04742346704006195,
0.023117002099752426,
-0.4654216766357422,
-0.12740734219551086,
-0.2662307620048523,
0.014566950500011444,
-0.14913471043109894,
0.3291706442832947,
-0.09410791099071503,
-0.529400646686554,
0.11115144193172455,
0.0995587557554245,
0.18835705518722534,
-0.08317700773477554,
0.1428556740283966,
0.3216398060321808,
0.06381809711456299,
0.4370022714138031,
0.30845972895622253,
-0.4894876480102539,
0.2164068967103958,
0.045704662799835205,
-0.04237449914216995,
0.013719430193305016,
-0.140237957239151,
-0.15331918001174927,
-0.22243429720401764,
0.5131101012229919,
0.1692928820848465,
-0.08638997375965118,
-0.4086516499519348,
-0.015979524701833725,
-0.06015413999557495,
-0.09416543692350388,
-0.004406989552080631,
-0.020894214510917664,
0.09879295527935028,
0.6481238007545471,
0.023549677804112434,
-0.5681862831115723,
0.055223897099494934,
0.37723901867866516,
0.36194366216659546,
-0.3089425563812256,
0.43721139430999756,
-0.28997302055358887,
-0.14778566360473633,
0.0662359744310379,
0.30410653352737427,
0.21976236999034882,
-0.43710723519325256,
0.15693017840385437,
-0.4769536256790161,
0.09672032296657562,
0.1170874685049057,
0.025424523279070854,
-0.08744153380393982,
0.10236518085002899,
-0.15857680141925812,
-0.035270437598228455,
-0.1049724891781807,
-0.07412075996398926,
-0.10409773141145706,
0.13005498051643372,
-0.2757788300514221,
0.08516475558280945,
-0.13914255797863007,
-0.04675893485546112,
-0.16354669630527496,
0.2998795509338379,
0.2337108850479126,
0.3066115379333496,
-0.24308297038078308,
-0.007639529183506966,
-0.02056802436709404,
-0.06651835888624191,
-0.06621376425027847,
0.21442654728889465,
-0.0488363578915596,
-0.060788944363594055,
-0.20219439268112183,
0.2093401402235031,
-0.1229950413107872,
-0.307666152715683,
-0.09998015314340591,
-0.22419120371341705,
0.19280679523944855,
-0.15827450156211853,
0.29694440960884094,
0.34824883937835693,
0.12780213356018066,
-0.20508351922035217,
0.17617283761501312,
-0.09690225124359131,
0.07599247246980667,
0.03184894844889641,
-0.2717679440975189,
0.47592321038246155,
0.1182614266872406,
-0.009834593161940575,
0.17783281207084656,
-0.11684323847293854,
-0.03301713615655899,
-0.1897791475057602,
0.1727515012025833,
0.19946789741516113,
0.2974505126476288,
-0.13675615191459656,
0.370727002620697,
0.2555842697620392,
0.12213394045829773,
0.43963682651519775,
-0.19502317905426025,
-0.29421690106391907,
0.12099352478981018,
0.02622884325683117,
-0.09685960412025452,
-0.1344929039478302,
-0.02288353443145752,
0.12662732601165771,
0.1499737650156021,
0.13363900780677795,
0.03750911355018616,
0.2561277151107788,
-0.12355712056159973,
-0.1766192615032196,
0.5085682272911072,
-0.25862354040145874,
0.1128394603729248,
0.3420552909374237,
0.39396899938583374,
-0.11856977641582489,
0.11846091598272324,
0.019712358713150024,
0.07679113000631332,
0.661780834197998,
0.022369548678398132,
0.6233105659484863,
0.4442884922027588,
0.021399036049842834,
0.0375521145761013,
-0.2622797191143036,
-0.043048419058322906,
0.3473743200302124,
-0.2768457531929016,
0.2329336255788803,
0.19069121778011322,
-0.10960545390844345,
0.2140432894229889,
-0.37042567133903503,
-0.10530838370323181,
0.14888715744018555,
0.05920099467039108,
-0.14577442407608032,
0.07089676707983017,
-0.07964791357517242,
-0.05750589072704315,
0.3960111141204834,
-0.28412044048309326,
-0.021642882376909256,
0.6245349049568176,
0.27280011773109436,
-0.15197722613811493,
-0.051287390291690826,
-0.3001595735549927,
-0.06893566250801086,
0.37792351841926575,
-0.031247004866600037,
0.07931273430585861,
0.31154152750968933,
0.04941486567258835,
0.28170254826545715,
0.385433554649353,
0.5730810165405273,
0.30612486600875854,
-0.07748538255691528,
0.1503891944885254,
0.05230189859867096,
0.04369904845952988,
0.07649337500333786,
0.0956650972366333,
-0.24069835245609283,
0.03434637188911438,
-0.05533833056688309,
0.013927541673183441,
-0.12733644247055054,
-0.14248372614383698,
-0.08577246963977814,
0.0038922391831874847,
-0.25044524669647217,
0.15929526090621948,
-0.24594272673130035,
0.24575141072273254,
-0.29918745160102844,
0.17773373425006866,
-0.5310995578765869,
0.012805774807929993,
0.27219584584236145,
-0.07439156621694565,
0.13899163901805878,
0.04303053021430969,
-0.020712444558739662,
-0.12595996260643005,
0.24837206304073334,
0.2727431654930115,
0.20677050948143005,
-0.3394639194011688,
-0.21751669049263,
-0.2886296510696411,
0.02722005918622017,
-0.48937147855758667,
-0.014833584427833557,
-0.27308332920074463,
0.34247586131095886,
-0.007339928299188614,
-0.042725373059511185,
0.40534520149230957,
0.0958455502986908,
0.07270932197570801,
0.3129825294017792,
-0.3213194012641907,
-0.1973266899585724,
0.03433374688029289,
-0.04319165647029877,
-0.08913871645927429,
-0.5756880044937134,
0.13715526461601257,
0.11682166159152985,
-0.000018127262592315674,
-0.027646072208881378,
-0.01477321982383728,
-0.040236447006464005,
0.12133601307868958,
0.4003881514072418,
0.24651116132736206,
0.3501969873905182,
-0.01499997079372406,
-0.26739951968193054,
-0.16598370671272278,
0.029754579067230225,
0.0255303755402565,
0.26872706413269043,
0.27236053347587585,
0.2060663402080536,
-0.1612788885831833,
-0.19517841935157776,
0.02164388820528984,
0.4302072823047638,
-0.03188600018620491,
-0.1484813690185547,
-0.31135475635528564,
0.13299062848091125,
-0.30020207166671753,
0.3740447461605072,
-0.18576154112815857,
0.4794744551181793,
0.13602539896965027,
0.1967431604862213,
-0.32738393545150757,
-0.4396911859512329,
0.5924092531204224,
-0.4189182221889496,
-0.30686837434768677,
-0.10387854278087616,
-0.008523613214492798,
-0.015294305980205536,
0.21194668114185333,
-0.354676216840744,
0.07874393463134766,
0.14252978563308716,
-0.1479233056306839,
0.14659252762794495,
0.21272596716880798,
0.16645945608615875,
-0.02002798765897751,
0.06881652772426605,
0.34339308738708496,
-0.032156411558389664,
-0.17746829986572266,
0.2706049382686615,
-0.023434355854988098
] |
https://github.com/huggingface/datasets/issues/5669 | Correction: the `beans` dataset stores the image file paths, not the bytes.
For your use case, I think it makes more sense to use `with_tranform` than `map` and lazily decode images with `cv2.imread` when indexing an example/batch:
```python
import cv2
def transform(batch):
batch["image2"] = np.stack([cv2.imread(image_file_path) for image_file_path in batch["image_file_path"]])
return batch
dataset = dataset.with_transform(transform)
```
| Almost identical datasets, huge performance difference | ### Describe the bug
I am struggling to understand (huge) performance difference between two datasets that are almost identical.
### Steps to reproduce the bug
# Fast (normal) dataset speed:
```python
import cv2
from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("beans", split="train")
for x in DataLoader(dataset.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
The above pass over the dataset takes about 1.5 seconds on my computer.
However, if I re-create (almost) the same dataset, the sweep takes HUGE amount of time: 15 minutes. Steps to reproduce:
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"])
return example
dataset2 = dataset.map(transform, remove_columns=["image"])
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
### Expected behavior
Same timings
### Environment info
python==3.10.9
datasets==2.10.1 | 55 | Almost identical datasets, huge performance difference
### Describe the bug
I am struggling to understand (huge) performance difference between two datasets that are almost identical.
### Steps to reproduce the bug
# Fast (normal) dataset speed:
```python
import cv2
from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("beans", split="train")
for x in DataLoader(dataset.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
The above pass over the dataset takes about 1.5 seconds on my computer.
However, if I re-create (almost) the same dataset, the sweep takes HUGE amount of time: 15 minutes. Steps to reproduce:
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"])
return example
dataset2 = dataset.map(transform, remove_columns=["image"])
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
### Expected behavior
Same timings
### Environment info
python==3.10.9
datasets==2.10.1
Correction: the `beans` dataset stores the image file paths, not the bytes.
For your use case, I think it makes more sense to use `with_tranform` than `map` and lazily decode images with `cv2.imread` when indexing an example/batch:
```python
import cv2
def transform(batch):
batch["image2"] = np.stack([cv2.imread(image_file_path) for image_file_path in batch["image_file_path"]])
return batch
dataset = dataset.with_transform(transform)
```
| [
-0.2065252661705017,
-0.17120826244354248,
-0.06908885389566422,
0.2150074988603592,
0.19906581938266754,
0.05381663143634796,
0.1543339192867279,
0.3986895680427551,
-0.16916751861572266,
0.24308669567108154,
-0.025165587663650513,
0.6264331340789795,
-0.12338794767856598,
-0.22326281666755676,
-0.21274298429489136,
-0.09911653399467468,
0.42642834782600403,
0.03470196574926376,
-0.3111470639705658,
-0.3565674424171448,
-0.10123465955257416,
-0.2641677260398865,
-0.14457403123378754,
-0.375527560710907,
-0.2956784665584564,
0.012077229097485542,
-0.007239885628223419,
-0.05387149378657341,
-0.043988145887851715,
-0.13122951984405518,
0.3583277463912964,
-0.08093425631523132,
0.06463313102722168,
0.7047473788261414,
-0.00011830130097223446,
0.0134878009557724,
0.06350146234035492,
0.07546474784612656,
-0.00005364418029785156,
0.16666176915168762,
0.4122579097747803,
-0.3564898669719696,
-0.11547838896512985,
-0.2812415659427643,
-0.10415279865264893,
0.029246758669614792,
-0.1272171437740326,
-0.5813156366348267,
0.0626114010810852,
-0.1518031358718872,
0.1390729546546936,
0.2161814570426941,
-0.7209910750389099,
0.004491813480854034,
0.29842308163642883,
-0.1071740984916687,
-0.2610717713832855,
-0.11475983262062073,
0.4326823949813843,
0.062191255390644073,
-0.19640132784843445,
0.531441867351532,
-0.25663459300994873,
0.07437679171562195,
0.4854905903339386,
0.03527887538075447,
-0.443787544965744,
-0.24203923344612122,
0.09433029592037201,
0.18907222151756287,
-0.12702754139900208,
-0.032122429460287094,
-0.3444884121417999,
-0.3829059600830078,
-0.3769625723361969,
0.0684383437037468,
0.03365118056535721,
0.13448207080364227,
-0.026296332478523254,
-0.18523436784744263,
-0.6446229219436646,
0.45401278138160706,
0.164961040019989,
-0.05060085654258728,
-0.07800443470478058,
-0.16457539796829224,
0.0846332535147667,
0.28956758975982666,
0.21151834726333618,
-0.026049545034766197,
0.35548311471939087,
-0.3108595311641693,
0.15699413418769836,
0.1482705920934677,
-0.3865598142147064,
-0.07699725031852722,
0.18633711338043213,
0.012804746627807617,
-0.12409508228302002,
0.008917586877942085,
0.1037132516503334,
0.19317999482154846,
-0.13155657052993774,
-0.17226067185401917,
-0.161972776055336,
0.2673318386077881,
-0.5167372822761536,
0.27142927050590515,
0.0633525401353836,
-0.26778021454811096,
-0.3092263340950012,
0.017828432843089104,
0.08909452706575394,
-0.2791658937931061,
0.2172224521636963,
0.07265441864728928,
0.021362848579883575,
-0.102432481944561,
-0.4686729907989502,
-0.09942033141851425,
-0.13091246783733368,
-0.03924984484910965,
-0.14527027308940887,
0.2833619713783264,
-0.15019099414348602,
0.14877891540527344,
0.14661471545696259,
0.03849989175796509,
-0.346330851316452,
0.05836895853281021,
-0.19160154461860657,
-0.12143222242593765,
-0.26447176933288574,
-0.021254409104585648,
0.029269732534885406,
-0.31649893522262573,
0.15216952562332153,
0.2353612184524536,
0.09981812536716461,
0.3725268542766571,
0.3243759870529175,
-0.2699487805366516,
0.4505673348903656,
-0.09518829733133316,
0.03158903867006302,
0.3111543357372284,
0.19497525691986084,
0.459099143743515,
-0.18513622879981995,
0.14798890054225922,
-0.28467005491256714,
-0.05194566398859024,
0.34291988611221313,
0.12598435580730438,
-0.026428386569023132,
0.020316552370786667,
-0.2751098573207855,
-0.019810624420642853,
-0.16505181789398193,
-0.0030231475830078125,
0.2485038936138153,
-0.11408372968435287,
-0.2824333608150482,
-0.3048931956291199,
-0.07542620599269867,
0.1534709483385086,
-0.04772796109318733,
0.15440839529037476,
0.41329383850097656,
0.38388243317604065,
0.4273587167263031,
0.48536714911460876,
-0.3055877089500427,
-0.08370649069547653,
-0.2427678406238556,
-0.30003875494003296,
0.13750268518924713,
-0.3698928654193878,
-0.19355058670043945,
0.3305477201938629,
-0.09199071675539017,
0.26743966341018677,
0.29369568824768066,
0.34767964482307434,
0.4441344738006592,
-0.23596104979515076,
-0.15526552498340607,
0.4041762351989746,
-0.0017669647932052612,
0.33597293496131897,
-0.29712051153182983,
-0.31353259086608887,
0.3814895451068878,
-0.020199619233608246,
-0.11306098103523254,
-0.09728648513555527,
0.009275238960981369,
-0.0545707531273365,
0.3608156144618988,
-0.21835434436798096,
-0.07977928221225739,
0.12467256188392639,
0.1413847655057907,
-0.15173915028572083,
0.01889505609869957,
0.12737470865249634,
0.12554624676704407,
0.3784862160682678,
0.24645817279815674,
-0.1764761060476303,
0.15081655979156494,
-0.2723917067050934,
-0.045678846538066864,
-0.32056280970573425,
-0.17816777527332306,
-0.3075129985809326,
-0.028577690944075584,
0.05622807890176773,
0.2379845827817917,
-0.16946014761924744,
0.07507339119911194,
0.1461101621389389,
-0.03716283664107323,
0.028890758752822876,
-0.2769927382469177,
0.2005784660577774,
0.1687864512205124,
-0.14559043943881989,
-0.1817326694726944,
0.014665010385215282,
0.19773174822330475,
-0.20393088459968567,
-0.16520196199417114,
0.09906472265720367,
-0.008032407611608505,
0.3276473581790924,
-0.023631324991583824,
0.1584896445274353,
0.16065829992294312,
-0.15272703766822815,
0.4635741710662842,
0.4822818636894226,
0.2608552873134613,
0.04307132959365845,
-0.42890802025794983,
0.6020904779434204,
-0.25963568687438965,
0.24720017611980438,
0.03380022197961807,
-0.25929757952690125,
0.044726140797138214,
0.04355436563491821,
0.20165744423866272,
0.07067796587944031,
0.33119213581085205,
0.15334075689315796,
0.45298320055007935,
0.24922867119312286,
0.0270673930644989,
0.3715570569038391,
0.29847145080566406,
0.21243180334568024,
-0.3912084400653839,
-0.008989155292510986,
-0.12345775216817856,
0.1241881251335144,
-0.013121290132403374,
0.0895400270819664,
0.4541217088699341,
0.19771617650985718,
0.08246037364006042,
0.033633582293987274,
0.15945039689540863,
0.013129811733961105,
0.23441240191459656,
-0.07649639248847961,
0.13963282108306885,
-0.03185958415269852,
0.2769184410572052,
0.26047036051750183,
-0.2180243730545044,
-0.11867885291576385,
0.02984563261270523,
0.05714065581560135,
0.149302139878273,
0.26169121265411377,
-0.13268454372882843,
-0.08389222621917725,
-0.34636008739471436,
0.11914408206939697,
0.13329057395458221,
-0.09004121273756027,
-0.23566463589668274,
0.11491268128156662,
-0.06740748882293701,
0.14114755392074585,
-0.351787805557251,
0.009874150156974792,
0.16353318095207214,
-0.11374758183956146,
0.018078602850437164,
0.15434373915195465,
-0.20810307562351227,
-0.04608367383480072,
0.061428628861904144,
-0.17664024233818054,
0.3698297441005707,
-0.09026080369949341,
0.051565930247306824,
-0.34835556149482727,
-0.33235862851142883,
0.05332035943865776,
-0.06944884359836578,
-0.025957288220524788,
-0.03786376863718033,
-0.019297875463962555,
-0.02888740599155426,
-0.27315008640289307,
0.1437796652317047,
-0.3229365944862366,
-0.2800332307815552,
-0.08530732989311218,
-0.02077343873679638,
-0.08647067844867706,
-0.014555349946022034,
-0.37961095571517944,
-0.07112455368041992,
-0.20267194509506226,
-0.08342203497886658,
-0.16784954071044922,
-0.09873580932617188,
0.12055620551109314,
0.1652129590511322,
-0.16818615794181824,
0.1038176417350769,
0.06623727828264236,
-0.1631586104631424,
-0.5148019790649414,
0.20914991199970245,
0.06255723536014557,
-0.30043578147888184,
-0.37794727087020874,
-0.2057792693376541,
-0.23666507005691528,
0.5457912683486938,
-0.4570384919643402,
-0.0830889344215393,
-0.6454786062240601,
0.33121299743652344,
-0.017673473805189133,
0.15575985610485077,
0.246748685836792,
-0.0004201531410217285,
-0.09080657362937927,
-0.3241282105445862,
-0.12880435585975647,
-0.2528211176395416,
-0.0020811716094613075,
0.19895127415657043,
-0.0816810131072998,
0.4896886944770813,
0.30385151505470276,
0.7954835891723633,
0.21829970180988312,
-0.2871333658695221,
0.18017646670341492,
0.014385400339961052,
0.3861355781555176,
-0.2462836354970932,
-0.4781992435455322,
0.26327624917030334,
-0.14125783741474152,
-0.24303913116455078,
0.02401558682322502,
-0.08421041071414948,
-0.2461681067943573,
0.08032995462417603,
-0.1925106942653656,
-0.08185386657714844,
-0.08927302062511444,
0.27740174531936646,
-0.14142096042633057,
-0.03610432147979736,
0.16974422335624695,
0.382965624332428,
-0.5229489803314209,
-0.17036819458007812,
0.13404180109500885,
-0.10867727547883987,
0.27630311250686646,
-0.09914009273052216,
-0.2609851360321045,
-0.11338664591312408,
-0.4405811131000519,
0.21498805284500122,
0.08957625180482864,
0.21199551224708557,
0.30623871088027954,
-0.2837603986263275,
0.15556783974170685,
0.017710309475660324,
0.7680591940879822,
0.0018784701824188232,
0.18299034237861633,
-0.09147240221500397,
-0.46045583486557007,
-0.5232290625572205,
-0.2706267237663269,
-0.1685352325439453,
0.11310803890228271,
0.44618701934814453,
0.3676062524318695,
0.09620489180088043,
-0.13638052344322205,
0.09929241240024567,
0.2910314202308655,
0.021430321037769318,
0.04307408630847931,
-0.2939361333847046,
-0.13732551038265228,
-0.044673748314380646,
-0.05739456042647362,
-0.17161476612091064,
0.07943017780780792,
-0.25263863801956177,
-0.07605353742837906,
-0.29487428069114685,
0.10117532312870026,
0.1582920253276825,
0.20522865653038025,
0.42275312542915344,
0.19943302869796753,
0.5737148523330688,
0.03054233267903328,
0.444926381111145,
0.03300108760595322,
0.5903763175010681,
-0.2263512760400772,
-0.18911471962928772,
-0.07387383282184601,
-0.12308982759714127,
0.035529959946870804,
0.5840631127357483,
0.01565859466791153,
0.19100457429885864,
-0.2824334502220154,
0.027870342135429382,
-0.3071281313896179,
0.08556254208087921,
0.3894194960594177,
0.166273832321167,
-0.1332184225320816,
-0.39045387506484985,
0.3581122159957886,
0.4670737385749817,
-0.19687548279762268,
0.2735383212566376,
-0.2987203001976013,
0.0377175509929657,
0.5209386348724365,
0.03462572768330574,
0.8687820434570312,
0.0427347868680954,
0.4241449534893036,
-0.0008614528924226761,
-0.016262777149677277,
0.2783616781234741,
-0.0685545951128006,
0.14762040972709656,
-0.24112650752067566,
-0.48375532031059265,
0.016209639608860016,
-0.22960993647575378,
-0.061645012348890305,
-0.05696661025285721,
0.13619312644004822,
0.27761122584342957,
-0.08167964220046997,
0.13477246463298798,
-0.39113277196884155,
-0.1822345107793808,
-0.17010900378227234,
-0.16084343194961548,
0.07115195691585541,
0.08031316846609116,
0.20790770649909973,
0.279183954000473,
0.1058945506811142,
0.009865842759609222,
-0.38666024804115295,
-0.11809176206588745,
-0.25286489725112915,
0.043669044971466064,
-0.17251572012901306,
0.3403356373310089,
0.018656477332115173,
-0.5113015174865723,
-0.012701466679573059,
0.03128296136856079,
0.22280940413475037,
-0.08956155180931091,
0.1189398318529129,
0.28560197353363037,
0.19904404878616333,
0.45756399631500244,
0.3195432722568512,
-0.49659326672554016,
0.297897607088089,
0.0757032036781311,
-0.07891283184289932,
-0.08283266425132751,
-0.1335238814353943,
-0.1938992142677307,
-0.14904837310314178,
0.5121597051620483,
0.051128651946783066,
-0.10463432967662811,
-0.2958464026451111,
0.015921620652079582,
-0.01033756136894226,
-0.17096130549907684,
0.03897645324468613,
-0.028384346514940262,
0.053627144545316696,
0.627236545085907,
0.12018987536430359,
-0.5960232019424438,
0.05813458934426308,
0.4154796004295349,
0.32167279720306396,
-0.2844443619251251,
0.42403608560562134,
-0.25947099924087524,
-0.14343294501304626,
0.027519933879375458,
0.2615966796875,
0.2919284403324127,
-0.35356444120407104,
0.21815869212150574,
-0.42139196395874023,
0.0450177937746048,
0.205084428191185,
0.019073080271482468,
0.01137905940413475,
0.15849825739860535,
-0.24622522294521332,
-0.02354138344526291,
-0.06378206610679626,
-0.05473523586988449,
-0.01601823791861534,
0.1314961314201355,
-0.27569663524627686,
0.11539687216281891,
-0.083892822265625,
-0.10909327864646912,
-0.2379186451435089,
0.28320837020874023,
0.19249102473258972,
0.31753790378570557,
-0.1937231421470642,
-0.03158232942223549,
-0.051655977964401245,
-0.12777258455753326,
-0.05425276607275009,
0.1229783445596695,
-0.12974092364311218,
-0.12992213666439056,
-0.23081105947494507,
0.1587870717048645,
-0.1630115509033203,
-0.3080710768699646,
-0.12729614973068237,
-0.1913887858390808,
0.12155936658382416,
-0.24158920347690582,
0.27972549200057983,
0.3506057858467102,
0.1364019513130188,
-0.2767406105995178,
0.07574650645256042,
-0.07787540555000305,
0.16005267202854156,
0.010448776185512543,
-0.22820211946964264,
0.27772337198257446,
0.16484053432941437,
0.025856979191303253,
0.10934747755527496,
-0.12908129394054413,
0.034666575491428375,
-0.32624560594558716,
0.10549087822437286,
0.22145779430866241,
0.19311316311359406,
-0.18375782668590546,
0.20533150434494019,
0.28176435828208923,
0.14532142877578735,
0.38059327006340027,
-0.09792297333478928,
-0.28420889377593994,
0.06501403450965881,
0.11765404790639877,
-0.15839147567749023,
-0.16193343698978424,
-0.05022931098937988,
0.2357146441936493,
0.159656822681427,
0.11050815135240555,
0.058745160698890686,
0.148452490568161,
-0.06151338666677475,
-0.07416003942489624,
0.5340373516082764,
-0.20875433087348938,
0.0837494507431984,
0.2029569149017334,
0.33154773712158203,
-0.08396067470312119,
0.18749982118606567,
-0.05955453962087631,
0.08165789395570755,
0.6292240619659424,
0.11550301313400269,
0.7329613566398621,
0.43499574065208435,
0.02833239547908306,
-0.06675286591053009,
-0.24030855298042297,
-0.062153782695531845,
0.2517698407173157,
-0.251740425825119,
0.19051197171211243,
0.19678911566734314,
-0.0687795877456665,
0.10939311981201172,
-0.3753104507923126,
-0.12803523242473602,
0.18616600334644318,
-0.04397936165332794,
-0.16064748167991638,
-0.04235289618372917,
-0.09806690365076065,
0.06904952228069305,
0.36575496196746826,
-0.21635961532592773,
0.00978864636272192,
0.49105337262153625,
0.2490311563014984,
-0.19225987792015076,
-0.05576498806476593,
-0.21872352063655853,
-0.14221525192260742,
0.3761345446109772,
-0.00807829201221466,
-0.007786061614751816,
0.40002989768981934,
-0.03567009046673775,
0.30071306228637695,
0.5277109146118164,
0.6011068224906921,
0.3023761510848999,
-0.14579343795776367,
0.07540266215801239,
0.01619364693760872,
0.06615394353866577,
-0.08749503642320633,
0.07618722319602966,
-0.3338736593723297,
-0.0664554163813591,
-0.05226990953087807,
0.05846758931875229,
-0.17139461636543274,
-0.15065953135490417,
-0.09818020462989807,
0.027462679892778397,
-0.28384697437286377,
0.08249181509017944,
-0.16135114431381226,
0.20834162831306458,
-0.3364759087562561,
0.19918812811374664,
-0.45168834924697876,
-0.021582137793302536,
0.3693355619907379,
-0.06386400014162064,
0.1445750892162323,
0.015078820288181305,
0.022331878542900085,
-0.10623610764741898,
0.22042465209960938,
0.2488432377576828,
0.11093254387378693,
-0.28436389565467834,
-0.07642674446105957,
-0.277510404586792,
0.023934800177812576,
-0.44649630784988403,
-0.009380072355270386,
-0.2565363049507141,
0.4406355619430542,
0.03529000282287598,
-0.09665118157863617,
0.3839489221572876,
0.06718757003545761,
0.07020721584558487,
0.3529891073703766,
-0.3900488018989563,
-0.15320202708244324,
-0.14295001327991486,
-0.038041818886995316,
0.0016111359000205994,
-0.5967345237731934,
0.030788403004407883,
0.1660897135734558,
0.06022931635379791,
-0.016101961955428123,
-0.09346013516187668,
0.1221032440662384,
0.26113802194595337,
0.3324412703514099,
0.15666057169437408,
0.3386266827583313,
0.027709275484085083,
-0.20849469304084778,
-0.20480820536613464,
0.010177619755268097,
-0.09933862090110779,
0.1682795137166977,
0.18620046973228455,
0.15201669931411743,
-0.171476811170578,
-0.22668099403381348,
0.06765468418598175,
0.38413205742836,
0.018383748829364777,
-0.17373785376548767,
-0.2570364475250244,
0.13449998199939728,
-0.36183327436447144,
0.31565430760383606,
-0.23569929599761963,
0.4837876260280609,
0.07373687624931335,
0.13240107893943787,
-0.34240737557411194,
-0.49098488688468933,
0.6107202768325806,
-0.5182898640632629,
-0.3031005263328552,
-0.23271694779396057,
0.06616281718015671,
-0.0625128522515297,
0.23390670120716095,
-0.24513766169548035,
0.017291799187660217,
0.11662019044160843,
-0.1160164400935173,
0.1090819388628006,
0.15161758661270142,
0.06498371064662933,
-0.040884923189878464,
0.010595843195915222,
0.314912348985672,
-0.017107920721173286,
-0.2171943336725235,
0.19085268676280975,
0.02793283760547638
] |
https://github.com/huggingface/datasets/issues/5669 | This is incorrect.
Did you try to run it? dataset[0] returns a tensor of numbers. dataset2[0]
returns the same tensor, but after a few long seconds. Looping over a
thousand of images cannot take 15 minutes.
On Fri, 24 Mar 2023 at 19:28 Mario Šaško ***@***.***> wrote:
> Correction: the beans dataset stores the image file paths, not the bytes.
>
> For your use case, I think it makes more sense to use with_tranform than
> map and lazily decode images with cv2.imread when accessing an
> example/batch:
>
> import cv2
> def transform(batch):
> batch["image2"] = np.stack([cv2.imread(image_file_path) for image_file_path in batch["image_file_path"]])
> return batch
> dataset = dataset.with_transform(transform)
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/5669#issuecomment-1483084347>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AASS73SHRWXIQX6SCYCJ7ITW5XDUDANCNFSM6AAAAAAWFSHWEM>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
| Almost identical datasets, huge performance difference | ### Describe the bug
I am struggling to understand (huge) performance difference between two datasets that are almost identical.
### Steps to reproduce the bug
# Fast (normal) dataset speed:
```python
import cv2
from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("beans", split="train")
for x in DataLoader(dataset.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
The above pass over the dataset takes about 1.5 seconds on my computer.
However, if I re-create (almost) the same dataset, the sweep takes HUGE amount of time: 15 minutes. Steps to reproduce:
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"])
return example
dataset2 = dataset.map(transform, remove_columns=["image"])
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
### Expected behavior
Same timings
### Environment info
python==3.10.9
datasets==2.10.1 | 147 | Almost identical datasets, huge performance difference
### Describe the bug
I am struggling to understand (huge) performance difference between two datasets that are almost identical.
### Steps to reproduce the bug
# Fast (normal) dataset speed:
```python
import cv2
from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("beans", split="train")
for x in DataLoader(dataset.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
The above pass over the dataset takes about 1.5 seconds on my computer.
However, if I re-create (almost) the same dataset, the sweep takes HUGE amount of time: 15 minutes. Steps to reproduce:
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"])
return example
dataset2 = dataset.map(transform, remove_columns=["image"])
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
### Expected behavior
Same timings
### Environment info
python==3.10.9
datasets==2.10.1
This is incorrect.
Did you try to run it? dataset[0] returns a tensor of numbers. dataset2[0]
returns the same tensor, but after a few long seconds. Looping over a
thousand of images cannot take 15 minutes.
On Fri, 24 Mar 2023 at 19:28 Mario Šaško ***@***.***> wrote:
> Correction: the beans dataset stores the image file paths, not the bytes.
>
> For your use case, I think it makes more sense to use with_tranform than
> map and lazily decode images with cv2.imread when accessing an
> example/batch:
>
> import cv2
> def transform(batch):
> batch["image2"] = np.stack([cv2.imread(image_file_path) for image_file_path in batch["image_file_path"]])
> return batch
> dataset = dataset.with_transform(transform)
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/5669#issuecomment-1483084347>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AASS73SHRWXIQX6SCYCJ7ITW5XDUDANCNFSM6AAAAAAWFSHWEM>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
| [
-0.20905712246894836,
-0.22886568307876587,
-0.08028101921081543,
0.2549530863761902,
0.23452545702457428,
0.024585843086242676,
0.20100745558738708,
0.43278390169143677,
-0.24287205934524536,
0.2857791781425476,
0.0024026259779930115,
0.5662869811058044,
-0.16168633103370667,
-0.21761423349380493,
-0.18225330114364624,
-0.1433866173028946,
0.38796234130859375,
0.04281780123710632,
-0.29119864106178284,
-0.37781059741973877,
-0.08467793464660645,
-0.23359304666519165,
-0.12439421564340591,
-0.3624474108219147,
-0.3220180571079254,
0.003969093784689903,
0.05517014116048813,
-0.11484771966934204,
-0.07619518041610718,
-0.06113157793879509,
0.34947407245635986,
-0.14548958837985992,
0.06237224489450455,
0.722638726234436,
-0.00011870876915054396,
0.06059525907039642,
0.07957123219966888,
0.09123090654611588,
0.01671026274561882,
0.15793895721435547,
0.4119231104850769,
-0.3750663101673126,
-0.1485161930322647,
-0.3172197937965393,
-0.06871777772903442,
0.07136163115501404,
-0.12274931371212006,
-0.5745933651924133,
0.15589997172355652,
-0.08952727913856506,
0.12136977165937424,
0.26386702060699463,
-0.6820510625839233,
0.03757370635867119,
0.2893427908420563,
-0.1420535147190094,
-0.2740294933319092,
-0.14424075186252594,
0.3999117910861969,
0.020194530487060547,
-0.15534979104995728,
0.578283965587616,
-0.2587524950504303,
0.10007162392139435,
0.4728865921497345,
0.10732464492321014,
-0.384168803691864,
-0.292371928691864,
0.08833474665880203,
0.21541370451450348,
-0.12080717831850052,
-0.04330058768391609,
-0.27807751297950745,
-0.3666648864746094,
-0.3894265294075012,
0.028244391083717346,
0.03313607722520828,
0.14345544576644897,
-0.05280650779604912,
-0.18036378920078278,
-0.6692923307418823,
0.47045764327049255,
0.053497835993766785,
0.02627013437449932,
-0.12596043944358826,
-0.22995063662528992,
0.07390890270471573,
0.31482040882110596,
0.2081330418586731,
0.02496674284338951,
0.34975823760032654,
-0.31062719225883484,
0.25419923663139343,
0.1721956580877304,
-0.3985987603664398,
-0.13520969450473785,
0.13470007479190826,
-0.07588900625705719,
-0.136876180768013,
-0.05612172186374664,
0.14873819053173065,
0.1962379813194275,
-0.21471761167049408,
-0.14473333954811096,
-0.20037999749183655,
0.3052254915237427,
-0.5654309988021851,
0.24323616921901703,
0.05723332241177559,
-0.2588982582092285,
-0.32563555240631104,
0.04561571031808853,
0.07762141525745392,
-0.3240927755832672,
0.09915360808372498,
0.09365838766098022,
0.031286172568798065,
-0.0842272937297821,
-0.46378546953201294,
-0.03443652018904686,
-0.21847239136695862,
-0.034373536705970764,
-0.13127592206001282,
0.2749667167663574,
-0.2268887758255005,
0.21150019764900208,
0.18836940824985504,
-0.007384397089481354,
-0.36136943101882935,
-0.011240396648645401,
-0.1928776204586029,
-0.07592737674713135,
-0.29068470001220703,
0.024432744830846786,
0.02820555865764618,
-0.25994226336479187,
0.08823832869529724,
0.2245827615261078,
0.11832602322101593,
0.3006536364555359,
0.35493284463882446,
-0.3067927062511444,
0.4678165912628174,
-0.06532593071460724,
-0.029615864157676697,
0.308505654335022,
0.19325955212116241,
0.3999279737472534,
-0.15453942120075226,
0.1651528924703598,
-0.32450562715530396,
-0.03495191037654877,
0.34823524951934814,
0.11196182668209076,
-0.036389853805303574,
0.02975964918732643,
-0.32983627915382385,
-0.016279403120279312,
-0.13847491145133972,
0.009132012724876404,
0.25379258394241333,
-0.12192361056804657,
-0.2992054224014282,
-0.2713581919670105,
-0.030131634324789047,
0.1036020964384079,
-0.08612169325351715,
0.127491295337677,
0.39140981435775757,
0.43792468309402466,
0.4306740164756775,
0.5218965411186218,
-0.32955628633499146,
-0.03536689653992653,
-0.2016746550798416,
-0.2646181583404541,
0.1568080186843872,
-0.3799058794975281,
-0.18220674991607666,
0.33356377482414246,
-0.07388579845428467,
0.23526373505592346,
0.2318877875804901,
0.3133879005908966,
0.4454896152019501,
-0.15592318773269653,
-0.16154277324676514,
0.3170674741268158,
0.02713165245950222,
0.30879825353622437,
-0.3063230812549591,
-0.3694906532764435,
0.3259919285774231,
0.0005431324243545532,
-0.03625375032424927,
-0.06629715859889984,
0.03162640333175659,
0.07534421980381012,
0.38746973872184753,
-0.2263883352279663,
-0.11402865499258041,
0.14593379199504852,
0.10192646086215973,
-0.1749502420425415,
0.009140443056821823,
0.0889892727136612,
0.056262463331222534,
0.36786067485809326,
0.26152437925338745,
-0.07799990475177765,
0.22747664153575897,
-0.23504570126533508,
-0.05916988104581833,
-0.3292030692100525,
-0.11175921559333801,
-0.30104145407676697,
-0.02637948840856552,
0.03866060823202133,
0.2188916653394699,
-0.11866210401058197,
0.03605973720550537,
0.1208413615822792,
-0.05918083339929581,
0.00017654523253440857,
-0.3354174792766571,
0.209705650806427,
0.19797725975513458,
-0.11237196624279022,
-0.23865391314029694,
0.004149952903389931,
0.19408753514289856,
-0.21270060539245605,
-0.1645163595676422,
0.0395696796476841,
-0.04141777381300926,
0.34354594349861145,
-0.17473284900188446,
0.26569971442222595,
0.18774455785751343,
-0.15478995442390442,
0.42654114961624146,
0.39414623379707336,
0.24378415942192078,
0.017017677426338196,
-0.3748277425765991,
0.5647673606872559,
-0.2768305540084839,
0.23062685132026672,
0.0372517928481102,
-0.2587481737136841,
0.003788501024246216,
0.03664213418960571,
0.12320759892463684,
0.09907639026641846,
0.4062786102294922,
0.18384340405464172,
0.4044189453125,
0.21595770120620728,
0.015901640057563782,
0.3397371172904968,
0.3854873478412628,
0.1983792930841446,
-0.42995214462280273,
-0.021067406982183456,
-0.13057702779769897,
0.14527910947799683,
-0.01437802892178297,
0.16569803655147552,
0.487845778465271,
0.1537965089082718,
0.09003674983978271,
0.12358752638101578,
0.1062387228012085,
-0.0002725161612033844,
0.243997722864151,
-0.00187654048204422,
0.2699710726737976,
-0.01738070882856846,
0.24800588190555573,
0.2773604989051819,
-0.2134070098400116,
-0.08268565684556961,
0.046424202620983124,
0.0983082577586174,
0.13585253059864044,
0.3173564672470093,
-0.13221493363380432,
-0.05358678847551346,
-0.4219074249267578,
0.07527981698513031,
0.1485682874917984,
-0.002732411026954651,
-0.23950833082199097,
0.09106189012527466,
-0.0382734052836895,
0.16054585576057434,
-0.2979848384857178,
0.06128266453742981,
0.1589498221874237,
-0.09752348810434341,
-0.061449386179447174,
0.17507509887218475,
-0.18931344151496887,
-0.05910130590200424,
0.051406290382146835,
-0.2330062985420227,
0.347928911447525,
-0.10513557493686676,
-0.020206350833177567,
-0.28896981477737427,
-0.42131534218788147,
0.09860008209943771,
-0.047571152448654175,
-0.04285286366939545,
-0.05311661958694458,
0.03404621407389641,
-0.029972903430461884,
-0.30477118492126465,
0.1775660663843155,
-0.2965029180049896,
-0.2614556849002838,
-0.06214097514748573,
-0.03076179511845112,
-0.06551508605480194,
-0.02862197905778885,
-0.45813778042793274,
-0.11707889288663864,
-0.17615610361099243,
-0.004420476034283638,
-0.14668889343738556,
-0.08781276643276215,
0.13887248933315277,
0.21007417142391205,
-0.08638283610343933,
0.14371347427368164,
0.09650702774524689,
-0.1520315259695053,
-0.5290907621383667,
0.2033553272485733,
0.045929159969091415,
-0.31172406673431396,
-0.3422349691390991,
-0.1738029569387436,
-0.1442304104566574,
0.5188180804252625,
-0.5158200860023499,
-0.11988887935876846,
-0.6136030554771423,
0.223351389169693,
-0.03191116452217102,
0.08561304956674576,
0.2624887228012085,
-0.01896238885819912,
-0.06015903130173683,
-0.2982025146484375,
-0.1044735461473465,
-0.26092228293418884,
-0.000003244727849960327,
0.18630650639533997,
-0.10065385699272156,
0.554543673992157,
0.39202022552490234,
0.7668161988258362,
0.276213139295578,
-0.3327874541282654,
0.08573812991380692,
0.007095674052834511,
0.29948166012763977,
-0.21224085986614227,
-0.4775769114494324,
0.31603869795799255,
-0.19840864837169647,
-0.313698410987854,
0.005526747554540634,
-0.14661242067813873,
-0.21635442972183228,
0.05355895310640335,
-0.09753784537315369,
-0.0814368724822998,
-0.09288466721773148,
0.2655414044857025,
-0.07950718700885773,
-0.012358872219920158,
0.19574332237243652,
0.3669390082359314,
-0.5272486805915833,
-0.20253533124923706,
0.15261945128440857,
-0.09052462875843048,
0.187153160572052,
-0.08015522360801697,
-0.3078799247741699,
-0.13141369819641113,
-0.3842241168022156,
0.2303486466407776,
0.050231680274009705,
0.22702458500862122,
0.28603029251098633,
-0.2526313364505768,
0.16792996227741241,
-0.0003877691924571991,
0.8188822269439697,
0.002333344891667366,
0.14557145535945892,
-0.0950314998626709,
-0.42619645595550537,
-0.5333025455474854,
-0.26026642322540283,
-0.17906689643859863,
0.02477269619703293,
0.4882805645465851,
0.45202019810676575,
0.10587821900844574,
-0.1103159636259079,
0.19684550166130066,
0.31459006667137146,
-0.005346663296222687,
0.0639016404747963,
-0.27188095450401306,
-0.12451321631669998,
-0.054927706718444824,
-0.12760768830776215,
-0.15852174162864685,
0.10321181267499924,
-0.26598334312438965,
-0.10559158027172089,
-0.2304937094449997,
0.12860575318336487,
0.14088484644889832,
0.20329344272613525,
0.3801631033420563,
0.19018018245697021,
0.4992724657058716,
0.07071518152952194,
0.4576144814491272,
0.04236776381731033,
0.5664135813713074,
-0.24500854313373566,
-0.29745984077453613,
-0.046402063220739365,
-0.07829099148511887,
-0.0007216371595859528,
0.5982753038406372,
-0.020353784784674644,
0.134481281042099,
-0.11900505423545837,
0.044311556965112686,
-0.35798606276512146,
0.2227969914674759,
0.4091910719871521,
0.21532365679740906,
-0.0472789965569973,
-0.4088243246078491,
0.3781391680240631,
0.4607612192630768,
-0.1856136918067932,
0.2511589825153351,
-0.3317636549472809,
0.013527125120162964,
0.4649682343006134,
0.04869876056909561,
0.9156389236450195,
0.010077176615595818,
0.37329477071762085,
0.03136478364467621,
0.03870710730552673,
0.3607513904571533,
-0.2270534634590149,
0.18235322833061218,
-0.22578540444374084,
-0.4661220908164978,
0.00649125874042511,
-0.2865341305732727,
-0.04952004924416542,
-0.020839322358369827,
0.14667686820030212,
0.1985962688922882,
0.04131831228733063,
0.19922424852848053,
-0.36749565601348877,
-0.19402527809143066,
-0.10518620908260345,
-0.168155238032341,
0.0854899138212204,
0.06951350718736649,
0.13401493430137634,
0.29583171010017395,
0.08537405729293823,
-0.005476564168930054,
-0.3858175277709961,
-0.13504093885421753,
-0.2510566711425781,
0.08159756660461426,
-0.3335114121437073,
0.32177096605300903,
0.05941847339272499,
-0.5057052373886108,
-0.004060335457324982,
0.1050909236073494,
0.2614763677120209,
-0.10879841446876526,
0.06558983027935028,
0.27120697498321533,
0.117765873670578,
0.4524006247520447,
0.36981791257858276,
-0.5524629354476929,
0.3697271943092346,
0.029330894351005554,
-0.05833767354488373,
-0.012222958728671074,
-0.10981981456279755,
-0.17696154117584229,
-0.10792312026023865,
0.49366840720176697,
0.12409333884716034,
-0.06549655646085739,
-0.28158044815063477,
0.07239322364330292,
-0.04939274117350578,
-0.13768985867500305,
0.046415776014328,
-0.06747574359178543,
0.023766696453094482,
0.6893078684806824,
0.035911351442337036,
-0.5809662342071533,
0.09682311117649078,
0.40963083505630493,
0.31827959418296814,
-0.36144745349884033,
0.4277193546295166,
-0.18330897390842438,
-0.1540437936782837,
0.038658566772937775,
0.2618667483329773,
0.20612232387065887,
-0.4222641587257385,
0.23055611550807953,
-0.41914600133895874,
0.04741595685482025,
0.19003868103027344,
0.024618860334157944,
0.04327797517180443,
0.13248494267463684,
-0.2460368573665619,
-0.020632736384868622,
-0.08284014463424683,
-0.018296506255865097,
-0.018812423571944237,
0.14637061953544617,
-0.1905899941921234,
0.2168906331062317,
-0.07435274124145508,
-0.11141683161258698,
-0.22904866933822632,
0.31190043687820435,
0.17824603617191315,
0.30301767587661743,
-0.2113093137741089,
-0.06169333681464195,
0.012836083769798279,
-0.13607966899871826,
-0.07931441068649292,
0.1781315803527832,
-0.1313832700252533,
-0.11917337775230408,
-0.27846232056617737,
0.16206876933574677,
-0.1109704002737999,
-0.31770893931388855,
-0.12100763618946075,
-0.22360070049762726,
0.11419333517551422,
-0.19208791851997375,
0.2854198217391968,
0.3454224169254303,
0.13973239064216614,
-0.20650871098041534,
-0.030798569321632385,
-0.025874610990285873,
0.11759257316589355,
-0.04451025277376175,
-0.20977386832237244,
0.335932195186615,
0.22425444424152374,
0.08440660685300827,
0.14054492115974426,
-0.13808317482471466,
-0.015026293694972992,
-0.3128477931022644,
0.0854463055729866,
0.16947375237941742,
0.20314419269561768,
-0.23785552382469177,
0.1697157621383667,
0.23741358518600464,
0.12760059535503387,
0.37566980719566345,
-0.16793273389339447,
-0.27533233165740967,
0.08146604895591736,
0.10171695798635483,
-0.11755311489105225,
-0.1406337469816208,
-0.06491632759571075,
0.26279500126838684,
0.16148069500923157,
0.14034375548362732,
0.024297788739204407,
0.15088295936584473,
-0.03472750633955002,
-0.06379621475934982,
0.5181642174720764,
-0.29047542810440063,
0.13554170727729797,
0.21092824637889862,
0.24587011337280273,
-0.02342855930328369,
0.10381421446800232,
-0.048712730407714844,
0.05335713177919388,
0.6160491704940796,
0.10105010867118835,
0.5914000868797302,
0.40471622347831726,
-0.024980857968330383,
-0.040993694216012955,
-0.1462762951850891,
-0.15333127975463867,
0.2363402545452118,
-0.332171231508255,
0.25219130516052246,
0.1533891260623932,
-0.09808170795440674,
0.1677229255437851,
-0.35052528977394104,
-0.16954004764556885,
0.13254685699939728,
-0.07912220060825348,
-0.10632172226905823,
-0.10719622671604156,
-0.10609660297632217,
0.10841390490531921,
0.3879632353782654,
-0.23653435707092285,
0.02478952705860138,
0.48339828848838806,
0.26575255393981934,
-0.23248997330665588,
0.06826088577508926,
-0.330044686794281,
-0.1476956456899643,
0.3486819863319397,
-0.0142831951379776,
0.023259559646248817,
0.37586870789527893,
-0.043449949473142624,
0.19138970971107483,
0.46360480785369873,
0.5555158257484436,
0.32091575860977173,
-0.09899634122848511,
0.11142252385616302,
0.05508192256093025,
0.08442430198192596,
-0.05954087898135185,
0.10516858100891113,
-0.21775169670581818,
-0.08641201257705688,
-0.08359958231449127,
0.04523039236664772,
-0.16116978228092194,
-0.1388319581747055,
-0.12053165584802628,
0.091746486723423,
-0.3309016525745392,
0.05988644063472748,
-0.1844356805086136,
0.20063762366771698,
-0.38104644417762756,
0.21089845895767212,
-0.4813942611217499,
0.0188872292637825,
0.46009111404418945,
-0.061176806688308716,
0.192305326461792,
-0.016461219638586044,
0.015651829540729523,
-0.14611515402793884,
0.2222827970981598,
0.17751245200634003,
0.16722922027111053,
-0.2981787919998169,
-0.03629172593355179,
-0.24779045581817627,
0.02079671621322632,
-0.41068217158317566,
0.01702515035867691,
-0.2622855007648468,
0.4300709664821625,
0.0824136883020401,
-0.09487567096948624,
0.4094104766845703,
-0.09859177470207214,
0.0735892653465271,
0.31589558720588684,
-0.3694809079170227,
-0.1449122428894043,
-0.12886929512023926,
0.00817522220313549,
0.04116986691951752,
-0.588625431060791,
0.09933792054653168,
0.1554728001356125,
0.02045266330242157,
-0.07661700248718262,
-0.044229984283447266,
0.06524764746427536,
0.3742445707321167,
0.3196042776107788,
0.21112042665481567,
0.32128316164016724,
-0.009130828082561493,
-0.20176741480827332,
-0.21055549383163452,
0.03516104072332382,
-0.08877349644899368,
0.20437419414520264,
0.1773139089345932,
0.13125568628311157,
-0.18425694108009338,
-0.21079687774181366,
0.015991002321243286,
0.28831857442855835,
0.030721589922904968,
-0.2614567279815674,
-0.25936341285705566,
0.13297367095947266,
-0.3267373740673065,
0.32309943437576294,
-0.16639739274978638,
0.5257086157798767,
0.09335703402757645,
0.1405094861984253,
-0.3576678931713104,
-0.4858326315879822,
0.6277881264686584,
-0.5178338885307312,
-0.3057704567909241,
-0.17797432839870453,
0.07377031445503235,
-0.029477689415216446,
0.27569276094436646,
-0.32329991459846497,
-0.03397359699010849,
0.12915630638599396,
-0.11339594423770905,
0.030053526163101196,
0.1953880786895752,
0.11254681646823883,
-0.07704434543848038,
0.012120544910430908,
0.28976795077323914,
0.031977180391550064,
-0.23974192142486572,
0.20652276277542114,
-0.038097117096185684
] |
https://github.com/huggingface/datasets/issues/5669 | I updated the transform with the NumPy -> PyTorch conversion.
I'm sharing the entire code:
```python
import cv2
import numpy as np
import datasets
import torch
from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("beans", split="train")
def transform(batch):
# # Pillow decodes as RGB
# batch["image"] = torch.stack([torch.from_numpy(cv2.cvtColor(cv2.imread(image_file_path), cv2.COLOR_BGR2RGB)) for image_file_path in batch["image_file_path"]])
batch["image"] = torch.stack([torch.from_numpy(cv2.imread(image_file_path)) for image_file_path in batch["image_file_path"]])
batch["labels"] = torch.tensor(batch["labels"])
return batch
dataset2 = dataset.cast_column("image", datasets.Image(decode=False)).with_transform(transform)
for x in DataLoader(dataset2, batch_size=16, shuffle=True, num_workers=8):
pass
```
This code is ≈ 10% faster on my machine than the default decoding with Pillow and `.with_format("torch")`. | Almost identical datasets, huge performance difference | ### Describe the bug
I am struggling to understand (huge) performance difference between two datasets that are almost identical.
### Steps to reproduce the bug
# Fast (normal) dataset speed:
```python
import cv2
from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("beans", split="train")
for x in DataLoader(dataset.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
The above pass over the dataset takes about 1.5 seconds on my computer.
However, if I re-create (almost) the same dataset, the sweep takes HUGE amount of time: 15 minutes. Steps to reproduce:
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"])
return example
dataset2 = dataset.map(transform, remove_columns=["image"])
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
### Expected behavior
Same timings
### Environment info
python==3.10.9
datasets==2.10.1 | 97 | Almost identical datasets, huge performance difference
### Describe the bug
I am struggling to understand (huge) performance difference between two datasets that are almost identical.
### Steps to reproduce the bug
# Fast (normal) dataset speed:
```python
import cv2
from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("beans", split="train")
for x in DataLoader(dataset.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
The above pass over the dataset takes about 1.5 seconds on my computer.
However, if I re-create (almost) the same dataset, the sweep takes HUGE amount of time: 15 minutes. Steps to reproduce:
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"])
return example
dataset2 = dataset.map(transform, remove_columns=["image"])
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
### Expected behavior
Same timings
### Environment info
python==3.10.9
datasets==2.10.1
I updated the transform with the NumPy -> PyTorch conversion.
I'm sharing the entire code:
```python
import cv2
import numpy as np
import datasets
import torch
from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("beans", split="train")
def transform(batch):
# # Pillow decodes as RGB
# batch["image"] = torch.stack([torch.from_numpy(cv2.cvtColor(cv2.imread(image_file_path), cv2.COLOR_BGR2RGB)) for image_file_path in batch["image_file_path"]])
batch["image"] = torch.stack([torch.from_numpy(cv2.imread(image_file_path)) for image_file_path in batch["image_file_path"]])
batch["labels"] = torch.tensor(batch["labels"])
return batch
dataset2 = dataset.cast_column("image", datasets.Image(decode=False)).with_transform(transform)
for x in DataLoader(dataset2, batch_size=16, shuffle=True, num_workers=8):
pass
```
This code is ≈ 10% faster on my machine than the default decoding with Pillow and `.with_format("torch")`. | [
-0.1086694598197937,
-0.3165908753871918,
-0.0370158776640892,
0.20473462343215942,
0.11170768737792969,
-0.0067077502608299255,
0.1725558638572693,
0.3824242651462555,
-0.3159745931625366,
0.21421703696250916,
0.011232253164052963,
0.6077688932418823,
-0.12937991321086884,
-0.3287797272205353,
-0.15708991885185242,
-0.12879663705825806,
0.3875378370285034,
0.03650464862585068,
-0.28083330392837524,
-0.3467360734939575,
-0.07850680500268936,
-0.2121591717004776,
-0.2261538803577423,
-0.34047573804855347,
-0.30156049132347107,
-0.00033804774284362793,
0.017238527536392212,
-0.08517467975616455,
0.013953972607851028,
-0.05140862986445427,
0.4081525504589081,
-0.10267874598503113,
0.034253187477588654,
0.5401812195777893,
-0.00012142759806010872,
-0.06862476468086243,
0.028474755585193634,
0.09510806947946548,
0.06403079628944397,
0.2270430028438568,
0.6320651173591614,
-0.31824028491973877,
-0.08027328550815582,
-0.2596598267555237,
-0.10560259222984314,
0.09377499669790268,
-0.27829113602638245,
-0.5752368569374084,
0.013252172619104385,
-0.01196739450097084,
0.1235598549246788,
0.2943626642227173,
-0.8101884126663208,
-0.03922001272439957,
0.2301093339920044,
-0.09561820328235626,
-0.2859121859073639,
-0.03486078232526779,
0.4839608669281006,
0.07615648955106735,
-0.28007471561431885,
0.5357367396354675,
-0.25760960578918457,
0.16900835931301117,
0.5205391049385071,
-0.024550432339310646,
-0.528305172920227,
-0.123161181807518,
0.11195629090070724,
0.1175139993429184,
-0.3115334212779999,
-0.022136325016617775,
-0.24069465696811676,
-0.4140988290309906,
-0.3353865146636963,
0.03901282697916031,
0.05990873649716377,
0.13244296610355377,
-0.05932377278804779,
-0.20793110132217407,
-0.6249611973762512,
0.4079461097717285,
0.11798008531332016,
-0.031736601144075394,
-0.13086725771427155,
-0.18451198935508728,
0.05009907856583595,
0.3043765127658844,
0.1725429892539978,
0.0205178614705801,
0.3364384174346924,
-0.2842782139778137,
0.1938774287700653,
0.11665699630975723,
-0.4360160827636719,
-0.10519914329051971,
0.2011895775794983,
-0.03800521790981293,
-0.06400630623102188,
-0.03846105933189392,
0.16906794905662537,
0.22725670039653778,
-0.08058957755565643,
-0.22458219528198242,
-0.19655653834342957,
0.29044488072395325,
-0.5257682204246521,
0.24573788046836853,
0.03606916964054108,
-0.2860848307609558,
-0.25102758407592773,
0.11298942565917969,
0.15775859355926514,
-0.31664636731147766,
0.26752036809921265,
0.06142702326178551,
0.11126244068145752,
-0.16669394075870514,
-0.5111837983131409,
-0.044025592505931854,
-0.17013144493103027,
-0.024663863703608513,
-0.05686735734343529,
0.32046252489089966,
-0.23767445981502533,
0.11956325173377991,
0.13617002964019775,
-0.00003816932439804077,
-0.38151976466178894,
0.07100972533226013,
-0.15984514355659485,
-0.01403050310909748,
-0.20593363046646118,
0.016579557210206985,
0.06569238007068634,
-0.408657044172287,
0.09635152667760849,
0.29294058680534363,
0.252517431974411,
0.2668302655220032,
0.3280750811100006,
-0.24049502611160278,
0.3857985734939575,
-0.19227755069732666,
-0.1394149214029312,
0.35529106855392456,
0.21267005801200867,
0.556586503982544,
-0.1565304547548294,
0.17201955616474152,
-0.23155982792377472,
-0.10570730268955231,
0.2693234384059906,
0.09781187772750854,
0.0056222304701805115,
-0.013999436050653458,
-0.16954509913921356,
-0.014725277200341225,
-0.0783374011516571,
-0.03902202472090721,
0.20227830111980438,
-0.23029452562332153,
-0.26688894629478455,
-0.26294928789138794,
-0.037869878113269806,
0.15808448195457458,
-0.04706687852740288,
0.07932918518781662,
0.41240713000297546,
0.4394221901893616,
0.47750619053840637,
0.5094350576400757,
-0.3167423903942108,
-0.19234873354434967,
-0.2822105288505554,
-0.3923878073692322,
0.14566868543624878,
-0.22549012303352356,
-0.23071949183940887,
0.21509692072868347,
-0.1503726691007614,
0.2669721245765686,
0.24239134788513184,
0.3271089792251587,
0.4663670063018799,
-0.23418709635734558,
-0.09045236557722092,
0.28939059376716614,
0.04494457691907883,
0.36362335085868835,
-0.3713051378726959,
-0.3091771602630615,
0.45928531885147095,
0.0004920214414596558,
-0.04734520986676216,
-0.11518320441246033,
-0.05232624337077141,
-0.041912991553545,
0.29951339960098267,
-0.2331497073173523,
-0.06056217476725578,
0.11188684403896332,
0.08414757996797562,
-0.16883012652397156,
-0.044324569404125214,
0.03900058567523956,
0.1107226312160492,
0.3195861876010895,
0.21640801429748535,
-0.10642719268798828,
0.22225454449653625,
-0.1800132691860199,
-0.11817918717861176,
-0.29423558712005615,
-0.20260865986347198,
-0.3437381088733673,
-0.05678645148873329,
0.1371157169342041,
0.2693915367126465,
-0.15699836611747742,
0.1360461413860321,
0.3125792443752289,
-0.0703243613243103,
0.014018122106790543,
-0.3241114020347595,
0.17790594696998596,
0.12071846425533295,
-0.14089849591255188,
-0.07002487778663635,
0.09012247622013092,
0.29214221239089966,
-0.21141524612903595,
-0.21833238005638123,
-0.06467629969120026,
-0.07163579761981964,
0.16887333989143372,
-0.04774213582277298,
0.09179434925317764,
0.17921563982963562,
-0.11780259758234024,
0.496194064617157,
0.49166786670684814,
0.19679374992847443,
0.030285879969596863,
-0.3673449158668518,
0.6846643090248108,
-0.09821998327970505,
0.20462745428085327,
-0.045195456594228745,
-0.1855420172214508,
0.019122086465358734,
0.12233288586139679,
0.2024376392364502,
0.10574796795845032,
0.3553962707519531,
0.24724707007408142,
0.6121624708175659,
0.21537606418132782,
-0.048110805451869965,
0.43706855177879333,
0.28210365772247314,
0.1940070539712906,
-0.35539019107818604,
0.010231675580143929,
-0.24066226184368134,
0.028742648661136627,
0.06044136732816696,
0.12052604556083679,
0.5198312997817993,
0.11124008893966675,
0.09732353687286377,
0.07646968215703964,
0.01807282492518425,
-0.04885292425751686,
0.16995441913604736,
-0.12079191207885742,
0.15186719596385956,
-0.11006007343530655,
0.3337409794330597,
0.2565772831439972,
-0.26125210523605347,
-0.09415045380592346,
0.08254888653755188,
0.0956275686621666,
0.08981596678495407,
0.2589348554611206,
-0.15046273171901703,
0.07086125016212463,
-0.38259822130203247,
0.1551743447780609,
0.11770549416542053,
-0.11188521981239319,
-0.227146714925766,
0.15041321516036987,
-0.026241451501846313,
0.12191257625818253,
-0.24325793981552124,
-0.02677053213119507,
0.18965283036231995,
-0.14973539113998413,
0.015154816210269928,
0.08421319723129272,
-0.22472815215587616,
-0.04822847619652748,
-0.07142268121242523,
-0.21145446598529816,
0.46543508768081665,
-0.031113650649785995,
0.03225287050008774,
-0.32083457708358765,
-0.337882399559021,
-0.012975780293345451,
-0.06250311434268951,
-0.09792102128267288,
-0.1279592216014862,
-0.027498718351125717,
-0.027022797614336014,
-0.19865141808986664,
0.16995397210121155,
-0.30702149868011475,
-0.2399643063545227,
0.01959872990846634,
-0.062467001378536224,
-0.09336376935243607,
0.07459931075572968,
-0.4578908681869507,
-0.09856825321912766,
-0.11158014833927155,
-0.19982540607452393,
-0.25915729999542236,
-0.047772713005542755,
0.04763806238770485,
0.10275503993034363,
-0.1317584067583084,
-0.012367483228445053,
0.09676505625247955,
-0.2278929501771927,
-0.4193975627422333,
0.25199124217033386,
0.05435165762901306,
-0.3506637215614319,
-0.3481486439704895,
-0.190328449010849,
-0.25517192482948303,
0.44897156953811646,
-0.3948931396007538,
-0.14342373609542847,
-0.6811549663543701,
0.4401991665363312,
-0.000649923225864768,
0.015390736982226372,
0.37221208214759827,
0.00035553425550460815,
-0.049667514860630035,
-0.21964143216609955,
-0.2687040865421295,
-0.35823142528533936,
0.049165550619363785,
0.11390432715415955,
-0.16764292120933533,
0.35110822319984436,
0.3055324852466583,
0.831778883934021,
0.27520066499710083,
-0.3314560651779175,
0.054931629449129105,
0.0165852103382349,
0.27649936079978943,
-0.2769753038883209,
-0.5646219253540039,
0.29656094312667847,
-0.235830157995224,
-0.13211391866207123,
0.0180823877453804,
-0.12434716522693634,
-0.16063454747200012,
0.07357824593782425,
-0.26473167538642883,
-0.02338261902332306,
-0.14843694865703583,
0.24808011949062347,
-0.17711582779884338,
-0.007026847451925278,
0.20254160463809967,
0.40913498401641846,
-0.5207270383834839,
-0.1188654974102974,
0.12844890356063843,
-0.01753213256597519,
0.18385910987854004,
-0.07118145376443863,
-0.32953232526779175,
-0.02524515613913536,
-0.3997049331665039,
0.25759902596473694,
0.06927112489938736,
0.24656514823436737,
0.3269421458244324,
-0.2645823061466217,
0.17061908543109894,
0.005519948899745941,
0.6037263870239258,
0.11570773273706436,
0.1942097395658493,
-0.043377190828323364,
-0.489737331867218,
-0.4759078621864319,
-0.2726724445819855,
-0.1521456390619278,
0.081151083111763,
0.4387175738811493,
0.24392299354076385,
0.1337892711162567,
-0.13490667939186096,
0.18824823200702667,
0.3490886986255646,
0.034650206565856934,
0.09987276792526245,
-0.216850146651268,
-0.2284497618675232,
-0.07341382652521133,
-0.05487982928752899,
-0.2077123522758484,
0.1837044507265091,
-0.2630031108856201,
-0.08709144592285156,
-0.2291356474161148,
0.07578210532665253,
0.1901005655527115,
0.20175762474536896,
0.3519321382045746,
0.09798777103424072,
0.5466277599334717,
-0.033511362969875336,
0.576364278793335,
-0.06855591386556625,
0.4715607464313507,
-0.11169685423374176,
-0.3092677891254425,
-0.05133412033319473,
-0.03294283151626587,
0.1048060953617096,
0.5361976027488708,
-0.08074149489402771,
0.28166505694389343,
-0.3225729763507843,
0.0607232004404068,
-0.25278037786483765,
0.09627009183168411,
0.3973437547683716,
0.2479705661535263,
-0.1171550527215004,
-0.351329505443573,
0.2782401442527771,
0.3740856349468231,
-0.21021807193756104,
0.2962251603603363,
-0.30843764543533325,
0.09562071412801743,
0.38083285093307495,
0.005680117756128311,
0.9173163771629333,
0.057547427713871,
0.3759021461009979,
0.0835593193769455,
-0.09887614846229553,
0.2743065655231476,
0.13106375932693481,
0.20753200352191925,
-0.3035781979560852,
-0.3695532977581024,
0.06093131750822067,
-0.26339858770370483,
0.04511287808418274,
-0.18289786577224731,
0.13123801350593567,
0.22524181008338928,
-0.004815161228179932,
0.17571958899497986,
-0.2914299964904785,
-0.17405816912651062,
-0.09213176369667053,
-0.18984870612621307,
0.09099961817264557,
0.0781119167804718,
0.13263440132141113,
0.3705289661884308,
0.07696941494941711,
0.09427562355995178,
-0.41987496614456177,
-0.18881699442863464,
-0.29430896043777466,
0.08114250004291534,
-0.19096119701862335,
0.28976255655288696,
0.015971487388014793,
-0.5931719541549683,
0.09215924143791199,
-0.0015059434808790684,
0.2531512975692749,
-0.07773653417825699,
0.11296724528074265,
0.22334912419319153,
0.0797739177942276,
0.40592217445373535,
0.37402281165122986,
-0.4766039252281189,
0.18052314221858978,
0.07640492171049118,
-0.12102208286523819,
-0.003778291866183281,
-0.15385475754737854,
-0.14198239147663116,
-0.15993642807006836,
0.5025373101234436,
0.021254349499940872,
-0.15736500918865204,
-0.3074133098125458,
0.004034847021102905,
-0.044444069266319275,
-0.22611159086227417,
0.01667243242263794,
0.018760213628411293,
0.015433158725500107,
0.5644738078117371,
0.00782034918665886,
-0.5522665977478027,
0.07670210301876068,
0.38111627101898193,
0.3663616180419922,
-0.2781534194946289,
0.401162713766098,
-0.25483936071395874,
-0.1646527200937271,
0.033883653581142426,
0.3143705725669861,
0.17201125621795654,
-0.4552639126777649,
0.2386491298675537,
-0.3944159746170044,
0.02637295424938202,
0.12580963969230652,
0.09590931236743927,
-0.05911312997341156,
0.16296929121017456,
-0.2208515703678131,
-0.008311852812767029,
-0.10883656144142151,
-0.16103647649288177,
-0.04345979169011116,
0.0664738267660141,
-0.16514375805854797,
0.18092170357704163,
-0.11815893650054932,
0.03317950665950775,
-0.20656466484069824,
0.20582807064056396,
0.29125964641571045,
0.3187166750431061,
-0.21307961642742157,
-0.07743507623672485,
-0.034397438168525696,
-0.07688479125499725,
-0.06653635203838348,
0.1642744541168213,
-0.05714535713195801,
-0.12302648276090622,
-0.21512918174266815,
0.15417176485061646,
-0.13634058833122253,
-0.2994053363800049,
-0.18532899022102356,
-0.13543686270713806,
0.1769479662179947,
-0.2088589072227478,
0.3991835117340088,
0.40342292189598083,
0.13023090362548828,
-0.10951337218284607,
0.05372968316078186,
-0.20293593406677246,
0.14052540063858032,
0.01703318953514099,
-0.21993273496627808,
0.3141835331916809,
0.13170126080513,
-0.009728946723043919,
0.2379709929227829,
-0.11385133117437363,
-0.001272737979888916,
-0.2389402687549591,
0.053649697452783585,
0.19730578362941742,
0.14296045899391174,
-0.20325292646884918,
0.20537355542182922,
0.16598813235759735,
0.04086728394031525,
0.3966977000236511,
-0.10316735506057739,
-0.2558818459510803,
0.029326174408197403,
0.058417946100234985,
-0.22815197706222534,
-0.1201072633266449,
-0.05050647258758545,
0.1744678020477295,
0.25987815856933594,
0.13827867805957794,
-0.053998950868844986,
0.17223316431045532,
0.057285647839307785,
-0.128548264503479,
0.524418294429779,
-0.22278401255607605,
0.1163560301065445,
0.26230767369270325,
0.3697623908519745,
-0.13950607180595398,
0.2737995982170105,
-0.06418895721435547,
0.029553011059761047,
0.5652656555175781,
0.1538698673248291,
0.6504949927330017,
0.3804490566253662,
0.03452892601490021,
-0.014846719801425934,
-0.20592911541461945,
-0.030776623636484146,
0.3057782053947449,
-0.2657334506511688,
0.1466837227344513,
0.1587851196527481,
-0.04393875226378441,
0.09205178916454315,
-0.3830125033855438,
-0.1397314816713333,
0.11262023448944092,
-0.07207335531711578,
-0.13527339696884155,
-0.03958511725068092,
-0.09057936072349548,
0.11117047071456909,
0.34466904401779175,
-0.20111903548240662,
-0.024973392486572266,
0.5671751499176025,
0.1978561282157898,
-0.2599262595176697,
-0.03710057586431503,
-0.15791228413581848,
-0.07929624617099762,
0.27405261993408203,
0.058702319860458374,
0.06372150033712387,
0.4275389015674591,
0.01811125874519348,
0.24206115305423737,
0.4528828561306,
0.5360192060470581,
0.26717373728752136,
-0.1719856709241867,
0.19142919778823853,
0.007294829934835434,
0.02692893147468567,
0.07140186429023743,
0.03372810781002045,
-0.32837677001953125,
-0.04166175425052643,
-0.023173443973064423,
0.026457950472831726,
-0.13169129192829132,
-0.05527589097619057,
-0.07076755166053772,
-0.07554113864898682,
-0.28147560358047485,
0.2769000828266144,
-0.266296923160553,
0.11291646957397461,
-0.32653775811195374,
0.20391187071800232,
-0.35825812816619873,
-0.08139441907405853,
0.39335423707962036,
-0.03720618039369583,
0.13374778628349304,
0.014509838074445724,
0.016964271664619446,
-0.054454635828733444,
0.25537410378456116,
0.1502993106842041,
0.12567533552646637,
-0.2955280840396881,
-0.12954095005989075,
-0.3321005702018738,
0.048207059502601624,
-0.42507970333099365,
-0.0009861961007118225,
-0.2919638156890869,
0.3089512288570404,
0.11453492939472198,
-0.037592023611068726,
0.36245813965797424,
0.08655498921871185,
0.1831488311290741,
0.23452803492546082,
-0.36308538913726807,
-0.146603524684906,
-0.00007423199713230133,
-0.09530390799045563,
0.05008762329816818,
-0.5815262794494629,
0.08348429203033447,
0.2400524616241455,
0.03991665691137314,
-0.06514258682727814,
0.007569625973701477,
0.07846429198980331,
0.17657656967639923,
0.2955692410469055,
0.22738893330097198,
0.37261924147605896,
0.06656040251255035,
-0.15688230097293854,
-0.12404583394527435,
0.085805743932724,
-0.010008338838815689,
0.20704621076583862,
0.23592187464237213,
0.18674838542938232,
-0.006349470466375351,
-0.24880318343639374,
0.10083471238613129,
0.43772152066230774,
0.02444818615913391,
-0.307233989238739,
-0.23705606162548065,
0.1750231683254242,
-0.27949488162994385,
0.41284939646720886,
-0.23953202366828918,
0.436280757188797,
0.06179022043943405,
0.17925307154655457,
-0.4067172706127167,
-0.47483816742897034,
0.595883846282959,
-0.3899136483669281,
-0.3073487877845764,
-0.22219787538051605,
0.1553363800048828,
-0.11353689432144165,
0.17862266302108765,
-0.28199154138565063,
-0.0261802077293396,
0.15244661271572113,
-0.13122135400772095,
0.17734508216381073,
0.19794481992721558,
0.01648799329996109,
-0.09417609870433807,
-0.0362691804766655,
0.4533001482486725,
-0.001358943060040474,
-0.14112761616706848,
0.17573565244674683,
-0.02104010060429573
] |
https://github.com/huggingface/datasets/issues/5669 | Thanks, @mariosasko
My question remain unanswered though. Why is the `map`ed dataset so slow? My understanding is that a dataset of numpy arrays should be must faster than a dataset that has to decode images into numpy arrays every time one accesses an item. | Almost identical datasets, huge performance difference | ### Describe the bug
I am struggling to understand (huge) performance difference between two datasets that are almost identical.
### Steps to reproduce the bug
# Fast (normal) dataset speed:
```python
import cv2
from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("beans", split="train")
for x in DataLoader(dataset.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
The above pass over the dataset takes about 1.5 seconds on my computer.
However, if I re-create (almost) the same dataset, the sweep takes HUGE amount of time: 15 minutes. Steps to reproduce:
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"])
return example
dataset2 = dataset.map(transform, remove_columns=["image"])
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
### Expected behavior
Same timings
### Environment info
python==3.10.9
datasets==2.10.1 | 44 | Almost identical datasets, huge performance difference
### Describe the bug
I am struggling to understand (huge) performance difference between two datasets that are almost identical.
### Steps to reproduce the bug
# Fast (normal) dataset speed:
```python
import cv2
from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("beans", split="train")
for x in DataLoader(dataset.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
The above pass over the dataset takes about 1.5 seconds on my computer.
However, if I re-create (almost) the same dataset, the sweep takes HUGE amount of time: 15 minutes. Steps to reproduce:
```python
def transform(example):
example["image2"] = cv2.imread(example["image_file_path"])
return example
dataset2 = dataset.map(transform, remove_columns=["image"])
for x in DataLoader(dataset2.with_format("torch"), batch_size=16, shuffle=True, num_workers=8):
pass
```
### Expected behavior
Same timings
### Environment info
python==3.10.9
datasets==2.10.1
Thanks, @mariosasko
My question remain unanswered though. Why is the `map`ed dataset so slow? My understanding is that a dataset of numpy arrays should be must faster than a dataset that has to decode images into numpy arrays every time one accesses an item. | [
-0.09605950117111206,
-0.22668693959712982,
-0.11022147536277771,
0.26627662777900696,
0.2136155068874359,
0.205649733543396,
0.2483494132757187,
0.3349485397338867,
-0.05455964058637619,
0.16616234183311462,
-0.12629826366901398,
0.6400960087776184,
-0.16121694445610046,
-0.29643967747688293,
-0.19088514149188995,
-0.08059272170066833,
0.44849884510040283,
0.11466073989868164,
-0.3271494209766388,
-0.4344009757041931,
-0.15819233655929565,
-0.26823893189430237,
-0.1943035125732422,
-0.3794185519218445,
-0.1860300898551941,
-0.11803131550550461,
0.06630399078130722,
-0.20313897728919983,
-0.19126266241073608,
-0.13795240223407745,
0.2832435965538025,
-0.14607585966587067,
-0.05425890535116196,
0.6030304431915283,
-0.00012184283696115017,
0.07692958414554596,
0.07922108471393585,
0.12422901391983032,
0.06363621354103088,
0.22209598124027252,
0.3787185847759247,
-0.3960241675376892,
-0.06295406818389893,
-0.272409051656723,
0.004213437438011169,
-0.0241563580930233,
-0.055017001926898956,
-0.6345092058181763,
0.11280867457389832,
-0.06865868717432022,
0.0973462164402008,
0.17941486835479736,
-0.7006286382675171,
0.06257939338684082,
0.14575564861297607,
-0.05876288563013077,
-0.34289175271987915,
0.029054168611764908,
0.4255675673484802,
-0.0012212283909320831,
-0.1859070360660553,
0.46543675661087036,
-0.23443229496479034,
0.1779707372188568,
0.48738062381744385,
0.06363928318023682,
-0.3982161581516266,
-0.26491615176200867,
0.07587739825248718,
0.2062472254037857,
-0.11104433238506317,
-0.05958762764930725,
-0.31431806087493896,
-0.40515050292015076,
-0.420013964176178,
0.18720312416553497,
0.012473642826080322,
0.11891670525074005,
0.0033311471343040466,
-0.1463017761707306,
-0.7839235067367554,
0.39789706468582153,
0.20229139924049377,
0.06189541891217232,
-0.1471816599369049,
-0.18535298109054565,
0.16323408484458923,
0.36548516154289246,
0.17743054032325745,
0.0009324364364147186,
0.39662301540374756,
-0.3496803641319275,
0.3032275438308716,
0.2270064651966095,
-0.33351412415504456,
-0.1396973878145218,
0.14821219444274902,
-0.09336039423942566,
0.026507198810577393,
-0.20604997873306274,
0.1184481605887413,
0.1694667935371399,
-0.2925041615962982,
-0.10630261898040771,
-0.07376520335674286,
0.2646740972995758,
-0.4868040382862091,
0.29784342646598816,
-0.009766094386577606,
-0.30933722853660583,
-0.311311274766922,
0.06662803143262863,
0.1765710711479187,
-0.1385326236486435,
0.23377470672130585,
-0.0542219802737236,
0.05326782912015915,
-0.030549943447113037,
-0.3633725047111511,
-0.04448823630809784,
-0.2534484267234802,
-0.07305308431386948,
-0.17655645310878754,
0.23810744285583496,
-0.10659349709749222,
0.07541556656360626,
-0.05824579298496246,
0.0889434888958931,
-0.26969966292381287,
0.13955622911453247,
-0.13342289626598358,
-0.07769215106964111,
-0.2208804488182068,
0.016663748770952225,
0.025697700679302216,
-0.17625437676906586,
0.15981797873973846,
0.23476329445838928,
-0.006536489352583885,
0.3467710018157959,
0.3473125696182251,
-0.31429657340049744,
0.4044221341609955,
-0.11185573786497116,
-0.015173196792602539,
0.46648716926574707,
0.21323591470718384,
0.5108903646469116,
-0.21547044813632965,
0.19135639071464539,
-0.3697298765182495,
-0.022633880376815796,
0.48733237385749817,
0.054732825607061386,
0.03868650645017624,
0.011551408097147942,
-0.1705550104379654,
0.032556984573602676,
-0.1487915813922882,
-0.21956396102905273,
0.1753222942352295,
-0.1443803608417511,
-0.3139820098876953,
-0.34897559881210327,
-0.2342504858970642,
0.1421729475259781,
-0.17711681127548218,
0.1716834157705307,
0.29609084129333496,
0.311037540435791,
0.4107922911643982,
0.5513441562652588,
-0.31153178215026855,
-0.09997013211250305,
-0.2542291283607483,
-0.18553200364112854,
0.1310373991727829,
-0.20296642184257507,
-0.29917725920677185,
0.32715344429016113,
0.0021266937255859375,
0.30396145582199097,
0.1946655958890915,
0.4735298752784729,
0.42832690477371216,
-0.18557624518871307,
-0.10967202484607697,
0.33306068181991577,
0.05740216374397278,
0.29014790058135986,
-0.29666149616241455,
-0.35172757506370544,
0.5205531716346741,
-0.0070042684674263,
-0.15888500213623047,
0.0030697956681251526,
0.09762848913669586,
-0.13782280683517456,
0.30356723070144653,
-0.18308503925800323,
-0.15829190611839294,
0.11822111904621124,
0.045362092554569244,
-0.23180630803108215,
-0.06503916531801224,
0.13555262982845306,
0.00322152953594923,
0.36267518997192383,
0.2356468141078949,
-0.1455245316028595,
0.14914025366306305,
-0.07580013573169708,
-0.11531677842140198,
-0.18163982033729553,
-0.21476835012435913,
-0.28765246272087097,
-0.060573119670152664,
0.06950071454048157,
0.20456993579864502,
-0.132561594247818,
0.12276571244001389,
0.23782825469970703,
-0.05672213435173035,
0.013525553047657013,
-0.3478984832763672,
0.14824283123016357,
0.1305612176656723,
-0.0661613717675209,
-0.22624370455741882,
-0.010250944644212723,
0.07633818686008453,
-0.20470817387104034,
-0.18646453320980072,
0.006259062327444553,
0.13489972054958344,
0.18413300812244415,
0.028761425986886024,
0.17030668258666992,
0.1680394858121872,
-0.19176004827022552,
0.5543813109397888,
0.5527573823928833,
0.2596692740917206,
-0.15057992935180664,
-0.41513651609420776,
0.552992582321167,
-0.10771669447422028,
0.3415067791938782,
0.044793859124183655,
-0.1081169918179512,
0.040284425020217896,
0.21581579744815826,
0.2094939798116684,
-0.025717653334140778,
0.2641598582267761,
0.1435214877128601,
0.6144043803215027,
0.3312106132507324,
0.07212212681770325,
0.30071696639060974,
0.3480278253555298,
0.19650661945343018,
-0.3140433430671692,
-0.06034580245614052,
-0.17600813508033752,
0.047308094799518585,
0.050566576421260834,
0.10106107592582703,
0.5639086365699768,
0.03084469959139824,
0.06678786128759384,
0.11178358644247055,
0.08931750059127808,
0.017745036631822586,
0.16037680208683014,
-0.06127616763114929,
0.2842493951320648,
-0.14439931511878967,
0.27838170528411865,
0.20134836435317993,
-0.2045646607875824,
-0.08129197359085083,
-0.010621964931488037,
0.0527556911110878,
0.2181759923696518,
0.18106625974178314,
-0.06985336542129517,
0.07678797096014023,
-0.3565305471420288,
0.06355038285255432,
0.009170563891530037,
-0.14437273144721985,
-0.23377282917499542,
0.043362341821193695,
0.05563129484653473,
0.15933144092559814,
-0.16759493947029114,
-0.11880642175674438,
0.21804708242416382,
-0.09798069298267365,
0.0634990930557251,
-0.011428825557231903,
-0.07432132214307785,
-0.07076507061719894,
0.02886485680937767,
-0.16014577448368073,
0.27176976203918457,
-0.0677376538515091,
0.02045084536075592,
-0.27527111768722534,
-0.3510672450065613,
-0.0002898219972848892,
-0.13305261731147766,
-0.015794776380062103,
-0.04555010423064232,
0.11896414309740067,
-0.11409801244735718,
-0.14394651353359222,
0.1498696655035019,
-0.3630722463130951,
-0.2502906322479248,
-0.011645451188087463,
0.02864248678088188,
-0.17024454474449158,
0.13240870833396912,
-0.43096667528152466,
-0.20264995098114014,
-0.09621080756187439,
-0.023577354848384857,
-0.13594278693199158,
0.001019580289721489,
0.051632288843393326,
0.23130540549755096,
-0.1521620899438858,
-0.016384299844503403,
0.11849316209554672,
-0.2033737301826477,
-0.3801238536834717,
0.28447097539901733,
0.1090540736913681,
-0.31919729709625244,
-0.3672783672809601,
-0.1731492280960083,
-0.20460382103919983,
0.558386504650116,
-0.4050583243370056,
-0.04623430594801903,
-0.6159409284591675,
0.21119233965873718,
0.04169996455311775,
0.10545086860656738,
0.31498974561691284,
0.042343851178884506,
-0.007208563387393951,
-0.3104463815689087,
-0.22302499413490295,
-0.33522069454193115,
0.06747104972600937,
0.10565100610256195,
-0.026146601885557175,
0.4220218062400818,
0.20457234978675842,
0.7491293549537659,
0.39177682995796204,
-0.23589326441287994,
0.08024449646472931,
0.04873940348625183,
0.32413461804389954,
-0.3638591170310974,
-0.49089983105659485,
0.21223066747188568,
-0.13667501509189606,
-0.30250439047813416,
0.08232298493385315,
-0.05118696019053459,
-0.3348451554775238,
0.08153349161148071,
-0.055259235203266144,
-0.08644378185272217,
-0.0774230808019638,
0.26648247241973877,
-0.1334884762763977,
-0.02694885805249214,
0.24614670872688293,
0.42370960116386414,
-0.541371762752533,
-0.17751038074493408,
0.023261219263076782,
-0.15547749400138855,
0.21679838001728058,
-0.10071763396263123,
-0.3793033957481384,
-0.170961394906044,
-0.36273670196533203,
0.2249680906534195,
0.11645060032606125,
0.36232733726501465,
0.24748729169368744,
-0.246443510055542,
0.2795708477497101,
0.14384505152702332,
0.7144006490707397,
-0.1331947296857834,
0.06858230382204056,
-0.02938758209347725,
-0.28162944316864014,
-0.4938541650772095,
-0.1483571082353592,
-0.14726629853248596,
0.12211810797452927,
0.3451372981071472,
0.31687021255493164,
0.1598835587501526,
-0.04173978418111801,
0.06331208348274231,
0.38907068967819214,
0.04693590849637985,
0.05719956383109093,
-0.2248295694589615,
-0.04442126303911209,
-0.08519536256790161,
-0.278804212808609,
-0.2798424959182739,
-0.06650156527757645,
-0.03808147460222244,
-0.10639376938343048,
-0.2960839569568634,
0.19991730153560638,
0.16531169414520264,
0.24490106105804443,
0.34734347462654114,
0.12667623162269592,
0.5050539374351501,
0.034933388233184814,
0.3950079381465912,
-0.01833318918943405,
0.5167949795722961,
-0.31040158867836,
-0.1262253373861313,
-0.14519040286540985,
-0.07335676997900009,
0.05035299062728882,
0.4867438077926636,
-0.005049318075180054,
0.041776664555072784,
-0.274827241897583,
-0.09837071597576141,
-0.2455362230539322,
0.007179770618677139,
0.4159265160560608,
0.18531620502471924,
-0.20362229645252228,
-0.5075839757919312,
0.3563934564590454,
0.4743855595588684,
-0.22229786217212677,
0.32630017399787903,
-0.4008771777153015,
0.12776049971580505,
0.5172125101089478,
0.04911746829748154,
0.8628101348876953,
-0.14072920382022858,
0.40920794010162354,
0.01885269582271576,
-0.0005049481987953186,
0.18253986537456512,
-0.015900850296020508,
0.17974969744682312,
-0.24880343675613403,
-0.38373422622680664,
-0.0502159483730793,
-0.24810174107551575,
0.011618224903941154,
0.10093697160482407,
0.1362888514995575,
0.24316516518592834,
0.12682262063026428,
0.31840914487838745,
-0.3443598747253418,
-0.223296657204628,
-0.028590405359864235,
-0.08716099709272385,
0.06941798329353333,
0.05053076893091202,
0.1634296327829361,
0.2468705177307129,
0.10988815873861313,
0.05622370168566704,
-0.45616912841796875,
-0.07337728887796402,
-0.17993639409542084,
-0.08062533289194107,
-0.19162485003471375,
0.5109328031539917,
0.05860253423452377,
-0.49283289909362793,
0.03795691579580307,
0.14908967912197113,
0.05806542932987213,
-0.0868486762046814,
0.047449640929698944,
0.13766995072364807,
0.23159490525722504,
0.379077672958374,
0.3597457706928253,
-0.4355145990848541,
0.2628061771392822,
0.12924478948116302,
0.038710206747055054,
-0.08562071621417999,
-0.27111300826072693,
-0.19157665967941284,
-0.4050896465778351,
0.5308738350868225,
0.14640294015407562,
-0.178997203707695,
-0.40182697772979736,
-0.012736212462186813,
-0.16007700562477112,
-0.1146111860871315,
0.003407844342291355,
-0.04072091728448868,
0.19812771677970886,
0.7074264287948608,
0.04986269772052765,
-0.5650720596313477,
0.09170199930667877,
0.3828139007091522,
0.3791733980178833,
-0.30408215522766113,
0.3614806830883026,
-0.3248208165168762,
-0.2042408287525177,
-0.01142420619726181,
0.38627368211746216,
0.20520401000976562,
-0.31202998757362366,
0.12226750701665878,
-0.4637942314147949,
0.06845711171627045,
0.09697780013084412,
-0.06274288892745972,
-0.055725276470184326,
0.20518553256988525,
-0.2520667016506195,
-0.12568576633930206,
-0.16740572452545166,
-0.030253086239099503,
-0.07735815644264221,
0.08684785664081573,
-0.22315701842308044,
-0.055827632546424866,
-0.08456426858901978,
0.050657398998737335,
-0.17795848846435547,
0.24920174479484558,
0.2918543219566345,
0.2785992920398712,
-0.15812255442142487,
-0.015998421236872673,
-0.056384798139333725,
-0.1338139772415161,
-0.06491220742464066,
0.04123940318822861,
-0.2312743365764618,
-0.08644425868988037,
-0.032585225999355316,
0.21000948548316956,
-0.13063868880271912,
-0.29699549078941345,
-0.07826439291238785,
-0.2044774740934372,
0.10659328103065491,
-0.33997151255607605,
0.15687599778175354,
0.2940347194671631,
0.06349314749240875,
-0.20546920597553253,
0.09549243003129959,
-0.04221373796463013,
0.05005231499671936,
0.05427203327417374,
-0.35225024819374084,
0.2960517406463623,
0.08310061693191528,
-0.05521880090236664,
0.26014870405197144,
-0.13379152119159698,
0.05440416559576988,
-0.20206308364868164,
0.13341335952281952,
0.18603433668613434,
0.2933585047721863,
-0.17485761642456055,
0.3673822283744812,
0.2688414454460144,
0.18376386165618896,
0.37440061569213867,
-0.12816497683525085,
-0.22654107213020325,
0.056290652602910995,
0.029197579249739647,
-0.16755369305610657,
-0.1704634726047516,
0.26064372062683105,
0.19572708010673523,
0.19199346005916595,
0.1445210874080658,
0.1018056869506836,
0.24131430685520172,
-0.032782673835754395,
-0.16639530658721924,
0.4743349850177765,
-0.28158870339393616,
0.11594298481941223,
0.44607940316200256,
0.36568203568458557,
-0.13776230812072754,
0.21017199754714966,
0.035100314766168594,
0.046454545110464096,
0.7195600271224976,
0.05100645869970322,
0.6979788541793823,
0.3532782793045044,
-0.09598952531814575,
-0.005600612610578537,
-0.1910000443458557,
0.021604305133223534,
0.3849406838417053,
-0.3004758954048157,
0.24388331174850464,
0.20523756742477417,
0.002763412892818451,
-0.013847213238477707,
-0.30775731801986694,
-0.05789254978299141,
0.09974507987499237,
0.004504484124481678,
-0.11076480150222778,
0.0780276283621788,
-0.055982060730457306,
0.0254562646150589,
0.28106117248535156,
-0.332535058259964,
-0.17854973673820496,
0.685669481754303,
0.16101832687854767,
-0.18403194844722748,
-0.18912388384342194,
-0.0539577417075634,
-0.12141034752130508,
0.2904040813446045,
-0.00375230610370636,
-0.007581800222396851,
0.10247982293367386,
0.08518081903457642,
0.15544983744621277,
0.445711225271225,
0.5493097305297852,
0.3240225315093994,
-0.1409764289855957,
0.19967056810855865,
-0.019193068146705627,
-0.06151435151696205,
0.005294807255268097,
0.07013308256864548,
-0.34711429476737976,
-0.04051975905895233,
-0.014894437044858932,
0.005288522690534592,
-0.0880775898694992,
-0.14141061902046204,
0.005055349785834551,
0.040399350225925446,
-0.21231967210769653,
0.09320811927318573,
-0.3077344000339508,
0.05063643306493759,
-0.19163930416107178,
0.13983753323554993,
-0.4716055989265442,
-0.11338174343109131,
0.3505145311355591,
-0.11776845157146454,
0.16154451668262482,
0.0031778477132320404,
-0.005077345296740532,
-0.14437679946422577,
0.25139474868774414,
0.25651904940605164,
0.146186962723732,
-0.33363479375839233,
-0.13081297278404236,
-0.4117767810821533,
-0.01289980486035347,
-0.5108080506324768,
0.058310627937316895,
-0.28743666410446167,
0.3011719882488251,
0.07961460202932358,
0.03850661218166351,
0.3502323627471924,
0.1250876784324646,
0.025059647858142853,
0.31132206320762634,
-0.3136010766029358,
-0.1952751725912094,
-0.029268842190504074,
-0.08698753267526627,
-0.06535349786281586,
-0.5059322118759155,
0.15128222107887268,
0.11403539776802063,
-0.012088339775800705,
-0.05428812652826309,
0.11164200305938721,
-0.017842721194028854,
0.2939322292804718,
0.38674673438072205,
0.2208351194858551,
0.3003683090209961,
0.029304467141628265,
-0.18340015411376953,
-0.18362002074718475,
0.014890596270561218,
0.05489243194460869,
0.312950998544693,
0.22191466391086578,
0.17221678793430328,
-0.2159932255744934,
-0.22236332297325134,
0.13069972395896912,
0.2535823583602905,
-0.05815831571817398,
-0.14401039481163025,
-0.24057534337043762,
0.16232551634311676,
-0.356390118598938,
0.39500677585601807,
-0.1894599199295044,
0.366048663854599,
0.13252750039100647,
0.10514628887176514,
-0.2784201204776764,
-0.4565731883049011,
0.48533523082733154,
-0.3231583535671234,
-0.31938818097114563,
-0.13023847341537476,
-0.05175688862800598,
-0.13231733441352844,
0.2501373291015625,
-0.3855039179325104,
0.011765003204345703,
0.20953810214996338,
-0.17261888086795807,
0.11114548146724701,
0.16701114177703857,
0.08330436795949936,
-0.1274441033601761,
-0.03017091378569603,
0.40824782848358154,
-0.07078257203102112,
-0.21955054998397827,
0.25093841552734375,
0.029112018644809723
] |
https://github.com/huggingface/datasets/issues/5660 | You can convert any dataset to pandas to be used with imbalanced-learn using `.to_pandas()`
Otherwise if you want to keep a `Dataset` object and still use e.g. [make_imbalance](https://imbalanced-learn.org/stable/references/generated/imblearn.datasets.make_imbalance.html#imblearn.datasets.make_imbalance), you just need to pass the list of rows ids and labels:
```python
row_indices = list(range(len(dataset)))
resampled_row_indices, _ = make_imbalance(
row_indices,
dataset["label"],
sampling_strategy={0: 25, 1: 50, 2: 50},
random_state=RANDOM_STATE,
)
resampled_dataset = dataset.select(resampled_row_indices)
``` | integration with imbalanced-learn | ### Feature request
Wouldn't it be great if the various class balancing operations from imbalanced-learn were available as part of datasets?
### Motivation
I'm trying to use imbalanced-learn to balance a dataset, but it's not clear how to get the two to interoperate - what would be great would be some examples. I've looked online, asked gpt-4, but so far not making much progress.
### Your contribution
If I can get this working myself I can submit a PR with example code to go in the docs | 62 | integration with imbalanced-learn
### Feature request
Wouldn't it be great if the various class balancing operations from imbalanced-learn were available as part of datasets?
### Motivation
I'm trying to use imbalanced-learn to balance a dataset, but it's not clear how to get the two to interoperate - what would be great would be some examples. I've looked online, asked gpt-4, but so far not making much progress.
### Your contribution
If I can get this working myself I can submit a PR with example code to go in the docs
You can convert any dataset to pandas to be used with imbalanced-learn using `.to_pandas()`
Otherwise if you want to keep a `Dataset` object and still use e.g. [make_imbalance](https://imbalanced-learn.org/stable/references/generated/imblearn.datasets.make_imbalance.html#imblearn.datasets.make_imbalance), you just need to pass the list of rows ids and labels:
```python
row_indices = list(range(len(dataset)))
resampled_row_indices, _ = make_imbalance(
row_indices,
dataset["label"],
sampling_strategy={0: 25, 1: 50, 2: 50},
random_state=RANDOM_STATE,
)
resampled_dataset = dataset.select(resampled_row_indices)
``` | [
-0.4059140682220459,
-0.0036018192768096924,
-0.10110694169998169,
0.21088753640651703,
0.1698371022939682,
0.2346896529197693,
0.4644748568534851,
-0.06730081140995026,
0.11677782982587814,
-0.1608097404241562,
-0.5748015642166138,
0.3132125437259674,
0.037380628287792206,
0.3158548176288605,
-0.01433568075299263,
-0.18436190485954285,
0.08671616017818451,
0.018325354903936386,
-0.33618420362472534,
0.10674095153808594,
-0.03980627283453941,
0.1171334907412529,
-0.22552809119224548,
0.15255427360534668,
-0.17833936214447021,
-0.10242073237895966,
-0.07105473428964615,
0.08737573027610779,
-0.12218626588582993,
0.15095233917236328,
0.6976845860481262,
0.5076029300689697,
0.12111319601535797,
0.5652078986167908,
-0.00011483726848382503,
-0.22571080923080444,
0.20448407530784607,
0.06821984797716141,
-0.2441389560699463,
-0.1429837942123413,
-0.12799379229545593,
-0.2991691827774048,
-0.04719410836696625,
-0.2636200189590454,
-0.04624033346772194,
-0.16777552664279938,
-0.25490304827690125,
-0.2373388409614563,
0.09444262087345123,
-0.15260964632034302,
0.09398898482322693,
-0.021038353443145752,
0.19836920499801636,
-0.1679701805114746,
0.010216522961854935,
0.04717358201742172,
0.16500148177146912,
0.5357515811920166,
0.2776680290699005,
-0.20962019264698029,
0.5132601261138916,
-0.0449574813246727,
-0.10254056006669998,
-0.032272692769765854,
0.2845518887042999,
-0.13359911739826202,
-0.31009623408317566,
-0.09423772245645523,
-0.25667667388916016,
0.16547054052352905,
0.46539849042892456,
-0.39347413182258606,
-0.32690930366516113,
-0.6618431210517883,
0.3011990189552307,
-0.28928184509277344,
-0.09974255412817001,
-0.17611181735992432,
0.2711392045021057,
0.24254964292049408,
-0.3567115068435669,
0.06970959901809692,
-0.06921577453613281,
0.2493114173412323,
0.04859448969364166,
0.2095261961221695,
0.12557196617126465,
0.12831281125545502,
-0.01759081520140171,
-0.14018678665161133,
0.1202220618724823,
-0.05792037397623062,
0.004262886475771666,
0.30686813592910767,
-0.4618951082229614,
-0.4351656436920166,
-0.25793731212615967,
-0.040316738188266754,
0.21201878786087036,
0.41244059801101685,
-0.5756645798683167,
0.09798040986061096,
-0.34571635723114014,
0.21528777480125427,
0.2109939008951187,
0.08678022027015686,
-0.05311249941587448,
0.36984097957611084,
0.24526873230934143,
0.1861104667186737,
0.004330940544605255,
-0.08218355476856232,
-0.03576069697737694,
0.21751676499843597,
0.02825445681810379,
-0.1482538878917694,
-0.21414785087108612,
-0.11961157619953156,
-0.4358590841293335,
-0.5204354524612427,
-0.060593198984861374,
0.0028348788619041443,
0.0026277191936969757,
-0.16062138974666595,
0.06862758100032806,
0.2802896201610565,
0.3501802682876587,
0.18794585764408112,
-0.18800732493400574,
-0.2758696377277374,
0.09252534806728363,
0.07933175563812256,
-0.2858984172344208,
-0.06509753316640854,
0.008915282785892487,
0.3914993107318878,
0.0823764055967331,
-0.12786735594272614,
0.37344029545783997,
0.5205632448196411,
0.14994056522846222,
-0.11127163469791412,
-0.18943318724632263,
0.10288292169570923,
-0.15763574838638306,
-0.03846857696771622,
0.29468029737472534,
0.1526823341846466,
-0.18389803171157837,
-0.18177537620067596,
-0.2736627757549286,
0.007523089647293091,
0.5131461024284363,
0.13979806005954742,
-0.054422780871391296,
-0.22184520959854126,
-0.5326719284057617,
0.42889752984046936,
0.11537420004606247,
-0.2633973956108093,
-0.07234099507331848,
-0.3518260717391968,
-0.30966389179229736,
-0.07893645763397217,
0.34293535351753235,
0.07024675607681274,
-0.23966200649738312,
-0.2517249584197998,
-0.23864202201366425,
-0.04675469547510147,
-0.1644432544708252,
0.10489659756422043,
-0.19954700767993927,
0.33718550205230713,
0.045778535306453705,
-0.17745248973369598,
0.05350348353385925,
-0.3620007336139679,
-0.39654165506362915,
-0.2716572880744934,
0.14522726833820343,
0.3106927275657654,
-0.4140342175960541,
0.17379538714885712,
0.17389722168445587,
-0.21087126433849335,
0.3510800898075104,
0.9778637290000916,
-0.15530560910701752,
-0.2350134551525116,
0.06861776858568192,
-0.1577569544315338,
0.19705328345298767,
0.35935312509536743,
0.10676872730255127,
0.08372843265533447,
0.25065740942955017,
0.049679361283779144,
0.10807021707296371,
-0.11870971322059631,
0.16367189586162567,
-0.3683658242225647,
0.1186097115278244,
0.2720653712749481,
0.052734777331352234,
-0.6437444686889648,
-0.13293306529521942,
0.029048584401607513,
0.2515294849872589,
0.12238599359989166,
0.2988685965538025,
-0.21121098101139069,
-0.11483226716518402,
-0.10216458141803741,
0.2176092267036438,
-0.03723791986703873,
0.09704633057117462,
-0.10603022575378418,
0.20231007039546967,
-0.1273399144411087,
-0.300559401512146,
0.3855253756046295,
-0.5844603180885315,
0.028934501111507416,
-0.060301460325717926,
0.17128923535346985,
0.3769921064376831,
0.00418487936258316,
-0.05611158162355423,
0.28760138154029846,
-0.21584054827690125,
-0.11939793825149536,
0.04243700951337814,
0.47646617889404297,
-0.11020617187023163,
-0.02031897008419037,
0.008915623649954796,
0.44768190383911133,
0.5043479204177856,
-0.14962875843048096,
-0.2577366530895233,
-0.33894795179367065,
0.08084337413311005,
-0.2992869019508362,
0.08487628400325775,
0.6596277356147766,
-0.3570968508720398,
0.16170644760131836,
0.06245572865009308,
0.08182995766401291,
-0.06559643149375916,
-0.029699228703975677,
-0.23798716068267822,
0.20971709489822388,
-0.1441022753715515,
-0.4696650207042694,
-0.1531687080860138,
-0.43856415152549744,
-0.29684582352638245,
0.2907394468784332,
-0.1811956763267517,
-0.00622868537902832,
-0.09343035519123077,
-0.03040887974202633,
0.07040034234523773,
0.32651543617248535,
0.059558555483818054,
0.17346368730068207,
0.5632430911064148,
0.2789541780948639,
0.05304894596338272,
0.16738887131214142,
-0.1514694094657898,
-0.08217694610357285,
0.07966429740190506,
0.20130734145641327,
-0.2079070806503296,
-0.15011915564537048,
0.22212114930152893,
0.10143524408340454,
0.07792273908853531,
-0.006624937057495117,
-0.2582222819328308,
0.013140687718987465,
-0.1902821958065033,
0.18078677356243134,
0.020939819514751434,
-0.1356564164161682,
0.4411998391151428,
-0.316691517829895,
0.10191895067691803,
-0.1268554925918579,
-0.15991070866584778,
0.23539090156555176,
0.031120002269744873,
0.23621489107608795,
-0.11966625601053238,
0.5479632019996643,
-0.19969907402992249,
0.03971530497074127,
-0.02251216024160385,
-0.011484440416097641,
-0.09585697948932648,
0.1433125138282776,
0.38020142912864685,
-0.12275411188602448,
0.5615099668502808,
-0.026520542800426483,
-0.2182936668395996,
-0.05853059142827988,
-0.1764872670173645,
-0.03100372850894928,
-0.21147820353507996,
0.0969146192073822,
0.1209888607263565,
-0.42386752367019653,
-0.24221691489219666,
-0.0018046721816062927,
-0.02206019125878811,
-0.3586064875125885,
0.00028824061155319214,
-0.3007931113243103,
0.05158347263932228,
0.180355042219162,
-0.2772543430328369,
-0.019876137375831604,
-0.3204643428325653,
-0.24713590741157532,
0.23784995079040527,
0.12911611795425415,
-0.13111937046051025,
-0.14042788743972778,
-0.04681689292192459,
-0.07900822162628174,
0.25559645891189575,
0.2805686891078949,
-0.07619321346282959,
-0.36124756932258606,
0.3291868269443512,
-0.21532569825649261,
-0.23746845126152039,
-0.16241329908370972,
-0.04898376017808914,
-0.033653534948825836,
0.3189873695373535,
-0.05020470544695854,
-0.1148093119263649,
-0.20169390738010406,
0.11394983530044556,
0.16763675212860107,
0.3248130679130554,
-0.0202462337911129,
-0.2721807360649109,
0.10594642907381058,
-0.14360925555229187,
-0.03885394707322121,
0.14268435537815094,
-0.002377662807703018,
0.047898948192596436,
0.14238159358501434,
0.21935436129570007,
-0.09069441258907318,
0.2919141352176666,
0.0237371027469635,
-0.08985397219657898,
0.013619085773825645,
0.2910929024219513,
0.31202515959739685,
-0.11358021199703217,
-0.3452041745185852,
-0.1836150735616684,
0.15933778882026672,
0.12923988699913025,
-0.015234638005495071,
0.030289046466350555,
-0.19545061886310577,
-0.4547426104545593,
0.18466725945472717,
0.01583469659090042,
0.09714511036872864,
-0.17884843051433563,
-0.5776866674423218,
0.1604742556810379,
0.08108659088611603,
-0.3341900706291199,
-0.1626642644405365,
0.00954851508140564,
0.31961798667907715,
0.19183197617530823,
0.0995551124215126,
0.1959301084280014,
-0.5139306783676147,
-0.43051987886428833,
0.3186368942260742,
0.14022675156593323,
-0.10081477463245392,
0.022226762026548386,
-0.1343144327402115,
-0.0361405648291111,
0.16889134049415588,
0.04909086227416992,
0.2788715362548828,
-0.37913262844085693,
-0.3270598351955414,
0.270719975233078,
-0.16392353177070618,
0.10585424304008484,
-0.10515603423118591,
-0.25043076276779175,
-0.22671867907047272,
0.1811923086643219,
0.5299124717712402,
-0.4644995331764221,
0.12787559628486633,
0.35040372610092163,
-0.01964152231812477,
-0.037451911717653275,
-0.27905744314193726,
0.36045050621032715,
-0.1767244040966034,
-0.3649136424064636,
0.012588303536176682,
0.4028663635253906,
0.23902279138565063,
-0.12447930127382278,
0.23661699891090393,
-0.5214773416519165,
0.3598179817199707,
0.5237433910369873,
0.04095418378710747,
0.0647047609090805,
0.1058482825756073,
0.251270592212677,
0.27305543422698975,
-0.3473551273345947,
0.37271490693092346,
0.43708768486976624,
0.04346522316336632,
-0.10240676254034042,
-0.019749967381358147,
-0.01672949269413948,
0.36132389307022095,
-0.06013622134923935,
0.21865203976631165,
-0.0632748156785965,
-0.32571548223495483,
-0.10401670634746552,
-0.12946999073028564,
0.02463730424642563,
-0.20356738567352295,
0.28804489970207214,
-0.34391650557518005,
-0.9341878890991211,
-0.06958708167076111,
-0.06866233050823212,
0.05278165638446808,
0.40292754769325256,
-0.14736154675483704,
-0.556032121181488,
0.04530651494860649,
0.17108210921287537,
0.7893826365470886,
0.1368693709373474,
0.21011601388454437,
0.239847332239151,
-0.008542798459529877,
0.5482553243637085,
-0.39697960019111633,
0.15530027449131012,
0.003678537905216217,
-0.1029028445482254,
0.03420552611351013,
-0.07058529555797577,
-0.07478706538677216,
0.18053030967712402,
0.13951511681079865,
0.14784611761569977,
-0.028800293803215027,
-0.20372775197029114,
0.09822511672973633,
0.17791777849197388,
0.3830114006996155,
-0.3142509460449219,
-0.20860475301742554,
0.15630343556404114,
0.1694667637348175,
-0.24567104876041412,
-0.22243258357048035,
-0.10936051607131958,
-0.2422134280204773,
0.5402829051017761,
-0.20665591955184937,
-0.23522567749023438,
0.2785736620426178,
0.2932961583137512,
0.036300934851169586,
-0.09836392104625702,
0.3958551287651062,
-0.05395065248012543,
0.33319199085235596,
0.062262702733278275,
-0.14696480333805084,
0.025145377963781357,
-0.0544198639690876,
0.06413152813911438,
-0.04126008599996567,
-0.24325217306613922,
0.561976432800293,
0.02145623415708542,
-0.09902571886777878,
0.14430034160614014,
0.1790277659893036,
-0.4143928587436676,
-0.2640065848827362,
-0.12400658428668976,
0.20263442397117615,
-0.05945705249905586,
-0.2248723804950714,
0.2895362377166748,
0.26866358518600464,
-0.011024676263332367,
0.08274500072002411,
0.08625718951225281,
-0.17097055912017822,
0.47499939799308777,
0.05866440013051033,
-0.12119762599468231,
-0.17279236018657684,
0.24156545102596283,
0.09096825122833252,
-0.2722690999507904,
0.1840728521347046,
0.06731896102428436,
-0.04564858227968216,
0.05643297731876373,
-0.026662923395633698,
0.37726613879203796,
0.21924924850463867,
0.01447458565235138,
-0.03386244177818298,
0.18726465106010437,
-0.22680243849754333,
-0.21602727472782135,
0.4187161326408386,
-0.15501153469085693,
0.02140328288078308,
-0.3803333044052124,
-0.31953904032707214,
0.10528882592916489,
0.1686728596687317,
0.18927055597305298,
-0.09388293325901031,
0.0006201788783073425,
-0.08292652666568756,
-0.08928801864385605,
-0.26119428873062134,
-0.045291222631931305,
0.05810897797346115,
-0.047587186098098755,
0.44288524985313416,
0.1198718398809433,
-0.18641397356987,
0.021255284547805786,
-0.12792573869228363,
-0.06223554536700249,
-0.001399695873260498,
-0.10948576033115387,
0.056438907980918884,
0.15121787786483765,
0.10653910785913467,
-0.17419329285621643,
0.05717591568827629,
-0.25676774978637695,
-0.17691031098365784,
-0.08143840730190277,
0.0020240843296051025,
-0.08922398090362549,
-0.08267322182655334,
0.11082586646080017,
0.1621295064687729,
0.3191441297531128,
-0.11374528706073761,
0.3453872501850128,
0.27183228731155396,
-0.4490499794483185,
-0.011515963822603226,
0.11279252171516418,
0.21540094912052155,
0.06180461496114731,
0.10233820229768753,
0.2501033842563629,
-0.12460706382989883,
-0.15635424852371216,
0.5009995102882385,
-0.013043435290455818,
0.2814018726348877,
0.21991202235221863,
0.35869932174682617,
0.2801344394683838,
-0.11740289628505707,
-0.023740675300359726,
0.11180423200130463,
0.05983009189367294,
-0.05951966345310211,
0.22914759814739227,
0.2834997773170471,
0.032449737191200256,
-0.1965036690235138,
0.04038869962096214,
0.11527024209499359,
-0.052303679287433624,
-0.5386409163475037,
0.22410643100738525,
0.3418140113353729,
-0.13138148188591003,
0.13465598225593567,
0.08226479589939117,
0.0330408439040184,
0.07845961302518845,
0.4777452051639557,
0.28299328684806824,
0.006823055446147919,
0.06868457794189453,
0.09799626469612122,
0.21034955978393555,
0.11334560811519623,
-0.10087066888809204,
-0.07407782971858978,
-0.10728316009044647,
0.16293536126613617,
0.11346933245658875,
0.19058643281459808,
-0.05025315284729004,
0.07168377935886383,
0.17492201924324036,
-0.12554296851158142,
-0.5751522779464722,
0.26918289065361023,
0.18913592398166656,
0.019820842891931534,
0.2653258144855499,
-0.2565724849700928,
-0.20233315229415894,
0.010750681161880493,
-0.23308724164962769,
0.043997298926115036,
-0.16485179960727692,
0.5982450246810913,
-0.19041016697883606,
0.05515233054757118,
-0.3540142774581909,
0.17246697843074799,
0.3662336468696594,
0.256423681974411,
-0.04080769419670105,
-0.2885045111179352,
0.0415797233581543,
0.17109893262386322,
0.24079442024230957,
0.3658728301525116,
0.1926625370979309,
0.16701291501522064,
-0.0839090645313263,
0.0487046092748642,
-0.0027830172330141068,
-0.015513096004724503,
0.10755817592144012,
0.38947024941444397,
0.0046157799661159515,
-0.16813620924949646,
0.14938955008983612,
0.15318720042705536,
-0.10316304862499237,
-0.049288950860500336,
-0.096320241689682,
-0.054539259523153305,
-0.5511085987091064,
0.24409395456314087,
0.18764519691467285,
-0.10691136121749878,
0.2725036144256592,
0.1597696989774704,
0.1085704118013382,
0.0786941647529602,
0.33546334505081177,
-0.3290467858314514,
0.015922661870718002,
-0.05664903670549393,
0.062262825667858124,
0.1315612494945526,
0.037456586956977844,
0.40546274185180664,
-0.19684523344039917,
0.046254049986600876,
-0.09880261868238449,
-0.5715643167495728,
-0.15948721766471863,
0.15031124651432037,
0.03795524686574936,
0.03671042621135712,
-0.05735830217599869,
0.4083550274372101,
0.13374745845794678,
0.22596876323223114,
0.16016557812690735,
-0.15972045063972473,
0.003509329166263342,
-0.1973799616098404,
-0.167842835187912,
-0.1716853827238083,
-0.01775306463241577,
-0.01797575131058693,
0.018263526260852814,
-0.07755595445632935,
-0.15783801674842834,
-0.0550122931599617,
0.2556707561016083,
0.07244015485048294,
0.1747152954339981,
0.429432213306427,
-0.021978210657835007,
0.23735646903514862,
0.5196809768676758,
0.20947778224945068,
0.2927298843860626,
-0.04199756309390068,
-0.2797835171222687,
-0.36718541383743286,
0.42439210414886475,
-0.6360487341880798,
0.10047927498817444,
-0.4582681655883789,
-0.3063872158527374,
0.07626552879810333,
0.17117096483707428,
0.19232115149497986,
-0.3459921181201935,
-0.2840111553668976,
-0.13893592357635498,
-0.17148709297180176,
-0.09809684753417969,
-0.1653028428554535,
0.300839900970459,
0.17212417721748352,
0.17246825993061066,
-0.12269401550292969,
-0.05317799001932144,
0.1394239366054535,
-0.09186212718486786,
-0.5280877351760864,
-0.029047943651676178,
-0.04925629496574402,
0.19176481664180756,
-0.07247734069824219,
-0.4681372344493866,
-0.056825071573257446,
0.3836677372455597,
-0.3691943883895874,
0.028261005878448486,
0.6505545973777771,
0.06770746409893036,
0.06125806272029877,
-0.0969226136803627,
0.057174138724803925,
-0.14490100741386414,
-0.031018462032079697,
0.006174303591251373,
-0.13640058040618896
] |
https://github.com/huggingface/datasets/issues/5659 | @sanchit-gandhi can you please also post the logs of `pip install soundfile==0.12.1`? To check what wheel is being installed or if it's being built from source (I think it's the latter case).
Required `libsndfile` binary **should** be bundeled with `soundfile` wheel but I assume it **might not** be the case for some non standard Linux distributions.
The only solution for using `soundfile` here is to build [`libsndfile`](https://github.com/libsndfile/libsndfile) from source:
```bash
git clone https://github.com/libsndfile/libsndfile.git
cd libsndfile/
autoreconf -vif
./configure --enable-werror
make
make install
```
for this, some building libraries should be installed, for Debian/Ubuntu it's like:
```bash
apt install autoconf autogen automake build-essential libasound2-dev \
libflac-dev libogg-dev libtool libvorbis-dev libopus-dev libmp3lame-dev \
libmpg123-dev pkg-config python
```
but for other Linux distributions it might be different.
When the binary is compiled, it should be put into location where `soundfile` would search for it (the directory is named `_soundfile_data`), it depends on where`libsdfile` (from the previous step) and `soundfile` were installed, might be something like this:
```bash
cp /usr/local/lib/libsndfile.so /usr/local/lib/python3.7/dist-packages/_soundfile_data/
cp /usr/local/lib/libsndfile.la /usr/local/lib/python3.7/dist-packages/_soundfile_data/
```
Another solution is to not use `soundfile` and apply custom processing function with `torchaudio` while setting `decode=False` in `Audio` feature and passing custom function to `.map`. | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files | ### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28 | 197 | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files
### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28
@sanchit-gandhi can you please also post the logs of `pip install soundfile==0.12.1`? To check what wheel is being installed or if it's being built from source (I think it's the latter case).
Required `libsndfile` binary **should** be bundeled with `soundfile` wheel but I assume it **might not** be the case for some non standard Linux distributions.
The only solution for using `soundfile` here is to build [`libsndfile`](https://github.com/libsndfile/libsndfile) from source:
```bash
git clone https://github.com/libsndfile/libsndfile.git
cd libsndfile/
autoreconf -vif
./configure --enable-werror
make
make install
```
for this, some building libraries should be installed, for Debian/Ubuntu it's like:
```bash
apt install autoconf autogen automake build-essential libasound2-dev \
libflac-dev libogg-dev libtool libvorbis-dev libopus-dev libmp3lame-dev \
libmpg123-dev pkg-config python
```
but for other Linux distributions it might be different.
When the binary is compiled, it should be put into location where `soundfile` would search for it (the directory is named `_soundfile_data`), it depends on where`libsdfile` (from the previous step) and `soundfile` were installed, might be something like this:
```bash
cp /usr/local/lib/libsndfile.so /usr/local/lib/python3.7/dist-packages/_soundfile_data/
cp /usr/local/lib/libsndfile.la /usr/local/lib/python3.7/dist-packages/_soundfile_data/
```
Another solution is to not use `soundfile` and apply custom processing function with `torchaudio` while setting `decode=False` in `Audio` feature and passing custom function to `.map`. | [
-0.049880754202604294,
0.21389538049697876,
-0.02552657201886177,
0.37763962149620056,
0.36412861943244934,
-0.05396618694067001,
0.2889644503593445,
0.11923642456531525,
-0.2776981592178345,
0.2703988552093506,
-0.33914411067962646,
0.02121618017554283,
-0.19508084654808044,
-0.05244786664843559,
-0.07602284848690033,
-0.053154755383729935,
-0.146317720413208,
0.5547893047332764,
0.1439652442932129,
0.06756901741027832,
-0.16367927193641663,
0.3902137875556946,
-0.12376674264669418,
-0.06845317035913467,
-0.24915023148059845,
0.048388101160526276,
0.12746968865394592,
0.17041106522083282,
-0.4433642625808716,
-0.35512402653694153,
0.4380989372730255,
0.2319992333650589,
-0.05099821090698242,
0.29043030738830566,
-0.00012352937483228743,
-0.11559702455997467,
0.20513415336608887,
-0.2270914912223816,
-0.40592265129089355,
-0.11279238760471344,
-0.212590754032135,
-0.131047785282135,
-0.018999427556991577,
-0.054712213575839996,
-0.054331302642822266,
-0.3607732355594635,
-0.2069346010684967,
-0.1928735375404358,
0.233961820602417,
0.3014804720878601,
0.13623759150505066,
0.17275191843509674,
-0.004351221024990082,
0.1199047714471817,
0.5826959609985352,
0.05023296922445297,
-0.12111442536115646,
0.09400640428066254,
0.2956078052520752,
0.06883106380701065,
0.16029924154281616,
0.11522360146045685,
-0.026204582303762436,
0.22168073058128357,
0.2528781592845917,
-0.09834760427474976,
0.10960826277732849,
-0.2319716513156891,
0.061605263501405716,
0.5462928414344788,
0.8929854035377502,
-0.13209515810012817,
-0.6255757808685303,
-0.3807216286659241,
-0.15301282703876495,
-0.1855306327342987,
0.3686770796775818,
-0.2373051643371582,
-0.10350987315177917,
0.29939761757850647,
-0.04895247891545296,
-0.0039725229144096375,
0.15861666202545166,
0.2882198095321655,
0.04949945956468582,
-0.1935369074344635,
-0.08759509027004242,
-0.1538151502609253,
0.31666818261146545,
-0.23562124371528625,
-0.1479191780090332,
-0.057447001338005066,
-0.06832793354988098,
0.21306248009204865,
-0.14738141000270844,
-0.10396292060613632,
0.08840421587228775,
0.07939273118972778,
0.07031139731407166,
0.15621960163116455,
-0.15107758343219757,
-0.053061552345752716,
-0.4215264618396759,
-0.046277355402708054,
0.1598110795021057,
-0.22630348801612854,
-0.062266863882541656,
-0.12766967713832855,
0.15912313759326935,
-0.09006772935390472,
0.3275679051876068,
-0.04262600094079971,
0.15337440371513367,
-0.37258824706077576,
-0.3740416169166565,
-0.01362275518476963,
0.30175721645355225,
-0.4751899242401123,
-0.41212451457977295,
0.04797927662730217,
-0.335199236869812,
-0.05054696649312973,
0.12953968346118927,
-0.04075709730386734,
0.09004686027765274,
0.5219283103942871,
0.4176955819129944,
0.19073054194450378,
-0.3532955050468445,
0.1694779247045517,
-0.021708309650421143,
-0.22332720458507538,
0.19873616099357605,
-0.02517165243625641,
0.3993792235851288,
-0.3515942096710205,
0.4323694109916687,
0.10456891357898712,
0.2842091917991638,
-0.049148090183734894,
-0.03585126996040344,
-0.07394207268953323,
-0.21954584121704102,
0.3524152636528015,
-0.17553046345710754,
0.019895687699317932,
-0.3287624716758728,
-0.11586916446685791,
-0.14956486225128174,
0.07563798129558563,
-0.20093664526939392,
-0.18875625729560852,
0.08634163439273834,
0.11109669506549835,
-0.4830392599105835,
0.27278685569763184,
-0.0029814280569553375,
-0.03812029957771301,
0.16576921939849854,
-0.41605913639068604,
0.024478504434227943,
-0.4133132994174957,
-0.2350761592388153,
-0.005670331418514252,
0.21449881792068481,
0.3355960249900818,
-0.3807133436203003,
-0.16003093123435974,
0.1093781590461731,
-0.1582372486591339,
-0.014331512153148651,
0.28229060769081116,
-0.13150735199451447,
0.29842907190322876,
-0.1967371106147766,
-0.10386650264263153,
0.5670567750930786,
-0.3654792308807373,
-0.42812711000442505,
0.1869962513446808,
0.08179593086242676,
0.4688357710838318,
0.07916706800460815,
-0.09337296336889267,
-0.09169740974903107,
-0.2231377810239792,
0.026687733829021454,
0.2629302144050598,
0.021867593750357628,
-0.18678542971611023,
0.0036608055233955383,
-0.4244551360607147,
0.06699034571647644,
0.3080374598503113,
0.03281782194972038,
-0.0945151299238205,
-0.01241455227136612,
0.4726387858390808,
0.2068977952003479,
-0.05670391768217087,
-0.05299684405326843,
0.10259047150611877,
0.5188701152801514,
0.23160745203495026,
0.11004562675952911,
-0.27419614791870117,
-0.08054119348526001,
0.11274544894695282,
0.26938340067863464,
0.04825346916913986,
-0.018937665969133377,
-0.10919047892093658,
0.13499833643436432,
-0.3264015316963196,
-0.2200787365436554,
0.24825221300125122,
-0.02232525497674942,
0.19468650221824646,
-0.22108615934848785,
-0.16697615385055542,
-0.0948956310749054,
0.10557926446199417,
-0.041065700352191925,
0.08541779220104218,
-0.30294209718704224,
-0.013122964650392532,
-0.022907255217432976,
0.08476229012012482,
0.15625116229057312,
0.41044124960899353,
0.046248309314250946,
-0.028219161555171013,
-0.10161028802394867,
0.29566460847854614,
0.5504580140113831,
-0.04094335064291954,
-0.4070577621459961,
0.5133808851242065,
0.30632925033569336,
0.05058152973651886,
-0.0856696292757988,
0.11710736155509949,
0.13307631015777588,
-0.20405864715576172,
0.16750679910182953,
0.2205520123243332,
-0.15079250931739807,
0.20390070974826813,
0.22054103016853333,
-0.2713400721549988,
0.2415943741798401,
0.286283940076828,
-0.2198144793510437,
-0.01912011206150055,
0.3594229221343994,
-0.17885804176330566,
0.40677785873413086,
-0.033479444682598114,
-0.14399105310440063,
-0.10318043828010559,
0.3257092237472534,
-0.06670576333999634,
-0.1779118776321411,
0.02396165020763874,
0.24085742235183716,
0.00036713480949401855,
0.051515594124794006,
0.32336050271987915,
0.6417386531829834,
0.23663672804832458,
0.0583278052508831,
-0.1511276513338089,
0.14702802896499634,
-0.46651220321655273,
0.14897891879081726,
0.1944667398929596,
-0.18413323163986206,
0.19084791839122772,
-0.04314263537526131,
0.2557905614376068,
-0.15247607231140137,
-0.17638370394706726,
0.07772140204906464,
0.10773403942584991,
-0.6525932550430298,
-0.07663445174694061,
-0.5262326598167419,
-0.1669667363166809,
-0.05134958401322365,
-0.28166258335113525,
-0.22957497835159302,
-0.08068374544382095,
0.09765132516622543,
0.07579837739467621,
-0.08529283851385117,
0.10263793170452118,
-0.0048494115471839905,
0.2893795967102051,
0.022972434759140015,
-0.3243034780025482,
0.1744280904531479,
0.3457619845867157,
-0.18844205141067505,
0.05915559083223343,
0.2852771580219269,
0.0943983644247055,
0.08993659168481827,
-0.31309956312179565,
-0.04984241724014282,
0.09779687225818634,
-0.2658802568912506,
0.1755244880914688,
-0.051112040877342224,
0.4030529260635376,
0.4598187506198883,
0.2776840329170227,
-0.01574307680130005,
-0.29303157329559326,
0.12528514862060547,
0.3331541121006012,
-0.03231336921453476,
-0.0120614655315876,
0.09485800564289093,
-0.05390311777591705,
-0.3954113721847534,
-0.4637475609779358,
-0.09166411310434341,
-0.342678427696228,
0.4091050624847412,
-0.0009286105632781982,
0.29537221789360046,
0.7557628154754639,
0.10837189108133316,
0.16713321208953857,
0.05080293118953705,
0.3576146066188812,
-0.17955073714256287,
-0.2276766151189804,
0.28309252858161926,
-0.11396460235118866,
-0.303384929895401,
-0.04539373517036438,
0.35711732506752014,
0.14031872153282166,
0.3954789638519287,
-0.3866767883300781,
-0.09279977530241013,
0.059751659631729126,
0.12738268077373505,
-0.08320583403110504,
0.15560562908649445,
0.1681663691997528,
0.35791730880737305,
0.09560039639472961,
-0.2865777611732483,
-0.18124669790267944,
0.08127886056900024,
-0.05408429354429245,
0.4320569932460785,
0.021040581166744232,
0.17854969203472137,
-0.22137151658535004,
0.5179806351661682,
0.052715882658958435,
-0.09091222286224365,
0.1991945207118988,
0.06482471525669098,
0.5033174157142639,
-0.060297902673482895,
-0.06210479885339737,
0.15956968069076538,
0.13854898512363434,
0.04431522637605667,
0.2818880081176758,
0.2857184112071991,
0.2571042776107788,
-0.3721221089363098,
0.3562707006931305,
-0.04199487715959549,
-0.14647933840751648,
0.1360076516866684,
0.07740478217601776,
0.05388224124908447,
0.051632463932037354,
0.353665292263031,
0.2875666320323944,
0.013879232108592987,
-0.1203811764717102,
0.5422342419624329,
0.21971572935581207,
0.0034470371901988983,
-0.036417052149772644,
-0.18140414357185364,
-0.019346676766872406,
0.0817226842045784,
0.1935337781906128,
0.4616091549396515,
-0.12792667746543884,
0.21326756477355957,
-0.15885350108146667,
0.03416925668716431,
0.07593531161546707,
-0.272318959236145,
0.05997177213430405,
0.12492083758115768,
0.2236122488975525,
-0.10954473912715912,
-0.14760330319404602,
-0.25815439224243164,
-0.21468180418014526,
0.22984443604946136,
0.28489768505096436,
-0.2363368570804596,
-0.4179784059524536,
-0.09194179624319077,
0.2912096083164215,
0.06766165792942047,
-0.1665307581424713,
-0.2633426785469055,
-0.47394129633903503,
-0.18938100337982178,
-0.1969667226076126,
0.03286519646644592,
0.2830890119075775,
-0.0696721151471138,
-0.07128984481096268,
0.23050127923488617,
-0.1764470934867859,
0.4720379710197449,
-0.1110110953450203,
0.24739310145378113,
0.07275800406932831,
0.17503520846366882,
0.07667746394872665,
-0.27621522545814514,
0.6093207001686096,
0.4613340497016907,
-0.5748463273048401,
0.05490966886281967,
0.049286969006061554,
-0.10494129359722137,
0.12657833099365234,
0.49734050035476685,
-0.203236922621727,
0.03332185000181198,
-0.20988425612449646,
-0.16689932346343994,
-0.0899110734462738,
0.3369802236557007,
0.3057073950767517,
-0.14112025499343872,
-0.019365880638360977,
-0.5954620242118835,
0.4933858811855316,
-0.13040564954280853,
-0.07425784319639206,
0.5431771874427795,
0.3751167058944702,
-0.2540671229362488,
0.050071295350790024,
-0.20028972625732422,
0.938000500202179,
0.1679849624633789,
-0.03475185111165047,
0.39505746960639954,
-0.27726638317108154,
0.24796538054943085,
-0.13314253091812134,
-0.04472142085433006,
0.15066981315612793,
-0.07901407778263092,
-0.2124829888343811,
-0.08163972198963165,
0.15276764333248138,
0.24742946028709412,
-0.19619068503379822,
0.2571852505207062,
0.2363925576210022,
-0.18507754802703857,
0.2410515993833542,
0.34127533435821533,
-0.08825967460870743,
-0.23929600417613983,
-0.4996219277381897,
0.05983947589993477,
-0.21201923489570618,
0.2821532189846039,
-0.23345227539539337,
-0.16736644506454468,
-0.16223132610321045,
-0.37301158905029297,
-0.3034265637397766,
-0.019777558743953705,
-0.606201708316803,
0.00012835487723350525,
0.004050400108098984,
-0.20931224524974823,
0.42495083808898926,
-0.05781005695462227,
-0.3502541184425354,
0.5912764072418213,
-0.3381415009498596,
0.08814430236816406,
-0.21939721703529358,
0.09057898074388504,
0.07562681287527084,
0.06658387184143066,
0.22453032433986664,
-0.0499744638800621,
-0.11331059783697128,
-0.4267258644104004,
-0.24010314047336578,
-0.2405204176902771,
0.40968477725982666,
-0.37012097239494324,
-0.1007474809885025,
-0.13668981194496155,
-0.3043428063392639,
-0.0966453030705452,
0.005863375961780548,
-0.04695793241262436,
0.06841325014829636,
0.14428788423538208,
-0.17190629243850708,
0.1301976442337036,
-0.07909689843654633,
-0.052401527762413025,
-0.12111671268939972,
0.2273588478565216,
-0.2594868838787079,
-0.2101680040359497,
0.3971303403377533,
0.12155332416296005,
-0.2633444368839264,
-0.16250447928905487,
0.049894750118255615,
-0.11894838511943817,
-0.30585232377052307,
-0.0868089348077774,
0.08560147136449814,
-0.10372979938983917,
0.05212811380624771,
0.08991599082946777,
0.14536239206790924,
0.04630175977945328,
0.02371421456336975,
-0.46576231718063354,
-0.1444142758846283,
0.33241701126098633,
-0.0263862032443285,
0.21902932226657867,
-0.16694171726703644,
-0.14410270750522614,
0.13567489385604858,
-0.031051678583025932,
-0.20413824915885925,
0.10186794400215149,
0.20448264479637146,
0.22578826546669006,
0.05633607134222984,
0.01620342768728733,
0.18995505571365356,
-0.27500054240226746,
-0.0026572681963443756,
0.04666141793131828,
-0.3123891353607178,
-0.00710136815905571,
-0.1346241533756256,
0.27495816349983215,
0.08997180312871933,
-0.3378797173500061,
0.10601218044757843,
-0.023355308920145035,
-0.2518883943557739,
-0.31359007954597473,
0.01891321688890457,
0.13236814737319946,
-0.18413738906383514,
-0.0060387589037418365,
0.07058614492416382,
0.1286289095878601,
-0.07012122124433517,
0.12594091892242432,
0.015206249430775642,
0.08092226833105087,
0.308966726064682,
0.19208374619483948,
-0.016553163528442383,
-0.04961317777633667,
-0.053215306252241135,
0.22263884544372559,
-0.03684983775019646,
-0.07609260082244873,
0.13448898494243622,
-0.29783064126968384,
-0.009367622435092926,
0.4454352855682373,
0.18453775346279144,
0.6857518553733826,
-0.12068187445402145,
0.05556870996952057,
0.08004177361726761,
0.08756674826145172,
-0.00683072954416275,
-0.007918812334537506,
-0.048252083361148834,
0.24565450847148895,
-0.09880185127258301,
0.28393763303756714,
0.1330655813217163,
-0.36537498235702515,
0.01902661845088005,
0.17367951571941376,
0.13045048713684082,
-0.1283191442489624,
0.08824574947357178,
0.7129381895065308,
-0.04891401156783104,
0.0782170370221138,
-0.10460636019706726,
-0.14702528715133667,
0.0594286173582077,
0.24855662882328033,
-0.48144787549972534,
0.10729558020830154,
0.2871219515800476,
-0.0034803934395313263,
-0.03293869271874428,
-0.5146503448486328,
-0.1732814610004425,
0.4555957019329071,
0.012798868119716644,
0.09392284601926804,
0.15349701046943665,
0.28658968210220337,
-0.4708642363548279,
-0.06937574595212936,
0.014115259051322937,
-0.16176843643188477,
-0.20174631476402283,
0.07785511016845703,
0.4016444683074951,
-0.2385188192129135,
-0.2536187469959259,
-0.06496354937553406,
-0.20226696133613586,
-0.2064248025417328,
-0.16271351277828217,
-0.050924405455589294,
0.01518799178302288,
-0.2840879261493683,
-0.23341940343379974,
-0.01324634812772274,
0.09218625724315643,
-0.3112953305244446,
0.23744700849056244,
0.3032325506210327,
-0.2797801196575165,
0.38987892866134644,
0.33272209763526917,
0.3134801983833313,
0.37833598256111145,
0.04781593754887581,
-0.17094974219799042,
-0.07845340669155121,
-0.026743929833173752,
0.20055435597896576,
0.4092733561992645,
0.031013019382953644,
0.32037633657455444,
0.3283001780509949,
0.014640580862760544,
-0.08389662206172943,
-0.2958451807498932,
0.14827463030815125,
-0.2095751315355301,
-0.6450566649436951,
0.6928914189338684,
-0.24998123943805695,
-0.10601246356964111,
-0.017907211557030678,
0.16609330475330353,
-0.22683022916316986,
0.04262946546077728,
0.521144688129425,
0.3244016468524933,
0.12816248834133148,
0.2558424174785614,
0.03910692036151886,
-0.13781395554542542,
0.24463161826133728,
0.27388665080070496,
0.07700177282094955,
-0.15622597932815552,
0.04958409070968628,
-0.6452693939208984,
-0.12914186716079712,
-0.031144512817263603,
0.0005436018109321594,
0.019787825644016266,
0.10342984646558762,
0.11867766082286835,
0.2379944771528244,
-0.11887377500534058,
0.09634602069854736,
0.5744260549545288,
-0.21504133939743042,
-0.2127048373222351,
-0.10693959891796112,
0.17755445837974548,
-0.12562133371829987,
-0.18995913863182068,
-0.5206833481788635,
0.06388142704963684,
-0.08415568619966507,
-0.09346799552440643,
-0.24923253059387207,
0.012487582862377167,
-0.10319863259792328,
0.0343782864511013,
0.17088237404823303,
0.09636779129505157,
0.5322657823562622,
-0.1261870265007019,
-0.32451331615448,
-0.3152916729450226,
-0.04203229025006294,
0.036233969032764435,
0.19935694336891174,
-0.13211767375469208,
0.38022711873054504,
-0.18788117170333862,
0.16983675956726074,
-0.34704285860061646,
0.32919585704803467,
-0.11708049476146698,
0.18016721308231354,
-0.4201682209968567,
-0.005040924996137619,
-0.41661766171455383,
0.18146862089633942,
0.05345861613750458,
-0.22326934337615967,
-0.0794333666563034,
0.008804969489574432,
-0.499805748462677,
-0.28783613443374634,
0.528273344039917,
-0.2095530778169632,
-0.014439322054386139,
0.016815293580293655,
0.44252318143844604,
0.32096442580223083,
0.13171188533306122,
-1.0341064929962158,
0.14135991036891937,
0.35800909996032715,
0.04677759110927582,
-0.3209111988544464,
0.24520960450172424,
-0.18830297887325287,
-0.11204284429550171,
-0.06656389683485031,
0.20237530767917633,
0.044737160205841064,
-0.25587913393974304,
0.14269942045211792,
-0.41050130128860474
] |
https://github.com/huggingface/datasets/issues/5659 | Not sure if it may help, but you could also try updating `pip` before installing soundfile | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files | ### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28 | 16 | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files
### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28
Not sure if it may help, but you could also try updating `pip` before installing soundfile | [
-0.049880754202604294,
0.21389538049697876,
-0.02552657201886177,
0.37763962149620056,
0.36412861943244934,
-0.05396618694067001,
0.2889644503593445,
0.11923642456531525,
-0.2776981592178345,
0.2703988552093506,
-0.33914411067962646,
0.02121618017554283,
-0.19508084654808044,
-0.05244786664843559,
-0.07602284848690033,
-0.053154755383729935,
-0.146317720413208,
0.5547893047332764,
0.1439652442932129,
0.06756901741027832,
-0.16367927193641663,
0.3902137875556946,
-0.12376674264669418,
-0.06845317035913467,
-0.24915023148059845,
0.048388101160526276,
0.12746968865394592,
0.17041106522083282,
-0.4433642625808716,
-0.35512402653694153,
0.4380989372730255,
0.2319992333650589,
-0.05099821090698242,
0.29043030738830566,
-0.00012352937483228743,
-0.11559702455997467,
0.20513415336608887,
-0.2270914912223816,
-0.40592265129089355,
-0.11279238760471344,
-0.212590754032135,
-0.131047785282135,
-0.018999427556991577,
-0.054712213575839996,
-0.054331302642822266,
-0.3607732355594635,
-0.2069346010684967,
-0.1928735375404358,
0.233961820602417,
0.3014804720878601,
0.13623759150505066,
0.17275191843509674,
-0.004351221024990082,
0.1199047714471817,
0.5826959609985352,
0.05023296922445297,
-0.12111442536115646,
0.09400640428066254,
0.2956078052520752,
0.06883106380701065,
0.16029924154281616,
0.11522360146045685,
-0.026204582303762436,
0.22168073058128357,
0.2528781592845917,
-0.09834760427474976,
0.10960826277732849,
-0.2319716513156891,
0.061605263501405716,
0.5462928414344788,
0.8929854035377502,
-0.13209515810012817,
-0.6255757808685303,
-0.3807216286659241,
-0.15301282703876495,
-0.1855306327342987,
0.3686770796775818,
-0.2373051643371582,
-0.10350987315177917,
0.29939761757850647,
-0.04895247891545296,
-0.0039725229144096375,
0.15861666202545166,
0.2882198095321655,
0.04949945956468582,
-0.1935369074344635,
-0.08759509027004242,
-0.1538151502609253,
0.31666818261146545,
-0.23562124371528625,
-0.1479191780090332,
-0.057447001338005066,
-0.06832793354988098,
0.21306248009204865,
-0.14738141000270844,
-0.10396292060613632,
0.08840421587228775,
0.07939273118972778,
0.07031139731407166,
0.15621960163116455,
-0.15107758343219757,
-0.053061552345752716,
-0.4215264618396759,
-0.046277355402708054,
0.1598110795021057,
-0.22630348801612854,
-0.062266863882541656,
-0.12766967713832855,
0.15912313759326935,
-0.09006772935390472,
0.3275679051876068,
-0.04262600094079971,
0.15337440371513367,
-0.37258824706077576,
-0.3740416169166565,
-0.01362275518476963,
0.30175721645355225,
-0.4751899242401123,
-0.41212451457977295,
0.04797927662730217,
-0.335199236869812,
-0.05054696649312973,
0.12953968346118927,
-0.04075709730386734,
0.09004686027765274,
0.5219283103942871,
0.4176955819129944,
0.19073054194450378,
-0.3532955050468445,
0.1694779247045517,
-0.021708309650421143,
-0.22332720458507538,
0.19873616099357605,
-0.02517165243625641,
0.3993792235851288,
-0.3515942096710205,
0.4323694109916687,
0.10456891357898712,
0.2842091917991638,
-0.049148090183734894,
-0.03585126996040344,
-0.07394207268953323,
-0.21954584121704102,
0.3524152636528015,
-0.17553046345710754,
0.019895687699317932,
-0.3287624716758728,
-0.11586916446685791,
-0.14956486225128174,
0.07563798129558563,
-0.20093664526939392,
-0.18875625729560852,
0.08634163439273834,
0.11109669506549835,
-0.4830392599105835,
0.27278685569763184,
-0.0029814280569553375,
-0.03812029957771301,
0.16576921939849854,
-0.41605913639068604,
0.024478504434227943,
-0.4133132994174957,
-0.2350761592388153,
-0.005670331418514252,
0.21449881792068481,
0.3355960249900818,
-0.3807133436203003,
-0.16003093123435974,
0.1093781590461731,
-0.1582372486591339,
-0.014331512153148651,
0.28229060769081116,
-0.13150735199451447,
0.29842907190322876,
-0.1967371106147766,
-0.10386650264263153,
0.5670567750930786,
-0.3654792308807373,
-0.42812711000442505,
0.1869962513446808,
0.08179593086242676,
0.4688357710838318,
0.07916706800460815,
-0.09337296336889267,
-0.09169740974903107,
-0.2231377810239792,
0.026687733829021454,
0.2629302144050598,
0.021867593750357628,
-0.18678542971611023,
0.0036608055233955383,
-0.4244551360607147,
0.06699034571647644,
0.3080374598503113,
0.03281782194972038,
-0.0945151299238205,
-0.01241455227136612,
0.4726387858390808,
0.2068977952003479,
-0.05670391768217087,
-0.05299684405326843,
0.10259047150611877,
0.5188701152801514,
0.23160745203495026,
0.11004562675952911,
-0.27419614791870117,
-0.08054119348526001,
0.11274544894695282,
0.26938340067863464,
0.04825346916913986,
-0.018937665969133377,
-0.10919047892093658,
0.13499833643436432,
-0.3264015316963196,
-0.2200787365436554,
0.24825221300125122,
-0.02232525497674942,
0.19468650221824646,
-0.22108615934848785,
-0.16697615385055542,
-0.0948956310749054,
0.10557926446199417,
-0.041065700352191925,
0.08541779220104218,
-0.30294209718704224,
-0.013122964650392532,
-0.022907255217432976,
0.08476229012012482,
0.15625116229057312,
0.41044124960899353,
0.046248309314250946,
-0.028219161555171013,
-0.10161028802394867,
0.29566460847854614,
0.5504580140113831,
-0.04094335064291954,
-0.4070577621459961,
0.5133808851242065,
0.30632925033569336,
0.05058152973651886,
-0.0856696292757988,
0.11710736155509949,
0.13307631015777588,
-0.20405864715576172,
0.16750679910182953,
0.2205520123243332,
-0.15079250931739807,
0.20390070974826813,
0.22054103016853333,
-0.2713400721549988,
0.2415943741798401,
0.286283940076828,
-0.2198144793510437,
-0.01912011206150055,
0.3594229221343994,
-0.17885804176330566,
0.40677785873413086,
-0.033479444682598114,
-0.14399105310440063,
-0.10318043828010559,
0.3257092237472534,
-0.06670576333999634,
-0.1779118776321411,
0.02396165020763874,
0.24085742235183716,
0.00036713480949401855,
0.051515594124794006,
0.32336050271987915,
0.6417386531829834,
0.23663672804832458,
0.0583278052508831,
-0.1511276513338089,
0.14702802896499634,
-0.46651220321655273,
0.14897891879081726,
0.1944667398929596,
-0.18413323163986206,
0.19084791839122772,
-0.04314263537526131,
0.2557905614376068,
-0.15247607231140137,
-0.17638370394706726,
0.07772140204906464,
0.10773403942584991,
-0.6525932550430298,
-0.07663445174694061,
-0.5262326598167419,
-0.1669667363166809,
-0.05134958401322365,
-0.28166258335113525,
-0.22957497835159302,
-0.08068374544382095,
0.09765132516622543,
0.07579837739467621,
-0.08529283851385117,
0.10263793170452118,
-0.0048494115471839905,
0.2893795967102051,
0.022972434759140015,
-0.3243034780025482,
0.1744280904531479,
0.3457619845867157,
-0.18844205141067505,
0.05915559083223343,
0.2852771580219269,
0.0943983644247055,
0.08993659168481827,
-0.31309956312179565,
-0.04984241724014282,
0.09779687225818634,
-0.2658802568912506,
0.1755244880914688,
-0.051112040877342224,
0.4030529260635376,
0.4598187506198883,
0.2776840329170227,
-0.01574307680130005,
-0.29303157329559326,
0.12528514862060547,
0.3331541121006012,
-0.03231336921453476,
-0.0120614655315876,
0.09485800564289093,
-0.05390311777591705,
-0.3954113721847534,
-0.4637475609779358,
-0.09166411310434341,
-0.342678427696228,
0.4091050624847412,
-0.0009286105632781982,
0.29537221789360046,
0.7557628154754639,
0.10837189108133316,
0.16713321208953857,
0.05080293118953705,
0.3576146066188812,
-0.17955073714256287,
-0.2276766151189804,
0.28309252858161926,
-0.11396460235118866,
-0.303384929895401,
-0.04539373517036438,
0.35711732506752014,
0.14031872153282166,
0.3954789638519287,
-0.3866767883300781,
-0.09279977530241013,
0.059751659631729126,
0.12738268077373505,
-0.08320583403110504,
0.15560562908649445,
0.1681663691997528,
0.35791730880737305,
0.09560039639472961,
-0.2865777611732483,
-0.18124669790267944,
0.08127886056900024,
-0.05408429354429245,
0.4320569932460785,
0.021040581166744232,
0.17854969203472137,
-0.22137151658535004,
0.5179806351661682,
0.052715882658958435,
-0.09091222286224365,
0.1991945207118988,
0.06482471525669098,
0.5033174157142639,
-0.060297902673482895,
-0.06210479885339737,
0.15956968069076538,
0.13854898512363434,
0.04431522637605667,
0.2818880081176758,
0.2857184112071991,
0.2571042776107788,
-0.3721221089363098,
0.3562707006931305,
-0.04199487715959549,
-0.14647933840751648,
0.1360076516866684,
0.07740478217601776,
0.05388224124908447,
0.051632463932037354,
0.353665292263031,
0.2875666320323944,
0.013879232108592987,
-0.1203811764717102,
0.5422342419624329,
0.21971572935581207,
0.0034470371901988983,
-0.036417052149772644,
-0.18140414357185364,
-0.019346676766872406,
0.0817226842045784,
0.1935337781906128,
0.4616091549396515,
-0.12792667746543884,
0.21326756477355957,
-0.15885350108146667,
0.03416925668716431,
0.07593531161546707,
-0.272318959236145,
0.05997177213430405,
0.12492083758115768,
0.2236122488975525,
-0.10954473912715912,
-0.14760330319404602,
-0.25815439224243164,
-0.21468180418014526,
0.22984443604946136,
0.28489768505096436,
-0.2363368570804596,
-0.4179784059524536,
-0.09194179624319077,
0.2912096083164215,
0.06766165792942047,
-0.1665307581424713,
-0.2633426785469055,
-0.47394129633903503,
-0.18938100337982178,
-0.1969667226076126,
0.03286519646644592,
0.2830890119075775,
-0.0696721151471138,
-0.07128984481096268,
0.23050127923488617,
-0.1764470934867859,
0.4720379710197449,
-0.1110110953450203,
0.24739310145378113,
0.07275800406932831,
0.17503520846366882,
0.07667746394872665,
-0.27621522545814514,
0.6093207001686096,
0.4613340497016907,
-0.5748463273048401,
0.05490966886281967,
0.049286969006061554,
-0.10494129359722137,
0.12657833099365234,
0.49734050035476685,
-0.203236922621727,
0.03332185000181198,
-0.20988425612449646,
-0.16689932346343994,
-0.0899110734462738,
0.3369802236557007,
0.3057073950767517,
-0.14112025499343872,
-0.019365880638360977,
-0.5954620242118835,
0.4933858811855316,
-0.13040564954280853,
-0.07425784319639206,
0.5431771874427795,
0.3751167058944702,
-0.2540671229362488,
0.050071295350790024,
-0.20028972625732422,
0.938000500202179,
0.1679849624633789,
-0.03475185111165047,
0.39505746960639954,
-0.27726638317108154,
0.24796538054943085,
-0.13314253091812134,
-0.04472142085433006,
0.15066981315612793,
-0.07901407778263092,
-0.2124829888343811,
-0.08163972198963165,
0.15276764333248138,
0.24742946028709412,
-0.19619068503379822,
0.2571852505207062,
0.2363925576210022,
-0.18507754802703857,
0.2410515993833542,
0.34127533435821533,
-0.08825967460870743,
-0.23929600417613983,
-0.4996219277381897,
0.05983947589993477,
-0.21201923489570618,
0.2821532189846039,
-0.23345227539539337,
-0.16736644506454468,
-0.16223132610321045,
-0.37301158905029297,
-0.3034265637397766,
-0.019777558743953705,
-0.606201708316803,
0.00012835487723350525,
0.004050400108098984,
-0.20931224524974823,
0.42495083808898926,
-0.05781005695462227,
-0.3502541184425354,
0.5912764072418213,
-0.3381415009498596,
0.08814430236816406,
-0.21939721703529358,
0.09057898074388504,
0.07562681287527084,
0.06658387184143066,
0.22453032433986664,
-0.0499744638800621,
-0.11331059783697128,
-0.4267258644104004,
-0.24010314047336578,
-0.2405204176902771,
0.40968477725982666,
-0.37012097239494324,
-0.1007474809885025,
-0.13668981194496155,
-0.3043428063392639,
-0.0966453030705452,
0.005863375961780548,
-0.04695793241262436,
0.06841325014829636,
0.14428788423538208,
-0.17190629243850708,
0.1301976442337036,
-0.07909689843654633,
-0.052401527762413025,
-0.12111671268939972,
0.2273588478565216,
-0.2594868838787079,
-0.2101680040359497,
0.3971303403377533,
0.12155332416296005,
-0.2633444368839264,
-0.16250447928905487,
0.049894750118255615,
-0.11894838511943817,
-0.30585232377052307,
-0.0868089348077774,
0.08560147136449814,
-0.10372979938983917,
0.05212811380624771,
0.08991599082946777,
0.14536239206790924,
0.04630175977945328,
0.02371421456336975,
-0.46576231718063354,
-0.1444142758846283,
0.33241701126098633,
-0.0263862032443285,
0.21902932226657867,
-0.16694171726703644,
-0.14410270750522614,
0.13567489385604858,
-0.031051678583025932,
-0.20413824915885925,
0.10186794400215149,
0.20448264479637146,
0.22578826546669006,
0.05633607134222984,
0.01620342768728733,
0.18995505571365356,
-0.27500054240226746,
-0.0026572681963443756,
0.04666141793131828,
-0.3123891353607178,
-0.00710136815905571,
-0.1346241533756256,
0.27495816349983215,
0.08997180312871933,
-0.3378797173500061,
0.10601218044757843,
-0.023355308920145035,
-0.2518883943557739,
-0.31359007954597473,
0.01891321688890457,
0.13236814737319946,
-0.18413738906383514,
-0.0060387589037418365,
0.07058614492416382,
0.1286289095878601,
-0.07012122124433517,
0.12594091892242432,
0.015206249430775642,
0.08092226833105087,
0.308966726064682,
0.19208374619483948,
-0.016553163528442383,
-0.04961317777633667,
-0.053215306252241135,
0.22263884544372559,
-0.03684983775019646,
-0.07609260082244873,
0.13448898494243622,
-0.29783064126968384,
-0.009367622435092926,
0.4454352855682373,
0.18453775346279144,
0.6857518553733826,
-0.12068187445402145,
0.05556870996952057,
0.08004177361726761,
0.08756674826145172,
-0.00683072954416275,
-0.007918812334537506,
-0.048252083361148834,
0.24565450847148895,
-0.09880185127258301,
0.28393763303756714,
0.1330655813217163,
-0.36537498235702515,
0.01902661845088005,
0.17367951571941376,
0.13045048713684082,
-0.1283191442489624,
0.08824574947357178,
0.7129381895065308,
-0.04891401156783104,
0.0782170370221138,
-0.10460636019706726,
-0.14702528715133667,
0.0594286173582077,
0.24855662882328033,
-0.48144787549972534,
0.10729558020830154,
0.2871219515800476,
-0.0034803934395313263,
-0.03293869271874428,
-0.5146503448486328,
-0.1732814610004425,
0.4555957019329071,
0.012798868119716644,
0.09392284601926804,
0.15349701046943665,
0.28658968210220337,
-0.4708642363548279,
-0.06937574595212936,
0.014115259051322937,
-0.16176843643188477,
-0.20174631476402283,
0.07785511016845703,
0.4016444683074951,
-0.2385188192129135,
-0.2536187469959259,
-0.06496354937553406,
-0.20226696133613586,
-0.2064248025417328,
-0.16271351277828217,
-0.050924405455589294,
0.01518799178302288,
-0.2840879261493683,
-0.23341940343379974,
-0.01324634812772274,
0.09218625724315643,
-0.3112953305244446,
0.23744700849056244,
0.3032325506210327,
-0.2797801196575165,
0.38987892866134644,
0.33272209763526917,
0.3134801983833313,
0.37833598256111145,
0.04781593754887581,
-0.17094974219799042,
-0.07845340669155121,
-0.026743929833173752,
0.20055435597896576,
0.4092733561992645,
0.031013019382953644,
0.32037633657455444,
0.3283001780509949,
0.014640580862760544,
-0.08389662206172943,
-0.2958451807498932,
0.14827463030815125,
-0.2095751315355301,
-0.6450566649436951,
0.6928914189338684,
-0.24998123943805695,
-0.10601246356964111,
-0.017907211557030678,
0.16609330475330353,
-0.22683022916316986,
0.04262946546077728,
0.521144688129425,
0.3244016468524933,
0.12816248834133148,
0.2558424174785614,
0.03910692036151886,
-0.13781395554542542,
0.24463161826133728,
0.27388665080070496,
0.07700177282094955,
-0.15622597932815552,
0.04958409070968628,
-0.6452693939208984,
-0.12914186716079712,
-0.031144512817263603,
0.0005436018109321594,
0.019787825644016266,
0.10342984646558762,
0.11867766082286835,
0.2379944771528244,
-0.11887377500534058,
0.09634602069854736,
0.5744260549545288,
-0.21504133939743042,
-0.2127048373222351,
-0.10693959891796112,
0.17755445837974548,
-0.12562133371829987,
-0.18995913863182068,
-0.5206833481788635,
0.06388142704963684,
-0.08415568619966507,
-0.09346799552440643,
-0.24923253059387207,
0.012487582862377167,
-0.10319863259792328,
0.0343782864511013,
0.17088237404823303,
0.09636779129505157,
0.5322657823562622,
-0.1261870265007019,
-0.32451331615448,
-0.3152916729450226,
-0.04203229025006294,
0.036233969032764435,
0.19935694336891174,
-0.13211767375469208,
0.38022711873054504,
-0.18788117170333862,
0.16983675956726074,
-0.34704285860061646,
0.32919585704803467,
-0.11708049476146698,
0.18016721308231354,
-0.4201682209968567,
-0.005040924996137619,
-0.41661766171455383,
0.18146862089633942,
0.05345861613750458,
-0.22326934337615967,
-0.0794333666563034,
0.008804969489574432,
-0.499805748462677,
-0.28783613443374634,
0.528273344039917,
-0.2095530778169632,
-0.014439322054386139,
0.016815293580293655,
0.44252318143844604,
0.32096442580223083,
0.13171188533306122,
-1.0341064929962158,
0.14135991036891937,
0.35800909996032715,
0.04677759110927582,
-0.3209111988544464,
0.24520960450172424,
-0.18830297887325287,
-0.11204284429550171,
-0.06656389683485031,
0.20237530767917633,
0.044737160205841064,
-0.25587913393974304,
0.14269942045211792,
-0.41050130128860474
] |
https://github.com/huggingface/datasets/issues/5659 | @lhoestq @sanchit-gandhi. I encountered the same error (also on the TPU v4) when trying to run `datasets` from source.
Downgrading soundfile with `pip install soundfile==0.12.0` seems to fix the issue for me. | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files | ### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28 | 32 | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files
### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28
@lhoestq @sanchit-gandhi. I encountered the same error (also on the TPU v4) when trying to run `datasets` from source.
Downgrading soundfile with `pip install soundfile==0.12.0` seems to fix the issue for me. | [
-0.049880754202604294,
0.21389538049697876,
-0.02552657201886177,
0.37763962149620056,
0.36412861943244934,
-0.05396618694067001,
0.2889644503593445,
0.11923642456531525,
-0.2776981592178345,
0.2703988552093506,
-0.33914411067962646,
0.02121618017554283,
-0.19508084654808044,
-0.05244786664843559,
-0.07602284848690033,
-0.053154755383729935,
-0.146317720413208,
0.5547893047332764,
0.1439652442932129,
0.06756901741027832,
-0.16367927193641663,
0.3902137875556946,
-0.12376674264669418,
-0.06845317035913467,
-0.24915023148059845,
0.048388101160526276,
0.12746968865394592,
0.17041106522083282,
-0.4433642625808716,
-0.35512402653694153,
0.4380989372730255,
0.2319992333650589,
-0.05099821090698242,
0.29043030738830566,
-0.00012352937483228743,
-0.11559702455997467,
0.20513415336608887,
-0.2270914912223816,
-0.40592265129089355,
-0.11279238760471344,
-0.212590754032135,
-0.131047785282135,
-0.018999427556991577,
-0.054712213575839996,
-0.054331302642822266,
-0.3607732355594635,
-0.2069346010684967,
-0.1928735375404358,
0.233961820602417,
0.3014804720878601,
0.13623759150505066,
0.17275191843509674,
-0.004351221024990082,
0.1199047714471817,
0.5826959609985352,
0.05023296922445297,
-0.12111442536115646,
0.09400640428066254,
0.2956078052520752,
0.06883106380701065,
0.16029924154281616,
0.11522360146045685,
-0.026204582303762436,
0.22168073058128357,
0.2528781592845917,
-0.09834760427474976,
0.10960826277732849,
-0.2319716513156891,
0.061605263501405716,
0.5462928414344788,
0.8929854035377502,
-0.13209515810012817,
-0.6255757808685303,
-0.3807216286659241,
-0.15301282703876495,
-0.1855306327342987,
0.3686770796775818,
-0.2373051643371582,
-0.10350987315177917,
0.29939761757850647,
-0.04895247891545296,
-0.0039725229144096375,
0.15861666202545166,
0.2882198095321655,
0.04949945956468582,
-0.1935369074344635,
-0.08759509027004242,
-0.1538151502609253,
0.31666818261146545,
-0.23562124371528625,
-0.1479191780090332,
-0.057447001338005066,
-0.06832793354988098,
0.21306248009204865,
-0.14738141000270844,
-0.10396292060613632,
0.08840421587228775,
0.07939273118972778,
0.07031139731407166,
0.15621960163116455,
-0.15107758343219757,
-0.053061552345752716,
-0.4215264618396759,
-0.046277355402708054,
0.1598110795021057,
-0.22630348801612854,
-0.062266863882541656,
-0.12766967713832855,
0.15912313759326935,
-0.09006772935390472,
0.3275679051876068,
-0.04262600094079971,
0.15337440371513367,
-0.37258824706077576,
-0.3740416169166565,
-0.01362275518476963,
0.30175721645355225,
-0.4751899242401123,
-0.41212451457977295,
0.04797927662730217,
-0.335199236869812,
-0.05054696649312973,
0.12953968346118927,
-0.04075709730386734,
0.09004686027765274,
0.5219283103942871,
0.4176955819129944,
0.19073054194450378,
-0.3532955050468445,
0.1694779247045517,
-0.021708309650421143,
-0.22332720458507538,
0.19873616099357605,
-0.02517165243625641,
0.3993792235851288,
-0.3515942096710205,
0.4323694109916687,
0.10456891357898712,
0.2842091917991638,
-0.049148090183734894,
-0.03585126996040344,
-0.07394207268953323,
-0.21954584121704102,
0.3524152636528015,
-0.17553046345710754,
0.019895687699317932,
-0.3287624716758728,
-0.11586916446685791,
-0.14956486225128174,
0.07563798129558563,
-0.20093664526939392,
-0.18875625729560852,
0.08634163439273834,
0.11109669506549835,
-0.4830392599105835,
0.27278685569763184,
-0.0029814280569553375,
-0.03812029957771301,
0.16576921939849854,
-0.41605913639068604,
0.024478504434227943,
-0.4133132994174957,
-0.2350761592388153,
-0.005670331418514252,
0.21449881792068481,
0.3355960249900818,
-0.3807133436203003,
-0.16003093123435974,
0.1093781590461731,
-0.1582372486591339,
-0.014331512153148651,
0.28229060769081116,
-0.13150735199451447,
0.29842907190322876,
-0.1967371106147766,
-0.10386650264263153,
0.5670567750930786,
-0.3654792308807373,
-0.42812711000442505,
0.1869962513446808,
0.08179593086242676,
0.4688357710838318,
0.07916706800460815,
-0.09337296336889267,
-0.09169740974903107,
-0.2231377810239792,
0.026687733829021454,
0.2629302144050598,
0.021867593750357628,
-0.18678542971611023,
0.0036608055233955383,
-0.4244551360607147,
0.06699034571647644,
0.3080374598503113,
0.03281782194972038,
-0.0945151299238205,
-0.01241455227136612,
0.4726387858390808,
0.2068977952003479,
-0.05670391768217087,
-0.05299684405326843,
0.10259047150611877,
0.5188701152801514,
0.23160745203495026,
0.11004562675952911,
-0.27419614791870117,
-0.08054119348526001,
0.11274544894695282,
0.26938340067863464,
0.04825346916913986,
-0.018937665969133377,
-0.10919047892093658,
0.13499833643436432,
-0.3264015316963196,
-0.2200787365436554,
0.24825221300125122,
-0.02232525497674942,
0.19468650221824646,
-0.22108615934848785,
-0.16697615385055542,
-0.0948956310749054,
0.10557926446199417,
-0.041065700352191925,
0.08541779220104218,
-0.30294209718704224,
-0.013122964650392532,
-0.022907255217432976,
0.08476229012012482,
0.15625116229057312,
0.41044124960899353,
0.046248309314250946,
-0.028219161555171013,
-0.10161028802394867,
0.29566460847854614,
0.5504580140113831,
-0.04094335064291954,
-0.4070577621459961,
0.5133808851242065,
0.30632925033569336,
0.05058152973651886,
-0.0856696292757988,
0.11710736155509949,
0.13307631015777588,
-0.20405864715576172,
0.16750679910182953,
0.2205520123243332,
-0.15079250931739807,
0.20390070974826813,
0.22054103016853333,
-0.2713400721549988,
0.2415943741798401,
0.286283940076828,
-0.2198144793510437,
-0.01912011206150055,
0.3594229221343994,
-0.17885804176330566,
0.40677785873413086,
-0.033479444682598114,
-0.14399105310440063,
-0.10318043828010559,
0.3257092237472534,
-0.06670576333999634,
-0.1779118776321411,
0.02396165020763874,
0.24085742235183716,
0.00036713480949401855,
0.051515594124794006,
0.32336050271987915,
0.6417386531829834,
0.23663672804832458,
0.0583278052508831,
-0.1511276513338089,
0.14702802896499634,
-0.46651220321655273,
0.14897891879081726,
0.1944667398929596,
-0.18413323163986206,
0.19084791839122772,
-0.04314263537526131,
0.2557905614376068,
-0.15247607231140137,
-0.17638370394706726,
0.07772140204906464,
0.10773403942584991,
-0.6525932550430298,
-0.07663445174694061,
-0.5262326598167419,
-0.1669667363166809,
-0.05134958401322365,
-0.28166258335113525,
-0.22957497835159302,
-0.08068374544382095,
0.09765132516622543,
0.07579837739467621,
-0.08529283851385117,
0.10263793170452118,
-0.0048494115471839905,
0.2893795967102051,
0.022972434759140015,
-0.3243034780025482,
0.1744280904531479,
0.3457619845867157,
-0.18844205141067505,
0.05915559083223343,
0.2852771580219269,
0.0943983644247055,
0.08993659168481827,
-0.31309956312179565,
-0.04984241724014282,
0.09779687225818634,
-0.2658802568912506,
0.1755244880914688,
-0.051112040877342224,
0.4030529260635376,
0.4598187506198883,
0.2776840329170227,
-0.01574307680130005,
-0.29303157329559326,
0.12528514862060547,
0.3331541121006012,
-0.03231336921453476,
-0.0120614655315876,
0.09485800564289093,
-0.05390311777591705,
-0.3954113721847534,
-0.4637475609779358,
-0.09166411310434341,
-0.342678427696228,
0.4091050624847412,
-0.0009286105632781982,
0.29537221789360046,
0.7557628154754639,
0.10837189108133316,
0.16713321208953857,
0.05080293118953705,
0.3576146066188812,
-0.17955073714256287,
-0.2276766151189804,
0.28309252858161926,
-0.11396460235118866,
-0.303384929895401,
-0.04539373517036438,
0.35711732506752014,
0.14031872153282166,
0.3954789638519287,
-0.3866767883300781,
-0.09279977530241013,
0.059751659631729126,
0.12738268077373505,
-0.08320583403110504,
0.15560562908649445,
0.1681663691997528,
0.35791730880737305,
0.09560039639472961,
-0.2865777611732483,
-0.18124669790267944,
0.08127886056900024,
-0.05408429354429245,
0.4320569932460785,
0.021040581166744232,
0.17854969203472137,
-0.22137151658535004,
0.5179806351661682,
0.052715882658958435,
-0.09091222286224365,
0.1991945207118988,
0.06482471525669098,
0.5033174157142639,
-0.060297902673482895,
-0.06210479885339737,
0.15956968069076538,
0.13854898512363434,
0.04431522637605667,
0.2818880081176758,
0.2857184112071991,
0.2571042776107788,
-0.3721221089363098,
0.3562707006931305,
-0.04199487715959549,
-0.14647933840751648,
0.1360076516866684,
0.07740478217601776,
0.05388224124908447,
0.051632463932037354,
0.353665292263031,
0.2875666320323944,
0.013879232108592987,
-0.1203811764717102,
0.5422342419624329,
0.21971572935581207,
0.0034470371901988983,
-0.036417052149772644,
-0.18140414357185364,
-0.019346676766872406,
0.0817226842045784,
0.1935337781906128,
0.4616091549396515,
-0.12792667746543884,
0.21326756477355957,
-0.15885350108146667,
0.03416925668716431,
0.07593531161546707,
-0.272318959236145,
0.05997177213430405,
0.12492083758115768,
0.2236122488975525,
-0.10954473912715912,
-0.14760330319404602,
-0.25815439224243164,
-0.21468180418014526,
0.22984443604946136,
0.28489768505096436,
-0.2363368570804596,
-0.4179784059524536,
-0.09194179624319077,
0.2912096083164215,
0.06766165792942047,
-0.1665307581424713,
-0.2633426785469055,
-0.47394129633903503,
-0.18938100337982178,
-0.1969667226076126,
0.03286519646644592,
0.2830890119075775,
-0.0696721151471138,
-0.07128984481096268,
0.23050127923488617,
-0.1764470934867859,
0.4720379710197449,
-0.1110110953450203,
0.24739310145378113,
0.07275800406932831,
0.17503520846366882,
0.07667746394872665,
-0.27621522545814514,
0.6093207001686096,
0.4613340497016907,
-0.5748463273048401,
0.05490966886281967,
0.049286969006061554,
-0.10494129359722137,
0.12657833099365234,
0.49734050035476685,
-0.203236922621727,
0.03332185000181198,
-0.20988425612449646,
-0.16689932346343994,
-0.0899110734462738,
0.3369802236557007,
0.3057073950767517,
-0.14112025499343872,
-0.019365880638360977,
-0.5954620242118835,
0.4933858811855316,
-0.13040564954280853,
-0.07425784319639206,
0.5431771874427795,
0.3751167058944702,
-0.2540671229362488,
0.050071295350790024,
-0.20028972625732422,
0.938000500202179,
0.1679849624633789,
-0.03475185111165047,
0.39505746960639954,
-0.27726638317108154,
0.24796538054943085,
-0.13314253091812134,
-0.04472142085433006,
0.15066981315612793,
-0.07901407778263092,
-0.2124829888343811,
-0.08163972198963165,
0.15276764333248138,
0.24742946028709412,
-0.19619068503379822,
0.2571852505207062,
0.2363925576210022,
-0.18507754802703857,
0.2410515993833542,
0.34127533435821533,
-0.08825967460870743,
-0.23929600417613983,
-0.4996219277381897,
0.05983947589993477,
-0.21201923489570618,
0.2821532189846039,
-0.23345227539539337,
-0.16736644506454468,
-0.16223132610321045,
-0.37301158905029297,
-0.3034265637397766,
-0.019777558743953705,
-0.606201708316803,
0.00012835487723350525,
0.004050400108098984,
-0.20931224524974823,
0.42495083808898926,
-0.05781005695462227,
-0.3502541184425354,
0.5912764072418213,
-0.3381415009498596,
0.08814430236816406,
-0.21939721703529358,
0.09057898074388504,
0.07562681287527084,
0.06658387184143066,
0.22453032433986664,
-0.0499744638800621,
-0.11331059783697128,
-0.4267258644104004,
-0.24010314047336578,
-0.2405204176902771,
0.40968477725982666,
-0.37012097239494324,
-0.1007474809885025,
-0.13668981194496155,
-0.3043428063392639,
-0.0966453030705452,
0.005863375961780548,
-0.04695793241262436,
0.06841325014829636,
0.14428788423538208,
-0.17190629243850708,
0.1301976442337036,
-0.07909689843654633,
-0.052401527762413025,
-0.12111671268939972,
0.2273588478565216,
-0.2594868838787079,
-0.2101680040359497,
0.3971303403377533,
0.12155332416296005,
-0.2633444368839264,
-0.16250447928905487,
0.049894750118255615,
-0.11894838511943817,
-0.30585232377052307,
-0.0868089348077774,
0.08560147136449814,
-0.10372979938983917,
0.05212811380624771,
0.08991599082946777,
0.14536239206790924,
0.04630175977945328,
0.02371421456336975,
-0.46576231718063354,
-0.1444142758846283,
0.33241701126098633,
-0.0263862032443285,
0.21902932226657867,
-0.16694171726703644,
-0.14410270750522614,
0.13567489385604858,
-0.031051678583025932,
-0.20413824915885925,
0.10186794400215149,
0.20448264479637146,
0.22578826546669006,
0.05633607134222984,
0.01620342768728733,
0.18995505571365356,
-0.27500054240226746,
-0.0026572681963443756,
0.04666141793131828,
-0.3123891353607178,
-0.00710136815905571,
-0.1346241533756256,
0.27495816349983215,
0.08997180312871933,
-0.3378797173500061,
0.10601218044757843,
-0.023355308920145035,
-0.2518883943557739,
-0.31359007954597473,
0.01891321688890457,
0.13236814737319946,
-0.18413738906383514,
-0.0060387589037418365,
0.07058614492416382,
0.1286289095878601,
-0.07012122124433517,
0.12594091892242432,
0.015206249430775642,
0.08092226833105087,
0.308966726064682,
0.19208374619483948,
-0.016553163528442383,
-0.04961317777633667,
-0.053215306252241135,
0.22263884544372559,
-0.03684983775019646,
-0.07609260082244873,
0.13448898494243622,
-0.29783064126968384,
-0.009367622435092926,
0.4454352855682373,
0.18453775346279144,
0.6857518553733826,
-0.12068187445402145,
0.05556870996952057,
0.08004177361726761,
0.08756674826145172,
-0.00683072954416275,
-0.007918812334537506,
-0.048252083361148834,
0.24565450847148895,
-0.09880185127258301,
0.28393763303756714,
0.1330655813217163,
-0.36537498235702515,
0.01902661845088005,
0.17367951571941376,
0.13045048713684082,
-0.1283191442489624,
0.08824574947357178,
0.7129381895065308,
-0.04891401156783104,
0.0782170370221138,
-0.10460636019706726,
-0.14702528715133667,
0.0594286173582077,
0.24855662882328033,
-0.48144787549972534,
0.10729558020830154,
0.2871219515800476,
-0.0034803934395313263,
-0.03293869271874428,
-0.5146503448486328,
-0.1732814610004425,
0.4555957019329071,
0.012798868119716644,
0.09392284601926804,
0.15349701046943665,
0.28658968210220337,
-0.4708642363548279,
-0.06937574595212936,
0.014115259051322937,
-0.16176843643188477,
-0.20174631476402283,
0.07785511016845703,
0.4016444683074951,
-0.2385188192129135,
-0.2536187469959259,
-0.06496354937553406,
-0.20226696133613586,
-0.2064248025417328,
-0.16271351277828217,
-0.050924405455589294,
0.01518799178302288,
-0.2840879261493683,
-0.23341940343379974,
-0.01324634812772274,
0.09218625724315643,
-0.3112953305244446,
0.23744700849056244,
0.3032325506210327,
-0.2797801196575165,
0.38987892866134644,
0.33272209763526917,
0.3134801983833313,
0.37833598256111145,
0.04781593754887581,
-0.17094974219799042,
-0.07845340669155121,
-0.026743929833173752,
0.20055435597896576,
0.4092733561992645,
0.031013019382953644,
0.32037633657455444,
0.3283001780509949,
0.014640580862760544,
-0.08389662206172943,
-0.2958451807498932,
0.14827463030815125,
-0.2095751315355301,
-0.6450566649436951,
0.6928914189338684,
-0.24998123943805695,
-0.10601246356964111,
-0.017907211557030678,
0.16609330475330353,
-0.22683022916316986,
0.04262946546077728,
0.521144688129425,
0.3244016468524933,
0.12816248834133148,
0.2558424174785614,
0.03910692036151886,
-0.13781395554542542,
0.24463161826133728,
0.27388665080070496,
0.07700177282094955,
-0.15622597932815552,
0.04958409070968628,
-0.6452693939208984,
-0.12914186716079712,
-0.031144512817263603,
0.0005436018109321594,
0.019787825644016266,
0.10342984646558762,
0.11867766082286835,
0.2379944771528244,
-0.11887377500534058,
0.09634602069854736,
0.5744260549545288,
-0.21504133939743042,
-0.2127048373222351,
-0.10693959891796112,
0.17755445837974548,
-0.12562133371829987,
-0.18995913863182068,
-0.5206833481788635,
0.06388142704963684,
-0.08415568619966507,
-0.09346799552440643,
-0.24923253059387207,
0.012487582862377167,
-0.10319863259792328,
0.0343782864511013,
0.17088237404823303,
0.09636779129505157,
0.5322657823562622,
-0.1261870265007019,
-0.32451331615448,
-0.3152916729450226,
-0.04203229025006294,
0.036233969032764435,
0.19935694336891174,
-0.13211767375469208,
0.38022711873054504,
-0.18788117170333862,
0.16983675956726074,
-0.34704285860061646,
0.32919585704803467,
-0.11708049476146698,
0.18016721308231354,
-0.4201682209968567,
-0.005040924996137619,
-0.41661766171455383,
0.18146862089633942,
0.05345861613750458,
-0.22326934337615967,
-0.0794333666563034,
0.008804969489574432,
-0.499805748462677,
-0.28783613443374634,
0.528273344039917,
-0.2095530778169632,
-0.014439322054386139,
0.016815293580293655,
0.44252318143844604,
0.32096442580223083,
0.13171188533306122,
-1.0341064929962158,
0.14135991036891937,
0.35800909996032715,
0.04677759110927582,
-0.3209111988544464,
0.24520960450172424,
-0.18830297887325287,
-0.11204284429550171,
-0.06656389683485031,
0.20237530767917633,
0.044737160205841064,
-0.25587913393974304,
0.14269942045211792,
-0.41050130128860474
] |
https://github.com/huggingface/datasets/issues/5659 | Maybe let's open an issue at https://github.com/bastibe/python-soundfile/issues in case they might know why you get `OSError: cannot load library 'libsndfile.so'` ? | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files | ### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28 | 21 | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files
### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28
Maybe let's open an issue at https://github.com/bastibe/python-soundfile/issues in case they might know why you get `OSError: cannot load library 'libsndfile.so'` ? | [
-0.049880754202604294,
0.21389538049697876,
-0.02552657201886177,
0.37763962149620056,
0.36412861943244934,
-0.05396618694067001,
0.2889644503593445,
0.11923642456531525,
-0.2776981592178345,
0.2703988552093506,
-0.33914411067962646,
0.02121618017554283,
-0.19508084654808044,
-0.05244786664843559,
-0.07602284848690033,
-0.053154755383729935,
-0.146317720413208,
0.5547893047332764,
0.1439652442932129,
0.06756901741027832,
-0.16367927193641663,
0.3902137875556946,
-0.12376674264669418,
-0.06845317035913467,
-0.24915023148059845,
0.048388101160526276,
0.12746968865394592,
0.17041106522083282,
-0.4433642625808716,
-0.35512402653694153,
0.4380989372730255,
0.2319992333650589,
-0.05099821090698242,
0.29043030738830566,
-0.00012352937483228743,
-0.11559702455997467,
0.20513415336608887,
-0.2270914912223816,
-0.40592265129089355,
-0.11279238760471344,
-0.212590754032135,
-0.131047785282135,
-0.018999427556991577,
-0.054712213575839996,
-0.054331302642822266,
-0.3607732355594635,
-0.2069346010684967,
-0.1928735375404358,
0.233961820602417,
0.3014804720878601,
0.13623759150505066,
0.17275191843509674,
-0.004351221024990082,
0.1199047714471817,
0.5826959609985352,
0.05023296922445297,
-0.12111442536115646,
0.09400640428066254,
0.2956078052520752,
0.06883106380701065,
0.16029924154281616,
0.11522360146045685,
-0.026204582303762436,
0.22168073058128357,
0.2528781592845917,
-0.09834760427474976,
0.10960826277732849,
-0.2319716513156891,
0.061605263501405716,
0.5462928414344788,
0.8929854035377502,
-0.13209515810012817,
-0.6255757808685303,
-0.3807216286659241,
-0.15301282703876495,
-0.1855306327342987,
0.3686770796775818,
-0.2373051643371582,
-0.10350987315177917,
0.29939761757850647,
-0.04895247891545296,
-0.0039725229144096375,
0.15861666202545166,
0.2882198095321655,
0.04949945956468582,
-0.1935369074344635,
-0.08759509027004242,
-0.1538151502609253,
0.31666818261146545,
-0.23562124371528625,
-0.1479191780090332,
-0.057447001338005066,
-0.06832793354988098,
0.21306248009204865,
-0.14738141000270844,
-0.10396292060613632,
0.08840421587228775,
0.07939273118972778,
0.07031139731407166,
0.15621960163116455,
-0.15107758343219757,
-0.053061552345752716,
-0.4215264618396759,
-0.046277355402708054,
0.1598110795021057,
-0.22630348801612854,
-0.062266863882541656,
-0.12766967713832855,
0.15912313759326935,
-0.09006772935390472,
0.3275679051876068,
-0.04262600094079971,
0.15337440371513367,
-0.37258824706077576,
-0.3740416169166565,
-0.01362275518476963,
0.30175721645355225,
-0.4751899242401123,
-0.41212451457977295,
0.04797927662730217,
-0.335199236869812,
-0.05054696649312973,
0.12953968346118927,
-0.04075709730386734,
0.09004686027765274,
0.5219283103942871,
0.4176955819129944,
0.19073054194450378,
-0.3532955050468445,
0.1694779247045517,
-0.021708309650421143,
-0.22332720458507538,
0.19873616099357605,
-0.02517165243625641,
0.3993792235851288,
-0.3515942096710205,
0.4323694109916687,
0.10456891357898712,
0.2842091917991638,
-0.049148090183734894,
-0.03585126996040344,
-0.07394207268953323,
-0.21954584121704102,
0.3524152636528015,
-0.17553046345710754,
0.019895687699317932,
-0.3287624716758728,
-0.11586916446685791,
-0.14956486225128174,
0.07563798129558563,
-0.20093664526939392,
-0.18875625729560852,
0.08634163439273834,
0.11109669506549835,
-0.4830392599105835,
0.27278685569763184,
-0.0029814280569553375,
-0.03812029957771301,
0.16576921939849854,
-0.41605913639068604,
0.024478504434227943,
-0.4133132994174957,
-0.2350761592388153,
-0.005670331418514252,
0.21449881792068481,
0.3355960249900818,
-0.3807133436203003,
-0.16003093123435974,
0.1093781590461731,
-0.1582372486591339,
-0.014331512153148651,
0.28229060769081116,
-0.13150735199451447,
0.29842907190322876,
-0.1967371106147766,
-0.10386650264263153,
0.5670567750930786,
-0.3654792308807373,
-0.42812711000442505,
0.1869962513446808,
0.08179593086242676,
0.4688357710838318,
0.07916706800460815,
-0.09337296336889267,
-0.09169740974903107,
-0.2231377810239792,
0.026687733829021454,
0.2629302144050598,
0.021867593750357628,
-0.18678542971611023,
0.0036608055233955383,
-0.4244551360607147,
0.06699034571647644,
0.3080374598503113,
0.03281782194972038,
-0.0945151299238205,
-0.01241455227136612,
0.4726387858390808,
0.2068977952003479,
-0.05670391768217087,
-0.05299684405326843,
0.10259047150611877,
0.5188701152801514,
0.23160745203495026,
0.11004562675952911,
-0.27419614791870117,
-0.08054119348526001,
0.11274544894695282,
0.26938340067863464,
0.04825346916913986,
-0.018937665969133377,
-0.10919047892093658,
0.13499833643436432,
-0.3264015316963196,
-0.2200787365436554,
0.24825221300125122,
-0.02232525497674942,
0.19468650221824646,
-0.22108615934848785,
-0.16697615385055542,
-0.0948956310749054,
0.10557926446199417,
-0.041065700352191925,
0.08541779220104218,
-0.30294209718704224,
-0.013122964650392532,
-0.022907255217432976,
0.08476229012012482,
0.15625116229057312,
0.41044124960899353,
0.046248309314250946,
-0.028219161555171013,
-0.10161028802394867,
0.29566460847854614,
0.5504580140113831,
-0.04094335064291954,
-0.4070577621459961,
0.5133808851242065,
0.30632925033569336,
0.05058152973651886,
-0.0856696292757988,
0.11710736155509949,
0.13307631015777588,
-0.20405864715576172,
0.16750679910182953,
0.2205520123243332,
-0.15079250931739807,
0.20390070974826813,
0.22054103016853333,
-0.2713400721549988,
0.2415943741798401,
0.286283940076828,
-0.2198144793510437,
-0.01912011206150055,
0.3594229221343994,
-0.17885804176330566,
0.40677785873413086,
-0.033479444682598114,
-0.14399105310440063,
-0.10318043828010559,
0.3257092237472534,
-0.06670576333999634,
-0.1779118776321411,
0.02396165020763874,
0.24085742235183716,
0.00036713480949401855,
0.051515594124794006,
0.32336050271987915,
0.6417386531829834,
0.23663672804832458,
0.0583278052508831,
-0.1511276513338089,
0.14702802896499634,
-0.46651220321655273,
0.14897891879081726,
0.1944667398929596,
-0.18413323163986206,
0.19084791839122772,
-0.04314263537526131,
0.2557905614376068,
-0.15247607231140137,
-0.17638370394706726,
0.07772140204906464,
0.10773403942584991,
-0.6525932550430298,
-0.07663445174694061,
-0.5262326598167419,
-0.1669667363166809,
-0.05134958401322365,
-0.28166258335113525,
-0.22957497835159302,
-0.08068374544382095,
0.09765132516622543,
0.07579837739467621,
-0.08529283851385117,
0.10263793170452118,
-0.0048494115471839905,
0.2893795967102051,
0.022972434759140015,
-0.3243034780025482,
0.1744280904531479,
0.3457619845867157,
-0.18844205141067505,
0.05915559083223343,
0.2852771580219269,
0.0943983644247055,
0.08993659168481827,
-0.31309956312179565,
-0.04984241724014282,
0.09779687225818634,
-0.2658802568912506,
0.1755244880914688,
-0.051112040877342224,
0.4030529260635376,
0.4598187506198883,
0.2776840329170227,
-0.01574307680130005,
-0.29303157329559326,
0.12528514862060547,
0.3331541121006012,
-0.03231336921453476,
-0.0120614655315876,
0.09485800564289093,
-0.05390311777591705,
-0.3954113721847534,
-0.4637475609779358,
-0.09166411310434341,
-0.342678427696228,
0.4091050624847412,
-0.0009286105632781982,
0.29537221789360046,
0.7557628154754639,
0.10837189108133316,
0.16713321208953857,
0.05080293118953705,
0.3576146066188812,
-0.17955073714256287,
-0.2276766151189804,
0.28309252858161926,
-0.11396460235118866,
-0.303384929895401,
-0.04539373517036438,
0.35711732506752014,
0.14031872153282166,
0.3954789638519287,
-0.3866767883300781,
-0.09279977530241013,
0.059751659631729126,
0.12738268077373505,
-0.08320583403110504,
0.15560562908649445,
0.1681663691997528,
0.35791730880737305,
0.09560039639472961,
-0.2865777611732483,
-0.18124669790267944,
0.08127886056900024,
-0.05408429354429245,
0.4320569932460785,
0.021040581166744232,
0.17854969203472137,
-0.22137151658535004,
0.5179806351661682,
0.052715882658958435,
-0.09091222286224365,
0.1991945207118988,
0.06482471525669098,
0.5033174157142639,
-0.060297902673482895,
-0.06210479885339737,
0.15956968069076538,
0.13854898512363434,
0.04431522637605667,
0.2818880081176758,
0.2857184112071991,
0.2571042776107788,
-0.3721221089363098,
0.3562707006931305,
-0.04199487715959549,
-0.14647933840751648,
0.1360076516866684,
0.07740478217601776,
0.05388224124908447,
0.051632463932037354,
0.353665292263031,
0.2875666320323944,
0.013879232108592987,
-0.1203811764717102,
0.5422342419624329,
0.21971572935581207,
0.0034470371901988983,
-0.036417052149772644,
-0.18140414357185364,
-0.019346676766872406,
0.0817226842045784,
0.1935337781906128,
0.4616091549396515,
-0.12792667746543884,
0.21326756477355957,
-0.15885350108146667,
0.03416925668716431,
0.07593531161546707,
-0.272318959236145,
0.05997177213430405,
0.12492083758115768,
0.2236122488975525,
-0.10954473912715912,
-0.14760330319404602,
-0.25815439224243164,
-0.21468180418014526,
0.22984443604946136,
0.28489768505096436,
-0.2363368570804596,
-0.4179784059524536,
-0.09194179624319077,
0.2912096083164215,
0.06766165792942047,
-0.1665307581424713,
-0.2633426785469055,
-0.47394129633903503,
-0.18938100337982178,
-0.1969667226076126,
0.03286519646644592,
0.2830890119075775,
-0.0696721151471138,
-0.07128984481096268,
0.23050127923488617,
-0.1764470934867859,
0.4720379710197449,
-0.1110110953450203,
0.24739310145378113,
0.07275800406932831,
0.17503520846366882,
0.07667746394872665,
-0.27621522545814514,
0.6093207001686096,
0.4613340497016907,
-0.5748463273048401,
0.05490966886281967,
0.049286969006061554,
-0.10494129359722137,
0.12657833099365234,
0.49734050035476685,
-0.203236922621727,
0.03332185000181198,
-0.20988425612449646,
-0.16689932346343994,
-0.0899110734462738,
0.3369802236557007,
0.3057073950767517,
-0.14112025499343872,
-0.019365880638360977,
-0.5954620242118835,
0.4933858811855316,
-0.13040564954280853,
-0.07425784319639206,
0.5431771874427795,
0.3751167058944702,
-0.2540671229362488,
0.050071295350790024,
-0.20028972625732422,
0.938000500202179,
0.1679849624633789,
-0.03475185111165047,
0.39505746960639954,
-0.27726638317108154,
0.24796538054943085,
-0.13314253091812134,
-0.04472142085433006,
0.15066981315612793,
-0.07901407778263092,
-0.2124829888343811,
-0.08163972198963165,
0.15276764333248138,
0.24742946028709412,
-0.19619068503379822,
0.2571852505207062,
0.2363925576210022,
-0.18507754802703857,
0.2410515993833542,
0.34127533435821533,
-0.08825967460870743,
-0.23929600417613983,
-0.4996219277381897,
0.05983947589993477,
-0.21201923489570618,
0.2821532189846039,
-0.23345227539539337,
-0.16736644506454468,
-0.16223132610321045,
-0.37301158905029297,
-0.3034265637397766,
-0.019777558743953705,
-0.606201708316803,
0.00012835487723350525,
0.004050400108098984,
-0.20931224524974823,
0.42495083808898926,
-0.05781005695462227,
-0.3502541184425354,
0.5912764072418213,
-0.3381415009498596,
0.08814430236816406,
-0.21939721703529358,
0.09057898074388504,
0.07562681287527084,
0.06658387184143066,
0.22453032433986664,
-0.0499744638800621,
-0.11331059783697128,
-0.4267258644104004,
-0.24010314047336578,
-0.2405204176902771,
0.40968477725982666,
-0.37012097239494324,
-0.1007474809885025,
-0.13668981194496155,
-0.3043428063392639,
-0.0966453030705452,
0.005863375961780548,
-0.04695793241262436,
0.06841325014829636,
0.14428788423538208,
-0.17190629243850708,
0.1301976442337036,
-0.07909689843654633,
-0.052401527762413025,
-0.12111671268939972,
0.2273588478565216,
-0.2594868838787079,
-0.2101680040359497,
0.3971303403377533,
0.12155332416296005,
-0.2633444368839264,
-0.16250447928905487,
0.049894750118255615,
-0.11894838511943817,
-0.30585232377052307,
-0.0868089348077774,
0.08560147136449814,
-0.10372979938983917,
0.05212811380624771,
0.08991599082946777,
0.14536239206790924,
0.04630175977945328,
0.02371421456336975,
-0.46576231718063354,
-0.1444142758846283,
0.33241701126098633,
-0.0263862032443285,
0.21902932226657867,
-0.16694171726703644,
-0.14410270750522614,
0.13567489385604858,
-0.031051678583025932,
-0.20413824915885925,
0.10186794400215149,
0.20448264479637146,
0.22578826546669006,
0.05633607134222984,
0.01620342768728733,
0.18995505571365356,
-0.27500054240226746,
-0.0026572681963443756,
0.04666141793131828,
-0.3123891353607178,
-0.00710136815905571,
-0.1346241533756256,
0.27495816349983215,
0.08997180312871933,
-0.3378797173500061,
0.10601218044757843,
-0.023355308920145035,
-0.2518883943557739,
-0.31359007954597473,
0.01891321688890457,
0.13236814737319946,
-0.18413738906383514,
-0.0060387589037418365,
0.07058614492416382,
0.1286289095878601,
-0.07012122124433517,
0.12594091892242432,
0.015206249430775642,
0.08092226833105087,
0.308966726064682,
0.19208374619483948,
-0.016553163528442383,
-0.04961317777633667,
-0.053215306252241135,
0.22263884544372559,
-0.03684983775019646,
-0.07609260082244873,
0.13448898494243622,
-0.29783064126968384,
-0.009367622435092926,
0.4454352855682373,
0.18453775346279144,
0.6857518553733826,
-0.12068187445402145,
0.05556870996952057,
0.08004177361726761,
0.08756674826145172,
-0.00683072954416275,
-0.007918812334537506,
-0.048252083361148834,
0.24565450847148895,
-0.09880185127258301,
0.28393763303756714,
0.1330655813217163,
-0.36537498235702515,
0.01902661845088005,
0.17367951571941376,
0.13045048713684082,
-0.1283191442489624,
0.08824574947357178,
0.7129381895065308,
-0.04891401156783104,
0.0782170370221138,
-0.10460636019706726,
-0.14702528715133667,
0.0594286173582077,
0.24855662882328033,
-0.48144787549972534,
0.10729558020830154,
0.2871219515800476,
-0.0034803934395313263,
-0.03293869271874428,
-0.5146503448486328,
-0.1732814610004425,
0.4555957019329071,
0.012798868119716644,
0.09392284601926804,
0.15349701046943665,
0.28658968210220337,
-0.4708642363548279,
-0.06937574595212936,
0.014115259051322937,
-0.16176843643188477,
-0.20174631476402283,
0.07785511016845703,
0.4016444683074951,
-0.2385188192129135,
-0.2536187469959259,
-0.06496354937553406,
-0.20226696133613586,
-0.2064248025417328,
-0.16271351277828217,
-0.050924405455589294,
0.01518799178302288,
-0.2840879261493683,
-0.23341940343379974,
-0.01324634812772274,
0.09218625724315643,
-0.3112953305244446,
0.23744700849056244,
0.3032325506210327,
-0.2797801196575165,
0.38987892866134644,
0.33272209763526917,
0.3134801983833313,
0.37833598256111145,
0.04781593754887581,
-0.17094974219799042,
-0.07845340669155121,
-0.026743929833173752,
0.20055435597896576,
0.4092733561992645,
0.031013019382953644,
0.32037633657455444,
0.3283001780509949,
0.014640580862760544,
-0.08389662206172943,
-0.2958451807498932,
0.14827463030815125,
-0.2095751315355301,
-0.6450566649436951,
0.6928914189338684,
-0.24998123943805695,
-0.10601246356964111,
-0.017907211557030678,
0.16609330475330353,
-0.22683022916316986,
0.04262946546077728,
0.521144688129425,
0.3244016468524933,
0.12816248834133148,
0.2558424174785614,
0.03910692036151886,
-0.13781395554542542,
0.24463161826133728,
0.27388665080070496,
0.07700177282094955,
-0.15622597932815552,
0.04958409070968628,
-0.6452693939208984,
-0.12914186716079712,
-0.031144512817263603,
0.0005436018109321594,
0.019787825644016266,
0.10342984646558762,
0.11867766082286835,
0.2379944771528244,
-0.11887377500534058,
0.09634602069854736,
0.5744260549545288,
-0.21504133939743042,
-0.2127048373222351,
-0.10693959891796112,
0.17755445837974548,
-0.12562133371829987,
-0.18995913863182068,
-0.5206833481788635,
0.06388142704963684,
-0.08415568619966507,
-0.09346799552440643,
-0.24923253059387207,
0.012487582862377167,
-0.10319863259792328,
0.0343782864511013,
0.17088237404823303,
0.09636779129505157,
0.5322657823562622,
-0.1261870265007019,
-0.32451331615448,
-0.3152916729450226,
-0.04203229025006294,
0.036233969032764435,
0.19935694336891174,
-0.13211767375469208,
0.38022711873054504,
-0.18788117170333862,
0.16983675956726074,
-0.34704285860061646,
0.32919585704803467,
-0.11708049476146698,
0.18016721308231354,
-0.4201682209968567,
-0.005040924996137619,
-0.41661766171455383,
0.18146862089633942,
0.05345861613750458,
-0.22326934337615967,
-0.0794333666563034,
0.008804969489574432,
-0.499805748462677,
-0.28783613443374634,
0.528273344039917,
-0.2095530778169632,
-0.014439322054386139,
0.016815293580293655,
0.44252318143844604,
0.32096442580223083,
0.13171188533306122,
-1.0341064929962158,
0.14135991036891937,
0.35800909996032715,
0.04677759110927582,
-0.3209111988544464,
0.24520960450172424,
-0.18830297887325287,
-0.11204284429550171,
-0.06656389683485031,
0.20237530767917633,
0.044737160205841064,
-0.25587913393974304,
0.14269942045211792,
-0.41050130128860474
] |
https://github.com/huggingface/datasets/issues/5659 | > @sanchit-gandhi can you please also post the logs of `pip install soundfile==0.12.1`? To check what wheel is being installed or if it's being built from source (I think it's the latter case). Required `libsndfile` binary **should** be bundeled with `soundfile` wheel but I assume it **might not** be the case for some non standard Linux distributions. The only solution for using `soundfile` here is to build [`libsndfile`](https://github.com/libsndfile/libsndfile) from source:
>
> ```shell
> git clone https://github.com/libsndfile/libsndfile.git
> cd libsndfile/
> autoreconf -vif
> ./configure --enable-werror
> make
> make install
> ```
This fixed the issue for me. After installing libsndfile as described above, I had to uninstall soundfile and re-install it with this command. `pip install "soundfile>=0.12.1"` | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files | ### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28 | 119 | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files
### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28
> @sanchit-gandhi can you please also post the logs of `pip install soundfile==0.12.1`? To check what wheel is being installed or if it's being built from source (I think it's the latter case). Required `libsndfile` binary **should** be bundeled with `soundfile` wheel but I assume it **might not** be the case for some non standard Linux distributions. The only solution for using `soundfile` here is to build [`libsndfile`](https://github.com/libsndfile/libsndfile) from source:
>
> ```shell
> git clone https://github.com/libsndfile/libsndfile.git
> cd libsndfile/
> autoreconf -vif
> ./configure --enable-werror
> make
> make install
> ```
This fixed the issue for me. After installing libsndfile as described above, I had to uninstall soundfile and re-install it with this command. `pip install "soundfile>=0.12.1"` | [
-0.049880754202604294,
0.21389538049697876,
-0.02552657201886177,
0.37763962149620056,
0.36412861943244934,
-0.05396618694067001,
0.2889644503593445,
0.11923642456531525,
-0.2776981592178345,
0.2703988552093506,
-0.33914411067962646,
0.02121618017554283,
-0.19508084654808044,
-0.05244786664843559,
-0.07602284848690033,
-0.053154755383729935,
-0.146317720413208,
0.5547893047332764,
0.1439652442932129,
0.06756901741027832,
-0.16367927193641663,
0.3902137875556946,
-0.12376674264669418,
-0.06845317035913467,
-0.24915023148059845,
0.048388101160526276,
0.12746968865394592,
0.17041106522083282,
-0.4433642625808716,
-0.35512402653694153,
0.4380989372730255,
0.2319992333650589,
-0.05099821090698242,
0.29043030738830566,
-0.00012352937483228743,
-0.11559702455997467,
0.20513415336608887,
-0.2270914912223816,
-0.40592265129089355,
-0.11279238760471344,
-0.212590754032135,
-0.131047785282135,
-0.018999427556991577,
-0.054712213575839996,
-0.054331302642822266,
-0.3607732355594635,
-0.2069346010684967,
-0.1928735375404358,
0.233961820602417,
0.3014804720878601,
0.13623759150505066,
0.17275191843509674,
-0.004351221024990082,
0.1199047714471817,
0.5826959609985352,
0.05023296922445297,
-0.12111442536115646,
0.09400640428066254,
0.2956078052520752,
0.06883106380701065,
0.16029924154281616,
0.11522360146045685,
-0.026204582303762436,
0.22168073058128357,
0.2528781592845917,
-0.09834760427474976,
0.10960826277732849,
-0.2319716513156891,
0.061605263501405716,
0.5462928414344788,
0.8929854035377502,
-0.13209515810012817,
-0.6255757808685303,
-0.3807216286659241,
-0.15301282703876495,
-0.1855306327342987,
0.3686770796775818,
-0.2373051643371582,
-0.10350987315177917,
0.29939761757850647,
-0.04895247891545296,
-0.0039725229144096375,
0.15861666202545166,
0.2882198095321655,
0.04949945956468582,
-0.1935369074344635,
-0.08759509027004242,
-0.1538151502609253,
0.31666818261146545,
-0.23562124371528625,
-0.1479191780090332,
-0.057447001338005066,
-0.06832793354988098,
0.21306248009204865,
-0.14738141000270844,
-0.10396292060613632,
0.08840421587228775,
0.07939273118972778,
0.07031139731407166,
0.15621960163116455,
-0.15107758343219757,
-0.053061552345752716,
-0.4215264618396759,
-0.046277355402708054,
0.1598110795021057,
-0.22630348801612854,
-0.062266863882541656,
-0.12766967713832855,
0.15912313759326935,
-0.09006772935390472,
0.3275679051876068,
-0.04262600094079971,
0.15337440371513367,
-0.37258824706077576,
-0.3740416169166565,
-0.01362275518476963,
0.30175721645355225,
-0.4751899242401123,
-0.41212451457977295,
0.04797927662730217,
-0.335199236869812,
-0.05054696649312973,
0.12953968346118927,
-0.04075709730386734,
0.09004686027765274,
0.5219283103942871,
0.4176955819129944,
0.19073054194450378,
-0.3532955050468445,
0.1694779247045517,
-0.021708309650421143,
-0.22332720458507538,
0.19873616099357605,
-0.02517165243625641,
0.3993792235851288,
-0.3515942096710205,
0.4323694109916687,
0.10456891357898712,
0.2842091917991638,
-0.049148090183734894,
-0.03585126996040344,
-0.07394207268953323,
-0.21954584121704102,
0.3524152636528015,
-0.17553046345710754,
0.019895687699317932,
-0.3287624716758728,
-0.11586916446685791,
-0.14956486225128174,
0.07563798129558563,
-0.20093664526939392,
-0.18875625729560852,
0.08634163439273834,
0.11109669506549835,
-0.4830392599105835,
0.27278685569763184,
-0.0029814280569553375,
-0.03812029957771301,
0.16576921939849854,
-0.41605913639068604,
0.024478504434227943,
-0.4133132994174957,
-0.2350761592388153,
-0.005670331418514252,
0.21449881792068481,
0.3355960249900818,
-0.3807133436203003,
-0.16003093123435974,
0.1093781590461731,
-0.1582372486591339,
-0.014331512153148651,
0.28229060769081116,
-0.13150735199451447,
0.29842907190322876,
-0.1967371106147766,
-0.10386650264263153,
0.5670567750930786,
-0.3654792308807373,
-0.42812711000442505,
0.1869962513446808,
0.08179593086242676,
0.4688357710838318,
0.07916706800460815,
-0.09337296336889267,
-0.09169740974903107,
-0.2231377810239792,
0.026687733829021454,
0.2629302144050598,
0.021867593750357628,
-0.18678542971611023,
0.0036608055233955383,
-0.4244551360607147,
0.06699034571647644,
0.3080374598503113,
0.03281782194972038,
-0.0945151299238205,
-0.01241455227136612,
0.4726387858390808,
0.2068977952003479,
-0.05670391768217087,
-0.05299684405326843,
0.10259047150611877,
0.5188701152801514,
0.23160745203495026,
0.11004562675952911,
-0.27419614791870117,
-0.08054119348526001,
0.11274544894695282,
0.26938340067863464,
0.04825346916913986,
-0.018937665969133377,
-0.10919047892093658,
0.13499833643436432,
-0.3264015316963196,
-0.2200787365436554,
0.24825221300125122,
-0.02232525497674942,
0.19468650221824646,
-0.22108615934848785,
-0.16697615385055542,
-0.0948956310749054,
0.10557926446199417,
-0.041065700352191925,
0.08541779220104218,
-0.30294209718704224,
-0.013122964650392532,
-0.022907255217432976,
0.08476229012012482,
0.15625116229057312,
0.41044124960899353,
0.046248309314250946,
-0.028219161555171013,
-0.10161028802394867,
0.29566460847854614,
0.5504580140113831,
-0.04094335064291954,
-0.4070577621459961,
0.5133808851242065,
0.30632925033569336,
0.05058152973651886,
-0.0856696292757988,
0.11710736155509949,
0.13307631015777588,
-0.20405864715576172,
0.16750679910182953,
0.2205520123243332,
-0.15079250931739807,
0.20390070974826813,
0.22054103016853333,
-0.2713400721549988,
0.2415943741798401,
0.286283940076828,
-0.2198144793510437,
-0.01912011206150055,
0.3594229221343994,
-0.17885804176330566,
0.40677785873413086,
-0.033479444682598114,
-0.14399105310440063,
-0.10318043828010559,
0.3257092237472534,
-0.06670576333999634,
-0.1779118776321411,
0.02396165020763874,
0.24085742235183716,
0.00036713480949401855,
0.051515594124794006,
0.32336050271987915,
0.6417386531829834,
0.23663672804832458,
0.0583278052508831,
-0.1511276513338089,
0.14702802896499634,
-0.46651220321655273,
0.14897891879081726,
0.1944667398929596,
-0.18413323163986206,
0.19084791839122772,
-0.04314263537526131,
0.2557905614376068,
-0.15247607231140137,
-0.17638370394706726,
0.07772140204906464,
0.10773403942584991,
-0.6525932550430298,
-0.07663445174694061,
-0.5262326598167419,
-0.1669667363166809,
-0.05134958401322365,
-0.28166258335113525,
-0.22957497835159302,
-0.08068374544382095,
0.09765132516622543,
0.07579837739467621,
-0.08529283851385117,
0.10263793170452118,
-0.0048494115471839905,
0.2893795967102051,
0.022972434759140015,
-0.3243034780025482,
0.1744280904531479,
0.3457619845867157,
-0.18844205141067505,
0.05915559083223343,
0.2852771580219269,
0.0943983644247055,
0.08993659168481827,
-0.31309956312179565,
-0.04984241724014282,
0.09779687225818634,
-0.2658802568912506,
0.1755244880914688,
-0.051112040877342224,
0.4030529260635376,
0.4598187506198883,
0.2776840329170227,
-0.01574307680130005,
-0.29303157329559326,
0.12528514862060547,
0.3331541121006012,
-0.03231336921453476,
-0.0120614655315876,
0.09485800564289093,
-0.05390311777591705,
-0.3954113721847534,
-0.4637475609779358,
-0.09166411310434341,
-0.342678427696228,
0.4091050624847412,
-0.0009286105632781982,
0.29537221789360046,
0.7557628154754639,
0.10837189108133316,
0.16713321208953857,
0.05080293118953705,
0.3576146066188812,
-0.17955073714256287,
-0.2276766151189804,
0.28309252858161926,
-0.11396460235118866,
-0.303384929895401,
-0.04539373517036438,
0.35711732506752014,
0.14031872153282166,
0.3954789638519287,
-0.3866767883300781,
-0.09279977530241013,
0.059751659631729126,
0.12738268077373505,
-0.08320583403110504,
0.15560562908649445,
0.1681663691997528,
0.35791730880737305,
0.09560039639472961,
-0.2865777611732483,
-0.18124669790267944,
0.08127886056900024,
-0.05408429354429245,
0.4320569932460785,
0.021040581166744232,
0.17854969203472137,
-0.22137151658535004,
0.5179806351661682,
0.052715882658958435,
-0.09091222286224365,
0.1991945207118988,
0.06482471525669098,
0.5033174157142639,
-0.060297902673482895,
-0.06210479885339737,
0.15956968069076538,
0.13854898512363434,
0.04431522637605667,
0.2818880081176758,
0.2857184112071991,
0.2571042776107788,
-0.3721221089363098,
0.3562707006931305,
-0.04199487715959549,
-0.14647933840751648,
0.1360076516866684,
0.07740478217601776,
0.05388224124908447,
0.051632463932037354,
0.353665292263031,
0.2875666320323944,
0.013879232108592987,
-0.1203811764717102,
0.5422342419624329,
0.21971572935581207,
0.0034470371901988983,
-0.036417052149772644,
-0.18140414357185364,
-0.019346676766872406,
0.0817226842045784,
0.1935337781906128,
0.4616091549396515,
-0.12792667746543884,
0.21326756477355957,
-0.15885350108146667,
0.03416925668716431,
0.07593531161546707,
-0.272318959236145,
0.05997177213430405,
0.12492083758115768,
0.2236122488975525,
-0.10954473912715912,
-0.14760330319404602,
-0.25815439224243164,
-0.21468180418014526,
0.22984443604946136,
0.28489768505096436,
-0.2363368570804596,
-0.4179784059524536,
-0.09194179624319077,
0.2912096083164215,
0.06766165792942047,
-0.1665307581424713,
-0.2633426785469055,
-0.47394129633903503,
-0.18938100337982178,
-0.1969667226076126,
0.03286519646644592,
0.2830890119075775,
-0.0696721151471138,
-0.07128984481096268,
0.23050127923488617,
-0.1764470934867859,
0.4720379710197449,
-0.1110110953450203,
0.24739310145378113,
0.07275800406932831,
0.17503520846366882,
0.07667746394872665,
-0.27621522545814514,
0.6093207001686096,
0.4613340497016907,
-0.5748463273048401,
0.05490966886281967,
0.049286969006061554,
-0.10494129359722137,
0.12657833099365234,
0.49734050035476685,
-0.203236922621727,
0.03332185000181198,
-0.20988425612449646,
-0.16689932346343994,
-0.0899110734462738,
0.3369802236557007,
0.3057073950767517,
-0.14112025499343872,
-0.019365880638360977,
-0.5954620242118835,
0.4933858811855316,
-0.13040564954280853,
-0.07425784319639206,
0.5431771874427795,
0.3751167058944702,
-0.2540671229362488,
0.050071295350790024,
-0.20028972625732422,
0.938000500202179,
0.1679849624633789,
-0.03475185111165047,
0.39505746960639954,
-0.27726638317108154,
0.24796538054943085,
-0.13314253091812134,
-0.04472142085433006,
0.15066981315612793,
-0.07901407778263092,
-0.2124829888343811,
-0.08163972198963165,
0.15276764333248138,
0.24742946028709412,
-0.19619068503379822,
0.2571852505207062,
0.2363925576210022,
-0.18507754802703857,
0.2410515993833542,
0.34127533435821533,
-0.08825967460870743,
-0.23929600417613983,
-0.4996219277381897,
0.05983947589993477,
-0.21201923489570618,
0.2821532189846039,
-0.23345227539539337,
-0.16736644506454468,
-0.16223132610321045,
-0.37301158905029297,
-0.3034265637397766,
-0.019777558743953705,
-0.606201708316803,
0.00012835487723350525,
0.004050400108098984,
-0.20931224524974823,
0.42495083808898926,
-0.05781005695462227,
-0.3502541184425354,
0.5912764072418213,
-0.3381415009498596,
0.08814430236816406,
-0.21939721703529358,
0.09057898074388504,
0.07562681287527084,
0.06658387184143066,
0.22453032433986664,
-0.0499744638800621,
-0.11331059783697128,
-0.4267258644104004,
-0.24010314047336578,
-0.2405204176902771,
0.40968477725982666,
-0.37012097239494324,
-0.1007474809885025,
-0.13668981194496155,
-0.3043428063392639,
-0.0966453030705452,
0.005863375961780548,
-0.04695793241262436,
0.06841325014829636,
0.14428788423538208,
-0.17190629243850708,
0.1301976442337036,
-0.07909689843654633,
-0.052401527762413025,
-0.12111671268939972,
0.2273588478565216,
-0.2594868838787079,
-0.2101680040359497,
0.3971303403377533,
0.12155332416296005,
-0.2633444368839264,
-0.16250447928905487,
0.049894750118255615,
-0.11894838511943817,
-0.30585232377052307,
-0.0868089348077774,
0.08560147136449814,
-0.10372979938983917,
0.05212811380624771,
0.08991599082946777,
0.14536239206790924,
0.04630175977945328,
0.02371421456336975,
-0.46576231718063354,
-0.1444142758846283,
0.33241701126098633,
-0.0263862032443285,
0.21902932226657867,
-0.16694171726703644,
-0.14410270750522614,
0.13567489385604858,
-0.031051678583025932,
-0.20413824915885925,
0.10186794400215149,
0.20448264479637146,
0.22578826546669006,
0.05633607134222984,
0.01620342768728733,
0.18995505571365356,
-0.27500054240226746,
-0.0026572681963443756,
0.04666141793131828,
-0.3123891353607178,
-0.00710136815905571,
-0.1346241533756256,
0.27495816349983215,
0.08997180312871933,
-0.3378797173500061,
0.10601218044757843,
-0.023355308920145035,
-0.2518883943557739,
-0.31359007954597473,
0.01891321688890457,
0.13236814737319946,
-0.18413738906383514,
-0.0060387589037418365,
0.07058614492416382,
0.1286289095878601,
-0.07012122124433517,
0.12594091892242432,
0.015206249430775642,
0.08092226833105087,
0.308966726064682,
0.19208374619483948,
-0.016553163528442383,
-0.04961317777633667,
-0.053215306252241135,
0.22263884544372559,
-0.03684983775019646,
-0.07609260082244873,
0.13448898494243622,
-0.29783064126968384,
-0.009367622435092926,
0.4454352855682373,
0.18453775346279144,
0.6857518553733826,
-0.12068187445402145,
0.05556870996952057,
0.08004177361726761,
0.08756674826145172,
-0.00683072954416275,
-0.007918812334537506,
-0.048252083361148834,
0.24565450847148895,
-0.09880185127258301,
0.28393763303756714,
0.1330655813217163,
-0.36537498235702515,
0.01902661845088005,
0.17367951571941376,
0.13045048713684082,
-0.1283191442489624,
0.08824574947357178,
0.7129381895065308,
-0.04891401156783104,
0.0782170370221138,
-0.10460636019706726,
-0.14702528715133667,
0.0594286173582077,
0.24855662882328033,
-0.48144787549972534,
0.10729558020830154,
0.2871219515800476,
-0.0034803934395313263,
-0.03293869271874428,
-0.5146503448486328,
-0.1732814610004425,
0.4555957019329071,
0.012798868119716644,
0.09392284601926804,
0.15349701046943665,
0.28658968210220337,
-0.4708642363548279,
-0.06937574595212936,
0.014115259051322937,
-0.16176843643188477,
-0.20174631476402283,
0.07785511016845703,
0.4016444683074951,
-0.2385188192129135,
-0.2536187469959259,
-0.06496354937553406,
-0.20226696133613586,
-0.2064248025417328,
-0.16271351277828217,
-0.050924405455589294,
0.01518799178302288,
-0.2840879261493683,
-0.23341940343379974,
-0.01324634812772274,
0.09218625724315643,
-0.3112953305244446,
0.23744700849056244,
0.3032325506210327,
-0.2797801196575165,
0.38987892866134644,
0.33272209763526917,
0.3134801983833313,
0.37833598256111145,
0.04781593754887581,
-0.17094974219799042,
-0.07845340669155121,
-0.026743929833173752,
0.20055435597896576,
0.4092733561992645,
0.031013019382953644,
0.32037633657455444,
0.3283001780509949,
0.014640580862760544,
-0.08389662206172943,
-0.2958451807498932,
0.14827463030815125,
-0.2095751315355301,
-0.6450566649436951,
0.6928914189338684,
-0.24998123943805695,
-0.10601246356964111,
-0.017907211557030678,
0.16609330475330353,
-0.22683022916316986,
0.04262946546077728,
0.521144688129425,
0.3244016468524933,
0.12816248834133148,
0.2558424174785614,
0.03910692036151886,
-0.13781395554542542,
0.24463161826133728,
0.27388665080070496,
0.07700177282094955,
-0.15622597932815552,
0.04958409070968628,
-0.6452693939208984,
-0.12914186716079712,
-0.031144512817263603,
0.0005436018109321594,
0.019787825644016266,
0.10342984646558762,
0.11867766082286835,
0.2379944771528244,
-0.11887377500534058,
0.09634602069854736,
0.5744260549545288,
-0.21504133939743042,
-0.2127048373222351,
-0.10693959891796112,
0.17755445837974548,
-0.12562133371829987,
-0.18995913863182068,
-0.5206833481788635,
0.06388142704963684,
-0.08415568619966507,
-0.09346799552440643,
-0.24923253059387207,
0.012487582862377167,
-0.10319863259792328,
0.0343782864511013,
0.17088237404823303,
0.09636779129505157,
0.5322657823562622,
-0.1261870265007019,
-0.32451331615448,
-0.3152916729450226,
-0.04203229025006294,
0.036233969032764435,
0.19935694336891174,
-0.13211767375469208,
0.38022711873054504,
-0.18788117170333862,
0.16983675956726074,
-0.34704285860061646,
0.32919585704803467,
-0.11708049476146698,
0.18016721308231354,
-0.4201682209968567,
-0.005040924996137619,
-0.41661766171455383,
0.18146862089633942,
0.05345861613750458,
-0.22326934337615967,
-0.0794333666563034,
0.008804969489574432,
-0.499805748462677,
-0.28783613443374634,
0.528273344039917,
-0.2095530778169632,
-0.014439322054386139,
0.016815293580293655,
0.44252318143844604,
0.32096442580223083,
0.13171188533306122,
-1.0341064929962158,
0.14135991036891937,
0.35800909996032715,
0.04677759110927582,
-0.3209111988544464,
0.24520960450172424,
-0.18830297887325287,
-0.11204284429550171,
-0.06656389683485031,
0.20237530767917633,
0.044737160205841064,
-0.25587913393974304,
0.14269942045211792,
-0.41050130128860474
] |
https://github.com/huggingface/datasets/issues/5659 | Thank you so much for the comprehensive instructions @polinaeterna! Also confirming that they worked for me 🤗 In my case, I had to run several of these commands under "sudo" for privileges, but otherwise this workaround gave a successful `libsndfile` install:
1. Grab source code:
```
git clone https://github.com/libsndfile/libsndfile.git
```
2. Set up a build environment:
```
sudo apt install autoconf autogen automake build-essential libasound2-dev \
libflac-dev libogg-dev libtool libvorbis-dev libopus-dev libmp3lame-dev \
libmpg123-dev pkg-config python
```
3. Build and test `libsndfile`:
```
autoreconf -vif
./configure --enable-werror
sudo make
sudo make check
```
4. Create `_soundfile_data` submodule (if it does not exist already):
```
sudo mkdir /usr/local/lib/python3.8/dist-packages/_soundfile_data/
```
5. Copy `libsndfile` files into submodule:
```
sudo cp /usr/local/lib/libsndfile.* /usr/local/lib/python3.8/dist-packages/_soundfile_data/
``` | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files | ### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28 | 120 | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files
### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28
Thank you so much for the comprehensive instructions @polinaeterna! Also confirming that they worked for me 🤗 In my case, I had to run several of these commands under "sudo" for privileges, but otherwise this workaround gave a successful `libsndfile` install:
1. Grab source code:
```
git clone https://github.com/libsndfile/libsndfile.git
```
2. Set up a build environment:
```
sudo apt install autoconf autogen automake build-essential libasound2-dev \
libflac-dev libogg-dev libtool libvorbis-dev libopus-dev libmp3lame-dev \
libmpg123-dev pkg-config python
```
3. Build and test `libsndfile`:
```
autoreconf -vif
./configure --enable-werror
sudo make
sudo make check
```
4. Create `_soundfile_data` submodule (if it does not exist already):
```
sudo mkdir /usr/local/lib/python3.8/dist-packages/_soundfile_data/
```
5. Copy `libsndfile` files into submodule:
```
sudo cp /usr/local/lib/libsndfile.* /usr/local/lib/python3.8/dist-packages/_soundfile_data/
``` | [
-0.049880754202604294,
0.21389538049697876,
-0.02552657201886177,
0.37763962149620056,
0.36412861943244934,
-0.05396618694067001,
0.2889644503593445,
0.11923642456531525,
-0.2776981592178345,
0.2703988552093506,
-0.33914411067962646,
0.02121618017554283,
-0.19508084654808044,
-0.05244786664843559,
-0.07602284848690033,
-0.053154755383729935,
-0.146317720413208,
0.5547893047332764,
0.1439652442932129,
0.06756901741027832,
-0.16367927193641663,
0.3902137875556946,
-0.12376674264669418,
-0.06845317035913467,
-0.24915023148059845,
0.048388101160526276,
0.12746968865394592,
0.17041106522083282,
-0.4433642625808716,
-0.35512402653694153,
0.4380989372730255,
0.2319992333650589,
-0.05099821090698242,
0.29043030738830566,
-0.00012352937483228743,
-0.11559702455997467,
0.20513415336608887,
-0.2270914912223816,
-0.40592265129089355,
-0.11279238760471344,
-0.212590754032135,
-0.131047785282135,
-0.018999427556991577,
-0.054712213575839996,
-0.054331302642822266,
-0.3607732355594635,
-0.2069346010684967,
-0.1928735375404358,
0.233961820602417,
0.3014804720878601,
0.13623759150505066,
0.17275191843509674,
-0.004351221024990082,
0.1199047714471817,
0.5826959609985352,
0.05023296922445297,
-0.12111442536115646,
0.09400640428066254,
0.2956078052520752,
0.06883106380701065,
0.16029924154281616,
0.11522360146045685,
-0.026204582303762436,
0.22168073058128357,
0.2528781592845917,
-0.09834760427474976,
0.10960826277732849,
-0.2319716513156891,
0.061605263501405716,
0.5462928414344788,
0.8929854035377502,
-0.13209515810012817,
-0.6255757808685303,
-0.3807216286659241,
-0.15301282703876495,
-0.1855306327342987,
0.3686770796775818,
-0.2373051643371582,
-0.10350987315177917,
0.29939761757850647,
-0.04895247891545296,
-0.0039725229144096375,
0.15861666202545166,
0.2882198095321655,
0.04949945956468582,
-0.1935369074344635,
-0.08759509027004242,
-0.1538151502609253,
0.31666818261146545,
-0.23562124371528625,
-0.1479191780090332,
-0.057447001338005066,
-0.06832793354988098,
0.21306248009204865,
-0.14738141000270844,
-0.10396292060613632,
0.08840421587228775,
0.07939273118972778,
0.07031139731407166,
0.15621960163116455,
-0.15107758343219757,
-0.053061552345752716,
-0.4215264618396759,
-0.046277355402708054,
0.1598110795021057,
-0.22630348801612854,
-0.062266863882541656,
-0.12766967713832855,
0.15912313759326935,
-0.09006772935390472,
0.3275679051876068,
-0.04262600094079971,
0.15337440371513367,
-0.37258824706077576,
-0.3740416169166565,
-0.01362275518476963,
0.30175721645355225,
-0.4751899242401123,
-0.41212451457977295,
0.04797927662730217,
-0.335199236869812,
-0.05054696649312973,
0.12953968346118927,
-0.04075709730386734,
0.09004686027765274,
0.5219283103942871,
0.4176955819129944,
0.19073054194450378,
-0.3532955050468445,
0.1694779247045517,
-0.021708309650421143,
-0.22332720458507538,
0.19873616099357605,
-0.02517165243625641,
0.3993792235851288,
-0.3515942096710205,
0.4323694109916687,
0.10456891357898712,
0.2842091917991638,
-0.049148090183734894,
-0.03585126996040344,
-0.07394207268953323,
-0.21954584121704102,
0.3524152636528015,
-0.17553046345710754,
0.019895687699317932,
-0.3287624716758728,
-0.11586916446685791,
-0.14956486225128174,
0.07563798129558563,
-0.20093664526939392,
-0.18875625729560852,
0.08634163439273834,
0.11109669506549835,
-0.4830392599105835,
0.27278685569763184,
-0.0029814280569553375,
-0.03812029957771301,
0.16576921939849854,
-0.41605913639068604,
0.024478504434227943,
-0.4133132994174957,
-0.2350761592388153,
-0.005670331418514252,
0.21449881792068481,
0.3355960249900818,
-0.3807133436203003,
-0.16003093123435974,
0.1093781590461731,
-0.1582372486591339,
-0.014331512153148651,
0.28229060769081116,
-0.13150735199451447,
0.29842907190322876,
-0.1967371106147766,
-0.10386650264263153,
0.5670567750930786,
-0.3654792308807373,
-0.42812711000442505,
0.1869962513446808,
0.08179593086242676,
0.4688357710838318,
0.07916706800460815,
-0.09337296336889267,
-0.09169740974903107,
-0.2231377810239792,
0.026687733829021454,
0.2629302144050598,
0.021867593750357628,
-0.18678542971611023,
0.0036608055233955383,
-0.4244551360607147,
0.06699034571647644,
0.3080374598503113,
0.03281782194972038,
-0.0945151299238205,
-0.01241455227136612,
0.4726387858390808,
0.2068977952003479,
-0.05670391768217087,
-0.05299684405326843,
0.10259047150611877,
0.5188701152801514,
0.23160745203495026,
0.11004562675952911,
-0.27419614791870117,
-0.08054119348526001,
0.11274544894695282,
0.26938340067863464,
0.04825346916913986,
-0.018937665969133377,
-0.10919047892093658,
0.13499833643436432,
-0.3264015316963196,
-0.2200787365436554,
0.24825221300125122,
-0.02232525497674942,
0.19468650221824646,
-0.22108615934848785,
-0.16697615385055542,
-0.0948956310749054,
0.10557926446199417,
-0.041065700352191925,
0.08541779220104218,
-0.30294209718704224,
-0.013122964650392532,
-0.022907255217432976,
0.08476229012012482,
0.15625116229057312,
0.41044124960899353,
0.046248309314250946,
-0.028219161555171013,
-0.10161028802394867,
0.29566460847854614,
0.5504580140113831,
-0.04094335064291954,
-0.4070577621459961,
0.5133808851242065,
0.30632925033569336,
0.05058152973651886,
-0.0856696292757988,
0.11710736155509949,
0.13307631015777588,
-0.20405864715576172,
0.16750679910182953,
0.2205520123243332,
-0.15079250931739807,
0.20390070974826813,
0.22054103016853333,
-0.2713400721549988,
0.2415943741798401,
0.286283940076828,
-0.2198144793510437,
-0.01912011206150055,
0.3594229221343994,
-0.17885804176330566,
0.40677785873413086,
-0.033479444682598114,
-0.14399105310440063,
-0.10318043828010559,
0.3257092237472534,
-0.06670576333999634,
-0.1779118776321411,
0.02396165020763874,
0.24085742235183716,
0.00036713480949401855,
0.051515594124794006,
0.32336050271987915,
0.6417386531829834,
0.23663672804832458,
0.0583278052508831,
-0.1511276513338089,
0.14702802896499634,
-0.46651220321655273,
0.14897891879081726,
0.1944667398929596,
-0.18413323163986206,
0.19084791839122772,
-0.04314263537526131,
0.2557905614376068,
-0.15247607231140137,
-0.17638370394706726,
0.07772140204906464,
0.10773403942584991,
-0.6525932550430298,
-0.07663445174694061,
-0.5262326598167419,
-0.1669667363166809,
-0.05134958401322365,
-0.28166258335113525,
-0.22957497835159302,
-0.08068374544382095,
0.09765132516622543,
0.07579837739467621,
-0.08529283851385117,
0.10263793170452118,
-0.0048494115471839905,
0.2893795967102051,
0.022972434759140015,
-0.3243034780025482,
0.1744280904531479,
0.3457619845867157,
-0.18844205141067505,
0.05915559083223343,
0.2852771580219269,
0.0943983644247055,
0.08993659168481827,
-0.31309956312179565,
-0.04984241724014282,
0.09779687225818634,
-0.2658802568912506,
0.1755244880914688,
-0.051112040877342224,
0.4030529260635376,
0.4598187506198883,
0.2776840329170227,
-0.01574307680130005,
-0.29303157329559326,
0.12528514862060547,
0.3331541121006012,
-0.03231336921453476,
-0.0120614655315876,
0.09485800564289093,
-0.05390311777591705,
-0.3954113721847534,
-0.4637475609779358,
-0.09166411310434341,
-0.342678427696228,
0.4091050624847412,
-0.0009286105632781982,
0.29537221789360046,
0.7557628154754639,
0.10837189108133316,
0.16713321208953857,
0.05080293118953705,
0.3576146066188812,
-0.17955073714256287,
-0.2276766151189804,
0.28309252858161926,
-0.11396460235118866,
-0.303384929895401,
-0.04539373517036438,
0.35711732506752014,
0.14031872153282166,
0.3954789638519287,
-0.3866767883300781,
-0.09279977530241013,
0.059751659631729126,
0.12738268077373505,
-0.08320583403110504,
0.15560562908649445,
0.1681663691997528,
0.35791730880737305,
0.09560039639472961,
-0.2865777611732483,
-0.18124669790267944,
0.08127886056900024,
-0.05408429354429245,
0.4320569932460785,
0.021040581166744232,
0.17854969203472137,
-0.22137151658535004,
0.5179806351661682,
0.052715882658958435,
-0.09091222286224365,
0.1991945207118988,
0.06482471525669098,
0.5033174157142639,
-0.060297902673482895,
-0.06210479885339737,
0.15956968069076538,
0.13854898512363434,
0.04431522637605667,
0.2818880081176758,
0.2857184112071991,
0.2571042776107788,
-0.3721221089363098,
0.3562707006931305,
-0.04199487715959549,
-0.14647933840751648,
0.1360076516866684,
0.07740478217601776,
0.05388224124908447,
0.051632463932037354,
0.353665292263031,
0.2875666320323944,
0.013879232108592987,
-0.1203811764717102,
0.5422342419624329,
0.21971572935581207,
0.0034470371901988983,
-0.036417052149772644,
-0.18140414357185364,
-0.019346676766872406,
0.0817226842045784,
0.1935337781906128,
0.4616091549396515,
-0.12792667746543884,
0.21326756477355957,
-0.15885350108146667,
0.03416925668716431,
0.07593531161546707,
-0.272318959236145,
0.05997177213430405,
0.12492083758115768,
0.2236122488975525,
-0.10954473912715912,
-0.14760330319404602,
-0.25815439224243164,
-0.21468180418014526,
0.22984443604946136,
0.28489768505096436,
-0.2363368570804596,
-0.4179784059524536,
-0.09194179624319077,
0.2912096083164215,
0.06766165792942047,
-0.1665307581424713,
-0.2633426785469055,
-0.47394129633903503,
-0.18938100337982178,
-0.1969667226076126,
0.03286519646644592,
0.2830890119075775,
-0.0696721151471138,
-0.07128984481096268,
0.23050127923488617,
-0.1764470934867859,
0.4720379710197449,
-0.1110110953450203,
0.24739310145378113,
0.07275800406932831,
0.17503520846366882,
0.07667746394872665,
-0.27621522545814514,
0.6093207001686096,
0.4613340497016907,
-0.5748463273048401,
0.05490966886281967,
0.049286969006061554,
-0.10494129359722137,
0.12657833099365234,
0.49734050035476685,
-0.203236922621727,
0.03332185000181198,
-0.20988425612449646,
-0.16689932346343994,
-0.0899110734462738,
0.3369802236557007,
0.3057073950767517,
-0.14112025499343872,
-0.019365880638360977,
-0.5954620242118835,
0.4933858811855316,
-0.13040564954280853,
-0.07425784319639206,
0.5431771874427795,
0.3751167058944702,
-0.2540671229362488,
0.050071295350790024,
-0.20028972625732422,
0.938000500202179,
0.1679849624633789,
-0.03475185111165047,
0.39505746960639954,
-0.27726638317108154,
0.24796538054943085,
-0.13314253091812134,
-0.04472142085433006,
0.15066981315612793,
-0.07901407778263092,
-0.2124829888343811,
-0.08163972198963165,
0.15276764333248138,
0.24742946028709412,
-0.19619068503379822,
0.2571852505207062,
0.2363925576210022,
-0.18507754802703857,
0.2410515993833542,
0.34127533435821533,
-0.08825967460870743,
-0.23929600417613983,
-0.4996219277381897,
0.05983947589993477,
-0.21201923489570618,
0.2821532189846039,
-0.23345227539539337,
-0.16736644506454468,
-0.16223132610321045,
-0.37301158905029297,
-0.3034265637397766,
-0.019777558743953705,
-0.606201708316803,
0.00012835487723350525,
0.004050400108098984,
-0.20931224524974823,
0.42495083808898926,
-0.05781005695462227,
-0.3502541184425354,
0.5912764072418213,
-0.3381415009498596,
0.08814430236816406,
-0.21939721703529358,
0.09057898074388504,
0.07562681287527084,
0.06658387184143066,
0.22453032433986664,
-0.0499744638800621,
-0.11331059783697128,
-0.4267258644104004,
-0.24010314047336578,
-0.2405204176902771,
0.40968477725982666,
-0.37012097239494324,
-0.1007474809885025,
-0.13668981194496155,
-0.3043428063392639,
-0.0966453030705452,
0.005863375961780548,
-0.04695793241262436,
0.06841325014829636,
0.14428788423538208,
-0.17190629243850708,
0.1301976442337036,
-0.07909689843654633,
-0.052401527762413025,
-0.12111671268939972,
0.2273588478565216,
-0.2594868838787079,
-0.2101680040359497,
0.3971303403377533,
0.12155332416296005,
-0.2633444368839264,
-0.16250447928905487,
0.049894750118255615,
-0.11894838511943817,
-0.30585232377052307,
-0.0868089348077774,
0.08560147136449814,
-0.10372979938983917,
0.05212811380624771,
0.08991599082946777,
0.14536239206790924,
0.04630175977945328,
0.02371421456336975,
-0.46576231718063354,
-0.1444142758846283,
0.33241701126098633,
-0.0263862032443285,
0.21902932226657867,
-0.16694171726703644,
-0.14410270750522614,
0.13567489385604858,
-0.031051678583025932,
-0.20413824915885925,
0.10186794400215149,
0.20448264479637146,
0.22578826546669006,
0.05633607134222984,
0.01620342768728733,
0.18995505571365356,
-0.27500054240226746,
-0.0026572681963443756,
0.04666141793131828,
-0.3123891353607178,
-0.00710136815905571,
-0.1346241533756256,
0.27495816349983215,
0.08997180312871933,
-0.3378797173500061,
0.10601218044757843,
-0.023355308920145035,
-0.2518883943557739,
-0.31359007954597473,
0.01891321688890457,
0.13236814737319946,
-0.18413738906383514,
-0.0060387589037418365,
0.07058614492416382,
0.1286289095878601,
-0.07012122124433517,
0.12594091892242432,
0.015206249430775642,
0.08092226833105087,
0.308966726064682,
0.19208374619483948,
-0.016553163528442383,
-0.04961317777633667,
-0.053215306252241135,
0.22263884544372559,
-0.03684983775019646,
-0.07609260082244873,
0.13448898494243622,
-0.29783064126968384,
-0.009367622435092926,
0.4454352855682373,
0.18453775346279144,
0.6857518553733826,
-0.12068187445402145,
0.05556870996952057,
0.08004177361726761,
0.08756674826145172,
-0.00683072954416275,
-0.007918812334537506,
-0.048252083361148834,
0.24565450847148895,
-0.09880185127258301,
0.28393763303756714,
0.1330655813217163,
-0.36537498235702515,
0.01902661845088005,
0.17367951571941376,
0.13045048713684082,
-0.1283191442489624,
0.08824574947357178,
0.7129381895065308,
-0.04891401156783104,
0.0782170370221138,
-0.10460636019706726,
-0.14702528715133667,
0.0594286173582077,
0.24855662882328033,
-0.48144787549972534,
0.10729558020830154,
0.2871219515800476,
-0.0034803934395313263,
-0.03293869271874428,
-0.5146503448486328,
-0.1732814610004425,
0.4555957019329071,
0.012798868119716644,
0.09392284601926804,
0.15349701046943665,
0.28658968210220337,
-0.4708642363548279,
-0.06937574595212936,
0.014115259051322937,
-0.16176843643188477,
-0.20174631476402283,
0.07785511016845703,
0.4016444683074951,
-0.2385188192129135,
-0.2536187469959259,
-0.06496354937553406,
-0.20226696133613586,
-0.2064248025417328,
-0.16271351277828217,
-0.050924405455589294,
0.01518799178302288,
-0.2840879261493683,
-0.23341940343379974,
-0.01324634812772274,
0.09218625724315643,
-0.3112953305244446,
0.23744700849056244,
0.3032325506210327,
-0.2797801196575165,
0.38987892866134644,
0.33272209763526917,
0.3134801983833313,
0.37833598256111145,
0.04781593754887581,
-0.17094974219799042,
-0.07845340669155121,
-0.026743929833173752,
0.20055435597896576,
0.4092733561992645,
0.031013019382953644,
0.32037633657455444,
0.3283001780509949,
0.014640580862760544,
-0.08389662206172943,
-0.2958451807498932,
0.14827463030815125,
-0.2095751315355301,
-0.6450566649436951,
0.6928914189338684,
-0.24998123943805695,
-0.10601246356964111,
-0.017907211557030678,
0.16609330475330353,
-0.22683022916316986,
0.04262946546077728,
0.521144688129425,
0.3244016468524933,
0.12816248834133148,
0.2558424174785614,
0.03910692036151886,
-0.13781395554542542,
0.24463161826133728,
0.27388665080070496,
0.07700177282094955,
-0.15622597932815552,
0.04958409070968628,
-0.6452693939208984,
-0.12914186716079712,
-0.031144512817263603,
0.0005436018109321594,
0.019787825644016266,
0.10342984646558762,
0.11867766082286835,
0.2379944771528244,
-0.11887377500534058,
0.09634602069854736,
0.5744260549545288,
-0.21504133939743042,
-0.2127048373222351,
-0.10693959891796112,
0.17755445837974548,
-0.12562133371829987,
-0.18995913863182068,
-0.5206833481788635,
0.06388142704963684,
-0.08415568619966507,
-0.09346799552440643,
-0.24923253059387207,
0.012487582862377167,
-0.10319863259792328,
0.0343782864511013,
0.17088237404823303,
0.09636779129505157,
0.5322657823562622,
-0.1261870265007019,
-0.32451331615448,
-0.3152916729450226,
-0.04203229025006294,
0.036233969032764435,
0.19935694336891174,
-0.13211767375469208,
0.38022711873054504,
-0.18788117170333862,
0.16983675956726074,
-0.34704285860061646,
0.32919585704803467,
-0.11708049476146698,
0.18016721308231354,
-0.4201682209968567,
-0.005040924996137619,
-0.41661766171455383,
0.18146862089633942,
0.05345861613750458,
-0.22326934337615967,
-0.0794333666563034,
0.008804969489574432,
-0.499805748462677,
-0.28783613443374634,
0.528273344039917,
-0.2095530778169632,
-0.014439322054386139,
0.016815293580293655,
0.44252318143844604,
0.32096442580223083,
0.13171188533306122,
-1.0341064929962158,
0.14135991036891937,
0.35800909996032715,
0.04677759110927582,
-0.3209111988544464,
0.24520960450172424,
-0.18830297887325287,
-0.11204284429550171,
-0.06656389683485031,
0.20237530767917633,
0.044737160205841064,
-0.25587913393974304,
0.14269942045211792,
-0.41050130128860474
] |
https://github.com/huggingface/datasets/issues/5659 | On a different machine, I also tried separately by first upgrading pip, then installing soundfile. This worked too! Thanks @lhoestq 🙌 | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files | ### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28 | 21 | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files
### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28
On a different machine, I also tried separately by first upgrading pip, then installing soundfile. This worked too! Thanks @lhoestq 🙌 | [
-0.049880754202604294,
0.21389538049697876,
-0.02552657201886177,
0.37763962149620056,
0.36412861943244934,
-0.05396618694067001,
0.2889644503593445,
0.11923642456531525,
-0.2776981592178345,
0.2703988552093506,
-0.33914411067962646,
0.02121618017554283,
-0.19508084654808044,
-0.05244786664843559,
-0.07602284848690033,
-0.053154755383729935,
-0.146317720413208,
0.5547893047332764,
0.1439652442932129,
0.06756901741027832,
-0.16367927193641663,
0.3902137875556946,
-0.12376674264669418,
-0.06845317035913467,
-0.24915023148059845,
0.048388101160526276,
0.12746968865394592,
0.17041106522083282,
-0.4433642625808716,
-0.35512402653694153,
0.4380989372730255,
0.2319992333650589,
-0.05099821090698242,
0.29043030738830566,
-0.00012352937483228743,
-0.11559702455997467,
0.20513415336608887,
-0.2270914912223816,
-0.40592265129089355,
-0.11279238760471344,
-0.212590754032135,
-0.131047785282135,
-0.018999427556991577,
-0.054712213575839996,
-0.054331302642822266,
-0.3607732355594635,
-0.2069346010684967,
-0.1928735375404358,
0.233961820602417,
0.3014804720878601,
0.13623759150505066,
0.17275191843509674,
-0.004351221024990082,
0.1199047714471817,
0.5826959609985352,
0.05023296922445297,
-0.12111442536115646,
0.09400640428066254,
0.2956078052520752,
0.06883106380701065,
0.16029924154281616,
0.11522360146045685,
-0.026204582303762436,
0.22168073058128357,
0.2528781592845917,
-0.09834760427474976,
0.10960826277732849,
-0.2319716513156891,
0.061605263501405716,
0.5462928414344788,
0.8929854035377502,
-0.13209515810012817,
-0.6255757808685303,
-0.3807216286659241,
-0.15301282703876495,
-0.1855306327342987,
0.3686770796775818,
-0.2373051643371582,
-0.10350987315177917,
0.29939761757850647,
-0.04895247891545296,
-0.0039725229144096375,
0.15861666202545166,
0.2882198095321655,
0.04949945956468582,
-0.1935369074344635,
-0.08759509027004242,
-0.1538151502609253,
0.31666818261146545,
-0.23562124371528625,
-0.1479191780090332,
-0.057447001338005066,
-0.06832793354988098,
0.21306248009204865,
-0.14738141000270844,
-0.10396292060613632,
0.08840421587228775,
0.07939273118972778,
0.07031139731407166,
0.15621960163116455,
-0.15107758343219757,
-0.053061552345752716,
-0.4215264618396759,
-0.046277355402708054,
0.1598110795021057,
-0.22630348801612854,
-0.062266863882541656,
-0.12766967713832855,
0.15912313759326935,
-0.09006772935390472,
0.3275679051876068,
-0.04262600094079971,
0.15337440371513367,
-0.37258824706077576,
-0.3740416169166565,
-0.01362275518476963,
0.30175721645355225,
-0.4751899242401123,
-0.41212451457977295,
0.04797927662730217,
-0.335199236869812,
-0.05054696649312973,
0.12953968346118927,
-0.04075709730386734,
0.09004686027765274,
0.5219283103942871,
0.4176955819129944,
0.19073054194450378,
-0.3532955050468445,
0.1694779247045517,
-0.021708309650421143,
-0.22332720458507538,
0.19873616099357605,
-0.02517165243625641,
0.3993792235851288,
-0.3515942096710205,
0.4323694109916687,
0.10456891357898712,
0.2842091917991638,
-0.049148090183734894,
-0.03585126996040344,
-0.07394207268953323,
-0.21954584121704102,
0.3524152636528015,
-0.17553046345710754,
0.019895687699317932,
-0.3287624716758728,
-0.11586916446685791,
-0.14956486225128174,
0.07563798129558563,
-0.20093664526939392,
-0.18875625729560852,
0.08634163439273834,
0.11109669506549835,
-0.4830392599105835,
0.27278685569763184,
-0.0029814280569553375,
-0.03812029957771301,
0.16576921939849854,
-0.41605913639068604,
0.024478504434227943,
-0.4133132994174957,
-0.2350761592388153,
-0.005670331418514252,
0.21449881792068481,
0.3355960249900818,
-0.3807133436203003,
-0.16003093123435974,
0.1093781590461731,
-0.1582372486591339,
-0.014331512153148651,
0.28229060769081116,
-0.13150735199451447,
0.29842907190322876,
-0.1967371106147766,
-0.10386650264263153,
0.5670567750930786,
-0.3654792308807373,
-0.42812711000442505,
0.1869962513446808,
0.08179593086242676,
0.4688357710838318,
0.07916706800460815,
-0.09337296336889267,
-0.09169740974903107,
-0.2231377810239792,
0.026687733829021454,
0.2629302144050598,
0.021867593750357628,
-0.18678542971611023,
0.0036608055233955383,
-0.4244551360607147,
0.06699034571647644,
0.3080374598503113,
0.03281782194972038,
-0.0945151299238205,
-0.01241455227136612,
0.4726387858390808,
0.2068977952003479,
-0.05670391768217087,
-0.05299684405326843,
0.10259047150611877,
0.5188701152801514,
0.23160745203495026,
0.11004562675952911,
-0.27419614791870117,
-0.08054119348526001,
0.11274544894695282,
0.26938340067863464,
0.04825346916913986,
-0.018937665969133377,
-0.10919047892093658,
0.13499833643436432,
-0.3264015316963196,
-0.2200787365436554,
0.24825221300125122,
-0.02232525497674942,
0.19468650221824646,
-0.22108615934848785,
-0.16697615385055542,
-0.0948956310749054,
0.10557926446199417,
-0.041065700352191925,
0.08541779220104218,
-0.30294209718704224,
-0.013122964650392532,
-0.022907255217432976,
0.08476229012012482,
0.15625116229057312,
0.41044124960899353,
0.046248309314250946,
-0.028219161555171013,
-0.10161028802394867,
0.29566460847854614,
0.5504580140113831,
-0.04094335064291954,
-0.4070577621459961,
0.5133808851242065,
0.30632925033569336,
0.05058152973651886,
-0.0856696292757988,
0.11710736155509949,
0.13307631015777588,
-0.20405864715576172,
0.16750679910182953,
0.2205520123243332,
-0.15079250931739807,
0.20390070974826813,
0.22054103016853333,
-0.2713400721549988,
0.2415943741798401,
0.286283940076828,
-0.2198144793510437,
-0.01912011206150055,
0.3594229221343994,
-0.17885804176330566,
0.40677785873413086,
-0.033479444682598114,
-0.14399105310440063,
-0.10318043828010559,
0.3257092237472534,
-0.06670576333999634,
-0.1779118776321411,
0.02396165020763874,
0.24085742235183716,
0.00036713480949401855,
0.051515594124794006,
0.32336050271987915,
0.6417386531829834,
0.23663672804832458,
0.0583278052508831,
-0.1511276513338089,
0.14702802896499634,
-0.46651220321655273,
0.14897891879081726,
0.1944667398929596,
-0.18413323163986206,
0.19084791839122772,
-0.04314263537526131,
0.2557905614376068,
-0.15247607231140137,
-0.17638370394706726,
0.07772140204906464,
0.10773403942584991,
-0.6525932550430298,
-0.07663445174694061,
-0.5262326598167419,
-0.1669667363166809,
-0.05134958401322365,
-0.28166258335113525,
-0.22957497835159302,
-0.08068374544382095,
0.09765132516622543,
0.07579837739467621,
-0.08529283851385117,
0.10263793170452118,
-0.0048494115471839905,
0.2893795967102051,
0.022972434759140015,
-0.3243034780025482,
0.1744280904531479,
0.3457619845867157,
-0.18844205141067505,
0.05915559083223343,
0.2852771580219269,
0.0943983644247055,
0.08993659168481827,
-0.31309956312179565,
-0.04984241724014282,
0.09779687225818634,
-0.2658802568912506,
0.1755244880914688,
-0.051112040877342224,
0.4030529260635376,
0.4598187506198883,
0.2776840329170227,
-0.01574307680130005,
-0.29303157329559326,
0.12528514862060547,
0.3331541121006012,
-0.03231336921453476,
-0.0120614655315876,
0.09485800564289093,
-0.05390311777591705,
-0.3954113721847534,
-0.4637475609779358,
-0.09166411310434341,
-0.342678427696228,
0.4091050624847412,
-0.0009286105632781982,
0.29537221789360046,
0.7557628154754639,
0.10837189108133316,
0.16713321208953857,
0.05080293118953705,
0.3576146066188812,
-0.17955073714256287,
-0.2276766151189804,
0.28309252858161926,
-0.11396460235118866,
-0.303384929895401,
-0.04539373517036438,
0.35711732506752014,
0.14031872153282166,
0.3954789638519287,
-0.3866767883300781,
-0.09279977530241013,
0.059751659631729126,
0.12738268077373505,
-0.08320583403110504,
0.15560562908649445,
0.1681663691997528,
0.35791730880737305,
0.09560039639472961,
-0.2865777611732483,
-0.18124669790267944,
0.08127886056900024,
-0.05408429354429245,
0.4320569932460785,
0.021040581166744232,
0.17854969203472137,
-0.22137151658535004,
0.5179806351661682,
0.052715882658958435,
-0.09091222286224365,
0.1991945207118988,
0.06482471525669098,
0.5033174157142639,
-0.060297902673482895,
-0.06210479885339737,
0.15956968069076538,
0.13854898512363434,
0.04431522637605667,
0.2818880081176758,
0.2857184112071991,
0.2571042776107788,
-0.3721221089363098,
0.3562707006931305,
-0.04199487715959549,
-0.14647933840751648,
0.1360076516866684,
0.07740478217601776,
0.05388224124908447,
0.051632463932037354,
0.353665292263031,
0.2875666320323944,
0.013879232108592987,
-0.1203811764717102,
0.5422342419624329,
0.21971572935581207,
0.0034470371901988983,
-0.036417052149772644,
-0.18140414357185364,
-0.019346676766872406,
0.0817226842045784,
0.1935337781906128,
0.4616091549396515,
-0.12792667746543884,
0.21326756477355957,
-0.15885350108146667,
0.03416925668716431,
0.07593531161546707,
-0.272318959236145,
0.05997177213430405,
0.12492083758115768,
0.2236122488975525,
-0.10954473912715912,
-0.14760330319404602,
-0.25815439224243164,
-0.21468180418014526,
0.22984443604946136,
0.28489768505096436,
-0.2363368570804596,
-0.4179784059524536,
-0.09194179624319077,
0.2912096083164215,
0.06766165792942047,
-0.1665307581424713,
-0.2633426785469055,
-0.47394129633903503,
-0.18938100337982178,
-0.1969667226076126,
0.03286519646644592,
0.2830890119075775,
-0.0696721151471138,
-0.07128984481096268,
0.23050127923488617,
-0.1764470934867859,
0.4720379710197449,
-0.1110110953450203,
0.24739310145378113,
0.07275800406932831,
0.17503520846366882,
0.07667746394872665,
-0.27621522545814514,
0.6093207001686096,
0.4613340497016907,
-0.5748463273048401,
0.05490966886281967,
0.049286969006061554,
-0.10494129359722137,
0.12657833099365234,
0.49734050035476685,
-0.203236922621727,
0.03332185000181198,
-0.20988425612449646,
-0.16689932346343994,
-0.0899110734462738,
0.3369802236557007,
0.3057073950767517,
-0.14112025499343872,
-0.019365880638360977,
-0.5954620242118835,
0.4933858811855316,
-0.13040564954280853,
-0.07425784319639206,
0.5431771874427795,
0.3751167058944702,
-0.2540671229362488,
0.050071295350790024,
-0.20028972625732422,
0.938000500202179,
0.1679849624633789,
-0.03475185111165047,
0.39505746960639954,
-0.27726638317108154,
0.24796538054943085,
-0.13314253091812134,
-0.04472142085433006,
0.15066981315612793,
-0.07901407778263092,
-0.2124829888343811,
-0.08163972198963165,
0.15276764333248138,
0.24742946028709412,
-0.19619068503379822,
0.2571852505207062,
0.2363925576210022,
-0.18507754802703857,
0.2410515993833542,
0.34127533435821533,
-0.08825967460870743,
-0.23929600417613983,
-0.4996219277381897,
0.05983947589993477,
-0.21201923489570618,
0.2821532189846039,
-0.23345227539539337,
-0.16736644506454468,
-0.16223132610321045,
-0.37301158905029297,
-0.3034265637397766,
-0.019777558743953705,
-0.606201708316803,
0.00012835487723350525,
0.004050400108098984,
-0.20931224524974823,
0.42495083808898926,
-0.05781005695462227,
-0.3502541184425354,
0.5912764072418213,
-0.3381415009498596,
0.08814430236816406,
-0.21939721703529358,
0.09057898074388504,
0.07562681287527084,
0.06658387184143066,
0.22453032433986664,
-0.0499744638800621,
-0.11331059783697128,
-0.4267258644104004,
-0.24010314047336578,
-0.2405204176902771,
0.40968477725982666,
-0.37012097239494324,
-0.1007474809885025,
-0.13668981194496155,
-0.3043428063392639,
-0.0966453030705452,
0.005863375961780548,
-0.04695793241262436,
0.06841325014829636,
0.14428788423538208,
-0.17190629243850708,
0.1301976442337036,
-0.07909689843654633,
-0.052401527762413025,
-0.12111671268939972,
0.2273588478565216,
-0.2594868838787079,
-0.2101680040359497,
0.3971303403377533,
0.12155332416296005,
-0.2633444368839264,
-0.16250447928905487,
0.049894750118255615,
-0.11894838511943817,
-0.30585232377052307,
-0.0868089348077774,
0.08560147136449814,
-0.10372979938983917,
0.05212811380624771,
0.08991599082946777,
0.14536239206790924,
0.04630175977945328,
0.02371421456336975,
-0.46576231718063354,
-0.1444142758846283,
0.33241701126098633,
-0.0263862032443285,
0.21902932226657867,
-0.16694171726703644,
-0.14410270750522614,
0.13567489385604858,
-0.031051678583025932,
-0.20413824915885925,
0.10186794400215149,
0.20448264479637146,
0.22578826546669006,
0.05633607134222984,
0.01620342768728733,
0.18995505571365356,
-0.27500054240226746,
-0.0026572681963443756,
0.04666141793131828,
-0.3123891353607178,
-0.00710136815905571,
-0.1346241533756256,
0.27495816349983215,
0.08997180312871933,
-0.3378797173500061,
0.10601218044757843,
-0.023355308920145035,
-0.2518883943557739,
-0.31359007954597473,
0.01891321688890457,
0.13236814737319946,
-0.18413738906383514,
-0.0060387589037418365,
0.07058614492416382,
0.1286289095878601,
-0.07012122124433517,
0.12594091892242432,
0.015206249430775642,
0.08092226833105087,
0.308966726064682,
0.19208374619483948,
-0.016553163528442383,
-0.04961317777633667,
-0.053215306252241135,
0.22263884544372559,
-0.03684983775019646,
-0.07609260082244873,
0.13448898494243622,
-0.29783064126968384,
-0.009367622435092926,
0.4454352855682373,
0.18453775346279144,
0.6857518553733826,
-0.12068187445402145,
0.05556870996952057,
0.08004177361726761,
0.08756674826145172,
-0.00683072954416275,
-0.007918812334537506,
-0.048252083361148834,
0.24565450847148895,
-0.09880185127258301,
0.28393763303756714,
0.1330655813217163,
-0.36537498235702515,
0.01902661845088005,
0.17367951571941376,
0.13045048713684082,
-0.1283191442489624,
0.08824574947357178,
0.7129381895065308,
-0.04891401156783104,
0.0782170370221138,
-0.10460636019706726,
-0.14702528715133667,
0.0594286173582077,
0.24855662882328033,
-0.48144787549972534,
0.10729558020830154,
0.2871219515800476,
-0.0034803934395313263,
-0.03293869271874428,
-0.5146503448486328,
-0.1732814610004425,
0.4555957019329071,
0.012798868119716644,
0.09392284601926804,
0.15349701046943665,
0.28658968210220337,
-0.4708642363548279,
-0.06937574595212936,
0.014115259051322937,
-0.16176843643188477,
-0.20174631476402283,
0.07785511016845703,
0.4016444683074951,
-0.2385188192129135,
-0.2536187469959259,
-0.06496354937553406,
-0.20226696133613586,
-0.2064248025417328,
-0.16271351277828217,
-0.050924405455589294,
0.01518799178302288,
-0.2840879261493683,
-0.23341940343379974,
-0.01324634812772274,
0.09218625724315643,
-0.3112953305244446,
0.23744700849056244,
0.3032325506210327,
-0.2797801196575165,
0.38987892866134644,
0.33272209763526917,
0.3134801983833313,
0.37833598256111145,
0.04781593754887581,
-0.17094974219799042,
-0.07845340669155121,
-0.026743929833173752,
0.20055435597896576,
0.4092733561992645,
0.031013019382953644,
0.32037633657455444,
0.3283001780509949,
0.014640580862760544,
-0.08389662206172943,
-0.2958451807498932,
0.14827463030815125,
-0.2095751315355301,
-0.6450566649436951,
0.6928914189338684,
-0.24998123943805695,
-0.10601246356964111,
-0.017907211557030678,
0.16609330475330353,
-0.22683022916316986,
0.04262946546077728,
0.521144688129425,
0.3244016468524933,
0.12816248834133148,
0.2558424174785614,
0.03910692036151886,
-0.13781395554542542,
0.24463161826133728,
0.27388665080070496,
0.07700177282094955,
-0.15622597932815552,
0.04958409070968628,
-0.6452693939208984,
-0.12914186716079712,
-0.031144512817263603,
0.0005436018109321594,
0.019787825644016266,
0.10342984646558762,
0.11867766082286835,
0.2379944771528244,
-0.11887377500534058,
0.09634602069854736,
0.5744260549545288,
-0.21504133939743042,
-0.2127048373222351,
-0.10693959891796112,
0.17755445837974548,
-0.12562133371829987,
-0.18995913863182068,
-0.5206833481788635,
0.06388142704963684,
-0.08415568619966507,
-0.09346799552440643,
-0.24923253059387207,
0.012487582862377167,
-0.10319863259792328,
0.0343782864511013,
0.17088237404823303,
0.09636779129505157,
0.5322657823562622,
-0.1261870265007019,
-0.32451331615448,
-0.3152916729450226,
-0.04203229025006294,
0.036233969032764435,
0.19935694336891174,
-0.13211767375469208,
0.38022711873054504,
-0.18788117170333862,
0.16983675956726074,
-0.34704285860061646,
0.32919585704803467,
-0.11708049476146698,
0.18016721308231354,
-0.4201682209968567,
-0.005040924996137619,
-0.41661766171455383,
0.18146862089633942,
0.05345861613750458,
-0.22326934337615967,
-0.0794333666563034,
0.008804969489574432,
-0.499805748462677,
-0.28783613443374634,
0.528273344039917,
-0.2095530778169632,
-0.014439322054386139,
0.016815293580293655,
0.44252318143844604,
0.32096442580223083,
0.13171188533306122,
-1.0341064929962158,
0.14135991036891937,
0.35800909996032715,
0.04677759110927582,
-0.3209111988544464,
0.24520960450172424,
-0.18830297887325287,
-0.11204284429550171,
-0.06656389683485031,
0.20237530767917633,
0.044737160205841064,
-0.25587913393974304,
0.14269942045211792,
-0.41050130128860474
] |
https://github.com/huggingface/datasets/issues/5659 | > @sanchit-gandhi can you please also post the logs of `pip install soundfile==0.12.1`? To check what wheel is being installed or if it's being built from source (I think it's the latter case). Required `libsndfile` binary **should** be bundeled with `soundfile` wheel but I assume it **might not** be the case for some non standard Linux distributions. The only solution for using `soundfile` here is to build [`libsndfile`](https://github.com/libsndfile/libsndfile) from source:
>
> ```shell
> git clone https://github.com/libsndfile/libsndfile.git
> cd libsndfile/
> autoreconf -vif
> ./configure --enable-werror
> make
> make install
> ```
>
> for this, some building libraries should be installed, for Debian/Ubuntu it's like:
>
> ```shell
> apt install autoconf autogen automake build-essential libasound2-dev \
> libflac-dev libogg-dev libtool libvorbis-dev libopus-dev libmp3lame-dev \
> libmpg123-dev pkg-config python
> ```
>
> but for other Linux distributions it might be different.
>
> When the binary is compiled, it should be put into location where `soundfile` would search for it (the directory is named `_soundfile_data`), it depends on where`libsdfile` (from the previous step) and `soundfile` were installed, might be something like this:
>
> ```shell
> cp /usr/local/lib/libsndfile.so /usr/local/lib/python3.7/dist-packages/_soundfile_data/
> cp /usr/local/lib/libsndfile.la /usr/local/lib/python3.7/dist-packages/_soundfile_data/
> ```
>
> Another solution is to not use `soundfile` and apply custom processing function with `torchaudio` while setting `decode=False` in `Audio` feature and passing custom function to `.map`.
Thanks, the solution solved my problem.
1. Purge uninstall libsndfile, uninstall python-soundfile.
2. Build libsndfile from source code and install.
3. Build python-soundfile from source code and install
4. Well done. | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files | ### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28 | 257 | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files
### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28
> @sanchit-gandhi can you please also post the logs of `pip install soundfile==0.12.1`? To check what wheel is being installed or if it's being built from source (I think it's the latter case). Required `libsndfile` binary **should** be bundeled with `soundfile` wheel but I assume it **might not** be the case for some non standard Linux distributions. The only solution for using `soundfile` here is to build [`libsndfile`](https://github.com/libsndfile/libsndfile) from source:
>
> ```shell
> git clone https://github.com/libsndfile/libsndfile.git
> cd libsndfile/
> autoreconf -vif
> ./configure --enable-werror
> make
> make install
> ```
>
> for this, some building libraries should be installed, for Debian/Ubuntu it's like:
>
> ```shell
> apt install autoconf autogen automake build-essential libasound2-dev \
> libflac-dev libogg-dev libtool libvorbis-dev libopus-dev libmp3lame-dev \
> libmpg123-dev pkg-config python
> ```
>
> but for other Linux distributions it might be different.
>
> When the binary is compiled, it should be put into location where `soundfile` would search for it (the directory is named `_soundfile_data`), it depends on where`libsdfile` (from the previous step) and `soundfile` were installed, might be something like this:
>
> ```shell
> cp /usr/local/lib/libsndfile.so /usr/local/lib/python3.7/dist-packages/_soundfile_data/
> cp /usr/local/lib/libsndfile.la /usr/local/lib/python3.7/dist-packages/_soundfile_data/
> ```
>
> Another solution is to not use `soundfile` and apply custom processing function with `torchaudio` while setting `decode=False` in `Audio` feature and passing custom function to `.map`.
Thanks, the solution solved my problem.
1. Purge uninstall libsndfile, uninstall python-soundfile.
2. Build libsndfile from source code and install.
3. Build python-soundfile from source code and install
4. Well done. | [
-0.049880754202604294,
0.21389538049697876,
-0.02552657201886177,
0.37763962149620056,
0.36412861943244934,
-0.05396618694067001,
0.2889644503593445,
0.11923642456531525,
-0.2776981592178345,
0.2703988552093506,
-0.33914411067962646,
0.02121618017554283,
-0.19508084654808044,
-0.05244786664843559,
-0.07602284848690033,
-0.053154755383729935,
-0.146317720413208,
0.5547893047332764,
0.1439652442932129,
0.06756901741027832,
-0.16367927193641663,
0.3902137875556946,
-0.12376674264669418,
-0.06845317035913467,
-0.24915023148059845,
0.048388101160526276,
0.12746968865394592,
0.17041106522083282,
-0.4433642625808716,
-0.35512402653694153,
0.4380989372730255,
0.2319992333650589,
-0.05099821090698242,
0.29043030738830566,
-0.00012352937483228743,
-0.11559702455997467,
0.20513415336608887,
-0.2270914912223816,
-0.40592265129089355,
-0.11279238760471344,
-0.212590754032135,
-0.131047785282135,
-0.018999427556991577,
-0.054712213575839996,
-0.054331302642822266,
-0.3607732355594635,
-0.2069346010684967,
-0.1928735375404358,
0.233961820602417,
0.3014804720878601,
0.13623759150505066,
0.17275191843509674,
-0.004351221024990082,
0.1199047714471817,
0.5826959609985352,
0.05023296922445297,
-0.12111442536115646,
0.09400640428066254,
0.2956078052520752,
0.06883106380701065,
0.16029924154281616,
0.11522360146045685,
-0.026204582303762436,
0.22168073058128357,
0.2528781592845917,
-0.09834760427474976,
0.10960826277732849,
-0.2319716513156891,
0.061605263501405716,
0.5462928414344788,
0.8929854035377502,
-0.13209515810012817,
-0.6255757808685303,
-0.3807216286659241,
-0.15301282703876495,
-0.1855306327342987,
0.3686770796775818,
-0.2373051643371582,
-0.10350987315177917,
0.29939761757850647,
-0.04895247891545296,
-0.0039725229144096375,
0.15861666202545166,
0.2882198095321655,
0.04949945956468582,
-0.1935369074344635,
-0.08759509027004242,
-0.1538151502609253,
0.31666818261146545,
-0.23562124371528625,
-0.1479191780090332,
-0.057447001338005066,
-0.06832793354988098,
0.21306248009204865,
-0.14738141000270844,
-0.10396292060613632,
0.08840421587228775,
0.07939273118972778,
0.07031139731407166,
0.15621960163116455,
-0.15107758343219757,
-0.053061552345752716,
-0.4215264618396759,
-0.046277355402708054,
0.1598110795021057,
-0.22630348801612854,
-0.062266863882541656,
-0.12766967713832855,
0.15912313759326935,
-0.09006772935390472,
0.3275679051876068,
-0.04262600094079971,
0.15337440371513367,
-0.37258824706077576,
-0.3740416169166565,
-0.01362275518476963,
0.30175721645355225,
-0.4751899242401123,
-0.41212451457977295,
0.04797927662730217,
-0.335199236869812,
-0.05054696649312973,
0.12953968346118927,
-0.04075709730386734,
0.09004686027765274,
0.5219283103942871,
0.4176955819129944,
0.19073054194450378,
-0.3532955050468445,
0.1694779247045517,
-0.021708309650421143,
-0.22332720458507538,
0.19873616099357605,
-0.02517165243625641,
0.3993792235851288,
-0.3515942096710205,
0.4323694109916687,
0.10456891357898712,
0.2842091917991638,
-0.049148090183734894,
-0.03585126996040344,
-0.07394207268953323,
-0.21954584121704102,
0.3524152636528015,
-0.17553046345710754,
0.019895687699317932,
-0.3287624716758728,
-0.11586916446685791,
-0.14956486225128174,
0.07563798129558563,
-0.20093664526939392,
-0.18875625729560852,
0.08634163439273834,
0.11109669506549835,
-0.4830392599105835,
0.27278685569763184,
-0.0029814280569553375,
-0.03812029957771301,
0.16576921939849854,
-0.41605913639068604,
0.024478504434227943,
-0.4133132994174957,
-0.2350761592388153,
-0.005670331418514252,
0.21449881792068481,
0.3355960249900818,
-0.3807133436203003,
-0.16003093123435974,
0.1093781590461731,
-0.1582372486591339,
-0.014331512153148651,
0.28229060769081116,
-0.13150735199451447,
0.29842907190322876,
-0.1967371106147766,
-0.10386650264263153,
0.5670567750930786,
-0.3654792308807373,
-0.42812711000442505,
0.1869962513446808,
0.08179593086242676,
0.4688357710838318,
0.07916706800460815,
-0.09337296336889267,
-0.09169740974903107,
-0.2231377810239792,
0.026687733829021454,
0.2629302144050598,
0.021867593750357628,
-0.18678542971611023,
0.0036608055233955383,
-0.4244551360607147,
0.06699034571647644,
0.3080374598503113,
0.03281782194972038,
-0.0945151299238205,
-0.01241455227136612,
0.4726387858390808,
0.2068977952003479,
-0.05670391768217087,
-0.05299684405326843,
0.10259047150611877,
0.5188701152801514,
0.23160745203495026,
0.11004562675952911,
-0.27419614791870117,
-0.08054119348526001,
0.11274544894695282,
0.26938340067863464,
0.04825346916913986,
-0.018937665969133377,
-0.10919047892093658,
0.13499833643436432,
-0.3264015316963196,
-0.2200787365436554,
0.24825221300125122,
-0.02232525497674942,
0.19468650221824646,
-0.22108615934848785,
-0.16697615385055542,
-0.0948956310749054,
0.10557926446199417,
-0.041065700352191925,
0.08541779220104218,
-0.30294209718704224,
-0.013122964650392532,
-0.022907255217432976,
0.08476229012012482,
0.15625116229057312,
0.41044124960899353,
0.046248309314250946,
-0.028219161555171013,
-0.10161028802394867,
0.29566460847854614,
0.5504580140113831,
-0.04094335064291954,
-0.4070577621459961,
0.5133808851242065,
0.30632925033569336,
0.05058152973651886,
-0.0856696292757988,
0.11710736155509949,
0.13307631015777588,
-0.20405864715576172,
0.16750679910182953,
0.2205520123243332,
-0.15079250931739807,
0.20390070974826813,
0.22054103016853333,
-0.2713400721549988,
0.2415943741798401,
0.286283940076828,
-0.2198144793510437,
-0.01912011206150055,
0.3594229221343994,
-0.17885804176330566,
0.40677785873413086,
-0.033479444682598114,
-0.14399105310440063,
-0.10318043828010559,
0.3257092237472534,
-0.06670576333999634,
-0.1779118776321411,
0.02396165020763874,
0.24085742235183716,
0.00036713480949401855,
0.051515594124794006,
0.32336050271987915,
0.6417386531829834,
0.23663672804832458,
0.0583278052508831,
-0.1511276513338089,
0.14702802896499634,
-0.46651220321655273,
0.14897891879081726,
0.1944667398929596,
-0.18413323163986206,
0.19084791839122772,
-0.04314263537526131,
0.2557905614376068,
-0.15247607231140137,
-0.17638370394706726,
0.07772140204906464,
0.10773403942584991,
-0.6525932550430298,
-0.07663445174694061,
-0.5262326598167419,
-0.1669667363166809,
-0.05134958401322365,
-0.28166258335113525,
-0.22957497835159302,
-0.08068374544382095,
0.09765132516622543,
0.07579837739467621,
-0.08529283851385117,
0.10263793170452118,
-0.0048494115471839905,
0.2893795967102051,
0.022972434759140015,
-0.3243034780025482,
0.1744280904531479,
0.3457619845867157,
-0.18844205141067505,
0.05915559083223343,
0.2852771580219269,
0.0943983644247055,
0.08993659168481827,
-0.31309956312179565,
-0.04984241724014282,
0.09779687225818634,
-0.2658802568912506,
0.1755244880914688,
-0.051112040877342224,
0.4030529260635376,
0.4598187506198883,
0.2776840329170227,
-0.01574307680130005,
-0.29303157329559326,
0.12528514862060547,
0.3331541121006012,
-0.03231336921453476,
-0.0120614655315876,
0.09485800564289093,
-0.05390311777591705,
-0.3954113721847534,
-0.4637475609779358,
-0.09166411310434341,
-0.342678427696228,
0.4091050624847412,
-0.0009286105632781982,
0.29537221789360046,
0.7557628154754639,
0.10837189108133316,
0.16713321208953857,
0.05080293118953705,
0.3576146066188812,
-0.17955073714256287,
-0.2276766151189804,
0.28309252858161926,
-0.11396460235118866,
-0.303384929895401,
-0.04539373517036438,
0.35711732506752014,
0.14031872153282166,
0.3954789638519287,
-0.3866767883300781,
-0.09279977530241013,
0.059751659631729126,
0.12738268077373505,
-0.08320583403110504,
0.15560562908649445,
0.1681663691997528,
0.35791730880737305,
0.09560039639472961,
-0.2865777611732483,
-0.18124669790267944,
0.08127886056900024,
-0.05408429354429245,
0.4320569932460785,
0.021040581166744232,
0.17854969203472137,
-0.22137151658535004,
0.5179806351661682,
0.052715882658958435,
-0.09091222286224365,
0.1991945207118988,
0.06482471525669098,
0.5033174157142639,
-0.060297902673482895,
-0.06210479885339737,
0.15956968069076538,
0.13854898512363434,
0.04431522637605667,
0.2818880081176758,
0.2857184112071991,
0.2571042776107788,
-0.3721221089363098,
0.3562707006931305,
-0.04199487715959549,
-0.14647933840751648,
0.1360076516866684,
0.07740478217601776,
0.05388224124908447,
0.051632463932037354,
0.353665292263031,
0.2875666320323944,
0.013879232108592987,
-0.1203811764717102,
0.5422342419624329,
0.21971572935581207,
0.0034470371901988983,
-0.036417052149772644,
-0.18140414357185364,
-0.019346676766872406,
0.0817226842045784,
0.1935337781906128,
0.4616091549396515,
-0.12792667746543884,
0.21326756477355957,
-0.15885350108146667,
0.03416925668716431,
0.07593531161546707,
-0.272318959236145,
0.05997177213430405,
0.12492083758115768,
0.2236122488975525,
-0.10954473912715912,
-0.14760330319404602,
-0.25815439224243164,
-0.21468180418014526,
0.22984443604946136,
0.28489768505096436,
-0.2363368570804596,
-0.4179784059524536,
-0.09194179624319077,
0.2912096083164215,
0.06766165792942047,
-0.1665307581424713,
-0.2633426785469055,
-0.47394129633903503,
-0.18938100337982178,
-0.1969667226076126,
0.03286519646644592,
0.2830890119075775,
-0.0696721151471138,
-0.07128984481096268,
0.23050127923488617,
-0.1764470934867859,
0.4720379710197449,
-0.1110110953450203,
0.24739310145378113,
0.07275800406932831,
0.17503520846366882,
0.07667746394872665,
-0.27621522545814514,
0.6093207001686096,
0.4613340497016907,
-0.5748463273048401,
0.05490966886281967,
0.049286969006061554,
-0.10494129359722137,
0.12657833099365234,
0.49734050035476685,
-0.203236922621727,
0.03332185000181198,
-0.20988425612449646,
-0.16689932346343994,
-0.0899110734462738,
0.3369802236557007,
0.3057073950767517,
-0.14112025499343872,
-0.019365880638360977,
-0.5954620242118835,
0.4933858811855316,
-0.13040564954280853,
-0.07425784319639206,
0.5431771874427795,
0.3751167058944702,
-0.2540671229362488,
0.050071295350790024,
-0.20028972625732422,
0.938000500202179,
0.1679849624633789,
-0.03475185111165047,
0.39505746960639954,
-0.27726638317108154,
0.24796538054943085,
-0.13314253091812134,
-0.04472142085433006,
0.15066981315612793,
-0.07901407778263092,
-0.2124829888343811,
-0.08163972198963165,
0.15276764333248138,
0.24742946028709412,
-0.19619068503379822,
0.2571852505207062,
0.2363925576210022,
-0.18507754802703857,
0.2410515993833542,
0.34127533435821533,
-0.08825967460870743,
-0.23929600417613983,
-0.4996219277381897,
0.05983947589993477,
-0.21201923489570618,
0.2821532189846039,
-0.23345227539539337,
-0.16736644506454468,
-0.16223132610321045,
-0.37301158905029297,
-0.3034265637397766,
-0.019777558743953705,
-0.606201708316803,
0.00012835487723350525,
0.004050400108098984,
-0.20931224524974823,
0.42495083808898926,
-0.05781005695462227,
-0.3502541184425354,
0.5912764072418213,
-0.3381415009498596,
0.08814430236816406,
-0.21939721703529358,
0.09057898074388504,
0.07562681287527084,
0.06658387184143066,
0.22453032433986664,
-0.0499744638800621,
-0.11331059783697128,
-0.4267258644104004,
-0.24010314047336578,
-0.2405204176902771,
0.40968477725982666,
-0.37012097239494324,
-0.1007474809885025,
-0.13668981194496155,
-0.3043428063392639,
-0.0966453030705452,
0.005863375961780548,
-0.04695793241262436,
0.06841325014829636,
0.14428788423538208,
-0.17190629243850708,
0.1301976442337036,
-0.07909689843654633,
-0.052401527762413025,
-0.12111671268939972,
0.2273588478565216,
-0.2594868838787079,
-0.2101680040359497,
0.3971303403377533,
0.12155332416296005,
-0.2633444368839264,
-0.16250447928905487,
0.049894750118255615,
-0.11894838511943817,
-0.30585232377052307,
-0.0868089348077774,
0.08560147136449814,
-0.10372979938983917,
0.05212811380624771,
0.08991599082946777,
0.14536239206790924,
0.04630175977945328,
0.02371421456336975,
-0.46576231718063354,
-0.1444142758846283,
0.33241701126098633,
-0.0263862032443285,
0.21902932226657867,
-0.16694171726703644,
-0.14410270750522614,
0.13567489385604858,
-0.031051678583025932,
-0.20413824915885925,
0.10186794400215149,
0.20448264479637146,
0.22578826546669006,
0.05633607134222984,
0.01620342768728733,
0.18995505571365356,
-0.27500054240226746,
-0.0026572681963443756,
0.04666141793131828,
-0.3123891353607178,
-0.00710136815905571,
-0.1346241533756256,
0.27495816349983215,
0.08997180312871933,
-0.3378797173500061,
0.10601218044757843,
-0.023355308920145035,
-0.2518883943557739,
-0.31359007954597473,
0.01891321688890457,
0.13236814737319946,
-0.18413738906383514,
-0.0060387589037418365,
0.07058614492416382,
0.1286289095878601,
-0.07012122124433517,
0.12594091892242432,
0.015206249430775642,
0.08092226833105087,
0.308966726064682,
0.19208374619483948,
-0.016553163528442383,
-0.04961317777633667,
-0.053215306252241135,
0.22263884544372559,
-0.03684983775019646,
-0.07609260082244873,
0.13448898494243622,
-0.29783064126968384,
-0.009367622435092926,
0.4454352855682373,
0.18453775346279144,
0.6857518553733826,
-0.12068187445402145,
0.05556870996952057,
0.08004177361726761,
0.08756674826145172,
-0.00683072954416275,
-0.007918812334537506,
-0.048252083361148834,
0.24565450847148895,
-0.09880185127258301,
0.28393763303756714,
0.1330655813217163,
-0.36537498235702515,
0.01902661845088005,
0.17367951571941376,
0.13045048713684082,
-0.1283191442489624,
0.08824574947357178,
0.7129381895065308,
-0.04891401156783104,
0.0782170370221138,
-0.10460636019706726,
-0.14702528715133667,
0.0594286173582077,
0.24855662882328033,
-0.48144787549972534,
0.10729558020830154,
0.2871219515800476,
-0.0034803934395313263,
-0.03293869271874428,
-0.5146503448486328,
-0.1732814610004425,
0.4555957019329071,
0.012798868119716644,
0.09392284601926804,
0.15349701046943665,
0.28658968210220337,
-0.4708642363548279,
-0.06937574595212936,
0.014115259051322937,
-0.16176843643188477,
-0.20174631476402283,
0.07785511016845703,
0.4016444683074951,
-0.2385188192129135,
-0.2536187469959259,
-0.06496354937553406,
-0.20226696133613586,
-0.2064248025417328,
-0.16271351277828217,
-0.050924405455589294,
0.01518799178302288,
-0.2840879261493683,
-0.23341940343379974,
-0.01324634812772274,
0.09218625724315643,
-0.3112953305244446,
0.23744700849056244,
0.3032325506210327,
-0.2797801196575165,
0.38987892866134644,
0.33272209763526917,
0.3134801983833313,
0.37833598256111145,
0.04781593754887581,
-0.17094974219799042,
-0.07845340669155121,
-0.026743929833173752,
0.20055435597896576,
0.4092733561992645,
0.031013019382953644,
0.32037633657455444,
0.3283001780509949,
0.014640580862760544,
-0.08389662206172943,
-0.2958451807498932,
0.14827463030815125,
-0.2095751315355301,
-0.6450566649436951,
0.6928914189338684,
-0.24998123943805695,
-0.10601246356964111,
-0.017907211557030678,
0.16609330475330353,
-0.22683022916316986,
0.04262946546077728,
0.521144688129425,
0.3244016468524933,
0.12816248834133148,
0.2558424174785614,
0.03910692036151886,
-0.13781395554542542,
0.24463161826133728,
0.27388665080070496,
0.07700177282094955,
-0.15622597932815552,
0.04958409070968628,
-0.6452693939208984,
-0.12914186716079712,
-0.031144512817263603,
0.0005436018109321594,
0.019787825644016266,
0.10342984646558762,
0.11867766082286835,
0.2379944771528244,
-0.11887377500534058,
0.09634602069854736,
0.5744260549545288,
-0.21504133939743042,
-0.2127048373222351,
-0.10693959891796112,
0.17755445837974548,
-0.12562133371829987,
-0.18995913863182068,
-0.5206833481788635,
0.06388142704963684,
-0.08415568619966507,
-0.09346799552440643,
-0.24923253059387207,
0.012487582862377167,
-0.10319863259792328,
0.0343782864511013,
0.17088237404823303,
0.09636779129505157,
0.5322657823562622,
-0.1261870265007019,
-0.32451331615448,
-0.3152916729450226,
-0.04203229025006294,
0.036233969032764435,
0.19935694336891174,
-0.13211767375469208,
0.38022711873054504,
-0.18788117170333862,
0.16983675956726074,
-0.34704285860061646,
0.32919585704803467,
-0.11708049476146698,
0.18016721308231354,
-0.4201682209968567,
-0.005040924996137619,
-0.41661766171455383,
0.18146862089633942,
0.05345861613750458,
-0.22326934337615967,
-0.0794333666563034,
0.008804969489574432,
-0.499805748462677,
-0.28783613443374634,
0.528273344039917,
-0.2095530778169632,
-0.014439322054386139,
0.016815293580293655,
0.44252318143844604,
0.32096442580223083,
0.13171188533306122,
-1.0341064929962158,
0.14135991036891937,
0.35800909996032715,
0.04677759110927582,
-0.3209111988544464,
0.24520960450172424,
-0.18830297887325287,
-0.11204284429550171,
-0.06656389683485031,
0.20237530767917633,
0.044737160205841064,
-0.25587913393974304,
0.14269942045211792,
-0.41050130128860474
] |
https://github.com/huggingface/datasets/issues/5659 | > Thank you so much for the comprehensive instructions @polinaeterna! Also confirming that they worked for me 🤗 In my case, I had to run several of these commands under "sudo" for privileges, but otherwise this workaround gave a successful `libsndfile` install:
>
> 1. Grab source code:
>
> ```
> git clone https://github.com/libsndfile/libsndfile.git
> ```
>
> 2. Set up a build environment:
>
> ```
> sudo apt install autoconf autogen automake build-essential libasound2-dev \
> libflac-dev libogg-dev libtool libvorbis-dev libopus-dev libmp3lame-dev \
> libmpg123-dev pkg-config python
> ```
>
> 3. Build and test `libsndfile`:
>
> ```
> autoreconf -vif
> ./configure --enable-werror
> sudo make
> sudo make check
> ```
>
> 4. Create `_soundfile_data` submodule (if it does not exist already):
>
> ```
> sudo mkdir /usr/local/lib/python3.8/dist-packages/_soundfile_data/
> ```
>
> 5. Copy `libsndfile` files into submodule:
>
> ```
> sudo cp /usr/local/lib/libsndfile.* /usr/local/lib/python3.8/dist-packages/_soundfile_data/
> ```
I had to run 'make install' or the `/usr/local/lib/libsndfile.*` files didn't exist.
It's working though! | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files | ### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28 | 171 | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files
### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28
> Thank you so much for the comprehensive instructions @polinaeterna! Also confirming that they worked for me 🤗 In my case, I had to run several of these commands under "sudo" for privileges, but otherwise this workaround gave a successful `libsndfile` install:
>
> 1. Grab source code:
>
> ```
> git clone https://github.com/libsndfile/libsndfile.git
> ```
>
> 2. Set up a build environment:
>
> ```
> sudo apt install autoconf autogen automake build-essential libasound2-dev \
> libflac-dev libogg-dev libtool libvorbis-dev libopus-dev libmp3lame-dev \
> libmpg123-dev pkg-config python
> ```
>
> 3. Build and test `libsndfile`:
>
> ```
> autoreconf -vif
> ./configure --enable-werror
> sudo make
> sudo make check
> ```
>
> 4. Create `_soundfile_data` submodule (if it does not exist already):
>
> ```
> sudo mkdir /usr/local/lib/python3.8/dist-packages/_soundfile_data/
> ```
>
> 5. Copy `libsndfile` files into submodule:
>
> ```
> sudo cp /usr/local/lib/libsndfile.* /usr/local/lib/python3.8/dist-packages/_soundfile_data/
> ```
I had to run 'make install' or the `/usr/local/lib/libsndfile.*` files didn't exist.
It's working though! | [
-0.049880754202604294,
0.21389538049697876,
-0.02552657201886177,
0.37763962149620056,
0.36412861943244934,
-0.05396618694067001,
0.2889644503593445,
0.11923642456531525,
-0.2776981592178345,
0.2703988552093506,
-0.33914411067962646,
0.02121618017554283,
-0.19508084654808044,
-0.05244786664843559,
-0.07602284848690033,
-0.053154755383729935,
-0.146317720413208,
0.5547893047332764,
0.1439652442932129,
0.06756901741027832,
-0.16367927193641663,
0.3902137875556946,
-0.12376674264669418,
-0.06845317035913467,
-0.24915023148059845,
0.048388101160526276,
0.12746968865394592,
0.17041106522083282,
-0.4433642625808716,
-0.35512402653694153,
0.4380989372730255,
0.2319992333650589,
-0.05099821090698242,
0.29043030738830566,
-0.00012352937483228743,
-0.11559702455997467,
0.20513415336608887,
-0.2270914912223816,
-0.40592265129089355,
-0.11279238760471344,
-0.212590754032135,
-0.131047785282135,
-0.018999427556991577,
-0.054712213575839996,
-0.054331302642822266,
-0.3607732355594635,
-0.2069346010684967,
-0.1928735375404358,
0.233961820602417,
0.3014804720878601,
0.13623759150505066,
0.17275191843509674,
-0.004351221024990082,
0.1199047714471817,
0.5826959609985352,
0.05023296922445297,
-0.12111442536115646,
0.09400640428066254,
0.2956078052520752,
0.06883106380701065,
0.16029924154281616,
0.11522360146045685,
-0.026204582303762436,
0.22168073058128357,
0.2528781592845917,
-0.09834760427474976,
0.10960826277732849,
-0.2319716513156891,
0.061605263501405716,
0.5462928414344788,
0.8929854035377502,
-0.13209515810012817,
-0.6255757808685303,
-0.3807216286659241,
-0.15301282703876495,
-0.1855306327342987,
0.3686770796775818,
-0.2373051643371582,
-0.10350987315177917,
0.29939761757850647,
-0.04895247891545296,
-0.0039725229144096375,
0.15861666202545166,
0.2882198095321655,
0.04949945956468582,
-0.1935369074344635,
-0.08759509027004242,
-0.1538151502609253,
0.31666818261146545,
-0.23562124371528625,
-0.1479191780090332,
-0.057447001338005066,
-0.06832793354988098,
0.21306248009204865,
-0.14738141000270844,
-0.10396292060613632,
0.08840421587228775,
0.07939273118972778,
0.07031139731407166,
0.15621960163116455,
-0.15107758343219757,
-0.053061552345752716,
-0.4215264618396759,
-0.046277355402708054,
0.1598110795021057,
-0.22630348801612854,
-0.062266863882541656,
-0.12766967713832855,
0.15912313759326935,
-0.09006772935390472,
0.3275679051876068,
-0.04262600094079971,
0.15337440371513367,
-0.37258824706077576,
-0.3740416169166565,
-0.01362275518476963,
0.30175721645355225,
-0.4751899242401123,
-0.41212451457977295,
0.04797927662730217,
-0.335199236869812,
-0.05054696649312973,
0.12953968346118927,
-0.04075709730386734,
0.09004686027765274,
0.5219283103942871,
0.4176955819129944,
0.19073054194450378,
-0.3532955050468445,
0.1694779247045517,
-0.021708309650421143,
-0.22332720458507538,
0.19873616099357605,
-0.02517165243625641,
0.3993792235851288,
-0.3515942096710205,
0.4323694109916687,
0.10456891357898712,
0.2842091917991638,
-0.049148090183734894,
-0.03585126996040344,
-0.07394207268953323,
-0.21954584121704102,
0.3524152636528015,
-0.17553046345710754,
0.019895687699317932,
-0.3287624716758728,
-0.11586916446685791,
-0.14956486225128174,
0.07563798129558563,
-0.20093664526939392,
-0.18875625729560852,
0.08634163439273834,
0.11109669506549835,
-0.4830392599105835,
0.27278685569763184,
-0.0029814280569553375,
-0.03812029957771301,
0.16576921939849854,
-0.41605913639068604,
0.024478504434227943,
-0.4133132994174957,
-0.2350761592388153,
-0.005670331418514252,
0.21449881792068481,
0.3355960249900818,
-0.3807133436203003,
-0.16003093123435974,
0.1093781590461731,
-0.1582372486591339,
-0.014331512153148651,
0.28229060769081116,
-0.13150735199451447,
0.29842907190322876,
-0.1967371106147766,
-0.10386650264263153,
0.5670567750930786,
-0.3654792308807373,
-0.42812711000442505,
0.1869962513446808,
0.08179593086242676,
0.4688357710838318,
0.07916706800460815,
-0.09337296336889267,
-0.09169740974903107,
-0.2231377810239792,
0.026687733829021454,
0.2629302144050598,
0.021867593750357628,
-0.18678542971611023,
0.0036608055233955383,
-0.4244551360607147,
0.06699034571647644,
0.3080374598503113,
0.03281782194972038,
-0.0945151299238205,
-0.01241455227136612,
0.4726387858390808,
0.2068977952003479,
-0.05670391768217087,
-0.05299684405326843,
0.10259047150611877,
0.5188701152801514,
0.23160745203495026,
0.11004562675952911,
-0.27419614791870117,
-0.08054119348526001,
0.11274544894695282,
0.26938340067863464,
0.04825346916913986,
-0.018937665969133377,
-0.10919047892093658,
0.13499833643436432,
-0.3264015316963196,
-0.2200787365436554,
0.24825221300125122,
-0.02232525497674942,
0.19468650221824646,
-0.22108615934848785,
-0.16697615385055542,
-0.0948956310749054,
0.10557926446199417,
-0.041065700352191925,
0.08541779220104218,
-0.30294209718704224,
-0.013122964650392532,
-0.022907255217432976,
0.08476229012012482,
0.15625116229057312,
0.41044124960899353,
0.046248309314250946,
-0.028219161555171013,
-0.10161028802394867,
0.29566460847854614,
0.5504580140113831,
-0.04094335064291954,
-0.4070577621459961,
0.5133808851242065,
0.30632925033569336,
0.05058152973651886,
-0.0856696292757988,
0.11710736155509949,
0.13307631015777588,
-0.20405864715576172,
0.16750679910182953,
0.2205520123243332,
-0.15079250931739807,
0.20390070974826813,
0.22054103016853333,
-0.2713400721549988,
0.2415943741798401,
0.286283940076828,
-0.2198144793510437,
-0.01912011206150055,
0.3594229221343994,
-0.17885804176330566,
0.40677785873413086,
-0.033479444682598114,
-0.14399105310440063,
-0.10318043828010559,
0.3257092237472534,
-0.06670576333999634,
-0.1779118776321411,
0.02396165020763874,
0.24085742235183716,
0.00036713480949401855,
0.051515594124794006,
0.32336050271987915,
0.6417386531829834,
0.23663672804832458,
0.0583278052508831,
-0.1511276513338089,
0.14702802896499634,
-0.46651220321655273,
0.14897891879081726,
0.1944667398929596,
-0.18413323163986206,
0.19084791839122772,
-0.04314263537526131,
0.2557905614376068,
-0.15247607231140137,
-0.17638370394706726,
0.07772140204906464,
0.10773403942584991,
-0.6525932550430298,
-0.07663445174694061,
-0.5262326598167419,
-0.1669667363166809,
-0.05134958401322365,
-0.28166258335113525,
-0.22957497835159302,
-0.08068374544382095,
0.09765132516622543,
0.07579837739467621,
-0.08529283851385117,
0.10263793170452118,
-0.0048494115471839905,
0.2893795967102051,
0.022972434759140015,
-0.3243034780025482,
0.1744280904531479,
0.3457619845867157,
-0.18844205141067505,
0.05915559083223343,
0.2852771580219269,
0.0943983644247055,
0.08993659168481827,
-0.31309956312179565,
-0.04984241724014282,
0.09779687225818634,
-0.2658802568912506,
0.1755244880914688,
-0.051112040877342224,
0.4030529260635376,
0.4598187506198883,
0.2776840329170227,
-0.01574307680130005,
-0.29303157329559326,
0.12528514862060547,
0.3331541121006012,
-0.03231336921453476,
-0.0120614655315876,
0.09485800564289093,
-0.05390311777591705,
-0.3954113721847534,
-0.4637475609779358,
-0.09166411310434341,
-0.342678427696228,
0.4091050624847412,
-0.0009286105632781982,
0.29537221789360046,
0.7557628154754639,
0.10837189108133316,
0.16713321208953857,
0.05080293118953705,
0.3576146066188812,
-0.17955073714256287,
-0.2276766151189804,
0.28309252858161926,
-0.11396460235118866,
-0.303384929895401,
-0.04539373517036438,
0.35711732506752014,
0.14031872153282166,
0.3954789638519287,
-0.3866767883300781,
-0.09279977530241013,
0.059751659631729126,
0.12738268077373505,
-0.08320583403110504,
0.15560562908649445,
0.1681663691997528,
0.35791730880737305,
0.09560039639472961,
-0.2865777611732483,
-0.18124669790267944,
0.08127886056900024,
-0.05408429354429245,
0.4320569932460785,
0.021040581166744232,
0.17854969203472137,
-0.22137151658535004,
0.5179806351661682,
0.052715882658958435,
-0.09091222286224365,
0.1991945207118988,
0.06482471525669098,
0.5033174157142639,
-0.060297902673482895,
-0.06210479885339737,
0.15956968069076538,
0.13854898512363434,
0.04431522637605667,
0.2818880081176758,
0.2857184112071991,
0.2571042776107788,
-0.3721221089363098,
0.3562707006931305,
-0.04199487715959549,
-0.14647933840751648,
0.1360076516866684,
0.07740478217601776,
0.05388224124908447,
0.051632463932037354,
0.353665292263031,
0.2875666320323944,
0.013879232108592987,
-0.1203811764717102,
0.5422342419624329,
0.21971572935581207,
0.0034470371901988983,
-0.036417052149772644,
-0.18140414357185364,
-0.019346676766872406,
0.0817226842045784,
0.1935337781906128,
0.4616091549396515,
-0.12792667746543884,
0.21326756477355957,
-0.15885350108146667,
0.03416925668716431,
0.07593531161546707,
-0.272318959236145,
0.05997177213430405,
0.12492083758115768,
0.2236122488975525,
-0.10954473912715912,
-0.14760330319404602,
-0.25815439224243164,
-0.21468180418014526,
0.22984443604946136,
0.28489768505096436,
-0.2363368570804596,
-0.4179784059524536,
-0.09194179624319077,
0.2912096083164215,
0.06766165792942047,
-0.1665307581424713,
-0.2633426785469055,
-0.47394129633903503,
-0.18938100337982178,
-0.1969667226076126,
0.03286519646644592,
0.2830890119075775,
-0.0696721151471138,
-0.07128984481096268,
0.23050127923488617,
-0.1764470934867859,
0.4720379710197449,
-0.1110110953450203,
0.24739310145378113,
0.07275800406932831,
0.17503520846366882,
0.07667746394872665,
-0.27621522545814514,
0.6093207001686096,
0.4613340497016907,
-0.5748463273048401,
0.05490966886281967,
0.049286969006061554,
-0.10494129359722137,
0.12657833099365234,
0.49734050035476685,
-0.203236922621727,
0.03332185000181198,
-0.20988425612449646,
-0.16689932346343994,
-0.0899110734462738,
0.3369802236557007,
0.3057073950767517,
-0.14112025499343872,
-0.019365880638360977,
-0.5954620242118835,
0.4933858811855316,
-0.13040564954280853,
-0.07425784319639206,
0.5431771874427795,
0.3751167058944702,
-0.2540671229362488,
0.050071295350790024,
-0.20028972625732422,
0.938000500202179,
0.1679849624633789,
-0.03475185111165047,
0.39505746960639954,
-0.27726638317108154,
0.24796538054943085,
-0.13314253091812134,
-0.04472142085433006,
0.15066981315612793,
-0.07901407778263092,
-0.2124829888343811,
-0.08163972198963165,
0.15276764333248138,
0.24742946028709412,
-0.19619068503379822,
0.2571852505207062,
0.2363925576210022,
-0.18507754802703857,
0.2410515993833542,
0.34127533435821533,
-0.08825967460870743,
-0.23929600417613983,
-0.4996219277381897,
0.05983947589993477,
-0.21201923489570618,
0.2821532189846039,
-0.23345227539539337,
-0.16736644506454468,
-0.16223132610321045,
-0.37301158905029297,
-0.3034265637397766,
-0.019777558743953705,
-0.606201708316803,
0.00012835487723350525,
0.004050400108098984,
-0.20931224524974823,
0.42495083808898926,
-0.05781005695462227,
-0.3502541184425354,
0.5912764072418213,
-0.3381415009498596,
0.08814430236816406,
-0.21939721703529358,
0.09057898074388504,
0.07562681287527084,
0.06658387184143066,
0.22453032433986664,
-0.0499744638800621,
-0.11331059783697128,
-0.4267258644104004,
-0.24010314047336578,
-0.2405204176902771,
0.40968477725982666,
-0.37012097239494324,
-0.1007474809885025,
-0.13668981194496155,
-0.3043428063392639,
-0.0966453030705452,
0.005863375961780548,
-0.04695793241262436,
0.06841325014829636,
0.14428788423538208,
-0.17190629243850708,
0.1301976442337036,
-0.07909689843654633,
-0.052401527762413025,
-0.12111671268939972,
0.2273588478565216,
-0.2594868838787079,
-0.2101680040359497,
0.3971303403377533,
0.12155332416296005,
-0.2633444368839264,
-0.16250447928905487,
0.049894750118255615,
-0.11894838511943817,
-0.30585232377052307,
-0.0868089348077774,
0.08560147136449814,
-0.10372979938983917,
0.05212811380624771,
0.08991599082946777,
0.14536239206790924,
0.04630175977945328,
0.02371421456336975,
-0.46576231718063354,
-0.1444142758846283,
0.33241701126098633,
-0.0263862032443285,
0.21902932226657867,
-0.16694171726703644,
-0.14410270750522614,
0.13567489385604858,
-0.031051678583025932,
-0.20413824915885925,
0.10186794400215149,
0.20448264479637146,
0.22578826546669006,
0.05633607134222984,
0.01620342768728733,
0.18995505571365356,
-0.27500054240226746,
-0.0026572681963443756,
0.04666141793131828,
-0.3123891353607178,
-0.00710136815905571,
-0.1346241533756256,
0.27495816349983215,
0.08997180312871933,
-0.3378797173500061,
0.10601218044757843,
-0.023355308920145035,
-0.2518883943557739,
-0.31359007954597473,
0.01891321688890457,
0.13236814737319946,
-0.18413738906383514,
-0.0060387589037418365,
0.07058614492416382,
0.1286289095878601,
-0.07012122124433517,
0.12594091892242432,
0.015206249430775642,
0.08092226833105087,
0.308966726064682,
0.19208374619483948,
-0.016553163528442383,
-0.04961317777633667,
-0.053215306252241135,
0.22263884544372559,
-0.03684983775019646,
-0.07609260082244873,
0.13448898494243622,
-0.29783064126968384,
-0.009367622435092926,
0.4454352855682373,
0.18453775346279144,
0.6857518553733826,
-0.12068187445402145,
0.05556870996952057,
0.08004177361726761,
0.08756674826145172,
-0.00683072954416275,
-0.007918812334537506,
-0.048252083361148834,
0.24565450847148895,
-0.09880185127258301,
0.28393763303756714,
0.1330655813217163,
-0.36537498235702515,
0.01902661845088005,
0.17367951571941376,
0.13045048713684082,
-0.1283191442489624,
0.08824574947357178,
0.7129381895065308,
-0.04891401156783104,
0.0782170370221138,
-0.10460636019706726,
-0.14702528715133667,
0.0594286173582077,
0.24855662882328033,
-0.48144787549972534,
0.10729558020830154,
0.2871219515800476,
-0.0034803934395313263,
-0.03293869271874428,
-0.5146503448486328,
-0.1732814610004425,
0.4555957019329071,
0.012798868119716644,
0.09392284601926804,
0.15349701046943665,
0.28658968210220337,
-0.4708642363548279,
-0.06937574595212936,
0.014115259051322937,
-0.16176843643188477,
-0.20174631476402283,
0.07785511016845703,
0.4016444683074951,
-0.2385188192129135,
-0.2536187469959259,
-0.06496354937553406,
-0.20226696133613586,
-0.2064248025417328,
-0.16271351277828217,
-0.050924405455589294,
0.01518799178302288,
-0.2840879261493683,
-0.23341940343379974,
-0.01324634812772274,
0.09218625724315643,
-0.3112953305244446,
0.23744700849056244,
0.3032325506210327,
-0.2797801196575165,
0.38987892866134644,
0.33272209763526917,
0.3134801983833313,
0.37833598256111145,
0.04781593754887581,
-0.17094974219799042,
-0.07845340669155121,
-0.026743929833173752,
0.20055435597896576,
0.4092733561992645,
0.031013019382953644,
0.32037633657455444,
0.3283001780509949,
0.014640580862760544,
-0.08389662206172943,
-0.2958451807498932,
0.14827463030815125,
-0.2095751315355301,
-0.6450566649436951,
0.6928914189338684,
-0.24998123943805695,
-0.10601246356964111,
-0.017907211557030678,
0.16609330475330353,
-0.22683022916316986,
0.04262946546077728,
0.521144688129425,
0.3244016468524933,
0.12816248834133148,
0.2558424174785614,
0.03910692036151886,
-0.13781395554542542,
0.24463161826133728,
0.27388665080070496,
0.07700177282094955,
-0.15622597932815552,
0.04958409070968628,
-0.6452693939208984,
-0.12914186716079712,
-0.031144512817263603,
0.0005436018109321594,
0.019787825644016266,
0.10342984646558762,
0.11867766082286835,
0.2379944771528244,
-0.11887377500534058,
0.09634602069854736,
0.5744260549545288,
-0.21504133939743042,
-0.2127048373222351,
-0.10693959891796112,
0.17755445837974548,
-0.12562133371829987,
-0.18995913863182068,
-0.5206833481788635,
0.06388142704963684,
-0.08415568619966507,
-0.09346799552440643,
-0.24923253059387207,
0.012487582862377167,
-0.10319863259792328,
0.0343782864511013,
0.17088237404823303,
0.09636779129505157,
0.5322657823562622,
-0.1261870265007019,
-0.32451331615448,
-0.3152916729450226,
-0.04203229025006294,
0.036233969032764435,
0.19935694336891174,
-0.13211767375469208,
0.38022711873054504,
-0.18788117170333862,
0.16983675956726074,
-0.34704285860061646,
0.32919585704803467,
-0.11708049476146698,
0.18016721308231354,
-0.4201682209968567,
-0.005040924996137619,
-0.41661766171455383,
0.18146862089633942,
0.05345861613750458,
-0.22326934337615967,
-0.0794333666563034,
0.008804969489574432,
-0.499805748462677,
-0.28783613443374634,
0.528273344039917,
-0.2095530778169632,
-0.014439322054386139,
0.016815293580293655,
0.44252318143844604,
0.32096442580223083,
0.13171188533306122,
-1.0341064929962158,
0.14135991036891937,
0.35800909996032715,
0.04677759110927582,
-0.3209111988544464,
0.24520960450172424,
-0.18830297887325287,
-0.11204284429550171,
-0.06656389683485031,
0.20237530767917633,
0.044737160205841064,
-0.25587913393974304,
0.14269942045211792,
-0.41050130128860474
] |
https://github.com/huggingface/datasets/issues/5659 | I had the same issue but it is working now! Thanks for all of your comments! | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files | ### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28 | 16 | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files
### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28
I had the same issue but it is working now! Thanks for all of your comments! | [
-0.049880754202604294,
0.21389538049697876,
-0.02552657201886177,
0.37763962149620056,
0.36412861943244934,
-0.05396618694067001,
0.2889644503593445,
0.11923642456531525,
-0.2776981592178345,
0.2703988552093506,
-0.33914411067962646,
0.02121618017554283,
-0.19508084654808044,
-0.05244786664843559,
-0.07602284848690033,
-0.053154755383729935,
-0.146317720413208,
0.5547893047332764,
0.1439652442932129,
0.06756901741027832,
-0.16367927193641663,
0.3902137875556946,
-0.12376674264669418,
-0.06845317035913467,
-0.24915023148059845,
0.048388101160526276,
0.12746968865394592,
0.17041106522083282,
-0.4433642625808716,
-0.35512402653694153,
0.4380989372730255,
0.2319992333650589,
-0.05099821090698242,
0.29043030738830566,
-0.00012352937483228743,
-0.11559702455997467,
0.20513415336608887,
-0.2270914912223816,
-0.40592265129089355,
-0.11279238760471344,
-0.212590754032135,
-0.131047785282135,
-0.018999427556991577,
-0.054712213575839996,
-0.054331302642822266,
-0.3607732355594635,
-0.2069346010684967,
-0.1928735375404358,
0.233961820602417,
0.3014804720878601,
0.13623759150505066,
0.17275191843509674,
-0.004351221024990082,
0.1199047714471817,
0.5826959609985352,
0.05023296922445297,
-0.12111442536115646,
0.09400640428066254,
0.2956078052520752,
0.06883106380701065,
0.16029924154281616,
0.11522360146045685,
-0.026204582303762436,
0.22168073058128357,
0.2528781592845917,
-0.09834760427474976,
0.10960826277732849,
-0.2319716513156891,
0.061605263501405716,
0.5462928414344788,
0.8929854035377502,
-0.13209515810012817,
-0.6255757808685303,
-0.3807216286659241,
-0.15301282703876495,
-0.1855306327342987,
0.3686770796775818,
-0.2373051643371582,
-0.10350987315177917,
0.29939761757850647,
-0.04895247891545296,
-0.0039725229144096375,
0.15861666202545166,
0.2882198095321655,
0.04949945956468582,
-0.1935369074344635,
-0.08759509027004242,
-0.1538151502609253,
0.31666818261146545,
-0.23562124371528625,
-0.1479191780090332,
-0.057447001338005066,
-0.06832793354988098,
0.21306248009204865,
-0.14738141000270844,
-0.10396292060613632,
0.08840421587228775,
0.07939273118972778,
0.07031139731407166,
0.15621960163116455,
-0.15107758343219757,
-0.053061552345752716,
-0.4215264618396759,
-0.046277355402708054,
0.1598110795021057,
-0.22630348801612854,
-0.062266863882541656,
-0.12766967713832855,
0.15912313759326935,
-0.09006772935390472,
0.3275679051876068,
-0.04262600094079971,
0.15337440371513367,
-0.37258824706077576,
-0.3740416169166565,
-0.01362275518476963,
0.30175721645355225,
-0.4751899242401123,
-0.41212451457977295,
0.04797927662730217,
-0.335199236869812,
-0.05054696649312973,
0.12953968346118927,
-0.04075709730386734,
0.09004686027765274,
0.5219283103942871,
0.4176955819129944,
0.19073054194450378,
-0.3532955050468445,
0.1694779247045517,
-0.021708309650421143,
-0.22332720458507538,
0.19873616099357605,
-0.02517165243625641,
0.3993792235851288,
-0.3515942096710205,
0.4323694109916687,
0.10456891357898712,
0.2842091917991638,
-0.049148090183734894,
-0.03585126996040344,
-0.07394207268953323,
-0.21954584121704102,
0.3524152636528015,
-0.17553046345710754,
0.019895687699317932,
-0.3287624716758728,
-0.11586916446685791,
-0.14956486225128174,
0.07563798129558563,
-0.20093664526939392,
-0.18875625729560852,
0.08634163439273834,
0.11109669506549835,
-0.4830392599105835,
0.27278685569763184,
-0.0029814280569553375,
-0.03812029957771301,
0.16576921939849854,
-0.41605913639068604,
0.024478504434227943,
-0.4133132994174957,
-0.2350761592388153,
-0.005670331418514252,
0.21449881792068481,
0.3355960249900818,
-0.3807133436203003,
-0.16003093123435974,
0.1093781590461731,
-0.1582372486591339,
-0.014331512153148651,
0.28229060769081116,
-0.13150735199451447,
0.29842907190322876,
-0.1967371106147766,
-0.10386650264263153,
0.5670567750930786,
-0.3654792308807373,
-0.42812711000442505,
0.1869962513446808,
0.08179593086242676,
0.4688357710838318,
0.07916706800460815,
-0.09337296336889267,
-0.09169740974903107,
-0.2231377810239792,
0.026687733829021454,
0.2629302144050598,
0.021867593750357628,
-0.18678542971611023,
0.0036608055233955383,
-0.4244551360607147,
0.06699034571647644,
0.3080374598503113,
0.03281782194972038,
-0.0945151299238205,
-0.01241455227136612,
0.4726387858390808,
0.2068977952003479,
-0.05670391768217087,
-0.05299684405326843,
0.10259047150611877,
0.5188701152801514,
0.23160745203495026,
0.11004562675952911,
-0.27419614791870117,
-0.08054119348526001,
0.11274544894695282,
0.26938340067863464,
0.04825346916913986,
-0.018937665969133377,
-0.10919047892093658,
0.13499833643436432,
-0.3264015316963196,
-0.2200787365436554,
0.24825221300125122,
-0.02232525497674942,
0.19468650221824646,
-0.22108615934848785,
-0.16697615385055542,
-0.0948956310749054,
0.10557926446199417,
-0.041065700352191925,
0.08541779220104218,
-0.30294209718704224,
-0.013122964650392532,
-0.022907255217432976,
0.08476229012012482,
0.15625116229057312,
0.41044124960899353,
0.046248309314250946,
-0.028219161555171013,
-0.10161028802394867,
0.29566460847854614,
0.5504580140113831,
-0.04094335064291954,
-0.4070577621459961,
0.5133808851242065,
0.30632925033569336,
0.05058152973651886,
-0.0856696292757988,
0.11710736155509949,
0.13307631015777588,
-0.20405864715576172,
0.16750679910182953,
0.2205520123243332,
-0.15079250931739807,
0.20390070974826813,
0.22054103016853333,
-0.2713400721549988,
0.2415943741798401,
0.286283940076828,
-0.2198144793510437,
-0.01912011206150055,
0.3594229221343994,
-0.17885804176330566,
0.40677785873413086,
-0.033479444682598114,
-0.14399105310440063,
-0.10318043828010559,
0.3257092237472534,
-0.06670576333999634,
-0.1779118776321411,
0.02396165020763874,
0.24085742235183716,
0.00036713480949401855,
0.051515594124794006,
0.32336050271987915,
0.6417386531829834,
0.23663672804832458,
0.0583278052508831,
-0.1511276513338089,
0.14702802896499634,
-0.46651220321655273,
0.14897891879081726,
0.1944667398929596,
-0.18413323163986206,
0.19084791839122772,
-0.04314263537526131,
0.2557905614376068,
-0.15247607231140137,
-0.17638370394706726,
0.07772140204906464,
0.10773403942584991,
-0.6525932550430298,
-0.07663445174694061,
-0.5262326598167419,
-0.1669667363166809,
-0.05134958401322365,
-0.28166258335113525,
-0.22957497835159302,
-0.08068374544382095,
0.09765132516622543,
0.07579837739467621,
-0.08529283851385117,
0.10263793170452118,
-0.0048494115471839905,
0.2893795967102051,
0.022972434759140015,
-0.3243034780025482,
0.1744280904531479,
0.3457619845867157,
-0.18844205141067505,
0.05915559083223343,
0.2852771580219269,
0.0943983644247055,
0.08993659168481827,
-0.31309956312179565,
-0.04984241724014282,
0.09779687225818634,
-0.2658802568912506,
0.1755244880914688,
-0.051112040877342224,
0.4030529260635376,
0.4598187506198883,
0.2776840329170227,
-0.01574307680130005,
-0.29303157329559326,
0.12528514862060547,
0.3331541121006012,
-0.03231336921453476,
-0.0120614655315876,
0.09485800564289093,
-0.05390311777591705,
-0.3954113721847534,
-0.4637475609779358,
-0.09166411310434341,
-0.342678427696228,
0.4091050624847412,
-0.0009286105632781982,
0.29537221789360046,
0.7557628154754639,
0.10837189108133316,
0.16713321208953857,
0.05080293118953705,
0.3576146066188812,
-0.17955073714256287,
-0.2276766151189804,
0.28309252858161926,
-0.11396460235118866,
-0.303384929895401,
-0.04539373517036438,
0.35711732506752014,
0.14031872153282166,
0.3954789638519287,
-0.3866767883300781,
-0.09279977530241013,
0.059751659631729126,
0.12738268077373505,
-0.08320583403110504,
0.15560562908649445,
0.1681663691997528,
0.35791730880737305,
0.09560039639472961,
-0.2865777611732483,
-0.18124669790267944,
0.08127886056900024,
-0.05408429354429245,
0.4320569932460785,
0.021040581166744232,
0.17854969203472137,
-0.22137151658535004,
0.5179806351661682,
0.052715882658958435,
-0.09091222286224365,
0.1991945207118988,
0.06482471525669098,
0.5033174157142639,
-0.060297902673482895,
-0.06210479885339737,
0.15956968069076538,
0.13854898512363434,
0.04431522637605667,
0.2818880081176758,
0.2857184112071991,
0.2571042776107788,
-0.3721221089363098,
0.3562707006931305,
-0.04199487715959549,
-0.14647933840751648,
0.1360076516866684,
0.07740478217601776,
0.05388224124908447,
0.051632463932037354,
0.353665292263031,
0.2875666320323944,
0.013879232108592987,
-0.1203811764717102,
0.5422342419624329,
0.21971572935581207,
0.0034470371901988983,
-0.036417052149772644,
-0.18140414357185364,
-0.019346676766872406,
0.0817226842045784,
0.1935337781906128,
0.4616091549396515,
-0.12792667746543884,
0.21326756477355957,
-0.15885350108146667,
0.03416925668716431,
0.07593531161546707,
-0.272318959236145,
0.05997177213430405,
0.12492083758115768,
0.2236122488975525,
-0.10954473912715912,
-0.14760330319404602,
-0.25815439224243164,
-0.21468180418014526,
0.22984443604946136,
0.28489768505096436,
-0.2363368570804596,
-0.4179784059524536,
-0.09194179624319077,
0.2912096083164215,
0.06766165792942047,
-0.1665307581424713,
-0.2633426785469055,
-0.47394129633903503,
-0.18938100337982178,
-0.1969667226076126,
0.03286519646644592,
0.2830890119075775,
-0.0696721151471138,
-0.07128984481096268,
0.23050127923488617,
-0.1764470934867859,
0.4720379710197449,
-0.1110110953450203,
0.24739310145378113,
0.07275800406932831,
0.17503520846366882,
0.07667746394872665,
-0.27621522545814514,
0.6093207001686096,
0.4613340497016907,
-0.5748463273048401,
0.05490966886281967,
0.049286969006061554,
-0.10494129359722137,
0.12657833099365234,
0.49734050035476685,
-0.203236922621727,
0.03332185000181198,
-0.20988425612449646,
-0.16689932346343994,
-0.0899110734462738,
0.3369802236557007,
0.3057073950767517,
-0.14112025499343872,
-0.019365880638360977,
-0.5954620242118835,
0.4933858811855316,
-0.13040564954280853,
-0.07425784319639206,
0.5431771874427795,
0.3751167058944702,
-0.2540671229362488,
0.050071295350790024,
-0.20028972625732422,
0.938000500202179,
0.1679849624633789,
-0.03475185111165047,
0.39505746960639954,
-0.27726638317108154,
0.24796538054943085,
-0.13314253091812134,
-0.04472142085433006,
0.15066981315612793,
-0.07901407778263092,
-0.2124829888343811,
-0.08163972198963165,
0.15276764333248138,
0.24742946028709412,
-0.19619068503379822,
0.2571852505207062,
0.2363925576210022,
-0.18507754802703857,
0.2410515993833542,
0.34127533435821533,
-0.08825967460870743,
-0.23929600417613983,
-0.4996219277381897,
0.05983947589993477,
-0.21201923489570618,
0.2821532189846039,
-0.23345227539539337,
-0.16736644506454468,
-0.16223132610321045,
-0.37301158905029297,
-0.3034265637397766,
-0.019777558743953705,
-0.606201708316803,
0.00012835487723350525,
0.004050400108098984,
-0.20931224524974823,
0.42495083808898926,
-0.05781005695462227,
-0.3502541184425354,
0.5912764072418213,
-0.3381415009498596,
0.08814430236816406,
-0.21939721703529358,
0.09057898074388504,
0.07562681287527084,
0.06658387184143066,
0.22453032433986664,
-0.0499744638800621,
-0.11331059783697128,
-0.4267258644104004,
-0.24010314047336578,
-0.2405204176902771,
0.40968477725982666,
-0.37012097239494324,
-0.1007474809885025,
-0.13668981194496155,
-0.3043428063392639,
-0.0966453030705452,
0.005863375961780548,
-0.04695793241262436,
0.06841325014829636,
0.14428788423538208,
-0.17190629243850708,
0.1301976442337036,
-0.07909689843654633,
-0.052401527762413025,
-0.12111671268939972,
0.2273588478565216,
-0.2594868838787079,
-0.2101680040359497,
0.3971303403377533,
0.12155332416296005,
-0.2633444368839264,
-0.16250447928905487,
0.049894750118255615,
-0.11894838511943817,
-0.30585232377052307,
-0.0868089348077774,
0.08560147136449814,
-0.10372979938983917,
0.05212811380624771,
0.08991599082946777,
0.14536239206790924,
0.04630175977945328,
0.02371421456336975,
-0.46576231718063354,
-0.1444142758846283,
0.33241701126098633,
-0.0263862032443285,
0.21902932226657867,
-0.16694171726703644,
-0.14410270750522614,
0.13567489385604858,
-0.031051678583025932,
-0.20413824915885925,
0.10186794400215149,
0.20448264479637146,
0.22578826546669006,
0.05633607134222984,
0.01620342768728733,
0.18995505571365356,
-0.27500054240226746,
-0.0026572681963443756,
0.04666141793131828,
-0.3123891353607178,
-0.00710136815905571,
-0.1346241533756256,
0.27495816349983215,
0.08997180312871933,
-0.3378797173500061,
0.10601218044757843,
-0.023355308920145035,
-0.2518883943557739,
-0.31359007954597473,
0.01891321688890457,
0.13236814737319946,
-0.18413738906383514,
-0.0060387589037418365,
0.07058614492416382,
0.1286289095878601,
-0.07012122124433517,
0.12594091892242432,
0.015206249430775642,
0.08092226833105087,
0.308966726064682,
0.19208374619483948,
-0.016553163528442383,
-0.04961317777633667,
-0.053215306252241135,
0.22263884544372559,
-0.03684983775019646,
-0.07609260082244873,
0.13448898494243622,
-0.29783064126968384,
-0.009367622435092926,
0.4454352855682373,
0.18453775346279144,
0.6857518553733826,
-0.12068187445402145,
0.05556870996952057,
0.08004177361726761,
0.08756674826145172,
-0.00683072954416275,
-0.007918812334537506,
-0.048252083361148834,
0.24565450847148895,
-0.09880185127258301,
0.28393763303756714,
0.1330655813217163,
-0.36537498235702515,
0.01902661845088005,
0.17367951571941376,
0.13045048713684082,
-0.1283191442489624,
0.08824574947357178,
0.7129381895065308,
-0.04891401156783104,
0.0782170370221138,
-0.10460636019706726,
-0.14702528715133667,
0.0594286173582077,
0.24855662882328033,
-0.48144787549972534,
0.10729558020830154,
0.2871219515800476,
-0.0034803934395313263,
-0.03293869271874428,
-0.5146503448486328,
-0.1732814610004425,
0.4555957019329071,
0.012798868119716644,
0.09392284601926804,
0.15349701046943665,
0.28658968210220337,
-0.4708642363548279,
-0.06937574595212936,
0.014115259051322937,
-0.16176843643188477,
-0.20174631476402283,
0.07785511016845703,
0.4016444683074951,
-0.2385188192129135,
-0.2536187469959259,
-0.06496354937553406,
-0.20226696133613586,
-0.2064248025417328,
-0.16271351277828217,
-0.050924405455589294,
0.01518799178302288,
-0.2840879261493683,
-0.23341940343379974,
-0.01324634812772274,
0.09218625724315643,
-0.3112953305244446,
0.23744700849056244,
0.3032325506210327,
-0.2797801196575165,
0.38987892866134644,
0.33272209763526917,
0.3134801983833313,
0.37833598256111145,
0.04781593754887581,
-0.17094974219799042,
-0.07845340669155121,
-0.026743929833173752,
0.20055435597896576,
0.4092733561992645,
0.031013019382953644,
0.32037633657455444,
0.3283001780509949,
0.014640580862760544,
-0.08389662206172943,
-0.2958451807498932,
0.14827463030815125,
-0.2095751315355301,
-0.6450566649436951,
0.6928914189338684,
-0.24998123943805695,
-0.10601246356964111,
-0.017907211557030678,
0.16609330475330353,
-0.22683022916316986,
0.04262946546077728,
0.521144688129425,
0.3244016468524933,
0.12816248834133148,
0.2558424174785614,
0.03910692036151886,
-0.13781395554542542,
0.24463161826133728,
0.27388665080070496,
0.07700177282094955,
-0.15622597932815552,
0.04958409070968628,
-0.6452693939208984,
-0.12914186716079712,
-0.031144512817263603,
0.0005436018109321594,
0.019787825644016266,
0.10342984646558762,
0.11867766082286835,
0.2379944771528244,
-0.11887377500534058,
0.09634602069854736,
0.5744260549545288,
-0.21504133939743042,
-0.2127048373222351,
-0.10693959891796112,
0.17755445837974548,
-0.12562133371829987,
-0.18995913863182068,
-0.5206833481788635,
0.06388142704963684,
-0.08415568619966507,
-0.09346799552440643,
-0.24923253059387207,
0.012487582862377167,
-0.10319863259792328,
0.0343782864511013,
0.17088237404823303,
0.09636779129505157,
0.5322657823562622,
-0.1261870265007019,
-0.32451331615448,
-0.3152916729450226,
-0.04203229025006294,
0.036233969032764435,
0.19935694336891174,
-0.13211767375469208,
0.38022711873054504,
-0.18788117170333862,
0.16983675956726074,
-0.34704285860061646,
0.32919585704803467,
-0.11708049476146698,
0.18016721308231354,
-0.4201682209968567,
-0.005040924996137619,
-0.41661766171455383,
0.18146862089633942,
0.05345861613750458,
-0.22326934337615967,
-0.0794333666563034,
0.008804969489574432,
-0.499805748462677,
-0.28783613443374634,
0.528273344039917,
-0.2095530778169632,
-0.014439322054386139,
0.016815293580293655,
0.44252318143844604,
0.32096442580223083,
0.13171188533306122,
-1.0341064929962158,
0.14135991036891937,
0.35800909996032715,
0.04677759110927582,
-0.3209111988544464,
0.24520960450172424,
-0.18830297887325287,
-0.11204284429550171,
-0.06656389683485031,
0.20237530767917633,
0.044737160205841064,
-0.25587913393974304,
0.14269942045211792,
-0.41050130128860474
] |
https://github.com/huggingface/datasets/issues/5659 | I had the same issue on SageMaker but not on Colab;
The `soundfile` versioning was fine.
my approach to solve it was to match {"numpy", "numba"} exact versions
```
! pip install "numpy==1.23.5"
! pip install "numpy==0.58.1"
```
the numbers are from Colab where successfully I could do the job.
| [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files | ### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28 | 50 | [Audio] Soundfile/libsndfile requirements too stringent for decoding mp3 files
### Describe the bug
I'm encountering several issues trying to load mp3 audio files using `datasets` on a TPU v4.
The PR https://github.com/huggingface/datasets/pull/5573 updated the audio loading logic to rely solely on the `soundfile`/`libsndfile` libraries for loading audio samples, regardless of their file type.
The installation guide suggests that `libsndfile` is bundled in when `soundfile` is pip installed:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/docs/source/installation.md?plain=1#L70-L71
However, just pip installing `soundfile==0.12.1` throws an error that `libsndfile` is missing:
```
pip install soundfile==0.12.1
```
Then:
```python
>>> soundfile
>>> soundfile.__libsndfile_version__
```
<details>
<summary> Traceback (most recent call last): </summary>
```
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 161, in <module>
import _soundfile_data # ImportError if this doesn't exist
ModuleNotFoundError: No module named '_soundfile_data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 170, in <module>
raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/soundfile.py", line 192, in <module>
_snd = _ffi.dlopen(_explicit_libname)
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
```
</details>
Thus, I've followed the official instructions for installing the `soundfile` package from https://github.com/bastibe/python-soundfile#installation, which states that `libsndfile` needs to be installed separately as:
```
pip install --upgrade soundfile
sudo apt install libsndfile1
```
We can now import `soundfile`:
```python
>>> import soundfile
>>> soundfile.__version__
'0.12.1'
>>> soundfile.__libsndfile_version__
'1.0.28'
```
We see that we have `soundfile==0.12.1`, which matches the `datasets[audio]` package constraints:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/setup.py#L144-L147
But we have `libsndfile==1.0.28`, which is too low for decoding mp3 files:
https://github.com/huggingface/datasets/blob/e1af108015e43f9df8734a1faeeaeb9eafce3971/src/datasets/config.py#L136-L138
Updating/upgrading the `libsndfile` doesn't change this:
```
sudo apt-get update
sudo apt-get upgrade
```
Is there any other suggestion for how to get a compatible `libsndfile` version? Currently, the version bundled with Ubuntu `apt-get` is too low for decoding mp3 files.
Maybe we could add this under `setup.py` such that we install the correct `libsndfile` version when we do `pip install datasets[audio]`? IMO this would help circumvent such version issues.
### Steps to reproduce the bug
Environment described above. Loading mp3 files:
```python
from datasets import load_dataset
common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
print(next(iter(common_voice_es)))
```
```python
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[4], line 2
1 common_voice_es = load_dataset("common_voice", "es", split="validation", streaming=True)
----> 2 print(next(iter(common_voice_es)))
File ~/datasets/src/datasets/iterable_dataset.py:941, in IterableDataset.__iter__(self)
937 for key, example in ex_iterable:
938 if self.features:
939 # `IterableDataset` automatically fills missing columns with None.
940 # This is done with `_apply_feature_types_on_example`.
--> 941 yield _apply_feature_types_on_example(
942 example, self.features, token_per_repo_id=self._token_per_repo_id
943 )
944 else:
945 yield example
File ~/datasets/src/datasets/iterable_dataset.py:700, in _apply_feature_types_on_example(example, features, token_per_repo_id)
698 encoded_example = features.encode_example(example)
699 # Decode example for Audio feature, e.g.
--> 700 decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
701 return decoded_example
File ~/datasets/src/datasets/features/features.py:1864, in Features.decode_example(self, example, token_per_repo_id)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
-> 1864 return {
1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1865, in <dictcomp>(.0)
1850 def decode_example(self, example: dict, token_per_repo_id: Optional[Dict[str, Union[str, bool, None]]] = None):
1851 """Decode example with custom feature decoding.
1852
1853 Args:
(...)
1861 `dict[str, Any]`
1862 """
1864 return {
-> 1865 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
1866 if self._column_requires_decoding[column_name]
1867 else value
1868 for column_name, (feature, value) in zip_dict(
1869 {key: value for key, value in self.items() if key in example}, example
1870 )
1871 }
File ~/datasets/src/datasets/features/features.py:1308, in decode_nested_example(schema, obj, token_per_repo_id)
1305 elif isinstance(schema, (Audio, Image)):
1306 # we pass the token to read and decode files from private repositories in streaming mode
1307 if obj is not None and schema.decode:
-> 1308 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
1309 return obj
File ~/datasets/src/datasets/features/audio.py:167, in Audio.decode_example(self, value, token_per_repo_id)
162 raise RuntimeError(
163 "Decoding 'opus' files requires system library 'libsndfile'>=1.0.31, "
164 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
165 )
166 elif not config.IS_MP3_SUPPORTED and audio_format == "mp3":
--> 167 raise RuntimeError(
168 "Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, "
169 'You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`. '
170 )
172 if file is None:
173 token_per_repo_id = token_per_repo_id or {}
RuntimeError: Decoding 'mp3' files requires system library 'libsndfile'>=1.1.0, You can try to update `soundfile` python library: `pip install "soundfile>=0.12.1"`.
```
### Expected behavior
Load mp3 files!
### Environment info
- `datasets` version: 2.10.2.dev0
- Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.13.1
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Soundfile version: 0.12.1
- Libsndfile version: 1.0.28
I had the same issue on SageMaker but not on Colab;
The `soundfile` versioning was fine.
my approach to solve it was to match {"numpy", "numba"} exact versions
```
! pip install "numpy==1.23.5"
! pip install "numpy==0.58.1"
```
the numbers are from Colab where successfully I could do the job.
| [
-0.049880754202604294,
0.21389538049697876,
-0.02552657201886177,
0.37763962149620056,
0.36412861943244934,
-0.05396618694067001,
0.2889644503593445,
0.11923642456531525,
-0.2776981592178345,
0.2703988552093506,
-0.33914411067962646,
0.02121618017554283,
-0.19508084654808044,
-0.05244786664843559,
-0.07602284848690033,
-0.053154755383729935,
-0.146317720413208,
0.5547893047332764,
0.1439652442932129,
0.06756901741027832,
-0.16367927193641663,
0.3902137875556946,
-0.12376674264669418,
-0.06845317035913467,
-0.24915023148059845,
0.048388101160526276,
0.12746968865394592,
0.17041106522083282,
-0.4433642625808716,
-0.35512402653694153,
0.4380989372730255,
0.2319992333650589,
-0.05099821090698242,
0.29043030738830566,
-0.00012352937483228743,
-0.11559702455997467,
0.20513415336608887,
-0.2270914912223816,
-0.40592265129089355,
-0.11279238760471344,
-0.212590754032135,
-0.131047785282135,
-0.018999427556991577,
-0.054712213575839996,
-0.054331302642822266,
-0.3607732355594635,
-0.2069346010684967,
-0.1928735375404358,
0.233961820602417,
0.3014804720878601,
0.13623759150505066,
0.17275191843509674,
-0.004351221024990082,
0.1199047714471817,
0.5826959609985352,
0.05023296922445297,
-0.12111442536115646,
0.09400640428066254,
0.2956078052520752,
0.06883106380701065,
0.16029924154281616,
0.11522360146045685,
-0.026204582303762436,
0.22168073058128357,
0.2528781592845917,
-0.09834760427474976,
0.10960826277732849,
-0.2319716513156891,
0.061605263501405716,
0.5462928414344788,
0.8929854035377502,
-0.13209515810012817,
-0.6255757808685303,
-0.3807216286659241,
-0.15301282703876495,
-0.1855306327342987,
0.3686770796775818,
-0.2373051643371582,
-0.10350987315177917,
0.29939761757850647,
-0.04895247891545296,
-0.0039725229144096375,
0.15861666202545166,
0.2882198095321655,
0.04949945956468582,
-0.1935369074344635,
-0.08759509027004242,
-0.1538151502609253,
0.31666818261146545,
-0.23562124371528625,
-0.1479191780090332,
-0.057447001338005066,
-0.06832793354988098,
0.21306248009204865,
-0.14738141000270844,
-0.10396292060613632,
0.08840421587228775,
0.07939273118972778,
0.07031139731407166,
0.15621960163116455,
-0.15107758343219757,
-0.053061552345752716,
-0.4215264618396759,
-0.046277355402708054,
0.1598110795021057,
-0.22630348801612854,
-0.062266863882541656,
-0.12766967713832855,
0.15912313759326935,
-0.09006772935390472,
0.3275679051876068,
-0.04262600094079971,
0.15337440371513367,
-0.37258824706077576,
-0.3740416169166565,
-0.01362275518476963,
0.30175721645355225,
-0.4751899242401123,
-0.41212451457977295,
0.04797927662730217,
-0.335199236869812,
-0.05054696649312973,
0.12953968346118927,
-0.04075709730386734,
0.09004686027765274,
0.5219283103942871,
0.4176955819129944,
0.19073054194450378,
-0.3532955050468445,
0.1694779247045517,
-0.021708309650421143,
-0.22332720458507538,
0.19873616099357605,
-0.02517165243625641,
0.3993792235851288,
-0.3515942096710205,
0.4323694109916687,
0.10456891357898712,
0.2842091917991638,
-0.049148090183734894,
-0.03585126996040344,
-0.07394207268953323,
-0.21954584121704102,
0.3524152636528015,
-0.17553046345710754,
0.019895687699317932,
-0.3287624716758728,
-0.11586916446685791,
-0.14956486225128174,
0.07563798129558563,
-0.20093664526939392,
-0.18875625729560852,
0.08634163439273834,
0.11109669506549835,
-0.4830392599105835,
0.27278685569763184,
-0.0029814280569553375,
-0.03812029957771301,
0.16576921939849854,
-0.41605913639068604,
0.024478504434227943,
-0.4133132994174957,
-0.2350761592388153,
-0.005670331418514252,
0.21449881792068481,
0.3355960249900818,
-0.3807133436203003,
-0.16003093123435974,
0.1093781590461731,
-0.1582372486591339,
-0.014331512153148651,
0.28229060769081116,
-0.13150735199451447,
0.29842907190322876,
-0.1967371106147766,
-0.10386650264263153,
0.5670567750930786,
-0.3654792308807373,
-0.42812711000442505,
0.1869962513446808,
0.08179593086242676,
0.4688357710838318,
0.07916706800460815,
-0.09337296336889267,
-0.09169740974903107,
-0.2231377810239792,
0.026687733829021454,
0.2629302144050598,
0.021867593750357628,
-0.18678542971611023,
0.0036608055233955383,
-0.4244551360607147,
0.06699034571647644,
0.3080374598503113,
0.03281782194972038,
-0.0945151299238205,
-0.01241455227136612,
0.4726387858390808,
0.2068977952003479,
-0.05670391768217087,
-0.05299684405326843,
0.10259047150611877,
0.5188701152801514,
0.23160745203495026,
0.11004562675952911,
-0.27419614791870117,
-0.08054119348526001,
0.11274544894695282,
0.26938340067863464,
0.04825346916913986,
-0.018937665969133377,
-0.10919047892093658,
0.13499833643436432,
-0.3264015316963196,
-0.2200787365436554,
0.24825221300125122,
-0.02232525497674942,
0.19468650221824646,
-0.22108615934848785,
-0.16697615385055542,
-0.0948956310749054,
0.10557926446199417,
-0.041065700352191925,
0.08541779220104218,
-0.30294209718704224,
-0.013122964650392532,
-0.022907255217432976,
0.08476229012012482,
0.15625116229057312,
0.41044124960899353,
0.046248309314250946,
-0.028219161555171013,
-0.10161028802394867,
0.29566460847854614,
0.5504580140113831,
-0.04094335064291954,
-0.4070577621459961,
0.5133808851242065,
0.30632925033569336,
0.05058152973651886,
-0.0856696292757988,
0.11710736155509949,
0.13307631015777588,
-0.20405864715576172,
0.16750679910182953,
0.2205520123243332,
-0.15079250931739807,
0.20390070974826813,
0.22054103016853333,
-0.2713400721549988,
0.2415943741798401,
0.286283940076828,
-0.2198144793510437,
-0.01912011206150055,
0.3594229221343994,
-0.17885804176330566,
0.40677785873413086,
-0.033479444682598114,
-0.14399105310440063,
-0.10318043828010559,
0.3257092237472534,
-0.06670576333999634,
-0.1779118776321411,
0.02396165020763874,
0.24085742235183716,
0.00036713480949401855,
0.051515594124794006,
0.32336050271987915,
0.6417386531829834,
0.23663672804832458,
0.0583278052508831,
-0.1511276513338089,
0.14702802896499634,
-0.46651220321655273,
0.14897891879081726,
0.1944667398929596,
-0.18413323163986206,
0.19084791839122772,
-0.04314263537526131,
0.2557905614376068,
-0.15247607231140137,
-0.17638370394706726,
0.07772140204906464,
0.10773403942584991,
-0.6525932550430298,
-0.07663445174694061,
-0.5262326598167419,
-0.1669667363166809,
-0.05134958401322365,
-0.28166258335113525,
-0.22957497835159302,
-0.08068374544382095,
0.09765132516622543,
0.07579837739467621,
-0.08529283851385117,
0.10263793170452118,
-0.0048494115471839905,
0.2893795967102051,
0.022972434759140015,
-0.3243034780025482,
0.1744280904531479,
0.3457619845867157,
-0.18844205141067505,
0.05915559083223343,
0.2852771580219269,
0.0943983644247055,
0.08993659168481827,
-0.31309956312179565,
-0.04984241724014282,
0.09779687225818634,
-0.2658802568912506,
0.1755244880914688,
-0.051112040877342224,
0.4030529260635376,
0.4598187506198883,
0.2776840329170227,
-0.01574307680130005,
-0.29303157329559326,
0.12528514862060547,
0.3331541121006012,
-0.03231336921453476,
-0.0120614655315876,
0.09485800564289093,
-0.05390311777591705,
-0.3954113721847534,
-0.4637475609779358,
-0.09166411310434341,
-0.342678427696228,
0.4091050624847412,
-0.0009286105632781982,
0.29537221789360046,
0.7557628154754639,
0.10837189108133316,
0.16713321208953857,
0.05080293118953705,
0.3576146066188812,
-0.17955073714256287,
-0.2276766151189804,
0.28309252858161926,
-0.11396460235118866,
-0.303384929895401,
-0.04539373517036438,
0.35711732506752014,
0.14031872153282166,
0.3954789638519287,
-0.3866767883300781,
-0.09279977530241013,
0.059751659631729126,
0.12738268077373505,
-0.08320583403110504,
0.15560562908649445,
0.1681663691997528,
0.35791730880737305,
0.09560039639472961,
-0.2865777611732483,
-0.18124669790267944,
0.08127886056900024,
-0.05408429354429245,
0.4320569932460785,
0.021040581166744232,
0.17854969203472137,
-0.22137151658535004,
0.5179806351661682,
0.052715882658958435,
-0.09091222286224365,
0.1991945207118988,
0.06482471525669098,
0.5033174157142639,
-0.060297902673482895,
-0.06210479885339737,
0.15956968069076538,
0.13854898512363434,
0.04431522637605667,
0.2818880081176758,
0.2857184112071991,
0.2571042776107788,
-0.3721221089363098,
0.3562707006931305,
-0.04199487715959549,
-0.14647933840751648,
0.1360076516866684,
0.07740478217601776,
0.05388224124908447,
0.051632463932037354,
0.353665292263031,
0.2875666320323944,
0.013879232108592987,
-0.1203811764717102,
0.5422342419624329,
0.21971572935581207,
0.0034470371901988983,
-0.036417052149772644,
-0.18140414357185364,
-0.019346676766872406,
0.0817226842045784,
0.1935337781906128,
0.4616091549396515,
-0.12792667746543884,
0.21326756477355957,
-0.15885350108146667,
0.03416925668716431,
0.07593531161546707,
-0.272318959236145,
0.05997177213430405,
0.12492083758115768,
0.2236122488975525,
-0.10954473912715912,
-0.14760330319404602,
-0.25815439224243164,
-0.21468180418014526,
0.22984443604946136,
0.28489768505096436,
-0.2363368570804596,
-0.4179784059524536,
-0.09194179624319077,
0.2912096083164215,
0.06766165792942047,
-0.1665307581424713,
-0.2633426785469055,
-0.47394129633903503,
-0.18938100337982178,
-0.1969667226076126,
0.03286519646644592,
0.2830890119075775,
-0.0696721151471138,
-0.07128984481096268,
0.23050127923488617,
-0.1764470934867859,
0.4720379710197449,
-0.1110110953450203,
0.24739310145378113,
0.07275800406932831,
0.17503520846366882,
0.07667746394872665,
-0.27621522545814514,
0.6093207001686096,
0.4613340497016907,
-0.5748463273048401,
0.05490966886281967,
0.049286969006061554,
-0.10494129359722137,
0.12657833099365234,
0.49734050035476685,
-0.203236922621727,
0.03332185000181198,
-0.20988425612449646,
-0.16689932346343994,
-0.0899110734462738,
0.3369802236557007,
0.3057073950767517,
-0.14112025499343872,
-0.019365880638360977,
-0.5954620242118835,
0.4933858811855316,
-0.13040564954280853,
-0.07425784319639206,
0.5431771874427795,
0.3751167058944702,
-0.2540671229362488,
0.050071295350790024,
-0.20028972625732422,
0.938000500202179,
0.1679849624633789,
-0.03475185111165047,
0.39505746960639954,
-0.27726638317108154,
0.24796538054943085,
-0.13314253091812134,
-0.04472142085433006,
0.15066981315612793,
-0.07901407778263092,
-0.2124829888343811,
-0.08163972198963165,
0.15276764333248138,
0.24742946028709412,
-0.19619068503379822,
0.2571852505207062,
0.2363925576210022,
-0.18507754802703857,
0.2410515993833542,
0.34127533435821533,
-0.08825967460870743,
-0.23929600417613983,
-0.4996219277381897,
0.05983947589993477,
-0.21201923489570618,
0.2821532189846039,
-0.23345227539539337,
-0.16736644506454468,
-0.16223132610321045,
-0.37301158905029297,
-0.3034265637397766,
-0.019777558743953705,
-0.606201708316803,
0.00012835487723350525,
0.004050400108098984,
-0.20931224524974823,
0.42495083808898926,
-0.05781005695462227,
-0.3502541184425354,
0.5912764072418213,
-0.3381415009498596,
0.08814430236816406,
-0.21939721703529358,
0.09057898074388504,
0.07562681287527084,
0.06658387184143066,
0.22453032433986664,
-0.0499744638800621,
-0.11331059783697128,
-0.4267258644104004,
-0.24010314047336578,
-0.2405204176902771,
0.40968477725982666,
-0.37012097239494324,
-0.1007474809885025,
-0.13668981194496155,
-0.3043428063392639,
-0.0966453030705452,
0.005863375961780548,
-0.04695793241262436,
0.06841325014829636,
0.14428788423538208,
-0.17190629243850708,
0.1301976442337036,
-0.07909689843654633,
-0.052401527762413025,
-0.12111671268939972,
0.2273588478565216,
-0.2594868838787079,
-0.2101680040359497,
0.3971303403377533,
0.12155332416296005,
-0.2633444368839264,
-0.16250447928905487,
0.049894750118255615,
-0.11894838511943817,
-0.30585232377052307,
-0.0868089348077774,
0.08560147136449814,
-0.10372979938983917,
0.05212811380624771,
0.08991599082946777,
0.14536239206790924,
0.04630175977945328,
0.02371421456336975,
-0.46576231718063354,
-0.1444142758846283,
0.33241701126098633,
-0.0263862032443285,
0.21902932226657867,
-0.16694171726703644,
-0.14410270750522614,
0.13567489385604858,
-0.031051678583025932,
-0.20413824915885925,
0.10186794400215149,
0.20448264479637146,
0.22578826546669006,
0.05633607134222984,
0.01620342768728733,
0.18995505571365356,
-0.27500054240226746,
-0.0026572681963443756,
0.04666141793131828,
-0.3123891353607178,
-0.00710136815905571,
-0.1346241533756256,
0.27495816349983215,
0.08997180312871933,
-0.3378797173500061,
0.10601218044757843,
-0.023355308920145035,
-0.2518883943557739,
-0.31359007954597473,
0.01891321688890457,
0.13236814737319946,
-0.18413738906383514,
-0.0060387589037418365,
0.07058614492416382,
0.1286289095878601,
-0.07012122124433517,
0.12594091892242432,
0.015206249430775642,
0.08092226833105087,
0.308966726064682,
0.19208374619483948,
-0.016553163528442383,
-0.04961317777633667,
-0.053215306252241135,
0.22263884544372559,
-0.03684983775019646,
-0.07609260082244873,
0.13448898494243622,
-0.29783064126968384,
-0.009367622435092926,
0.4454352855682373,
0.18453775346279144,
0.6857518553733826,
-0.12068187445402145,
0.05556870996952057,
0.08004177361726761,
0.08756674826145172,
-0.00683072954416275,
-0.007918812334537506,
-0.048252083361148834,
0.24565450847148895,
-0.09880185127258301,
0.28393763303756714,
0.1330655813217163,
-0.36537498235702515,
0.01902661845088005,
0.17367951571941376,
0.13045048713684082,
-0.1283191442489624,
0.08824574947357178,
0.7129381895065308,
-0.04891401156783104,
0.0782170370221138,
-0.10460636019706726,
-0.14702528715133667,
0.0594286173582077,
0.24855662882328033,
-0.48144787549972534,
0.10729558020830154,
0.2871219515800476,
-0.0034803934395313263,
-0.03293869271874428,
-0.5146503448486328,
-0.1732814610004425,
0.4555957019329071,
0.012798868119716644,
0.09392284601926804,
0.15349701046943665,
0.28658968210220337,
-0.4708642363548279,
-0.06937574595212936,
0.014115259051322937,
-0.16176843643188477,
-0.20174631476402283,
0.07785511016845703,
0.4016444683074951,
-0.2385188192129135,
-0.2536187469959259,
-0.06496354937553406,
-0.20226696133613586,
-0.2064248025417328,
-0.16271351277828217,
-0.050924405455589294,
0.01518799178302288,
-0.2840879261493683,
-0.23341940343379974,
-0.01324634812772274,
0.09218625724315643,
-0.3112953305244446,
0.23744700849056244,
0.3032325506210327,
-0.2797801196575165,
0.38987892866134644,
0.33272209763526917,
0.3134801983833313,
0.37833598256111145,
0.04781593754887581,
-0.17094974219799042,
-0.07845340669155121,
-0.026743929833173752,
0.20055435597896576,
0.4092733561992645,
0.031013019382953644,
0.32037633657455444,
0.3283001780509949,
0.014640580862760544,
-0.08389662206172943,
-0.2958451807498932,
0.14827463030815125,
-0.2095751315355301,
-0.6450566649436951,
0.6928914189338684,
-0.24998123943805695,
-0.10601246356964111,
-0.017907211557030678,
0.16609330475330353,
-0.22683022916316986,
0.04262946546077728,
0.521144688129425,
0.3244016468524933,
0.12816248834133148,
0.2558424174785614,
0.03910692036151886,
-0.13781395554542542,
0.24463161826133728,
0.27388665080070496,
0.07700177282094955,
-0.15622597932815552,
0.04958409070968628,
-0.6452693939208984,
-0.12914186716079712,
-0.031144512817263603,
0.0005436018109321594,
0.019787825644016266,
0.10342984646558762,
0.11867766082286835,
0.2379944771528244,
-0.11887377500534058,
0.09634602069854736,
0.5744260549545288,
-0.21504133939743042,
-0.2127048373222351,
-0.10693959891796112,
0.17755445837974548,
-0.12562133371829987,
-0.18995913863182068,
-0.5206833481788635,
0.06388142704963684,
-0.08415568619966507,
-0.09346799552440643,
-0.24923253059387207,
0.012487582862377167,
-0.10319863259792328,
0.0343782864511013,
0.17088237404823303,
0.09636779129505157,
0.5322657823562622,
-0.1261870265007019,
-0.32451331615448,
-0.3152916729450226,
-0.04203229025006294,
0.036233969032764435,
0.19935694336891174,
-0.13211767375469208,
0.38022711873054504,
-0.18788117170333862,
0.16983675956726074,
-0.34704285860061646,
0.32919585704803467,
-0.11708049476146698,
0.18016721308231354,
-0.4201682209968567,
-0.005040924996137619,
-0.41661766171455383,
0.18146862089633942,
0.05345861613750458,
-0.22326934337615967,
-0.0794333666563034,
0.008804969489574432,
-0.499805748462677,
-0.28783613443374634,
0.528273344039917,
-0.2095530778169632,
-0.014439322054386139,
0.016815293580293655,
0.44252318143844604,
0.32096442580223083,
0.13171188533306122,
-1.0341064929962158,
0.14135991036891937,
0.35800909996032715,
0.04677759110927582,
-0.3209111988544464,
0.24520960450172424,
-0.18830297887325287,
-0.11204284429550171,
-0.06656389683485031,
0.20237530767917633,
0.044737160205841064,
-0.25587913393974304,
0.14269942045211792,
-0.41050130128860474
] |
https://github.com/huggingface/datasets/issues/5654 | Upd. the above code works if we replace `25` with `1`, but the result value at key "hr" is not a tensor but a list of lists of lists of uint8.
Adding `train_data.set_format("torch")` after map fixes this, but the original issue remains
| Offset overflow when executing Dataset.map | ### Describe the bug
Hi, I'm trying to use `.map` method to cache multiple random crops from the image to speed up data processing during training, as the image size is too big.
The map function executes all iterations, and then returns the following error:
```bash
Traceback (most recent call last):
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 3353, in _map_single
writer.finalize() # close_stream=bool(buf_writer is None)) # We only close if we are writing in a file
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 582, in finalize
self.write_examples_on_file()
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 446, in write_examples_on_file
self.write_batch(batch_examples=batch_examples)
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 555, in write_batch
self.write_table(pa_table, writer_batch_size)
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 567, in write_table
pa_table = pa_table.combine_chunks()
File "pyarrow/table.pxi", line 3315, in pyarrow.lib.Table.combine_chunks
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: offset overflow while concatenating arrays
```
Here is the minimal code (`/home/datasets/DIV2K_train_HR` is just a folder of images that can be replaced by any appropriate):
### Steps to reproduce the bug
```python
from glob import glob
import torch
from datasets import Dataset, Image
from torchvision.transforms import PILToTensor, RandomCrop
file_paths = glob("/home/datasets/DIV2K_train_HR/*")
to_tensor = PILToTensor()
crop_transf = RandomCrop(size=256)
def prepare_data(example):
tensor = to_tensor(example["image"].convert("RGB"))
return {"hr": torch.stack([crop_transf(tensor) for _ in range(25)])}
train_data = Dataset.from_dict({"image": file_paths}).cast_column("image", Image())
train_data = train_data.map(
prepare_data,
cache_file_name="/home/datasets/DIV2K_train_HR_crops.tmp",
desc="Caching multiple random crops of image",
remove_columns="image",
)
print(train_data[0].keys(), train_data[0]["hr"].shape)
```
### Expected behavior
Cached file is stored at `"/home/datasets/DIV2K_train_HR_crops.tmp"`, output is `dict_keys(['hr']) torch.Size([25, 3, 256, 256])`
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-5.15.0-67-generic-x86_64-with-glibc2.10
- Python version: 3.8.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Pytorch version: 2.0.0+cu117
- torchvision version: 0.15.1+cu117 | 42 | Offset overflow when executing Dataset.map
### Describe the bug
Hi, I'm trying to use `.map` method to cache multiple random crops from the image to speed up data processing during training, as the image size is too big.
The map function executes all iterations, and then returns the following error:
```bash
Traceback (most recent call last):
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 3353, in _map_single
writer.finalize() # close_stream=bool(buf_writer is None)) # We only close if we are writing in a file
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 582, in finalize
self.write_examples_on_file()
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 446, in write_examples_on_file
self.write_batch(batch_examples=batch_examples)
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 555, in write_batch
self.write_table(pa_table, writer_batch_size)
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 567, in write_table
pa_table = pa_table.combine_chunks()
File "pyarrow/table.pxi", line 3315, in pyarrow.lib.Table.combine_chunks
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: offset overflow while concatenating arrays
```
Here is the minimal code (`/home/datasets/DIV2K_train_HR` is just a folder of images that can be replaced by any appropriate):
### Steps to reproduce the bug
```python
from glob import glob
import torch
from datasets import Dataset, Image
from torchvision.transforms import PILToTensor, RandomCrop
file_paths = glob("/home/datasets/DIV2K_train_HR/*")
to_tensor = PILToTensor()
crop_transf = RandomCrop(size=256)
def prepare_data(example):
tensor = to_tensor(example["image"].convert("RGB"))
return {"hr": torch.stack([crop_transf(tensor) for _ in range(25)])}
train_data = Dataset.from_dict({"image": file_paths}).cast_column("image", Image())
train_data = train_data.map(
prepare_data,
cache_file_name="/home/datasets/DIV2K_train_HR_crops.tmp",
desc="Caching multiple random crops of image",
remove_columns="image",
)
print(train_data[0].keys(), train_data[0]["hr"].shape)
```
### Expected behavior
Cached file is stored at `"/home/datasets/DIV2K_train_HR_crops.tmp"`, output is `dict_keys(['hr']) torch.Size([25, 3, 256, 256])`
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-5.15.0-67-generic-x86_64-with-glibc2.10
- Python version: 3.8.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Pytorch version: 2.0.0+cu117
- torchvision version: 0.15.1+cu117
Upd. the above code works if we replace `25` with `1`, but the result value at key "hr" is not a tensor but a list of lists of lists of uint8.
Adding `train_data.set_format("torch")` after map fixes this, but the original issue remains
| [
-0.3162172734737396,
-0.13853387534618378,
0.012086600065231323,
0.2913801670074463,
0.0989006906747818,
0.006209701299667358,
0.33761030435562134,
0.2682550549507141,
-0.08812040835618973,
0.15623009204864502,
0.31795451045036316,
0.34499314427375793,
-0.07823392003774643,
-0.283382773399353,
-0.16080625355243683,
0.010885707102715969,
0.10210995376110077,
-0.1087682917714119,
-0.1636206954717636,
-0.033478155732154846,
-0.4200260639190674,
-0.023586006835103035,
-0.3509451746940613,
-0.02501191571354866,
-0.2638705372810364,
-0.2696775197982788,
-0.09139122813940048,
0.09412479400634766,
-0.24843254685401917,
-0.2553470730781555,
0.05320560932159424,
-0.052223049104213715,
-0.10942697525024414,
0.4962080121040344,
-0.00011980554700130597,
0.0038841143250465393,
0.3538905680179596,
-0.13435837626457214,
0.0033850669860839844,
0.15322813391685486,
-0.2660070061683655,
0.11489435285329819,
-0.25642192363739014,
-0.41777294874191284,
0.22475950419902802,
-0.07129691541194916,
0.19092349708080292,
-0.38851019740104675,
0.19059132039546967,
0.2196395993232727,
0.14578497409820557,
-0.1501902937889099,
0.19162309169769287,
0.11163955926895142,
0.3399573564529419,
-0.008449669927358627,
0.09324928373098373,
0.0014597214758396149,
0.1050170511007309,
-0.17328998446464539,
-0.2725999355316162,
0.19549117982387543,
-0.1800374984741211,
0.02925741672515869,
0.27898165583610535,
0.018876872956752777,
0.2721376121044159,
-0.22138525545597076,
0.11370427906513214,
-0.19364774227142334,
0.2811950445175171,
-0.3317616581916809,
-0.31279250979423523,
-0.22151915729045868,
-0.13041998445987701,
-0.05465961992740631,
0.21357396245002747,
0.193037211894989,
-0.11053582280874252,
-0.10332620143890381,
-0.5583669543266296,
0.1825847029685974,
-0.1261882483959198,
0.27603060007095337,
-0.015691176056861877,
0.08644762635231018,
0.06479036808013916,
0.2900731563568115,
0.3812967538833618,
0.02924918755888939,
0.26708298921585083,
-0.21314619481563568,
0.0424041748046875,
0.33082497119903564,
-0.21164070069789886,
0.20305128395557404,
0.3167072534561157,
-0.11131725460290909,
0.27918553352355957,
-0.3030400276184082,
0.13520921766757965,
-0.05543144792318344,
0.22455555200576782,
0.2285909652709961,
0.3194514811038971,
0.22750256955623627,
-0.09927471727132797,
0.5449182391166687,
-0.07261297106742859,
0.06883753836154938,
-0.16424280405044556,
-0.10704270750284195,
0.16111381351947784,
-0.43983522057533264,
0.41909167170524597,
0.20959581434726715,
0.051153093576431274,
-0.012221001088619232,
-0.05848671868443489,
0.03435489535331726,
-0.1701572686433792,
0.13146129250526428,
0.0364670529961586,
0.08667431771755219,
0.2546437978744507,
0.03209516406059265,
0.15415415167808533,
0.11032237112522125,
-0.030544426292181015,
0.04002021998167038,
-0.13274164497852325,
0.012368742376565933,
-0.2715354561805725,
-0.017920883372426033,
-0.13614428043365479,
0.10721562802791595,
0.038460664451122284,
-0.05331312492489815,
0.2745613753795624,
-0.013728663325309753,
0.05885662883520126,
-0.2692453861236572,
0.4553086757659912,
0.08345359563827515,
-0.039038628339767456,
0.09754462540149689,
0.09314428269863129,
0.12498456239700317,
-0.14869794249534607,
0.34011340141296387,
-0.4454159736633301,
-0.3735451102256775,
0.13951203227043152,
0.1493675410747528,
0.027136176824569702,
0.45120030641555786,
-0.27221596240997314,
-0.03809001296758652,
0.6629467010498047,
-0.13805799186229706,
0.16201776266098022,
-0.1265958845615387,
-0.3302248418331146,
-0.3850090801715851,
0.023137472569942474,
0.5076612234115601,
-0.3379416763782501,
0.3567451536655426,
-0.06547872722148895,
0.2962597608566284,
0.22181260585784912,
0.20884940028190613,
-0.19721053540706635,
0.24799597263336182,
-0.41293632984161377,
0.06218886375427246,
0.25054776668548584,
-0.3053126633167267,
-0.5847715735435486,
0.16758640110492706,
-0.1089286059141159,
-0.051944438368082047,
-0.022369273006916046,
-0.1381196677684784,
0.213362455368042,
-0.15429846942424774,
0.22709894180297852,
0.26250985264778137,
-0.31073734164237976,
0.27285248041152954,
-0.34787261486053467,
-0.04710259288549423,
-0.055005621165037155,
0.10346836596727371,
-0.06244896352291107,
-0.2315005213022232,
0.16468971967697144,
-0.31599855422973633,
0.06701160967350006,
-0.09799212217330933,
0.20724481344223022,
0.3694693446159363,
-0.05198915675282478,
-0.21729661524295807,
0.02663564682006836,
-0.23460933566093445,
-0.299424409866333,
0.12338627129793167,
-0.30354976654052734,
-0.22813376784324646,
-0.3462308347225189,
-0.1129673644900322,
0.09422346949577332,
0.22489741444587708,
-0.3150448203086853,
0.13683657348155975,
0.11594433337450027,
-0.21787132322788239,
0.3751644790172577,
-0.0173211470246315,
0.18648473918437958,
0.11261012405157089,
0.018465429544448853,
-0.10234806686639786,
-0.36076265573501587,
-0.020455200225114822,
-0.23685680329799652,
-0.3072718679904938,
-0.13376009464263916,
0.1555338203907013,
0.1607571542263031,
-0.27493658661842346,
-0.18111979961395264,
0.5199156999588013,
0.19300581514835358,
0.024334721267223358,
0.02587917074561119,
-0.04410357028245926,
0.022060824558138847,
-0.33676987886428833,
0.12464037537574768,
0.12508119642734528,
-0.05411340296268463,
-0.02707412838935852,
0.03465278446674347,
0.39832359552383423,
-0.08903558552265167,
0.0485759899020195,
-0.05850493162870407,
0.06730327755212784,
0.006500057876110077,
0.10043506324291229,
0.11817547678947449,
-0.24042698740959167,
0.18114353716373444,
0.330159455537796,
0.051454491913318634,
-0.07738514244556427,
0.22463774681091309,
0.09144619852304459,
0.5485853552818298,
0.10554586350917816,
-0.06208856403827667,
0.08168178796768188,
-0.12617617845535278,
-0.0022465065121650696,
0.0385708212852478,
0.16890831291675568,
0.36960357427597046,
0.23381812870502472,
-0.004343211650848389,
0.00507311150431633,
0.03240522742271423,
0.09802165627479553,
0.13348200917243958,
-0.014932654798030853,
0.3741518259048462,
0.014371656812727451,
0.3791033625602722,
-0.005657253786921501,
-0.11971218138933182,
-0.0691552683711052,
0.2369457185268402,
0.34381699562072754,
-0.06008952483534813,
0.2617899775505066,
0.07442593574523926,
-0.2493860423564911,
-0.1285776048898697,
-0.2117946445941925,
-0.25043001770973206,
-0.46359968185424805,
0.010950719937682152,
0.19233007729053497,
-0.24668779969215393,
0.40805792808532715,
0.051486365497112274,
0.0769566223025322,
0.3555842936038971,
-0.3220779299736023,
-0.11293525993824005,
-0.23134809732437134,
-0.09166327118873596,
-0.07868285477161407,
0.372769296169281,
-0.36980825662612915,
0.3364112973213196,
0.09421698749065399,
-0.04790344834327698,
-0.2087959349155426,
-0.14582449197769165,
-0.06904903054237366,
0.14864115417003632,
0.03505943715572357,
0.36164918541908264,
-0.04127420112490654,
-0.32429343461990356,
-0.16708232462406158,
0.23244556784629822,
-0.2839902341365814,
-0.17777177691459656,
0.2883387804031372,
-0.06392619013786316,
-0.21386942267417908,
-0.286607027053833,
0.15989744663238525,
0.09451562911272049,
-0.4490886926651001,
0.12276607006788254,
-0.040481604635715485,
0.3137088716030121,
0.3320968449115753,
0.36515921354293823,
-0.0072033219039440155,
0.008628617972135544,
-0.432095468044281,
-0.17277446389198303,
-0.2048608362674713,
0.3312003016471863,
-0.1325850486755371,
-0.12248748540878296,
-0.05560828745365143,
-0.04955979436635971,
-0.008426480926573277,
0.613400399684906,
-0.3642798662185669,
-0.3109155297279358,
-0.041742198169231415,
0.38016775250434875,
-0.21260511875152588,
0.10811068117618561,
0.388216495513916,
0.1583765149116516,
-0.025699637830257416,
-0.23023143410682678,
-0.07261819392442703,
0.15832728147506714,
-0.00039977673441171646,
0.07707217335700989,
0.17538076639175415,
0.17304030060768127,
0.16639012098312378,
0.670207142829895,
0.2936783730983734,
-0.21851739287376404,
0.10393261909484863,
0.06673610955476761,
0.1385868787765503,
-0.1165231317281723,
-0.24955123662948608,
0.103012315928936,
0.010121569037437439,
-0.11560949683189392,
-0.08037671446800232,
-0.14040260016918182,
-0.27535346150398254,
-0.06339877098798752,
0.1608259677886963,
-0.22712217271327972,
-0.16336852312088013,
0.274749219417572,
-0.31282222270965576,
0.22625526785850525,
-0.04870307818055153,
-0.12141156941652298,
-0.6040534973144531,
-0.050902292132377625,
-0.05244503542780876,
-0.28626906871795654,
0.36674249172210693,
-0.06827828288078308,
-0.2274637669324875,
-0.03849662095308304,
-0.29918161034584045,
0.49605873227119446,
0.17505939304828644,
0.09838889539241791,
0.028790056705474854,
0.12397156655788422,
0.010901246219873428,
-0.14622123539447784,
0.9838896989822388,
-0.39711716771125793,
0.07473611831665039,
-0.10170906037092209,
0.30994489789009094,
-0.5558417439460754,
-0.12004208564758301,
-0.040481358766555786,
0.6047397255897522,
0.13525031507015228,
0.427392840385437,
-0.19949474930763245,
0.21054664254188538,
0.13131572306156158,
0.0034574419260025024,
0.019075751304626465,
-0.2894856929779053,
-0.19663256406784058,
-0.15489530563354492,
-0.1463642716407776,
0.0009232945740222931,
0.2509903311729431,
0.12247045338153839,
0.3477136790752411,
-0.14166651666164398,
0.21331150829792023,
0.21897020936012268,
-0.44801849126815796,
0.01672183722257614,
0.4635842740535736,
-0.21984001994132996,
-0.0709274560213089,
0.06733421236276627,
-0.1514214128255844,
0.5369435548782349,
0.35143449902534485,
-0.18516027927398682,
-0.2567383646965027,
-0.09077607095241547,
-0.11097805947065353,
0.23132771253585815,
0.1824926882982254,
-0.010429732501506805,
-0.059513553977012634,
0.068947933614254,
0.2774125337600708,
-0.11369307339191437,
-0.05160509794950485,
0.28849950432777405,
-0.09594409167766571,
-0.027542445808649063,
-0.2704636752605438,
0.1079268828034401,
0.11188796162605286,
0.1056850254535675,
0.7204752564430237,
-0.38469213247299194,
-0.2987355589866638,
0.34678545594215393,
0.15060491859912872,
0.7017124891281128,
-0.24234655499458313,
-0.016559360548853874,
-0.10047522187232971,
0.021561704576015472,
0.22445033490657806,
0.004484288394451141,
0.4391486346721649,
-0.21353347599506378,
-0.2522556483745575,
0.08123141527175903,
-0.291210412979126,
0.056935474276542664,
0.2369188666343689,
-0.1358625590801239,
0.03497721999883652,
0.1053512841463089,
0.19677788019180298,
-0.20883211493492126,
-0.1769888699054718,
0.06950357556343079,
-0.19286909699440002,
-0.2299003303050995,
0.021157175302505493,
0.012328153476119041,
-0.3588647246360779,
-0.12294718623161316,
-0.05296849459409714,
-0.10124392807483673,
-0.3947100043296814,
-0.3057520389556885,
0.0927528664469719,
-0.8240392804145813,
0.17521488666534424,
-0.07531573623418808,
-0.14093837141990662,
-0.0773969441652298,
0.1710793375968933,
-0.10111726820468903,
0.02456641010940075,
0.06113113462924957,
-0.1292244791984558,
0.39663511514663696,
-0.014438394457101822,
-0.13948121666908264,
-0.08664970099925995,
0.05940983444452286,
0.0647849589586258,
-0.12972579896450043,
0.09040938317775726,
-0.1568877249956131,
-0.32795852422714233,
0.06686025857925415,
0.16311177611351013,
0.2764724791049957,
0.0028708353638648987,
-0.17131948471069336,
-0.3233976662158966,
-0.1718009114265442,
-0.051082972437143326,
0.0352092944085598,
0.08411572873592377,
-0.2493029683828354,
0.31799235939979553,
-0.3558431565761566,
-0.24999630451202393,
0.16880369186401367,
0.4366067349910736,
-0.14736507833003998,
0.16987618803977966,
0.3026655912399292,
0.199818953871727,
-0.13796061277389526,
-0.09771757572889328,
-0.08328234404325485,
0.09078729152679443,
-0.4261019229888916,
0.016038909554481506,
-0.20066678524017334,
0.16396300494670868,
0.013607040047645569,
-0.11911074817180634,
0.19329896569252014,
0.23042923212051392,
-0.17648981511592865,
-0.40211766958236694,
-0.3694411814212799,
-0.016095314174890518,
-0.2940853536128998,
-0.005523486062884331,
0.3518132269382477,
0.036438990384340286,
0.046286679804325104,
0.13459256291389465,
-0.2750885784626007,
0.09115263819694519,
0.04460730403661728,
0.21984067559242249,
0.05774762108922005,
-0.0024208631366491318,
0.15504959225654602,
-0.13054978847503662,
0.04117615520954132,
0.1720418632030487,
-0.38475698232650757,
-0.1939878612756729,
0.11347007751464844,
0.12180602550506592,
0.01563132181763649,
-0.30364638566970825,
0.05982052534818649,
-0.3052332401275635,
-0.05404582619667053,
-0.243184432387352,
0.07995057106018066,
0.01676815003156662,
-0.07160501182079315,
0.14148174226284027,
0.3406820297241211,
-0.2182091474533081,
-0.050508398562669754,
0.034124068915843964,
-0.0792393907904625,
-0.009842447936534882,
-0.0502905547618866,
0.49356675148010254,
0.06696634739637375,
-0.21204078197479248,
-0.1744615137577057,
0.02159273251891136,
-0.0787319764494896,
0.13872072100639343,
0.44594666361808777,
-0.36470234394073486,
-0.15472307801246643,
0.2866087257862091,
0.3405591547489166,
0.16872434318065643,
-0.39908567070961,
-0.26618707180023193,
0.0679214745759964,
0.13164085149765015,
-0.10165746510028839,
-0.21290458738803864,
0.4551470875740051,
0.20822018384933472,
0.006463006138801575,
0.26872876286506653,
0.014620602130889893,
-0.3395180106163025,
0.06256367266178131,
0.2362871766090393,
0.5383242964744568,
-0.4057713449001312,
0.07063716650009155,
0.5641933679580688,
0.09535975009202957,
0.054684583097696304,
0.29951679706573486,
0.29746297001838684,
0.42111384868621826,
0.4255618751049042,
0.17892687022686005,
0.10956622660160065,
-0.01744840294122696,
-0.36429542303085327,
-0.12381439656019211,
-0.4646536409854889,
0.12514454126358032,
0.6501315832138062,
0.00009503960609436035,
0.48655593395233154,
0.19032810628414154,
0.21117180585861206,
-0.010621830821037292,
-0.13649167120456696,
0.07327865809202194,
0.04556712880730629,
-0.29886138439178467,
0.29103246331214905,
-0.09248850494623184,
-0.17183291912078857,
0.03929702937602997,
-0.028853122144937515,
-0.06098990887403488,
0.2787972092628479,
0.9314665794372559,
-0.0357753150165081,
-0.05587659031152725,
0.03193650394678116,
0.1119108647108078,
0.11077424883842468,
0.23187348246574402,
-0.5057820081710815,
0.34311509132385254,
0.03581111133098602,
-0.07851780205965042,
-0.18281233310699463,
0.48112645745277405,
0.6075059175491333,
0.4813373386859894,
-0.10477739572525024,
0.17391495406627655,
0.17418169975280762,
-0.10105402767658234,
-0.30331099033355713,
0.005784403532743454,
0.1822342872619629,
-0.15570637583732605,
0.281497597694397,
0.05949324369430542,
-0.08067870140075684,
0.2409590184688568,
0.35958558320999146,
0.11299265921115875,
0.25322189927101135,
-0.34746915102005005,
0.010394513607025146,
-0.45376017689704895,
0.20052596926689148,
0.13152843713760376,
-0.18156886100769043,
-0.01839549094438553,
0.19566965103149414,
-0.13576725125312805,
0.21498990058898926,
0.015523519366979599,
0.037128083407878876,
-0.06985501945018768,
0.5685499906539917,
0.7119781970977783,
0.11623023450374603,
-0.48891112208366394,
-0.32718053460121155,
-0.2598631978034973,
0.4319441020488739,
-0.5004779100418091,
0.1171928197145462,
0.31816792488098145,
0.13039395213127136,
0.08729077875614166,
0.0066327303647994995,
0.5777506232261658,
-0.23912180960178375,
-0.1977725625038147,
0.5552239418029785,
-0.47027134895324707,
-0.29140704870224,
0.07097290456295013,
-0.3178827464580536,
0.09341077506542206,
-0.5273531675338745,
0.13148872554302216,
0.004898931831121445,
0.1057884693145752,
-0.03523322194814682,
0.21709682047367096,
-0.016229312866926193,
0.04738588631153107,
0.3510323166847229,
0.39892181754112244,
0.1323401778936386,
-0.11806495487689972,
-0.030218258500099182,
-0.23533402383327484,
0.13449952006340027,
-0.3808654546737671,
0.27859413623809814,
0.08397779613733292,
0.3096805810928345,
-0.40903642773628235,
-0.678119957447052,
-0.3419525623321533,
0.07972409576177597,
0.16776785254478455,
-0.056874122470617294,
0.022578246891498566,
0.20010694861412048,
-0.14825087785720825,
-0.16399604082107544,
0.14975664019584656,
-0.0590645931661129,
0.11325547099113464,
0.18795433640480042,
-0.20774759352207184,
-0.07519014924764633,
0.19691267609596252,
-0.3420124351978302,
-0.4389646351337433,
0.31614264845848083,
0.13064339756965637,
-0.3581569194793701,
-0.21114614605903625,
-0.48099395632743835,
0.005052655935287476,
0.3630102276802063,
0.09488177299499512,
-0.3283947706222534,
0.10067817568778992,
-0.2559230327606201,
-0.03734581917524338,
0.09946499764919281,
0.45040613412857056,
-0.105208620429039,
-0.46152210235595703,
0.11733666062355042,
-0.25243571400642395
] |
https://github.com/huggingface/datasets/issues/5654 | As a workaround, one can replace
`return {"hr": torch.stack([crop_transf(tensor) for _ in range(25)])}`
with
`return {f"hr_crop_{i}": crop_transf(tensor) for i in range(25)}`
and then choose appropriate crop randomly in further processing, but I still don't understand why the original approach doesn't work(
| Offset overflow when executing Dataset.map | ### Describe the bug
Hi, I'm trying to use `.map` method to cache multiple random crops from the image to speed up data processing during training, as the image size is too big.
The map function executes all iterations, and then returns the following error:
```bash
Traceback (most recent call last):
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 3353, in _map_single
writer.finalize() # close_stream=bool(buf_writer is None)) # We only close if we are writing in a file
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 582, in finalize
self.write_examples_on_file()
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 446, in write_examples_on_file
self.write_batch(batch_examples=batch_examples)
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 555, in write_batch
self.write_table(pa_table, writer_batch_size)
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 567, in write_table
pa_table = pa_table.combine_chunks()
File "pyarrow/table.pxi", line 3315, in pyarrow.lib.Table.combine_chunks
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: offset overflow while concatenating arrays
```
Here is the minimal code (`/home/datasets/DIV2K_train_HR` is just a folder of images that can be replaced by any appropriate):
### Steps to reproduce the bug
```python
from glob import glob
import torch
from datasets import Dataset, Image
from torchvision.transforms import PILToTensor, RandomCrop
file_paths = glob("/home/datasets/DIV2K_train_HR/*")
to_tensor = PILToTensor()
crop_transf = RandomCrop(size=256)
def prepare_data(example):
tensor = to_tensor(example["image"].convert("RGB"))
return {"hr": torch.stack([crop_transf(tensor) for _ in range(25)])}
train_data = Dataset.from_dict({"image": file_paths}).cast_column("image", Image())
train_data = train_data.map(
prepare_data,
cache_file_name="/home/datasets/DIV2K_train_HR_crops.tmp",
desc="Caching multiple random crops of image",
remove_columns="image",
)
print(train_data[0].keys(), train_data[0]["hr"].shape)
```
### Expected behavior
Cached file is stored at `"/home/datasets/DIV2K_train_HR_crops.tmp"`, output is `dict_keys(['hr']) torch.Size([25, 3, 256, 256])`
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-5.15.0-67-generic-x86_64-with-glibc2.10
- Python version: 3.8.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Pytorch version: 2.0.0+cu117
- torchvision version: 0.15.1+cu117 | 41 | Offset overflow when executing Dataset.map
### Describe the bug
Hi, I'm trying to use `.map` method to cache multiple random crops from the image to speed up data processing during training, as the image size is too big.
The map function executes all iterations, and then returns the following error:
```bash
Traceback (most recent call last):
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 3353, in _map_single
writer.finalize() # close_stream=bool(buf_writer is None)) # We only close if we are writing in a file
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 582, in finalize
self.write_examples_on_file()
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 446, in write_examples_on_file
self.write_batch(batch_examples=batch_examples)
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 555, in write_batch
self.write_table(pa_table, writer_batch_size)
File "/home/ubuntu/miniconda3/envs/enhancement/lib/python3.8/site-packages/datasets/arrow_writer.py", line 567, in write_table
pa_table = pa_table.combine_chunks()
File "pyarrow/table.pxi", line 3315, in pyarrow.lib.Table.combine_chunks
File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: offset overflow while concatenating arrays
```
Here is the minimal code (`/home/datasets/DIV2K_train_HR` is just a folder of images that can be replaced by any appropriate):
### Steps to reproduce the bug
```python
from glob import glob
import torch
from datasets import Dataset, Image
from torchvision.transforms import PILToTensor, RandomCrop
file_paths = glob("/home/datasets/DIV2K_train_HR/*")
to_tensor = PILToTensor()
crop_transf = RandomCrop(size=256)
def prepare_data(example):
tensor = to_tensor(example["image"].convert("RGB"))
return {"hr": torch.stack([crop_transf(tensor) for _ in range(25)])}
train_data = Dataset.from_dict({"image": file_paths}).cast_column("image", Image())
train_data = train_data.map(
prepare_data,
cache_file_name="/home/datasets/DIV2K_train_HR_crops.tmp",
desc="Caching multiple random crops of image",
remove_columns="image",
)
print(train_data[0].keys(), train_data[0]["hr"].shape)
```
### Expected behavior
Cached file is stored at `"/home/datasets/DIV2K_train_HR_crops.tmp"`, output is `dict_keys(['hr']) torch.Size([25, 3, 256, 256])`
### Environment info
- `datasets` version: 2.10.1
- Platform: Linux-5.15.0-67-generic-x86_64-with-glibc2.10
- Python version: 3.8.16
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
- Pytorch version: 2.0.0+cu117
- torchvision version: 0.15.1+cu117
As a workaround, one can replace
`return {"hr": torch.stack([crop_transf(tensor) for _ in range(25)])}`
with
`return {f"hr_crop_{i}": crop_transf(tensor) for i in range(25)}`
and then choose appropriate crop randomly in further processing, but I still don't understand why the original approach doesn't work(
| [
-0.3162172734737396,
-0.13853387534618378,
0.012086600065231323,
0.2913801670074463,
0.0989006906747818,
0.006209701299667358,
0.33761030435562134,
0.2682550549507141,
-0.08812040835618973,
0.15623009204864502,
0.31795451045036316,
0.34499314427375793,
-0.07823392003774643,
-0.283382773399353,
-0.16080625355243683,
0.010885707102715969,
0.10210995376110077,
-0.1087682917714119,
-0.1636206954717636,
-0.033478155732154846,
-0.4200260639190674,
-0.023586006835103035,
-0.3509451746940613,
-0.02501191571354866,
-0.2638705372810364,
-0.2696775197982788,
-0.09139122813940048,
0.09412479400634766,
-0.24843254685401917,
-0.2553470730781555,
0.05320560932159424,
-0.052223049104213715,
-0.10942697525024414,
0.4962080121040344,
-0.00011980554700130597,
0.0038841143250465393,
0.3538905680179596,
-0.13435837626457214,
0.0033850669860839844,
0.15322813391685486,
-0.2660070061683655,
0.11489435285329819,
-0.25642192363739014,
-0.41777294874191284,
0.22475950419902802,
-0.07129691541194916,
0.19092349708080292,
-0.38851019740104675,
0.19059132039546967,
0.2196395993232727,
0.14578497409820557,
-0.1501902937889099,
0.19162309169769287,
0.11163955926895142,
0.3399573564529419,
-0.008449669927358627,
0.09324928373098373,
0.0014597214758396149,
0.1050170511007309,
-0.17328998446464539,
-0.2725999355316162,
0.19549117982387543,
-0.1800374984741211,
0.02925741672515869,
0.27898165583610535,
0.018876872956752777,
0.2721376121044159,
-0.22138525545597076,
0.11370427906513214,
-0.19364774227142334,
0.2811950445175171,
-0.3317616581916809,
-0.31279250979423523,
-0.22151915729045868,
-0.13041998445987701,
-0.05465961992740631,
0.21357396245002747,
0.193037211894989,
-0.11053582280874252,
-0.10332620143890381,
-0.5583669543266296,
0.1825847029685974,
-0.1261882483959198,
0.27603060007095337,
-0.015691176056861877,
0.08644762635231018,
0.06479036808013916,
0.2900731563568115,
0.3812967538833618,
0.02924918755888939,
0.26708298921585083,
-0.21314619481563568,
0.0424041748046875,
0.33082497119903564,
-0.21164070069789886,
0.20305128395557404,
0.3167072534561157,
-0.11131725460290909,
0.27918553352355957,
-0.3030400276184082,
0.13520921766757965,
-0.05543144792318344,
0.22455555200576782,
0.2285909652709961,
0.3194514811038971,
0.22750256955623627,
-0.09927471727132797,
0.5449182391166687,
-0.07261297106742859,
0.06883753836154938,
-0.16424280405044556,
-0.10704270750284195,
0.16111381351947784,
-0.43983522057533264,
0.41909167170524597,
0.20959581434726715,
0.051153093576431274,
-0.012221001088619232,
-0.05848671868443489,
0.03435489535331726,
-0.1701572686433792,
0.13146129250526428,
0.0364670529961586,
0.08667431771755219,
0.2546437978744507,
0.03209516406059265,
0.15415415167808533,
0.11032237112522125,
-0.030544426292181015,
0.04002021998167038,
-0.13274164497852325,
0.012368742376565933,
-0.2715354561805725,
-0.017920883372426033,
-0.13614428043365479,
0.10721562802791595,
0.038460664451122284,
-0.05331312492489815,
0.2745613753795624,
-0.013728663325309753,
0.05885662883520126,
-0.2692453861236572,
0.4553086757659912,
0.08345359563827515,
-0.039038628339767456,
0.09754462540149689,
0.09314428269863129,
0.12498456239700317,
-0.14869794249534607,
0.34011340141296387,
-0.4454159736633301,
-0.3735451102256775,
0.13951203227043152,
0.1493675410747528,
0.027136176824569702,
0.45120030641555786,
-0.27221596240997314,
-0.03809001296758652,
0.6629467010498047,
-0.13805799186229706,
0.16201776266098022,
-0.1265958845615387,
-0.3302248418331146,
-0.3850090801715851,
0.023137472569942474,
0.5076612234115601,
-0.3379416763782501,
0.3567451536655426,
-0.06547872722148895,
0.2962597608566284,
0.22181260585784912,
0.20884940028190613,
-0.19721053540706635,
0.24799597263336182,
-0.41293632984161377,
0.06218886375427246,
0.25054776668548584,
-0.3053126633167267,
-0.5847715735435486,
0.16758640110492706,
-0.1089286059141159,
-0.051944438368082047,
-0.022369273006916046,
-0.1381196677684784,
0.213362455368042,
-0.15429846942424774,
0.22709894180297852,
0.26250985264778137,
-0.31073734164237976,
0.27285248041152954,
-0.34787261486053467,
-0.04710259288549423,
-0.055005621165037155,
0.10346836596727371,
-0.06244896352291107,
-0.2315005213022232,
0.16468971967697144,
-0.31599855422973633,
0.06701160967350006,
-0.09799212217330933,
0.20724481344223022,
0.3694693446159363,
-0.05198915675282478,
-0.21729661524295807,
0.02663564682006836,
-0.23460933566093445,
-0.299424409866333,
0.12338627129793167,
-0.30354976654052734,
-0.22813376784324646,
-0.3462308347225189,
-0.1129673644900322,
0.09422346949577332,
0.22489741444587708,
-0.3150448203086853,
0.13683657348155975,
0.11594433337450027,
-0.21787132322788239,
0.3751644790172577,
-0.0173211470246315,
0.18648473918437958,
0.11261012405157089,
0.018465429544448853,
-0.10234806686639786,
-0.36076265573501587,
-0.020455200225114822,
-0.23685680329799652,
-0.3072718679904938,
-0.13376009464263916,
0.1555338203907013,
0.1607571542263031,
-0.27493658661842346,
-0.18111979961395264,
0.5199156999588013,
0.19300581514835358,
0.024334721267223358,
0.02587917074561119,
-0.04410357028245926,
0.022060824558138847,
-0.33676987886428833,
0.12464037537574768,
0.12508119642734528,
-0.05411340296268463,
-0.02707412838935852,
0.03465278446674347,
0.39832359552383423,
-0.08903558552265167,
0.0485759899020195,
-0.05850493162870407,
0.06730327755212784,
0.006500057876110077,
0.10043506324291229,
0.11817547678947449,
-0.24042698740959167,
0.18114353716373444,
0.330159455537796,
0.051454491913318634,
-0.07738514244556427,
0.22463774681091309,
0.09144619852304459,
0.5485853552818298,
0.10554586350917816,
-0.06208856403827667,
0.08168178796768188,
-0.12617617845535278,
-0.0022465065121650696,
0.0385708212852478,
0.16890831291675568,
0.36960357427597046,
0.23381812870502472,
-0.004343211650848389,
0.00507311150431633,
0.03240522742271423,
0.09802165627479553,
0.13348200917243958,
-0.014932654798030853,
0.3741518259048462,
0.014371656812727451,
0.3791033625602722,
-0.005657253786921501,
-0.11971218138933182,
-0.0691552683711052,
0.2369457185268402,
0.34381699562072754,
-0.06008952483534813,
0.2617899775505066,
0.07442593574523926,
-0.2493860423564911,
-0.1285776048898697,
-0.2117946445941925,
-0.25043001770973206,
-0.46359968185424805,
0.010950719937682152,
0.19233007729053497,
-0.24668779969215393,
0.40805792808532715,
0.051486365497112274,
0.0769566223025322,
0.3555842936038971,
-0.3220779299736023,
-0.11293525993824005,
-0.23134809732437134,
-0.09166327118873596,
-0.07868285477161407,
0.372769296169281,
-0.36980825662612915,
0.3364112973213196,
0.09421698749065399,
-0.04790344834327698,
-0.2087959349155426,
-0.14582449197769165,
-0.06904903054237366,
0.14864115417003632,
0.03505943715572357,
0.36164918541908264,
-0.04127420112490654,
-0.32429343461990356,
-0.16708232462406158,
0.23244556784629822,
-0.2839902341365814,
-0.17777177691459656,
0.2883387804031372,
-0.06392619013786316,
-0.21386942267417908,
-0.286607027053833,
0.15989744663238525,
0.09451562911272049,
-0.4490886926651001,
0.12276607006788254,
-0.040481604635715485,
0.3137088716030121,
0.3320968449115753,
0.36515921354293823,
-0.0072033219039440155,
0.008628617972135544,
-0.432095468044281,
-0.17277446389198303,
-0.2048608362674713,
0.3312003016471863,
-0.1325850486755371,
-0.12248748540878296,
-0.05560828745365143,
-0.04955979436635971,
-0.008426480926573277,
0.613400399684906,
-0.3642798662185669,
-0.3109155297279358,
-0.041742198169231415,
0.38016775250434875,
-0.21260511875152588,
0.10811068117618561,
0.388216495513916,
0.1583765149116516,
-0.025699637830257416,
-0.23023143410682678,
-0.07261819392442703,
0.15832728147506714,
-0.00039977673441171646,
0.07707217335700989,
0.17538076639175415,
0.17304030060768127,
0.16639012098312378,
0.670207142829895,
0.2936783730983734,
-0.21851739287376404,
0.10393261909484863,
0.06673610955476761,
0.1385868787765503,
-0.1165231317281723,
-0.24955123662948608,
0.103012315928936,
0.010121569037437439,
-0.11560949683189392,
-0.08037671446800232,
-0.14040260016918182,
-0.27535346150398254,
-0.06339877098798752,
0.1608259677886963,
-0.22712217271327972,
-0.16336852312088013,
0.274749219417572,
-0.31282222270965576,
0.22625526785850525,
-0.04870307818055153,
-0.12141156941652298,
-0.6040534973144531,
-0.050902292132377625,
-0.05244503542780876,
-0.28626906871795654,
0.36674249172210693,
-0.06827828288078308,
-0.2274637669324875,
-0.03849662095308304,
-0.29918161034584045,
0.49605873227119446,
0.17505939304828644,
0.09838889539241791,
0.028790056705474854,
0.12397156655788422,
0.010901246219873428,
-0.14622123539447784,
0.9838896989822388,
-0.39711716771125793,
0.07473611831665039,
-0.10170906037092209,
0.30994489789009094,
-0.5558417439460754,
-0.12004208564758301,
-0.040481358766555786,
0.6047397255897522,
0.13525031507015228,
0.427392840385437,
-0.19949474930763245,
0.21054664254188538,
0.13131572306156158,
0.0034574419260025024,
0.019075751304626465,
-0.2894856929779053,
-0.19663256406784058,
-0.15489530563354492,
-0.1463642716407776,
0.0009232945740222931,
0.2509903311729431,
0.12247045338153839,
0.3477136790752411,
-0.14166651666164398,
0.21331150829792023,
0.21897020936012268,
-0.44801849126815796,
0.01672183722257614,
0.4635842740535736,
-0.21984001994132996,
-0.0709274560213089,
0.06733421236276627,
-0.1514214128255844,
0.5369435548782349,
0.35143449902534485,
-0.18516027927398682,
-0.2567383646965027,
-0.09077607095241547,
-0.11097805947065353,
0.23132771253585815,
0.1824926882982254,
-0.010429732501506805,
-0.059513553977012634,
0.068947933614254,
0.2774125337600708,
-0.11369307339191437,
-0.05160509794950485,
0.28849950432777405,
-0.09594409167766571,
-0.027542445808649063,
-0.2704636752605438,
0.1079268828034401,
0.11188796162605286,
0.1056850254535675,
0.7204752564430237,
-0.38469213247299194,
-0.2987355589866638,
0.34678545594215393,
0.15060491859912872,
0.7017124891281128,
-0.24234655499458313,
-0.016559360548853874,
-0.10047522187232971,
0.021561704576015472,
0.22445033490657806,
0.004484288394451141,
0.4391486346721649,
-0.21353347599506378,
-0.2522556483745575,
0.08123141527175903,
-0.291210412979126,
0.056935474276542664,
0.2369188666343689,
-0.1358625590801239,
0.03497721999883652,
0.1053512841463089,
0.19677788019180298,
-0.20883211493492126,
-0.1769888699054718,
0.06950357556343079,
-0.19286909699440002,
-0.2299003303050995,
0.021157175302505493,
0.012328153476119041,
-0.3588647246360779,
-0.12294718623161316,
-0.05296849459409714,
-0.10124392807483673,
-0.3947100043296814,
-0.3057520389556885,
0.0927528664469719,
-0.8240392804145813,
0.17521488666534424,
-0.07531573623418808,
-0.14093837141990662,
-0.0773969441652298,
0.1710793375968933,
-0.10111726820468903,
0.02456641010940075,
0.06113113462924957,
-0.1292244791984558,
0.39663511514663696,
-0.014438394457101822,
-0.13948121666908264,
-0.08664970099925995,
0.05940983444452286,
0.0647849589586258,
-0.12972579896450043,
0.09040938317775726,
-0.1568877249956131,
-0.32795852422714233,
0.06686025857925415,
0.16311177611351013,
0.2764724791049957,
0.0028708353638648987,
-0.17131948471069336,
-0.3233976662158966,
-0.1718009114265442,
-0.051082972437143326,
0.0352092944085598,
0.08411572873592377,
-0.2493029683828354,
0.31799235939979553,
-0.3558431565761566,
-0.24999630451202393,
0.16880369186401367,
0.4366067349910736,
-0.14736507833003998,
0.16987618803977966,
0.3026655912399292,
0.199818953871727,
-0.13796061277389526,
-0.09771757572889328,
-0.08328234404325485,
0.09078729152679443,
-0.4261019229888916,
0.016038909554481506,
-0.20066678524017334,
0.16396300494670868,
0.013607040047645569,
-0.11911074817180634,
0.19329896569252014,
0.23042923212051392,
-0.17648981511592865,
-0.40211766958236694,
-0.3694411814212799,
-0.016095314174890518,
-0.2940853536128998,
-0.005523486062884331,
0.3518132269382477,
0.036438990384340286,
0.046286679804325104,
0.13459256291389465,
-0.2750885784626007,
0.09115263819694519,
0.04460730403661728,
0.21984067559242249,
0.05774762108922005,
-0.0024208631366491318,
0.15504959225654602,
-0.13054978847503662,
0.04117615520954132,
0.1720418632030487,
-0.38475698232650757,
-0.1939878612756729,
0.11347007751464844,
0.12180602550506592,
0.01563132181763649,
-0.30364638566970825,
0.05982052534818649,
-0.3052332401275635,
-0.05404582619667053,
-0.243184432387352,
0.07995057106018066,
0.01676815003156662,
-0.07160501182079315,
0.14148174226284027,
0.3406820297241211,
-0.2182091474533081,
-0.050508398562669754,
0.034124068915843964,
-0.0792393907904625,
-0.009842447936534882,
-0.0502905547618866,
0.49356675148010254,
0.06696634739637375,
-0.21204078197479248,
-0.1744615137577057,
0.02159273251891136,
-0.0787319764494896,
0.13872072100639343,
0.44594666361808777,
-0.36470234394073486,
-0.15472307801246643,
0.2866087257862091,
0.3405591547489166,
0.16872434318065643,
-0.39908567070961,
-0.26618707180023193,
0.0679214745759964,
0.13164085149765015,
-0.10165746510028839,
-0.21290458738803864,
0.4551470875740051,
0.20822018384933472,
0.006463006138801575,
0.26872876286506653,
0.014620602130889893,
-0.3395180106163025,
0.06256367266178131,
0.2362871766090393,
0.5383242964744568,
-0.4057713449001312,
0.07063716650009155,
0.5641933679580688,
0.09535975009202957,
0.054684583097696304,
0.29951679706573486,
0.29746297001838684,
0.42111384868621826,
0.4255618751049042,
0.17892687022686005,
0.10956622660160065,
-0.01744840294122696,
-0.36429542303085327,
-0.12381439656019211,
-0.4646536409854889,
0.12514454126358032,
0.6501315832138062,
0.00009503960609436035,
0.48655593395233154,
0.19032810628414154,
0.21117180585861206,
-0.010621830821037292,
-0.13649167120456696,
0.07327865809202194,
0.04556712880730629,
-0.29886138439178467,
0.29103246331214905,
-0.09248850494623184,
-0.17183291912078857,
0.03929702937602997,
-0.028853122144937515,
-0.06098990887403488,
0.2787972092628479,
0.9314665794372559,
-0.0357753150165081,
-0.05587659031152725,
0.03193650394678116,
0.1119108647108078,
0.11077424883842468,
0.23187348246574402,
-0.5057820081710815,
0.34311509132385254,
0.03581111133098602,
-0.07851780205965042,
-0.18281233310699463,
0.48112645745277405,
0.6075059175491333,
0.4813373386859894,
-0.10477739572525024,
0.17391495406627655,
0.17418169975280762,
-0.10105402767658234,
-0.30331099033355713,
0.005784403532743454,
0.1822342872619629,
-0.15570637583732605,
0.281497597694397,
0.05949324369430542,
-0.08067870140075684,
0.2409590184688568,
0.35958558320999146,
0.11299265921115875,
0.25322189927101135,
-0.34746915102005005,
0.010394513607025146,
-0.45376017689704895,
0.20052596926689148,
0.13152843713760376,
-0.18156886100769043,
-0.01839549094438553,
0.19566965103149414,
-0.13576725125312805,
0.21498990058898926,
0.015523519366979599,
0.037128083407878876,
-0.06985501945018768,
0.5685499906539917,
0.7119781970977783,
0.11623023450374603,
-0.48891112208366394,
-0.32718053460121155,
-0.2598631978034973,
0.4319441020488739,
-0.5004779100418091,
0.1171928197145462,
0.31816792488098145,
0.13039395213127136,
0.08729077875614166,
0.0066327303647994995,
0.5777506232261658,
-0.23912180960178375,
-0.1977725625038147,
0.5552239418029785,
-0.47027134895324707,
-0.29140704870224,
0.07097290456295013,
-0.3178827464580536,
0.09341077506542206,
-0.5273531675338745,
0.13148872554302216,
0.004898931831121445,
0.1057884693145752,
-0.03523322194814682,
0.21709682047367096,
-0.016229312866926193,
0.04738588631153107,
0.3510323166847229,
0.39892181754112244,
0.1323401778936386,
-0.11806495487689972,
-0.030218258500099182,
-0.23533402383327484,
0.13449952006340027,
-0.3808654546737671,
0.27859413623809814,
0.08397779613733292,
0.3096805810928345,
-0.40903642773628235,
-0.678119957447052,
-0.3419525623321533,
0.07972409576177597,
0.16776785254478455,
-0.056874122470617294,
0.022578246891498566,
0.20010694861412048,
-0.14825087785720825,
-0.16399604082107544,
0.14975664019584656,
-0.0590645931661129,
0.11325547099113464,
0.18795433640480042,
-0.20774759352207184,
-0.07519014924764633,
0.19691267609596252,
-0.3420124351978302,
-0.4389646351337433,
0.31614264845848083,
0.13064339756965637,
-0.3581569194793701,
-0.21114614605903625,
-0.48099395632743835,
0.005052655935287476,
0.3630102276802063,
0.09488177299499512,
-0.3283947706222534,
0.10067817568778992,
-0.2559230327606201,
-0.03734581917524338,
0.09946499764919281,
0.45040613412857056,
-0.105208620429039,
-0.46152210235595703,
0.11733666062355042,
-0.25243571400642395
] |
https://github.com/huggingface/datasets/issues/5651 | Hello,
It says `save_to_disk` is deprecated in 2.8.0, so the alternative to this will be `storage_options`?
https://huggingface.co/docs/datasets/package_reference/main_classes#datasets.Dataset.save_to_disk | expanduser in save_to_disk | ### Describe the bug
save_to_disk() does not expand `~`
1. `dataset = load_datasets("any dataset")`
2. `dataset.save_to_disk("~/data")`
3. a folder named "~" created in current folder
4. FileNotFoundError is raised, because the expanded path does not exist (`/home/<user>/data`)
related issue https://github.com/huggingface/transformers/issues/10628
### Steps to reproduce the bug
As described above.
### Expected behavior
expanduser correctly
### Environment info
- datasets 2.10.1
- python 3.10 | 17 | expanduser in save_to_disk
### Describe the bug
save_to_disk() does not expand `~`
1. `dataset = load_datasets("any dataset")`
2. `dataset.save_to_disk("~/data")`
3. a folder named "~" created in current folder
4. FileNotFoundError is raised, because the expanded path does not exist (`/home/<user>/data`)
related issue https://github.com/huggingface/transformers/issues/10628
### Steps to reproduce the bug
As described above.
### Expected behavior
expanduser correctly
### Environment info
- datasets 2.10.1
- python 3.10
Hello,
It says `save_to_disk` is deprecated in 2.8.0, so the alternative to this will be `storage_options`?
https://huggingface.co/docs/datasets/package_reference/main_classes#datasets.Dataset.save_to_disk | [
-0.14264874160289764,
-0.273425430059433,
0.08651530742645264,
0.28257906436920166,
0.5655992031097412,
0.011892750859260559,
0.2978208363056183,
0.001508474349975586,
-0.016337838023900986,
0.1727750301361084,
-0.26282215118408203,
0.012623298913240433,
-0.23922722041606903,
-0.10301680862903595,
0.23597502708435059,
-0.32273465394973755,
0.3444603681564331,
0.02565961703658104,
-0.49540793895721436,
-0.059811390936374664,
-0.28673845529556274,
0.2256201058626175,
0.049675002694129944,
0.11046130955219269,
-0.37248462438583374,
0.0640362799167633,
-0.3601689040660858,
0.3275560438632965,
0.3156563639640808,
-0.008837226778268814,
0.27159059047698975,
-0.1584116369485855,
0.15471281111240387,
0.41877883672714233,
-0.00012154933210695162,
0.09267529845237732,
0.22642585635185242,
0.08246998488903046,
-0.32607775926589966,
-0.43419909477233887,
0.1128029078245163,
-0.0043975114822387695,
0.0624050498008728,
-0.08332344889640808,
0.009051471948623657,
0.08387860655784607,
0.17431378364562988,
-0.0996636301279068,
0.3709958791732788,
-0.10806597024202347,
0.19701030850410461,
0.2812032997608185,
0.23210179805755615,
-0.21927085518836975,
0.1524476706981659,
0.559649646282196,
-0.11619008332490921,
0.17287495732307434,
-0.13733507692813873,
-0.1758129894733429,
0.12175902724266052,
0.09985217452049255,
0.16586317121982574,
-0.4285186529159546,
0.5060605406761169,
0.10452461242675781,
0.16738417744636536,
-0.19590991735458374,
-0.0412726029753685,
0.2736330032348633,
0.352906197309494,
-0.10754070430994034,
-0.6052959561347961,
-0.4026145935058594,
-0.1993686556816101,
0.12227044999599457,
0.42396315932273865,
0.06466683745384216,
-0.03809790313243866,
0.1304536759853363,
-0.3093482553958893,
-0.18000425398349762,
-0.13707461953163147,
0.28562211990356445,
-0.10532036423683167,
0.06963866949081421,
-0.350429892539978,
0.08378821611404419,
0.2959369421005249,
-0.34112828969955444,
-0.34317052364349365,
-0.21997830271720886,
0.026589008048176765,
-0.02938736043870449,
-0.07016173005104065,
-0.13181652128696442,
0.11240597069263458,
0.1293696016073227,
0.17865513265132904,
0.24381119012832642,
-0.12709614634513855,
-0.1449333131313324,
-0.06946288794279099,
-0.015430158004164696,
0.32369551062583923,
0.1431731879711151,
0.03546121343970299,
0.20009586215019226,
0.3393559157848358,
0.02598707750439644,
0.02257256954908371,
-0.09305672347545624,
0.08270664513111115,
-0.12502866983413696,
0.14907267689704895,
-0.41659513115882874,
0.3198917806148529,
0.22220377624034882,
-0.16163066029548645,
0.009714867919683456,
0.11028440296649933,
0.022333551198244095,
0.0952649936079979,
0.33178144693374634,
-0.08858925104141235,
-0.20325803756713867,
0.014287710189819336,
0.3225061595439911,
0.046878039836883545,
0.3685075640678406,
-0.3270886540412903,
-0.035458050668239594,
-0.013339497148990631,
0.06080010533332825,
-0.029735945165157318,
-0.3063206672668457,
0.24879050254821777,
-0.08614236861467361,
-0.07364990562200546,
-0.13505765795707703,
-0.23611874878406525,
-0.043220605701208115,
0.1319928765296936,
0.23942974209785461,
-0.1443544626235962,
0.07557155936956406,
-0.0027384599670767784,
-0.31292736530303955,
-0.0003667473793029785,
0.07773443311452866,
0.05130036547780037,
-0.3630533814430237,
-0.37395143508911133,
0.10589313507080078,
-0.4260360598564148,
0.011375665664672852,
-0.23942777514457703,
-0.06286569684743881,
0.08384712785482407,
-0.11590265482664108,
-0.05215603485703468,
0.15395234525203705,
-0.13049863278865814,
-0.20552468299865723,
0.45143914222717285,
0.5706250071525574,
0.28116074204444885,
-0.23652538657188416,
-0.1235036551952362,
-0.011621663346886635,
-0.09783409535884857,
0.3307223916053772,
-0.05297239497303963,
0.3828589916229248,
-0.552534818649292,
0.1485540121793747,
0.3226683437824249,
-0.23562584817409515,
-0.24296075105667114,
-0.006625905632972717,
-0.26168349385261536,
0.17317402362823486,
0.1075890064239502,
-0.2064950168132782,
0.12174911797046661,
-0.18684116005897522,
0.08300597965717316,
0.12640705704689026,
0.06437418609857559,
0.07580915838479996,
-0.29309648275375366,
-0.2606479823589325,
0.11690376698970795,
-0.18815520405769348,
-0.05178358778357506,
0.18064981698989868,
0.18608133494853973,
0.2512284517288208,
0.4978503882884979,
-0.18258073925971985,
0.2330131232738495,
0.40447795391082764,
0.32414793968200684,
0.14443223178386688,
-0.16244637966156006,
-0.18150731921195984,
-0.2884063422679901,
-0.0498836524784565,
0.0963044986128807,
-0.34057193994522095,
0.0910845696926117,
-0.21156905591487885,
-0.2772560715675354,
0.06085365265607834,
-0.07144825160503387,
0.0005902349948883057,
-0.018403060734272003,
0.09108655154705048,
0.31679975986480713,
0.02335464209318161,
-0.09365179389715195,
0.2823040187358856,
0.002215355634689331,
0.430921345949173,
-0.30080530047416687,
0.5507709980010986,
-0.003796212375164032,
-0.12984037399291992,
-0.2799910306930542,
0.22977033257484436,
0.2692981958389282,
-0.543441116809845,
0.012624364346265793,
0.4291730225086212,
-0.18506380915641785,
0.3585885763168335,
-0.2871718406677246,
0.036639511585235596,
0.3357120156288147,
-0.10412286967039108,
0.041190728545188904,
0.31644707918167114,
0.1488979309797287,
0.05163309723138809,
-0.5347707271575928,
0.11144135892391205,
0.05578663945198059,
0.03245215117931366,
0.0667046457529068,
0.1945604532957077,
-0.06494814902544022,
-0.11354492604732513,
0.1371341049671173,
-0.34740808606147766,
0.020824246108531952,
-0.10051089525222778,
0.26718670129776,
-0.12790657579898834,
-0.30540919303894043,
-0.15011197328567505,
0.0915510430932045,
-0.02650551125407219,
0.10530217736959457,
0.36864328384399414,
-0.3020782470703125,
0.019219346344470978,
0.17763260006904602,
0.2969110310077667,
0.4056362807750702,
0.10981768369674683,
0.19434621930122375,
0.10722216963768005,
0.3002680540084839,
-0.07899855822324753,
0.33365392684936523,
0.023030776530504227,
-0.06842562556266785,
0.19766885042190552,
-0.039628904312849045,
0.19617223739624023,
-0.35813963413238525,
0.03743235021829605,
-0.1067097932100296,
0.02239028923213482,
-0.5687759518623352,
-0.06122786924242973,
0.003055781126022339,
-0.1683238446712494,
-0.03167448192834854,
-0.18675753474235535,
-0.2407558560371399,
-0.25776296854019165,
-0.2667941451072693,
0.7977102994918823,
-0.3358987867832184,
-0.055744074285030365,
0.03749397397041321,
-0.1246633380651474,
-0.15927530825138092,
-0.02142428234219551,
-0.37190741300582886,
0.5694864392280579,
-0.06601792573928833,
-0.051399845629930496,
0.08986160159111023,
-0.4525335729122162,
-0.11549479514360428,
-0.06210901588201523,
0.27016544342041016,
-0.6176061034202576,
-0.407548189163208,
0.02611703984439373,
-0.1385549157857895,
0.25985193252563477,
0.27712830901145935,
-0.021784409880638123,
0.01303195208311081,
-0.15111449360847473,
0.16384589672088623,
-0.06205735728144646,
-0.010098140686750412,
0.14961203932762146,
0.40098151564598083,
-0.10633569955825806,
-0.1420811116695404,
-0.009323511272668839,
-0.2255803495645523,
-0.22858156263828278,
0.4505685269832611,
-0.07869625091552734,
-0.00042120926082134247,
0.4129371643066406,
0.1737714409828186,
0.08736523985862732,
-0.2952679991722107,
-0.09058891236782074,
-0.01930646039545536,
-0.20808443427085876,
0.4804903566837311,
-0.10330401360988617,
-0.3336336612701416,
-0.10820279270410538,
-0.2751157283782959,
-0.12699270248413086,
-0.25581979751586914,
-0.2942129969596863,
-0.0445551723241806,
-0.404758095741272,
0.12878796458244324,
-0.31541338562965393,
0.3753829300403595,
0.4789014458656311,
-0.0646379142999649,
0.0615726113319397,
0.019120588898658752,
-0.30188846588134766,
0.11168590188026428,
0.36494016647338867,
0.25657787919044495,
-0.40278252959251404,
0.048654891550540924,
-0.11899670958518982,
0.22897720336914062,
0.17353326082229614,
0.40550896525382996,
0.20196406543254852,
-0.0474567785859108,
0.5324333906173706,
-0.02436414733529091,
-0.3797334134578705,
0.17810051143169403,
0.04410472884774208,
-0.14448286592960358,
0.08546382188796997,
0.40480709075927734,
0.4000295400619507,
0.054735004901885986,
-0.36787015199661255,
-0.07192995399236679,
-0.5437737107276917,
-0.08742272108793259,
0.03325476869940758,
-0.07751216739416122,
0.13950935006141663,
0.12905341386795044,
-0.13020578026771545,
-0.07590168714523315,
-0.09221059828996658,
0.4208820164203644,
0.34386885166168213,
-0.045019764453172684,
-0.1497524529695511,
0.012540683150291443,
-0.3486563265323639,
0.26825010776519775,
0.02268533781170845,
0.009966108947992325,
0.05135778337717056,
-0.29588305950164795,
0.02260734885931015,
0.12074895948171616,
0.9362156391143799,
0.0850474014878273,
0.027405686676502228,
-0.14599531888961792,
-0.12984415888786316,
-0.6243669986724854,
-0.030940473079681396,
0.29785415530204773,
0.13588039577007294,
-0.07605842500925064,
0.9098863005638123,
0.030182957649230957,
-0.40590694546699524,
0.1703132838010788,
0.14275144040584564,
-0.14293959736824036,
-0.18734844028949738,
-0.08272723853588104,
-0.40766334533691406,
-0.06411194056272507,
-0.06256945431232452,
0.05097370594739914,
0.24221643805503845,
0.0929451733827591,
-0.19825956225395203,
-0.0719812884926796,
-0.18165959417819977,
0.06330087780952454,
-0.1287543773651123,
0.3921055495738983,
-0.1412462443113327,
0.16321611404418945,
-0.07880228012800217,
0.05484199896454811,
0.05594252794981003,
0.27819135785102844,
-0.03586535528302193,
-0.32394203543663025,
-0.038581304252147675,
-0.17746508121490479,
0.23750978708267212,
0.14546391367912292,
-0.11068204045295715,
-0.04126838594675064,
0.08848489075899124,
0.2940758764743805,
-0.4607698917388916,
-0.10838712751865387,
0.16107267141342163,
0.11225111037492752,
-0.03641938045620918,
-0.01904837042093277,
0.26183265447616577,
0.05740927904844284,
0.08920057117938995,
0.21246841549873352,
0.5250458121299744,
-0.22231531143188477,
0.186412513256073,
-0.1587231606245041,
0.8619299530982971,
0.26296526193618774,
0.3540699779987335,
0.16466806828975677,
-0.43289506435394287,
0.3712111711502075,
0.04854527860879898,
0.12456618994474411,
-0.4602542519569397,
-0.029900062829256058,
0.001574486494064331,
-0.004575416445732117,
0.16514675319194794,
-0.0981845036149025,
-0.2044655680656433,
-0.03404355049133301,
-0.24551764130592346,
0.1611441671848297,
-0.1414909064769745,
0.10068951547145844,
-0.29773807525634766,
-0.28733545541763306,
-0.12513694167137146,
0.12065118551254272,
0.15947109460830688,
0.4508868455886841,
-0.04646175727248192,
-0.16728006303310394,
-0.13728010654449463,
-0.22676292061805725,
-0.055581383407115936,
0.21036481857299805,
-0.2988907992839813,
-0.017216403037309647,
0.2905981242656708,
-0.39084315299987793,
0.28493133187294006,
0.463668555021286,
0.4259375035762787,
0.0952618196606636,
-0.2718363106250763,
-0.0934898853302002,
-0.49368566274642944,
0.25322356820106506,
-0.17175626754760742,
0.037861332297325134,
0.2897772789001465,
0.10184484720230103,
-0.1400044709444046,
-0.17850038409233093,
-0.19193631410598755,
-0.04137163236737251,
-0.08458031713962555,
0.09526479244232178,
0.032684437930583954,
-0.6734375357627869,
0.0207909494638443,
-0.06240076944231987,
-0.2076624184846878,
-0.3056955933570862,
0.05093687027692795,
0.1843823790550232,
-0.21720050275325775,
0.1870284080505371,
-0.2855675220489502,
-0.19807404279708862,
0.08637398481369019,
0.5752511024475098,
-0.3056797981262207,
0.23976463079452515,
0.40012285113334656,
-0.3538830280303955,
-0.03688320517539978,
-0.15835973620414734,
0.36876794695854187,
0.026212796568870544,
-0.4529745578765869,
0.4071946442127228,
-0.03595360368490219,
0.14439184963703156,
-0.21918456256389618,
0.21566154062747955,
0.26149076223373413,
-0.1029394268989563,
-0.027923740446567535,
-0.09417399764060974,
-0.3815007209777832,
-0.08775884658098221,
-0.014214049093425274,
-0.034070901572704315,
0.22160199284553528,
-0.09678160399198532,
0.16113857924938202,
-0.22586654126644135,
-0.23716115951538086,
-0.044532857835292816,
-0.062086548656225204,
-0.1685999631881714,
0.28095540404319763,
-0.24557414650917053,
0.3733503818511963,
-0.40036407113075256,
0.137926384806633,
-0.08285483717918396,
-0.1701027750968933,
-0.14887818694114685,
-0.2770059406757355,
0.14826704561710358,
0.260348916053772,
-0.06580644845962524,
-0.10514675080776215,
0.18419119715690613,
0.17174428701400757,
-0.24692706763744354,
0.2580524981021881,
0.3076461851596832,
0.10565796494483948,
0.21216751635074615,
-0.008652763441205025,
0.10590982437133789,
-0.23028945922851562,
0.0019684089347720146,
0.14130732417106628,
0.09346497058868408,
-0.32462817430496216,
0.084716796875,
-0.1539502888917923,
-0.14150908589363098,
-0.24187283217906952,
0.08179493248462677,
0.18625986576080322,
-0.046482548117637634,
0.3472628593444824,
-0.05496188998222351,
-0.32001417875289917,
-0.018972545862197876,
0.3121735453605652,
0.23437650501728058,
-0.05304983630776405,
0.12005580216646194,
0.30538222193717957,
0.09522859752178192,
0.033833540976047516,
0.007970478385686874,
0.21686744689941406,
0.0358300656080246,
0.06119982898235321,
0.18922913074493408,
-0.10244964808225632,
-0.169691264629364,
0.04964388906955719,
0.06107105687260628,
0.44849756360054016,
-0.032131701707839966,
0.25818416476249695,
0.5621897578239441,
-0.2654809355735779,
0.2711487412452698,
0.5216841101646423,
0.08318869024515152,
0.26694387197494507,
0.24876566231250763,
-0.1811881959438324,
0.04779038578271866,
-0.3210727870464325,
0.05327789857983589,
0.17091412842273712,
-0.30410921573638916,
0.1879543662071228,
-0.25330650806427,
-0.015502538532018661,
0.07540805637836456,
-0.19196218252182007,
0.4761299192905426,
-0.6184008717536926,
0.03308245167136192,
-0.10623429715633392,
-0.015566881746053696,
-0.3002934455871582,
-0.12437190115451813,
0.23089134693145752,
-0.05538017302751541,
0.12540581822395325,
-0.1312381625175476,
-0.18319544196128845,
-0.5385612845420837,
0.1681453138589859,
-0.11517862975597382,
0.08227339386940002,
0.07125721871852875,
0.01703980565071106,
0.2534645199775696,
0.058566294610500336,
-0.2662148177623749,
0.1536942571401596,
0.260873407125473,
-0.17986240983009338,
-0.1944369375705719,
0.6993910074234009,
0.42644408345222473,
0.022825822234153748,
0.21483838558197021,
0.12419666349887848,
0.023262623697519302,
-0.11588014662265778,
0.023331083357334137,
0.20324334502220154,
-0.2432703822851181,
0.22434136271476746,
0.23217087984085083,
0.13930663466453552,
-0.06254389882087708,
0.3602614104747772,
-0.04757220670580864,
0.2252967655658722,
-0.4767686724662781,
0.34186169505119324,
-0.3156488835811615,
-0.44323742389678955,
-0.11371271312236786,
-0.22667433321475983,
-0.195749893784523,
0.1286381185054779,
0.43283072113990784,
-0.12019193172454834,
0.17958420515060425,
-0.040820345282554626,
0.029800131916999817,
0.3292471468448639,
0.0169744361191988,
0.3395980894565582,
-0.33697789907455444,
-0.11896394193172455,
-0.03842902183532715,
-0.3286444842815399,
0.08713792264461517,
0.24798522889614105,
-0.01108541339635849,
0.02135409414768219,
0.061404600739479065,
-0.17465685307979584,
-0.18934738636016846,
0.1368063986301422,
-0.003583032637834549,
-0.027261003851890564,
0.19120174646377563,
0.09672871232032776,
0.011863334104418755,
0.11080877482891083,
0.0670991912484169,
0.22999773919582367,
-0.23304902017116547,
0.2502036988735199,
0.1554677039384842,
0.007336564362049103,
-0.11944961547851562,
0.46651363372802734,
-0.34065353870391846,
-0.1001313179731369,
0.4292028248310089,
0.17795364558696747,
-0.1356467604637146,
-0.1616663634777069,
0.04161682724952698,
-0.14450164139270782,
0.023771528154611588,
-0.28297916054725647,
-0.06752738356590271,
-0.1686837524175644,
0.4834505319595337,
-0.3344722092151642,
-0.30291908979415894,
-0.20660468935966492,
-0.05150030925869942,
0.26879948377609253,
0.1316678524017334,
0.061706893146038055,
0.3895096480846405,
-0.3034246861934662,
-0.0517316497862339,
0.5097033381462097,
0.26178842782974243,
-0.20409554243087769,
0.12565380334854126,
-0.3219984769821167,
-0.42251402139663696,
0.47786587476730347,
-0.14010486006736755,
-0.28226110339164734,
-0.09745614975690842,
0.3095461130142212,
0.131034255027771,
-0.35903221368789673,
-0.3754001259803772,
-0.032811254262924194,
0.3382444381713867,
0.07806166261434555,
0.05555431544780731,
0.21336883306503296,
-0.40415722131729126,
-0.14337721467018127,
0.0660407543182373,
0.667876124382019,
0.4116937518119812,
-0.058872878551483154,
0.34721243381500244,
-0.178569495677948
] |
https://github.com/huggingface/datasets/issues/5651 | @ashikshafi08 I think you misunderstood the warning. The method `save_to_disk` is not deprecated only the optional parameter `fs`.
Also @benjaminbrown038 as I cannot find your PR I would like to work on this if you don't mind. | expanduser in save_to_disk | ### Describe the bug
save_to_disk() does not expand `~`
1. `dataset = load_datasets("any dataset")`
2. `dataset.save_to_disk("~/data")`
3. a folder named "~" created in current folder
4. FileNotFoundError is raised, because the expanded path does not exist (`/home/<user>/data`)
related issue https://github.com/huggingface/transformers/issues/10628
### Steps to reproduce the bug
As described above.
### Expected behavior
expanduser correctly
### Environment info
- datasets 2.10.1
- python 3.10 | 37 | expanduser in save_to_disk
### Describe the bug
save_to_disk() does not expand `~`
1. `dataset = load_datasets("any dataset")`
2. `dataset.save_to_disk("~/data")`
3. a folder named "~" created in current folder
4. FileNotFoundError is raised, because the expanded path does not exist (`/home/<user>/data`)
related issue https://github.com/huggingface/transformers/issues/10628
### Steps to reproduce the bug
As described above.
### Expected behavior
expanduser correctly
### Environment info
- datasets 2.10.1
- python 3.10
@ashikshafi08 I think you misunderstood the warning. The method `save_to_disk` is not deprecated only the optional parameter `fs`.
Also @benjaminbrown038 as I cannot find your PR I would like to work on this if you don't mind. | [
-0.25514593720436096,
-0.28579622507095337,
0.08033251017332077,
0.1457454115152359,
0.5986451506614685,
-0.061253517866134644,
0.3984640836715698,
0.04652600362896919,
-0.06246251240372658,
0.2774219512939453,
-0.22879323363304138,
-0.00004668533802032471,
-0.2396613508462906,
-0.16584624350070953,
0.06488986313343048,
-0.26262834668159485,
0.3703494668006897,
0.07368741184473038,
-0.5676891207695007,
-0.09139824658632278,
-0.3248838186264038,
0.25112229585647583,
0.030192911624908447,
0.3014957308769226,
-0.3697739839553833,
0.04498346149921417,
-0.2849207818508148,
0.3461899161338806,
0.2378566563129425,
-0.07648004591464996,
0.25495147705078125,
-0.16239459812641144,
0.18260955810546875,
0.5833312273025513,
-0.00011850459850393236,
0.18761369585990906,
0.33965635299682617,
0.008718915283679962,
-0.27836525440216064,
-0.34798407554626465,
0.1668391227722168,
-0.08412297070026398,
0.06746421009302139,
-0.2064918577671051,
-0.08771621435880661,
-0.055031560361385345,
0.14247025549411774,
-0.09013339877128601,
0.4986172020435333,
-0.042555369436740875,
0.22511103749275208,
0.3293207287788391,
0.17474940419197083,
-0.23922981321811676,
0.14152292907238007,
0.48825758695602417,
-0.157578244805336,
-0.015699267387390137,
-0.19129666686058044,
-0.20895065367221832,
0.10334107279777527,
0.14203792810440063,
0.113606758415699,
-0.40500789880752563,
0.43683308362960815,
0.13324221968650818,
0.27823248505592346,
-0.21569061279296875,
-0.061486244201660156,
0.2819112241268158,
0.5084444284439087,
-0.057142551988363266,
-0.6553539633750916,
-0.3015764355659485,
-0.2881036698818207,
0.1084875538945198,
0.3254600763320923,
-0.051484160125255585,
-0.1410333812236786,
0.23532703518867493,
-0.19461789727210999,
-0.19487828016281128,
-0.20161718130111694,
0.1905340552330017,
-0.13357841968536377,
0.20410983264446259,
-0.3422805964946747,
0.11395041644573212,
0.2570042908191681,
-0.3386525809764862,
-0.1850615292787552,
-0.19414326548576355,
0.07687585055828094,
-0.09722040593624115,
-0.09066465497016907,
-0.2865249514579773,
0.050379469990730286,
-0.094750314950943,
0.17052946984767914,
0.23468896746635437,
-0.05508938431739807,
-0.1561852991580963,
-0.04864044487476349,
0.022957004606723785,
0.23615163564682007,
0.0422629676759243,
0.009571637958288193,
0.19514966011047363,
0.47348546981811523,
-0.06563717871904373,
0.1254713535308838,
-0.12563395500183105,
0.05929112806916237,
-0.2319137454032898,
0.17852362990379333,
-0.19298161566257477,
0.44892221689224243,
0.13381539285182953,
-0.1617109477519989,
-0.11061012744903564,
0.1701914668083191,
0.010675594210624695,
0.005950868129730225,
0.36181771755218506,
-0.027483582496643066,
-0.09683050215244293,
-0.03413555771112442,
0.26017943024635315,
0.03543705493211746,
0.24390412867069244,
-0.3036949336528778,
-0.0375354178249836,
-0.10762295871973038,
-0.05718761682510376,
-0.06612356752157211,
-0.1875355988740921,
0.23403114080429077,
-0.17335918545722961,
-0.0889594554901123,
-0.012614168226718903,
-0.1827443242073059,
-0.0780230239033699,
0.2505177855491638,
0.3524205684661865,
-0.19709688425064087,
0.06304159760475159,
0.0589207261800766,
-0.21834906935691833,
-0.04597257822751999,
0.21825118362903595,
-0.004360748454928398,
-0.48305365443229675,
-0.4583938419818878,
0.13254161179065704,
-0.36792200803756714,
-0.007046130020171404,
-0.16981492936611176,
-0.11160124838352203,
0.1807277798652649,
-0.20474383234977722,
-0.03191189840435982,
0.07651402056217194,
-0.13185521960258484,
-0.22032850980758667,
0.306289941072464,
0.6485587358474731,
0.14909487962722778,
-0.15703022480010986,
-0.11443786323070526,
-0.16203337907791138,
-0.022662773728370667,
0.46271008253097534,
-0.22035187482833862,
0.3293898105621338,
-0.49034830927848816,
0.175475612282753,
0.3639084994792938,
-0.1802314966917038,
-0.20260003209114075,
0.09816966950893402,
-0.2085767537355423,
0.11168576031923294,
0.14186257123947144,
-0.20803560316562653,
0.1364232301712036,
-0.35603150725364685,
-0.006373479962348938,
0.06304720044136047,
0.10589927434921265,
0.11877405643463135,
-0.27295422554016113,
-0.3211662471294403,
0.23152250051498413,
-0.21883846819400787,
0.0852959156036377,
0.2683023512363434,
0.2200453132390976,
0.28596043586730957,
0.460915207862854,
-0.2839130163192749,
0.2232361137866974,
0.39947211742401123,
0.3273968994617462,
0.06664921343326569,
-0.11779642105102539,
-0.1625329852104187,
-0.35652610659599304,
-0.06657669693231583,
0.12949718534946442,
-0.2892914414405823,
0.060235343873500824,
-0.28477537631988525,
-0.25908535718917847,
0.090693399310112,
-0.07759924232959747,
0.09614291042089462,
0.03948162496089935,
0.047214046120643616,
0.24093960225582123,
-0.04910796880722046,
-0.09016312658786774,
0.28238824009895325,
-0.056562405079603195,
0.379295289516449,
-0.25576770305633545,
0.5259210467338562,
-0.14734938740730286,
-0.11432206630706787,
-0.23557621240615845,
0.09365981817245483,
0.33794596791267395,
-0.5089001655578613,
-0.03557576239109039,
0.44172608852386475,
-0.09200181812047958,
0.24431169033050537,
-0.25007128715515137,
0.1399141103029251,
0.22460927069187164,
-0.11874429881572723,
0.1271815299987793,
0.48530563712120056,
0.12585234642028809,
0.15855421125888824,
-0.5564214587211609,
0.07390477508306503,
0.030817147344350815,
-0.08036219328641891,
0.057399682700634,
0.12312128394842148,
0.08288945257663727,
-0.11042580008506775,
0.03526090830564499,
-0.1865053027868271,
-0.12170965224504471,
0.032260991632938385,
0.07250973582267761,
-0.1208825409412384,
-0.23415875434875488,
-0.26589077711105347,
0.1711360365152359,
-0.1519426703453064,
0.15183274447917938,
0.4172302186489105,
-0.2017439603805542,
-0.045529674738645554,
0.17868132889270782,
0.3392629027366638,
0.5612231492996216,
0.1250159740447998,
0.2465236335992813,
0.026206618174910545,
0.26536911725997925,
-0.106734998524189,
0.3391138017177582,
0.10543674230575562,
-0.013202760368585587,
0.33114248514175415,
-0.0974263995885849,
0.24658803641796112,
-0.41766616702079773,
-0.017055854201316833,
-0.057640910148620605,
0.07875877618789673,
-0.4960421323776245,
-0.015140049159526825,
0.016050055623054504,
-0.13488970696926117,
0.02165713906288147,
-0.09434309601783752,
-0.191379576921463,
-0.19835306704044342,
-0.21474863588809967,
0.6907285451889038,
-0.392838716506958,
0.06857319921255112,
0.07517402619123459,
-0.02003982663154602,
-0.05588400736451149,
-0.07642320543527603,
-0.442339688539505,
0.4893009066581726,
-0.018395449966192245,
-0.011117760092020035,
0.0109810009598732,
-0.4356536567211151,
-0.10637116432189941,
0.10405683517456055,
0.2523128092288971,
-0.6758660674095154,
-0.41058090329170227,
-0.021541275084018707,
-0.14550720155239105,
0.20625847578048706,
0.2879661023616791,
0.0568745993077755,
0.1590283364057541,
-0.13765542209148407,
0.06268283724784851,
-0.26648080348968506,
-0.08349786698818207,
0.06808364391326904,
0.3108121156692505,
-0.13069051504135132,
-0.24960051476955414,
-0.12361656129360199,
-0.32649606466293335,
-0.34583669900894165,
0.26501700282096863,
-0.12593312561511993,
-0.0010092351585626602,
0.4938291907310486,
0.21304301917552948,
0.04643292352557182,
-0.07978099584579468,
-0.15406037867069244,
-0.08808287233114243,
-0.0884827971458435,
0.4637301564216614,
-0.13712400197982788,
-0.41215136647224426,
-0.04267120361328125,
-0.24241510033607483,
-0.10111190378665924,
-0.18516378104686737,
-0.2482982724905014,
-0.09288688004016876,
-0.34224268794059753,
0.11021386086940765,
-0.290931761264801,
0.3844788074493408,
0.587197482585907,
0.01404477283358574,
-0.014466200023889542,
-0.003948286175727844,
-0.2863093614578247,
0.03293536230921745,
0.32803764939308167,
0.22802598774433136,
-0.34721431136131287,
0.11087605357170105,
-0.09587232023477554,
0.36721035838127136,
0.1274527609348297,
0.3326866626739502,
0.2530820965766907,
0.013915842399001122,
0.565282940864563,
-0.07994767278432846,
-0.2805083990097046,
0.06439784169197083,
0.009212270379066467,
-0.16654227674007416,
0.03319212794303894,
0.2569194436073303,
0.2509097754955292,
0.08862533420324326,
-0.3526279926300049,
-0.0379609651863575,
-0.4987544119358063,
-0.07212954759597778,
0.04512283578515053,
-0.07227520644664764,
0.17496372759342194,
0.1238889992237091,
-0.12087513506412506,
-0.019756168127059937,
0.02873716503381729,
0.5014553070068359,
0.321181058883667,
-0.08464665710926056,
-0.2134656310081482,
0.12680791318416595,
-0.31083348393440247,
0.3126142621040344,
0.029136832803487778,
0.08940111100673676,
0.03253598511219025,
-0.3510713279247284,
-0.030196990817785263,
0.048018310219049454,
0.8232337236404419,
-0.09470994025468826,
-0.1005096435546875,
-0.07436695694923401,
-0.06850239634513855,
-0.5215990543365479,
-0.07638685405254364,
0.1999986171722412,
0.06491605937480927,
-0.08353739231824875,
0.8201033473014832,
-0.06617198884487152,
-0.5095383524894714,
0.23602381348609924,
0.050755780190229416,
-0.1356402039527893,
-0.086100734770298,
-0.2528302073478699,
-0.46184784173965454,
-0.19726812839508057,
-0.043548159301280975,
0.16320788860321045,
0.08845816552639008,
-0.10767575353384018,
-0.10976409912109375,
-0.1009923443198204,
-0.1520368605852127,
0.06569027155637741,
-0.06051105260848999,
0.3389703035354614,
-0.12870481610298157,
0.033812060952186584,
-0.11132624745368958,
0.1158318817615509,
-0.0009086523205041885,
0.24653057754039764,
-0.06798911094665527,
-0.3317564129829407,
0.0814068391919136,
-0.14787398278713226,
0.24895262718200684,
0.24295932054519653,
-0.13724228739738464,
-0.021555237472057343,
-0.018575001507997513,
0.3048836588859558,
-0.3263170123100281,
-0.09639370441436768,
0.21462631225585938,
0.08790843188762665,
-0.0874326080083847,
-0.010600216686725616,
0.26783543825149536,
0.017798587679862976,
0.0010766386985778809,
0.16574659943580627,
0.4359239637851715,
-0.1798802763223648,
0.31609228253364563,
-0.08145613968372345,
0.9760724306106567,
0.20044437050819397,
0.4520587623119354,
0.23027914762496948,
-0.327065646648407,
0.34213417768478394,
0.03154938668012619,
0.10827973484992981,
-0.441927969455719,
-0.05777152627706528,
-0.05988054722547531,
0.023736171424388885,
0.31585371494293213,
-0.07046252489089966,
-0.33948472142219543,
0.02567126601934433,
-0.23270347714424133,
0.1673920750617981,
-0.16051296889781952,
0.16089266538619995,
-0.1672135293483734,
-0.2597975432872772,
-0.17288869619369507,
0.14954231679439545,
0.17134258151054382,
0.4760589599609375,
-0.09010207653045654,
-0.2182483971118927,
-0.10342153161764145,
-0.30092066526412964,
-0.02272029221057892,
0.27143794298171997,
-0.1408807933330536,
0.13084186613559723,
0.2237059772014618,
-0.3248729705810547,
0.34266531467437744,
0.44880202412605286,
0.5234724283218384,
0.1708613932132721,
-0.26576513051986694,
-0.09069301187992096,
-0.582899808883667,
0.21190151572227478,
-0.23122356832027435,
0.064993716776371,
0.30769503116607666,
0.02890874445438385,
-0.21120065450668335,
-0.07561343908309937,
-0.1741582155227661,
-0.1819596141576767,
-0.04951469600200653,
0.04747556149959564,
0.11025620996952057,
-0.6989846229553223,
0.08820679038763046,
-0.03243882581591606,
-0.3401455581188202,
-0.25221532583236694,
0.08478182554244995,
0.15107080340385437,
-0.26761457324028015,
0.22723889350891113,
-0.26294705271720886,
-0.20798957347869873,
0.0984344631433487,
0.44341444969177246,
-0.18028868734836578,
0.17832782864570618,
0.40495651960372925,
-0.35273605585098267,
-0.050655193626880646,
-0.24611273407936096,
0.26025259494781494,
-0.005051475018262863,
-0.4648074507713318,
0.36165565252304077,
-0.017799124121665955,
0.046500980854034424,
-0.12061341106891632,
0.2700730562210083,
0.22260341048240662,
-0.04160558432340622,
-0.11502273380756378,
-0.0057183802127838135,
-0.36530524492263794,
-0.05942018702626228,
-0.08530830591917038,
0.1496531367301941,
0.20275579392910004,
-0.1568281203508377,
0.20018434524536133,
-0.3186439573764801,
-0.2903635799884796,
0.05334164947271347,
-0.04878734424710274,
-0.08729911595582962,
0.31491559743881226,
-0.3724110722541809,
0.35471758246421814,
-0.376809298992157,
0.12315492331981659,
-0.03730900213122368,
-0.2634158134460449,
-0.16361042857170105,
-0.2740939259529114,
0.151436910033226,
0.2763768136501312,
-0.07097005844116211,
-0.16217151284217834,
0.1426103711128235,
0.08465062081813812,
-0.13204605877399445,
0.2737308144569397,
0.3338077664375305,
0.09519076347351074,
0.3254839777946472,
0.05440903082489967,
0.07454301416873932,
-0.21473629772663116,
0.02635687217116356,
0.13199740648269653,
0.16937275230884552,
-0.31224995851516724,
0.06256905198097229,
-0.11748099327087402,
-0.16195914149284363,
-0.32502907514572144,
0.19924379885196686,
0.3060053586959839,
0.07063435763120651,
0.38644909858703613,
-0.10719333589076996,
-0.32791635394096375,
-0.1042575091123581,
0.3191941976547241,
0.23761630058288574,
-0.11652668565511703,
0.01044280081987381,
0.3484514057636261,
0.16060559451580048,
-0.09064672142267227,
-0.09801214188337326,
0.23745593428611755,
0.051604535430669785,
0.047078125178813934,
0.2260909527540207,
-0.0496208481490612,
-0.12049149721860886,
0.25597527623176575,
0.12201917171478271,
0.4632595479488373,
-0.17373976111412048,
0.2575993835926056,
0.5764228701591492,
-0.24891938269138336,
0.2828867435455322,
0.5213070511817932,
0.04981352388858795,
0.29718083143234253,
0.4282013475894928,
-0.15430186688899994,
0.07464062422513962,
-0.28032219409942627,
0.02081994339823723,
0.0575258731842041,
-0.34350985288619995,
0.21906554698944092,
-0.2822646498680115,
-0.07585583627223969,
0.0515596866607666,
-0.11030209064483643,
0.234165757894516,
-0.48070651292800903,
0.02189469337463379,
-0.21125853061676025,
0.00822556484490633,
-0.3420969545841217,
-0.12566348910331726,
0.2698321044445038,
0.04446469247341156,
0.14626383781433105,
-0.17346054315567017,
-0.15430425107479095,
-0.3784966468811035,
0.14801152050495148,
-0.07303120195865631,
0.10711302608251572,
0.2250973880290985,
0.1137738823890686,
0.18718589842319489,
0.11462071537971497,
-0.2668343484401703,
0.08316565304994583,
0.2547604441642761,
-0.1800621598958969,
-0.20005595684051514,
0.6457419991493225,
0.5019462704658508,
0.12310084700584412,
0.23937886953353882,
0.10276859998703003,
0.015153329819440842,
-0.1101817786693573,
0.10526388883590698,
0.27462485432624817,
-0.18037977814674377,
0.35480353236198425,
0.2833949029445648,
0.15200501680374146,
-0.10074383020401001,
0.33019256591796875,
-0.05328788980841637,
0.15689310431480408,
-0.47272393107414246,
0.38442516326904297,
-0.17844636738300323,
-0.5038381218910217,
-0.18163883686065674,
-0.1405603587627411,
-0.27702105045318604,
0.11711759120225906,
0.48561233282089233,
-0.09493198990821838,
0.28478068113327026,
-0.09700753539800644,
0.056209273636341095,
0.2987150549888611,
0.10397927463054657,
0.3199797570705414,
-0.30059024691581726,
-0.2541053593158722,
0.1174338310956955,
-0.4569903612136841,
0.05175713822245598,
0.23320458829402924,
0.08418159931898117,
-0.033879123628139496,
0.12479265034198761,
-0.1203257143497467,
-0.025091763585805893,
0.052022628486156464,
-0.06772279739379883,
-0.06762424111366272,
0.1473904401063919,
0.041826918721199036,
0.059441085904836655,
0.1168450191617012,
0.05755332112312317,
0.19047001004219055,
-0.4605236351490021,
0.27842476963996887,
0.15602119266986847,
0.018917247653007507,
-0.08775509148836136,
0.3876257538795471,
-0.25993573665618896,
-0.07182911783456802,
0.40143758058547974,
0.18266688287258148,
-0.0027595385909080505,
-0.18010473251342773,
0.004499562084674835,
-0.13903455436229706,
-0.0262368805706501,
-0.3073076605796814,
-0.14360535144805908,
0.03315451368689537,
0.45251360535621643,
-0.31222131848335266,
-0.16193857789039612,
-0.2685328423976898,
-0.0769965797662735,
0.24410033226013184,
0.2155519276857376,
-0.012596920132637024,
0.38581353425979614,
-0.274882972240448,
-0.057357270270586014,
0.3585246801376343,
0.19926977157592773,
-0.1412714719772339,
0.08745738118886948,
-0.4273211359977722,
-0.37130415439605713,
0.5691514015197754,
-0.13612936437129974,
-0.3551632761955261,
-0.1716442108154297,
0.31094932556152344,
0.08511362969875336,
-0.26421231031417847,
-0.4280731678009033,
0.09464876353740692,
0.27304860949516296,
0.05810406431555748,
-0.06134328246116638,
0.24488939344882965,
-0.3044281303882599,
-0.18356087803840637,
0.056981056928634644,
0.5920590162277222,
0.27842816710472107,
-0.07219301909208298,
0.27919524908065796,
-0.24472585320472717
] |
https://github.com/huggingface/datasets/issues/5651 | @mariosasko It's been several months and the PR is not reviewed. Could you please take a look? I assume this is not complicated and could be merged fairly soon. | expanduser in save_to_disk | ### Describe the bug
save_to_disk() does not expand `~`
1. `dataset = load_datasets("any dataset")`
2. `dataset.save_to_disk("~/data")`
3. a folder named "~" created in current folder
4. FileNotFoundError is raised, because the expanded path does not exist (`/home/<user>/data`)
related issue https://github.com/huggingface/transformers/issues/10628
### Steps to reproduce the bug
As described above.
### Expected behavior
expanduser correctly
### Environment info
- datasets 2.10.1
- python 3.10 | 29 | expanduser in save_to_disk
### Describe the bug
save_to_disk() does not expand `~`
1. `dataset = load_datasets("any dataset")`
2. `dataset.save_to_disk("~/data")`
3. a folder named "~" created in current folder
4. FileNotFoundError is raised, because the expanded path does not exist (`/home/<user>/data`)
related issue https://github.com/huggingface/transformers/issues/10628
### Steps to reproduce the bug
As described above.
### Expected behavior
expanduser correctly
### Environment info
- datasets 2.10.1
- python 3.10
@mariosasko It's been several months and the PR is not reviewed. Could you please take a look? I assume this is not complicated and could be merged fairly soon. | [
-0.13998648524284363,
-0.30963942408561707,
0.10560639947652817,
0.3240334391593933,
0.577688455581665,
-0.023360684514045715,
0.37770694494247437,
-0.03220584616065025,
-0.06492868065834045,
0.20577020943164825,
-0.12886083126068115,
-0.05877376347780228,
-0.19510626792907715,
-0.11477270722389221,
0.19137471914291382,
-0.3719925880432129,
0.3715738356113434,
0.004890337586402893,
-0.5357912182807922,
-0.09647811949253082,
-0.2780686318874359,
0.1895061433315277,
0.01235152781009674,
0.16766014695167542,
-0.4251340627670288,
0.10954602807760239,
-0.363456130027771,
0.33537352085113525,
0.3951498568058014,
0.08155383914709091,
0.2764202356338501,
-0.2005559802055359,
0.15533189475536346,
0.5242718458175659,
-0.0001242491416633129,
0.0954030230641365,
0.279486745595932,
0.10084062069654465,
-0.22426241636276245,
-0.3891560435295105,
0.08895555138587952,
-0.07398611307144165,
0.01248190551996231,
-0.08252891153097153,
0.023293979465961456,
0.020464953035116196,
0.15136288106441498,
-0.07218676805496216,
0.3700346350669861,
-0.08504348993301392,
0.1676921248435974,
0.33271872997283936,
0.10388445854187012,
-0.21784156560897827,
0.18711504340171814,
0.5377848148345947,
-0.1421651393175125,
-0.0520605593919754,
-0.14589954912662506,
-0.26099085807800293,
0.20091083645820618,
0.06770655512809753,
0.2100035548210144,
-0.5109968185424805,
0.48772290349006653,
0.10297483205795288,
0.2333584725856781,
-0.2784176170825958,
-0.05865471810102463,
0.34625735878944397,
0.4960246980190277,
-0.03660687059164047,
-0.5775269269943237,
-0.3232744336128235,
-0.27021920680999756,
0.23173263669013977,
0.41626062989234924,
0.06741978973150253,
-0.006088465452194214,
0.1578064262866974,
-0.26518017053604126,
-0.1134844571352005,
-0.1460050344467163,
0.24359025061130524,
-0.23228828608989716,
0.17610636353492737,
-0.22164395451545715,
0.08320049196481705,
0.21168279647827148,
-0.33950039744377136,
-0.17233571410179138,
-0.27708813548088074,
0.04672687500715256,
-0.055567558854818344,
-0.12892645597457886,
-0.14746752381324768,
0.05747803673148155,
-0.032283179461956024,
0.1282806694507599,
0.2504463791847229,
-0.07465493679046631,
-0.1877235323190689,
-0.09390808641910553,
-0.03127959743142128,
0.3823220133781433,
0.10805584490299225,
0.022652488201856613,
0.32899966835975647,
0.4451945126056671,
-0.13880321383476257,
-0.014282897114753723,
-0.0303872711956501,
0.039491720497608185,
-0.15291249752044678,
0.19167298078536987,
-0.3409710228443146,
0.3041726350784302,
0.2265271544456482,
-0.09173440933227539,
0.0016079694032669067,
0.07984736561775208,
0.025706831365823746,
0.06968080997467041,
0.30508098006248474,
-0.09751909971237183,
-0.0812920480966568,
-0.02457963302731514,
0.3097801208496094,
0.12178835272789001,
0.32794204354286194,
-0.34313830733299255,
-0.07003779709339142,
-0.05657076835632324,
0.012595336884260178,
-0.041353490203619,
-0.15073660016059875,
0.22338037192821503,
-0.12203045934438705,
-0.1335439383983612,
-0.11662205308675766,
-0.14986130595207214,
-0.03355223685503006,
0.17144766449928284,
0.3168894350528717,
-0.1494017094373703,
0.13500767946243286,
-0.033130157738924026,
-0.23445086181163788,
0.01222410798072815,
0.24946382641792297,
0.041718967258930206,
-0.30910390615463257,
-0.34422144293785095,
0.09782829880714417,
-0.4916817545890808,
-0.015855107456445694,
-0.20241691172122955,
-0.15568751096725464,
0.1740543693304062,
-0.17751646041870117,
-0.042244862765073776,
0.045116718858480453,
-0.08064717054367065,
-0.2382114827632904,
0.38117173314094543,
0.5450645685195923,
0.1849629431962967,
-0.1688886284828186,
-0.12168927490711212,
-0.0156754981726408,
-0.026320382952690125,
0.4042590856552124,
-0.08711625635623932,
0.4646037817001343,
-0.5448360443115234,
0.2747352719306946,
0.35815343260765076,
-0.2616134583950043,
-0.3219919204711914,
-0.01393158733844757,
-0.28593266010284424,
0.1707695722579956,
0.18510714173316956,
-0.15451481938362122,
0.11575192213058472,
-0.2767196297645569,
0.0028523411601781845,
0.25508400797843933,
0.01715630479156971,
0.14790648221969604,
-0.31635308265686035,
-0.22778131067752838,
0.21531079709529877,
-0.1867913007736206,
0.021068507805466652,
0.20881237089633942,
0.1919899433851242,
0.2261468768119812,
0.4850582778453827,
-0.2728254795074463,
0.25067585706710815,
0.34801185131073,
0.28505828976631165,
0.06694522500038147,
-0.07905565202236176,
-0.13214217126369476,
-0.27704641222953796,
-0.0479281023144722,
0.11829836666584015,
-0.3338523805141449,
0.14520420134067535,
-0.19258111715316772,
-0.2776104211807251,
0.051221273839473724,
-0.07783190906047821,
0.05717955902218819,
-0.0461159385740757,
0.1372273713350296,
0.19103462994098663,
-0.07240182161331177,
-0.03840356320142746,
0.311190664768219,
0.08214263617992401,
0.4029622972011566,
-0.2603835165500641,
0.5553991794586182,
-0.02931806445121765,
-0.06350692361593246,
-0.33285731077194214,
0.1690751314163208,
0.29493409395217896,
-0.5686947107315063,
-0.012471737340092659,
0.35635441541671753,
-0.153678297996521,
0.31409960985183716,
-0.2720288336277008,
0.06772113591432571,
0.32193535566329956,
-0.14720448851585388,
0.06666938215494156,
0.3992103934288025,
0.13206499814987183,
-0.007434248924255371,
-0.6134263873100281,
0.07141097635030746,
0.04263420030474663,
0.02414904162287712,
0.047099769115448,
0.21033936738967896,
0.029012665152549744,
-0.12044215202331543,
0.08410841971635818,
-0.17919626832008362,
-0.015773925930261612,
-0.053368039429187775,
0.16457927227020264,
-0.13531433045864105,
-0.24991261959075928,
-0.11216528713703156,
0.12192609906196594,
-0.08584294468164444,
0.13198600709438324,
0.3268359899520874,
-0.3469742238521576,
0.028514191508293152,
0.08889010548591614,
0.3772333264350891,
0.42637085914611816,
0.11907157301902771,
0.2230735868215561,
0.024560661986470222,
0.35479411482810974,
-0.07300940901041031,
0.3274261951446533,
0.0756903737783432,
-0.10922050476074219,
0.29613396525382996,
-0.008507221937179565,
0.2476232945919037,
-0.3566747009754181,
0.038411110639572144,
-0.05580884590744972,
0.021878419443964958,
-0.5024044513702393,
-0.002220459282398224,
0.02480948716402054,
-0.06879451125860214,
-0.02278301492333412,
-0.21061769127845764,
-0.17774571478366852,
-0.2829062342643738,
-0.23868350684642792,
0.701835572719574,
-0.39946937561035156,
-0.01486736536026001,
0.07672587037086487,
-0.11119751632213593,
-0.12891867756843567,
-0.10294075310230255,
-0.37669992446899414,
0.5139293074607849,
-0.03438276797533035,
-0.07065081596374512,
0.11352159082889557,
-0.44833841919898987,
-0.14197450876235962,
0.06581138074398041,
0.34134823083877563,
-0.623569667339325,
-0.4708012640476227,
-0.019033392891287804,
-0.10395912826061249,
0.20268183946609497,
0.1894453912973404,
0.005736708641052246,
0.09482748061418533,
-0.14309880137443542,
0.11331130564212799,
-0.09235909581184387,
0.004979215562343597,
0.18314599990844727,
0.4027024805545807,
-0.1810058206319809,
-0.1877724826335907,
-0.10616563260555267,
-0.2691405415534973,
-0.22496572136878967,
0.35167229175567627,
-0.1463172286748886,
-0.010106319561600685,
0.3994496166706085,
0.13259011507034302,
0.0011927597224712372,
-0.19515278935432434,
-0.2347266674041748,
0.005058038979768753,
-0.05563581362366676,
0.5421988368034363,
-0.12859363853931427,
-0.3763549327850342,
-0.11043665558099747,
-0.34966182708740234,
-0.14445030689239502,
-0.16159871220588684,
-0.2838987112045288,
0.08972440659999847,
-0.39838215708732605,
0.12871196866035461,
-0.29444774985313416,
0.4231474995613098,
0.5256154537200928,
-0.09733753651380539,
0.07729880511760712,
-0.021165624260902405,
-0.29837074875831604,
0.10569748282432556,
0.4623199701309204,
0.2916874885559082,
-0.41007906198501587,
0.014449402689933777,
-0.2282995581626892,
0.2880675494670868,
0.1125936359167099,
0.41610947251319885,
0.1337689310312271,
-0.005125346593558788,
0.4249480366706848,
0.0454990491271019,
-0.318899929523468,
0.1154962033033371,
0.07391837239265442,
-0.17714717984199524,
0.07429961115121841,
0.4182499051094055,
0.2860821783542633,
0.09549739211797714,
-0.41866469383239746,
-0.07707474380731583,
-0.5212249755859375,
-0.05230901390314102,
0.04288206994533539,
-0.08251634240150452,
0.23085999488830566,
0.13873142004013062,
-0.16987556219100952,
-0.037962574511766434,
-0.05867132917046547,
0.40070709586143494,
0.3299132287502289,
-0.07705728709697723,
-0.14098289608955383,
-0.017527054995298386,
-0.2858060300350189,
0.2061990201473236,
0.0030460990965366364,
0.07076365500688553,
0.09071733057498932,
-0.35231220722198486,
0.04177667200565338,
0.10491573810577393,
1.050115704536438,
-0.05776888132095337,
0.013566814363002777,
-0.15290114283561707,
-0.048273567110300064,
-0.5625994801521301,
-0.11578534543514252,
0.29183146357536316,
0.12972770631313324,
-0.07340864092111588,
0.8770892024040222,
0.0792873203754425,
-0.3517575263977051,
0.21621984243392944,
0.14930419623851776,
-0.163433238863945,
-0.20505104959011078,
-0.09431227296590805,
-0.42946940660476685,
0.03579380363225937,
-0.0740043967962265,
0.10267854481935501,
0.17035211622714996,
0.022206157445907593,
-0.21300050616264343,
-0.13774296641349792,
-0.1473332941532135,
0.019714023917913437,
-0.08848748356103897,
0.4297283887863159,
-0.20180943608283997,
0.19417399168014526,
-0.1449335813522339,
0.029628494754433632,
-0.028127793222665787,
0.2752348482608795,
-0.05306975170969963,
-0.39692744612693787,
0.03752172738313675,
-0.3119286894798279,
0.269010066986084,
0.16873586177825928,
-0.10746101289987564,
-0.1096545159816742,
0.043617527931928635,
0.27786439657211304,
-0.3269093930721283,
-0.13605330884456635,
0.19219693541526794,
0.1271965652704239,
-0.09100593626499176,
-0.08417217433452606,
0.2456088662147522,
0.1168714314699173,
0.05374892055988312,
0.25642240047454834,
0.38165247440338135,
-0.1980973780155182,
0.28772392868995667,
-0.2845747470855713,
0.9741697311401367,
0.23348699510097504,
0.35618141293525696,
0.1797342449426651,
-0.4027394652366638,
0.32521766424179077,
-0.05592118203639984,
0.16184327006340027,
-0.5516027212142944,
-0.07440117746591568,
-0.012899182736873627,
-0.046430863440036774,
0.09450460225343704,
-0.04158903285861015,
-0.2268669605255127,
-0.02381136082112789,
-0.30268293619155884,
0.17978152632713318,
-0.09319725632667542,
0.09303058683872223,
-0.11606694757938385,
-0.24890287220478058,
-0.10859175026416779,
0.0930289477109909,
0.23231273889541626,
0.43097615242004395,
-0.04661151394248009,
-0.196046844124794,
-0.21948200464248657,
-0.2513178884983063,
-0.015348687767982483,
0.3124728798866272,
-0.21163463592529297,
0.0027857720851898193,
0.3055809736251831,
-0.3900575339794159,
0.33842992782592773,
0.48270681500434875,
0.4106657803058624,
0.11632362008094788,
-0.2576127350330353,
-0.03541664034128189,
-0.4645204544067383,
0.2795700132846832,
-0.16751503944396973,
0.04429345950484276,
0.30141186714172363,
0.07660490274429321,
-0.24164073169231415,
-0.13943180441856384,
-0.20708595216274261,
-0.09262091666460037,
-0.10568451136350632,
0.15070371329784393,
0.1350233107805252,
-0.6372312903404236,
0.07940660417079926,
-0.0009620711207389832,
-0.26381731033325195,
-0.30802205204963684,
0.044751256704330444,
0.14696580171585083,
-0.23503649234771729,
0.30551910400390625,
-0.31623023748397827,
-0.22510328888893127,
0.13743376731872559,
0.5204229354858398,
-0.20892301201820374,
0.17393434047698975,
0.3852303922176361,
-0.3428468108177185,
-0.01860475167632103,
-0.20143409073352814,
0.41277453303337097,
-0.008990466594696045,
-0.49094444513320923,
0.3919907510280609,
-0.12491211295127869,
0.053607746958732605,
-0.1279660016298294,
0.23122595250606537,
0.19291998445987701,
-0.10149182379245758,
-0.14179253578186035,
-0.11808817833662033,
-0.31492695212364197,
-0.2047692835330963,
-0.021923230960965157,
-0.003867918625473976,
0.2587406635284424,
-0.170817568898201,
0.14400431513786316,
-0.2585366666316986,
-0.21512635052204132,
-0.06620153039693832,
-0.006470829248428345,
-0.12661176919937134,
0.27336886525154114,
-0.2453286051750183,
0.3612775206565857,
-0.45083844661712646,
0.10167576372623444,
-0.104185089468956,
-0.15738843381404877,
-0.14081202447414398,
-0.2635573744773865,
0.17700494825839996,
0.2905366122722626,
-0.013209402561187744,
-0.1515628695487976,
0.2092132568359375,
0.1438063085079193,
-0.21544195711612701,
0.23814329504966736,
0.24825744330883026,
0.10683342814445496,
0.22277146577835083,
0.019153974950313568,
0.08828283846378326,
-0.27755874395370483,
0.11080799996852875,
0.16777865588665009,
0.06456815451383591,
-0.3030622601509094,
0.11206039786338806,
-0.07418306916952133,
-0.13826029002666473,
-0.28320878744125366,
0.03575928509235382,
0.1867615431547165,
0.022009670734405518,
0.37837427854537964,
-0.15413492918014526,
-0.3089369535446167,
-0.028603652492165565,
0.2654772400856018,
0.315372109413147,
-0.10018213093280792,
0.08645836263895035,
0.28486883640289307,
0.09867958724498749,
-0.03129167854785919,
-0.05337553471326828,
0.3083879351615906,
0.05347047373652458,
0.03656806796789169,
0.18209001421928406,
-0.09915266185998917,
-0.2701774537563324,
0.043048400431871414,
0.11188481748104095,
0.526301920413971,
-0.15420378744602203,
0.2871019244194031,
0.6126033663749695,
-0.2922828793525696,
0.31855231523513794,
0.5166174173355103,
0.05518979951739311,
0.1545724719762802,
0.39886680245399475,
-0.07006777822971344,
-0.013872304931282997,
-0.22311343252658844,
-0.02345116063952446,
0.10812171548604965,
-0.28182029724121094,
0.22440467774868011,
-0.3205663859844208,
-0.06744495779275894,
0.052761923521757126,
-0.12231077998876572,
0.33879992365837097,
-0.5541970729827881,
0.064933642745018,
-0.14687779545783997,
-0.09643986821174622,
-0.2830122709274292,
-0.0565243624150753,
0.2462935447692871,
-0.036741629242897034,
0.13740479946136475,
-0.17073586583137512,
-0.16954480111598969,
-0.4093102216720581,
0.13800683617591858,
-0.08381818234920502,
0.06711246073246002,
0.20969299972057343,
0.08483083546161652,
0.2109460085630417,
0.010319661349058151,
-0.33463817834854126,
0.127424955368042,
0.2182285189628601,
-0.21142619848251343,
-0.20638614892959595,
0.6069607734680176,
0.4522404074668884,
0.07090279459953308,
0.17917367815971375,
0.1459587663412094,
0.008003517985343933,
-0.1346507966518402,
0.08305110782384872,
0.25938934087753296,
-0.22150743007659912,
0.26124250888824463,
0.18253996968269348,
0.11724694073200226,
-0.06160528212785721,
0.41338205337524414,
-0.049900926649570465,
0.1911647915840149,
-0.48750364780426025,
0.3825230896472931,
-0.2976657748222351,
-0.5447053909301758,
-0.15391576290130615,
-0.26910245418548584,
-0.15842390060424805,
0.08728846162557602,
0.5063590407371521,
-0.04075261205434799,
0.20157316327095032,
-0.0590459480881691,
0.014949142932891846,
0.272560179233551,
0.12133227288722992,
0.3607260286808014,
-0.3574114143848419,
-0.19203539192676544,
0.08574697375297546,
-0.3872111141681671,
0.15186724066734314,
0.2001906931400299,
0.0031423047184944153,
0.01815573126077652,
0.0898810550570488,
-0.1294006109237671,
-0.17951105535030365,
0.1660791039466858,
0.06864769756793976,
-0.01987380161881447,
0.23698243498802185,
0.05779498815536499,
-0.03988342359662056,
0.15243762731552124,
0.09582862257957458,
0.23350150883197784,
-0.3762644827365875,
0.2879609763622284,
0.18288661539554596,
-0.002119094133377075,
-0.09454572200775146,
0.33137941360473633,
-0.2661861479282379,
-0.047586288303136826,
0.3933263123035431,
0.19238515198230743,
-0.02752438187599182,
-0.12692390382289886,
0.11131932586431503,
-0.19454756379127502,
-0.00415666401386261,
-0.31995028257369995,
-0.11464868485927582,
-0.1066964715719223,
0.4105176627635956,
-0.33109915256500244,
-0.2412450909614563,
-0.2358240932226181,
-0.13922584056854248,
0.26487383246421814,
0.2073540836572647,
0.09121012687683105,
0.34162983298301697,
-0.3262690007686615,
-0.012799698859453201,
0.45423623919487,
0.17564965784549713,
-0.19438308477401733,
0.03708953410387039,
-0.3022610545158386,
-0.3782444894313812,
0.45238280296325684,
-0.16267907619476318,
-0.37836071848869324,
-0.22016774117946625,
0.31320783495903015,
0.021884238347411156,
-0.2294686734676361,
-0.2988366484642029,
-0.028918422758579254,
0.3167892098426819,
0.06041204556822777,
0.039688900113105774,
0.19563187658786774,
-0.3508787453174591,
-0.11420218646526337,
0.1348232626914978,
0.6038511395454407,
0.40624427795410156,
-0.08163218200206757,
0.25423359870910645,
-0.19995467364788055
] |
https://github.com/huggingface/datasets/issues/5650 | > Can you post a reproducible code snippet of what you tried to do?
>
>
```python
from datasets import load_dataset
dataset = load_dataset("my_folder_name", split="train")
``` | load_dataset can't work correct with my image data | I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked | 26 | load_dataset can't work correct with my image data
I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked
> Can you post a reproducible code snippet of what you tried to do?
>
>
```python
from datasets import load_dataset
dataset = load_dataset("my_folder_name", split="train")
``` | [
-0.11089533567428589,
-0.048615962266922,
-0.09447897970676422,
0.8409000635147095,
0.41031262278556824,
0.09188073873519897,
0.31935685873031616,
0.09225237369537354,
0.16247890889644623,
0.06351488828659058,
-0.05847581475973129,
0.022202815860509872,
-0.1759265661239624,
0.07329081743955612,
-0.14125633239746094,
-0.1944628357887268,
0.13946446776390076,
0.013926766812801361,
-0.19267883896827698,
-0.3365288972854614,
-0.3862646520137787,
0.11721031367778778,
-0.19806918501853943,
-0.36908259987831116,
-0.49844613671302795,
0.13057729601860046,
-0.3325158357620239,
0.263798326253891,
-0.1272825449705124,
0.06834480166435242,
-0.054867882281541824,
0.011665761470794678,
0.2379775494337082,
0.8322035670280457,
-0.00012280729424674064,
-0.12472369521856308,
0.24861577153205872,
-0.2831067144870758,
-0.10688626021146774,
-0.195614755153656,
-0.2806987762451172,
-0.29039430618286133,
0.10030361264944077,
-0.2731734812259674,
-0.011693038046360016,
-0.061044834554195404,
-0.05762935429811478,
-0.27713698148727417,
0.561733067035675,
0.3971937894821167,
0.13603366911411285,
-0.4153258502483368,
0.08763718605041504,
0.17826858162879944,
0.10736111551523209,
0.3220282196998596,
0.10505124926567078,
0.26763245463371277,
-0.07466112822294235,
-0.02446141093969345,
0.291346937417984,
0.0672026127576828,
-0.03548574820160866,
0.0495394803583622,
0.3018651008605957,
0.1775527149438858,
-0.22217939794063568,
-0.6702983975410461,
0.04189080744981766,
0.07398536801338196,
0.47522762417793274,
-0.015407884493470192,
-0.17981460690498352,
-0.16298270225524902,
0.01574840024113655,
-0.24725031852722168,
0.1148417592048645,
0.43916207551956177,
-0.048647601157426834,
-0.20167206227779388,
-0.32967838644981384,
-0.15886296331882477,
-0.34314244985580444,
0.4397430419921875,
0.036433130502700806,
-0.11770513653755188,
-0.13647118210792542,
0.28884488344192505,
0.24170853197574615,
0.15474477410316467,
0.31974440813064575,
-0.3138577342033386,
0.14709897339344025,
0.2954367399215698,
-0.2395460456609726,
0.11701563000679016,
-0.4171903133392334,
0.41033196449279785,
0.02252309024333954,
0.09669351577758789,
-0.14534351229667664,
-0.08591300249099731,
-0.013044089078903198,
0.08764628320932388,
0.19253884255886078,
0.06861130893230438,
-0.01826602965593338,
0.3370044231414795,
0.007301361300051212,
-0.21185699105262756,
-0.3812379539012909,
-0.14513418078422546,
-0.4753830134868622,
-0.20843039453029633,
0.13459353148937225,
-0.2511895000934601,
-0.11218822002410889,
0.1602582037448883,
0.023533962666988373,
-0.13464756309986115,
-0.02560543268918991,
-0.21610350906848907,
0.022928249090909958,
0.3372090458869934,
0.18811072409152985,
0.06007503718137741,
0.16799677908420563,
0.346943736076355,
-0.12396427989006042,
-0.16075563430786133,
-0.08142715692520142,
0.06257092952728271,
-0.3016394376754761,
0.06896886974573135,
0.09039878845214844,
-0.17613019049167633,
0.12930311262607574,
0.04245297238230705,
0.06773923337459564,
-0.2861379384994507,
0.15079163014888763,
-0.5710235238075256,
0.19461499154567719,
0.1684475839138031,
0.11849011480808258,
0.11103418469429016,
0.060802776366472244,
0.05022888630628586,
0.013517037034034729,
0.29457026720046997,
-0.740969717502594,
0.11639702320098877,
-0.07359659671783447,
0.07522208988666534,
-0.15601089596748352,
-0.03344470635056496,
-0.6885718107223511,
0.14122706651687622,
0.24121493101119995,
-0.05474458262324333,
0.08798003196716309,
-0.18518073856830597,
-0.16397777199745178,
-0.3404349088668823,
0.13107731938362122,
0.5817694664001465,
-0.3099677860736847,
0.09811095893383026,
-0.3807576298713684,
-0.1185687780380249,
0.22127948701381683,
0.19114692509174347,
-0.05091719701886177,
0.35676082968711853,
-0.3278447091579437,
-0.12585482001304626,
0.3667460083961487,
-0.2073855996131897,
-0.3384537100791931,
0.256867915391922,
0.199066162109375,
-0.29490920901298523,
-0.05562068894505501,
0.3996601700782776,
0.05376772955060005,
0.026134196668863297,
-0.10794173926115036,
0.28219813108444214,
-0.10714855045080185,
0.03383992612361908,
0.07042472809553146,
-0.12350546568632126,
0.2542898952960968,
0.2084970474243164,
0.09205475449562073,
0.2009177953004837,
0.30391713976860046,
0.04307437688112259,
0.2216133177280426,
-0.09099572896957397,
0.22821393609046936,
0.2668590545654297,
0.25079667568206787,
0.20969733595848083,
0.07052621245384216,
0.07823999226093292,
-0.4306260347366333,
0.062065161764621735,
0.1367979794740677,
-0.03158566728234291,
-0.012545589357614517,
0.40780019760131836,
-0.3020530939102173,
-0.2849617898464203,
-0.44549787044525146,
0.025413550436496735,
0.0025991424918174744,
-0.04758024215698242,
0.08091714233160019,
-0.27632349729537964,
0.0020519495010375977,
0.5919520854949951,
-0.3150404393672943,
0.11174501478672028,
-0.17049282789230347,
0.5590713620185852,
0.07394037395715714,
-0.3059803545475006,
-0.060784339904785156,
-0.24224653840065002,
0.18129247426986694,
-0.21897169947624207,
-0.0832495391368866,
0.3265475332736969,
0.4793784022331238,
-0.11326770484447479,
-0.13129618763923645,
-0.04329238831996918,
0.20149469375610352,
-0.37113791704177856,
0.21905693411827087,
0.12086173892021179,
0.45041191577911377,
-0.15106157958507538,
-0.1762365698814392,
0.029343124479055405,
-0.20698417723178864,
0.28705036640167236,
0.030453309416770935,
-0.1367281675338745,
0.05183260142803192,
-0.05709729343652725,
0.10306057333946228,
0.005662083625793457,
0.05291229113936424,
0.18402795493602753,
0.3385293483734131,
0.1519511342048645,
0.09786392748355865,
-0.29582858085632324,
0.12434318661689758,
-0.061630114912986755,
0.07095751166343689,
0.2579278349876404,
-0.23387518525123596,
0.061137646436691284,
-0.04286326467990875,
0.23229588568210602,
0.6990488767623901,
0.14184221625328064,
-0.1667284220457077,
0.11265985667705536,
0.25350722670555115,
-0.002082042396068573,
0.08049939572811127,
0.15548507869243622,
0.6001364588737488,
0.2057047337293625,
-0.025948891416192055,
0.029204145073890686,
-0.2819989323616028,
-0.1102585569024086,
0.20751453936100006,
0.2628073990345001,
-0.2449100911617279,
0.17772197723388672,
-0.008744299411773682,
-0.2004767805337906,
-0.17957669496536255,
0.1666301041841507,
-0.2747507691383362,
-0.0034308992326259613,
-0.29636579751968384,
-0.07496047019958496,
0.24937283992767334,
-0.1369384229183197,
-0.15687407553195953,
0.024901270866394043,
0.14040401577949524,
-0.4941006600856781,
-0.12034288048744202,
0.16843587160110474,
-0.10783277451992035,
-0.024749377742409706,
0.16468854248523712,
-0.07381036877632141,
0.3157408833503723,
-0.26335519552230835,
-0.19362381100654602,
0.08855815976858139,
-0.11080624163150787,
0.09464587271213531,
-0.12815126776695251,
0.18252483010292053,
-0.1503932774066925,
0.3061225116252899,
0.0763150304555893,
-0.14068429172039032,
0.1898171454668045,
-0.13456901907920837,
-0.1599835902452469,
0.042388349771499634,
0.05977903679013252,
0.13902921974658966,
0.06630721688270569,
-0.30227941274642944,
-0.3840264081954956,
-0.15086713433265686,
-0.06293998658657074,
0.5116999745368958,
0.21688376367092133,
0.20447930693626404,
0.4275248348712921,
-0.18601775169372559,
0.11796802282333374,
-0.026366736739873886,
-0.2601536214351654,
-0.3044451177120209,
0.33450639247894287,
-0.08666068315505981,
-0.44289833307266235,
0.11912116408348083,
-0.10682052373886108,
0.02230541780591011,
0.24621076881885529,
-0.3423260450363159,
-0.09152635186910629,
-0.15945836901664734,
-0.10959295928478241,
-0.08634787052869797,
0.3629830777645111,
-0.11930093169212341,
-0.28079110383987427,
0.15672430396080017,
-0.3113503158092499,
0.04162364453077316,
0.019013449549674988,
0.07545329630374908,
0.4145060181617737,
0.061974044889211655,
0.28865116834640503,
-0.31870853900909424,
0.2971554100513458,
0.33282753825187683,
-0.17442911863327026,
0.5390427112579346,
-0.28470802307128906,
0.39155054092407227,
-0.26360851526260376,
-0.21799272298812866,
0.3140929937362671,
0.07357966899871826,
0.01748955249786377,
0.1125432699918747,
0.06337414681911469,
-0.1328810602426529,
-0.16903267800807953,
0.07704535126686096,
-0.5964305400848389,
0.024989694356918335,
0.10135525465011597,
0.11008156836032867,
0.1729104369878769,
-0.20476672053337097,
-0.15656699240207672,
0.06631913781166077,
-0.29841744899749756,
-0.14014223217964172,
0.20164325833320618,
0.10598073899745941,
0.059855587780475616,
-0.2517210841178894,
0.10099965333938599,
0.0691971555352211,
0.34161195158958435,
-0.03371015191078186,
0.13656127452850342,
-0.07149089872837067,
0.21428105235099792,
0.19032323360443115,
0.21782851219177246,
0.8233819007873535,
-0.2196849286556244,
-0.22266577184200287,
0.12901094555854797,
0.00972602516412735,
-0.4922584295272827,
0.06688465923070908,
-0.23016971349716187,
0.007473338395357132,
-0.06826740503311157,
0.4269842505455017,
-0.2512374222278595,
-0.04578932747244835,
0.06866931915283203,
0.5078311562538147,
-0.3342092037200928,
-0.44868871569633484,
-0.4090455174446106,
-0.19321009516716003,
-0.3349074125289917,
-0.24517209827899933,
0.09071145951747894,
0.1908448338508606,
-0.013606537133455276,
-0.1401989907026291,
-0.1480565220117569,
-0.24034345149993896,
0.18767483532428741,
-0.11978434771299362,
0.531904399394989,
0.2985750436782837,
0.1212996244430542,
0.21036887168884277,
-0.018539147451519966,
0.47892892360687256,
0.56388920545578,
-0.5183635354042053,
-0.08773400634527206,
0.2510448098182678,
-0.14223438501358032,
0.37574082612991333,
0.017178978770971298,
-0.07986561208963394,
-0.3419865667819977,
-0.1404273509979248,
0.06783884018659592,
-0.3452201783657074,
0.2113000452518463,
0.37678080797195435,
-0.09989358484745026,
-0.4420112371444702,
-0.6335878372192383,
0.5343448519706726,
0.03824625909328461,
0.07827390730381012,
0.24564744532108307,
0.053511641919612885,
-0.36324480175971985,
0.05313849821686745,
-0.07513415813446045,
0.9677296876907349,
-0.12881357967853546,
0.25006943941116333,
0.0010210275650024414,
0.10398757457733154,
0.25744494795799255,
0.058339789509773254,
-0.034623339772224426,
-0.306428462266922,
-0.17143207788467407,
-0.020625252276659012,
-0.16084936261177063,
0.09302191436290741,
0.49944552779197693,
-0.0026828795671463013,
0.3516354560852051,
-0.5018647909164429,
-0.16940495371818542,
-0.11416076868772507,
0.3103110194206238,
-0.10323076695203781,
-0.10714066028594971,
-0.3828355669975281,
0.13347452878952026,
0.14782367646694183,
0.18991565704345703,
-0.021417886018753052,
0.12165828794240952,
-0.30970871448516846,
0.023313917219638824,
-0.04863174259662628,
0.04197490215301514,
-0.3106642961502075,
0.10110711306333542,
-0.1360451579093933,
-0.3997824490070343,
-0.026039648801088333,
0.5245506763458252,
-0.08796525001525879,
-0.08722294867038727,
0.026494259014725685,
0.12737922370433807,
-0.18167248368263245,
0.04232669249176979,
-0.11128955334424973,
-0.19078314304351807,
0.13739264011383057,
0.03787582367658615,
-0.11000030487775803,
-0.08559393137693405,
-0.08579066395759583,
-0.13429856300354004,
-0.11732729524374008,
0.16000337898731232,
0.1839311718940735,
-0.46915942430496216,
-0.2923665940761566,
-0.07865334302186966,
-0.057548195123672485,
0.007100842893123627,
0.04880540445446968,
0.29413795471191406,
-0.01607631891965866,
0.5082184076309204,
-0.09040714800357819,
-0.30317366123199463,
-0.022871453315019608,
0.24254097044467926,
0.1455584019422531,
-0.019748449325561523,
0.43334442377090454,
0.026005014777183533,
0.0017699450254440308,
-0.14570292830467224,
0.5492011308670044,
0.3673432767391205,
-0.22276073694229126,
0.24595430493354797,
0.18702033162117004,
0.27280905842781067,
0.024704590439796448,
0.08046959340572357,
0.05988745763897896,
-0.02939716726541519,
-0.010734356939792633,
-0.4312394857406616,
-0.43366333842277527,
-0.025565464049577713,
0.03129807859659195,
0.18167707324028015,
-0.05557970702648163,
-0.33555176854133606,
0.47344669699668884,
0.07812362164258957,
-0.16315828263759613,
0.13809046149253845,
-0.023320212960243225,
0.15711764991283417,
0.2761578857898712,
0.17511580884456635,
0.12335126101970673,
-0.04826337844133377,
-0.01110125333070755,
0.043217167258262634,
0.010573241859674454,
-0.0522046834230423,
-0.2601521909236908,
0.22821030020713806,
0.22636407613754272,
0.07260610908269882,
-0.015281334519386292,
-0.6752914786338806,
-0.21105629205703735,
-0.19015932083129883,
0.045193612575531006,
0.08924510329961777,
-0.07078021764755249,
0.14491984248161316,
0.2921854853630066,
-0.18824031949043274,
-0.12168355286121368,
0.12737193703651428,
-0.2458048015832901,
0.43230360746383667,
0.3884676992893219,
-0.0265425443649292,
0.5338808298110962,
-0.06493540108203888,
-0.2857687473297119,
0.006146559491753578,
0.04372752830386162,
-0.20222575962543488,
0.20533277094364166,
-0.17755545675754547,
0.4272106885910034,
-0.04220278188586235,
0.3559001386165619,
0.616295337677002,
-0.32175564765930176,
0.16821081936359406,
0.1650908887386322,
0.07356477528810501,
-0.26099973917007446,
-0.14040809869766235,
-0.04836787283420563,
-0.1136532574892044,
-0.04469810426235199,
0.25226926803588867,
-0.27189186215400696,
0.1171136200428009,
-0.4208358824253082,
-0.07450782507658005,
0.5259254574775696,
-0.0663982555270195,
0.1472986936569214,
0.23782795667648315,
-0.09840825200080872,
0.1245100200176239,
0.2927680015563965,
0.08182375133037567,
-0.27715158462524414,
0.48747971653938293,
-0.10179314017295837,
0.34710264205932617,
-0.050477154552936554,
0.051045630127191544,
0.1622437834739685,
-0.22590863704681396,
0.05452045053243637,
0.3521921634674072,
-0.15199698507785797,
0.06726148724555969,
-0.31848418712615967,
0.12592078745365143,
0.013475097715854645,
-0.07841485738754272,
-0.045352350920438766,
0.08269120752811432,
0.10479320585727692,
0.033808384090662,
-0.1580360233783722,
-0.2900325357913971,
-0.21997937560081482,
0.08629593998193741,
0.03138607740402222,
-0.6587299108505249,
0.23528358340263367,
0.3631274700164795,
-0.20237568020820618,
-0.26192227005958557,
0.029994379729032516,
0.37240567803382874,
-0.04189411550760269,
-0.2796298563480377,
0.35395315289497375,
0.013847019523382187,
0.06973782181739807,
0.29822710156440735,
0.08509592711925507,
0.31018686294555664,
0.3968663811683655,
0.24849846959114075,
0.06496505439281464,
0.20248740911483765,
-0.1285291165113449,
-0.15530544519424438,
0.3403846323490143,
0.2371833473443985,
0.2643156051635742,
0.0484095923602581,
0.05277365446090698,
-0.11072781682014465,
-0.08474649488925934,
0.24208900332450867,
0.04629390314221382,
-0.276833176612854,
0.392782598733902,
-0.24544501304626465,
-0.12266272306442261,
-0.4469994902610779,
-0.033896587789058685,
-0.4519083499908447,
0.06157762557268143,
0.3063420355319977,
-0.187009796500206,
0.12220396101474762,
0.21483366191387177,
-0.017486076802015305,
-0.08845609426498413,
0.45607084035873413,
-0.06326558440923691,
0.28627699613571167,
-0.4419322907924652,
-0.30081039667129517,
-0.6847622990608215,
-0.05155806988477707,
-0.16819539666175842,
-0.1352251023054123,
-0.14586694538593292,
0.12305685877799988,
0.04801679402589798,
0.07108235359191895,
0.36901766061782837,
0.08682610094547272,
0.36276528239250183,
0.28730469942092896,
-0.321083128452301,
-0.09387888014316559,
-0.1149526908993721,
0.5472537279129028,
-0.07449212670326233,
-0.389889657497406,
0.09335707128047943,
-0.17709574103355408,
-0.07778894156217575,
0.0386895127594471,
-0.1376814842224121,
-0.06422168016433716,
0.20421582460403442,
0.4223615825176239,
0.09990961849689484,
0.6024319529533386,
-0.10675094276666641,
0.3157239854335785,
-0.1399480402469635,
-0.20427143573760986,
-0.20560450851917267,
0.22560468316078186,
0.293245792388916,
0.07418696582317352,
-0.30688121914863586,
-0.103554368019104,
-0.24244673550128937,
-0.006656002253293991,
0.029025040566921234,
0.016744405031204224,
-0.38567957282066345,
-0.080899678170681,
0.0415026918053627,
0.026166383177042007,
0.16805104911327362,
0.12144702672958374,
-0.14066161215305328,
-0.17663517594337463,
-0.20375898480415344,
-0.11526275426149368,
0.2676251530647278,
-0.41440969705581665,
-0.3668314814567566,
-0.13235129415988922,
0.020989958196878433,
-0.1033918559551239,
0.22736479341983795,
-0.08497340977191925,
0.18864285945892334,
0.5812985897064209,
-0.10514552891254425,
-0.32382312417030334,
0.2935139536857605,
0.009232752025127411,
0.08815961331129074,
0.23040291666984558,
0.09875641018152237,
0.12410946190357208,
-0.2501790523529053,
0.07711438834667206,
-0.14735126495361328
] |
https://github.com/huggingface/datasets/issues/5650 | hi @WiNE-iNEFF ! can you please also tell a bit more about how your data is structured (directory structure and filenames patterns)? | load_dataset can't work correct with my image data | I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked | 22 | load_dataset can't work correct with my image data
I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked
hi @WiNE-iNEFF ! can you please also tell a bit more about how your data is structured (directory structure and filenames patterns)? | [
-0.27253055572509766,
0.130905419588089,
-0.04990464821457863,
0.8561934232711792,
0.33972540497779846,
-0.01824251562356949,
0.3219378590583801,
0.07428555190563202,
0.32509735226631165,
0.04825328290462494,
-0.07098022103309631,
-0.043963488191366196,
-0.1462162286043167,
0.1275608390569687,
-0.11319294571876526,
-0.05815370753407478,
0.17801198363304138,
0.06636995822191238,
-0.12171301245689392,
-0.35502001643180847,
-0.2607901394367218,
0.1455288529396057,
-0.22495409846305847,
-0.32603758573532104,
-0.5014058351516724,
0.12320433557033539,
-0.235006183385849,
0.3522081673145294,
-0.2067306637763977,
0.17767637968063354,
-0.08497985452413559,
0.04612736776471138,
0.3146730363368988,
0.7512519359588623,
-0.00012091673124814406,
-0.10970393568277359,
0.1952255368232727,
-0.36398908495903015,
-0.03555164486169815,
-0.09989380836486816,
-0.33425891399383545,
-0.06506261229515076,
0.009831942617893219,
-0.16736315190792084,
0.07363702356815338,
0.06878404319286346,
-0.06357990950345993,
-0.19048342108726501,
0.4624705910682678,
0.42220619320869446,
0.15903916954994202,
-0.5421872735023499,
0.03611467033624649,
0.07827648520469666,
0.26294633746147156,
0.4485280215740204,
0.12124313414096832,
0.3542366027832031,
-0.07508686184883118,
0.060387298464775085,
0.1224713921546936,
0.11858808994293213,
-0.005258597433567047,
0.04009225592017174,
0.2242555022239685,
0.12858915328979492,
-0.15566109120845795,
-0.6195434927940369,
0.042475562542676926,
0.003415626473724842,
0.6534818410873413,
0.10735560208559036,
-0.10584628582000732,
-0.045088887214660645,
-0.016068825498223305,
-0.059877485036849976,
0.21415124833583832,
0.3163735270500183,
-0.11199603974819183,
-0.16245129704475403,
-0.28320977091789246,
-0.12970362603664398,
-0.3745037913322449,
0.33495497703552246,
0.16980889439582825,
-0.04023488238453865,
-0.11597767472267151,
0.2756378650665283,
0.364834725856781,
0.11914098262786865,
0.18713685870170593,
-0.21443575620651245,
-0.05637712776660919,
0.26200321316719055,
-0.25057747960090637,
0.11931454390287399,
-0.49201080203056335,
0.5599991083145142,
0.1333291232585907,
0.16627508401870728,
-0.06292396783828735,
-0.01669306308031082,
0.059725865721702576,
0.05551720783114433,
0.14435775578022003,
0.14614905416965485,
0.05913549289107323,
0.21081717312335968,
-0.023040946573019028,
-0.26015332341194153,
-0.44026854634284973,
-0.06732390820980072,
-0.5692867040634155,
-0.243531733751297,
-0.04392306134104729,
-0.22288577258586884,
-0.19013354182243347,
-0.021139442920684814,
0.043338097631931305,
-0.29021933674812317,
0.1900244951248169,
-0.27276045083999634,
0.18173056840896606,
0.4084619879722595,
0.2003541886806488,
0.11956378072500229,
0.04368682950735092,
0.1994989961385727,
-0.12530510127544403,
-0.16461646556854248,
-0.08950108289718628,
-0.001760462298989296,
-0.39409250020980835,
0.11010968685150146,
0.13425785303115845,
-0.08452168107032776,
0.07301598787307739,
0.05642365664243698,
-0.01995040848851204,
-0.19428201019763947,
0.09357061237096786,
-0.5728088617324829,
0.19646045565605164,
0.1519860178232193,
0.08730682730674744,
0.006345145404338837,
-0.006390486843883991,
-0.049919720739126205,
0.0599922239780426,
0.2629598081111908,
-0.8240832090377808,
0.027706727385520935,
-0.1784801036119461,
0.07924874871969223,
-0.167082279920578,
-0.07583858072757721,
-0.6115251183509827,
0.21443066000938416,
0.14222800731658936,
-0.15096087753772736,
-0.029781609773635864,
-0.04426167905330658,
-0.12736442685127258,
-0.27193912863731384,
0.15906785428524017,
0.5315953493118286,
-0.5789545178413391,
0.17359058558940887,
-0.29266518354415894,
-0.20965512096881866,
0.2553917467594147,
0.2531822621822357,
-0.08960926532745361,
0.29005491733551025,
-0.25616157054901123,
-0.15339058637619019,
0.3974631428718567,
-0.12240421772003174,
-0.43384331464767456,
0.24010568857192993,
0.24324624240398407,
-0.3796960115432739,
0.0006821341812610626,
0.44496721029281616,
0.16998913884162903,
0.048024408519268036,
-0.12319047749042511,
0.1463916003704071,
-0.07165610045194626,
-0.039042841643095016,
0.029886871576309204,
-0.03750906512141228,
0.15621480345726013,
0.18085867166519165,
-0.06486260890960693,
0.1896030157804489,
0.27096444368362427,
-0.008166085928678513,
0.22046297788619995,
-0.07835421711206436,
0.21906913816928864,
0.29558277130126953,
0.2652879059314728,
0.2789933681488037,
0.18111062049865723,
0.2528964877128601,
-0.41885459423065186,
0.12232266366481781,
0.13753533363342285,
-0.05503058433532715,
0.0521477535367012,
0.35132893919944763,
-0.20081141591072083,
-0.28445789217948914,
-0.4463834762573242,
-0.025506801903247833,
0.0018338561058044434,
0.058749470859766006,
0.09503715485334396,
-0.3328087627887726,
-0.10517993569374084,
0.497868150472641,
-0.2518085241317749,
0.025305312126874924,
-0.1684245467185974,
0.49776768684387207,
-0.008384106680750847,
-0.26888081431388855,
-0.07874482125043869,
-0.3148364722728729,
0.11029709875583649,
-0.2048412710428238,
-0.07290688157081604,
0.31235599517822266,
0.46707576513290405,
-0.21467016637325287,
0.04584728553891182,
-0.10311441123485565,
0.1861133575439453,
-0.25610506534576416,
0.2105787843465805,
-0.08781026303768158,
0.3588308095932007,
-0.16501134634017944,
-0.24588680267333984,
-0.09965188056230545,
-0.2061559110879898,
0.24622660875320435,
-0.0802755355834961,
-0.17720314860343933,
0.15540286898612976,
-0.0354183167219162,
0.18142947554588318,
0.04694630205631256,
0.16874584555625916,
0.13861717283725739,
0.33141180872917175,
0.1762508898973465,
0.1232837662100792,
-0.2909836173057556,
0.00974399596452713,
0.0008862316608428955,
-0.013260088860988617,
0.27866873145103455,
-0.21512581408023834,
-0.01457883045077324,
0.07318709045648575,
0.29429852962493896,
0.7075679898262024,
0.13664984703063965,
-0.19335052371025085,
-0.05656556040048599,
0.26940736174583435,
-0.029397035017609596,
-0.0037660375237464905,
-0.04694746062159538,
0.6542112827301025,
0.1959482580423355,
-0.14285966753959656,
-0.018126193434000015,
-0.36447209119796753,
-0.1772196888923645,
0.2845100462436676,
0.2933625280857086,
-0.2306748926639557,
0.1365431398153305,
0.11027593165636063,
-0.16802911460399628,
-0.015710337087512016,
0.21152520179748535,
-0.29824888706207275,
0.16231456398963928,
-0.188127338886261,
-0.056780919432640076,
0.2504081130027771,
-0.14648644626140594,
-0.09544655680656433,
0.2279614508152008,
0.09174460917711258,
-0.38112372159957886,
-0.28537464141845703,
0.11225102841854095,
-0.17122529447078705,
0.007764849811792374,
0.18558160960674286,
-0.06053648516535759,
0.18150915205478668,
-0.21300363540649414,
-0.053366586565971375,
0.08638404309749603,
-0.19602613151073456,
0.16940800845623016,
-0.10547953844070435,
0.19430077075958252,
-0.18980830907821655,
0.2545146644115448,
0.06642845273017883,
-0.14946022629737854,
0.1812698394060135,
-0.195173442363739,
-0.1940435916185379,
0.09803421795368195,
-0.020731650292873383,
-0.005568590015172958,
0.03265759348869324,
-0.19793328642845154,
-0.4028293788433075,
-0.12572209537029266,
-0.013570990413427353,
0.49388474225997925,
0.19675111770629883,
0.22940057516098022,
0.41766196489334106,
-0.24671439826488495,
0.009302951395511627,
-0.07768793404102325,
-0.23074358701705933,
-0.32922980189323425,
0.32332491874694824,
-0.0801985114812851,
-0.4223317503929138,
0.1997646540403366,
-0.03323528170585632,
0.08227670192718506,
0.22862690687179565,
-0.4371063709259033,
-0.06745684891939163,
-0.01416634302586317,
-0.1700124740600586,
-0.06692641973495483,
0.135793074965477,
-0.08242666721343994,
-0.30325084924697876,
0.1281958967447281,
-0.3054923415184021,
0.007311828434467316,
0.1583734005689621,
0.025641851127147675,
0.4663630425930023,
-0.030009178444743156,
0.1660216748714447,
-0.3044191300868988,
0.137813538312912,
0.2589470148086548,
-0.21768563985824585,
0.45715466141700745,
-0.2811209559440613,
0.34477442502975464,
-0.2040330469608307,
-0.07532772421836853,
0.3938779830932617,
0.11723461002111435,
-0.1572321653366089,
0.15239202976226807,
0.12100031971931458,
-0.20700055360794067,
-0.20236004889011383,
0.12506935000419617,
-0.38997650146484375,
0.07355481386184692,
0.21250508725643158,
0.049977947026491165,
0.10000233352184296,
-0.2739616632461548,
-0.1840275228023529,
0.09032721817493439,
-0.28006455302238464,
-0.08895553648471832,
0.19498272240161896,
0.11647104471921921,
0.10365796089172363,
-0.38010305166244507,
0.26469874382019043,
0.05160970613360405,
0.43571794033050537,
-0.11597198247909546,
0.13202691078186035,
-0.19669263064861298,
0.21389329433441162,
0.11902900040149689,
0.21381478011608124,
0.9063467979431152,
-0.2744048237800598,
-0.2392496019601822,
0.08490174263715744,
0.1391860395669937,
-0.39677709341049194,
0.10387534648180008,
-0.2088840901851654,
-0.02946385368704796,
-0.05252545699477196,
0.508452296257019,
-0.2003081887960434,
-0.039771270006895065,
0.01393066719174385,
0.416166216135025,
-0.37782156467437744,
-0.44260525703430176,
-0.4475296139717102,
-0.10900592803955078,
-0.3848130702972412,
-0.17991650104522705,
-0.016085196286439896,
0.04567238688468933,
0.1144896149635315,
-0.1686638742685318,
-0.0003362167626619339,
-0.18013910949230194,
0.17577612400054932,
-0.012020774185657501,
0.5876559615135193,
0.38085755705833435,
0.08832298219203949,
0.2469482123851776,
0.15091797709465027,
0.41824278235435486,
0.5259194374084473,
-0.5009557604789734,
-0.09221528470516205,
0.2943030297756195,
-0.18742401897907257,
0.3155234158039093,
0.002452503889799118,
-0.0753403976559639,
-0.32016050815582275,
-0.10905402898788452,
0.01746276766061783,
-0.36188578605651855,
0.2989797592163086,
0.30953240394592285,
-0.18482351303100586,
-0.4603438079357147,
-0.5731938481330872,
0.41737160086631775,
-0.09431134164333344,
-0.0019261687994003296,
0.2187718152999878,
-0.030527260154485703,
-0.3074914216995239,
0.09989801049232483,
0.05475529283285141,
0.9287147521972656,
-0.1596965491771698,
0.14275005459785461,
-0.10813845694065094,
0.11856284737586975,
0.19400812685489655,
0.20546896755695343,
-0.04483221471309662,
-0.3240968585014343,
-0.14702636003494263,
-0.05302901566028595,
-0.149436354637146,
-0.024840030819177628,
0.6496953964233398,
-0.026068605482578278,
0.2763630151748657,
-0.2288890779018402,
-0.2325926125049591,
-0.03729098290205002,
0.31487947702407837,
0.03366250544786453,
-0.13284751772880554,
-0.16702410578727722,
0.1776774525642395,
0.04653816297650337,
0.14548231661319733,
-0.08820177614688873,
0.06537088006734848,
-0.1893233358860016,
0.04399341344833374,
0.0036051273345947266,
0.09110309183597565,
-0.46122249960899353,
0.05893440544605255,
-0.1855202168226242,
-0.4639739990234375,
-0.19032637774944305,
0.5321263074874878,
-0.21726468205451965,
-0.13755851984024048,
-0.022602200508117676,
0.30963099002838135,
-0.15642517805099487,
0.06864234805107117,
-0.0979187935590744,
-0.2253701090812683,
0.09683573246002197,
-0.014401368796825409,
-0.07512854039669037,
-0.254965215921402,
-0.1374245136976242,
-0.2483643889427185,
-0.08693714439868927,
0.09462761133909225,
0.2929263412952423,
-0.33914828300476074,
-0.22368356585502625,
-0.026496436446905136,
-0.15609392523765564,
0.0884171724319458,
0.05875987559556961,
0.2799007296562195,
0.05327681079506874,
0.4492853581905365,
-0.017803188413381577,
-0.3187027871608734,
-0.022692710161209106,
0.23655381798744202,
-0.0014013033360242844,
-0.0364375039935112,
0.3074032962322235,
0.02706928551197052,
0.02787097543478012,
-0.09312807768583298,
0.4777832329273224,
0.3677275776863098,
-0.5034165978431702,
0.12236444652080536,
0.10118544101715088,
0.20598188042640686,
0.15024328231811523,
0.030323466286063194,
0.1915803849697113,
-0.12019558250904083,
-0.019260510802268982,
-0.3824130892753601,
-0.48438817262649536,
0.03286143019795418,
0.004548863973468542,
0.17469269037246704,
-0.0634055882692337,
-0.543384313583374,
0.4087357521057129,
0.034595005214214325,
-0.17910820245742798,
0.09236976504325867,
-0.0401545912027359,
0.19007857143878937,
0.15916377305984497,
0.18022030591964722,
0.1227632537484169,
-0.1121121197938919,
-0.009750504046678543,
0.0422961562871933,
0.08099658787250519,
-0.041216667741537094,
-0.17219305038452148,
0.1976003646850586,
0.16116061806678772,
0.18019962310791016,
-0.17094309628009796,
-0.6409100294113159,
-0.2910977900028229,
-0.12322787940502167,
0.06766308844089508,
0.011729590594768524,
-0.10172529518604279,
-0.0017847232520580292,
0.13327984511852264,
-0.18093442916870117,
-0.19328667223453522,
0.14071005582809448,
-0.159694105386734,
0.44697105884552,
0.3605278432369232,
0.0020485883578658104,
0.4551662802696228,
-0.14906014502048492,
-0.31488531827926636,
0.06794551014900208,
0.09799491614103317,
-0.11665618419647217,
0.15974318981170654,
-0.1306661069393158,
0.42655956745147705,
-0.013119280338287354,
0.33235985040664673,
0.5433852076530457,
-0.26411738991737366,
0.18459713459014893,
0.16848745942115784,
0.11233533918857574,
-0.1894983947277069,
-0.10934978723526001,
-0.2926699221134186,
-0.11164319515228271,
-0.10250039398670197,
0.18130719661712646,
-0.22796157002449036,
0.13876035809516907,
-0.2539060413837433,
-0.0022890567779541016,
0.5336993336677551,
0.06972004473209381,
-0.005615979433059692,
0.20092365145683289,
-0.2744637131690979,
0.20371946692466736,
0.358003169298172,
0.14885686337947845,
-0.2866377830505371,
0.5167535543441772,
-0.09983180463314056,
0.3780674934387207,
0.06079455837607384,
0.07232262194156647,
0.16722893714904785,
-0.28905585408210754,
-0.10255632549524307,
0.36992233991622925,
-0.06348320096731186,
0.0834333747625351,
-0.3110942542552948,
0.08382100611925125,
-0.054056793451309204,
-0.2091660350561142,
-0.045943599194288254,
-0.0553588829934597,
0.09011445194482803,
0.11650161445140839,
-0.29270806908607483,
-0.32226282358169556,
-0.2794671654701233,
0.17673060297966003,
-0.08035479485988617,
-0.38878628611564636,
0.16450169682502747,
0.3625279366970062,
-0.19158534705638885,
-0.23193271458148956,
-0.04788419231772423,
0.42574143409729004,
-0.13931767642498016,
-0.23609894514083862,
0.6145622134208679,
0.023223668336868286,
0.14921395480632782,
0.4362336993217468,
0.06473399698734283,
0.25691089034080505,
0.414397656917572,
0.37284404039382935,
-0.009045537561178207,
0.18968090415000916,
-0.07352437824010849,
-0.2233189195394516,
0.33214882016181946,
0.37752240896224976,
0.28475260734558105,
0.09118920564651489,
0.08020104467868805,
-0.05675441771745682,
-0.011318832635879517,
0.1294281929731369,
0.07388921827077866,
-0.03799064829945564,
0.34086552262306213,
-0.15091127157211304,
-0.08247469365596771,
-0.37061646580696106,
0.0092005655169487,
-0.36777693033218384,
0.01759485900402069,
0.17655198276042938,
-0.2616521716117859,
0.10801663994789124,
0.19043421745300293,
-0.007190369069576263,
-0.06960895657539368,
0.5724195241928101,
-0.11013853549957275,
0.24277113378047943,
-0.40280482172966003,
-0.3515852689743042,
-0.6681357622146606,
0.030681751668453217,
-0.15482762455940247,
-0.0323188453912735,
-0.18384629487991333,
0.170172780752182,
0.12007619440555573,
0.028373222798109055,
0.37820905447006226,
-0.05761902034282684,
0.2846372127532959,
0.18454307317733765,
-0.3199106752872467,
-0.024831589311361313,
-0.02176326885819435,
0.6224456429481506,
-0.050960972905159,
-0.39169803261756897,
0.21501067280769348,
-0.05484091863036156,
-0.06575044244527817,
0.11545172333717346,
-0.22090262174606323,
-0.05460570752620697,
0.10483801364898682,
0.5096868872642517,
0.04515829682350159,
0.7027186751365662,
-0.17438483238220215,
0.3495519459247589,
-0.19796280562877655,
-0.24714523553848267,
-0.1815163791179657,
0.11274264007806778,
0.2978452444076538,
0.036043211817741394,
-0.21721990406513214,
0.11876051127910614,
-0.25071051716804504,
-0.12370173633098602,
0.012798413634300232,
0.12767061591148376,
-0.42781567573547363,
-0.13425210118293762,
0.1870564967393875,
-0.07038035988807678,
0.2388494312763214,
0.07741937041282654,
-0.0968998521566391,
-0.3650173842906952,
-0.21428315341472626,
0.017456144094467163,
0.3075252175331116,
-0.27748891711235046,
-0.28691190481185913,
-0.017013829201459885,
0.038018934428691864,
-0.007926370948553085,
0.2130003571510315,
-0.1691165268421173,
0.15730994939804077,
0.457948237657547,
-0.08543021976947784,
-0.37008950114250183,
0.26743441820144653,
-0.02142500877380371,
0.07740633934736252,
0.22664180397987366,
0.01939917728304863,
0.1753508299589157,
-0.3482516407966614,
0.12135054171085358,
-0.21386057138442993
] |
https://github.com/huggingface/datasets/issues/5650 | > hi @WiNE-iNEFF ! can you please also tell a bit more about how your data is structured (directory structure and filenames patterns)?
All file have format .png converted in RGBA.
In main folder "MyData" contain 4 folder with images. In function load_dataset i use folder "MyData" | load_dataset can't work correct with my image data | I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked | 47 | load_dataset can't work correct with my image data
I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked
> hi @WiNE-iNEFF ! can you please also tell a bit more about how your data is structured (directory structure and filenames patterns)?
All file have format .png converted in RGBA.
In main folder "MyData" contain 4 folder with images. In function load_dataset i use folder "MyData" | [
-0.25661343336105347,
0.14332899451255798,
-0.04390154778957367,
0.8268578052520752,
0.3386569023132324,
-0.021963924169540405,
0.29721972346305847,
0.07901491224765778,
0.2955476641654968,
0.07517315447330475,
-0.06626254320144653,
-0.01015043631196022,
-0.09799881279468536,
0.14573709666728973,
-0.0933627188205719,
-0.0752069428563118,
0.17461445927619934,
0.07102320343255997,
-0.08222942054271698,
-0.3361683785915375,
-0.2781524062156677,
0.15611454844474792,
-0.2466321587562561,
-0.3155829608440399,
-0.5295439958572388,
0.11585766822099686,
-0.19176331162452698,
0.3407367169857025,
-0.17654094099998474,
0.18571269512176514,
-0.09917162358760834,
0.03907497972249985,
0.23989495635032654,
0.7323967218399048,
-0.00012275716289877892,
-0.11640197038650513,
0.18663285672664642,
-0.3626311719417572,
-0.071400485932827,
-0.1388346254825592,
-0.3016122877597809,
-0.05234365910291672,
-0.011658087372779846,
-0.16418932378292084,
0.036540836095809937,
0.03604349121451378,
-0.041082993149757385,
-0.23771651089191437,
0.44467073678970337,
0.4450502097606659,
0.1392713189125061,
-0.5292209386825562,
0.04542091488838196,
0.09377704560756683,
0.24651071429252625,
0.4364134669303894,
0.14714780449867249,
0.3250213861465454,
-0.08357428014278412,
0.07509505748748779,
0.13657158613204956,
0.12179918587207794,
-0.0017691776156425476,
0.015585508197546005,
0.21617700159549713,
0.1049782857298851,
-0.221408411860466,
-0.6477063298225403,
0.041405826807022095,
-0.01324463076889515,
0.5949627161026001,
0.0700475201010704,
-0.12598097324371338,
-0.04950939118862152,
0.01308644562959671,
-0.07958651334047318,
0.17218677699565887,
0.3079283833503723,
-0.15391260385513306,
-0.166490375995636,
-0.26549413800239563,
-0.12513715028762817,
-0.3884841799736023,
0.35666579008102417,
0.23453015089035034,
-0.09275075793266296,
-0.11449354887008667,
0.3160150647163391,
0.35045325756073,
0.11748260259628296,
0.15481743216514587,
-0.22026251256465912,
0.012812590226531029,
0.23017901182174683,
-0.2532981336116791,
0.1671966016292572,
-0.468392550945282,
0.57381272315979,
0.1412971019744873,
0.17503373324871063,
-0.1083744466304779,
-0.03556947410106659,
0.06083856150507927,
0.10021167993545532,
0.11059027910232544,
0.14402024447917938,
0.035369426012039185,
0.20347385108470917,
0.01911109685897827,
-0.3020503520965576,
-0.4437828063964844,
-0.08233892917633057,
-0.5413583517074585,
-0.23491151630878448,
-0.03115735575556755,
-0.1961817741394043,
-0.21364891529083252,
-0.049404412508010864,
0.01807793229818344,
-0.3099514842033386,
0.19266963005065918,
-0.28403687477111816,
0.17189177870750427,
0.4345444440841675,
0.21222737431526184,
0.08523901551961899,
0.05340683460235596,
0.22332951426506042,
-0.15189087390899658,
-0.15067878365516663,
-0.08092202246189117,
0.004856279119849205,
-0.37092646956443787,
0.13976162672042847,
0.12067905068397522,
-0.16158126294612885,
0.08793339133262634,
0.04806222766637802,
0.004254965111613274,
-0.1823362112045288,
0.11162997037172318,
-0.6561967730522156,
0.23682130873203278,
0.16944319009780884,
0.0802263468503952,
-0.010272316634654999,
-0.013372629880905151,
-0.04235002398490906,
0.0599139928817749,
0.2583436369895935,
-0.7774987816810608,
0.023735567927360535,
-0.17785581946372986,
0.06063385307788849,
-0.1624402403831482,
-0.06915586441755295,
-0.6190606355667114,
0.25565701723098755,
0.15018481016159058,
-0.23118887841701508,
-0.04742064327001572,
-0.07049811631441116,
-0.1347123682498932,
-0.293373703956604,
0.18322378396987915,
0.5974425673484802,
-0.5266736745834351,
0.15202182531356812,
-0.28311029076576233,
-0.2339557409286499,
0.26866137981414795,
0.23356181383132935,
-0.05073268711566925,
0.28267017006874084,
-0.2898448705673218,
-0.1554061472415924,
0.40795254707336426,
-0.1538626104593277,
-0.4379711151123047,
0.2152009904384613,
0.2551426291465759,
-0.3642198443412781,
0.01990921050310135,
0.40586888790130615,
0.15925990045070648,
0.03024538978934288,
-0.13355135917663574,
0.17892411351203918,
-0.0969206690788269,
-0.0390487015247345,
0.06401845067739487,
-0.028777923434972763,
0.20634505152702332,
0.17427964508533478,
-0.09122233092784882,
0.23297226428985596,
0.2721536159515381,
-0.032619938254356384,
0.19783669710159302,
-0.06299124658107758,
0.20939917862415314,
0.22237345576286316,
0.24768169224262238,
0.23696795105934143,
0.16878291964530945,
0.1865183264017105,
-0.3951283395290375,
0.1071014553308487,
0.15824556350708008,
-0.04339076206088066,
-0.020693287253379822,
0.3364369869232178,
-0.20968055725097656,
-0.2735018730163574,
-0.4275103807449341,
-0.03648703545331955,
-0.02010008692741394,
0.1363147795200348,
0.12616771459579468,
-0.30501991510391235,
-0.08365614712238312,
0.5243973731994629,
-0.2588614523410797,
-0.009199410676956177,
-0.17292526364326477,
0.47667908668518066,
-0.008610342629253864,
-0.27239373326301575,
-0.08495575189590454,
-0.2735656201839447,
0.1348792016506195,
-0.21906404197216034,
-0.09729707986116409,
0.2817770540714264,
0.4824916124343872,
-0.20376959443092346,
0.024402448907494545,
-0.09827542304992676,
0.15645846724510193,
-0.232928067445755,
0.16499918699264526,
-0.05881638452410698,
0.374615341424942,
-0.15475235879421234,
-0.24868114292621613,
-0.09335951507091522,
-0.19422045350074768,
0.2634170949459076,
-0.060753028839826584,
-0.16426187753677368,
0.2154798060655594,
-0.008721418678760529,
0.18204626441001892,
0.02352800965309143,
0.08552935719490051,
0.1426369547843933,
0.34607186913490295,
0.15082982182502747,
0.0934753566980362,
-0.2559938430786133,
0.11649706959724426,
0.02152378112077713,
0.042083680629730225,
0.2984519898891449,
-0.2021091878414154,
-0.04164625704288483,
0.09750563651323318,
0.30021461844444275,
0.7302613854408264,
0.1451188176870346,
-0.2238839864730835,
-0.06364568322896957,
0.2883450984954834,
-0.025992106646299362,
0.006552845239639282,
-0.0715961903333664,
0.69178706407547,
0.21382762491703033,
-0.14249137043952942,
-0.031597770750522614,
-0.34850600361824036,
-0.2181471437215805,
0.2789847254753113,
0.29812026023864746,
-0.2408151626586914,
0.1636359691619873,
0.09686768054962158,
-0.20341697335243225,
-0.027154967188835144,
0.22262047231197357,
-0.26353567838668823,
0.16207391023635864,
-0.2169458121061325,
-0.0065292902290821075,
0.24875928461551666,
-0.11133714020252228,
-0.034584153443574905,
0.22689136862754822,
0.07366516441106796,
-0.44143691658973694,
-0.2838258445262909,
0.14932504296302795,
-0.1564561426639557,
-0.011836312711238861,
0.16221195459365845,
0.011273425072431564,
0.17527246475219727,
-0.22185185551643372,
-0.0329403392970562,
0.07582655549049377,
-0.19420704245567322,
0.18187826871871948,
-0.12576411664485931,
0.2086467444896698,
-0.17009128630161285,
0.24899861216545105,
0.08142973482608795,
-0.15693415701389313,
0.19495776295661926,
-0.19379836320877075,
-0.2107059359550476,
0.08216425031423569,
-0.0683034360408783,
-0.00031726062297821045,
0.025700420141220093,
-0.2543685734272003,
-0.4440394341945648,
-0.14982610940933228,
-0.0038154777139425278,
0.4443345069885254,
0.24371647834777832,
0.15169532597064972,
0.42581579089164734,
-0.21719731390476227,
-0.015131153166294098,
-0.04333994537591934,
-0.2589978873729706,
-0.3193358778953552,
0.3021286427974701,
-0.09048687666654587,
-0.44265103340148926,
0.1899491846561432,
-0.045546822249889374,
0.061497002840042114,
0.25166067481040955,
-0.418837308883667,
-0.13309024274349213,
0.00845712423324585,
-0.15250366926193237,
-0.03940756246447563,
0.1322120577096939,
-0.057867541909217834,
-0.2844213545322418,
0.13440221548080444,
-0.32304030656814575,
-0.08021851629018784,
0.15386810898780823,
0.014178359881043434,
0.44278690218925476,
0.05464136600494385,
0.2056475579738617,
-0.3380618989467621,
0.10608406364917755,
0.30660557746887207,
-0.2002437710762024,
0.4776119887828827,
-0.3331317603588104,
0.38041698932647705,
-0.21905356645584106,
-0.08455070853233337,
0.41485896706581116,
0.1436758190393448,
-0.11754123121500015,
0.10793103277683258,
0.09194687008857727,
-0.20053285360336304,
-0.2175314724445343,
0.052926212549209595,
-0.42620742321014404,
0.07445748150348663,
0.2316099852323532,
0.054998625069856644,
0.13969670236110687,
-0.253837525844574,
-0.1717783808708191,
0.059078365564346313,
-0.2248232513666153,
-0.1021193265914917,
0.18992400169372559,
0.17241783440113068,
0.07804273813962936,
-0.35261204838752747,
0.24179130792617798,
0.05726436525583267,
0.42736661434173584,
-0.05645032227039337,
0.1838170439004898,
-0.25181448459625244,
0.22515201568603516,
0.10602176189422607,
0.20969492197036743,
0.905533492565155,
-0.31524816155433655,
-0.19986608624458313,
0.0864109992980957,
0.09379173070192337,
-0.4250944256782532,
0.16836680471897125,
-0.17434383928775787,
0.006287682801485062,
-0.07900603115558624,
0.4990112781524658,
-0.24643783271312714,
-0.05256090313196182,
0.018937908113002777,
0.45036372542381287,
-0.37190690636634827,
-0.39846813678741455,
-0.4320409297943115,
-0.14201201498508453,
-0.4301018714904785,
-0.18732796609401703,
-0.032057326287031174,
0.04979650303721428,
0.1341712474822998,
-0.18232351541519165,
-0.021956127136945724,
-0.19971443712711334,
0.1436992585659027,
0.024202708154916763,
0.619903564453125,
0.3513193130493164,
0.04990066587924957,
0.2536274194717407,
0.11438131332397461,
0.43800294399261475,
0.5278053283691406,
-0.48455923795700073,
-0.12175702303647995,
0.3085806369781494,
-0.1610172688961029,
0.33919191360473633,
-0.008089296519756317,
-0.12507809698581696,
-0.28388795256614685,
-0.1290023922920227,
0.04242192581295967,
-0.31953319907188416,
0.22751858830451965,
0.2982281446456909,
-0.11498451232910156,
-0.4044484496116638,
-0.6030042171478271,
0.36072444915771484,
-0.08671563863754272,
-0.02012626826763153,
0.19227257370948792,
-0.013228904455900192,
-0.30427223443984985,
0.16038748621940613,
0.04881774261593819,
0.9467455148696899,
-0.12153902649879456,
0.1115076094865799,
-0.08526969701051712,
0.11262686550617218,
0.2199225127696991,
0.2483936995267868,
-0.040357064455747604,
-0.2957720160484314,
-0.17560935020446777,
-0.0525575652718544,
-0.1704195886850357,
-0.051812682300806046,
0.6166263222694397,
-0.059689559042453766,
0.2774474322795868,
-0.2481900453567505,
-0.2159091979265213,
0.00881250947713852,
0.3277509808540344,
0.01672944612801075,
-0.12725576758384705,
-0.18541179597377777,
0.1608920395374298,
0.03724157065153122,
0.15027055144309998,
-0.036563560366630554,
0.07334820926189423,
-0.2183072865009308,
0.07127641141414642,
-0.0026099830865859985,
0.13291707634925842,
-0.4578280448913574,
0.044504571706056595,
-0.21187728643417358,
-0.4215853810310364,
-0.13525092601776123,
0.5759027004241943,
-0.2081482857465744,
-0.13636524975299835,
0.010528644546866417,
0.27395930886268616,
-0.16783671081066132,
0.09589020162820816,
-0.11585751175880432,
-0.22064663469791412,
0.14286114275455475,
-0.04263284057378769,
-0.14126846194267273,
-0.22718545794487,
-0.12137636542320251,
-0.28736966848373413,
-0.06180964410305023,
0.08902978897094727,
0.29199597239494324,
-0.3036164939403534,
-0.23288387060165405,
-0.01806063950061798,
-0.16639350354671478,
0.0572357103228569,
0.039815738797187805,
0.2893131971359253,
0.024162564426660538,
0.4967195987701416,
-0.02130957506597042,
-0.3359619379043579,
-0.010039469227194786,
0.22522588074207306,
0.032750844955444336,
0.026296205818653107,
0.3269628584384918,
0.00821501761674881,
0.030582644045352936,
-0.10584092140197754,
0.40942859649658203,
0.313079833984375,
-0.5499625205993652,
0.160469651222229,
0.10877376794815063,
0.20104660093784332,
0.1423686444759369,
0.008017127402126789,
0.16086480021476746,
-0.0872475802898407,
-0.06594716012477875,
-0.44304829835891724,
-0.4818340241909027,
0.02424187958240509,
0.01113989856094122,
0.15551719069480896,
-0.05568520352244377,
-0.540684163570404,
0.42539000511169434,
0.05055723339319229,
-0.16646252572536469,
0.09432373940944672,
-0.0497470423579216,
0.22546473145484924,
0.18186140060424805,
0.2051541954278946,
0.14906440675258636,
-0.139023095369339,
-0.02656545676290989,
0.06919097900390625,
0.08145992457866669,
-0.014956168830394745,
-0.1624724268913269,
0.21445821225643158,
0.16433623433113098,
0.1785656213760376,
-0.17125926911830902,
-0.6334947943687439,
-0.2886216640472412,
-0.12779012322425842,
0.10618805885314941,
0.006663985550403595,
-0.14254602789878845,
-0.008350193500518799,
0.13151445984840393,
-0.20753508806228638,
-0.19347117841243744,
0.10800442099571228,
-0.18663446605205536,
0.4123007357120514,
0.34814774990081787,
0.01915236935019493,
0.41577622294425964,
-0.15323227643966675,
-0.31092575192451477,
0.06384390592575073,
0.11623142659664154,
-0.08443612605333328,
0.1347627341747284,
-0.10718093812465668,
0.43095076084136963,
-0.032528869807720184,
0.30822813510894775,
0.5249781608581543,
-0.22728167474269867,
0.1963115930557251,
0.19215941429138184,
0.08967189490795135,
-0.20769912004470825,
-0.1031675636768341,
-0.30716681480407715,
-0.1445191502571106,
-0.09273384511470795,
0.18534702062606812,
-0.18013998866081238,
0.14806383848190308,
-0.2474559247493744,
-0.023381680250167847,
0.4986790418624878,
0.07908692955970764,
-0.007470693439245224,
0.22524267435073853,
-0.26460644602775574,
0.22253835201263428,
0.3534892797470093,
0.16749253869056702,
-0.2960091233253479,
0.5154748558998108,
-0.07532629370689392,
0.378383606672287,
0.06750652194023132,
0.09483759105205536,
0.20372864603996277,
-0.28928589820861816,
-0.04563890025019646,
0.38103270530700684,
-0.05316125974059105,
0.05215069279074669,
-0.29335352778434753,
0.06387729942798615,
-0.027893442660570145,
-0.21331147849559784,
-0.023834414780139923,
-0.03616960346698761,
0.11787454783916473,
0.12144175171852112,
-0.26818960905075073,
-0.3287280797958374,
-0.2720935344696045,
0.1425178200006485,
-0.057443663477897644,
-0.442656010389328,
0.18624533712863922,
0.32938632369041443,
-0.23527702689170837,
-0.20069687068462372,
-0.06355336308479309,
0.3838927447795868,
-0.11770658195018768,
-0.20167894661426544,
0.5943634510040283,
0.03773312643170357,
0.17800381779670715,
0.39754483103752136,
0.10913179814815521,
0.28372669219970703,
0.4295772612094879,
0.3645572066307068,
0.004705943167209625,
0.21915271878242493,
-0.0588882640004158,
-0.2206423580646515,
0.37260743975639343,
0.3952667713165283,
0.2859036326408386,
0.09945659339427948,
0.07065519690513611,
-0.05267795920372009,
-0.0353628434240818,
0.14821511507034302,
0.09185482561588287,
-0.011345252394676208,
0.40057435631752014,
-0.16440372169017792,
-0.040278710424900055,
-0.3799741566181183,
0.00025425106287002563,
-0.3636968731880188,
-0.022545458748936653,
0.2234153300523758,
-0.2760874032974243,
0.10594572871923447,
0.18351484835147858,
-0.018865495920181274,
-0.09117387235164642,
0.5674034357070923,
-0.1363554745912552,
0.24949690699577332,
-0.4014154374599457,
-0.35713428258895874,
-0.6926710605621338,
0.020280487835407257,
-0.10844521224498749,
-0.029877223074436188,
-0.22315192222595215,
0.14988866448402405,
0.11191994696855545,
0.031670667231082916,
0.35765519738197327,
-0.05199917405843735,
0.3183910548686981,
0.180120587348938,
-0.32988807559013367,
-0.050835832953453064,
-0.029343388974666595,
0.6371689438819885,
-0.0417136624455452,
-0.43537893891334534,
0.1715404987335205,
-0.0830826610326767,
-0.05281617492437363,
0.10730091482400894,
-0.207315593957901,
-0.09001946449279785,
0.08448853343725204,
0.5352305173873901,
0.08504842966794968,
0.7128188610076904,
-0.19336609542369843,
0.3638504147529602,
-0.14376403391361237,
-0.20005665719509125,
-0.23353488743305206,
0.1449546068906784,
0.3181738555431366,
0.08263261616230011,
-0.20837219059467316,
0.13313783705234528,
-0.2715427279472351,
-0.11087216436862946,
0.00446966290473938,
0.11977680027484894,
-0.3928312063217163,
-0.02624211087822914,
0.18404018878936768,
-0.09139123558998108,
0.22460278868675232,
0.07129421085119247,
-0.10645264387130737,
-0.33324724435806274,
-0.2365570366382599,
0.03151337057352066,
0.34446412324905396,
-0.26803672313690186,
-0.2653299570083618,
-0.002629891037940979,
0.061825647950172424,
0.011771048419177532,
0.16718332469463348,
-0.16283783316612244,
0.17586708068847656,
0.4462023973464966,
-0.0668434351682663,
-0.38704338669776917,
0.28082939982414246,
-0.06834963709115982,
0.10570447146892548,
0.21215707063674927,
0.020245296880602837,
0.1741933971643448,
-0.3695438504219055,
0.12030967324972153,
-0.20300155878067017
] |
https://github.com/huggingface/datasets/issues/5650 | @WiNE-iNEFF I'm sorry there is still not enough information to answer your question :( For now I can only assume that your [filenames contain split names](https://huggingface.co/docs/datasets/repository_structure#splits-and-file-names) which are somehow incorrectly parsed.
What would be the output if you omit `split` while loading? Like just
```python
ds = load_dataset("MyData")
print(ds)
```
| load_dataset can't work correct with my image data | I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked | 50 | load_dataset can't work correct with my image data
I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked
@WiNE-iNEFF I'm sorry there is still not enough information to answer your question :( For now I can only assume that your [filenames contain split names](https://huggingface.co/docs/datasets/repository_structure#splits-and-file-names) which are somehow incorrectly parsed.
What would be the output if you omit `split` while loading? Like just
```python
ds = load_dataset("MyData")
print(ds)
```
| [
-0.1758604347705841,
-0.209586501121521,
0.01980317384004593,
0.8191556930541992,
0.2988639771938324,
0.09997572004795074,
0.16577008366584778,
0.09318815171718597,
0.2899940013885498,
0.08995870500802994,
-0.20960387587547302,
-0.0025026053190231323,
-0.10109251737594604,
0.31656891107559204,
-0.0022798292338848114,
-0.14722369611263275,
0.2150040566921234,
-0.0016538165509700775,
0.012366737239062786,
-0.3357095420360565,
-0.29991307854652405,
0.2628801763057709,
-0.21258364617824554,
-0.36098581552505493,
-0.48907214403152466,
0.10499120503664017,
-0.20719021558761597,
0.406971275806427,
-0.24798841774463654,
0.021277308464050293,
-0.10418850183486938,
0.04554834961891174,
0.16263653337955475,
0.6989753842353821,
-0.00012836043606512249,
0.01318340003490448,
0.1374620646238327,
-0.3315293788909912,
-0.10346752405166626,
-0.20929601788520813,
-0.19612902402877808,
-0.09293300658464432,
0.1511349081993103,
-0.14744235575199127,
-0.0019257739186286926,
0.10613235086202621,
-0.1417015790939331,
-0.11649718880653381,
0.5599696636199951,
0.2624751329421997,
0.10417473316192627,
-0.1615435779094696,
0.028112933039665222,
0.03840981423854828,
0.15811923146247864,
0.41252630949020386,
0.03227420151233673,
0.3835139572620392,
-0.06687121093273163,
0.07646986842155457,
0.2057783007621765,
0.24117906391620636,
-0.08463870733976364,
0.059389855712652206,
0.31837037205696106,
0.2399202287197113,
-0.2292642742395401,
-0.6489919424057007,
-0.031555917114019394,
0.09071412682533264,
0.33867958188056946,
-0.05357779562473297,
-0.33149704337120056,
-0.3671351671218872,
-0.055471889674663544,
-0.1707170158624649,
0.19030635058879852,
0.3827214539051056,
-0.19736289978027344,
-0.10459816455841064,
-0.3588477671146393,
-0.09724147617816925,
-0.27101385593414307,
0.2834790349006653,
0.11765062808990479,
0.024043608456850052,
-0.21350251138210297,
0.35225963592529297,
0.4351944923400879,
0.1881888061761856,
-0.24337232112884521,
-0.13477133214473724,
0.0285474993288517,
0.26375460624694824,
-0.26411035656929016,
0.023369431495666504,
-0.34145107865333557,
0.6632726788520813,
0.31385737657546997,
0.2182995080947876,
-0.14502891898155212,
-0.01823095791041851,
0.006814848631620407,
0.10204778611660004,
0.2605140507221222,
0.21154773235321045,
0.07496234774589539,
0.21132352948188782,
0.05515163764357567,
0.04430990293622017,
-0.2762749195098877,
-0.060027897357940674,
-0.4046030640602112,
-0.1733265221118927,
-0.20474742352962494,
-0.3430531322956085,
0.146725594997406,
-0.06944550573825836,
-0.046035636216402054,
-0.26628902554512024,
0.1186615601181984,
-0.1596204787492752,
0.16232186555862427,
0.48010993003845215,
0.18763163685798645,
0.035584911704063416,
0.037844739854335785,
0.3131770193576813,
-0.22000941634178162,
-0.13921286165714264,
-0.09523600339889526,
-0.10462296009063721,
-0.3379659652709961,
0.21719947457313538,
0.14845621585845947,
-0.24688364565372467,
0.2741852104663849,
0.11790280044078827,
0.0871562659740448,
-0.2636883556842804,
-0.03794705122709274,
-0.4855916500091553,
0.14042052626609802,
0.24181845784187317,
0.07714767754077911,
0.06761456280946732,
0.14717520773410797,
-0.2287018746137619,
-0.03165537863969803,
0.16031502187252045,
-0.6923631429672241,
-0.07940424233675003,
-0.11893570423126221,
-0.0031753573566675186,
-0.24532683193683624,
-0.037759676575660706,
-0.7218445539474487,
0.321758508682251,
0.18856953084468842,
-0.07805782556533813,
0.012488175183534622,
-0.013605860061943531,
-0.2034553587436676,
-0.20589111745357513,
0.28624212741851807,
0.627495288848877,
-0.48968833684921265,
-0.04258473217487335,
-0.10114093869924545,
-0.29662150144577026,
0.13880446553230286,
0.4582578241825104,
-0.00804494321346283,
0.18341030180454254,
-0.26542162895202637,
-0.04719333350658417,
0.24734245240688324,
-0.3027222156524658,
-0.2871178686618805,
0.1789909303188324,
0.17370262742042542,
-0.0466083325445652,
0.001303303986787796,
0.23892515897750854,
0.33973950147628784,
0.008952464908361435,
-0.048070795834064484,
0.13831329345703125,
-0.19304259121418,
-0.00409158319234848,
0.04908709228038788,
-0.12315620481967926,
0.08512402325868607,
0.17699719965457916,
-0.13836130499839783,
0.22855162620544434,
0.11144188046455383,
-0.17703750729560852,
0.35538244247436523,
-0.04654422029852867,
0.18958191573619843,
0.2333875149488449,
0.18345938622951508,
0.49507036805152893,
0.2765628397464752,
0.12234675884246826,
-0.5509465336799622,
0.2682434320449829,
0.2103617787361145,
0.03779442608356476,
-0.19827796518802643,
0.08849427103996277,
-0.241337388753891,
-0.13237407803535461,
-0.4672728478908539,
-0.09791279584169388,
-0.11442303657531738,
0.017274707555770874,
0.22440020740032196,
-0.18574121594429016,
-0.28783756494522095,
0.3811532258987427,
-0.19997496902942657,
0.21745780110359192,
-0.3363115191459656,
0.3715803921222687,
0.05332639068365097,
-0.2608903646469116,
-0.135578453540802,
-0.1115914061665535,
0.07324917614459991,
-0.253151535987854,
-0.007825477048754692,
0.3538706600666046,
0.4258784055709839,
-0.1400057077407837,
0.07272183895111084,
-0.044064417481422424,
0.2554109990596771,
-0.2254260927438736,
0.1897064447402954,
-0.1277695596218109,
0.3365840017795563,
-0.12040141224861145,
-0.21469850838184357,
-0.004621148109436035,
-0.25277554988861084,
0.38115912675857544,
-0.12206924706697464,
-0.16459324955940247,
0.17695289850234985,
-0.04984751716256142,
0.07590433955192566,
-0.09761929512023926,
0.22487442195415497,
-0.006554346531629562,
0.3898470997810364,
0.08258819580078125,
-0.09963715821504593,
-0.22541648149490356,
0.1964779496192932,
-0.11408554017543793,
-0.12839001417160034,
0.3006743788719177,
-0.20843498408794403,
0.07620088011026382,
0.11691155284643173,
0.2212398201227188,
0.6067830324172974,
0.1142076700925827,
-0.15814262628555298,
0.0801747590303421,
0.1840822994709015,
-0.04592258483171463,
0.051922667771577835,
0.10155072063207626,
0.5064160227775574,
0.13918748497962952,
-0.13619829714298248,
-0.017500706017017365,
-0.46378380060195923,
-0.10327088087797165,
0.19013243913650513,
0.18684576451778412,
-0.33930671215057373,
0.16483955085277557,
0.1428937315940857,
-0.2356220930814743,
-0.16922089457511902,
0.05606793239712715,
-0.44620591402053833,
0.07360119372606277,
-0.12569153308868408,
0.06866633892059326,
0.14831483364105225,
-0.06593147665262222,
0.04848376661539078,
0.20124146342277527,
-0.0398673415184021,
-0.3438284695148468,
-0.35044896602630615,
0.09548255801200867,
-0.026124494150280952,
-0.0929957702755928,
0.19276654720306396,
-0.02850719355046749,
0.38603270053863525,
-0.3372313678264618,
-0.22874681651592255,
0.018654674291610718,
-0.2744349241256714,
0.2519236207008362,
-0.4177146553993225,
0.2820485532283783,
-0.03608063608407974,
0.24266314506530762,
0.15598064661026,
-0.1416867971420288,
0.35025379061698914,
-0.14285802841186523,
-0.13990652561187744,
0.035095877945423126,
0.03390076756477356,
-0.024603545665740967,
-0.0664532333612442,
-0.13712656497955322,
-0.36444517970085144,
-0.19377610087394714,
0.268811970949173,
0.3999442458152771,
0.13956159353256226,
0.25715458393096924,
0.2637532949447632,
-0.18063053488731384,
-0.051812611520290375,
-0.013768177479505539,
-0.2486041784286499,
-0.2816816568374634,
0.2175556719303131,
-0.07119596004486084,
-0.34076476097106934,
0.22474415600299835,
0.016833171248435974,
-0.07258075475692749,
0.11245187371969223,
-0.4166010618209839,
-0.22309035062789917,
-0.07175972312688828,
-0.08956985920667648,
0.02318783476948738,
0.21643997728824615,
0.005609769374132156,
-0.2517133057117462,
0.17528685927391052,
-0.32073765993118286,
-0.2029171586036682,
0.11463768035173416,
-0.10744917392730713,
0.3063277006149292,
0.015171587467193604,
0.3997069001197815,
-0.2946612238883972,
0.34678998589515686,
0.3878614902496338,
0.019465075805783272,
0.39820176362991333,
-0.29038819670677185,
0.39488282799720764,
-0.2986452877521515,
-0.09360700845718384,
0.2816443145275116,
0.037729524075984955,
-0.17001459002494812,
0.24135982990264893,
0.24202960729599,
0.04316558688879013,
-0.15520857274532318,
0.14101548492908478,
-0.37402501702308655,
-0.07257863879203796,
0.1451636105775833,
0.22168239951133728,
0.028079796582460403,
-0.16425403952598572,
-0.10937254875898361,
0.11108364164829254,
-0.2624441385269165,
-0.0952054038643837,
0.38986852765083313,
0.11920437216758728,
0.07778683304786682,
-0.43823373317718506,
0.30318281054496765,
-0.20116746425628662,
0.4242975115776062,
-0.08139394968748093,
-0.06425193697214127,
-0.17544221878051758,
0.11525977402925491,
0.2708216905593872,
0.23198474943637848,
1.046402096748352,
-0.07391151785850525,
-0.2018134444952011,
-0.040297266095876694,
-0.157874196767807,
-0.40159550309181213,
0.06697933375835419,
-0.1993691325187683,
0.10685043036937714,
0.04939143732190132,
0.5950978398323059,
-0.3793180584907532,
-0.21202191710472107,
0.21277253329753876,
0.4954356551170349,
-0.3219314217567444,
-0.3151338994503021,
-0.4931262135505676,
-0.22061853110790253,
-0.5093716979026794,
-0.1515485644340515,
0.05338577181100845,
-0.020321130752563477,
0.11269237846136093,
-0.12543562054634094,
0.06171521544456482,
-0.1365438997745514,
0.17745694518089294,
0.02002335712313652,
0.5352798700332642,
0.35073497891426086,
0.11236055195331573,
0.3902354836463928,
0.15200281143188477,
0.3547009229660034,
0.7751986384391785,
-0.5518155694007874,
-0.41708144545555115,
0.1259838491678238,
-0.11632376909255981,
0.3053703010082245,
0.20465004444122314,
-0.0018849335610866547,
-0.19651082158088684,
-0.012587507255375385,
0.2600958049297333,
-0.47980445623397827,
0.2157750427722931,
0.4001196622848511,
-0.05005335435271263,
-0.5372955799102783,
-0.5445300340652466,
0.5035073757171631,
-0.05479636415839195,
-0.02012762427330017,
0.23485736548900604,
0.37246769666671753,
-0.30047571659088135,
0.14876826107501984,
-0.19434447586536407,
1.0574796199798584,
-0.21277698874473572,
0.2097785770893097,
0.09127312898635864,
0.14346252381801605,
0.34216776490211487,
0.24894098937511444,
-0.01608254387974739,
-0.32144132256507874,
-0.043004631996154785,
-0.0361272469162941,
-0.03281508386135101,
-0.05218498408794403,
0.34065625071525574,
0.00021169334650039673,
0.3241845667362213,
-0.250680536031723,
-0.1571114957332611,
-0.07528320699930191,
0.18631689250469208,
-0.030485576018691063,
-0.22272329032421112,
-0.37172549962997437,
0.09535519778728485,
0.0994645431637764,
0.26363062858581543,
-0.02719060704112053,
0.14001011848449707,
-0.15534141659736633,
-0.09996728599071503,
-0.16366489231586456,
-0.04908048361539841,
-0.4664769768714905,
-0.030275022611021996,
-0.03000982105731964,
-0.4573284983634949,
-0.1967223584651947,
0.44460856914520264,
-0.13208289444446564,
-0.10206621885299683,
-0.07406491041183472,
0.25356417894363403,
-0.2444530725479126,
-0.01143568754196167,
-0.11139041185379028,
-0.2248147577047348,
0.16824975609779358,
-0.0004299655556678772,
-0.10488076508045197,
-0.2971791625022888,
-0.18484851717948914,
-0.2784246802330017,
-0.09640385210514069,
0.1516406536102295,
0.23509381711483002,
-0.3670288920402527,
-0.3279140889644623,
-0.04537052661180496,
0.06525842845439911,
-0.08163611590862274,
-0.0207669660449028,
0.24598082900047302,
-0.07826284319162369,
0.27978309988975525,
-0.09975267201662064,
-0.3198762834072113,
-0.06177893653512001,
0.1244916170835495,
-0.06985986977815628,
-0.08839431405067444,
0.32357466220855713,
0.11430318653583527,
0.06239200383424759,
-0.03825218603014946,
0.3329208493232727,
0.3110085427761078,
-0.6888204216957092,
0.2602328658103943,
0.24004873633384705,
0.20129281282424927,
0.005534209311008453,
0.2818072736263275,
0.22882390022277832,
-0.15884506702423096,
-0.028954289853572845,
-0.35246554017066956,
-0.32633817195892334,
0.11155498027801514,
0.0741967037320137,
0.11942875385284424,
0.005093522369861603,
-0.29639971256256104,
0.3090609014034271,
0.01788458786904812,
-0.14384552836418152,
0.15880027413368225,
-0.125270813703537,
0.16703273355960846,
0.3771944046020508,
0.22807928919792175,
0.3042261004447937,
-0.16930091381072998,
-0.04691338539123535,
0.07760055363178253,
0.005616985261440277,
0.006076071411371231,
-0.31484246253967285,
0.2332979142665863,
0.14278487861156464,
0.09156811982393265,
-0.1061118096113205,
-0.35882481932640076,
-0.16617536544799805,
-0.26950252056121826,
0.31188124418258667,
0.2232726365327835,
0.007135910913348198,
-0.059519145637750626,
0.1963556855916977,
-0.029808063060045242,
-0.22873640060424805,
0.19665968418121338,
-0.07080642133951187,
0.5051493048667908,
0.3391445577144623,
-0.06862368434667587,
0.14304205775260925,
-0.038701340556144714,
-0.2028040885925293,
0.10654117912054062,
0.19243891537189484,
-0.12622129917144775,
0.18653979897499084,
-0.11541502177715302,
0.4027901291847229,
0.08026977628469467,
0.503000795841217,
0.5431453585624695,
-0.1707352101802826,
0.196081280708313,
0.1003517359495163,
0.014728948473930359,
-0.19823181629180908,
-0.006213728338479996,
-0.09480392932891846,
-0.11783988773822784,
-0.05907240882515907,
0.33826756477355957,
-0.23463790118694305,
0.26973170042037964,
-0.26220834255218506,
-0.033268265426158905,
0.5367003679275513,
0.21244461834430695,
0.0952528640627861,
0.10715936124324799,
-0.2292703092098236,
0.31222137808799744,
0.2470247596502304,
0.13147322833538055,
-0.10991723835468292,
0.31481441855430603,
-0.26050111651420593,
0.34442204236984253,
-0.16219565272331238,
0.15498913824558258,
0.24975921213626862,
-0.2490602433681488,
-0.09811814874410629,
0.3043152987957001,
-0.03906797990202904,
0.05638435482978821,
-0.3885335922241211,
0.38460594415664673,
-0.18106378614902496,
-0.3221074938774109,
-0.040886614471673965,
0.11605653166770935,
0.11644723266363144,
0.04865548387169838,
-0.09191330522298813,
-0.24876120686531067,
-0.28645622730255127,
0.1998414695262909,
-0.10293547809123993,
-0.5083662867546082,
0.24533432722091675,
0.21044282615184784,
-0.16818416118621826,
-0.36054733395576477,
-0.13348455727100372,
0.3266006410121918,
-0.027133535593748093,
-0.21722428500652313,
0.5061268210411072,
0.15237244963645935,
0.17452189326286316,
0.39291587471961975,
0.15177206695079803,
0.3934236764907837,
0.2511962056159973,
0.4270368218421936,
0.12443521618843079,
0.06472752243280411,
0.014619894325733185,
-0.10100574791431427,
0.2955860197544098,
0.3161590099334717,
0.3438631594181061,
0.0835246741771698,
0.03102724626660347,
-0.060178421437740326,
-0.13289400935173035,
0.05803286284208298,
0.07827984541654587,
-0.1860935240983963,
0.5039092302322388,
-0.2761767506599426,
-0.05073496326804161,
-0.46273279190063477,
0.009946372359991074,
-0.4529084861278534,
0.08318845927715302,
0.13055738806724548,
-0.170420303940773,
-0.023326028138399124,
0.15603673458099365,
-0.04507702589035034,
0.037291333079338074,
0.4456717073917389,
0.12922924757003784,
0.25726455450057983,
-0.4512750804424286,
-0.28136706352233887,
-0.6472898721694946,
0.06357476115226746,
-0.1267251819372177,
-0.20335108041763306,
-0.14931154251098633,
0.14059999585151672,
0.08821326494216919,
0.09758048504590988,
0.3205891251564026,
-0.1693531572818756,
0.25369906425476074,
0.09393437951803207,
-0.12571988999843597,
0.015073005110025406,
-0.23416078090667725,
0.4428187906742096,
0.0133938267827034,
-0.3490642309188843,
0.17323429882526398,
-0.20050205290317535,
-0.22429603338241577,
0.03595837578177452,
0.06793028861284256,
-0.07890062779188156,
-0.16950562596321106,
0.34825271368026733,
0.17276936769485474,
0.655622661113739,
-0.13605986535549164,
0.15086108446121216,
-0.19615665078163147,
-0.3559328317642212,
-0.3118196427822113,
0.18309390544891357,
0.10655121505260468,
0.09635086357593536,
-0.2289746105670929,
-0.042752400040626526,
-0.30738306045532227,
0.07305790483951569,
0.10324522852897644,
0.0034716688096523285,
-0.3514086604118347,
-0.022977571934461594,
0.12215587496757507,
-0.04531010985374451,
0.4230972230434418,
0.2424526810646057,
-0.16231092810630798,
-0.20511332154273987,
-0.205892875790596,
-0.03868803009390831,
0.5213631391525269,
-0.3373865783214569,
-0.3047339916229248,
0.04470508173108101,
0.13223695755004883,
0.20975299179553986,
-0.08612172305583954,
-0.45554447174072266,
0.14530746638774872,
0.35265102982521057,
-0.04212676361203194,
-0.39976704120635986,
0.2919612526893616,
0.016424819827079773,
-0.10154678672552109,
0.160487100481987,
0.013097362592816353,
0.2133372575044632,
-0.4090043306350708,
0.36276376247406006,
-0.24590954184532166
] |
https://github.com/huggingface/datasets/issues/5650 | > @WiNE-iNEFF I'm sorry there is still not enough information to answer your question :( For now I can only assume that your [filenames contain split names](https://huggingface.co/docs/datasets/repository_structure#splits-and-file-names) which are somehow incorrectly parsed.
> What would be the output if you omit `split` while loading? Like just
> ```python
> ds = load_dataset("MyData")
> print(ds)
> ```
>
>
```python
Dataset({
features: ['image', 'label'],
num_rows: 4
})
``` | load_dataset can't work correct with my image data | I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked | 67 | load_dataset can't work correct with my image data
I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked
> @WiNE-iNEFF I'm sorry there is still not enough information to answer your question :( For now I can only assume that your [filenames contain split names](https://huggingface.co/docs/datasets/repository_structure#splits-and-file-names) which are somehow incorrectly parsed.
> What would be the output if you omit `split` while loading? Like just
> ```python
> ds = load_dataset("MyData")
> print(ds)
> ```
>
>
```python
Dataset({
features: ['image', 'label'],
num_rows: 4
})
``` | [
-0.14027895033359528,
-0.21775709092617035,
0.01905115693807602,
0.8180442452430725,
0.31160062551498413,
0.09880086779594421,
0.18401458859443665,
0.10137102007865906,
0.2914615273475647,
0.06977254152297974,
-0.187803715467453,
-0.019470302388072014,
-0.10439877212047577,
0.31862741708755493,
-0.022650785744190216,
-0.1375705450773239,
0.24105940759181976,
0.007798727601766586,
0.028632845729589462,
-0.32347196340560913,
-0.2880488932132721,
0.2421344518661499,
-0.2325095534324646,
-0.3669554591178894,
-0.5126814246177673,
0.13734999299049377,
-0.20606768131256104,
0.38337692618370056,
-0.22811633348464966,
0.03771845996379852,
-0.11957953870296478,
0.0022110091522336006,
0.133134126663208,
0.6800273656845093,
-0.00012988646631129086,
0.01129201054573059,
0.1391291618347168,
-0.33240678906440735,
-0.11418551206588745,
-0.2290855497121811,
-0.1873500794172287,
-0.0870184600353241,
0.14461755752563477,
-0.16998887062072754,
0.01572522521018982,
0.06098465248942375,
-0.13219650089740753,
-0.10980606079101562,
0.5502287149429321,
0.2541984021663666,
0.09007100015878677,
-0.170498788356781,
0.03405086696147919,
0.08378399908542633,
0.1728755235671997,
0.4311607778072357,
0.018824875354766846,
0.3658626675605774,
-0.08254717290401459,
0.06041613966226578,
0.21519753336906433,
0.24425175786018372,
-0.07931532710790634,
0.08234261721372604,
0.36213213205337524,
0.2304724007844925,
-0.24190083146095276,
-0.6800302267074585,
-0.032371945679187775,
0.08747692406177521,
0.3292108178138733,
-0.022134747356176376,
-0.3449390232563019,
-0.3969596326351166,
-0.053536977618932724,
-0.17151063680648804,
0.1967485249042511,
0.38888874650001526,
-0.1911030113697052,
-0.14548134803771973,
-0.359893798828125,
-0.1106572300195694,
-0.2597796320915222,
0.3065892159938812,
0.12315233051776886,
0.02110474370419979,
-0.18519636988639832,
0.36052095890045166,
0.43169307708740234,
0.17644570767879486,
-0.23068609833717346,
-0.14295919239521027,
0.044461965560913086,
0.2822384834289551,
-0.22607439756393433,
0.04890190064907074,
-0.3382076621055603,
0.6685095429420471,
0.31974491477012634,
0.18580809235572815,
-0.16665972769260406,
-0.04411885142326355,
-0.03022206947207451,
0.09064383059740067,
0.2797051668167114,
0.20117759704589844,
0.07591935992240906,
0.21109884977340698,
0.038759611546993256,
0.039664190262556076,
-0.2765604555606842,
-0.057691797614097595,
-0.3961930572986603,
-0.1786382794380188,
-0.18259426951408386,
-0.3492167592048645,
0.13135769963264465,
-0.05551013723015785,
-0.027090225368738174,
-0.2794162929058075,
0.1058252826333046,
-0.16028690338134766,
0.1341353952884674,
0.436265766620636,
0.2014002799987793,
0.0371490940451622,
0.025961585342884064,
0.3274800181388855,
-0.23729124665260315,
-0.1471283733844757,
-0.0915803462266922,
-0.09609004855155945,
-0.35270190238952637,
0.200908362865448,
0.14710140228271484,
-0.25562384724617004,
0.2723764479160309,
0.09800354391336441,
0.0999031662940979,
-0.2770620584487915,
-0.03619012609124184,
-0.5177183747291565,
0.14498253166675568,
0.24317090213298798,
0.07177853584289551,
0.06264765560626984,
0.15238672494888306,
-0.22220076620578766,
-0.02752215415239334,
0.1814614236354828,
-0.7173410654067993,
-0.08789512515068054,
-0.1095857173204422,
-0.02600107342004776,
-0.24989080429077148,
-0.01187996193766594,
-0.6984378695487976,
0.3035709857940674,
0.2053856998682022,
-0.1015525758266449,
0.02731732279062271,
-0.0470132939517498,
-0.21995006501674652,
-0.19405868649482727,
0.2733365595340729,
0.6465904712677002,
-0.49091944098472595,
-0.035103701055049896,
-0.11007866263389587,
-0.26741012930870056,
0.13382792472839355,
0.45137307047843933,
-0.005813542753458023,
0.1927967518568039,
-0.27079927921295166,
-0.058579109609127045,
0.2835955023765564,
-0.23508873581886292,
-0.30578336119651794,
0.1723417341709137,
0.18418791890144348,
-0.05706452950835228,
-0.013887997716665268,
0.27586114406585693,
0.30512455105781555,
0.029380399733781815,
-0.06474538892507553,
0.11963315308094025,
-0.19010604918003082,
0.005720473825931549,
0.07572691142559052,
-0.14423353970050812,
0.08002635836601257,
0.17527884244918823,
-0.11234769225120544,
0.22357839345932007,
0.1270412653684616,
-0.12469784915447235,
0.3382759392261505,
-0.044811490923166275,
0.21926936507225037,
0.2385880947113037,
0.19580908119678497,
0.49943211674690247,
0.28293728828430176,
0.12583455443382263,
-0.5666124820709229,
0.2687734067440033,
0.22725915908813477,
0.016086475923657417,
-0.1954665184020996,
0.1294832080602646,
-0.24342292547225952,
-0.14488373696804047,
-0.45926550030708313,
-0.12359888851642609,
-0.1337382197380066,
0.00636131688952446,
0.16449947655200958,
-0.19537752866744995,
-0.28538089990615845,
0.40008604526519775,
-0.16504567861557007,
0.20718401670455933,
-0.3511331379413605,
0.3732284903526306,
0.053864412009716034,
-0.30290326476097107,
-0.1587422788143158,
-0.11861813068389893,
0.06319372355937958,
-0.2547050714492798,
-0.032144445925951004,
0.34098172187805176,
0.46865028142929077,
-0.16106712818145752,
0.03069385513663292,
-0.024660050868988037,
0.2829567492008209,
-0.23524534702301025,
0.1752745807170868,
-0.12102653086185455,
0.34936830401420593,
-0.120946004986763,
-0.25078314542770386,
-0.045789606869220734,
-0.28377291560173035,
0.40940338373184204,
-0.1138928085565567,
-0.1560458242893219,
0.14981871843338013,
-0.02018468827009201,
0.08326704055070877,
-0.11939412355422974,
0.21339713037014008,
-0.02950960025191307,
0.37767598032951355,
0.09595351666212082,
-0.09216374158859253,
-0.2348010092973709,
0.18805378675460815,
-0.07034078985452652,
-0.11997565627098083,
0.3234901428222656,
-0.20998193323612213,
0.06458164006471634,
0.1317821443080902,
0.17411571741104126,
0.617300808429718,
0.09654872119426727,
-0.14560812711715698,
0.09130610525608063,
0.205674409866333,
-0.03699321299791336,
0.054492637515068054,
0.11572093516588211,
0.5159980654716492,
0.1371089667081833,
-0.11464932560920715,
-0.0048315078020095825,
-0.4554020166397095,
-0.11801634728908539,
0.20366281270980835,
0.16482466459274292,
-0.3296418786048889,
0.1814941167831421,
0.1295652687549591,
-0.2256971001625061,
-0.12917344272136688,
0.06905178725719452,
-0.4613569974899292,
0.0729728415608406,
-0.122767373919487,
0.09302908182144165,
0.15120241045951843,
-0.086899034678936,
0.01051514595746994,
0.18552981317043304,
-0.008860349655151367,
-0.37541118264198303,
-0.3176320195198059,
0.1247083842754364,
-0.019869375973939896,
-0.1076478660106659,
0.17104598879814148,
-0.024227743968367577,
0.3571111857891083,
-0.3202205300331116,
-0.2529004216194153,
0.01825176551938057,
-0.29971781373023987,
0.25874149799346924,
-0.388937383890152,
0.27803629636764526,
-0.04637246951460838,
0.22736135125160217,
0.12426726520061493,
-0.12790285050868988,
0.3609420359134674,
-0.1171288788318634,
-0.1344285011291504,
0.034874141216278076,
0.03237542882561684,
0.004498697817325592,
-0.09604578465223312,
-0.12138305604457855,
-0.3397537171840668,
-0.18119576573371887,
0.26471686363220215,
0.41505780816078186,
0.14756101369857788,
0.268873006105423,
0.3021014332771301,
-0.22664690017700195,
-0.04609409347176552,
-0.03470436856150627,
-0.24133005738258362,
-0.26679733395576477,
0.2333662509918213,
-0.05260296165943146,
-0.33318212628364563,
0.2091466784477234,
-0.010068029165267944,
-0.08048155903816223,
0.13723520934581757,
-0.432037889957428,
-0.21280531585216522,
-0.07607226818799973,
-0.06464146822690964,
0.02599519118666649,
0.21280959248542786,
-0.014402493834495544,
-0.24275493621826172,
0.19403424859046936,
-0.32412874698638916,
-0.20413799583911896,
0.11268220096826553,
-0.05581041797995567,
0.3067871928215027,
0.037328366190195084,
0.3655838370323181,
-0.2766854763031006,
0.3534751534461975,
0.3670920729637146,
0.0327296108007431,
0.4223606586456299,
-0.28022247552871704,
0.40370792150497437,
-0.3248869776725769,
-0.09702689200639725,
0.302053302526474,
0.025024354457855225,
-0.17308413982391357,
0.2274039089679718,
0.22263771295547485,
0.009095672518014908,
-0.15346987545490265,
0.1564321368932724,
-0.379294753074646,
-0.05616838112473488,
0.14290857315063477,
0.19687001407146454,
0.026371613144874573,
-0.15881110727787018,
-0.14101438224315643,
0.06491461396217346,
-0.2652973532676697,
-0.11148334294557571,
0.3698042333126068,
0.14767304062843323,
0.09911829233169556,
-0.4066588878631592,
0.26949989795684814,
-0.1579391062259674,
0.3905772864818573,
-0.06217685341835022,
-0.052341680973768234,
-0.17596371471881866,
0.13004139065742493,
0.27174806594848633,
0.2551058828830719,
1.0602779388427734,
-0.05627308040857315,
-0.19603636860847473,
-0.012859247624874115,
-0.1398169845342636,
-0.3960363566875458,
0.04819008708000183,
-0.1838248074054718,
0.07416865229606628,
0.06551411747932434,
0.6251630783081055,
-0.3680150806903839,
-0.1891184002161026,
0.20105111598968506,
0.5023553371429443,
-0.31999099254608154,
-0.3284786641597748,
-0.4993671774864197,
-0.17916396260261536,
-0.4949997663497925,
-0.1731933355331421,
0.07078289240598679,
-0.026912754401564598,
0.12618815898895264,
-0.12323834002017975,
0.05303026735782623,
-0.1656191349029541,
0.15537545084953308,
0.010034371167421341,
0.5343905091285706,
0.32628461718559265,
0.10928173363208771,
0.3898291289806366,
0.13920721411705017,
0.308207243680954,
0.7755006551742554,
-0.531137228012085,
-0.4287009835243225,
0.13243640959262848,
-0.10202546417713165,
0.27791091799736023,
0.17481909692287445,
-0.0027432627975940704,
-0.23219560086727142,
-0.022997964173555374,
0.2608841359615326,
-0.44409769773483276,
0.24586941301822662,
0.39229029417037964,
-0.06492603570222855,
-0.5212392807006836,
-0.5328664779663086,
0.5158559679985046,
-0.052718739956617355,
-0.026915214955806732,
0.2389701008796692,
0.3651963472366333,
-0.30094295740127563,
0.14702078700065613,
-0.1838853508234024,
1.0354185104370117,
-0.17532306909561157,
0.21572957932949066,
0.09680354595184326,
0.1599888950586319,
0.3670060634613037,
0.25232845544815063,
-0.007105695083737373,
-0.28516459465026855,
-0.08666983246803284,
-0.04108993709087372,
-0.0414026714861393,
-0.05446924641728401,
0.380046010017395,
0.036938488483428955,
0.35535430908203125,
-0.25125330686569214,
-0.17254629731178284,
-0.06440962105989456,
0.17679497599601746,
-0.02211577817797661,
-0.22235780954360962,
-0.3394733965396881,
0.07629064470529556,
0.10259008407592773,
0.2822369933128357,
-0.008749835193157196,
0.1481269896030426,
-0.161454975605011,
-0.08552724868059158,
-0.1501714289188385,
-0.027702394872903824,
-0.45955488085746765,
-0.016483791172504425,
-0.01973487064242363,
-0.45190709829330444,
-0.18458200991153717,
0.446548730134964,
-0.1380920112133026,
-0.10949122160673141,
-0.05896417796611786,
0.23597592115402222,
-0.22436600923538208,
-0.01437290757894516,
-0.12997430562973022,
-0.21331743896007538,
0.16510863602161407,
0.008063450455665588,
-0.11610874533653259,
-0.327140748500824,
-0.18702974915504456,
-0.24343760311603546,
-0.11158942431211472,
0.17041999101638794,
0.2186155617237091,
-0.3364802300930023,
-0.3513181507587433,
-0.04800763726234436,
0.059699930250644684,
-0.07467494159936905,
-0.03936729580163956,
0.23092462122440338,
-0.052789416164159775,
0.28731176257133484,
-0.1274651437997818,
-0.3194815516471863,
-0.060974910855293274,
0.12485034018754959,
-0.07332928478717804,
-0.06336506456136703,
0.3343958258628845,
0.09596636891365051,
0.06402060389518738,
-0.01307310163974762,
0.3490874767303467,
0.27964532375335693,
-0.6937853097915649,
0.235066220164299,
0.22419869899749756,
0.2045210897922516,
-0.017232630401849747,
0.2297004759311676,
0.20844261348247528,
-0.1269102841615677,
-0.023983001708984375,
-0.3408006727695465,
-0.34266185760498047,
0.12783461809158325,
0.03635409101843834,
0.10913684219121933,
-0.01343352347612381,
-0.28397876024246216,
0.33745265007019043,
0.020832305774092674,
-0.12102896720170975,
0.17028668522834778,
-0.10031280666589737,
0.18534471094608307,
0.40134960412979126,
0.23669126629829407,
0.2612472474575043,
-0.15946730971336365,
-0.06351881474256516,
0.07460570335388184,
0.0037921592593193054,
0.02533259242773056,
-0.32092928886413574,
0.24289101362228394,
0.16538624465465546,
0.09057164937257767,
-0.11937125027179718,
-0.372218519449234,
-0.17145892977714539,
-0.27725911140441895,
0.3106466233730316,
0.20934204757213593,
0.010661591775715351,
-0.058892376720905304,
0.1775410920381546,
-0.03365922346711159,
-0.21598851680755615,
0.2285020798444748,
-0.08068272471427917,
0.5063795447349548,
0.34128671884536743,
-0.05437210947275162,
0.17339417338371277,
-0.02205236256122589,
-0.24435056746006012,
0.0904114693403244,
0.13380272686481476,
-0.13158123195171356,
0.18382705748081207,
-0.118290975689888,
0.43740954995155334,
0.052681323140859604,
0.46615150570869446,
0.5256845951080322,
-0.15727324783802032,
0.19983842968940735,
0.10888978838920593,
-0.003461006563156843,
-0.21772167086601257,
-0.04175401106476784,
-0.09295982122421265,
-0.08778685331344604,
-0.039302758872509,
0.3323841989040375,
-0.22864118218421936,
0.28593960404396057,
-0.2723976969718933,
-0.02535044401884079,
0.5293381810188293,
0.1839471012353897,
0.08579984307289124,
0.13286356627941132,
-0.22303654253482819,
0.3176170587539673,
0.248550146818161,
0.1455700844526291,
-0.11975331604480743,
0.34038567543029785,
-0.25632911920547485,
0.3416846692562103,
-0.0907658189535141,
0.14225585758686066,
0.2725676894187927,
-0.24634085595607758,
-0.13243471086025238,
0.3346228003501892,
-0.025205712765455246,
0.05484537035226822,
-0.40218257904052734,
0.32248273491859436,
-0.1736353039741516,
-0.310920387506485,
-0.009237818419933319,
0.09283778071403503,
0.1438698172569275,
0.0480879582464695,
-0.07546551525592804,
-0.2566857933998108,
-0.31589850783348083,
0.19046898186206818,
-0.10530610382556915,
-0.5292192697525024,
0.2690163850784302,
0.22618797421455383,
-0.1898294985294342,
-0.34911495447158813,
-0.16580678522586823,
0.3489634394645691,
-0.01363629475235939,
-0.212758868932724,
0.5014841556549072,
0.14391370117664337,
0.1647137999534607,
0.36359018087387085,
0.1579810380935669,
0.390056848526001,
0.2523258626461029,
0.42168256640434265,
0.10571449249982834,
0.10025733709335327,
-0.0003052055835723877,
-0.10248637944459915,
0.2795340120792389,
0.3079199194908142,
0.3500349223613739,
0.06750882416963577,
0.008336547762155533,
-0.05685415118932724,
-0.10699749737977982,
0.06401894986629486,
0.08518968522548676,
-0.21917174756526947,
0.48136377334594727,
-0.2820025682449341,
-0.07510590553283691,
-0.43399399518966675,
0.005625277757644653,
-0.43983614444732666,
0.0677492693066597,
0.14441081881523132,
-0.16702371835708618,
-0.005935654044151306,
0.18055211007595062,
-0.0575740784406662,
0.011951111257076263,
0.4255026876926422,
0.11578802019357681,
0.2478448450565338,
-0.44484230875968933,
-0.2584303617477417,
-0.6541973948478699,
0.06136643514037132,
-0.13158480823040009,
-0.20422348380088806,
-0.1113966852426529,
0.14956775307655334,
0.07118241488933563,
0.09526023268699646,
0.3295190930366516,
-0.15618669986724854,
0.2653549909591675,
0.11854656785726547,
-0.12850458920001984,
-0.01438290998339653,
-0.24234673380851746,
0.46170103549957275,
-0.010420922189950943,
-0.3614252507686615,
0.18169349431991577,
-0.21699640154838562,
-0.2387053370475769,
0.052005015313625336,
0.04193998873233795,
-0.06437046825885773,
-0.11278359591960907,
0.348867803812027,
0.18071717023849487,
0.638145387172699,
-0.13432440161705017,
0.1525469273328781,
-0.20853734016418457,
-0.3550819754600525,
-0.30728816986083984,
0.18259814381599426,
0.12208305299282074,
0.12101228535175323,
-0.2447831630706787,
-0.019642099738121033,
-0.2990911900997162,
0.09242375195026398,
0.10521639883518219,
0.002637214958667755,
-0.3642621338367462,
-0.00008592382073402405,
0.10349695384502411,
-0.037433259189128876,
0.4107591211795807,
0.2354488968849182,
-0.16400080919265747,
-0.24147078394889832,
-0.19779038429260254,
-0.038142137229442596,
0.5120985507965088,
-0.3159289062023163,
-0.31417548656463623,
0.025555409491062164,
0.11865678429603577,
0.22999197244644165,
-0.06598950177431107,
-0.4169781804084778,
0.13778182864189148,
0.3832109570503235,
-0.0493096262216568,
-0.4097527265548706,
0.27126407623291016,
0.01886461302638054,
-0.09471668303012848,
0.15665322542190552,
0.01464470662176609,
0.2007693648338318,
-0.3957718312740326,
0.3701578378677368,
-0.23013338446617126
] |
https://github.com/huggingface/datasets/issues/5650 | @WiNE-iNEFF My only guess is that 4 images in your data have `"train"` string in their names (something like `"train_image_0.png"`) and others do not and the loader ignores all the files that do not contain split name in filename. If it's true, please try to remove "train" from filenames. Or maybe they are inside a directory named "train", then the directory should be renamed (unless you want to put only these 4 specific images to the train but apparently you do not).
If there is a bug I cannot investigate it unfortunately because I cannot reproduce your case without some data samples. | load_dataset can't work correct with my image data | I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked | 102 | load_dataset can't work correct with my image data
I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked
@WiNE-iNEFF My only guess is that 4 images in your data have `"train"` string in their names (something like `"train_image_0.png"`) and others do not and the loader ignores all the files that do not contain split name in filename. If it's true, please try to remove "train" from filenames. Or maybe they are inside a directory named "train", then the directory should be renamed (unless you want to put only these 4 specific images to the train but apparently you do not).
If there is a bug I cannot investigate it unfortunately because I cannot reproduce your case without some data samples. | [
-0.3184143006801605,
0.11623577773571014,
0.004813235253095627,
0.7473567128181458,
0.23421408236026764,
0.041685715317726135,
0.33594438433647156,
0.21330620348453522,
0.4263291656970978,
0.17171671986579895,
-0.10355032980442047,
0.196505606174469,
-0.14578336477279663,
0.10011137276887894,
-0.1034432053565979,
-0.03730528801679611,
0.07633653283119202,
0.07769440114498138,
-0.059451326727867126,
-0.2626515328884125,
-0.22085075080394745,
0.1937502771615982,
-0.20895209908485413,
-0.4100785255432129,
-0.5033214688301086,
0.2067738175392151,
-0.20960171520709991,
0.4152142107486725,
-0.2631571292877197,
0.05819759517908096,
0.007191367447376251,
-0.03895559161901474,
0.3270321488380432,
0.6809664368629456,
-0.00011518529208842665,
0.036756619811058044,
0.09427741169929504,
-0.31956571340560913,
-0.03462371975183487,
-0.09810865670442581,
-0.3538464307785034,
-0.015895351767539978,
0.08242028951644897,
-0.13359759747982025,
0.10875594615936279,
0.17752432823181152,
-0.14849528670310974,
-0.15040335059165955,
0.451627641916275,
0.4986044466495514,
0.22030527889728546,
-0.3780514597892761,
-0.010274581611156464,
-0.029417868703603745,
0.2541777193546295,
0.3535100817680359,
-0.03218582645058632,
0.31310683488845825,
-0.0348748154938221,
-0.06732828915119171,
0.04793839156627655,
0.23010462522506714,
0.05438694357872009,
0.09575873613357544,
0.25935590267181396,
0.03501551225781441,
-0.11062173545360565,
-0.6431712508201599,
-0.15884992480278015,
0.005008385516703129,
0.49555253982543945,
0.10154064744710922,
-0.2704482674598694,
-0.1716517210006714,
0.08674384653568268,
0.047812022268772125,
0.14652518928050995,
0.07918056845664978,
-0.16983553767204285,
-0.11975635588169098,
-0.18558752536773682,
0.037464696913957596,
-0.38676518201828003,
0.21995358169078827,
0.08006152510643005,
0.05154476314783096,
-0.06487663835287094,
0.29785865545272827,
0.3828807473182678,
0.15744368731975555,
-0.02937880903482437,
-0.08721145242452621,
-0.11572285741567612,
0.1709056943655014,
-0.4092823266983032,
0.019203931093215942,
-0.40389564633369446,
0.5791511535644531,
0.05365709960460663,
0.22351926565170288,
0.09688280522823334,
0.07562032341957092,
0.143954798579216,
0.11655649542808533,
0.08302527666091919,
0.22195179760456085,
0.10441458225250244,
0.16763737797737122,
0.05920809507369995,
-0.1538480520248413,
-0.42848050594329834,
0.021356549113988876,
-0.6377643346786499,
-0.31290459632873535,
-0.16048233211040497,
-0.12612299621105194,
-0.0029878318309783936,
-0.17320387065410614,
-0.15008625388145447,
-0.4491887092590332,
0.19367146492004395,
-0.18930883705615997,
0.2625906467437744,
0.46217042207717896,
0.16760510206222534,
0.23062177002429962,
-0.020031772553920746,
0.1675197184085846,
-0.20532673597335815,
-0.15068301558494568,
-0.1123298704624176,
0.03696538507938385,
-0.47104716300964355,
0.11046236753463745,
0.2136927843093872,
-0.12929309904575348,
0.1631603240966797,
0.029577020555734634,
0.05634155496954918,
-0.17557111382484436,
0.18011826276779175,
-0.5248041152954102,
0.0300768855959177,
0.11867694556713104,
-0.02611297369003296,
0.04751472920179367,
0.11343152076005936,
-0.22738149762153625,
0.02703101933002472,
0.1897575855255127,
-0.7094846367835999,
-0.12357905507087708,
-0.18059071898460388,
0.14672109484672546,
-0.1291225701570511,
-0.16527295112609863,
-0.49468114972114563,
0.17153050005435944,
0.14958053827285767,
-0.169264554977417,
-0.11659161746501923,
-0.19222217798233032,
-0.1522887647151947,
-0.1751614362001419,
0.23048284649848938,
0.49237027764320374,
-0.7366962432861328,
0.07176841795444489,
-0.19994734227657318,
-0.26552996039390564,
0.19798825681209564,
0.3071826994419098,
-0.15504227578639984,
0.23136381804943085,
-0.20579802989959717,
-0.09187233448028564,
0.2701566517353058,
-0.10246668010950089,
-0.4925277531147003,
0.247343510389328,
0.15298402309417725,
-0.20440170168876648,
0.05234069004654884,
0.37846359610557556,
0.4308198094367981,
-0.05229174345731735,
-0.020036574453115463,
0.2640739679336548,
-0.09502559155225754,
0.00831824541091919,
-0.00004065781831741333,
0.06149004399776459,
0.1496058851480484,
0.24972879886627197,
-0.08049806952476501,
0.30980390310287476,
0.18136301636695862,
-0.10736934840679169,
0.28503164649009705,
-0.023362502455711365,
0.15945056080818176,
0.3196810185909271,
0.19772347807884216,
0.35426291823387146,
0.32668712735176086,
0.22145137190818787,
-0.28957873582839966,
0.2997516393661499,
0.1938273310661316,
0.01934874802827835,
-0.14157319068908691,
0.17950323224067688,
-0.2390102744102478,
-0.1263711303472519,
-0.5153999924659729,
-0.10342083871364594,
0.0397476889193058,
0.15126201510429382,
0.08565259724855423,
-0.3357298970222473,
-0.2155805230140686,
0.3350238800048828,
-0.14940598607063293,
0.05446465313434601,
-0.1527991145849228,
0.43571656942367554,
-0.04966539144515991,
-0.28311026096343994,
-0.048839736729860306,
-0.3104005753993988,
0.06461269408464432,
-0.2198367565870285,
-0.13577686250209808,
0.3025965690612793,
0.5197209119796753,
-0.1389564871788025,
0.04007609188556671,
-0.20931604504585266,
0.20426152646541595,
-0.24931223690509796,
0.0372776985168457,
-0.1105760708451271,
0.3704148828983307,
-0.15018263459205627,
-0.2268049120903015,
-0.06960563361644745,
-0.17047825455665588,
0.36687278747558594,
-0.1388184279203415,
-0.12912943959236145,
0.0768951028585434,
-0.09125307947397232,
0.2179039716720581,
-0.028240695595741272,
0.11542358994483948,
0.03636562451720238,
0.3807401657104492,
0.17346590757369995,
0.04138186573982239,
-0.1880647838115692,
0.08272863924503326,
0.12137627601623535,
-0.20265929400920868,
0.28993427753448486,
-0.15869413316249847,
0.016635410487651825,
0.1728539913892746,
0.360200971364975,
0.6836824417114258,
0.21946530044078827,
-0.11771545559167862,
-0.11211320012807846,
0.18585841357707977,
-0.07824471592903137,
0.02780526876449585,
-0.0339035838842392,
0.6311240196228027,
0.20422017574310303,
-0.1501520425081253,
0.029632315039634705,
-0.39416617155075073,
-0.25465014576911926,
0.29863446950912476,
0.27174651622772217,
-0.24872764945030212,
0.1110047772526741,
0.08294335752725601,
-0.1151636391878128,
-0.08471561968326569,
0.06168621405959129,
-0.34857749938964844,
0.06096925586462021,
0.014168528839945793,
0.08691558241844177,
0.060031965374946594,
0.009909402579069138,
-0.06847314536571503,
0.1269485056400299,
0.09743127226829529,
-0.2923910319805145,
-0.34346818923950195,
0.14265763759613037,
-0.22233307361602783,
0.06474631279706955,
0.2667759656906128,
0.013140968978404999,
0.17829711735248566,
-0.03600525110960007,
-0.07326632738113403,
0.020385224372148514,
-0.2909092605113983,
0.17684879899024963,
-0.2541793882846832,
0.28860050439834595,
-0.09903381764888763,
0.2574276924133301,
0.15093019604682922,
-0.25229528546333313,
0.28617578744888306,
-0.22650611400604248,
-0.14618121087551117,
0.09500271081924438,
-0.06515133380889893,
0.0688854455947876,
-0.10747811198234558,
-0.28904804587364197,
-0.37024998664855957,
-0.2602454423904419,
-0.026383832097053528,
0.42699557542800903,
0.12725910544395447,
0.20392481982707977,
0.43544983863830566,
-0.20974372327327728,
0.12952107191085815,
-0.10861476510763168,
-0.111639603972435,
-0.23040837049484253,
0.3793076276779175,
-0.09046414494514465,
-0.27328458428382874,
0.18294069170951843,
0.0068173035979270935,
-0.033833179622888565,
0.23857992887496948,
-0.44015583395957947,
-0.15720440447330475,
-0.04822446405887604,
-0.21540911495685577,
-0.10421700775623322,
-0.021796703338623047,
0.05598302185535431,
-0.24449259042739868,
-0.007013339549303055,
-0.335082083940506,
-0.023291874676942825,
0.21293053030967712,
-0.16560423374176025,
0.4424165189266205,
-0.20107051730155945,
0.2158345878124237,
-0.15159335732460022,
0.0902746319770813,
0.08972758054733276,
-0.08359944820404053,
0.39190220832824707,
-0.2706162631511688,
0.2618881165981293,
-0.21684883534908295,
-0.013376805931329727,
0.3402213454246521,
-0.012191765010356903,
-0.255939245223999,
0.24985535442829132,
0.11879289150238037,
-0.2327287495136261,
-0.06154385954141617,
0.1607610136270523,
-0.1777980625629425,
0.004387900233268738,
0.2520075738430023,
0.0957663506269455,
0.04798857867717743,
-0.2383633553981781,
-0.11771061271429062,
0.04718828946352005,
-0.16300250589847565,
-0.015928838402032852,
0.21568158268928528,
0.10159054398536682,
0.03395234793424606,
-0.3889971673488617,
0.2084372490644455,
-0.07902410626411438,
0.3515016436576843,
-0.11355102807283401,
0.13178718090057373,
-0.16941434144973755,
0.07413165271282196,
0.10669636726379395,
0.177515909075737,
1.0322339534759521,
-0.2422119528055191,
-0.2428785264492035,
0.08786557614803314,
0.05644236505031586,
-0.348786860704422,
0.028532445430755615,
-0.18911367654800415,
0.14721199870109558,
0.022523824125528336,
0.39625778794288635,
-0.15960592031478882,
0.0005752593278884888,
0.09587746858596802,
0.3944738209247589,
-0.3650709092617035,
-0.42084237933158875,
-0.4260435700416565,
-0.12062796950340271,
-0.5100451707839966,
-0.09727349877357483,
-0.013930078595876694,
-0.07302290946245193,
0.10012724995613098,
-0.12210902571678162,
0.01818331889808178,
-0.1895841807126999,
0.17484202980995178,
0.07142221182584763,
0.5390269756317139,
0.41421300172805786,
0.04263424873352051,
0.2591198980808258,
0.14587241411209106,
0.37988999485969543,
0.6172281503677368,
-0.492896169424057,
-0.23841030895709991,
0.30180054903030396,
-0.25819334387779236,
0.2507534921169281,
0.06569824367761612,
-0.02404649369418621,
-0.2312869131565094,
-0.06640207767486572,
0.06359418481588364,
-0.2902321219444275,
0.3280174732208252,
0.34390097856521606,
-0.255151629447937,
-0.44256463646888733,
-0.5987231135368347,
0.2749609649181366,
-0.17558038234710693,
-0.029418379068374634,
0.26904261112213135,
-0.002017442137002945,
-0.30608418583869934,
0.29666560888290405,
-0.0053902678191661835,
0.8607081770896912,
-0.14342424273490906,
0.06694772839546204,
-0.021748367697000504,
0.26840880513191223,
0.1787078082561493,
0.30664539337158203,
0.050309084355831146,
-0.3840567469596863,
-0.24950692057609558,
0.0391526073217392,
-0.07514497637748718,
-0.03984527289867401,
0.5132015347480774,
-0.05412374809384346,
0.14682401716709137,
-0.09573877602815628,
-0.21653452515602112,
0.017501607537269592,
0.19414059817790985,
0.009407749399542809,
-0.27488255500793457,
-0.11110885441303253,
0.25612932443618774,
0.05585067346692085,
0.1281212568283081,
-0.007621448487043381,
-0.0030578263103961945,
-0.10074850916862488,
-0.04884979873895645,
0.07633298635482788,
0.16847601532936096,
-0.4958169162273407,
0.17162150144577026,
-0.2444402575492859,
-0.35700005292892456,
-0.1883745938539505,
0.37119293212890625,
-0.3256630301475525,
-0.13488784432411194,
-0.04280313476920128,
0.4270133972167969,
-0.07281173020601273,
0.014748901128768921,
-0.12678413093090057,
-0.3956000506877899,
0.20185741782188416,
0.01729223132133484,
-0.0585327073931694,
-0.3253649175167084,
-0.19513453543186188,
-0.31049564480781555,
0.08888643980026245,
0.10450458526611328,
0.3328547477722168,
-0.27446234226226807,
-0.26796576380729675,
-0.01454879716038704,
-0.16741541028022766,
-0.10607489943504333,
0.11466450989246368,
0.09764305502176285,
-0.043022558093070984,
0.3983992338180542,
-0.1777256429195404,
-0.34608542919158936,
-0.030139198526740074,
0.15561309456825256,
-0.026679690927267075,
-0.05615606904029846,
0.4510688781738281,
0.10620611906051636,
0.16261717677116394,
-0.13246101140975952,
0.35242959856987,
0.27953675389289856,
-0.7004064321517944,
0.15769603848457336,
0.02609061449766159,
0.2720150053501129,
0.2895616888999939,
0.05932649224996567,
0.19733121991157532,
-0.07658152282238007,
-0.18844395875930786,
-0.3777630925178528,
-0.34824198484420776,
-0.03842831775546074,
-0.020348742604255676,
0.2501433789730072,
-0.22093454003334045,
-0.277991384267807,
0.28827401995658875,
-0.01535777933895588,
-0.2657584547996521,
0.054299190640449524,
-0.15682491660118103,
0.17609167098999023,
0.045205071568489075,
0.3385723829269409,
0.10020044445991516,
-0.08466433733701706,
0.05353527516126633,
0.2633993327617645,
0.12702783942222595,
-0.09687384963035583,
-0.25021129846572876,
0.13673612475395203,
0.16564227640628815,
0.31672734022140503,
-0.18133819103240967,
-0.41325587034225464,
-0.2300824522972107,
-0.06431538611650467,
0.15250450372695923,
0.060931846499443054,
-0.16566060483455658,
-0.056318771094083786,
0.1618533730506897,
-0.09477609395980835,
-0.18136340379714966,
0.07811491936445236,
-0.09543951600790024,
0.4431418478488922,
0.33834660053253174,
0.12409710884094238,
0.21269018948078156,
-0.06973230838775635,
-0.3064194619655609,
-0.012781113386154175,
-0.01615414023399353,
-0.014441798441112041,
0.12873885035514832,
-0.15362970530986786,
0.30535876750946045,
0.044370684772729874,
0.35425883531570435,
0.43267399072647095,
-0.18171222507953644,
0.24315983057022095,
0.0935978889465332,
0.20493461191654205,
-0.19750858843326569,
0.024367231875658035,
-0.2915971279144287,
-0.28474777936935425,
-0.02006218582391739,
0.10700839757919312,
-0.12659582495689392,
0.13820722699165344,
-0.08912013471126556,
0.005116701126098633,
0.4331529438495636,
0.15141171216964722,
0.034296661615371704,
0.10114330053329468,
-0.3497248589992523,
0.20551647245883942,
0.2628713548183441,
0.07804936170578003,
-0.1161862313747406,
0.45019716024398804,
-0.10523867607116699,
0.4519403874874115,
-0.002987912856042385,
-0.012542346492409706,
0.16122524440288544,
-0.25495263934135437,
0.03574509546160698,
0.33676624298095703,
0.03530634939670563,
0.022076444700360298,
-0.20874398946762085,
0.1663408875465393,
-0.29218870401382446,
-0.2650839388370514,
0.005685456097126007,
-0.0772257149219513,
0.09734567999839783,
0.19531147181987762,
-0.3834395110607147,
-0.2403506636619568,
-0.41786062717437744,
0.14972993731498718,
-0.1433965563774109,
-0.24236778914928436,
0.13015837967395782,
0.2945602834224701,
-0.15467186272144318,
-0.3036903440952301,
-0.2693497836589813,
0.40325799584388733,
-0.11435550451278687,
-0.2989560663700104,
0.5527175068855286,
0.05251351743936539,
0.1486566960811615,
0.45257145166397095,
0.03730151802301407,
0.3051055073738098,
0.2603345811367035,
0.4639236330986023,
-0.0670127272605896,
0.09944549202919006,
-0.009468715637922287,
-0.21339929103851318,
0.30994853377342224,
0.35315728187561035,
0.3503480553627014,
0.22081613540649414,
0.139141246676445,
-0.15079784393310547,
-0.07324476540088654,
0.03370825946331024,
0.08462937921285629,
-0.05240838602185249,
0.298142671585083,
-0.002135099843144417,
-0.06398046761751175,
-0.28998711705207825,
0.029824815690517426,
-0.4728516936302185,
-0.0017657577991485596,
0.165403813123703,
-0.24906465411186218,
0.007242266088724136,
0.0851500853896141,
0.024337172508239746,
-0.043830569833517075,
0.5769986510276794,
-0.06647291779518127,
0.2561236619949341,
-0.369290292263031,
-0.3526332974433899,
-0.6938745975494385,
0.1773546040058136,
-0.13452355563640594,
-0.10105334967374802,
-0.12243425101041794,
0.24408254027366638,
0.1338455229997635,
0.035608429461717606,
0.36558860540390015,
-0.09583854675292969,
0.19640234112739563,
0.1796969324350357,
-0.2641203999519348,
0.033190708607435226,
-0.003460928797721863,
0.5416674613952637,
0.04701445996761322,
-0.44306832551956177,
0.21549156308174133,
-0.005495425313711166,
-0.0006921738386154175,
0.04794249311089516,
-0.2720925211906433,
0.08985531330108643,
-0.05448424816131592,
0.4351211190223694,
0.09895656257867813,
0.7577958703041077,
-0.25169873237609863,
0.27541863918304443,
-0.22650498151779175,
-0.3572584092617035,
-0.32557356357574463,
-0.0662757009267807,
0.2421010434627533,
0.3127431273460388,
-0.06408324092626572,
0.0534089133143425,
-0.3304278254508972,
0.011670950800180435,
0.023162171244621277,
0.11375117301940918,
-0.4433896541595459,
-0.057694558054208755,
0.0967806875705719,
-0.010813180357217789,
0.24500903487205505,
0.1731879860162735,
-0.03269621357321739,
-0.3690827786922455,
-0.24984215199947357,
-0.02728237956762314,
0.38007891178131104,
-0.2554795742034912,
-0.3787376880645752,
0.02849329635500908,
0.10426567494869232,
0.048056989908218384,
0.21139079332351685,
-0.3290642499923706,
0.11948099732398987,
0.35861125588417053,
-0.042403414845466614,
-0.28727859258651733,
0.24330392479896545,
0.07151445746421814,
0.19590583443641663,
0.13207712769508362,
-0.14762231707572937,
0.19343480467796326,
-0.3366764187812805,
0.23529474437236786,
-0.26462119817733765
] |
https://github.com/huggingface/datasets/issues/5650 | > @WiNE-iNEFF My only guess is that 4 images in your data have `"train"` string in their names (something like `"train_image_0.png"`) and others do not and the loader ignores all the files that do not contain split name in filename. If it's true, please try to remove "train" from filenames. Or maybe they are inside a directory named "train", then the directory should be renamed (unless you want to put only these 4 specific images to the train but apparently you do not).
>
> If there is a bug I cannot investigate it unfortunately because I cannot reproduce your case without some data samples.
I checked my files and some of them do have the words train, valid and test in their names, but the number of such images is more than 500, not 4. | load_dataset can't work correct with my image data | I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked | 136 | load_dataset can't work correct with my image data
I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked
> @WiNE-iNEFF My only guess is that 4 images in your data have `"train"` string in their names (something like `"train_image_0.png"`) and others do not and the loader ignores all the files that do not contain split name in filename. If it's true, please try to remove "train" from filenames. Or maybe they are inside a directory named "train", then the directory should be renamed (unless you want to put only these 4 specific images to the train but apparently you do not).
>
> If there is a bug I cannot investigate it unfortunately because I cannot reproduce your case without some data samples.
I checked my files and some of them do have the words train, valid and test in their names, but the number of such images is more than 500, not 4. | [
-0.2607296109199524,
0.10786649584770203,
0.006297808140516281,
0.7898244261741638,
0.23361162841320038,
0.042052723467350006,
0.34163764119148254,
0.20830076932907104,
0.4157722592353821,
0.1736869066953659,
-0.1088019534945488,
0.15200349688529968,
-0.10837976634502411,
0.0946744829416275,
-0.10308386385440826,
-0.03359042853116989,
0.12974512577056885,
0.07964146137237549,
-0.0157419815659523,
-0.2728458046913147,
-0.22292062640190125,
0.17896819114685059,
-0.25466060638427734,
-0.39698514342308044,
-0.49861034750938416,
0.2181747406721115,
-0.16595828533172607,
0.40337109565734863,
-0.261225163936615,
0.029268883168697357,
-0.02617594599723816,
-0.056586045771837234,
0.2767048478126526,
0.6575321555137634,
-0.00012019706628052518,
0.0352264940738678,
0.10993925482034683,
-0.3219955265522003,
-0.05379287898540497,
-0.12820439040660858,
-0.3535897731781006,
-0.02705979347229004,
0.0881534069776535,
-0.15642334520816803,
0.1146935522556305,
0.1805761754512787,
-0.14162509143352509,
-0.17994457483291626,
0.4870016574859619,
0.5206982493400574,
0.16718518733978271,
-0.38505107164382935,
0.0010660961270332336,
0.0011381246149539948,
0.22615687549114227,
0.3975693881511688,
-0.03518107533454895,
0.2998979687690735,
-0.033575475215911865,
-0.06205401569604874,
0.07633765041828156,
0.21253609657287598,
0.03175122290849686,
0.11474178731441498,
0.2586265504360199,
0.028874795883893967,
-0.1267695128917694,
-0.6647117137908936,
-0.14150702953338623,
0.018628068268299103,
0.5014959573745728,
0.1256512701511383,
-0.2829499840736389,
-0.20153144001960754,
0.07611711323261261,
0.09995335340499878,
0.17188821732997894,
0.08625993132591248,
-0.159739688038826,
-0.13950754702091217,
-0.18558292090892792,
0.018246177583932877,
-0.38309651613235474,
0.24689379334449768,
0.11658333241939545,
0.07633814215660095,
-0.04568321257829666,
0.33948051929473877,
0.397061288356781,
0.16745631396770477,
-0.011928685009479523,
-0.12012697011232376,
-0.13332350552082062,
0.16545429825782776,
-0.41289767622947693,
0.03663971275091171,
-0.46446552872657776,
0.6149505376815796,
0.05329315364360809,
0.1860988438129425,
0.07889410853385925,
0.04196777194738388,
0.1375523805618286,
0.12797152996063232,
0.07247638702392578,
0.1945580244064331,
0.1720728874206543,
0.17152822017669678,
0.033996786922216415,
-0.16868801414966583,
-0.40382614731788635,
0.027102291584014893,
-0.6782557368278503,
-0.31001806259155273,
-0.16804245114326477,
-0.1354019045829773,
-0.028045468032360077,
-0.18184040486812592,
-0.1566106677055359,
-0.41638556122779846,
0.1261693835258484,
-0.23453135788440704,
0.24522355198860168,
0.4349086284637451,
0.14447316527366638,
0.22446513175964355,
-0.025527451187372208,
0.17159609496593475,
-0.21786832809448242,
-0.23894581198692322,
-0.07991921901702881,
0.04082472249865532,
-0.4920799434185028,
0.13414627313613892,
0.19793102145195007,
-0.1511380672454834,
0.16953779757022858,
0.029952451586723328,
0.053514767438173294,
-0.22393028438091278,
0.1727031171321869,
-0.5858357548713684,
0.034114859998226166,
0.10509971529245377,
-0.05459975823760033,
0.03677252680063248,
0.11606425046920776,
-0.26718345284461975,
0.03634063899517059,
0.20122238993644714,
-0.7263861298561096,
-0.09593524038791656,
-0.1806696653366089,
0.09641128033399582,
-0.12097951769828796,
-0.14241576194763184,
-0.5109609365463257,
0.18786635994911194,
0.1726115643978119,
-0.19960513710975647,
-0.10205370932817459,
-0.20065206289291382,
-0.13461586833000183,
-0.15450964868068695,
0.2366631180047989,
0.5056262016296387,
-0.7795029282569885,
0.08174781501293182,
-0.22302554547786713,
-0.24178102612495422,
0.20229992270469666,
0.3098016381263733,
-0.13212086260318756,
0.27278760075569153,
-0.19163745641708374,
-0.06859645247459412,
0.2843473553657532,
-0.08819779008626938,
-0.47220438718795776,
0.24429114162921906,
0.1968664526939392,
-0.2294502556324005,
0.07167915999889374,
0.3745671510696411,
0.4195810556411743,
-0.05871798098087311,
-0.05977662280201912,
0.21719107031822205,
-0.0904359221458435,
-0.0471777468919754,
0.018185459077358246,
0.07315010577440262,
0.15737295150756836,
0.2444927841424942,
-0.06625726819038391,
0.30246439576148987,
0.19983240962028503,
-0.09535036236047745,
0.27688315510749817,
0.02635788545012474,
0.17003017663955688,
0.31314608454704285,
0.1790643036365509,
0.3948501646518707,
0.3282751142978668,
0.23507876694202423,
-0.28419458866119385,
0.28107428550720215,
0.20619583129882812,
0.004391958005726337,
-0.11947369575500488,
0.22387611865997314,
-0.2775973677635193,
-0.1303592324256897,
-0.49330776929855347,
-0.09165539592504501,
-0.018953263759613037,
0.16708731651306152,
0.054081305861473083,
-0.3204502463340759,
-0.2332272231578827,
0.3748926520347595,
-0.1785224974155426,
0.06248581036925316,
-0.17796412110328674,
0.43373483419418335,
-0.060455240309238434,
-0.26122066378593445,
-0.1022249162197113,
-0.3155535161495209,
0.07685917615890503,
-0.20950853824615479,
-0.1358623504638672,
0.30894356966018677,
0.5274257063865662,
-0.17583279311656952,
0.030811524018645287,
-0.17213624715805054,
0.21063411235809326,
-0.28497737646102905,
0.02219090797007084,
-0.11312706768512726,
0.40624797344207764,
-0.15326765179634094,
-0.21680793166160583,
-0.14078623056411743,
-0.15756453573703766,
0.40558186173439026,
-0.15062591433525085,
-0.12237794697284698,
0.05634588003158569,
-0.0825386643409729,
0.23135420680046082,
-0.03566954284906387,
0.15023274719715118,
0.014112070202827454,
0.40795403718948364,
0.1556708812713623,
0.05607184022665024,
-0.249642014503479,
0.10131275653839111,
0.08888775110244751,
-0.20700474083423615,
0.30287835001945496,
-0.13751646876335144,
0.031705550849437714,
0.17410404980182648,
0.3209298253059387,
0.683050274848938,
0.18324321508407593,
-0.1345435231924057,
-0.0955917239189148,
0.1912674456834793,
-0.08780664205551147,
0.02591824159026146,
-0.004228502511978149,
0.635623574256897,
0.20174333453178406,
-0.1789679229259491,
0.03877152502536774,
-0.3782067894935608,
-0.26530885696411133,
0.34861472249031067,
0.2335105985403061,
-0.2857722342014313,
0.15512552857398987,
0.11163477599620819,
-0.10484587401151657,
-0.06615707278251648,
0.08625586330890656,
-0.3698594272136688,
0.07185918092727661,
0.005533577874302864,
0.0921589732170105,
0.09484972059726715,
-0.020438119769096375,
-0.07936856895685196,
0.1416328102350235,
0.08602973073720932,
-0.3083422780036926,
-0.3647117018699646,
0.16260769963264465,
-0.2319454848766327,
0.02165863662958145,
0.28602808713912964,
0.011218048632144928,
0.16702333092689514,
-0.06176737695932388,
-0.11184322088956833,
0.04431512951850891,
-0.29424867033958435,
0.200325608253479,
-0.24731120467185974,
0.31584563851356506,
-0.11104750633239746,
0.23946070671081543,
0.12793976068496704,
-0.24892301857471466,
0.27772313356399536,
-0.22482946515083313,
-0.15586000680923462,
0.061881110072135925,
-0.052338723093271255,
0.083455391228199,
-0.092767134308815,
-0.26813793182373047,
-0.3513517379760742,
-0.2238064855337143,
-0.03925694152712822,
0.40127840638160706,
0.13912223279476166,
0.21063025295734406,
0.40145522356033325,
-0.20185275375843048,
0.10330517590045929,
-0.089906245470047,
-0.12145766615867615,
-0.20149333775043488,
0.36239778995513916,
-0.047109536826610565,
-0.2525351345539093,
0.16522985696792603,
-0.0028560757637023926,
-0.026026874780654907,
0.22118119895458221,
-0.4450128674507141,
-0.12774404883384705,
-0.035924434661865234,
-0.20918211340904236,
-0.11333060264587402,
-0.008887011557817459,
0.03641148656606674,
-0.23137721419334412,
0.04384724795818329,
-0.35079431533813477,
-0.04301493614912033,
0.2314971536397934,
-0.1371094286441803,
0.4589822590351105,
-0.15811944007873535,
0.21072210371494293,
-0.16666656732559204,
0.08812962472438812,
0.10630200803279877,
-0.05843067914247513,
0.3899703025817871,
-0.24106058478355408,
0.2765205502510071,
-0.19312705099582672,
0.010682977735996246,
0.35770371556282043,
-0.015030696988105774,
-0.24006816744804382,
0.25034791231155396,
0.10677103698253632,
-0.2216060757637024,
-0.08593935519456863,
0.17422352731227875,
-0.2323632836341858,
0.0451672226190567,
0.23854565620422363,
0.04587859287858009,
0.04273449257016182,
-0.2263033241033554,
-0.10370903462171555,
0.07082816958427429,
-0.18829049170017242,
-0.030320556834340096,
0.19551154971122742,
0.12884803116321564,
0.024462055414915085,
-0.38640981912612915,
0.20056971907615662,
-0.03715785965323448,
0.36408546566963196,
-0.08616755902767181,
0.15853111445903778,
-0.17671720683574677,
0.12205629050731659,
0.12074867635965347,
0.2147524356842041,
1.0435597896575928,
-0.246928408741951,
-0.25136950612068176,
0.086967334151268,
0.07850079238414764,
-0.33494046330451965,
0.025519132614135742,
-0.19907602667808533,
0.13508109748363495,
0.02774207666516304,
0.3873060345649719,
-0.17894074320793152,
0.003399580717086792,
0.08474913239479065,
0.4141846299171448,
-0.35251694917678833,
-0.42749083042144775,
-0.4180034101009369,
-0.0981583446264267,
-0.4941510558128357,
-0.1321440190076828,
0.004950389266014099,
-0.07219181954860687,
0.12594641745090485,
-0.10474337637424469,
0.00514519028365612,
-0.19641664624214172,
0.21267151832580566,
0.07476955652236938,
0.5313391089439392,
0.41334518790245056,
0.01651991903781891,
0.28163477778434753,
0.12926927208900452,
0.3544568121433258,
0.6032309532165527,
-0.5181836485862732,
-0.24622175097465515,
0.2782958745956421,
-0.23727631568908691,
0.2802281975746155,
0.06286906450986862,
-0.006707422435283661,
-0.2508302330970764,
-0.01538855955004692,
0.05784490332007408,
-0.2922685742378235,
0.36110860109329224,
0.35828012228012085,
-0.257229745388031,
-0.502434492111206,
-0.6238521933555603,
0.2868450880050659,
-0.17766088247299194,
-0.04635024815797806,
0.3273092210292816,
0.011397816240787506,
-0.32173532247543335,
0.25280696153640747,
0.022750265896320343,
0.9004528522491455,
-0.14476847648620605,
0.053932685405015945,
-0.07485871016979218,
0.27941766381263733,
0.1897760033607483,
0.27277153730392456,
0.04567458853125572,
-0.3482511639595032,
-0.2822716534137726,
0.0026845261454582214,
-0.06110730022192001,
-0.014993542805314064,
0.5546162128448486,
-0.016447491943836212,
0.16727674007415771,
-0.0799887403845787,
-0.20839788019657135,
0.04556778818368912,
0.19104424118995667,
0.03953767567873001,
-0.2669019401073456,
-0.10212785005569458,
0.20814834535121918,
0.04706956073641777,
0.11604039371013641,
-0.003924895077943802,
0.020184263586997986,
-0.09103772789239883,
-0.03760163486003876,
0.07461276650428772,
0.14470088481903076,
-0.5143782496452332,
0.15818797051906586,
-0.20867547392845154,
-0.33346277475357056,
-0.16446368396282196,
0.3962651491165161,
-0.30223944783210754,
-0.11606566607952118,
-0.025934506207704544,
0.40947771072387695,
-0.07952365279197693,
0.010650355368852615,
-0.10609667003154755,
-0.38496658205986023,
0.20915542542934418,
0.032295651733875275,
-0.07557420432567596,
-0.28780433535575867,
-0.19922597706317902,
-0.3241199254989624,
0.05600428581237793,
0.10821202397346497,
0.34466367959976196,
-0.27591243386268616,
-0.26745229959487915,
-0.021157607436180115,
-0.16867738962173462,
-0.09447617083787918,
0.06624046713113785,
0.09872042387723923,
-0.05921892821788788,
0.40153634548187256,
-0.20657117664813995,
-0.34203794598579407,
-0.028343547135591507,
0.12217915058135986,
-0.04667153209447861,
-0.04879613220691681,
0.4409902095794678,
0.09370875358581543,
0.16463911533355713,
-0.09556989371776581,
0.3759011924266815,
0.2833546996116638,
-0.7191146612167358,
0.12248843163251877,
-0.00011397525668144226,
0.22519388794898987,
0.2671845257282257,
0.06264512240886688,
0.2094564437866211,
-0.0650082528591156,
-0.1744249314069748,
-0.3943328857421875,
-0.3335484266281128,
-0.03579429164528847,
-0.01568029820919037,
0.2031775414943695,
-0.1805206835269928,
-0.28983044624328613,
0.30705106258392334,
-0.0026962347328662872,
-0.2061706781387329,
0.023402757942676544,
-0.15724167227745056,
0.20212283730506897,
0.05224453657865524,
0.3644604980945587,
0.10638903081417084,
-0.11462780833244324,
0.005529426038265228,
0.25931641459465027,
0.1460219770669937,
-0.04294707626104355,
-0.2647537887096405,
0.16868191957473755,
0.18300016224384308,
0.3147384524345398,
-0.20874260365962982,
-0.4457823932170868,
-0.21650853753089905,
-0.09259635210037231,
0.11385409533977509,
0.07152606546878815,
-0.14329840242862701,
-0.026877515017986298,
0.16136939823627472,
-0.09666824340820312,
-0.2036331593990326,
0.08998623490333557,
-0.09625592827796936,
0.473259836435318,
0.3416558802127838,
0.11803103983402252,
0.26926010847091675,
-0.04902057349681854,
-0.3535356819629669,
-0.00023154914379119873,
-0.02519424632191658,
-0.051305197179317474,
0.14568831026554108,
-0.15532156825065613,
0.3361402750015259,
0.054386530071496964,
0.35753604769706726,
0.4854159355163574,
-0.17530658841133118,
0.2173386663198471,
0.1401331126689911,
0.14973647892475128,
-0.1898781657218933,
0.010474562644958496,
-0.27589085698127747,
-0.25712549686431885,
-0.024995878338813782,
0.13286542892456055,
-0.14534422755241394,
0.14570043981075287,
-0.10679075121879578,
0.007291354238986969,
0.43932509422302246,
0.13267186284065247,
0.04916665330529213,
0.132632777094841,
-0.3164216876029968,
0.22426508367061615,
0.2864210903644562,
0.06453388929367065,
-0.14760097861289978,
0.460833340883255,
-0.0855548158288002,
0.46456480026245117,
0.026378098875284195,
0.03610963746905327,
0.19654317200183868,
-0.1822947859764099,
0.056640319526195526,
0.3865933120250702,
0.046301569789648056,
0.023193825036287308,
-0.21200095117092133,
0.11769501119852066,
-0.28298652172088623,
-0.2552042007446289,
0.003095269203186035,
-0.10403385013341904,
0.13849669694900513,
0.20758435130119324,
-0.38159823417663574,
-0.2504727244377136,
-0.4246924817562103,
0.1314319670200348,
-0.13248547911643982,
-0.2657407522201538,
0.1881270706653595,
0.3077673017978668,
-0.16998213529586792,
-0.32032909989356995,
-0.3009217083454132,
0.42279961705207825,
-0.08547656238079071,
-0.33143430948257446,
0.5541519522666931,
0.07532084733247757,
0.1308048963546753,
0.4400787949562073,
0.059630267322063446,
0.31129559874534607,
0.2637271583080292,
0.4658524990081787,
-0.0836545079946518,
0.08613204956054688,
-0.016012340784072876,
-0.19798919558525085,
0.3599299490451813,
0.35964223742485046,
0.3767605721950531,
0.2085801362991333,
0.08303197473287582,
-0.11807489395141602,
-0.053182218223810196,
0.0275923702865839,
0.08240708708763123,
-0.09324216842651367,
0.29956138134002686,
-0.0017462223768234253,
-0.06635823845863342,
-0.2888273000717163,
0.01978890411555767,
-0.4846116602420807,
0.035554490983486176,
0.1702706664800644,
-0.2611338794231415,
0.01106857880949974,
0.10064056515693665,
-0.007699763402342796,
-0.030768422409892082,
0.5453169345855713,
-0.06516042351722717,
0.26942116022109985,
-0.4036833345890045,
-0.3503272235393524,
-0.6875771284103394,
0.1451893001794815,
-0.1324893981218338,
-0.119462750852108,
-0.09231060743331909,
0.21951481699943542,
0.15653091669082642,
0.052275821566581726,
0.37490731477737427,
-0.1099439263343811,
0.20537802577018738,
0.16419316828250885,
-0.24431930482387543,
-0.002209953498095274,
0.0020135119557380676,
0.5676386952400208,
0.02187161147594452,
-0.4432826638221741,
0.23005884885787964,
-0.015122704207897186,
-0.06566909700632095,
0.047643642872571945,
-0.28781813383102417,
0.10438330471515656,
-0.011395781300961971,
0.4149302542209625,
0.12014621496200562,
0.7809678912162781,
-0.25575894117355347,
0.3010018467903137,
-0.18770387768745422,
-0.33115893602371216,
-0.3430420160293579,
-0.021893884986639023,
0.24298131465911865,
0.307725191116333,
-0.11900433897972107,
0.05423903837800026,
-0.3198307454586029,
0.00850018858909607,
0.02333647757768631,
0.13272824883460999,
-0.49807363748550415,
-0.09536965936422348,
0.08073320984840393,
-0.022166414186358452,
0.25830626487731934,
0.14877140522003174,
-0.031777363270521164,
-0.37495696544647217,
-0.2538984417915344,
-0.0042754411697387695,
0.38127705454826355,
-0.26709645986557007,
-0.38563257455825806,
0.014213841408491135,
0.09061095118522644,
0.0734369307756424,
0.21329623460769653,
-0.3370071351528168,
0.10217787325382233,
0.4005824029445648,
-0.032224513590335846,
-0.2788091003894806,
0.22437675297260284,
0.09417662769556046,
0.20231503248214722,
0.15200376510620117,
-0.15765699744224548,
0.2089630365371704,
-0.3653067350387573,
0.23965761065483093,
-0.24773554503917694
] |
https://github.com/huggingface/datasets/issues/5650 | @WiNE-iNEFF Probably they are named inconsistently so that the correct pattern for which files should correspond to which split cannot be inferred. You can make it clearer to the loader by removing split names from filenames and putting files in separate folder for each split (you can take a look at the [documentation for imagefolder](https://huggingface.co/docs/datasets/image_dataset#imagefolder)):
```
Fuaimeanna2/
├─ test
│ ├─ label_0
│ │ ├── filename_0.jpg
│ │ └── filename_1.jpg
│ │ └── ...
│ ├─ label_1
│ │ └── ...
│ ├─ label_2
│ │ └── ...
│ └─ label_3
│ └── ...
├─ train
│ ├─ label_0
│ │ └── ...
│ ├─ label_1
│ │ └── ...
│ ├─ label_2
│ │ └── ...
│ └─ label_3
│ └── ...
└── validation
├─ label_0
│ └── ...
├─ label_1
│ └── ...
├─ label_2
│ └── ...
└─ label_3
└── ...
``` | load_dataset can't work correct with my image data | I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked | 145 | load_dataset can't work correct with my image data
I have about 20000 images in my folder which divided into 4 folders with class names.
When i use load_dataset("my_folder_name", split="train") this function create dataset in which there are only 4 images, the remaining 19000 images were not added there. What is the problem and did not understand. Tried converting images and the like but absolutely nothing worked
@WiNE-iNEFF Probably they are named inconsistently so that the correct pattern for which files should correspond to which split cannot be inferred. You can make it clearer to the loader by removing split names from filenames and putting files in separate folder for each split (you can take a look at the [documentation for imagefolder](https://huggingface.co/docs/datasets/image_dataset#imagefolder)):
```
Fuaimeanna2/
├─ test
│ ├─ label_0
│ │ ├── filename_0.jpg
│ │ └── filename_1.jpg
│ │ └── ...
│ ├─ label_1
│ │ └── ...
│ ├─ label_2
│ │ └── ...
│ └─ label_3
│ └── ...
├─ train
│ ├─ label_0
│ │ └── ...
│ ├─ label_1
│ │ └── ...
│ ├─ label_2
│ │ └── ...
│ └─ label_3
│ └── ...
└── validation
├─ label_0
│ └── ...
├─ label_1
│ └── ...
├─ label_2
│ └── ...
└─ label_3
└── ...
``` | [
-0.15141336619853973,
-0.10156199336051941,
0.011981703341007233,
0.8929697871208191,
0.24488727748394012,
0.015088357031345367,
0.38042744994163513,
0.0658925324678421,
0.4348651170730591,
0.12483051419258118,
-0.14608129858970642,
0.009876273572444916,
-0.0752858892083168,
0.2638666331768036,
-0.08109018206596375,
-0.1720045655965805,
0.20882219076156616,
0.025386152788996696,
0.0020442213863134384,
-0.2939072847366333,
-0.24789142608642578,
0.2237815409898758,
-0.24990637600421906,
-0.3271157741546631,
-0.5230505466461182,
0.19037921726703644,
-0.16260062158107758,
0.36243849992752075,
-0.28738388419151306,
0.0995800644159317,
-0.023464057594537735,
-0.0181818138808012,
0.2511715292930603,
0.7239479422569275,
-0.00012871413491666317,
0.0771903246641159,
0.1294027864933014,
-0.3239678740501404,
-0.05394524708390236,
-0.13693304359912872,
-0.27596041560173035,
0.0023552626371383667,
0.06987293064594269,
-0.1229306012392044,
0.09546802937984467,
0.065306156873703,
-0.0867319405078888,
-0.00666443258523941,
0.4725438058376312,
0.30554139614105225,
0.0780746266245842,
-0.27924400568008423,
-0.02238546311855316,
0.11343331634998322,
0.19923138618469238,
0.4664064943790436,
-0.02685718983411789,
0.36597657203674316,
-0.09085370600223541,
-0.042781684547662735,
0.004629097878932953,
0.15779802203178406,
0.04237473011016846,
0.14442166686058044,
0.2882760167121887,
0.16071227192878723,
-0.19384579360485077,
-0.5937607884407043,
-0.09464108198881149,
0.15398871898651123,
0.39237189292907715,
0.09432311356067657,
-0.3244510293006897,
-0.36496055126190186,
-0.06506766378879547,
-0.03908302262425423,
0.22627779841423035,
0.241901233792305,
-0.14777815341949463,
-0.17026978731155396,
-0.20663201808929443,
0.04974115639925003,
-0.3240867257118225,
0.25786352157592773,
0.05817645788192749,
0.02724830061197281,
-0.16718898713588715,
0.3270704746246338,
0.44929295778274536,
0.22042953968048096,
-0.04110201820731163,
-0.1906663477420807,
-0.026522021740674973,
0.19179140031337738,
-0.29301634430885315,
0.02773076295852661,
-0.43997305631637573,
0.7084764838218689,
0.1470286250114441,
0.21348807215690613,
-0.006042899563908577,
-0.041892699897289276,
-0.029380647465586662,
0.1268921047449112,
0.1574450433254242,
0.23911289870738983,
0.12187033891677856,
0.1647917777299881,
0.037843793630599976,
0.08380047976970673,
-0.304560124874115,
0.021461565047502518,
-0.5159841179847717,
-0.23960117995738983,
-0.24324092268943787,
-0.26677680015563965,
-0.034548647701740265,
-0.0158546045422554,
-0.1285332590341568,
-0.4015372693538666,
0.14374792575836182,
-0.2853156328201294,
0.22451984882354736,
0.39158886671066284,
0.15858730673789978,
0.12447836250066757,
0.02066878229379654,
0.24913153052330017,
-0.1994057148694992,
-0.22131547331809998,
-0.08308964967727661,
-0.013758582063019276,
-0.4311593770980835,
0.21412122249603271,
0.08547897636890411,
-0.23398250341415405,
0.19644078612327576,
0.10251658409833908,
0.028595250099897385,
-0.17224276065826416,
0.017850592732429504,
-0.5656169056892395,
0.10099630057811737,
0.13086006045341492,
-0.023305781185626984,
0.026556722819805145,
0.13738881051540375,
-0.1655483841896057,
-0.012775011360645294,
0.06254532188177109,
-0.7664704322814941,
-0.0033092573285102844,
-0.05283453315496445,
-0.013266939669847488,
-0.15968549251556396,
-0.04188041761517525,
-0.6976624727249146,
0.23912186920642853,
0.15460632741451263,
-0.19062989950180054,
0.0643942728638649,
-0.1500507891178131,
-0.1594836562871933,
-0.16819894313812256,
0.16364383697509766,
0.5983350276947021,
-0.6010921001434326,
-0.010900475084781647,
-0.15733805298805237,
-0.2811136543750763,
0.15457171201705933,
0.39012202620506287,
-0.051227062940597534,
0.3433324694633484,
-0.3511170744895935,
-0.04139428585767746,
0.26310792565345764,
-0.17394694685935974,
-0.29204291105270386,
0.22825351357460022,
0.19170819222927094,
-0.10516151785850525,
0.1706976741552353,
0.28196433186531067,
0.3069283366203308,
-0.06777419149875641,
-0.11869226396083832,
0.16018956899642944,
-0.15446797013282776,
-0.040947478264570236,
0.12413385510444641,
-0.06794963032007217,
0.12388397753238678,
0.17170944809913635,
-0.14737260341644287,
0.20226173102855682,
0.15632759034633636,
-0.14526529610157013,
0.2914051115512848,
-0.06727125495672226,
0.23897269368171692,
0.21428677439689636,
0.13298003375530243,
0.4201696515083313,
0.25175702571868896,
0.276952862739563,
-0.485811710357666,
0.2537454068660736,
0.1893351674079895,
-0.010931722819805145,
-0.07205760478973389,
0.24349474906921387,
-0.25337252020835876,
-0.19212093949317932,
-0.5306504964828491,
-0.1677427738904953,
-0.1155182272195816,
0.18865731358528137,
0.15317124128341675,
-0.29823845624923706,
-0.26234424114227295,
0.40074455738067627,
-0.2091771960258484,
0.1486826390028,
-0.35557618737220764,
0.48559314012527466,
0.06064604967832565,
-0.2583465278148651,
-0.11682601273059845,
-0.25969478487968445,
0.009155429899692535,
-0.24136710166931152,
0.008229028433561325,
0.3087242841720581,
0.5341229438781738,
-0.17868368327617645,
0.008282091468572617,
-0.0669722631573677,
0.22169357538223267,
-0.19672183692455292,
0.0786491110920906,
-0.16865494847297668,
0.33672767877578735,
-0.12824994325637817,
-0.2346305400133133,
-0.05612126737833023,
-0.22224114835262299,
0.45974940061569214,
-0.11915894597768784,
-0.215595543384552,
0.045302025973796844,
-0.0412866473197937,
0.14366492629051208,
-0.0037881135940551758,
0.20193928480148315,
-0.02888394333422184,
0.42185771465301514,
0.16767744719982147,
-0.039029330015182495,
-0.19929204881191254,
0.13811251521110535,
-0.021511193364858627,
-0.18635571002960205,
0.3123730421066284,
-0.1576024293899536,
0.05261905491352081,
0.1084616631269455,
0.26903384923934937,
0.675467848777771,
0.074510857462883,
-0.14478422701358795,
-0.03721559792757034,
0.15899547934532166,
-0.0658043697476387,
-0.024059489369392395,
0.02252022735774517,
0.6305781006813049,
0.20055760443210602,
-0.20045609772205353,
-0.05137668550014496,
-0.42967715859413147,
-0.1957545280456543,
0.29174545407295227,
0.19548624753952026,
-0.3380528688430786,
0.22080498933792114,
0.11275635659694672,
-0.17626693844795227,
-0.12436522543430328,
0.08218444883823395,
-0.39381143450737,
0.09675635397434235,
-0.10176803171634674,
0.16761556267738342,
0.16011300683021545,
-0.07079808413982391,
-0.0332433320581913,
0.20669904351234436,
0.04703391343355179,
-0.3116062581539154,
-0.39734190702438354,
0.2194669544696808,
-0.11544433236122131,
-0.07072439044713974,
0.22955931723117828,
-0.06084420904517174,
0.1442485749721527,
-0.2817091941833496,
-0.23755300045013428,
-0.016954787075519562,
-0.26878637075424194,
0.28515803813934326,
-0.3452025353908539,
0.3203229606151581,
0.058102842420339584,
0.3320593237876892,
0.13810592889785767,
-0.17812059819698334,
0.3201664090156555,
-0.14023816585540771,
-0.24373167753219604,
0.041356295347213745,
-0.04377007111907005,
0.07546304166316986,
-0.08072284609079361,
-0.10860878974199295,
-0.2993181049823761,
-0.18692074716091156,
0.19661317765712738,
0.38856208324432373,
0.1344231814146042,
0.23155853152275085,
0.40747201442718506,
-0.2912808656692505,
-0.11976295709609985,
-0.06729196012020111,
-0.15476201474666595,
-0.2995859682559967,
0.303379625082016,
0.010099440813064575,
-0.277119517326355,
0.04396846145391464,
-0.09640911221504211,
-0.02392720617353916,
0.15433739125728607,
-0.37231317162513733,
-0.29391977190971375,
-0.020549019798636436,
-0.1432299166917801,
0.05426683649420738,
0.21895435452461243,
-0.02789849042892456,
-0.3094908595085144,
0.18260689079761505,
-0.31758275628089905,
-0.13699249923229218,
0.20808574557304382,
-0.07975511252880096,
0.4461821913719177,
-0.017555223777890205,
0.2564406394958496,
-0.20688708126544952,
0.23735271394252777,
0.1736554354429245,
-0.027831705287098885,
0.42183661460876465,
-0.24048002064228058,
0.4121035933494568,
-0.2388666719198227,
0.033345893025398254,
0.3732476830482483,
0.03208944946527481,
-0.13506096601486206,
0.24546827375888824,
0.12044345587491989,
0.000995498150587082,
-0.07364478707313538,
0.14066863059997559,
-0.2803352475166321,
0.014214776456356049,
0.24034017324447632,
0.24315090477466583,
0.02859625220298767,
-0.25708240270614624,
-0.15339213609695435,
0.09997420012950897,
-0.1959930807352066,
-0.018679864704608917,
0.3910631239414215,
0.1957862377166748,
0.16099491715431213,
-0.40338122844696045,
0.2736257314682007,
0.060797497630119324,
0.3494555950164795,
-0.0036916732788085938,
0.03270439803600311,
-0.16631174087524414,
0.0805787593126297,
0.14787811040878296,
0.2551501989364624,
1.1125251054763794,
-0.10463328659534454,
-0.22834420204162598,
-0.011828966438770294,
-0.04472063109278679,
-0.38859155774116516,
0.00638049840927124,
-0.15141946077346802,
-0.025436175987124443,
0.01116853766143322,
0.6001843214035034,
-0.35457146167755127,
-0.1546543836593628,
0.09980512410402298,
0.49451854825019836,
-0.35171642899513245,
-0.39347636699676514,
-0.46685898303985596,
-0.13781842589378357,
-0.4128395915031433,
-0.18520289659500122,
0.07333043217658997,
-0.07522714138031006,
0.1692194640636444,
-0.004620090126991272,
0.02302091382443905,
-0.2608005404472351,
0.17922432720661163,
0.06492537260055542,
0.4944417178630829,
0.31191426515579224,
0.019944466650485992,
0.3521292805671692,
0.14582841098308563,
0.3259786367416382,
0.6764864921569824,
-0.5999301671981812,
-0.3422578275203705,
0.2868236303329468,
-0.09096717834472656,
0.2675173878669739,
0.1266518086194992,
-0.01387246698141098,
-0.211283341050148,
-0.011872150003910065,
0.1451706439256668,
-0.34700995683670044,
0.2844470143318176,
0.3866158723831177,
-0.1530591994524002,
-0.4694352149963379,
-0.5469472408294678,
0.43893876671791077,
-0.11401239037513733,
-0.03470112383365631,
0.2947152554988861,
0.29466789960861206,
-0.28255364298820496,
0.15344353020191193,
-0.12084273993968964,
0.9594821929931641,
-0.07370610535144806,
0.20573213696479797,
0.12607067823410034,
0.17154128849506378,
0.22635802626609802,
0.2840690016746521,
0.055814046412706375,
-0.3286900818347931,
-0.18092429637908936,
-0.0774795338511467,
-0.09518729150295258,
-0.00950881652534008,
0.4652450382709503,
0.13429708778858185,
0.34033989906311035,
-0.12864117324352264,
-0.1899993121623993,
-0.0022931471467018127,
0.1735491305589676,
-0.028578225523233414,
-0.2218833863735199,
-0.2609420716762543,
0.06615366041660309,
0.14060676097869873,
0.2987302541732788,
0.030224919319152832,
0.08772754669189453,
-0.14458267390727997,
-0.06430788338184357,
0.02566322684288025,
0.028311774134635925,
-0.5364122986793518,
-0.040451664477586746,
0.08451411128044128,
-0.3681912422180176,
-0.2507164776325226,
0.426486611366272,
-0.2509803771972656,
-0.2898891568183899,
0.07464651763439178,
0.2769887149333954,
-0.1995050013065338,
0.015031296759843826,
-0.11132295429706573,
-0.3321593403816223,
0.2070702314376831,
0.04637366533279419,
0.04046078026294708,
-0.3557565212249756,
-0.16826781630516052,
-0.2828577160835266,
-0.043816208839416504,
0.16052956879138947,
0.19193577766418457,
-0.3460018038749695,
-0.2718719244003296,
-0.09948539733886719,
-0.031662002205848694,
-0.056706465780735016,
-0.03610749542713165,
0.18819230794906616,
0.009528852999210358,
0.3074306845664978,
-0.20767450332641602,
-0.3378831744194031,
-0.05833236873149872,
0.14128603041172028,
-0.08571668714284897,
0.020316503942012787,
0.35858359932899475,
0.08941131085157394,
0.10342507064342499,
-0.008009493350982666,
0.381416380405426,
0.4251089096069336,
-0.7144968509674072,
0.2378360629081726,
0.086801677942276,
0.13056960701942444,
0.060564182698726654,
0.1540299355983734,
0.2585574686527252,
-0.14854000508785248,
-0.09555403888225555,
-0.4040032923221588,
-0.3218139410018921,
0.06791050732135773,
-0.015480615198612213,
0.12131758034229279,
-0.11699413508176804,
-0.36022040247917175,
0.3281309902667999,
-0.0008953791111707687,
-0.10288126021623611,
0.11512640118598938,
-0.06712548434734344,
0.183855801820755,
0.27328169345855713,
0.26586806774139404,
0.3030672073364258,
-0.08230435848236084,
-0.0668812096118927,
0.09082697331905365,
0.05575161427259445,
0.0472007691860199,
-0.3437650799751282,
0.2245609015226364,
0.1982305943965912,
0.2473789006471634,
-0.12151789665222168,
-0.37291792035102844,
-0.17506802082061768,
-0.21862387657165527,
0.21327784657478333,
0.0826340988278389,
-0.07585467398166656,
-0.05979807674884796,
0.07676757872104645,
-0.07849770784378052,
-0.20402449369430542,
0.12739382684230804,
-0.11335565894842148,
0.5304566025733948,
0.4434892237186432,
-0.022110888734459877,
0.18147331476211548,
-0.05439668893814087,
-0.22599445283412933,
0.10877369344234467,
0.1284925937652588,
-0.13970071077346802,
0.1289094239473343,
-0.11678153276443481,
0.37671178579330444,
-0.022613298147916794,
0.3922964036464691,
0.5090759992599487,
-0.19701820611953735,
0.21740178763866425,
0.11326777189970016,
-0.0017535514198243618,
-0.1606704443693161,
0.03611692786216736,
-0.19499963521957397,
-0.1505572497844696,
-0.033577241003513336,
0.287589967250824,
-0.18062333762645721,
0.1959402859210968,
-0.2627182900905609,
-0.03028116002678871,
0.46008700132369995,
0.19320879876613617,
0.02814032882452011,
0.15461553633213043,
-0.3007376790046692,
0.3189981281757355,
0.413921594619751,
0.07752770185470581,
-0.19869732856750488,
0.31143271923065186,
-0.13592328131198883,
0.35789182782173157,
-0.20107319951057434,
0.07558366656303406,
0.2509227693080902,
-0.24201147258281708,
-0.08410519361495972,
0.363567590713501,
0.11726903915405273,
-0.029164906591176987,
-0.3094130754470825,
0.24987941980361938,
-0.2118961215019226,
-0.20701536536216736,
-0.023824550211429596,
-0.03949231281876564,
0.1609300971031189,
0.08298297971487045,
-0.31490468978881836,
-0.30955252051353455,
-0.33078715205192566,
0.15697160363197327,
-0.09226998686790466,
-0.4755064845085144,
0.25566214323043823,
0.2293185144662857,
-0.1960449516773224,
-0.31464290618896484,
-0.31312865018844604,
0.39913415908813477,
-0.05480802059173584,
-0.20830364525318146,
0.6007123589515686,
0.06977863609790802,
0.11219903826713562,
0.42863941192626953,
0.15310174226760864,
0.30724218487739563,
0.26596152782440186,
0.5159923434257507,
-0.06509416550397873,
0.02630201354622841,
-0.017587441951036453,
-0.12071502208709717,
0.2741806209087372,
0.2151794284582138,
0.2909121811389923,
0.099542036652565,
0.017603810876607895,
-0.055168382823467255,
-0.02125564031302929,
-0.002927853725850582,
0.061744324862957,
-0.11177821457386017,
0.36682334542274475,
-0.2194807380437851,
0.04052154719829559,
-0.32895228266716003,
0.050078704953193665,
-0.4840658903121948,
0.062645822763443,
0.12420773506164551,
-0.19680637121200562,
0.05554274469614029,
0.1896691620349884,
-0.06211114674806595,
0.0455324649810791,
0.42904943227767944,
0.039059512317180634,
0.13960623741149902,
-0.3609697222709656,
-0.26284897327423096,
-0.646406888961792,
0.0685926228761673,
-0.1776188462972641,
-0.2022446244955063,
-0.19661395251750946,
0.16044414043426514,
0.16718758642673492,
0.02661880850791931,
0.39230698347091675,
-0.06120016425848007,
0.3404029607772827,
0.15815290808677673,
-0.20252034068107605,
-0.05016962066292763,
-0.0605413019657135,
0.5653362274169922,
-0.028817277401685715,
-0.438454270362854,
0.18734592199325562,
-0.08329398185014725,
-0.18045416474342346,
0.09273238480091095,
-0.0477166548371315,
-0.04306049644947052,
-0.08544599264860153,
0.31278350949287415,
0.16368573904037476,
0.6143015027046204,
-0.20972183346748352,
0.18899983167648315,
-0.254332035779953,
-0.27114295959472656,
-0.3302931785583496,
0.0806722640991211,
0.16507753729820251,
0.22046583890914917,
-0.1961984634399414,
-0.018897749483585358,
-0.37423115968704224,
0.04547271504998207,
0.05478070676326752,
0.12076466530561447,
-0.47721371054649353,
0.051091261208057404,
0.07409653067588806,
-0.0891999751329422,
0.38565361499786377,
0.154132679104805,
-0.10518357157707214,
-0.3789823055267334,
-0.22098037600517273,
0.006172887980937958,
0.46036940813064575,
-0.3928535580635071,
-0.33729875087738037,
0.07626455277204514,
-0.02382981777191162,
0.2071288824081421,
0.17289999127388,
-0.3232157528400421,
0.17888930439949036,
0.35897013545036316,
-0.05950001999735832,
-0.31835734844207764,
0.17843088507652283,
0.04659546539187431,
0.08884869515895844,
0.17903530597686768,
-0.11266513168811798,
0.25454121828079224,
-0.4377802014350891,
0.32295453548431396,
-0.19112572073936462
] |