html_url
stringlengths
51
51
title
stringlengths
6
280
comments
stringlengths
67
24.7k
body
stringlengths
51
36.2k
βŒ€
comment_length
int64
16
1.45k
text
stringlengths
159
38.3k
embeddings
sequence
https://github.com/huggingface/datasets/issues/6280
Couldn't cast array of type fixed_size_list to Sequence(Value(float64))
Thanks for the quick response @mariosasko! I just installed your branch via `poetry add 'git+https://github.com/huggingface/datasets#fix-array_values'` and I can confirm it works on the example provided. Follow up question for you, should `None`s be supported in these types of features as they are in others? For example, the following script: ``` from datasets import Features, Value, Sequence, ClassLabel, Dataset dataset_features = Features({ 'text': Value('string'), 'embedding': Sequence(Value('double'), length=2), 'categories': Sequence(ClassLabel(names=sorted([ 'one', 'two', 'three' ]))), }) dataset = Dataset.from_dict( { 'text': ['A'] * 10000, "embedding": [None] * 10000, # THIS LINE CHANGED 'categories': [[0]] * 10000, }, features=dataset_features ) def test_mapper(r): r['text'] = list(map(lambda t: t + ' b', r['text'])) return r dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2) ``` fails with ``` Traceback (most recent call last): File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1354, in _write_generator_to_queue for i, result in enumerate(func(**kwargs)): File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3493, in _map_single writer.write_batch(batch) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_writer.py", line 549, in write_batch array = cast_array_to_feature(col_values, col_type) if col_type is not None else col_values File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 1831, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 1831, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 2160, in cast_array_to_feature raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") TypeError: Couldn't cast array of type fixed_size_list<item: double>[2] to Sequence(feature=Value(dtype='float64', id=None), length=2, id=None) ``` Ideally we can have empty embedding columns as well!
### Describe the bug I have a dataset with an embedding column, when I try to map that dataset I get the following exception: ``` Traceback (most recent call last): File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map for rank, done, content in iflatmap_unordered( File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get raise self._value TypeError: Couldn't cast array of type fixed_size_list<item: float>[2] to Sequence(feature=Value(dtype='float32', id=None), length=2, id=None) ``` ### Steps to reproduce the bug Here's a simple repro script: ``` from datasets import Features, Value, Sequence, ClassLabel, Dataset dataset_features = Features({ 'text': Value('string'), 'embedding': Sequence(Value('double'), length=2), 'categories': Sequence(ClassLabel(names=sorted([ 'one', 'two', 'three' ]))), }) dataset = Dataset.from_dict( { 'text': ['A'] * 10000, 'embedding': [[0.0, 0.1]] * 10000, 'categories': [[0]] * 10000, }, features=dataset_features ) def test_mapper(r): r['text'] = list(map(lambda t: t + ' b', r['text'])) return r dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2) ``` Removing the embedding column fixes the issue! ### Expected behavior The mapping completes successfully. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-14.0-arm64-arm-64bit - Python version: 3.10.12 - Huggingface_hub version: 0.17.1 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
234
Couldn't cast array of type fixed_size_list to Sequence(Value(float64)) ### Describe the bug I have a dataset with an embedding column, when I try to map that dataset I get the following exception: ``` Traceback (most recent call last): File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map for rank, done, content in iflatmap_unordered( File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get raise self._value TypeError: Couldn't cast array of type fixed_size_list<item: float>[2] to Sequence(feature=Value(dtype='float32', id=None), length=2, id=None) ``` ### Steps to reproduce the bug Here's a simple repro script: ``` from datasets import Features, Value, Sequence, ClassLabel, Dataset dataset_features = Features({ 'text': Value('string'), 'embedding': Sequence(Value('double'), length=2), 'categories': Sequence(ClassLabel(names=sorted([ 'one', 'two', 'three' ]))), }) dataset = Dataset.from_dict( { 'text': ['A'] * 10000, 'embedding': [[0.0, 0.1]] * 10000, 'categories': [[0]] * 10000, }, features=dataset_features ) def test_mapper(r): r['text'] = list(map(lambda t: t + ' b', r['text'])) return r dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2) ``` Removing the embedding column fixes the issue! ### Expected behavior The mapping completes successfully. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-14.0-arm64-arm-64bit - Python version: 3.10.12 - Huggingface_hub version: 0.17.1 - PyArrow version: 13.0.0 - Pandas version: 2.0.3 Thanks for the quick response @mariosasko! I just installed your branch via `poetry add 'git+https://github.com/huggingface/datasets#fix-array_values'` and I can confirm it works on the example provided. Follow up question for you, should `None`s be supported in these types of features as they are in others? For example, the following script: ``` from datasets import Features, Value, Sequence, ClassLabel, Dataset dataset_features = Features({ 'text': Value('string'), 'embedding': Sequence(Value('double'), length=2), 'categories': Sequence(ClassLabel(names=sorted([ 'one', 'two', 'three' ]))), }) dataset = Dataset.from_dict( { 'text': ['A'] * 10000, "embedding": [None] * 10000, # THIS LINE CHANGED 'categories': [[0]] * 10000, }, features=dataset_features ) def test_mapper(r): r['text'] = list(map(lambda t: t + ' b', r['text'])) return r dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2) ``` fails with ``` Traceback (most recent call last): File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1354, in _write_generator_to_queue for i, result in enumerate(func(**kwargs)): File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3493, in _map_single writer.write_batch(batch) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_writer.py", line 549, in write_batch array = cast_array_to_feature(col_values, col_type) if col_type is not None else col_values File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 1831, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 1831, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 2160, in cast_array_to_feature raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") TypeError: Couldn't cast array of type fixed_size_list<item: double>[2] to Sequence(feature=Value(dtype='float64', id=None), length=2, id=None) ``` Ideally we can have empty embedding columns as well!
[ 0.013585752807557583, -0.05202486738562584, -0.06949372589588165, -0.06194750964641571, 0.28900039196014404, 0.14561179280281067, 0.07460504025220871, 0.1989031583070755, -0.04872482270002365, -0.012759526260197163, 0.05155529826879501, -0.02075866237282753, 0.040338948369026184, -0.14798246324062347, -0.0015915909316390753, -0.06804890930652618, -0.022133711725473404, -0.14679394662380219, -0.07504342496395111, 0.006526406388729811, -0.22574707865715027, 0.022449765354394913, 0.09382826834917068, 0.013893123716115952, 0.06940803676843643, -0.19170384109020233, -0.06347329914569855, -0.01618434116244316, -0.06446842104196548, -0.12131110578775406, 0.08910967409610748, 0.012872559949755669, 0.09278897196054459, -0.1232227236032486, 0.0000050636976993700955, 0.0742587074637413, 0.13222050666809082, -0.11418358981609344, 0.10557256639003754, -0.052325379103422165, 0.07986646890640259, -0.061908185482025146, -0.03463030233979225, 0.024146929383277893, -0.09213889390230179, -0.10153389722108841, -0.20197202265262604, -0.04027089476585388, -0.04706144705414772, 0.06621939688920975, -0.004364021588116884, -0.10272663086652756, 0.13937881588935852, -0.14724990725517273, -0.12479860335588455, -0.057685405015945435, 0.10409322381019592, 0.016843905672430992, -0.10154350847005844, 0.13579517602920532, 0.010061201639473438, -0.0584094412624836, -0.11121700704097748, 0.03960985690355301, -0.13205403089523315, -0.0385197177529335, -0.0521516278386116, -0.052759524434804916, -0.024156536906957626, 0.1352076381444931, -0.1509324610233307, 0.09647519886493683, -0.11151092499494553, -0.05352269858121872, 0.09410391002893448, -0.14010228216648102, 0.0322679802775383, 0.14278987050056458, 0.008948532864451408, 0.02155180275440216, 0.04476616904139519, 0.06900037080049515, 0.05083676055073738, 0.08788250386714935, -0.1654738485813141, -0.08542709052562714, -0.1542038917541504, 0.20757605135440826, -0.03972911089658737, -0.17367735505104065, -0.10653814673423767, -0.0234190933406353, -0.036900632083415985, -0.018705526366829872, 0.10539429634809494, -0.020695816725492477, -0.0012242244556546211, -0.17273768782615662, 0.04513971135020256, -0.12797993421554565, -0.019709497690200806, -0.10736385732889175, 0.209915429353714, 0.04585777595639229, -0.055571991950273514, 0.0813790038228035, -0.15927031636238098, 0.13676655292510986, -0.013334467075765133, 0.10434794425964355, 0.005962960422039032, 0.03626951202750206, -0.08391251415014267, 0.0780668705701828, 0.1658056676387787, -0.0019187921425327659, 0.07284671068191528, 0.04106488078832626, -0.0789908692240715, 0.19620725512504578, -0.0652683898806572, 0.15764479339122772, 0.004112526308745146, 0.08460689336061478, 0.15584811568260193, 0.10879635810852051, 0.020880665630102158, 0.0618625171482563, 0.02920839563012123, 0.15748655796051025, -0.003925085533410311, 0.13417746126651764, 0.04554401710629463, -0.10361284017562866, 0.15617366135120392, 0.12364725023508072, 0.09536699205636978, -0.25651460886001587, 0.06648959219455719, -0.06755460798740387, -0.00891659501940012, -0.08973617106676102, 0.13416972756385803, -0.015022230334579945, 0.06591586023569107, -0.03566352650523186, 0.15224309265613556, 0.04647184908390045, -0.033757396042346954, 0.00538484426215291, -0.24937862157821655, 0.02409343235194683, -0.10142402350902557, -0.130084827542305, -0.11541673541069031, 0.14203669130802155, 0.17270682752132416, -0.24722100794315338, 0.040702205151319504, -0.11710770428180695, 0.027866173535585403, -0.028231246396899223, -0.003294516820460558, -0.14385771751403809, 0.05303465574979782, -0.08228393644094467, -0.07033072412014008, 0.05015141889452934, -0.11080898344516754, 0.11981679499149323, 0.2133321762084961, -0.03986986726522446, 0.03732330724596977, -0.09031011164188385, -0.0684608593583107, 0.10252071917057037, -0.18118123710155487, 0.11176784336566925, -0.250299870967865, -0.12134797871112823, -0.013811996206641197, -0.08201614767313004, 0.05709204077720642, -0.06173640862107277, 0.14816324412822723, 0.013264309614896774, 0.0991177037358284, 0.04579859972000122, -0.1829136162996292, -0.07392111420631409, 0.014518012292683125, -0.03943343460559845, 0.01102636568248272, -0.3326292335987091, -0.0496755950152874, 0.002354091266170144, -0.07584147155284882, 0.06746423244476318, -0.17769403755664825, -0.05502161756157875, 0.05817254260182381, -0.10932358354330063, 0.045936763286590576, -0.0034895804710686207, -0.032185088843107224, -0.1320340931415558, -0.09489505738019943, -0.11424681544303894, -0.03376607969403267, -0.08681230992078781, -0.24789667129516602, 0.13707932829856873, -0.11603197455406189, 0.07838307321071625, -0.07525942474603653, -0.01904238387942314, -0.008820750750601292, 0.009845097549259663, -0.06607762724161148, 0.16373179852962494, 0.017554285004734993, -0.07421332597732544, -0.05816390737891197, -0.07850331813097, -0.00871785543859005, -0.02401539869606495, -0.04612629860639572, -0.10821419209241867, -0.010830947197973728, 0.18308387696743011, -0.025595134124159813, -0.08019783347845078, 0.10527312755584717, 0.09700211882591248, -0.15516072511672974, -0.22850072383880615, -0.13251538574695587, -0.2066715806722641, -0.0025149143766611814, -0.0890476256608963, -0.1355251967906952, 0.17924338579177856, -0.10151797533035278, 0.10244423151016235, 0.0037893475964665413, 0.16723699867725372, -0.09585026651620865, 0.2409006506204605, 0.029741762205958366, 0.06816835701465607, 0.2815958261489868, 0.008496192283928394, -0.1874472200870514, -0.11431574821472168, 0.01129769068211317, -0.03679797053337097, -0.09750717133283615, 0.022684454917907715, 0.010895558632910252, -0.06307704746723175, 0.3730987012386322, 0.024512043222784996, 0.03475877642631531, -0.047114331275224686, 0.19518998265266418, -0.08720859885215759, -0.018216654658317566, -0.10049264132976532, 0.12740860879421234, 0.02092379704117775, 0.043367113918066025, -0.09079952538013458, -0.05820189416408539, 0.0018392240162938833, -0.02536400966346264, -0.1996711790561676, 0.026333056390285492, -0.06667393445968628, 0.08203426748514175, 0.300263375043869, -0.16416625678539276, 0.07856594771146774, 0.040038395673036575, -0.12356060743331909, -0.014423443004488945, 0.18233275413513184, -0.14084850251674652, 0.13200686872005463, -0.08977976441383362, 0.21853184700012207, 0.0013251391937956214, -0.011411482468247414, 0.0052984291687607765, -0.11066599190235138, -0.048738520592451096, -0.0939275473356247, -0.009447244927287102, -0.10711449384689331, 0.3155675530433655, 0.05901113152503967, 0.009413013234734535, 0.06785786151885986, -0.024900972843170166, -0.05150403454899788, 0.006774130277335644, -0.0210877638310194, 0.17430691421031952, 0.3206404447555542, -0.15387548506259918, -0.042624980211257935, -0.19779805839061737, -0.02500566653907299, -0.04735405370593071, 0.07161039113998413, 0.202052041888237, 0.054767243564128876, 0.02963404171168804, -0.00257251039147377, 0.13297304511070251, -0.1734389364719391, 0.03107129968702793, 0.1430893838405609, -0.10513701289892197, -0.006390358787029982, -0.02427765727043152, 0.100069060921669, -0.15843722224235535, -0.15007008612155914, -0.08580846339464188, 0.006252392195165157, 0.09826884418725967, -0.08239208906888962, -0.03861449658870697, -0.10440212488174438, 0.15966512262821198, -0.248751699924469, -0.1657373458147049, 0.20864716172218323, 0.1434715837240219, -0.07477358728647232, -0.05053858086466789, -0.06470464169979095, -0.060350451618433, -0.004848413169384003, 0.14723162353038788, -0.10239139944314957, -0.05007167160511017, -0.09738686680793762, -0.08340068906545639, -0.10103066265583038, -0.00771483825519681, 0.054607879370450974, 0.0931360051035881, -0.11263209581375122, -0.22935909032821655, 0.24028810858726501, -0.07680881023406982, 0.11110832542181015, -0.13060776889324188, 0.03456344082951546, 0.2055056095123291, 0.20076973736286163, 0.07907336205244064, 0.11408371478319168, -0.06507772207260132, 0.15931305289268494, 0.09318996220827103, -0.13198283314704895, -0.20423738658428192, -0.04160631448030472, -0.02306925505399704, 0.06242264434695244, -0.030421502888202667, -0.03258620575070381, -0.02764701098203659, -0.06882240623235703, 0.06904783099889755, -0.015804676339030266, 0.28144142031669617, 0.07721396535634995, 0.015922270715236664, -0.10854727029800415, -0.1306837797164917, 0.12074221670627594, 0.0008781602373346686, -0.05213493853807449, -0.1398162990808487, -0.20571918785572052, -0.27124732732772827, -0.013476983644068241, 0.22956082224845886, 0.04209240898489952, -0.10695454478263855, -0.0734432190656662, -0.01670452393591404, 0.11234937608242035, 0.27759599685668945, 0.07131903618574142, -0.006758164148777723, 0.09272251278162003, 0.2037762850522995, -0.014572514221072197, -0.03865839168429375, 0.027020955458283424, 0.12182337045669556, 0.18409377336502075, 0.04608443006873131, -0.06924420595169067, 0.05287827551364899, 0.0755927637219429, 0.019797848537564278, 0.08007954061031342, 0.036519356071949005, 0.034310679882764816, 0.06431441754102707, -0.08323830366134644, 0.05802907049655914, 0.10124585777521133, 0.03265659883618355, -0.31885525584220886, -0.15096576511859894, -0.21424764394760132, 0.14913254976272583, 0.22564788162708282, -0.16241511702537537, -0.09685371071100235, -0.019308701157569885, -0.12646320462226868, 0.1197507381439209, -0.016353923827409744, 0.1228809580206871, 0.022056318819522858, 0.057185884565114975, -0.05195920541882515, 0.12644749879837036, -0.09742384403944016, 0.20922282338142395, 0.07375091314315796, 0.11930260062217712, 0.03394424170255661, -0.25265729427337646, -0.0523124597966671, 0.0016443409258499742, -0.15649360418319702, 0.024314148351550102, -0.16789433360099792, -0.03018336556851864, 0.012846805155277252, -0.03326164186000824, 0.032513152807950974, 0.020930688828229904, -0.06283775717020035, 0.002086242660880089, -0.13263021409511566, 0.09614324569702148, 0.03496864065527916, 0.05015790835022926, -0.1784306764602661, -0.06785709410905838, 0.08683551102876663, 0.29089266061782837, -0.036879394203424454, -0.10506709665060043, 0.07270243763923645, 0.28345245122909546, 0.25333717465400696, 0.24313248693943024, 0.06324503570795059, 0.07813695073127747, 0.1754007339477539, 0.0796438530087471, 0.006151179783046246, 0.042622894048690796, 0.12930716574192047, -0.0068291546776890755, -0.11931895464658737, 0.09031517803668976, 0.043094318360090256, -0.07755589485168457, -0.0226368959993124, -0.050691910088062286, -0.0967194214463234, -0.011893779039382935, -0.2426801323890686, 0.15684373676776886, 0.21135413646697998, 0.004650142975151539, 0.021259529516100883, -0.06647387146949768, -0.08788648992776871, -0.13914470374584198, -0.048602987080812454, -0.0740170106291771, -0.05618366599082947, 0.16296441853046417, -0.08354699611663818, 0.1691226065158844, 0.11577538400888443, -0.013032888993620872, -0.023474043235182762, -0.006003233138471842, -0.013605731539428234, -0.037559874355793, -0.030791763216257095, -0.1055222898721695, -0.01915828324854374, -0.002404426923021674, 0.051812827587127686, 0.13816282153129578, 0.0331878587603569, 0.012709514237940311, 0.20868192613124847, -0.0424860343337059, -0.05622416362166405, -0.020788168534636497, 0.04631819203495979, -0.14805756509304047, -0.03282516822218895, 0.03797397390007973, 0.12946298718452454, 0.1148097813129425, -0.013119950890541077, 0.0970068871974945, -0.08870074898004532, -0.04647926241159439, 0.11717614531517029, 0.017078842967748642, -0.01244821585714817, 0.22094516456127167, 0.2324276715517044, 0.03921188786625862, 0.1932229846715927, 0.16887561976909637, -0.05236072838306427, -0.05913478136062622, 0.06829480081796646, 0.02983175404369831, -0.09075985848903656, -0.01941438764333725, -0.14626234769821167, -0.04115721955895424, -0.22882623970508575, -0.04853039234876633, 0.05643691122531891, 0.23822414875030518, 0.07093682140111923, -0.09792106598615646, -0.14457695186138153, -0.023363718762993813, -0.06416554003953934, -0.0918494239449501, 0.007894870825111866, -0.046961575746536255, -0.25762221217155457, 0.03627734258770943, -2.4007193125872566e-32, -0.07094909250736237, -0.07955271005630493, -0.058007579296827316, -0.1053110659122467, -0.1662980616092682, 0.07497261464595795, 0.05808854475617409, 0.19284145534038544, 0.1107151210308075, -0.1327497363090515, -0.05324173346161842, 0.02450604923069477, -0.03386475145816803, -0.01721423678100109, -0.05850826948881149, -0.08994186669588089, -0.005950881168246269, 0.1095002144575119, -0.010479318909347057, -0.027447285130620003, -0.01654815673828125, 0.11729296296834946, -0.011254790239036083, 0.13472570478916168, -0.05767672881484032, 0.19597956538200378, 0.02613718807697296, -0.13954134285449982, 0.23910051584243774, -0.1287463903427124, -0.025451231747865677, 0.19336359202861786, 0.09067317098379135, -0.07711870223283768, 0.011450449004769325, -0.14230728149414062, -0.10930440574884415, -0.04062537103891373, -0.04073599725961685, 0.0809590294957161, 0.06273037195205688, 0.11096978932619095, 0.05389799177646637, -0.06895729154348373, 0.0397140309214592, -0.021634189411997795, 0.07818353176116943, 0.011255878955125809, -0.004522286355495453, -0.0010953436139971018, 0.015161620453000069, -0.14049749076366425, -0.03942957520484924, 0.22666434943675995, 0.0603625550866127, -0.010208864696323872, 0.10301405191421509, 0.2475380152463913, -0.20238745212554932, -0.04970480874180794, 0.11538606137037277, 0.14982475340366364, 0.1261717677116394, -0.098228320479393, -0.08937861025333405, 0.1965179592370987, 0.2298455685377121, -0.05814787745475769, -0.034359391778707504, 0.011984565295279026, -0.07480107992887497, 0.07969264686107635, -0.028820516541600227, -0.07760217040777206, -0.09523501992225647, 0.09409867972135544, -0.12477351725101471, 0.13721932470798492, -0.040804412215948105, -0.1748008280992508, 0.03964336961507797, 0.11058732122182846, 0.1696723848581314, -0.08268588781356812, -0.08219882845878601, 0.008169778622686863, -0.026339983567595482, -0.06979503482580185, -0.021484173834323883, -0.12692907452583313, 0.03256740793585777, 0.05825541168451309, -0.09832290560007095, -0.041647836565971375, -0.2548733055591583, 0.1370851695537567, -0.12833940982818604, 0.08415605127811432, -0.10017876327037811, 0.03646218404173851, -0.021807486191391945, -0.12256946414709091, 0.10091797262430191, -0.01973746344447136, 0.1820097714662552, 0.21759042143821716, 0.09016453474760056, 0.03525480255484581, -0.12449365854263306, -0.09845691174268723, -0.025624478235840797, -0.08617030084133148, 0.04469200596213341, 0.21433255076408386, 0.07432551681995392, -0.08215317875146866, 0.05836240574717522, -0.04005599021911621, 0.09717436134815216, 0.14345599710941315, 0.013817078433930874, -0.07194402813911438, -0.08531744033098221, -0.04386487230658531, 0.026262301951646805, -0.062160514295101166, -0.1968606859445572, 0.0979476198554039, 0.036621760576963425, -0.07704698294401169, 0.08254260569810867, -0.07363002747297287, 7.10938536485628e-7, -0.23125658929347992, 0.1230422854423523, -0.06543732434511185, -0.12409456074237823, -0.09702235460281372, 0.22192691266536713, -0.052092742174863815, 0.1823071837425232, -0.1000484898686409, 0.11253289878368378, 0.1647999882698059, -0.11875209212303162, -0.015019133687019348, -0.11911115795373917, 0.11324430257081985, -0.3345286548137665, -0.005868317559361458, 0.06262670457363129, -0.09213106334209442, -0.028460543602705002, 0.10352188348770142, 0.05887733772397041, 0.12423228472471237, -0.13131268322467804, 0.12865355610847473, -0.010091805830597878, -0.016166701912879944, -0.08487941324710846, 0.13565191626548767, -0.1879865676164627, -0.038570232689380646, -0.037129878997802734, -0.004561416804790497, 0.10984078049659729, -0.07369465380907059, -0.08875145018100739, -0.08380930870771408, -0.05415328964591026, 0.02658204175531864, 0.1514691561460495, -0.08915887027978897, 0.10439637303352356, 0.018480248749256134, 0.006057584658265114, 0.03878025710582733, -0.0573851577937603, -0.21638673543930054, 0.08175092935562134, -0.10579240322113037, 0.09800554066896439, -0.08085891604423523, 0.17564435303211212, 0.08769088238477707, 0.1961580216884613, 0.07419566065073013, 0.005560871679335833, 0.10022410750389099, -0.2958805561065674, 0.2467060685157776, -0.12420423328876495, -0.06397567689418793, 0.006265094969421625, -0.14322814345359802, -0.0028623121324926615, 0.016581689938902855, -0.20840109884738922, -0.12250542640686035, 1.6159409490214895e-34, -0.008224019780755043, 0.08334635198116302, 0.04748212546110153, -0.07177905738353729, -0.033707816153764725, -0.0024732565507292747, 0.18808713555335999, 0.0005893586785532534, 0.1229463517665863, -0.13205347955226898, -0.071082703769207 ]
https://github.com/huggingface/datasets/issues/6280
Couldn't cast array of type fixed_size_list to Sequence(Value(float64))
This part of PyArrow is buggy and inconsistent regarding features implemented across the types, so the only option is to operate on the Arrow buffer level to fix issues such as the above one.
### Describe the bug I have a dataset with an embedding column, when I try to map that dataset I get the following exception: ``` Traceback (most recent call last): File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map for rank, done, content in iflatmap_unordered( File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get raise self._value TypeError: Couldn't cast array of type fixed_size_list<item: float>[2] to Sequence(feature=Value(dtype='float32', id=None), length=2, id=None) ``` ### Steps to reproduce the bug Here's a simple repro script: ``` from datasets import Features, Value, Sequence, ClassLabel, Dataset dataset_features = Features({ 'text': Value('string'), 'embedding': Sequence(Value('double'), length=2), 'categories': Sequence(ClassLabel(names=sorted([ 'one', 'two', 'three' ]))), }) dataset = Dataset.from_dict( { 'text': ['A'] * 10000, 'embedding': [[0.0, 0.1]] * 10000, 'categories': [[0]] * 10000, }, features=dataset_features ) def test_mapper(r): r['text'] = list(map(lambda t: t + ' b', r['text'])) return r dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2) ``` Removing the embedding column fixes the issue! ### Expected behavior The mapping completes successfully. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-14.0-arm64-arm-64bit - Python version: 3.10.12 - Huggingface_hub version: 0.17.1 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
34
Couldn't cast array of type fixed_size_list to Sequence(Value(float64)) ### Describe the bug I have a dataset with an embedding column, when I try to map that dataset I get the following exception: ``` Traceback (most recent call last): File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map for rank, done, content in iflatmap_unordered( File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get raise self._value TypeError: Couldn't cast array of type fixed_size_list<item: float>[2] to Sequence(feature=Value(dtype='float32', id=None), length=2, id=None) ``` ### Steps to reproduce the bug Here's a simple repro script: ``` from datasets import Features, Value, Sequence, ClassLabel, Dataset dataset_features = Features({ 'text': Value('string'), 'embedding': Sequence(Value('double'), length=2), 'categories': Sequence(ClassLabel(names=sorted([ 'one', 'two', 'three' ]))), }) dataset = Dataset.from_dict( { 'text': ['A'] * 10000, 'embedding': [[0.0, 0.1]] * 10000, 'categories': [[0]] * 10000, }, features=dataset_features ) def test_mapper(r): r['text'] = list(map(lambda t: t + ' b', r['text'])) return r dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2) ``` Removing the embedding column fixes the issue! ### Expected behavior The mapping completes successfully. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-14.0-arm64-arm-64bit - Python version: 3.10.12 - Huggingface_hub version: 0.17.1 - PyArrow version: 13.0.0 - Pandas version: 2.0.3 This part of PyArrow is buggy and inconsistent regarding features implemented across the types, so the only option is to operate on the Arrow buffer level to fix issues such as the above one.
[ 0.013585752807557583, -0.05202486738562584, -0.06949372589588165, -0.06194750964641571, 0.28900039196014404, 0.14561179280281067, 0.07460504025220871, 0.1989031583070755, -0.04872482270002365, -0.012759526260197163, 0.05155529826879501, -0.02075866237282753, 0.040338948369026184, -0.14798246324062347, -0.0015915909316390753, -0.06804890930652618, -0.022133711725473404, -0.14679394662380219, -0.07504342496395111, 0.006526406388729811, -0.22574707865715027, 0.022449765354394913, 0.09382826834917068, 0.013893123716115952, 0.06940803676843643, -0.19170384109020233, -0.06347329914569855, -0.01618434116244316, -0.06446842104196548, -0.12131110578775406, 0.08910967409610748, 0.012872559949755669, 0.09278897196054459, -0.1232227236032486, 0.0000050636976993700955, 0.0742587074637413, 0.13222050666809082, -0.11418358981609344, 0.10557256639003754, -0.052325379103422165, 0.07986646890640259, -0.061908185482025146, -0.03463030233979225, 0.024146929383277893, -0.09213889390230179, -0.10153389722108841, -0.20197202265262604, -0.04027089476585388, -0.04706144705414772, 0.06621939688920975, -0.004364021588116884, -0.10272663086652756, 0.13937881588935852, -0.14724990725517273, -0.12479860335588455, -0.057685405015945435, 0.10409322381019592, 0.016843905672430992, -0.10154350847005844, 0.13579517602920532, 0.010061201639473438, -0.0584094412624836, -0.11121700704097748, 0.03960985690355301, -0.13205403089523315, -0.0385197177529335, -0.0521516278386116, -0.052759524434804916, -0.024156536906957626, 0.1352076381444931, -0.1509324610233307, 0.09647519886493683, -0.11151092499494553, -0.05352269858121872, 0.09410391002893448, -0.14010228216648102, 0.0322679802775383, 0.14278987050056458, 0.008948532864451408, 0.02155180275440216, 0.04476616904139519, 0.06900037080049515, 0.05083676055073738, 0.08788250386714935, -0.1654738485813141, -0.08542709052562714, -0.1542038917541504, 0.20757605135440826, -0.03972911089658737, -0.17367735505104065, -0.10653814673423767, -0.0234190933406353, -0.036900632083415985, -0.018705526366829872, 0.10539429634809494, -0.020695816725492477, -0.0012242244556546211, -0.17273768782615662, 0.04513971135020256, -0.12797993421554565, -0.019709497690200806, -0.10736385732889175, 0.209915429353714, 0.04585777595639229, -0.055571991950273514, 0.0813790038228035, -0.15927031636238098, 0.13676655292510986, -0.013334467075765133, 0.10434794425964355, 0.005962960422039032, 0.03626951202750206, -0.08391251415014267, 0.0780668705701828, 0.1658056676387787, -0.0019187921425327659, 0.07284671068191528, 0.04106488078832626, -0.0789908692240715, 0.19620725512504578, -0.0652683898806572, 0.15764479339122772, 0.004112526308745146, 0.08460689336061478, 0.15584811568260193, 0.10879635810852051, 0.020880665630102158, 0.0618625171482563, 0.02920839563012123, 0.15748655796051025, -0.003925085533410311, 0.13417746126651764, 0.04554401710629463, -0.10361284017562866, 0.15617366135120392, 0.12364725023508072, 0.09536699205636978, -0.25651460886001587, 0.06648959219455719, -0.06755460798740387, -0.00891659501940012, -0.08973617106676102, 0.13416972756385803, -0.015022230334579945, 0.06591586023569107, -0.03566352650523186, 0.15224309265613556, 0.04647184908390045, -0.033757396042346954, 0.00538484426215291, -0.24937862157821655, 0.02409343235194683, -0.10142402350902557, -0.130084827542305, -0.11541673541069031, 0.14203669130802155, 0.17270682752132416, -0.24722100794315338, 0.040702205151319504, -0.11710770428180695, 0.027866173535585403, -0.028231246396899223, -0.003294516820460558, -0.14385771751403809, 0.05303465574979782, -0.08228393644094467, -0.07033072412014008, 0.05015141889452934, -0.11080898344516754, 0.11981679499149323, 0.2133321762084961, -0.03986986726522446, 0.03732330724596977, -0.09031011164188385, -0.0684608593583107, 0.10252071917057037, -0.18118123710155487, 0.11176784336566925, -0.250299870967865, -0.12134797871112823, -0.013811996206641197, -0.08201614767313004, 0.05709204077720642, -0.06173640862107277, 0.14816324412822723, 0.013264309614896774, 0.0991177037358284, 0.04579859972000122, -0.1829136162996292, -0.07392111420631409, 0.014518012292683125, -0.03943343460559845, 0.01102636568248272, -0.3326292335987091, -0.0496755950152874, 0.002354091266170144, -0.07584147155284882, 0.06746423244476318, -0.17769403755664825, -0.05502161756157875, 0.05817254260182381, -0.10932358354330063, 0.045936763286590576, -0.0034895804710686207, -0.032185088843107224, -0.1320340931415558, -0.09489505738019943, -0.11424681544303894, -0.03376607969403267, -0.08681230992078781, -0.24789667129516602, 0.13707932829856873, -0.11603197455406189, 0.07838307321071625, -0.07525942474603653, -0.01904238387942314, -0.008820750750601292, 0.009845097549259663, -0.06607762724161148, 0.16373179852962494, 0.017554285004734993, -0.07421332597732544, -0.05816390737891197, -0.07850331813097, -0.00871785543859005, -0.02401539869606495, -0.04612629860639572, -0.10821419209241867, -0.010830947197973728, 0.18308387696743011, -0.025595134124159813, -0.08019783347845078, 0.10527312755584717, 0.09700211882591248, -0.15516072511672974, -0.22850072383880615, -0.13251538574695587, -0.2066715806722641, -0.0025149143766611814, -0.0890476256608963, -0.1355251967906952, 0.17924338579177856, -0.10151797533035278, 0.10244423151016235, 0.0037893475964665413, 0.16723699867725372, -0.09585026651620865, 0.2409006506204605, 0.029741762205958366, 0.06816835701465607, 0.2815958261489868, 0.008496192283928394, -0.1874472200870514, -0.11431574821472168, 0.01129769068211317, -0.03679797053337097, -0.09750717133283615, 0.022684454917907715, 0.010895558632910252, -0.06307704746723175, 0.3730987012386322, 0.024512043222784996, 0.03475877642631531, -0.047114331275224686, 0.19518998265266418, -0.08720859885215759, -0.018216654658317566, -0.10049264132976532, 0.12740860879421234, 0.02092379704117775, 0.043367113918066025, -0.09079952538013458, -0.05820189416408539, 0.0018392240162938833, -0.02536400966346264, -0.1996711790561676, 0.026333056390285492, -0.06667393445968628, 0.08203426748514175, 0.300263375043869, -0.16416625678539276, 0.07856594771146774, 0.040038395673036575, -0.12356060743331909, -0.014423443004488945, 0.18233275413513184, -0.14084850251674652, 0.13200686872005463, -0.08977976441383362, 0.21853184700012207, 0.0013251391937956214, -0.011411482468247414, 0.0052984291687607765, -0.11066599190235138, -0.048738520592451096, -0.0939275473356247, -0.009447244927287102, -0.10711449384689331, 0.3155675530433655, 0.05901113152503967, 0.009413013234734535, 0.06785786151885986, -0.024900972843170166, -0.05150403454899788, 0.006774130277335644, -0.0210877638310194, 0.17430691421031952, 0.3206404447555542, -0.15387548506259918, -0.042624980211257935, -0.19779805839061737, -0.02500566653907299, -0.04735405370593071, 0.07161039113998413, 0.202052041888237, 0.054767243564128876, 0.02963404171168804, -0.00257251039147377, 0.13297304511070251, -0.1734389364719391, 0.03107129968702793, 0.1430893838405609, -0.10513701289892197, -0.006390358787029982, -0.02427765727043152, 0.100069060921669, -0.15843722224235535, -0.15007008612155914, -0.08580846339464188, 0.006252392195165157, 0.09826884418725967, -0.08239208906888962, -0.03861449658870697, -0.10440212488174438, 0.15966512262821198, -0.248751699924469, -0.1657373458147049, 0.20864716172218323, 0.1434715837240219, -0.07477358728647232, -0.05053858086466789, -0.06470464169979095, -0.060350451618433, -0.004848413169384003, 0.14723162353038788, -0.10239139944314957, -0.05007167160511017, -0.09738686680793762, -0.08340068906545639, -0.10103066265583038, -0.00771483825519681, 0.054607879370450974, 0.0931360051035881, -0.11263209581375122, -0.22935909032821655, 0.24028810858726501, -0.07680881023406982, 0.11110832542181015, -0.13060776889324188, 0.03456344082951546, 0.2055056095123291, 0.20076973736286163, 0.07907336205244064, 0.11408371478319168, -0.06507772207260132, 0.15931305289268494, 0.09318996220827103, -0.13198283314704895, -0.20423738658428192, -0.04160631448030472, -0.02306925505399704, 0.06242264434695244, -0.030421502888202667, -0.03258620575070381, -0.02764701098203659, -0.06882240623235703, 0.06904783099889755, -0.015804676339030266, 0.28144142031669617, 0.07721396535634995, 0.015922270715236664, -0.10854727029800415, -0.1306837797164917, 0.12074221670627594, 0.0008781602373346686, -0.05213493853807449, -0.1398162990808487, -0.20571918785572052, -0.27124732732772827, -0.013476983644068241, 0.22956082224845886, 0.04209240898489952, -0.10695454478263855, -0.0734432190656662, -0.01670452393591404, 0.11234937608242035, 0.27759599685668945, 0.07131903618574142, -0.006758164148777723, 0.09272251278162003, 0.2037762850522995, -0.014572514221072197, -0.03865839168429375, 0.027020955458283424, 0.12182337045669556, 0.18409377336502075, 0.04608443006873131, -0.06924420595169067, 0.05287827551364899, 0.0755927637219429, 0.019797848537564278, 0.08007954061031342, 0.036519356071949005, 0.034310679882764816, 0.06431441754102707, -0.08323830366134644, 0.05802907049655914, 0.10124585777521133, 0.03265659883618355, -0.31885525584220886, -0.15096576511859894, -0.21424764394760132, 0.14913254976272583, 0.22564788162708282, -0.16241511702537537, -0.09685371071100235, -0.019308701157569885, -0.12646320462226868, 0.1197507381439209, -0.016353923827409744, 0.1228809580206871, 0.022056318819522858, 0.057185884565114975, -0.05195920541882515, 0.12644749879837036, -0.09742384403944016, 0.20922282338142395, 0.07375091314315796, 0.11930260062217712, 0.03394424170255661, -0.25265729427337646, -0.0523124597966671, 0.0016443409258499742, -0.15649360418319702, 0.024314148351550102, -0.16789433360099792, -0.03018336556851864, 0.012846805155277252, -0.03326164186000824, 0.032513152807950974, 0.020930688828229904, -0.06283775717020035, 0.002086242660880089, -0.13263021409511566, 0.09614324569702148, 0.03496864065527916, 0.05015790835022926, -0.1784306764602661, -0.06785709410905838, 0.08683551102876663, 0.29089266061782837, -0.036879394203424454, -0.10506709665060043, 0.07270243763923645, 0.28345245122909546, 0.25333717465400696, 0.24313248693943024, 0.06324503570795059, 0.07813695073127747, 0.1754007339477539, 0.0796438530087471, 0.006151179783046246, 0.042622894048690796, 0.12930716574192047, -0.0068291546776890755, -0.11931895464658737, 0.09031517803668976, 0.043094318360090256, -0.07755589485168457, -0.0226368959993124, -0.050691910088062286, -0.0967194214463234, -0.011893779039382935, -0.2426801323890686, 0.15684373676776886, 0.21135413646697998, 0.004650142975151539, 0.021259529516100883, -0.06647387146949768, -0.08788648992776871, -0.13914470374584198, -0.048602987080812454, -0.0740170106291771, -0.05618366599082947, 0.16296441853046417, -0.08354699611663818, 0.1691226065158844, 0.11577538400888443, -0.013032888993620872, -0.023474043235182762, -0.006003233138471842, -0.013605731539428234, -0.037559874355793, -0.030791763216257095, -0.1055222898721695, -0.01915828324854374, -0.002404426923021674, 0.051812827587127686, 0.13816282153129578, 0.0331878587603569, 0.012709514237940311, 0.20868192613124847, -0.0424860343337059, -0.05622416362166405, -0.020788168534636497, 0.04631819203495979, -0.14805756509304047, -0.03282516822218895, 0.03797397390007973, 0.12946298718452454, 0.1148097813129425, -0.013119950890541077, 0.0970068871974945, -0.08870074898004532, -0.04647926241159439, 0.11717614531517029, 0.017078842967748642, -0.01244821585714817, 0.22094516456127167, 0.2324276715517044, 0.03921188786625862, 0.1932229846715927, 0.16887561976909637, -0.05236072838306427, -0.05913478136062622, 0.06829480081796646, 0.02983175404369831, -0.09075985848903656, -0.01941438764333725, -0.14626234769821167, -0.04115721955895424, -0.22882623970508575, -0.04853039234876633, 0.05643691122531891, 0.23822414875030518, 0.07093682140111923, -0.09792106598615646, -0.14457695186138153, -0.023363718762993813, -0.06416554003953934, -0.0918494239449501, 0.007894870825111866, -0.046961575746536255, -0.25762221217155457, 0.03627734258770943, -2.4007193125872566e-32, -0.07094909250736237, -0.07955271005630493, -0.058007579296827316, -0.1053110659122467, -0.1662980616092682, 0.07497261464595795, 0.05808854475617409, 0.19284145534038544, 0.1107151210308075, -0.1327497363090515, -0.05324173346161842, 0.02450604923069477, -0.03386475145816803, -0.01721423678100109, -0.05850826948881149, -0.08994186669588089, -0.005950881168246269, 0.1095002144575119, -0.010479318909347057, -0.027447285130620003, -0.01654815673828125, 0.11729296296834946, -0.011254790239036083, 0.13472570478916168, -0.05767672881484032, 0.19597956538200378, 0.02613718807697296, -0.13954134285449982, 0.23910051584243774, -0.1287463903427124, -0.025451231747865677, 0.19336359202861786, 0.09067317098379135, -0.07711870223283768, 0.011450449004769325, -0.14230728149414062, -0.10930440574884415, -0.04062537103891373, -0.04073599725961685, 0.0809590294957161, 0.06273037195205688, 0.11096978932619095, 0.05389799177646637, -0.06895729154348373, 0.0397140309214592, -0.021634189411997795, 0.07818353176116943, 0.011255878955125809, -0.004522286355495453, -0.0010953436139971018, 0.015161620453000069, -0.14049749076366425, -0.03942957520484924, 0.22666434943675995, 0.0603625550866127, -0.010208864696323872, 0.10301405191421509, 0.2475380152463913, -0.20238745212554932, -0.04970480874180794, 0.11538606137037277, 0.14982475340366364, 0.1261717677116394, -0.098228320479393, -0.08937861025333405, 0.1965179592370987, 0.2298455685377121, -0.05814787745475769, -0.034359391778707504, 0.011984565295279026, -0.07480107992887497, 0.07969264686107635, -0.028820516541600227, -0.07760217040777206, -0.09523501992225647, 0.09409867972135544, -0.12477351725101471, 0.13721932470798492, -0.040804412215948105, -0.1748008280992508, 0.03964336961507797, 0.11058732122182846, 0.1696723848581314, -0.08268588781356812, -0.08219882845878601, 0.008169778622686863, -0.026339983567595482, -0.06979503482580185, -0.021484173834323883, -0.12692907452583313, 0.03256740793585777, 0.05825541168451309, -0.09832290560007095, -0.041647836565971375, -0.2548733055591583, 0.1370851695537567, -0.12833940982818604, 0.08415605127811432, -0.10017876327037811, 0.03646218404173851, -0.021807486191391945, -0.12256946414709091, 0.10091797262430191, -0.01973746344447136, 0.1820097714662552, 0.21759042143821716, 0.09016453474760056, 0.03525480255484581, -0.12449365854263306, -0.09845691174268723, -0.025624478235840797, -0.08617030084133148, 0.04469200596213341, 0.21433255076408386, 0.07432551681995392, -0.08215317875146866, 0.05836240574717522, -0.04005599021911621, 0.09717436134815216, 0.14345599710941315, 0.013817078433930874, -0.07194402813911438, -0.08531744033098221, -0.04386487230658531, 0.026262301951646805, -0.062160514295101166, -0.1968606859445572, 0.0979476198554039, 0.036621760576963425, -0.07704698294401169, 0.08254260569810867, -0.07363002747297287, 7.10938536485628e-7, -0.23125658929347992, 0.1230422854423523, -0.06543732434511185, -0.12409456074237823, -0.09702235460281372, 0.22192691266536713, -0.052092742174863815, 0.1823071837425232, -0.1000484898686409, 0.11253289878368378, 0.1647999882698059, -0.11875209212303162, -0.015019133687019348, -0.11911115795373917, 0.11324430257081985, -0.3345286548137665, -0.005868317559361458, 0.06262670457363129, -0.09213106334209442, -0.028460543602705002, 0.10352188348770142, 0.05887733772397041, 0.12423228472471237, -0.13131268322467804, 0.12865355610847473, -0.010091805830597878, -0.016166701912879944, -0.08487941324710846, 0.13565191626548767, -0.1879865676164627, -0.038570232689380646, -0.037129878997802734, -0.004561416804790497, 0.10984078049659729, -0.07369465380907059, -0.08875145018100739, -0.08380930870771408, -0.05415328964591026, 0.02658204175531864, 0.1514691561460495, -0.08915887027978897, 0.10439637303352356, 0.018480248749256134, 0.006057584658265114, 0.03878025710582733, -0.0573851577937603, -0.21638673543930054, 0.08175092935562134, -0.10579240322113037, 0.09800554066896439, -0.08085891604423523, 0.17564435303211212, 0.08769088238477707, 0.1961580216884613, 0.07419566065073013, 0.005560871679335833, 0.10022410750389099, -0.2958805561065674, 0.2467060685157776, -0.12420423328876495, -0.06397567689418793, 0.006265094969421625, -0.14322814345359802, -0.0028623121324926615, 0.016581689938902855, -0.20840109884738922, -0.12250542640686035, 1.6159409490214895e-34, -0.008224019780755043, 0.08334635198116302, 0.04748212546110153, -0.07177905738353729, -0.033707816153764725, -0.0024732565507292747, 0.18808713555335999, 0.0005893586785532534, 0.1229463517665863, -0.13205347955226898, -0.071082703769207 ]
https://github.com/huggingface/datasets/issues/6279
Batched IterableDataset
This is exactly what I was looking for. It would also be very useful for me :-)
### Feature request Hi, could you add an implementation of a batched `IterableDataset`. It already support an option to do batch iteration via `.iter(batch_size=...)` but this cannot be used in combination with a torch `DataLoader` since it just returns an iterator. ### Motivation The current implementation loads each element of a batch individually which can be very slow in cases of a big batch_size. I did some experiments [here](https://discuss.huggingface.co/t/slow-dataloader-with-big-batch-size/57224) and using a batched iteration would speed up data loading significantly. ### Your contribution N/A
17
Batched IterableDataset ### Feature request Hi, could you add an implementation of a batched `IterableDataset`. It already support an option to do batch iteration via `.iter(batch_size=...)` but this cannot be used in combination with a torch `DataLoader` since it just returns an iterator. ### Motivation The current implementation loads each element of a batch individually which can be very slow in cases of a big batch_size. I did some experiments [here](https://discuss.huggingface.co/t/slow-dataloader-with-big-batch-size/57224) and using a batched iteration would speed up data loading significantly. ### Your contribution N/A This is exactly what I was looking for. It would also be very useful for me :-)
[ -0.1476454734802246, 0.1132344976067543, -0.04827847704291344, -0.09739042073488235, -0.00937233678996563, 0.08001690357923508, 0.25656020641326904, 0.03638194873929024, 0.03297102451324463, 0.15329469740390778, -0.09521880745887756, -0.010468210093677044, -0.2030562460422516, -0.00994382705539465, 0.06039976701140404, -0.1819259226322174, -0.11659184098243713, -0.04933224990963936, -0.1311912089586258, -0.08047764748334885, 0.0029932144097983837, 0.1310422122478485, 0.056919220834970474, -0.13295218348503113, 0.15603014826774597, -0.022710151970386505, -0.14653287827968597, -0.060249630361795425, -0.051232628524303436, -0.16252823173999786, 0.059709582477808, 0.1524553745985031, 0.05317060649394989, 0.09462256729602814, 0.000005452321147458861, 0.11471102386713028, 0.00851023942232132, 0.03842981159687042, -0.1232207715511322, 0.16705884039402008, 0.272674024105072, 0.0034246945288032293, 0.008039864711463451, 0.04236466437578201, 0.007781829684972763, -0.04172399640083313, 0.06777244061231613, -0.09761952608823776, 0.07136533409357071, -0.14639726281166077, 0.03782068192958832, 0.16832642257213593, -0.1894499957561493, -0.16129110753536224, 0.10550492256879807, 0.17817145586013794, -0.02948714978992939, 0.1649235337972641, 0.07121347635984421, 0.07091329246759415, -0.0958680585026741, -0.01320498064160347, -0.007605308201164007, -0.11691770702600479, 0.002915207762271166, -0.14604292809963226, -0.13740754127502441, -0.05736057087779045, -0.0980367660522461, 0.04880199581384659, 0.0357334204018116, -0.26077911257743835, -0.17350582778453827, 0.05241892859339714, -0.14166507124900818, -0.21495410799980164, -0.16653969883918762, 0.04112062603235245, -0.10562531650066376, 0.052634622901678085, -0.057942889630794525, 0.007631157990545034, 0.024470554664731026, -0.07648417353630066, -0.045070111751556396, 0.06520511955022812, 0.04530617594718933, -0.05444493517279625, -0.008792123757302761, -0.03057068958878517, 0.21055592596530914, -0.13635125756263733, -0.05528054013848305, 0.06070428714156151, -0.11111678183078766, -0.06667573750019073, 0.019324742257595062, -0.2122986614704132, 0.17093400657176971, 0.015296326018869877, 0.16889046132564545, 0.06902401149272919, 0.056037772446870804, -0.05974775180220604, 0.1127931997179985, -0.16689012944698334, -0.08067047595977783, -0.18459264934062958, -0.03677025064826012, -0.029454154893755913, 0.0232095830142498, 0.019648391753435135, -0.02100936882197857, -0.07908065617084503, 0.07946295291185379, 0.08562566339969635, -0.00602145679295063, 0.27434125542640686, -0.09435224533081055, -0.22760160267353058, 0.12320411205291748, -0.11303550750017166, 0.11978932470083237, 0.05853196978569031, 0.09779778867959976, -0.022013073787093163, -0.11120259761810303, -0.012437601573765278, 0.017313780263066292, -0.0684623047709465, -0.09596046805381775, -0.058344680815935135, 0.09942816197872162, 0.004037604201585054, 0.28321778774261475, -0.021806534379720688, -0.017212551087141037, -0.22141550481319427, 0.033796221017837524, 0.058458369225263596, 0.12537631392478943, -0.014181852340698242, 0.051032308489084244, -0.15525178611278534, -0.016002507880330086, -0.05324425548315048, 0.02161775901913643, 0.18307285010814667, -0.12151283025741577, 0.11323506385087967, 0.0770038366317749, 0.20732027292251587, -0.08349166810512543, 0.09366708993911743, -0.12691374123096466, 0.07348913699388504, -0.017009615898132324, -0.07176554948091507, -0.2716573178768158, -0.09156437963247299, 0.13223274052143097, -0.0989256426692009, -0.03122345730662346, -0.02679280750453472, 0.0510716587305069, 0.23184341192245483, -0.08353286236524582, -0.03315132111310959, 0.043368492275476456, -0.1048780158162117, 0.06905141472816467, -0.0385708324611187, -0.10782109200954437, -0.009441089816391468, -0.18455934524536133, 0.15331842005252838, -0.062105096876621246, 0.11316964030265808, -0.11287159472703934, 0.12617816030979156, 0.14545322954654694, -0.005873711779713631, 0.17592452466487885, -0.04557435214519501, 0.16557610034942627, -0.19199034571647644, 0.10278692841529846, 0.10302112251520157, -0.23678630590438843, 0.09440977871417999, 0.11081498116254807, 0.05276257172226906, 0.17019665241241455, 0.10911974310874939, 0.0032576441299170256, 0.12307901680469513, -0.04276583716273308, -0.2496950477361679, 0.23714451491832733, -0.12236388027667999, -0.19257867336273193, -0.01077477727085352, 0.022629279643297195, -0.03983885794878006, 0.01808982528746128, -0.1630937159061432, -0.21362023055553436, 0.1803092658519745, 0.18941695988178253, -0.2665354311466217, 0.02225758694112301, 0.02001713216304779, 0.016745299100875854, -0.022166656330227852, -0.173811674118042, -0.0001248993503395468, -0.05424640327692032, 0.14823026955127716, 0.03702918812632561, -0.05526474863290787, -0.10861553251743317, 0.034238748252391815, 0.0049250125885009766, -0.06468821316957474, -0.0044160811230540276, 0.014152011834084988, 0.15779033303260803, -0.1225990280508995, 0.20067468285560608, -0.056925371289253235, -0.09614496678113937, -0.0757916197180748, 0.1525430530309677, 0.09153227508068085, -0.09752905368804932, 0.014987342059612274, 0.1541339010000229, -0.014343718998134136, 0.06474931538105011, 0.0906120240688324, -0.1727718561887741, -0.08892796188592911, -0.13559463620185852, -0.003325946629047394, -0.01654522307217121, 0.16193744540214539, -0.13251425325870514, 0.030589083209633827, 0.045323003083467484, -0.10342217236757278, 0.15319402515888214, 0.14742131531238556, -0.18882475793361664, 0.14137522876262665, -0.10816135257482529, -0.011891370639204979, 0.12673845887184143, -0.09805355966091156, -0.013496801257133484, 0.009395644068717957, 0.08503689616918564, 0.006419006735086441, -0.08083941787481308, 0.006010513752698898, 0.07973769307136536, 0.07134859263896942, 0.1768331378698349, -0.16507765650749207, 0.05016489699482918, 0.06962382048368454, 0.11288299411535263, 0.04423892870545387, 0.24554306268692017, -0.014706562273204327, -0.01182620320469141, -0.1433100402355194, -0.08360474556684494, 0.12755531072616577, 0.07500803470611572, -0.11601030826568604, -0.19275252521038055, -0.2020263522863388, 0.039706964045763016, -0.14185166358947754, 0.07742410898208618, -0.0942210704088211, 0.03745152801275253, -0.08757694065570831, -0.11756215244531631, -0.060720354318618774, 0.035518527030944824, 0.010200117714703083, -0.06245474889874458, 0.012016328051686287, 0.05167226120829582, -0.027436723932623863, -0.024070195853710175, 0.054807331413030624, 0.09864581376314163, -0.020312616601586342, -0.1311977207660675, 0.050387606024742126, 0.14496919512748718, 0.08534898608922958, 0.13216139376163483, -0.10404518991708755, 0.10669487714767456, 0.09281407296657562, -0.004789491184055805, -0.2300403118133545, 0.001080919522792101, 0.035008516162633896, 0.05110432952642441, -0.19919827580451965, 0.15798556804656982, -0.02283768728375435, -0.11383229494094849, -0.17539501190185547, 0.015243793837726116, -0.04401996359229088, 0.07356633991003036, -0.09776938706636429, -0.06027800962328911, -0.043845608830451965, -0.02185163088142872, 0.02003606967628002, -0.1383281648159027, -0.11454084515571594, 0.03297973796725273, -0.03227540850639343, -0.005977958906441927, 0.0591990128159523, 0.05553966760635376, 0.12485089898109436, 0.2066204994916916, -0.2107975035905838, -0.02491643652319908, -0.1022104024887085, 0.18998458981513977, -0.029267804697155952, 0.024229004979133606, -0.017021384090185165, -0.04395107552409172, -0.03681626543402672, 0.15259400010108948, -0.079279825091362, 0.10207445174455643, -0.03423253819346428, -0.03710528463125229, -0.09754765778779984, 0.041486285626888275, 0.04901847243309021, -0.021025363355875015, -0.06163192167878151, 0.04198227450251579, -0.05563205108046532, -0.16591928899288177, -0.009881050325930119, -0.24769356846809387, 0.16415613889694214, 0.003665153170004487, 0.1504743993282318, 0.21348732709884644, -0.1433037668466568, -0.11891862004995346, 0.09982487559318542, 0.2294231504201889, -0.03576577827334404, 0.10084079951047897, -0.2971752882003784, 0.04293779656291008, -0.08797764033079147, -0.03161495551466942, -0.005583600606769323, -0.09179733693599701, -0.12686528265476227, 0.031530264765024185, -0.02683088928461075, 0.17721876502037048, 0.00166680000256747, 0.17039485275745392, -0.2018781304359436, -0.012705570086836815, -0.05287667363882065, 0.06697546690702438, -0.05130978301167488, 0.014232729561626911, 0.0258872602134943, -0.2056877464056015, 0.2320759892463684, -0.044757261872291565, -0.031846221536397934, 0.0585954412817955, -0.2093454748392105, -0.12908458709716797, 0.06762028485536575, 0.12140849977731705, 0.09438066929578781, -0.0582592748105526, 0.04501425474882126, 0.08332378417253494, 0.2873448431491852, -0.018456637859344482, 0.1802741289138794, -0.04758847504854202, -0.031354233622550964, 0.04806460812687874, 0.0042089009657502174, 0.021141376346349716, 0.13285794854164124, 0.09685324877500534, 0.07647954672574997, -0.10012006014585495, -0.11794491857290268, 0.07876455783843994, -0.0951036885380745, -0.17204052209854126, -0.07031557708978653, 0.19979605078697205, -0.05243481695652008, -0.009548809379339218, -0.020597830414772034, 0.07519719749689102, 0.08481045812368393, 0.21447861194610596, 0.009874324314296246, -0.2308717668056488, 0.16581548750400543, 0.08742493391036987, 0.02827804535627365, -0.046746205538511276, 0.18758846819400787, 0.07637634128332138, 0.06070595979690552, 0.130270853638649, -0.012308014556765556, 0.05302552133798599, -0.044348832219839096, -0.07757661491632462, 0.03852935507893562, -0.07947151362895966, 0.0015205380041152239, 0.2792298197746277, -0.08698403090238571, -0.00020400056382641196, -0.16649514436721802, -0.15579579770565033, -0.09464206546545029, -0.10278836637735367, 0.06151646748185158, -0.21423551440238953, -0.2433701902627945, -0.19622941315174103, -0.07627056539058685, 0.1603308618068695, 0.04796050861477852, 0.17109039425849915, -0.1998770833015442, -0.12341852486133575, 0.01443744357675314, 0.010933568701148033, -0.03450895845890045, 0.01827245019376278, -0.016286436468362808, -0.09759622812271118, 0.2743179500102997, 0.04471360519528389, -0.11040201038122177, 0.014859626069664955, 0.010752690955996513, -0.07613959908485413, 0.06299085170030594, 0.015884721651673317, 0.03341181203722954, 0.23759816586971283, 0.005324951838701963, -0.08483696728944778, -0.031420186161994934, -0.05199543759226799, -0.024724269285798073, 0.2559240162372589, -0.1803802102804184, -0.07966507971286774, -0.04523216187953949, 0.016422905027866364, 0.1509554237127304, -0.10212975740432739, 0.08409541845321655, -0.20838510990142822, 0.21131904423236847, -0.013812045566737652, -0.21630032360553741, -0.11780012398958206, 0.03859347850084305, -0.011769931763410568, -0.025922907516360283, -0.07787303626537323, 0.0751863345503807, -0.14980463683605194, 0.17697158455848694, -0.045937567949295044, -0.005552538670599461, 0.15308444201946259, 0.0425264872610569, 0.027090858668088913, -0.23275291919708252, 0.04335533827543259, -0.015089922584593296, 0.08083167672157288, 0.10329370945692062, 0.022707922384142876, 0.021683698520064354, -0.037611812353134155, -0.02576798014342785, 0.06095894053578377, 0.18860679864883423, -0.1817271113395691, -0.012167571112513542, 0.0652308389544487, -0.025021083652973175, -0.039963047951459885, 0.02582009695470333, 0.08951796591281891, -0.09493768960237503, 0.013001768849790096, -0.021933769807219505, 0.14490483701229095, -0.040671456605196, -0.060193758457899094, 0.2019115835428238, -0.07669875025749207, 0.08571944385766983, 0.12710359692573547, 0.07707839459180832, -0.06948293000459671, 0.003424503840506077, 0.0912441685795784, -0.07453257590532303, 0.12424744665622711, -0.09520623832941055, 0.20353010296821594, -0.09709656983613968, 0.1387719213962555, -0.031161777675151825, -0.025070572271943092, -0.14877630770206451, -0.11090616136789322, 0.02350742183625698, -0.0620855949819088, 0.11031992733478546, 0.1316251903772354, 0.053100328892469406, -0.11194118112325668, -0.16638660430908203, 0.0023001073859632015, -2.6035604137132427e-32, 0.03471638262271881, 0.15323108434677124, 0.028846047818660736, 0.1792832911014557, 0.09290286898612976, -0.04206419363617897, -0.04027871415019035, -0.02655450627207756, 0.10882561653852463, 0.028453750535845757, -0.15020476281642914, 0.12824076414108276, 0.10578658431768417, -0.027054451406002045, -0.04524388536810875, 0.03128510341048241, 0.15847529470920563, 0.0709264725446701, -0.04047444462776184, 0.1817137598991394, 0.13313956558704376, -0.08740811049938202, 0.05179808288812637, 0.2164783477783203, -0.11323000490665436, 0.09733469784259796, -0.13205182552337646, 0.06620588153600693, -0.16390886902809143, -0.011962328106164932, -0.050778381526470184, 0.09481443464756012, -0.06500418484210968, -0.036876000463962555, -0.05918394774198532, 0.13910873234272003, -0.21004359424114227, -0.04836501553654671, -0.1083940640091896, 0.02190238982439041, 0.07697713375091553, 0.05868172273039818, 0.09280720353126526, -0.03767958655953407, 0.028069086372852325, 0.13655754923820496, -0.07129069417715073, 0.06729438155889511, -0.004155831877142191, -0.12835639715194702, 0.13633044064044952, 0.08896110951900482, -0.023593446239829063, 0.1277216374874115, 0.11397672444581985, 0.054773662239313126, 0.10750948637723923, 0.04363696649670601, -0.1644670069217682, -0.008577135391533375, 0.10286599397659302, 0.0189207810908556, -0.03808924928307533, 0.0004156766808591783, 0.24645639955997467, -0.06601428985595703, 0.18353575468063354, 0.09897950291633606, 0.18323984742164612, 0.1406688541173935, -0.12611030042171478, 0.016695933416485786, -0.06437211483716965, -0.042121317237615585, -0.24786517024040222, 0.11335959285497665, -0.05558071285486221, 0.041895896196365356, -0.0726224035024643, -0.01875312253832817, 0.022204048931598663, -0.031054699793457985, 0.09969482570886612, -0.0082233976572752, 0.007548058405518532, 0.04994610697031021, 0.0155066242441535, 0.14023250341415405, -0.007353540509939194, -0.025064140558242798, -0.08199092745780945, 0.1631254404783249, -0.059977058321237564, 0.022593814879655838, -0.11315025389194489, 0.20600676536560059, -0.08831130713224411, 0.03237179294228554, 0.023217247799038887, -0.12163055688142776, -0.02455049194395542, -0.04234502464532852, -0.04815690219402313, 0.07642056047916412, 0.047670766711235046, -0.025388354435563087, 0.09966003149747849, 0.10631333291530609, -0.3361113369464874, -0.006966473534703255, -0.10431943833827972, 0.05854976177215576, 0.026314139366149902, -0.008510979823768139, 0.1699938327074051, -0.006119470577687025, 0.12699536979198456, 0.047906141728162766, 0.11888333410024643, -0.06003987044095993, -0.13305561244487762, -0.12406723946332932, -0.036723874509334564, -0.011819644831120968, -0.04004712775349617, -0.004951339680701494, -0.04246961697936058, -0.20458777248859406, 0.1003226488828659, -0.24217341840267181, -0.058247849345207214, 0.06756331026554108, 7.202684741969279e-7, -0.11988082528114319, 0.03422139957547188, 0.1169641837477684, 0.08002238720655441, 0.016314120963215828, 0.04231131449341774, 0.10438331216573715, -0.05812797322869301, 0.08779529482126236, 0.18646442890167236, 0.12118522077798843, -0.06157444417476654, -0.024921108037233353, -0.034939952194690704, 0.02178444154560566, 0.03469913825392723, -0.1451507955789566, 0.21978183090686798, -0.03145155310630798, -0.1133875623345375, 0.09948471188545227, 0.1590396761894226, 0.0901372879743576, -0.12353792786598206, 0.013565422035753727, -0.009977849200367928, 0.040303751826286316, -0.03409241512417793, -0.033191148191690445, 0.0331977978348732, -0.01748768985271454, -0.04529174417257309, -0.09824797511100769, 0.016634879633784294, -0.05203252285718918, -0.048868607729673386, -0.09696794301271439, 0.06046213582158089, 0.04219774901866913, 0.07654870301485062, 0.12120582908391953, -0.09865222871303558, -0.08546295762062073, 0.022370481863617897, 0.17604492604732513, 0.1325557827949524, -0.08035995066165924, 0.1544588953256607, -0.19641050696372986, -0.03219643235206604, -0.06751126050949097, 0.11043072491884232, -0.007542972918599844, 0.2722356915473938, 0.009698184207081795, -0.009793099015951157, -0.17165738344192505, -0.05436893180012703, -0.042832691222429276, -0.20115984976291656, -0.09342999756336212, 0.11210592836141586, -0.10006190836429596, 0.005228265188634396, -0.07686179876327515, -0.016710316762328148, 0.04429987445473671, 2.398879994536006e-34, 0.05916658788919449, 0.04666569083929062, 0.08619215339422226, -0.05410261079668999, 0.02573755756020546, -0.07530021667480469, 0.021083205938339233, 0.06852314621210098, -0.1301189810037613, -0.18447840213775635, -0.20752578973770142 ]
https://github.com/huggingface/datasets/issues/6277
FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either.
`evaluate.load("paws-x", "es")` throws the error because there is no such metric in the `evaluate` lib. So, this is unrelated to our lib.
### Describe the bug I'm encountering a "FileNotFoundError" while attempting to use the "paws-x" dataset to retrain the DistilRoBERTa-base model. The error message is as follows: FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either. ### Steps to reproduce the bug https://colab.research.google.com/drive/11xUUFxloClpmqLvDy_Xxfmo3oUzjY5nx#scrollTo=kUn74FigzhHm ### Expected behavior The the trained model ### Environment info colab, "paws-x" dataset , DistilRoBERTa-base model
22
FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either. ### Describe the bug I'm encountering a "FileNotFoundError" while attempting to use the "paws-x" dataset to retrain the DistilRoBERTa-base model. The error message is as follows: FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either. ### Steps to reproduce the bug https://colab.research.google.com/drive/11xUUFxloClpmqLvDy_Xxfmo3oUzjY5nx#scrollTo=kUn74FigzhHm ### Expected behavior The the trained model ### Environment info colab, "paws-x" dataset , DistilRoBERTa-base model `evaluate.load("paws-x", "es")` throws the error because there is no such metric in the `evaluate` lib. So, this is unrelated to our lib.
[ 0.17501899600028992, 0.010684090666472912, -0.12697921693325043, -0.18182404339313507, 0.15205924212932587, 0.16004475951194763, 0.08504734933376312, 0.13752824068069458, 0.13427942991256714, 0.014860298484563828, -0.009862205013632774, 0.011818666942417622, -0.02322211116552353, 0.14375802874565125, 0.12569376826286316, 0.08859501034021378, 0.022197742015123367, 0.17294146120548248, -0.06228486821055412, 0.02074585109949112, 0.029146244749426842, 0.07651956379413605, -0.011682441458106041, -0.04108559712767601, -0.1305108666419983, -0.08943594247102737, -0.08367805182933807, 0.12959115207195282, -0.04707350209355354, -0.07857150584459305, 0.20733888447284698, 0.027346665039658546, 0.13816198706626892, 0.23305653035640717, 0.000006492572993010981, -0.008955312892794609, 0.09211072325706482, 0.11033056676387787, 0.07829546183347702, -0.223318949341774, 0.2521871328353882, 0.007783246226608753, 0.002466686302796006, 0.006334918551146984, 0.08126572519540787, -0.05550014227628708, 0.02758176252245903, 0.20333567261695862, -0.03961892053484917, 0.16127710044384003, 0.08394957333803177, 0.10674455016851425, 0.038384418934583664, -0.15996307134628296, 0.059332601726055145, -0.04514188691973686, -0.10494111478328705, 0.04265283793210983, -0.033900629729032516, -0.17336875200271606, 0.052288759499788284, 0.08094575256109238, 0.04525051265954971, -0.14739049971103668, -0.023644588887691498, 0.03805459290742874, 0.13086098432540894, -0.17210906744003296, -0.05617180094122887, 0.12622115015983582, -0.009905615821480751, 0.06857222318649292, -0.09105928987264633, -0.013721090741455555, -0.021108146756887436, -0.12149156630039215, 0.11871553212404251, 0.05715196952223778, 0.018090425059199333, 0.0039972178637981415, 0.038660649210214615, -0.16875573992729187, 0.026483705267310143, 0.13819065690040588, 0.015815377235412598, 0.11016492545604706, -0.14319846034049988, -0.12005266547203064, 0.047316085547208786, -0.041495196521282196, 0.26319509744644165, 0.10236825793981552, -0.023191647604107857, -0.17521041631698608, 0.11465375125408173, 0.015235219150781631, 0.1504562944173813, 0.06907980889081955, 0.014238692820072174, 0.045384764671325684, 0.06641833484172821, -0.1414669305086136, -0.09142791479825974, 0.1387728899717331, -0.009480577893555164, 0.21243062615394592, -0.08599089086055756, 0.007537612225860357, 0.054699961096048355, 0.13338060677051544, -0.05495474860072136, 0.06085731461644173, -0.1587151139974594, -0.11466371268033981, -0.01856395974755287, -0.05171803757548332, 0.06360176205635071, 0.039054516702890396, -0.05561380088329315, 0.0130986999720335, 0.03158622980117798, 0.1591212898492813, -0.08063486218452454, 0.1321904957294464, -0.01634076237678528, 0.08040548115968704, 0.06696611642837524, 0.10775011032819748, 0.006841836031526327, 0.05313364416360855, -0.09558374434709549, 0.22464732825756073, -0.16503827273845673, -0.13784419000148773, -0.017263337969779968, -0.04489533230662346, 0.03645288199186325, -0.23990347981452942, 0.1840336173772812, 0.011970131658017635, -0.15267744660377502, -0.1145244836807251, -0.2758561074733734, -0.04508434236049652, 0.13198958337306976, 0.030601777136325836, 0.09756025671958923, -0.12226405739784241, 0.003650429891422391, -0.03891144320368767, -0.10580340027809143, 0.07418694347143173, -0.20403510332107544, 0.02540973387658596, -0.09141027927398682, -0.00205794139765203, -0.1913570910692215, -0.07509292662143707, -0.16851173341274261, -0.08630572259426117, 0.045519471168518066, -0.14144150912761688, 0.01145605742931366, -0.0005716491723433137, 0.006432669702917337, 0.042154666036367416, 0.11159435659646988, 0.0024592396803200245, -0.0009261809755116701, -0.006062161643058062, 0.06016477569937706, 0.015408024191856384, -0.03744371235370636, 0.03128254413604736, -0.1842489391565323, 0.12595972418785095, 0.01794932223856449, -0.07072094827890396, -0.11022838950157166, 0.010869371704757214, 0.030172524973750114, 0.002601100131869316, 0.033438049256801605, -0.1337970644235611, 0.028081707656383514, 0.01826978474855423, -0.13496403396129608, -0.01668146252632141, 0.050957974046468735, -0.06673206388950348, -0.02085668034851551, -0.03697659447789192, 0.019283559173345566, -0.01069832593202591, 0.19525116682052612, -0.12078957259654999, 0.14437764883041382, -0.037030644714832306, 0.06686606258153915, -0.25234174728393555, 0.18290618062019348, -0.11025087535381317, -0.005295848473906517, 0.007874378003180027, 0.07368237525224686, 0.014274941757321358, 0.12874366343021393, 0.17696736752986908, -0.0567791685461998, -0.13659541308879852, -0.10727760940790176, -0.03473652899265289, -0.028183992952108383, 0.038423147052526474, -0.01807459630072117, -0.03264102339744568, 0.017304953187704086, -0.05561736971139908, 0.02292073331773281, 0.09717345237731934, 0.017237035557627678, 0.20649243891239166, 0.12317279726266861, 0.081444151699543, -0.08114700764417648, 0.069488026201725, -0.034847941249608994, -0.07535009831190109, 0.1498379111289978, 0.1474689543247223, -0.2162867933511734, 0.003444596193730831, 0.08059362322092056, -0.05562305822968483, 0.00747892027720809, -0.040777191519737244, 0.050559066236019135, -0.14208361506462097, 0.04067349433898926, 0.017590928822755814, -0.21517314016819, -0.0031612792517989874, -0.028892509639263153, 0.09873440116643906, 0.15796932578086853, -0.13055898249149323, -0.1925123929977417, -0.15001356601715088, -0.0066885934211313725, -0.026463499292731285, 0.17612861096858978, -0.10197155922651291, -0.11572455614805222, 0.1221870630979538, 0.1905021220445633, 0.017185483127832413, 0.12567533552646637, -0.026255717501044273, 0.020121265202760696, -0.17553359270095825, 0.21598011255264282, -0.01283276081085205, 0.002633169759064913, -0.040077876299619675, 0.041221678256988525, -0.034921277314424515, -0.13268440961837769, 0.004503236617892981, 0.1563832014799118, 0.09898104518651962, 0.0080560352653265, -0.004945208318531513, -0.10134429484605789, -0.025948775932192802, -0.056050557643175125, 0.0003291431348770857, -0.03070363961160183, 0.05525153502821922, 0.13170018792152405, -0.01643986627459526, -0.16333618760108948, 0.03784230351448059, 0.05262118577957153, -0.029198922216892242, -0.00981819536536932, -0.052716247737407684, -0.07396254688501358, -0.020462045446038246, 0.04535346478223801, 0.04231852665543556, -0.04865086451172829, 0.03777142986655235, 0.030365025624632835, 0.0561567097902298, -0.045834045857191086, -0.02496403083205223, 0.004826958291232586, -0.16687804460525513, 0.023132940754294395, -0.06367900222539902, -0.06524067372083664, 0.010251144878566265, -0.0788651555776596, -0.021327845752239227, -0.10047692805528641, 0.06531167775392532, 0.056259602308273315, -0.0067858765833079815, 0.052135713398456573, -0.1720116138458252, -0.03004392236471176, -0.20801356434822083, 0.027718279510736465, 0.11030293256044388, 0.018293965607881546, -0.2742811143398285, -0.022376958280801773, -0.10869351774454117, 0.07305554300546646, -0.11488400399684906, 0.011637589894235134, -0.1745961308479309, 0.014603360556066036, -0.0031492013949900866, -0.12421271204948425, 0.06635241955518723, -0.2707293927669525, -0.16335077583789825, 0.0196271650493145, -0.09564704447984695, -0.05719127133488655, -0.12788327038288116, -0.054039642214775085, -0.18165983259677887, -0.07901377230882645, -0.108664870262146, -0.044651616364717484, -0.1233547031879425, 0.2373315542936325, -0.06298276782035828, -0.08800879120826721, -0.003288127016276121, -0.13242600858211517, -0.039504725486040115, -0.056205395609140396, 0.020475542172789574, -0.21639186143875122, -0.018211225047707558, -0.14633913338184357, -0.2027209997177124, 0.16393235325813293, 0.13813184201717377, -0.016100361943244934, -0.11209763586521149, 0.07630272954702377, 0.008257437497377396, -0.09887814521789551, 0.05584731698036194, 0.17308293282985687, -0.07166466861963272, 0.12549804151058197, 0.16540665924549103, 0.00921852421015501, -0.09457121789455414, -0.07960116863250732, 0.1822805553674698, 0.07723693549633026, 0.10666680335998535, 0.0040413313545286655, -0.01778041012585163, 0.01227184385061264, 0.014346337877213955, 0.10494057089090347, 0.1084747165441513, 0.03770594298839569, 0.21480326354503632, -0.18786107003688812, -0.0857047513127327, 0.0875459760427475, 0.029051583260297775, -0.0075015355832874775, -0.06605109572410583, -0.028094885870814323, 0.11678572744131088, 0.0460207462310791, 0.04938294366002083, 0.051697250455617905, 0.20866110920906067, 0.15479837357997894, 0.09619707614183426, 0.0019812912214547396, 0.003798697842285037, -0.09046287834644318, -0.09495800733566284, -0.013376319780945778, -0.11266212910413742, -0.017245544120669365, 0.08886530995368958, -0.013312849216163158, 0.04856432229280472, -0.0013686282327398658, 0.22662511467933655, 0.14605356752872467, -0.08064643293619156, -0.06834590435028076, -0.08909613639116287, -0.04797358438372612, -0.1052546352148056, 0.13229842483997345, -0.1705387979745865, -0.09393581002950668, 0.018772786483168602, 0.11722734570503235, -0.036875076591968536, 0.05626853555440903, -0.09789474308490753, 0.060497019439935684, -0.10791901499032974, -0.1795111894607544, -0.16249269247055054, -0.02337110973894596, -0.10230232775211334, 0.002524877665564418, 0.13434840738773346, 0.011079281568527222, -0.09368044137954712, -0.009940319694578648, -0.13625767827033997, 0.1722177267074585, -0.025991234928369522, 0.03115718811750412, -0.08634187281131744, 0.1577405482530594, 0.05068671330809593, 0.061930954456329346, -0.041186679154634476, 0.14928990602493286, -0.2267669141292572, -0.10947751998901367, -0.00883894506841898, -0.09650534391403198, 0.07206188887357712, 0.005221776198595762, -0.12887641787528992, -0.18652808666229248, -0.05849988013505936, -0.0426502451300621, -0.06196421757340431, 0.20810464024543762, 0.09954635798931122, -0.02252202481031418, -0.08268260210752487, 0.01993499882519245, -0.24023130536079407, 0.06696449965238571, 0.08969061821699142, 0.22706498205661774, 0.031533826142549515, -0.04889782890677452, 0.04679054021835327, -0.07146789878606796, -0.06869183480739594, -0.1344829797744751, -0.11344055086374283, 0.2129778116941452, -0.05868251621723175, 0.18957637250423431, -0.0868135467171669, 0.10396196693181992, 0.08424362540245056, -0.1285097301006317, 0.024309879168868065, -0.04941144213080406, 0.21758002042770386, 0.13688500225543976, -0.0009468336938880384, 0.041750580072402954, -0.02336977981030941, -0.25316715240478516, -0.11465658247470856, 0.12322144210338593, 0.03823958709836006, 0.05069660767912865, -0.05345667526125908, -0.08569610863924026, 0.16848717629909515, 0.051100365817546844, -0.03970169275999069, -0.12207222729921341, -0.1323951780796051, 0.025683367624878883, 0.08010655641555786, 0.06511696428060532, -0.01705845817923546, 0.12897786498069763, 0.11989687383174896, -0.1033744290471077, 0.07149549573659897, 0.033397141844034195, 0.07389207929372787, 0.11086906492710114, 0.051654696464538574, 0.15576213598251343, -0.031942758709192276, -0.10258112847805023, -0.10530461370944977, 0.17981253564357758, 0.036235399544239044, -0.0625036209821701, -0.17586852610111237, 0.0380011647939682, 0.025431042537093163, 0.04035161808133125, -0.12766428291797638, -0.0021111564710736275, 0.06721576303243637, -0.04555688798427582, 0.012820622883737087, -0.0867803618311882, 0.09754110127687454, -0.05600148066878319, -0.037131547927856445, 0.031017731875181198, 0.012411678209900856, 0.0225596334785223, -0.12175621092319489, -0.14925628900527954, 0.012167852371931076, 0.15980781614780426, 0.02261354587972164, -0.03666474297642708, 0.24897605180740356, 0.0048164245672523975, -0.13852444291114807, -0.01779613085091114, -0.08897772431373596, -0.02527623064815998, -0.07427314668893814, 0.03755063936114311, 0.03839914873242378, -0.0864400789141655, -0.19276943802833557, -0.02068420499563217, 0.06780214607715607, -0.047267187386751175, 0.15098153054714203, -0.003422695444896817, -0.03846035152673721, -0.007891708053648472, -0.12450899928808212, -0.05690932273864746, 0.06748582422733307, -0.006102546118199825, -0.004861581604927778, -0.08231841772794724, -2.4638668691134298e-32, 0.06256762892007828, -0.06415043771266937, -0.042241476476192474, -0.04838796705007553, -0.3124939501285553, 0.14662717282772064, -0.08818919211626053, 0.09194204211235046, 0.030575204640626907, -0.1509033441543579, -0.021365169435739517, -0.00622825650498271, 0.014489078894257545, 0.03151603415608406, 0.1275991052389145, 0.2611517608165741, -0.09884368628263474, -0.027810100466012955, -0.056985173374414444, -0.11712746322154999, 0.15800084173679352, 0.0657910704612732, -0.03741103783249855, -0.04315749183297157, -0.073822520673275, 0.07532130181789398, -0.12265985459089279, 0.01607314683496952, -0.010315204039216042, -0.04645123332738876, -0.07374131679534912, -0.02436262182891369, 0.011468705721199512, 0.01070493832230568, -0.06283289939165115, 0.1227046400308609, -0.11542012542486191, -0.05939100310206413, -0.0061928522773087025, -0.07004483044147491, 0.10728523880243301, 0.10325633734464645, -0.1466551423072815, -0.1145380437374115, 0.15351158380508423, 0.12843655049800873, 0.005531831178814173, -0.1236054003238678, 0.21987201273441315, -0.024224260821938515, 0.018755991011857986, 0.11587552726268768, -0.0017845069523900747, 0.008623980917036533, 0.0714593157172203, -0.005578475538641214, 0.05708582326769829, 0.1370820701122284, -0.010255708359181881, 0.014253786765038967, 0.1784476935863495, -0.07164103537797928, 0.07458601146936417, -0.035264331847429276, 0.15699119865894318, 0.09174013882875443, 0.290461927652359, -0.0009253295720554888, 0.08826165646314621, -0.09969334304332733, 0.15908032655715942, 0.0414896160364151, -0.06116688624024391, 0.02913658320903778, -0.19774162769317627, 0.06480712443590164, -0.2227500081062317, 0.008475038222968578, 0.1262020766735077, 0.013653861358761787, 0.0648820772767067, -0.11973031610250473, -0.06538046151399612, 0.03889147937297821, -0.06766816973686218, 0.1591843068599701, -0.004006435628980398, -0.045630116015672684, -0.14380457997322083, 0.15978090465068817, -0.06971415132284164, 0.007646237965673208, -0.05413346365094185, -0.011067739687860012, 0.05567336082458496, -0.1384555995464325, -0.0715397372841835, 0.08556394279003143, 0.04286622256040573, -0.08139445632696152, -0.14558105170726776, -0.05252060294151306, 0.011907187290489674, 0.11733254790306091, 0.1335063874721527, -0.1017182320356369, 0.005599432159215212, -0.021003294736146927, -0.08047929406166077, 0.08961004763841629, 0.023505710065364838, 0.0021744987461715937, 0.19623394310474396, 0.29393470287323, 0.011726041324436665, 0.04886520653963089, -0.16913966834545135, -0.047138527035713196, 0.02945808693766594, 0.1687331199645996, -0.09798523783683777, 0.1227373331785202, -0.06947405636310577, 0.09671074897050858, 0.010791764594614506, 0.041884344071149826, -0.17724794149398804, 0.00637423200532794, -0.010544327087700367, 0.13331326842308044, -0.021907059475779533, -0.034357715398073196, 7.699245543335564e-7, -0.12457714974880219, 0.026909219101071358, 0.11073226481676102, -0.22643402218818665, 0.04646911844611168, 0.07077446579933167, -0.148222878575325, 0.08878301084041595, -0.06820570677518845, 0.03942122310400009, 0.05775429680943489, -0.044650595635175705, -0.09619741141796112, -0.1420917958021164, 0.15221057832241058, 0.004394798073917627, -0.0739653930068016, 0.03775066137313843, 0.04181527718901634, 0.06661462038755417, -0.10932772606611252, 0.0826905146241188, 0.15399934351444244, -0.13590136170387268, -0.05020003020763397, -0.015191665850579739, -0.0065682921558618546, 0.08507116883993149, 0.10170972347259521, -0.12419769167900085, -0.08640418201684952, 0.07536961883306503, -0.08829756081104279, 0.056413959711790085, -0.028396472334861755, -0.029779158532619476, -0.14340923726558685, -0.05616478621959686, 0.10466215759515762, 0.06967569142580032, 0.025319449603557587, 0.031422264873981476, -0.038784969598054886, -0.13580243289470673, 0.11996764689683914, -0.04648786410689354, 0.046845268458127975, -0.10880735516548157, -0.045360371470451355, 0.01234314776957035, 0.13694047927856445, 0.08552949875593185, 0.1283593475818634, 0.13928429782390594, -0.09719641506671906, -0.06731058657169342, 0.13027052581310272, 0.0074583678506314754, 0.08976723998785019, 0.0037223491817712784, -0.09173761308193207, -0.14548370242118835, -0.12129401415586472, -0.08207904547452927, 0.05727175623178482, -0.08438726514577866, 0.007136183325201273, 1.9148003719092563e-35, 0.022589974105358124, 0.00817801896482706, -0.002643448766320944, -0.2292764037847519, 0.026900572702288628, 0.09060461819171906, -0.09773820638656616, -0.14877434074878693, 0.09409642964601517, -0.06826921552419662, -0.06889620423316956 ]
https://github.com/huggingface/datasets/issues/6276
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error
Since you are using Windows, maybe moving the `map` call inside `if __name__ == "__main__"` can fix the issue: ```python if __name__ == "__main__": common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) ``` Otherwise, the only solution is to set `num_proc=1`.
### Describe the bug I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post https://huggingface.co/blog/fine-tune-whisper I tried google collab and it works but because I'm on the free version the training doesn't complete the error comes in jupyter notebook when i run this line `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` here is the error message ``` Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s] The above exception was the direct cause of the following exception: NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1 File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value NameError: name 'feature_extractor' is not defined ``` ### Steps to reproduce the bug 1. follow the steps in this blog post https://huggingface.co/blog/fine-tune-whisper 2. run this line of code `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` 3. I'm using jupyter notebook from anaconda ### Expected behavior No error message ### Environment info datasets version: 2.8.0 Python version: 3.11 Windows 10
38
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error ### Describe the bug I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post https://huggingface.co/blog/fine-tune-whisper I tried google collab and it works but because I'm on the free version the training doesn't complete the error comes in jupyter notebook when i run this line `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` here is the error message ``` Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s] The above exception was the direct cause of the following exception: NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1 File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value NameError: name 'feature_extractor' is not defined ``` ### Steps to reproduce the bug 1. follow the steps in this blog post https://huggingface.co/blog/fine-tune-whisper 2. run this line of code `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` 3. I'm using jupyter notebook from anaconda ### Expected behavior No error message ### Environment info datasets version: 2.8.0 Python version: 3.11 Windows 10 Since you are using Windows, maybe moving the `map` call inside `if __name__ == "__main__"` can fix the issue: ```python if __name__ == "__main__": common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) ``` Otherwise, the only solution is to set `num_proc=1`.
[ 0.09523754566907883, 0.01659438945353031, 0.017888270318508148, 0.014276492409408092, 0.2735872268676758, -0.01401198748499155, 0.11820992082357407, 0.04570578783750534, 0.05514794960618019, 0.057444166392087936, -0.1803496778011322, -0.012840925715863705, 0.05464494600892067, 0.17127904295921326, -0.02503468655049801, -0.15509238839149475, 0.02068079635500908, -0.12725019454956055, 0.0448068231344223, -0.009743981063365936, -0.10085160285234451, 0.06560972332954407, -0.056987836956977844, 0.06333602219820023, -0.03345679119229317, -0.32662680745124817, -0.11255965381860733, 0.05255737900733948, -0.0768861472606659, -0.007313491310924292, 0.07201910763978958, 0.01996087096631527, -0.082244873046875, 0.22588925063610077, 0.000005832827810081653, -0.010653550736606121, 0.16098804771900177, 0.0030936929397284985, 0.039498958736658096, -0.019901497289538383, 0.13652382791042328, 0.06946121156215668, -0.13987915217876434, 0.009591499343514442, -0.07452116906642914, 0.024054085835814476, -0.17111214995384216, 0.07872343808412552, 0.23443280160427094, 0.18826737999916077, 0.038286834955215454, -0.028592417016625404, 0.12026559561491013, -0.08646004647016525, 0.005961341317743063, -0.24798230826854706, -0.05611974373459816, -0.0893331840634346, -0.2152881771326065, -0.133069708943367, 0.01362075749784708, 0.03180385008454323, -0.03299387916922569, -0.01860904134809971, 0.045951951295137405, 0.14257293939590454, -0.14024128019809723, -0.23802655935287476, -0.021336078643798828, 0.18363946676254272, 0.04351428896188736, 0.1544659286737442, -0.17320579290390015, 0.02234925888478756, -0.03420386090874672, -0.20674289762973785, -0.01731932908296585, -0.07723192870616913, -0.05148172378540039, -0.06570956856012344, -0.0994459018111229, -0.057518940418958664, 0.014714527875185013, -0.0031631914898753166, 0.0760519951581955, -0.047352761030197144, -0.07610530406236649, 0.03280835598707199, 0.08964795619249344, -0.25488629937171936, 0.08808489888906479, 0.029951075091958046, -0.01472321804612875, -0.011107070371508598, -0.13965490460395813, -0.055207476019859314, -0.07044805586338043, -0.12234005331993103, -0.017032237723469734, -0.07007820904254913, 0.020847657695412636, -0.13937360048294067, 0.08663615584373474, 0.1469144970178604, -0.016484536230564117, 0.07283664494752884, 0.10052763670682907, -0.0250475462526083, 0.13590362668037415, 0.10847017168998718, 0.041228827089071274, 0.09238182753324509, -0.19902396202087402, -0.00870687048882246, -0.03964397311210632, -0.006856310181319714, 0.04156529903411865, 0.01721210777759552, -0.014142083935439587, 0.2381592094898224, 0.14213918149471283, 0.1384163796901703, -0.06747829914093018, 0.09678678959608078, 0.0009477669955231249, -0.10460274666547775, 0.07096892595291138, 0.11471306532621384, -0.1464231163263321, -0.03345854580402374, -0.04136902838945389, 0.1732441633939743, -0.02887607179582119, -0.01982605643570423, 0.11730001866817474, 0.12423104792833328, 0.060606468468904495, -0.10082811117172241, 0.026380399242043495, -0.00904732383787632, 0.02420135959982872, -0.18174424767494202, -0.25925856828689575, 0.009837287478148937, -0.03868452459573746, -0.09634130448102951, 0.18148058652877808, 0.039903149008750916, 0.0616689957678318, -0.13623107969760895, -0.14382143318653107, 0.12252177298069, -0.1088540181517601, 0.09792502224445343, 0.032412029802799225, 0.12617972493171692, -0.004331926815211773, -0.06161046773195267, -0.07667253166437149, -0.03622325509786606, 0.061300959438085556, 0.05394629389047623, -0.013082285411655903, -0.14364105463027954, 0.1074330061674118, 0.016602730378508568, 0.08907525986433029, -0.0187670961022377, -0.0408063642680645, -0.04988928511738777, 0.1008554995059967, 0.13845084607601166, 0.05885423719882965, 0.002379057230427861, -0.018384316936135292, 0.16905055940151215, -0.030400754883885384, -0.01834714412689209, -0.17085613310337067, -0.08952663838863373, -0.0444122850894928, -0.06419625878334045, 0.06823825091123581, -0.07176376134157181, 0.004841903690248728, -0.012241920456290245, 0.18998587131500244, 0.09216878563165665, -0.09743795543909073, -0.07767246663570404, 0.11782176792621613, -0.003992987331002951, -0.1359536498785019, -0.09121295809745789, -0.02665136568248272, -0.06603722274303436, -0.03693116828799248, -0.13704298436641693, 0.027360348030924797, -0.1259104311466217, -0.010964046232402325, -0.03440394252538681, 0.05282590538263321, 0.05727998539805412, -0.07408885657787323, -0.0139514384791255, -0.09235510230064392, -0.04086652770638466, -0.18836042284965515, -0.0963752493262291, -0.06795211136341095, 0.009846781380474567, 0.06913118064403534, -0.12765441834926605, 0.02901981770992279, -0.09593677520751953, 0.09221872687339783, -0.05170043557882309, -0.02125108800828457, -0.017530657351017, -0.02053878642618656, 0.09035893529653549, -0.024117378517985344, -0.02562781237065792, -0.047256700694561005, -0.07519689202308655, -0.11257092654705048, 0.024339774623513222, 0.14784912765026093, 0.12065806984901428, -0.038686785846948624, -0.13509127497673035, 0.06853451579809189, 0.11014360934495926, 0.04504071921110153, -0.16595131158828735, -0.05759236216545105, -0.20745864510536194, -0.08324994891881943, 0.1047084778547287, -0.10840488970279694, 0.07833649218082428, -0.10744544118642807, -0.030811669304966927, 0.07287493348121643, 0.06814883649349213, -0.03322150185704231, 0.04927560314536095, 0.033822569996118546, -0.022076867520809174, 0.18559302389621735, 0.08996333926916122, -0.13338600099086761, 0.04502773657441139, 0.059634532779455185, -0.05740489810705185, 0.011934679932892323, 0.05874926224350929, -0.17693021893501282, -0.27134618163108826, 0.23855195939540863, -0.020226139575242996, 0.12191344052553177, -0.09004967659711838, 0.1525929719209671, -0.0683746188879013, -0.06322792172431946, -0.14627237617969513, 0.029485994949936867, 0.059695325791835785, -0.06057405844330788, 0.0026532653719186783, 0.04718739539384842, -0.14039652049541473, 0.0193362794816494, 0.013032782822847366, 0.2056182473897934, 0.0070931510999798775, -0.029280465096235275, 0.02223462238907814, -0.13058139383792877, 0.0036424777936190367, 0.0743122324347496, 0.04171518236398697, 0.13553179800510406, 0.04395941272377968, 0.02649274282157421, -0.09532763808965683, -0.04947853833436966, 0.10975678265094757, -0.037960756570100784, 0.08599940687417984, 0.03046339377760887, -0.1669771373271942, -0.13637347519397736, 0.11348855495452881, 0.06261543184518814, 0.15005861222743988, 0.01563914492726326, 0.06629245728254318, -0.06685583293437958, -0.00492990342900157, -0.0008840984664857388, 0.04929810017347336, 0.004267336335033178, -0.14088159799575806, 0.15027852356433868, 0.28088805079460144, -0.05619152635335922, -0.01768597774207592, 0.051416922360658646, -0.08385541290044785, -0.07020871341228485, 0.23716458678245544, 0.08402299880981445, 0.06661848723888397, -0.04466700181365013, -0.011246451176702976, 0.08947623521089554, -0.016609253361821175, 0.06775147467851639, -0.024975625798106194, 0.0393415167927742, 0.08635477721691132, 0.04988770931959152, 0.026474764570593834, -0.22573819756507874, -0.12140239030122757, 0.006713094189763069, -0.29906946420669556, 0.00447978125885129, 0.19961851835250854, -0.2082921713590622, 0.03735673055052757, -0.0008390619186684489, 0.039064906537532806, -0.15486787259578705, -0.1495593786239624, 0.24645546078681946, 0.004297909792512655, -0.07391172647476196, -0.006754210218787193, -0.10641059279441833, 0.0622699037194252, -0.04604775831103325, 0.017289262264966965, 0.05986673757433891, -0.02488052099943161, 0.10809582471847534, 0.08965069055557251, 0.022145936265587807, -0.023810630664229393, -0.04221722483634949, -0.06643501669168472, -0.14262214303016663, -0.08703772723674774, -0.15099263191223145, 0.09888258576393127, -0.005995818413794041, 0.01904749684035778, 0.24197599291801453, 0.004795638378709555, 0.03986337408423424, 0.19415530562400818, -0.11451352387666702, 0.09964292496442795, 0.0646093413233757, -0.09540921449661255, -0.10852900892496109, -0.11080244928598404, 0.1351034939289093, 0.06256186962127686, -0.02355434186756611, 0.033113833516836166, 0.04605427011847496, -0.01477218046784401, -0.1429550051689148, -0.14548370242118835, 0.08384779840707779, 0.04426439851522446, 0.06776644289493561, -0.09522580355405807, -0.12927377223968506, 0.055493637919425964, 0.22290277481079102, 0.08638304471969604, 0.011624736711382866, 0.0494549497961998, -0.24578319489955902, 0.178957998752594, 0.0749230608344078, -0.09424666315317154, -0.07533641904592514, -0.2181379646062851, 0.05215015634894371, -0.15028776228427887, 0.21415384113788605, 0.11707470566034317, 0.007204465102404356, -0.02959495410323143, -0.03583981841802597, 0.2851254642009735, -0.10713602602481842, 0.0017513056518509984, -0.07694835215806961, 0.11115913093090057, 0.004005953669548035, 0.038376618176698685, 0.07965710014104843, -0.08241446316242218, 0.14536932110786438, 0.12849143147468567, 0.06551644951105118, 0.07993858307600021, 0.16249245405197144, 0.05741052329540253, 0.015185452066361904, -0.06714855879545212, -0.08843514323234558, -0.12444423139095306, -0.09512298554182053, -0.015729917213320732, -0.05343194678425789, 0.16081975400447845, 0.016226759180426598, 0.01728176884353161, 0.2903081774711609, -0.1798190325498581, 0.11582814157009125, 0.04360770806670189, 0.10350209474563599, -0.03416406363248825, 0.04246728867292404, 0.11331810802221298, 0.10103919357061386, -0.018066419288516045, 0.22541573643684387, -0.05861503258347511, -0.10162799060344696, 0.07654840499162674, -0.0695694163441658, 0.026551946997642517, 0.13258522748947144, 0.012556944042444229, 0.06425796449184418, -0.002517131855711341, 0.011438069865107536, 0.041318271309137344, -0.05680854246020317, 0.09603017568588257, 0.008761056698858738, -0.22746609151363373, -0.04784051328897476, -0.0595485158264637, 0.07639065384864807, 0.07709614932537079, 0.10924743860960007, -0.001620614668354392, -0.06773398071527481, 0.13904209434986115, 0.03096465952694416, -0.0378364734351635, -0.04366074502468109, -0.02476937137544155, -0.004080110229551792, -0.036870863288640976, 0.30369946360588074, -0.28889408707618713, 0.18710105121135712, 0.18414469063282013, -0.06583068519830704, 0.10387624055147171, 0.08511798828840256, 0.014537050388753414, 0.09619496017694473, -0.04962116852402687, 0.06682471185922623, -0.0316983163356781, -0.06806270778179169, -0.026947051286697388, 0.08701729774475098, 0.038063064217567444, 0.1293313354253769, -0.15496093034744263, -0.13712814450263977, 0.21369248628616333, 0.1162920594215393, -0.015390360727906227, 0.01789882220327854, 0.03532334789633751, 0.07257319241762161, -0.022464381530880928, -0.0281352661550045, -0.05055757611989975, 0.1434711366891861, 0.04544428363442421, 0.033981043845415115, 0.028667768463492393, 0.09622650593519211, 0.05130588263273239, 0.20024557411670685, -0.11347924172878265, 0.011119731701910496, 0.23873509466648102, 0.03826657682657242, -0.24132229387760162, 0.1564200520515442, 0.006076784338802099, -0.035588860511779785, -0.04854796454310417, 0.05041758716106415, 0.10645648837089539, -0.03609687462449074, -0.3233909010887146, -0.061742473393678665, -0.05846373736858368, 0.056325118988752365, 0.02646857127547264, -0.18841667473316193, 0.09445645660161972, 0.010224133729934692, 0.12247651070356369, -0.009480430744588375, 0.007140093483030796, -0.03984859585762024, 0.03303823247551918, -0.013250213116407394, 0.09289220720529556, 0.19214271008968353, 0.10562577098608017, -0.08910215646028519, 0.19566480815410614, 0.15648292005062103, 0.004380699712783098, -0.09933920204639435, 0.12594617903232574, 0.1154274046421051, 0.05646374076604843, -0.005951733328402042, 0.011264433152973652, 0.13864223659038544, -0.20049995183944702, 0.06119806692004204, 0.1846417933702469, 0.20043547451496124, 0.20876947045326233, -0.008636653423309326, -0.2170337438583374, -0.04091837257146835, -0.03566575422883034, -0.07534702122211456, 0.01174099463969469, 0.05893545225262642, -0.002292762277647853, 0.06305596977472305, -2.928844092093549e-32, -0.26690226793289185, -0.06969625502824783, -0.031783487647771835, 0.1718810349702835, -0.23130536079406738, 0.03340684995055199, -0.07804499566555023, 0.02210428938269615, -0.0018148913513869047, -0.10060007870197296, -0.11483326554298401, 0.04063005372881889, 0.04408493638038635, -0.030728807672858238, -0.11459528654813766, 0.0704898089170456, 0.04374020919203758, 0.07819847762584686, -0.04140758514404297, 0.05018184706568718, 0.0410614050924778, 0.13381674885749817, 0.011945377103984356, -0.08066754043102264, -0.24541079998016357, 0.09839659929275513, -0.23864708840847015, -0.024963198229670525, -0.09074277430772781, -0.09577865153551102, -0.14011095464229584, 0.09916650503873825, -0.07416965067386627, 0.032196544110774994, -0.023771388456225395, -0.0017035925993695855, -0.08642149716615677, -0.02506502903997898, -0.08072615414857864, 0.06997645646333694, 0.09748171269893646, 0.07457099109888077, 0.021790217608213425, -0.07342707365751266, -0.13244427740573883, 0.15533851087093353, 0.09811543673276901, -0.13054054975509644, -0.008706793189048767, -0.017440306022763252, -0.06305385380983353, 0.08668652921915054, -0.05851040408015251, 0.030127588659524918, 0.0037717665545642376, -0.22508160769939423, -0.07162081450223923, 0.023092497140169144, -0.0960303321480751, -0.0075277783907949924, 0.09307657182216644, 0.0010934267193078995, 0.005260535981506109, 0.05600162595510483, -0.024022694677114487, 0.000009571292139298748, 0.19661478698253632, 0.10755303502082825, 0.015181068331003189, -0.15148258209228516, 0.052809134125709534, -0.053931497037410736, 0.023241685703396797, -0.021999258548021317, -0.20280279219150543, -0.25574663281440735, -0.07409332692623138, -0.00017378773191012442, 0.007507276721298695, -0.062312494963407516, 0.02783902734518051, 0.12310448288917542, -0.0021269384305924177, -0.026246368885040283, -0.2081005871295929, -0.07790426164865494, -0.1399400681257248, 0.06730542331933975, -0.12689480185508728, 0.014133651740849018, 0.03027988411486149, 0.09011506289243698, -0.17186902463436127, -0.06700095534324646, 0.08352738618850708, -0.004498873371630907, 0.06931864470243454, 0.06388712674379349, -0.13002954423427582, -0.05243152379989624, -0.06272576004266739, -0.12176670879125595, 0.10433248430490494, 0.11275263130664825, 0.22595641016960144, -0.013543332926928997, 0.13041207194328308, -0.052469100803136826, -0.15330231189727783, -0.08376353979110718, 0.001038560178130865, -0.03128962591290474, 0.29268425703048706, 0.09734463691711426, -0.015950119122862816, -0.09929444640874863, 0.003842460922896862, 0.058101363480091095, 0.11206908524036407, 0.13165684044361115, -0.1591673046350479, -0.16644786298274994, -0.13328929245471954, -0.0921480730175972, -0.10564213246107101, 0.1016523614525795, -0.0997818186879158, 0.026789812371134758, -0.05754280462861061, -0.0020384967792779207, -0.06251639127731323, -0.05879038944840431, 7.389504617094644e-7, -0.27593761682510376, 0.2001568078994751, -0.012400315143167973, 0.0180814228951931, -0.1586751639842987, 0.06994923204183578, -0.023837197571992874, -0.05848100781440735, -0.05348643660545349, 0.18756531178951263, 0.02381528913974762, -0.09903233498334885, -0.006813327316194773, 0.0037407621275633574, 0.005915708839893341, -0.121828094124794, -0.24915552139282227, 0.06356231123209, -0.17509450018405914, -0.007437893655151129, -0.03146436810493469, 0.08804581314325333, 0.18415683507919312, -0.01875397562980652, 0.07413145154714584, 0.060147903859615326, -0.10523991286754608, -0.007989929057657719, 0.012266132980585098, 0.006397816352546215, -0.019477101042866707, 0.07489029318094254, 0.007830969989299774, 0.11319182068109512, -0.010049193166196346, -0.07733848690986633, -0.10608778148889542, -0.03311435133218765, 0.02203352004289627, 0.03621235862374306, 0.052771810442209244, 0.18436045944690704, 0.046444110572338104, -0.1486952304840088, 0.005768163595348597, 0.11425232887268066, -0.06487204134464264, -0.13812755048274994, -0.07227694988250732, 0.011139779351651669, 0.10664799809455872, -0.04908433184027672, 0.12263868749141693, 0.14791864156723022, -0.05222035199403763, 0.05756116658449173, -0.14208604395389557, -0.12978079915046692, 0.22138451039791107, -0.04352286085486412, -0.03786700591444969, -0.1287641078233719, 0.043624039739370346, -0.07796787470579147, 0.020723244175314903, -0.09808171540498734, 0.008645092137157917, -3.404717794139131e-35, -0.04211992397904396, -0.06597217917442322, -0.003808443434536457, -0.19327813386917114, 0.10011711716651917, 0.039329130202531815, 0.3007398545742035, -0.04168963432312012, 0.10052609443664551, -0.21683458983898163, -0.15740416944026947 ]
https://github.com/huggingface/datasets/issues/6276
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error
> Since you are using Windows, maybe moving the `map` call inside `if __name__ == "__main__"` can fix the issue: > > ```python > if __name__ == "__main__": > common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) > ``` > > Otherwise, the only solution is to set `num_proc=1`. Thank you very much for the response, i eventually tried setting `num_proc=1` and now the jupyter notebook kernel keers dying after running the command, what do you think the issue could be, could it be that my system is not capable of running the command "i'm using a Lenovo Thinkpad T440 with no GPU"
### Describe the bug I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post https://huggingface.co/blog/fine-tune-whisper I tried google collab and it works but because I'm on the free version the training doesn't complete the error comes in jupyter notebook when i run this line `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` here is the error message ``` Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s] The above exception was the direct cause of the following exception: NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1 File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value NameError: name 'feature_extractor' is not defined ``` ### Steps to reproduce the bug 1. follow the steps in this blog post https://huggingface.co/blog/fine-tune-whisper 2. run this line of code `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` 3. I'm using jupyter notebook from anaconda ### Expected behavior No error message ### Environment info datasets version: 2.8.0 Python version: 3.11 Windows 10
100
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error ### Describe the bug I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post https://huggingface.co/blog/fine-tune-whisper I tried google collab and it works but because I'm on the free version the training doesn't complete the error comes in jupyter notebook when i run this line `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` here is the error message ``` Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s] The above exception was the direct cause of the following exception: NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1 File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value NameError: name 'feature_extractor' is not defined ``` ### Steps to reproduce the bug 1. follow the steps in this blog post https://huggingface.co/blog/fine-tune-whisper 2. run this line of code `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` 3. I'm using jupyter notebook from anaconda ### Expected behavior No error message ### Environment info datasets version: 2.8.0 Python version: 3.11 Windows 10 > Since you are using Windows, maybe moving the `map` call inside `if __name__ == "__main__"` can fix the issue: > > ```python > if __name__ == "__main__": > common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) > ``` > > Otherwise, the only solution is to set `num_proc=1`. Thank you very much for the response, i eventually tried setting `num_proc=1` and now the jupyter notebook kernel keers dying after running the command, what do you think the issue could be, could it be that my system is not capable of running the command "i'm using a Lenovo Thinkpad T440 with no GPU"
[ 0.09523754566907883, 0.01659438945353031, 0.017888270318508148, 0.014276492409408092, 0.2735872268676758, -0.01401198748499155, 0.11820992082357407, 0.04570578783750534, 0.05514794960618019, 0.057444166392087936, -0.1803496778011322, -0.012840925715863705, 0.05464494600892067, 0.17127904295921326, -0.02503468655049801, -0.15509238839149475, 0.02068079635500908, -0.12725019454956055, 0.0448068231344223, -0.009743981063365936, -0.10085160285234451, 0.06560972332954407, -0.056987836956977844, 0.06333602219820023, -0.03345679119229317, -0.32662680745124817, -0.11255965381860733, 0.05255737900733948, -0.0768861472606659, -0.007313491310924292, 0.07201910763978958, 0.01996087096631527, -0.082244873046875, 0.22588925063610077, 0.000005832827810081653, -0.010653550736606121, 0.16098804771900177, 0.0030936929397284985, 0.039498958736658096, -0.019901497289538383, 0.13652382791042328, 0.06946121156215668, -0.13987915217876434, 0.009591499343514442, -0.07452116906642914, 0.024054085835814476, -0.17111214995384216, 0.07872343808412552, 0.23443280160427094, 0.18826737999916077, 0.038286834955215454, -0.028592417016625404, 0.12026559561491013, -0.08646004647016525, 0.005961341317743063, -0.24798230826854706, -0.05611974373459816, -0.0893331840634346, -0.2152881771326065, -0.133069708943367, 0.01362075749784708, 0.03180385008454323, -0.03299387916922569, -0.01860904134809971, 0.045951951295137405, 0.14257293939590454, -0.14024128019809723, -0.23802655935287476, -0.021336078643798828, 0.18363946676254272, 0.04351428896188736, 0.1544659286737442, -0.17320579290390015, 0.02234925888478756, -0.03420386090874672, -0.20674289762973785, -0.01731932908296585, -0.07723192870616913, -0.05148172378540039, -0.06570956856012344, -0.0994459018111229, -0.057518940418958664, 0.014714527875185013, -0.0031631914898753166, 0.0760519951581955, -0.047352761030197144, -0.07610530406236649, 0.03280835598707199, 0.08964795619249344, -0.25488629937171936, 0.08808489888906479, 0.029951075091958046, -0.01472321804612875, -0.011107070371508598, -0.13965490460395813, -0.055207476019859314, -0.07044805586338043, -0.12234005331993103, -0.017032237723469734, -0.07007820904254913, 0.020847657695412636, -0.13937360048294067, 0.08663615584373474, 0.1469144970178604, -0.016484536230564117, 0.07283664494752884, 0.10052763670682907, -0.0250475462526083, 0.13590362668037415, 0.10847017168998718, 0.041228827089071274, 0.09238182753324509, -0.19902396202087402, -0.00870687048882246, -0.03964397311210632, -0.006856310181319714, 0.04156529903411865, 0.01721210777759552, -0.014142083935439587, 0.2381592094898224, 0.14213918149471283, 0.1384163796901703, -0.06747829914093018, 0.09678678959608078, 0.0009477669955231249, -0.10460274666547775, 0.07096892595291138, 0.11471306532621384, -0.1464231163263321, -0.03345854580402374, -0.04136902838945389, 0.1732441633939743, -0.02887607179582119, -0.01982605643570423, 0.11730001866817474, 0.12423104792833328, 0.060606468468904495, -0.10082811117172241, 0.026380399242043495, -0.00904732383787632, 0.02420135959982872, -0.18174424767494202, -0.25925856828689575, 0.009837287478148937, -0.03868452459573746, -0.09634130448102951, 0.18148058652877808, 0.039903149008750916, 0.0616689957678318, -0.13623107969760895, -0.14382143318653107, 0.12252177298069, -0.1088540181517601, 0.09792502224445343, 0.032412029802799225, 0.12617972493171692, -0.004331926815211773, -0.06161046773195267, -0.07667253166437149, -0.03622325509786606, 0.061300959438085556, 0.05394629389047623, -0.013082285411655903, -0.14364105463027954, 0.1074330061674118, 0.016602730378508568, 0.08907525986433029, -0.0187670961022377, -0.0408063642680645, -0.04988928511738777, 0.1008554995059967, 0.13845084607601166, 0.05885423719882965, 0.002379057230427861, -0.018384316936135292, 0.16905055940151215, -0.030400754883885384, -0.01834714412689209, -0.17085613310337067, -0.08952663838863373, -0.0444122850894928, -0.06419625878334045, 0.06823825091123581, -0.07176376134157181, 0.004841903690248728, -0.012241920456290245, 0.18998587131500244, 0.09216878563165665, -0.09743795543909073, -0.07767246663570404, 0.11782176792621613, -0.003992987331002951, -0.1359536498785019, -0.09121295809745789, -0.02665136568248272, -0.06603722274303436, -0.03693116828799248, -0.13704298436641693, 0.027360348030924797, -0.1259104311466217, -0.010964046232402325, -0.03440394252538681, 0.05282590538263321, 0.05727998539805412, -0.07408885657787323, -0.0139514384791255, -0.09235510230064392, -0.04086652770638466, -0.18836042284965515, -0.0963752493262291, -0.06795211136341095, 0.009846781380474567, 0.06913118064403534, -0.12765441834926605, 0.02901981770992279, -0.09593677520751953, 0.09221872687339783, -0.05170043557882309, -0.02125108800828457, -0.017530657351017, -0.02053878642618656, 0.09035893529653549, -0.024117378517985344, -0.02562781237065792, -0.047256700694561005, -0.07519689202308655, -0.11257092654705048, 0.024339774623513222, 0.14784912765026093, 0.12065806984901428, -0.038686785846948624, -0.13509127497673035, 0.06853451579809189, 0.11014360934495926, 0.04504071921110153, -0.16595131158828735, -0.05759236216545105, -0.20745864510536194, -0.08324994891881943, 0.1047084778547287, -0.10840488970279694, 0.07833649218082428, -0.10744544118642807, -0.030811669304966927, 0.07287493348121643, 0.06814883649349213, -0.03322150185704231, 0.04927560314536095, 0.033822569996118546, -0.022076867520809174, 0.18559302389621735, 0.08996333926916122, -0.13338600099086761, 0.04502773657441139, 0.059634532779455185, -0.05740489810705185, 0.011934679932892323, 0.05874926224350929, -0.17693021893501282, -0.27134618163108826, 0.23855195939540863, -0.020226139575242996, 0.12191344052553177, -0.09004967659711838, 0.1525929719209671, -0.0683746188879013, -0.06322792172431946, -0.14627237617969513, 0.029485994949936867, 0.059695325791835785, -0.06057405844330788, 0.0026532653719186783, 0.04718739539384842, -0.14039652049541473, 0.0193362794816494, 0.013032782822847366, 0.2056182473897934, 0.0070931510999798775, -0.029280465096235275, 0.02223462238907814, -0.13058139383792877, 0.0036424777936190367, 0.0743122324347496, 0.04171518236398697, 0.13553179800510406, 0.04395941272377968, 0.02649274282157421, -0.09532763808965683, -0.04947853833436966, 0.10975678265094757, -0.037960756570100784, 0.08599940687417984, 0.03046339377760887, -0.1669771373271942, -0.13637347519397736, 0.11348855495452881, 0.06261543184518814, 0.15005861222743988, 0.01563914492726326, 0.06629245728254318, -0.06685583293437958, -0.00492990342900157, -0.0008840984664857388, 0.04929810017347336, 0.004267336335033178, -0.14088159799575806, 0.15027852356433868, 0.28088805079460144, -0.05619152635335922, -0.01768597774207592, 0.051416922360658646, -0.08385541290044785, -0.07020871341228485, 0.23716458678245544, 0.08402299880981445, 0.06661848723888397, -0.04466700181365013, -0.011246451176702976, 0.08947623521089554, -0.016609253361821175, 0.06775147467851639, -0.024975625798106194, 0.0393415167927742, 0.08635477721691132, 0.04988770931959152, 0.026474764570593834, -0.22573819756507874, -0.12140239030122757, 0.006713094189763069, -0.29906946420669556, 0.00447978125885129, 0.19961851835250854, -0.2082921713590622, 0.03735673055052757, -0.0008390619186684489, 0.039064906537532806, -0.15486787259578705, -0.1495593786239624, 0.24645546078681946, 0.004297909792512655, -0.07391172647476196, -0.006754210218787193, -0.10641059279441833, 0.0622699037194252, -0.04604775831103325, 0.017289262264966965, 0.05986673757433891, -0.02488052099943161, 0.10809582471847534, 0.08965069055557251, 0.022145936265587807, -0.023810630664229393, -0.04221722483634949, -0.06643501669168472, -0.14262214303016663, -0.08703772723674774, -0.15099263191223145, 0.09888258576393127, -0.005995818413794041, 0.01904749684035778, 0.24197599291801453, 0.004795638378709555, 0.03986337408423424, 0.19415530562400818, -0.11451352387666702, 0.09964292496442795, 0.0646093413233757, -0.09540921449661255, -0.10852900892496109, -0.11080244928598404, 0.1351034939289093, 0.06256186962127686, -0.02355434186756611, 0.033113833516836166, 0.04605427011847496, -0.01477218046784401, -0.1429550051689148, -0.14548370242118835, 0.08384779840707779, 0.04426439851522446, 0.06776644289493561, -0.09522580355405807, -0.12927377223968506, 0.055493637919425964, 0.22290277481079102, 0.08638304471969604, 0.011624736711382866, 0.0494549497961998, -0.24578319489955902, 0.178957998752594, 0.0749230608344078, -0.09424666315317154, -0.07533641904592514, -0.2181379646062851, 0.05215015634894371, -0.15028776228427887, 0.21415384113788605, 0.11707470566034317, 0.007204465102404356, -0.02959495410323143, -0.03583981841802597, 0.2851254642009735, -0.10713602602481842, 0.0017513056518509984, -0.07694835215806961, 0.11115913093090057, 0.004005953669548035, 0.038376618176698685, 0.07965710014104843, -0.08241446316242218, 0.14536932110786438, 0.12849143147468567, 0.06551644951105118, 0.07993858307600021, 0.16249245405197144, 0.05741052329540253, 0.015185452066361904, -0.06714855879545212, -0.08843514323234558, -0.12444423139095306, -0.09512298554182053, -0.015729917213320732, -0.05343194678425789, 0.16081975400447845, 0.016226759180426598, 0.01728176884353161, 0.2903081774711609, -0.1798190325498581, 0.11582814157009125, 0.04360770806670189, 0.10350209474563599, -0.03416406363248825, 0.04246728867292404, 0.11331810802221298, 0.10103919357061386, -0.018066419288516045, 0.22541573643684387, -0.05861503258347511, -0.10162799060344696, 0.07654840499162674, -0.0695694163441658, 0.026551946997642517, 0.13258522748947144, 0.012556944042444229, 0.06425796449184418, -0.002517131855711341, 0.011438069865107536, 0.041318271309137344, -0.05680854246020317, 0.09603017568588257, 0.008761056698858738, -0.22746609151363373, -0.04784051328897476, -0.0595485158264637, 0.07639065384864807, 0.07709614932537079, 0.10924743860960007, -0.001620614668354392, -0.06773398071527481, 0.13904209434986115, 0.03096465952694416, -0.0378364734351635, -0.04366074502468109, -0.02476937137544155, -0.004080110229551792, -0.036870863288640976, 0.30369946360588074, -0.28889408707618713, 0.18710105121135712, 0.18414469063282013, -0.06583068519830704, 0.10387624055147171, 0.08511798828840256, 0.014537050388753414, 0.09619496017694473, -0.04962116852402687, 0.06682471185922623, -0.0316983163356781, -0.06806270778179169, -0.026947051286697388, 0.08701729774475098, 0.038063064217567444, 0.1293313354253769, -0.15496093034744263, -0.13712814450263977, 0.21369248628616333, 0.1162920594215393, -0.015390360727906227, 0.01789882220327854, 0.03532334789633751, 0.07257319241762161, -0.022464381530880928, -0.0281352661550045, -0.05055757611989975, 0.1434711366891861, 0.04544428363442421, 0.033981043845415115, 0.028667768463492393, 0.09622650593519211, 0.05130588263273239, 0.20024557411670685, -0.11347924172878265, 0.011119731701910496, 0.23873509466648102, 0.03826657682657242, -0.24132229387760162, 0.1564200520515442, 0.006076784338802099, -0.035588860511779785, -0.04854796454310417, 0.05041758716106415, 0.10645648837089539, -0.03609687462449074, -0.3233909010887146, -0.061742473393678665, -0.05846373736858368, 0.056325118988752365, 0.02646857127547264, -0.18841667473316193, 0.09445645660161972, 0.010224133729934692, 0.12247651070356369, -0.009480430744588375, 0.007140093483030796, -0.03984859585762024, 0.03303823247551918, -0.013250213116407394, 0.09289220720529556, 0.19214271008968353, 0.10562577098608017, -0.08910215646028519, 0.19566480815410614, 0.15648292005062103, 0.004380699712783098, -0.09933920204639435, 0.12594617903232574, 0.1154274046421051, 0.05646374076604843, -0.005951733328402042, 0.011264433152973652, 0.13864223659038544, -0.20049995183944702, 0.06119806692004204, 0.1846417933702469, 0.20043547451496124, 0.20876947045326233, -0.008636653423309326, -0.2170337438583374, -0.04091837257146835, -0.03566575422883034, -0.07534702122211456, 0.01174099463969469, 0.05893545225262642, -0.002292762277647853, 0.06305596977472305, -2.928844092093549e-32, -0.26690226793289185, -0.06969625502824783, -0.031783487647771835, 0.1718810349702835, -0.23130536079406738, 0.03340684995055199, -0.07804499566555023, 0.02210428938269615, -0.0018148913513869047, -0.10060007870197296, -0.11483326554298401, 0.04063005372881889, 0.04408493638038635, -0.030728807672858238, -0.11459528654813766, 0.0704898089170456, 0.04374020919203758, 0.07819847762584686, -0.04140758514404297, 0.05018184706568718, 0.0410614050924778, 0.13381674885749817, 0.011945377103984356, -0.08066754043102264, -0.24541079998016357, 0.09839659929275513, -0.23864708840847015, -0.024963198229670525, -0.09074277430772781, -0.09577865153551102, -0.14011095464229584, 0.09916650503873825, -0.07416965067386627, 0.032196544110774994, -0.023771388456225395, -0.0017035925993695855, -0.08642149716615677, -0.02506502903997898, -0.08072615414857864, 0.06997645646333694, 0.09748171269893646, 0.07457099109888077, 0.021790217608213425, -0.07342707365751266, -0.13244427740573883, 0.15533851087093353, 0.09811543673276901, -0.13054054975509644, -0.008706793189048767, -0.017440306022763252, -0.06305385380983353, 0.08668652921915054, -0.05851040408015251, 0.030127588659524918, 0.0037717665545642376, -0.22508160769939423, -0.07162081450223923, 0.023092497140169144, -0.0960303321480751, -0.0075277783907949924, 0.09307657182216644, 0.0010934267193078995, 0.005260535981506109, 0.05600162595510483, -0.024022694677114487, 0.000009571292139298748, 0.19661478698253632, 0.10755303502082825, 0.015181068331003189, -0.15148258209228516, 0.052809134125709534, -0.053931497037410736, 0.023241685703396797, -0.021999258548021317, -0.20280279219150543, -0.25574663281440735, -0.07409332692623138, -0.00017378773191012442, 0.007507276721298695, -0.062312494963407516, 0.02783902734518051, 0.12310448288917542, -0.0021269384305924177, -0.026246368885040283, -0.2081005871295929, -0.07790426164865494, -0.1399400681257248, 0.06730542331933975, -0.12689480185508728, 0.014133651740849018, 0.03027988411486149, 0.09011506289243698, -0.17186902463436127, -0.06700095534324646, 0.08352738618850708, -0.004498873371630907, 0.06931864470243454, 0.06388712674379349, -0.13002954423427582, -0.05243152379989624, -0.06272576004266739, -0.12176670879125595, 0.10433248430490494, 0.11275263130664825, 0.22595641016960144, -0.013543332926928997, 0.13041207194328308, -0.052469100803136826, -0.15330231189727783, -0.08376353979110718, 0.001038560178130865, -0.03128962591290474, 0.29268425703048706, 0.09734463691711426, -0.015950119122862816, -0.09929444640874863, 0.003842460922896862, 0.058101363480091095, 0.11206908524036407, 0.13165684044361115, -0.1591673046350479, -0.16644786298274994, -0.13328929245471954, -0.0921480730175972, -0.10564213246107101, 0.1016523614525795, -0.0997818186879158, 0.026789812371134758, -0.05754280462861061, -0.0020384967792779207, -0.06251639127731323, -0.05879038944840431, 7.389504617094644e-7, -0.27593761682510376, 0.2001568078994751, -0.012400315143167973, 0.0180814228951931, -0.1586751639842987, 0.06994923204183578, -0.023837197571992874, -0.05848100781440735, -0.05348643660545349, 0.18756531178951263, 0.02381528913974762, -0.09903233498334885, -0.006813327316194773, 0.0037407621275633574, 0.005915708839893341, -0.121828094124794, -0.24915552139282227, 0.06356231123209, -0.17509450018405914, -0.007437893655151129, -0.03146436810493469, 0.08804581314325333, 0.18415683507919312, -0.01875397562980652, 0.07413145154714584, 0.060147903859615326, -0.10523991286754608, -0.007989929057657719, 0.012266132980585098, 0.006397816352546215, -0.019477101042866707, 0.07489029318094254, 0.007830969989299774, 0.11319182068109512, -0.010049193166196346, -0.07733848690986633, -0.10608778148889542, -0.03311435133218765, 0.02203352004289627, 0.03621235862374306, 0.052771810442209244, 0.18436045944690704, 0.046444110572338104, -0.1486952304840088, 0.005768163595348597, 0.11425232887268066, -0.06487204134464264, -0.13812755048274994, -0.07227694988250732, 0.011139779351651669, 0.10664799809455872, -0.04908433184027672, 0.12263868749141693, 0.14791864156723022, -0.05222035199403763, 0.05756116658449173, -0.14208604395389557, -0.12978079915046692, 0.22138451039791107, -0.04352286085486412, -0.03786700591444969, -0.1287641078233719, 0.043624039739370346, -0.07796787470579147, 0.020723244175314903, -0.09808171540498734, 0.008645092137157917, -3.404717794139131e-35, -0.04211992397904396, -0.06597217917442322, -0.003808443434536457, -0.19327813386917114, 0.10011711716651917, 0.039329130202531815, 0.3007398545742035, -0.04168963432312012, 0.10052609443664551, -0.21683458983898163, -0.15740416944026947 ]
https://github.com/huggingface/datasets/issues/6275
Would like to Contribute a dataset
Hi! The process of contributing a dataset is explained here: https://huggingface.co/docs/datasets/upload_dataset. Also, check https://huggingface.co/docs/datasets/image_dataset for a more detailed explanation of how to share an image dataset.
I have a dataset of 2500 images that can be used for color-blind machine-learning algorithms. Since , there was no dataset available online , I made this dataset myself and would like to contribute this now to community
26
Would like to Contribute a dataset I have a dataset of 2500 images that can be used for color-blind machine-learning algorithms. Since , there was no dataset available online , I made this dataset myself and would like to contribute this now to community Hi! The process of contributing a dataset is explained here: https://huggingface.co/docs/datasets/upload_dataset. Also, check https://huggingface.co/docs/datasets/image_dataset for a more detailed explanation of how to share an image dataset.
[ 0.016343215480446815, 0.00629084138199687, -0.04012153297662735, 0.008750014938414097, 0.10962290316820145, 0.030689213424921036, 0.2170308530330658, -0.11082601547241211, 0.12508907914161682, 0.05166525021195412, -0.016930781304836273, -0.08480113744735718, -0.07812215387821198, 0.13296499848365784, 0.076119065284729, -0.2713366448879242, -0.13890017569065094, -0.09505513310432434, -0.0708228275179863, -0.1512170135974884, -0.0013670872431248426, 0.02832525037229061, 0.11331149935722351, -0.059428852051496506, -0.01056218333542347, 0.02153787761926651, -0.09227032959461212, 0.11593348532915115, -0.07803378254175186, -0.0350128598511219, 0.02555837109684944, 0.04911623150110245, 0.09829629957675934, 0.14040078222751617, 0.0000053096764531801455, -0.0893002301454544, 0.006061829160898924, 0.06278178840875626, 0.0924108698964119, -0.06106634810566902, 0.12418169528245926, -0.03630460426211357, -0.06170181185007095, 0.038149986416101456, -0.03167763724923134, -0.07113944739103317, 0.22832025587558746, 0.11113449186086655, 0.24528658390045166, 0.18258674442768097, 0.0644032210111618, 0.15440605580806732, 0.054183732718229294, -0.0778985247015953, 0.026910757645964622, 0.18363545835018158, 0.0018303835531696677, 0.17518293857574463, -0.15937605500221252, -0.09818698465824127, 0.02432015910744667, -0.044363733381032944, 0.11238040030002594, -0.09624471515417099, 0.1196562722325325, 0.07432270795106888, -0.29435792565345764, -0.08104708045721054, 0.0033509796485304832, 0.11032036691904068, 0.11185616999864578, 0.012762515805661678, -0.032747890800237656, 0.09518887102603912, -0.12378139048814774, 0.05676696449518204, -0.18823149800300598, 0.1536436229944229, -0.03511831909418106, 0.047267936170101166, -0.18301339447498322, -0.024146882817149162, -0.07257423549890518, -0.12365338951349258, 0.14730066061019897, -0.00033019002876244485, -0.017907164990901947, -0.0005954671651124954, -0.2049470692873001, -0.051540691405534744, 0.018018046393990517, -0.0532987043261528, -0.03225494921207428, 0.00792964082211256, 0.052632372826337814, -0.00546628562733531, -0.13762740790843964, -0.033608365803956985, 0.06869426369667053, -0.0029205563478171825, 0.020696811378002167, -0.11732655018568039, -0.10902483761310577, 0.1440218836069107, 0.06239334121346474, -0.005246657878160477, 0.14361776411533356, -0.24061840772628784, 0.08385318517684937, 0.14814285933971405, 0.055289000272750854, 0.04364783316850662, 0.02970883622765541, 0.0155111039057374, -0.010086238384246826, 0.07856401056051254, -0.07154391705989838, 0.03734135627746582, 0.04881187900900841, -0.10112567245960236, 0.31428399682044983, 0.03243904560804367, -0.02971123531460762, 0.06522174924612045, -0.028308961540460587, -0.05656101554632187, 0.08317592740058899, 0.1086190938949585, 0.09064840525388718, -0.17480090260505676, -0.07841310650110245, -0.026720285415649414, 0.08943668007850647, -0.1406107395887375, 0.1286371350288391, -0.06419866532087326, 0.0011153696104884148, 0.04118863493204117, -0.05145465210080147, -0.06397590786218643, 0.12034468352794647, 0.010427254252135754, -0.15468493103981018, -0.07823917269706726, -0.0012905027251690626, -0.16100740432739258, 0.06830179691314697, 0.005752059165388346, -0.13105785846710205, 0.2062995880842209, 0.08799831569194794, 0.26381349563598633, -0.28114455938339233, 0.05045764520764351, 0.10662513226270676, -0.07892218977212906, 0.00070127536309883, 0.07400348782539368, -0.1840757429599762, -0.0009877659613266587, 0.07949108630418777, -0.09913229942321777, -0.018746912479400635, -0.09163923561573029, -0.034449223428964615, 0.1017225980758667, -0.051529351621866226, 0.1159258559346199, -0.026203591376543045, 0.07705938816070557, -0.0010299085406586528, 0.024878282099962234, 0.009368672035634518, -0.05159728601574898, 0.11172465234994888, 0.1749059408903122, 0.04946943745017052, -0.09975264966487885, -0.13714122772216797, -0.07606560736894608, 0.01858128234744072, -0.3182848393917084, -0.1240728348493576, 0.03881372883915901, 0.050253789871931076, -0.01639222912490368, -0.19514986872673035, 0.23711413145065308, -0.19703388214111328, 0.10172855854034424, -0.09403470158576965, 0.04412197694182396, 0.1326608806848526, 0.2881092131137848, -0.12240700423717499, 0.04851945862174034, 0.08529253304004669, -0.3213498592376709, -0.008789081126451492, -0.1769753396511078, -0.0004769294464495033, -0.05589142069220543, 0.11536925286054611, 0.011023296043276787, -0.11132895201444626, -0.04595375433564186, 0.021408777683973312, -0.0012742913095280528, 0.13880771398544312, -0.10230649262666702, -0.05298817530274391, 0.07252050936222076, -0.11490944772958755, -0.1880500316619873, -0.012202841229736805, 0.03132731094956398, -0.0012907844502478838, 0.01709984429180622, -0.028212876990437508, 0.1647697389125824, -0.0007294488605111837, -0.0189453586935997, -0.0034299183171242476, -0.044117625802755356, 0.11568533629179001, -0.027732182294130325, 0.05038613826036453, -0.03193407505750656, 0.23210637271404266, 0.02865227684378624, 0.05563215911388397, -0.024875560775399208, 0.05965956300497055, 0.1478632390499115, -0.14323537051677704, 0.07512080669403076, 0.20776034891605377, 0.1000722125172615, 0.09483838826417923, -0.2165214568376541, -0.08166748285293579, 0.0010611325269564986, -0.12998494505882263, 0.08145661652088165, -0.0010485317325219512, 0.09962927550077438, -0.21320486068725586, -0.02515174075961113, 0.013390769250690937, 0.15186917781829834, 0.2190963476896286, 0.054180122911930084, 0.03125271201133728, 0.05860468000173569, -0.05729655176401138, -0.08771876245737076, -0.07968515157699585, 0.035101111978292465, -0.19160054624080658, 0.05304297059774399, -0.0947880819439888, 0.03229394927620888, 0.009995750151574612, -0.06648828089237213, 0.09919515252113342, 0.0389474518597126, 0.19417865574359894, 0.009621991775929928, -0.07919345796108246, 0.033889397978782654, -0.08488073945045471, -0.0015746131539344788, -0.0035065189003944397, -0.08977304399013519, 0.020693069323897362, -0.16849707067012787, 0.07649919390678406, -0.06681905686855316, 0.0025269887410104275, 0.13425517082214355, -0.24773378670215607, 0.15905791521072388, 0.05664322152733803, -0.05570647493004799, 0.1339985877275467, 0.14460350573062897, 0.06418751925230026, -0.011769280768930912, -0.05942511186003685, 0.06168859824538231, -0.010210647247731686, 0.07571353763341904, 0.06175747513771057, -0.28461313247680664, -0.13061195611953735, 0.039083074778318405, -0.08611983805894852, 0.10098997503519058, 0.036196380853652954, 0.15069158375263214, -0.1442110687494278, 0.10635275393724442, 0.21995213627815247, 0.04793201759457588, 0.06468503922224045, 0.036093950271606445, 0.22510626912117004, 0.11048009991645813, -0.02435866929590702, 0.014457772485911846, -0.04509272426366806, -0.16481010615825653, -0.005791874136775732, 0.08845339715480804, 0.08990400284528732, -0.003526782151311636, -0.1718660593032837, -0.13739177584648132, 0.0398278534412384, 0.1144987940788269, -0.02010032720863819, -0.1315603256225586, 0.13006211817264557, 0.012396666221320629, 0.018898984417319298, 0.2658005952835083, -0.2355187088251114, -0.1800914853811264, 0.19396138191223145, -0.05133580043911934, -0.06994233280420303, -0.06148490309715271, 0.11795385181903839, -0.04586394876241684, 0.11735931783914566, -0.03228866681456566, 0.12233711034059525, -0.06691154092550278, 0.05702562630176544, -0.10452355444431305, -0.18637166917324066, 0.06489896774291992, 0.030910957604646683, -0.003076257649809122, 0.09144986420869827, -0.06645923852920532, 0.07221997529268265, -0.08096424490213394, -0.10637536644935608, 0.1437779814004898, 0.011406781151890755, 0.10399647057056427, 0.10652602463960648, 0.04333486407995224, -0.020396843552589417, -0.04118837043642998, -0.16589795053005219, 0.1667013168334961, -0.13302013278007507, 0.042811259627342224, -0.007541928440332413, 0.07992932945489883, 0.1677466481924057, 0.05336400493979454, -0.03849976137280464, 0.16678190231323242, 0.05448927730321884, 0.19823956489562988, -0.02224181778728962, -0.19994059205055237, 0.07345690578222275, -0.08671628683805466, 0.05415773764252663, 0.06593173742294312, -0.055748991668224335, -0.14630883932113647, 0.0369524285197258, -0.057991206645965576, -0.07966925203800201, 0.04821173474192619, 0.06477304548025131, -0.15524469316005707, 0.03897099569439888, 0.004203514661639929, -0.11218240112066269, -0.09733041375875473, -0.13198710978031158, -0.06635534018278122, -0.058779746294021606, 0.17433126270771027, -0.08853070437908173, -0.08350004255771637, -0.07705292105674744, -0.1494051069021225, -0.04731925576925278, -0.05935196951031685, -0.04764540493488312, 0.03640484809875488, 0.0358828604221344, 0.13083980977535248, -0.025175560265779495, -0.027921538800001144, -0.09614129364490509, 0.011787512339651585, -0.023967422544956207, -0.003928015474230051, 0.05076923221349716, 0.07320327311754227, 0.03299124911427498, -0.07040441781282425, 0.0060858228243887424, 0.0237538181245327, -0.07485941797494888, 0.04031552001833916, -0.06848233938217163, -0.14004656672477722, -0.13155707716941833, 0.061183661222457886, 0.20298950374126434, -0.1268465667963028, 0.022844837978482246, -0.05117121711373329, 0.14633525907993317, 0.1172441616654396, 0.09220252931118011, 0.03994949162006378, -0.12985453009605408, 0.10298609733581543, 0.10848790407180786, 0.02436939999461174, 0.087869793176651, 0.21284042298793793, -0.07575660198926926, 0.018215226009488106, -0.02144613303244114, -0.13345542550086975, 0.20712998509407043, -0.06968273967504501, -0.03353758528828621, -0.11853478848934174, -0.010802500881254673, -0.008001153357326984, 0.05509604886174202, 0.08985581248998642, 0.055076971650123596, -0.0070551298558712006, 0.06002088263630867, -0.019207937642931938, 0.1794029176235199, -0.029428530484437943, -0.08984602242708206, -0.17147763073444366, -0.09143272042274475, -0.10938430577516556, -0.06421151757240295, -0.06393655389547348, 0.01662546955049038, 0.012347431853413582, 0.1231452152132988, -0.04053119570016861, 0.05573837086558342, -0.044146277010440826, -0.31944918632507324, 0.03562931343913078, -0.2826332449913025, -0.020465651527047157, 0.2474684715270996, 0.05259949341416359, -0.0784190222620964, -0.23590242862701416, -0.10330086946487427, 0.06852308660745621, -0.03538284823298454, -0.06721960008144379, 0.1070019006729126, 0.10775760561227798, -0.1385449767112732, 0.02212510071694851, -0.04641113802790642, 0.0596611313521862, 0.1639663130044937, 0.25218474864959717, -0.026380153372883797, -0.04672611877322197, 0.008256967179477215, 0.20034025609493256, -0.11867713928222656, -0.007019769866019487, -0.29438507556915283, -0.012017717584967613, 0.08065178990364075, -0.04490639269351959, -0.051616668701171875, -0.134876549243927, -0.001303544151596725, -0.06477884948253632, -0.011203738860785961, 0.06752292811870575, 0.1505751758813858, -0.0023213790263980627, -0.050415344536304474, 0.017194731160998344, 0.07980293035507202, 0.0042313141748309135, -0.23016415536403656, -0.20311738550662994, -0.013180471956729889, 0.011262461543083191, -0.061612777411937714, 0.08137647807598114, 0.17036457359790802, 0.15102769434452057, -0.034886110574007034, -0.017828388139605522, 0.08923792093992233, -0.04676245152950287, -0.12711110711097717, -0.024899810552597046, -0.06570589542388916, -0.030933713540434837, 0.002925282111391425, -0.03792374208569527, 0.19208960235118866, 0.08105885982513428, -0.21091774106025696, 0.2831280529499054, 0.17577190697193146, 0.004901431035250425, 0.040070004761219025, 0.1572488695383072, 0.06602083891630173, -0.003062026109546423, 0.0596291646361351, 0.025106217712163925, 0.010196802206337452, 0.24291203916072845, 0.07298872619867325, -0.20581530034542084, 0.07899505645036697, -0.015478711575269699, 0.06137097254395485, -0.16961601376533508, -0.14319756627082825, 0.0712723433971405, 0.10877757519483566, 0.23360514640808105, -0.03165500611066818, -0.07308536022901535, -0.14940431714057922, -0.08962146937847137, 0.002442452358081937, 0.026433277875185013, -0.09891428798437119, -0.12090475857257843, -0.09586523473262787, -2.797215467297934e-32, 0.10618870705366135, -0.14410491287708282, -0.004835991188883781, 0.06077836453914642, -0.13021238148212433, 0.029967252165079117, 0.10445412993431091, -0.23890042304992676, -0.011680159717798233, -0.01129675842821598, -0.03663120046257973, -0.029612405225634575, 0.08326702564954758, 0.24494238197803497, -0.17193438112735748, 0.0038619653787463903, 0.022458214312791824, -0.021478945389389992, 0.049242883920669556, -0.023299504071474075, -0.08209532499313354, -0.13308018445968628, -0.092387355864048, -0.01978892832994461, -0.036525435745716095, 0.02473161555826664, -0.05592910200357437, 0.050952181220054626, 0.003599873511120677, 0.20124681293964386, -0.07720905542373657, 0.11078320443630219, -0.03599398210644722, 0.0805620327591896, 0.1144801452755928, -0.03877341002225876, -0.04402713105082512, 0.06901654601097107, -0.03564520180225372, 0.05358917638659477, -0.09811366349458694, -0.06471610069274902, 0.03257109969854355, -0.1845252513885498, 0.05308724567294121, -0.10570071637630463, 0.07923546433448792, 0.0001655362284509465, -0.048173464834690094, 0.042194608598947525, -0.04118430241942406, 0.0749795138835907, 0.054106805473566055, 0.04077582433819771, -0.02004118077456951, -0.01381246279925108, 0.02632978744804859, -0.025208860635757446, 0.032495271414518356, -0.02796567603945732, 0.09280233085155487, -0.07068149000406265, 0.028723547235131264, 0.10379637777805328, 0.2597551643848419, -0.04445364326238632, 0.006910338532179594, 0.02263300120830536, 0.03978258743882179, -0.0646090880036354, -0.16423609852790833, 0.1482892781496048, 0.05104050785303116, 0.19077159464359283, -0.1531403362751007, 0.07938119024038315, -0.08492214232683182, -0.06111367046833038, 0.062377434223890305, -0.03477368503808975, -0.14189819991588593, -0.12858523428440094, 0.1835438758134842, 0.07882556319236755, 0.09864669293165207, -0.13234125077724457, -0.11658299714326859, -0.05978205054998398, 0.1125919371843338, -0.0045656259171664715, -0.024542028084397316, 0.054509930312633514, -0.07367846369743347, -0.06324576586484909, -0.063538558781147, -0.16724616289138794, 0.02461211197078228, 0.15090370178222656, 0.11102911084890366, -0.10928428918123245, 0.0010092334123328328, 0.1012817770242691, 0.14787457883358002, 0.06880545616149902, 0.0536193810403347, -0.0443490594625473, 0.13415445387363434, 0.1991022378206253, -0.250583678483963, 0.08943115174770355, -0.027951762080192566, 0.16226017475128174, 0.022957250475883484, 0.046904269605875015, 0.08797860145568848, -0.08043423295021057, 0.019933423027396202, -0.013229640200734138, -0.027385443449020386, 0.02807598188519478, -0.20040559768676758, -0.19048385322093964, -0.2649472653865814, -0.021511441096663475, -0.08044219017028809, 0.05837106704711914, 0.027769220992922783, 0.0008279154426418245, -0.045939963310956955, -0.09506954252719879, -0.03830477222800255, -0.017157895490527153, 7.560517474303197e-7, -0.20303933322429657, 0.03732352703809738, -0.07226086407899857, 0.0867122933268547, 0.12724851071834564, -0.08354541659355164, -0.1769682615995407, 0.15999338030815125, -0.1051642969250679, 0.1533282846212387, 0.07703686505556107, -0.09645497053861618, 0.14346644282341003, -0.10112603008747101, 0.02707110531628132, -0.1811656802892685, -0.09492403268814087, 0.0007792816031724215, -0.08212625235319138, 0.017586087808012962, 0.07928317040205002, 0.150197371840477, 0.014309353195130825, 0.018152795732021332, 0.07994179427623749, -0.059433091431856155, 0.07257524877786636, -0.18728289008140564, 0.11783342063426971, -0.13378208875656128, 0.013570371083915234, 0.044989973306655884, 0.025898205116391182, 0.15628138184547424, 0.08215201646089554, -0.07402201741933823, -0.10148440301418304, 0.03442979231476784, -0.0854388177394867, -0.005537960212677717, 0.10544637590646744, 0.03321249410510063, -0.2170437127351761, -0.18172836303710938, 0.1951979547739029, -0.004748757462948561, -0.15659941732883453, -0.009599261917173862, -0.16929233074188232, -0.045960914343595505, 0.11989031732082367, -0.10172510892152786, 0.020901840180158615, 0.027822349220514297, 0.13984185457229614, -0.17146402597427368, -0.12620273232460022, -0.0397510752081871, 0.029768435284495354, -0.09930184483528137, -0.10457920283079147, -0.02007311023771763, 0.06887104362249374, 0.05106673017144203, 0.12195856124162674, 0.018287060782313347, -0.09955752640962601, 1.0917635667889794e-34, -0.05552981421351433, -0.04549391567707062, 0.14045698940753937, -0.05687056481838226, 0.08120450377464294, -0.08705497533082962, 0.012099876068532467, -0.08804968744516373, -0.008177214302122593, -0.15215006470680237, 0.05615600198507309 ]
https://github.com/huggingface/datasets/issues/6274
FileNotFoundError for dataset with multiple builder config
Please tell me if the above info is not enough for solving the problem. I will then make my dataset public temporarily so that you can really reproduce the bug.
### Describe the bug When there is only one config and only the dataset name is entered when using datasets.load_dataset(), it works fine. But if I create a second builder_config for my dataset and enter the config name when using datasets.load_dataset(), the following error will happen. FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow' The "XXX.incomplete folder" in the cache folder of my dataset will disappear before "generating test split", which does not happen when config name is not entered and the config name is "default" C:\Users\chenx\.cache\huggingface\datasets\my_dataset\0_shot_multiple_choice\1.0.0 The folder that is supposed to remain under the above directory will disappear, and the data generator will not have a place to generate data into. ### Steps to reproduce the bug test = load_dataset('my_dataset', '0_shot_multiple_choice') ### Expected behavior FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow' ### Environment info datasets 2.14.5 python 3.8.18
30
FileNotFoundError for dataset with multiple builder config ### Describe the bug When there is only one config and only the dataset name is entered when using datasets.load_dataset(), it works fine. But if I create a second builder_config for my dataset and enter the config name when using datasets.load_dataset(), the following error will happen. FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow' The "XXX.incomplete folder" in the cache folder of my dataset will disappear before "generating test split", which does not happen when config name is not entered and the config name is "default" C:\Users\chenx\.cache\huggingface\datasets\my_dataset\0_shot_multiple_choice\1.0.0 The folder that is supposed to remain under the above directory will disappear, and the data generator will not have a place to generate data into. ### Steps to reproduce the bug test = load_dataset('my_dataset', '0_shot_multiple_choice') ### Expected behavior FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow' ### Environment info datasets 2.14.5 python 3.8.18 Please tell me if the above info is not enough for solving the problem. I will then make my dataset public temporarily so that you can really reproduce the bug.
[ 0.049640778452157974, 0.11337407678365707, -0.1409832090139389, 0.014893134124577045, 0.15319706499576569, 0.11278347671031952, 0.23889175057411194, 0.062459323555231094, -0.0402422696352005, 0.043220143765211105, 0.004625521134585142, -0.11794952303171158, -0.129444882273674, -0.1230144128203392, 0.020382260903716087, 0.09280840307474136, -0.0704134926199913, 0.005598939955234528, -0.07957164198160172, 0.03281964361667633, -0.04586589336395264, 0.06254173070192337, 0.1413625031709671, -0.0016879738541319966, -0.14322952926158905, -0.05901490896940231, -0.09056118875741959, 0.2090781331062317, -0.031347572803497314, -0.19120267033576965, 0.1898794025182724, 0.0830773338675499, 0.0008233972475863993, 0.35335490107536316, 0.0000060001689234923106, 0.006300455424934626, 0.2865663170814514, 0.06002085655927658, -0.18690407276153564, -0.11942164599895477, 0.021537519991397858, 0.10522107779979706, 0.03439682722091675, 0.0049047512002289295, 0.07647008448839188, -0.1409532129764557, 0.02829204685986042, -0.032949745655059814, 0.02210739627480507, 0.11254121363162994, 0.10399159044027328, -0.06642751395702362, -0.0012638246407732368, -0.16977359354496002, 0.1669369488954544, 0.026980698108673096, 0.03650422766804695, 0.05829930678009987, -0.17779073119163513, -0.05682257562875748, 0.04282670095562935, 0.0014098226092755795, 0.04321432486176491, 0.10867597907781601, -0.061501238495111465, -0.06643983721733093, -0.17979134619235992, -0.07236004620790482, 0.023407870903611183, 0.2641007602214813, 0.0734967440366745, 0.06466888636350632, -0.1645106077194214, -0.08911512047052383, -0.05039056017994881, -0.08135106414556503, 0.07382705062627792, 0.09524918347597122, -0.1227816715836525, 0.001970900222659111, -0.0743989422917366, -0.08951989561319351, 0.02196325547993183, -0.027052603662014008, -0.22476646304130554, -0.011720621958374977, -0.17464019358158112, -0.02960728481411934, -0.0613374188542366, -0.0975160300731659, 0.16969846189022064, -0.019686389714479446, -0.13243351876735687, -0.2187058925628662, 0.06021767854690552, 0.07116200774908066, -0.03908800706267357, -0.07041794806718826, 0.00785577017813921, 0.04320257157087326, 0.005639895796775818, -0.21203669905662537, -0.04000166803598404, 0.0655955895781517, 0.07096673548221588, 0.09972551465034485, -0.042290717363357544, 0.013412159867584705, 0.005590816494077444, 0.02998538501560688, -0.06105121970176697, -0.031967077404260635, -0.14566002786159515, -0.1193573921918869, 0.026589136570692062, -0.045622024685144424, 0.07411044090986252, 0.09515378624200821, -0.07187052071094513, 0.02645844966173172, 0.06607136875391006, 0.08471588790416718, 0.02710721641778946, 0.17521488666534424, 0.15003947913646698, -0.036941785365343094, -0.000547676463611424, 0.14549699425697327, 0.11674562096595764, -0.01645946130156517, -0.033011481165885925, 0.047380365431308746, -0.022601595148444176, 0.006304607726633549, 0.1323302835226059, -0.0193063672631979, 0.11927144974470139, -0.282545804977417, 0.03788990154862404, -0.03878714516758919, 0.00806718971580267, -0.1438882201910019, -0.1854090541601181, -0.07223659008741379, 0.08045116811990738, 0.13275574147701263, 0.05361858755350113, 0.011885849758982658, -0.012840046547353268, 0.01643400639295578, -0.10896310210227966, 0.11814948171377182, -0.2550429105758667, 0.048555370420217514, 0.012003873474895954, 0.11707673221826553, -0.0675552487373352, 0.05398271605372429, -0.08851208537817001, -0.14913418889045715, 0.06409604847431183, 0.05814162269234657, -0.026385843753814697, -0.08536117523908615, 0.005507030989974737, 0.042111340910196304, 0.035128187388181686, -0.07380452752113342, -0.053275350481271744, 0.011894591152668, -0.06538670510053635, -0.11538925021886826, -0.17219288647174835, 0.10767616331577301, -0.32880374789237976, 0.16385790705680847, 0.09120673686265945, -0.11142627149820328, -0.06927898526191711, 0.0245001632720232, 0.018632709980010986, 0.03840909153223038, 0.06658881902694702, -0.11799168586730957, -0.003028811188414693, -0.03006078116595745, -0.13046255707740784, -0.0042544458992779255, 0.08920209109783173, -0.047656744718551636, -0.09455229341983795, 0.03101273439824581, -0.052251528948545456, -0.08190207183361053, 0.05061095952987671, -0.10080090165138245, 0.03558150306344032, -0.22624744474887848, 0.11927550286054611, -0.25456252694129944, 0.10093921422958374, 0.029559146612882614, -0.14642111957073212, 0.005579432472586632, -0.08423139154911041, -0.042316410690546036, -0.1886563003063202, 0.2637844979763031, -0.0030473428778350353, -0.26516813039779663, -0.16209901869297028, -0.0026321217883378267, 0.06280897557735443, -0.02282484993338585, -0.11963414400815964, -0.09484537690877914, 0.003503581276163459, 0.19071143865585327, -0.1036481112241745, 0.055438119918107986, -0.005464035086333752, 0.23139013350009918, 0.11760026216506958, 0.0028445557691156864, -0.05123220384120941, 0.05167008936405182, 0.04378601163625717, -0.09116758406162262, 0.12272778898477554, 0.026691732928156853, -0.23277637362480164, -0.019550181925296783, -0.01511447411030531, 0.05697815120220184, 0.05546669661998749, -0.09908803552389145, 0.06301423162221909, -0.3148505985736847, -0.038181405514478683, -0.008164706639945507, -0.14367936551570892, -0.055178605020046234, -0.09455756843090057, -0.03522341325879097, 0.014613309875130653, 0.08264540135860443, -0.15057207643985748, 0.014233945868909359, 0.024252165108919144, -0.03764097020030022, 0.1409163922071457, -0.06097210943698883, -0.13259188830852509, 0.15846380591392517, 0.06839879602193832, -0.01856861263513565, 0.10439690202474594, 0.0794534832239151, -0.04979022592306137, -0.05529067665338516, 0.25189146399497986, -0.02965664304792881, -0.1021139845252037, -0.0719664990901947, 0.030656931921839714, -0.059440094977617264, -0.011186500079929829, 0.1026945486664772, 0.12382669001817703, 0.13888464868068695, 0.04057254642248154, -0.08194456994533539, -0.17853547632694244, -0.0422545000910759, 0.09041809290647507, -0.07171689718961716, 0.12747135758399963, 0.14596323668956757, 0.08585028350353241, 0.023770282045006752, -0.18979275226593018, 0.0943751409649849, 0.19759754836559296, -0.08738451451063156, 0.12673914432525635, 0.07342423498630524, -0.0700751468539238, -0.009517405182123184, -0.09590232372283936, -0.062473513185977936, 0.02666960097849369, -0.09274208545684814, 0.0085922721773386, 0.008636243641376495, 0.00526523357257247, 0.047025542706251144, -0.006485980004072189, -0.08671831339597702, -0.033026278018951416, -0.1767059713602066, -0.04877743124961853, -0.05207665637135506, 0.01636648364365101, -0.06146623566746712, 0.05871037021279335, 0.03535919263958931, 0.10120555013418198, 0.1102549284696579, -0.09889836609363556, -0.19392544031143188, 0.0719822570681572, -0.06770336627960205, 0.13446013629436493, 0.23811884224414825, 0.014722488820552826, -0.07689899951219559, 0.008373919874429703, -0.17662815749645233, 0.08443243056535721, 0.05274911969900131, -0.05741275101900101, 0.07453855872154236, 0.05808881297707558, -0.0728049948811531, 0.004826634656637907, 0.031612083315849304, -0.1329163759946823, -0.1879115104675293, -0.05181830748915672, -0.08539309352636337, -0.0213591568171978, 0.08177623152732849, -0.00387487281113863, -0.17502404749393463, -0.001205156440846622, -0.00423273304477334, -0.06102864071726799, -0.012105676345527172, 0.2500327229499817, -0.13796702027320862, 0.02697218395769596, 0.043247297406196594, -0.07257775217294693, 0.07140050828456879, 0.030977798625826836, -0.055798426270484924, 0.06568112224340439, -0.03753648325800896, 0.07932651042938232, -0.139191135764122, 0.036375775933265686, 0.07138057053089142, 0.048427581787109375, -0.14379768073558807, -0.003433733247220516, 0.11170963197946548, -0.15990297496318817, -0.09992720931768417, 0.0675925686955452, -0.017251400277018547, 0.14826585352420807, -0.05209451913833618, 0.0647653266787529, 0.057618334889411926, -0.05841803923249245, 0.10225950181484222, 0.06805028766393661, 0.08300349861383438, -0.09206200391054153, -0.1054040715098381, 0.13818925619125366, 0.05020516365766525, 0.028361160308122635, -0.012550070881843567, 0.034671884030103683, 0.2042423039674759, -0.12372395396232605, -0.09884507209062576, 0.10217934846878052, -0.037340372800827026, -0.008324957452714443, -0.1602325588464737, -0.033231280744075775, 0.10806670039892197, 0.03044780343770981, -0.009767199866473675, -0.01220701914280653, 0.07763349264860153, 0.021801570430397987, 0.09677253663539886, 0.050511740148067474, 0.0788978636264801, 0.11221254616975784, -0.08712957054376602, 0.02692212350666523, -0.07869131118059158, 0.11489842087030411, 0.05713415890932083, 0.0501864068210125, -0.10434151440858841, 0.07466896623373032, 0.17192888259887695, 0.1411135196685791, 0.04224194958806038, 0.047312624752521515, 0.07209987193346024, -0.07440733164548874, -0.1409469097852707, 0.15648767352104187, 0.03355792164802551, 0.03584358096122742, -0.03241284564137459, 0.14823463559150696, -0.07535913586616516, 0.1399299055337906, 0.05469578504562378, 0.0657673254609108, -0.1362617164850235, -0.15119166672229767, -0.06171021610498428, -0.2808256447315216, -0.11396338045597076, 0.03068668767809868, 0.1695777326822281, -0.04274030402302742, -0.031054915860295296, -0.06640998274087906, -0.13520437479019165, 0.027069518342614174, -0.01643652841448784, 0.06774439662694931, -0.07324159890413284, 0.10477714985609055, 0.10953125357627869, 0.006856434512883425, 0.08695027232170105, 0.3009963631629944, -0.1531045287847519, -0.18758535385131836, 0.16220566630363464, -0.17251712083816528, 0.019174804911017418, 0.13148462772369385, -0.16314323246479034, -0.04303284361958504, -0.10545673966407776, -0.03892841935157776, 0.0786508172750473, 0.09740746021270752, 0.13334155082702637, -0.16357678174972534, -0.12017139792442322, -0.1051609069108963, -0.21546754240989685, -0.02894643321633339, 0.03281411528587341, 0.2065490484237671, -0.040049731731414795, -0.06869598478078842, -0.005863592494279146, -0.2015388458967209, -0.07214415818452835, -0.007886895909905434, 0.050674088299274445, 0.07559315860271454, 0.024584615603089333, 0.24242044985294342, 0.01869686134159565, 0.1059381514787674, 0.09392532706260681, -0.0005722623900510371, 0.1032102182507515, -0.0000698045696481131, 0.16483785212039948, 0.30651870369911194, 0.05322562903165817, 0.04652895778417587, -0.1796870231628418, 0.04485984519124031, -0.07644287496805191, 0.23071157932281494, -0.010225660167634487, 0.13189786672592163, -0.030070019885897636, -0.15339039266109467, 0.22949658334255219, 0.07940724492073059, -0.07184083759784698, -0.11566989868879318, -0.06275413930416107, 0.09284697473049164, -0.08773455768823624, 0.01711280830204487, -0.1904190480709076, 0.08440149575471878, 0.0728328749537468, -0.11676932126283646, 0.0729944109916687, 0.12400185316801071, 0.1392889767885208, -0.0008042437257245183, 0.035720936954021454, 0.0990055650472641, -0.008065198548138142, -0.02032429538667202, -0.2024221569299698, 0.060823630541563034, 0.14428411424160004, -0.02333509363234043, -0.07065548002719879, -0.006234032567590475, -0.07163633406162262, -0.010499132797122002, -0.0037720827385783195, 0.02326374687254429, 0.01743183843791485, -0.06689618527889252, 0.08470468968153, 0.021132992580533028, 0.10388660430908203, -0.04068516567349434, 0.004329397343099117, 0.004037759266793728, -0.04008902981877327, -0.1275322437286377, -0.05774558708071709, -0.11927749216556549, -0.01780131831765175, 0.008825624361634254, 0.011992029845714569, 0.0856163427233696, 0.28599631786346436, -0.026362493634223938, 0.028304997831583023, -0.06391766667366028, 0.03211617469787598, 0.06410399824380875, -0.023727301508188248, 0.1008630096912384, 0.07542063295841217, -0.167007714509964, -0.09672516584396362, 0.0017873803153634071, 0.10851936042308807, 0.04986118897795677, 0.1570122241973877, -0.13253872096538544, -0.054620981216430664, -0.08481867611408234, -0.16729064285755157, 0.09794694185256958, 0.02822626382112503, 0.08001485466957092, 0.03225839510560036, 0.0006444830214604735, -2.4661383650096e-32, -0.023531252518296242, -0.0024453706573694944, 0.04239249601960182, -0.07755016535520554, -0.06799089908599854, 0.12188991904258728, 0.008255896158516407, 0.0379183366894722, -0.06843317300081253, -0.23798564076423645, -0.1167001873254776, -0.11817440390586853, -0.05235022306442261, 0.02293698489665985, 0.04192851111292839, 0.04238135740160942, -0.14668522775173187, 0.06307002902030945, -0.0014715052675455809, 0.005835856311023235, 0.14782926440238953, 0.04244507849216461, 0.15046873688697815, 0.023238003253936768, -0.16285546123981476, -0.04045103117823601, -0.1511775255203247, -0.05897289887070656, 0.0463092103600502, -0.026505935937166214, 0.07163097709417343, 0.04602626711130142, -0.0015318061923608184, -0.001772055635228753, -0.035729289054870605, -0.06224965304136276, -0.09506113827228546, -0.19710727035999298, -0.14025036990642548, -0.04185033589601517, 0.061459723860025406, 0.10009170323610306, -0.013589762151241302, -0.2076069712638855, 0.18049277365207672, 0.017634881660342216, -0.05592114105820656, -0.0017409645952284336, 0.020169401541352272, -0.041663121432065964, -0.034238461405038834, 0.14164279401302338, 0.08943162113428116, 0.07597615569829941, 0.06445762515068054, 0.038761574774980545, 0.03551539406180382, 0.05348654463887215, -0.1677568107843399, 0.10178683698177338, 0.17052753269672394, -0.0664963573217392, 0.09405576437711716, 0.013379721902310848, 0.09450023621320724, 0.05757814645767212, 0.43155089020729065, 0.010022078640758991, 0.10008252412080765, -0.1664130985736847, 0.0887356773018837, 0.1110445186495781, -0.1432003676891327, 0.10462203621864319, -0.00301190628670156, -0.134298637509346, -0.20477885007858276, -0.015613486059010029, 0.09269782900810242, -0.13873882591724396, -0.05462249368429184, -0.10198622196912766, -0.014160651713609695, 0.054448921233415604, -0.1493961066007614, 0.05703166499733925, -0.08085176348686218, 0.054916974157094955, -0.12073300033807755, 0.07766138762235641, -0.025285735726356506, 0.1298273205757141, -0.0072730714455246925, -0.027965176850557327, -0.1030375137925148, 0.18205930292606354, 0.023761112242937088, 0.006043838337063789, -0.13376544415950775, 0.07541872560977936, -0.08068149536848068, -0.14298732578754425, 0.11645632982254028, 0.12269507348537445, 0.027381086722016335, -0.03698979318141937, 0.042061951011419296, -0.00645223306491971, -0.10834231972694397, -0.05215752497315407, 0.029630258679389954, -0.08699691295623779, 0.1096394956111908, 0.021724101155996323, 0.11426714062690735, 0.14179953932762146, -0.143450066447258, -0.11080926656723022, 0.20995253324508667, 0.056076694279909134, -0.17074550688266754, -0.01720334030687809, -0.21849936246871948, 0.05477406084537506, 0.04936777427792549, 0.037067268043756485, -0.09061591327190399, -0.09423814713954926, 0.1472095102071762, 0.08315904438495636, 0.028113629668951035, -0.15304389595985413, 7.689602625760017e-7, -0.08786877989768982, 0.13908860087394714, -0.03954349458217621, -0.04994336515665054, -0.142067551612854, -0.004884395748376846, -0.15942393243312836, -0.015307103283703327, -0.10509748756885529, 0.1491449773311615, 0.15565139055252075, -0.003534049028530717, -0.19863200187683105, -0.01945236138999462, 0.13581864535808563, 0.043996233493089676, 0.05179164558649063, 0.14601585268974304, -0.02634785883128643, 0.10992515832185745, 0.10882972180843353, 0.1663459837436676, 0.13448691368103027, -0.18089227378368378, -0.04599232226610184, 0.011741233989596367, -0.0499376580119133, -0.016361024230718613, 0.12298386543989182, 0.07583993673324585, -0.06647255271673203, -0.05229184776544571, 0.052786439657211304, 0.07293283939361572, 0.03851033374667168, -0.051571398973464966, -0.1065702736377716, -0.012476521544158459, 0.012030577287077904, -0.022503908723592758, 0.13893096148967743, 0.04304167628288269, -0.14590729773044586, 0.04065973311662674, 0.026076411828398705, -0.020340729504823685, -0.003931893035769463, -0.045344892889261246, -0.1044577956199646, 0.1208578497171402, 0.0863952487707138, 0.12983205914497375, 0.2162046730518341, 0.13482671976089478, -0.19036264717578888, -0.03255920112133026, 0.04905874654650688, 0.00833309255540371, 0.2169654816389084, -0.0029895079787820578, -0.10926354676485062, -0.03706050291657448, -0.10248687863349915, -0.08592399954795837, 0.14612290263175964, -0.14746885001659393, -0.05694865807890892, 1.4999537505232784e-34, 0.011675902642309666, 0.0021000143606215715, -0.012554357759654522, -0.15678799152374268, -0.06384442001581192, -0.010129998438060284, 0.12928760051727295, 0.050575271248817444, 0.0035700779408216476, -0.07539393752813339, 0.026135632768273354 ]
https://github.com/huggingface/datasets/issues/6273
Broken Link to PubMed Abstracts dataset .
@lhoestq @albertvillanova @lewtun I don't think we are allowed to host these data files on the Hub (due to DMCA), which means the only option is to use a different dataset in the course (and to re-record the video πŸ™‚), no?
### Describe the bug The link provided for the dataset is broken, data_files = [https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url) The ### Steps to reproduce the bug Steps to reproduce: 1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url) 2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link. ### Expected behavior The link should Redirect to the "PubMed Abstracts dataset" as expected . ### Environment info .
41
Broken Link to PubMed Abstracts dataset . ### Describe the bug The link provided for the dataset is broken, data_files = [https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url) The ### Steps to reproduce the bug Steps to reproduce: 1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url) 2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link. ### Expected behavior The link should Redirect to the "PubMed Abstracts dataset" as expected . ### Environment info . @lhoestq @albertvillanova @lewtun I don't think we are allowed to host these data files on the Hub (due to DMCA), which means the only option is to use a different dataset in the course (and to re-record the video πŸ™‚), no?
[ 0.18884272873401642, 0.17499004304409027, -0.021518025547266006, -0.023657958954572678, 0.14042437076568604, 0.12548667192459106, 0.07252739369869232, -0.03304063528776169, -0.008498876355588436, 0.1071895882487297, -0.018692346289753914, 0.0996725782752037, 0.034404318779706955, 0.11051946133375168, 0.14633683860301971, 0.0128150200471282, 0.009446194395422935, -0.009161352179944515, 0.06841442734003067, -0.022587398067116737, 0.008663296699523926, 0.12066228687763214, -0.014975378289818764, -0.055278994143009186, 0.09616465866565704, 0.1243392825126648, -0.158767968416214, -0.09985608607530594, 0.026755670085549355, -0.1940617561340332, 0.05694558098912239, 0.03489549085497856, -0.04505954682826996, 0.06551618129014969, 0.000005951440925855422, -0.10609368979930878, 0.017564257606863976, 0.10164189338684082, -0.003008044557645917, -0.036533817648887634, 0.05253148451447487, -0.003965361509472132, -0.12722116708755493, -0.08679447323083878, 0.019850552082061768, -0.1193908229470253, 0.012157700024545193, 0.12295219302177429, 0.0005120884161442518, 0.040090836584568024, 0.048654161393642426, 0.12479889392852783, 0.2057064324617386, -0.15671810507774353, -0.03947697579860687, 0.12072187662124634, 0.09799452126026154, 0.10779912024736404, -0.1010507196187973, 0.04695451259613037, -0.0016713301884010434, 0.0030203911010175943, 0.06682567298412323, 0.09147001057863235, -0.05279770866036415, 0.0026720399037003517, -0.11253316700458527, -0.12096113711595535, 0.003165490459650755, 0.20379289984703064, 0.12238757312297821, 0.015963057056069374, -0.02877083420753479, 0.09682779759168625, -0.0381106398999691, 0.004510583821684122, 0.03447504714131355, 0.12434850633144379, 0.06870570778846741, 0.07807449251413345, -0.04486178234219551, -0.05867782235145569, 0.06936022639274597, 0.13111405074596405, 0.10069381445646286, -0.10159403830766678, -0.19133970141410828, -0.12133873999118805, 0.005679681897163391, -0.07477620989084244, 0.13299870491027832, 0.05204368755221367, 0.060083840042352676, -0.0923047587275505, 0.17445026338100433, 0.01079359371215105, -0.06822679936885834, -0.09173974394798279, 0.18859797716140747, -0.09201391041278839, -0.06868545711040497, -0.06972743570804596, -0.05609125271439552, -0.17928484082221985, 0.11426158994436264, -0.14348949491977692, 0.016502439975738525, -0.0002319513587281108, 0.2667435109615326, 0.21371160447597504, 0.1913362294435501, -0.001635197433643043, 0.03238394856452942, -0.000738434144295752, 0.03960574045777321, 0.014475005678832531, -0.036668360233306885, -0.11819523572921753, 0.07456555962562561, 0.26337599754333496, 0.016632933169603348, 0.15614844858646393, -0.2761562466621399, 0.1313067525625229, -0.06748021394014359, 0.10445832461118698, 0.09209414571523666, -0.0009340678225271404, -0.0012131299590691924, -0.0513317734003067, 0.002669466193765402, -0.06691162288188934, -0.2363172173500061, 0.09139195084571838, 0.1968633532524109, 0.014505411498248577, -0.0004261527501512319, -0.09010204672813416, 0.1168028712272644, -0.11841435730457306, -0.06501356512308121, -0.0452854186296463, -0.08260486274957657, 0.005887210369110107, 0.23272864520549774, 0.03066125698387623, 0.05225472152233124, 0.026383496820926666, 0.06151663139462471, 0.02919626794755459, -0.3705540597438812, 0.17224633693695068, -0.1701056808233261, -0.1833641529083252, -0.08914967626333237, 0.010067353956401348, -0.010603585280478, -0.10453908890485764, -0.15447884798049927, -0.10145772993564606, -0.03475188836455345, 0.08388067036867142, 0.1068963035941124, -0.17055797576904297, 0.21389923989772797, -0.06157049536705017, 0.17491090297698975, 0.03527101129293442, -0.10713964700698853, 0.1334504932165146, 0.05422860383987427, 0.136411651968956, -0.11666841804981232, -0.0962241068482399, -0.1985846310853958, 0.13225725293159485, -0.01823798380792141, 0.03153768181800842, -0.1946304440498352, -0.09705300629138947, 0.05190787464380264, -0.1495964080095291, -0.24920102953910828, -0.12510442733764648, 0.04136255756020546, -0.012093611061573029, -0.08252158015966415, 0.058129142969846725, 0.10944647341966629, -0.011736185289919376, -0.06662612408399582, 0.04563266411423683, -0.12484820932149887, -0.07005475461483002, 0.1104535460472107, -0.10422145575284958, -0.0014277289155870676, 0.07233783602714539, 0.1049642413854599, 0.09704603254795074, 0.022850308567285538, 0.0029316816944628954, -0.0147977564483881, 0.02826821431517601, 0.11323443055152893, 0.051572270691394806, -0.12608851492404938, -0.06494107842445374, 0.0011615020921453834, 0.004925081040710211, -0.1916937232017517, -0.05050903186202049, -0.08875709027051926, 0.025717608630657196, -0.048550575971603394, -0.009198436513543129, 0.0017595170065760612, -0.08815687149763107, -0.1480286419391632, 0.22590333223342896, -0.054642483592033386, -0.05701941251754761, 0.03867650032043457, -0.02877579815685749, -0.12134254723787308, 0.08453013747930527, -0.1898113191127777, -0.040431514382362366, 0.10118623077869415, -0.03625360503792763, -0.07399303466081619, 0.024379238486289978, 0.2356692999601364, 0.15869636833667755, -0.0529329888522625, 0.19731396436691284, 0.011913775466382504, -0.17031127214431763, 0.22213782370090485, -0.2128610908985138, -0.0577876977622509, 0.14724819362163544, -0.07232435792684555, 0.08132048696279526, 0.21036432683467865, -0.04772672429680824, -0.15224914252758026, 0.0424429252743721, -0.0033116526901721954, 0.1755521595478058, 0.1589696705341339, 0.04058481752872467, -0.16495993733406067, -0.04183914139866829, 0.035954032093286514, 0.16490067541599274, -0.14644618332386017, -0.09760846197605133, -0.13187123835086823, 0.012194115668535233, 0.23108936846256256, -0.059862229973077774, 0.08096365630626678, -0.03220612183213234, -0.04143816977739334, -0.016350753605365753, -0.06714768707752228, 0.07340613007545471, -0.07303445786237717, 0.09478374570608139, 0.04558361694216728, 0.05633910745382309, -0.15171512961387634, -0.12128717452287674, -0.04351949691772461, 0.004925368819385767, -0.1701299399137497, 0.07329397648572922, 0.010792764835059643, -0.06766903400421143, -0.10676770657300949, 0.1398594230413437, -0.0964529886841774, -0.014787774533033371, 0.03955628350377083, 0.009740181267261505, -0.18063153326511383, -0.033010564744472504, -0.16746442019939423, 0.057329799979925156, 0.02584325708448887, -0.008055447600781918, -0.1318264901638031, 0.015252668410539627, -0.13420386612415314, -0.06914586573839188, -0.11779611557722092, 0.08305814117193222, -0.16646608710289001, 0.14718428254127502, 0.03093460202217102, 0.04946928098797798, -0.026340555399656296, -0.0459807850420475, -0.017908988520503044, 0.07701487839221954, 0.050672855228185654, 0.06667689234018326, -0.08432876318693161, -0.22180256247520447, -0.017754031345248222, 0.03279292955994606, 0.2206147164106369, 0.04405802860856056, -0.037184204906225204, -0.09982148557901382, -0.011838720180094242, -0.09421734511852264, 0.05853217840194702, -0.0014378103660419583, 0.1775999814271927, 0.07166732847690582, -0.1769929975271225, -0.004877668805420399, 0.024632900953292847, -0.0829324945807457, -0.1686127930879593, 0.05604802817106247, -0.09729475528001785, 0.005062464624643326, -0.012764967046678066, 0.039600223302841187, 0.043592166155576706, -0.18400417268276215, 0.04126562923192978, -0.17739541828632355, -0.01638633757829666, -0.1177048310637474, 0.2229348123073578, 0.018340636044740677, -0.1286555379629135, -0.022887608036398888, 0.029439283534884453, 0.009289462119340897, 0.017627259716391563, -0.10459838807582855, 0.017593445256352425, 0.02595861256122589, -0.0914362221956253, -0.1141442060470581, 0.08784227818250656, -0.054247401654720306, 0.03671034798026085, -0.14882856607437134, 0.09207155555486679, -0.012919189408421516, 0.004296475555747747, 0.06440987437963486, 0.06658400595188141, 0.10660829395055771, 0.03817707672715187, 0.21029077470302582, 0.11193245649337769, 0.0028657945804297924, -0.11695070564746857, 0.1044289693236351, 0.036162324249744415, 0.12235137820243835, 0.0441177599132061, -0.046327777206897736, -0.046185724437236786, -0.019874757155776024, 0.0595533549785614, 0.07157377153635025, 0.056404516100883484, -0.020501792430877686, -0.05530450493097305, -0.02660345658659935, -0.03148052096366882, -0.20483727753162384, -0.012044791132211685, -0.12095363438129425, 0.00136618094984442, 0.1090063750743866, 0.016687264665961266, 0.00023365496599581093, -0.04241582006216049, 0.08008190244436264, -0.08040262758731842, 0.07470443844795227, 0.02873286046087742, -0.059005290269851685, -0.17826084792613983, -0.06352643668651581, 0.053298477083444595, -0.12026055157184601, 0.2677442729473114, 0.059986330568790436, 0.07294738292694092, 0.08184514194726944, 0.05389555171132088, 0.12716907262802124, -0.13207188248634338, 0.14176806807518005, 0.032028380781412125, 0.30907583236694336, -0.011491985060274601, -0.023953933268785477, 0.042931828647851944, 0.0018292638706043363, 0.1390283703804016, -0.06260374933481216, -0.031179605051875114, 0.03896397724747658, 0.22000887989997864, -0.20846246182918549, 0.10740215331315994, 0.03451281040906906, 0.017124654725193977, -0.20373523235321045, -0.07615209370851517, -0.2091532051563263, 0.22657881677150726, -0.07161315530538559, 0.05866658687591553, -0.135255828499794, 0.06346847862005234, -0.1433785855770111, 0.0833808183670044, -0.24269461631774902, 0.13453559577465057, 0.04661354050040245, 0.011170141398906708, 0.0786336362361908, 0.10571043193340302, -0.03956121951341629, 0.1422824263572693, -0.09538572281599045, -0.1273648589849472, 0.06174945831298828, -0.1498204916715622, -0.03268571197986603, 0.10802905261516571, -0.19135892391204834, -0.18400703370571136, 0.06094064936041832, -0.020519765093922615, -0.07975415140390396, 0.07219196856021881, -0.018064072355628014, -0.04178387671709061, -0.2043389081954956, 0.05291954427957535, -0.007784863002598286, 0.057218488305807114, 0.014430752955377102, 0.2345595508813858, -0.0583525151014328, 0.0014521008124575019, -0.03251469135284424, -0.10703598707914352, -0.0590674951672554, -0.011080600321292877, -0.0810576006770134, 0.08478423953056335, 0.022029176354408264, 0.23455876111984253, -0.22829017043113708, 0.09756062924861908, 0.0521826446056366, -0.030904360115528107, -0.02351621352136135, -0.09471680223941803, 0.010595613159239292, 0.03779244422912598, 0.08116095513105392, 0.0399923101067543, 0.006836414337158203, 0.02899005264043808, -0.03659699484705925, 0.11109240353107452, 0.17182014882564545, -0.05900280177593231, -0.022042477503418922, -0.06900282204151154, 0.002382892882451415, 0.03311373293399811, -0.039846234023571014, -0.08817679435014725, -0.07490094751119614, 0.14878860116004944, 0.048122331500053406, 0.15176555514335632, 0.1833566427230835, 0.05949530377984047, -0.08266551792621613, -0.10129088163375854, -0.055888738483190536, 0.0977667048573494, -0.06163249909877777, 0.20344758033752441, -0.0391959547996521, 0.16235889494419098, -0.17256885766983032, -0.1540871113538742, -0.03266596049070358, 0.07940210402011871, -0.13183638453483582, 0.08041179180145264, -0.19428402185440063, -0.0014230124652385712, 0.12373831868171692, -0.09125572443008423, -0.07264504581689835, 0.026482565328478813, 0.004843762144446373, 0.01165161095559597, 0.0007522382074967027, 0.027993502095341682, 0.059844739735126495, -0.054036516696214676, -0.04568551853299141, 0.037588853389024734, 0.07846792042255402, 0.015757853165268898, 0.15316487848758698, 0.0032419669441878796, 0.03223533555865288, 0.22572079300880432, -0.012264770455658436, 0.03957086428999901, 0.16759365797042847, 0.18532662093639374, -0.16847480833530426, 0.035589415580034256, 0.08962953090667725, -0.00008901199180399999, -0.09591809660196304, 0.012527135200798512, -0.019909974187612534, 0.021410301327705383, -0.1962626427412033, -0.10659525543451309, 0.03362644091248512, 0.14137598872184753, 0.03038221225142479, -0.0921168401837349, 0.13035093247890472, -0.0007204925059340894, -0.12276586890220642, 0.1625727415084839, 0.15777228772640228, 0.012664934620261192, -0.07336907088756561, -0.20165689289569855, -2.3751336494840525e-32, 0.027513902634382248, 0.1301773190498352, -0.08463602513074875, -0.06905803084373474, -0.19588908553123474, 0.12126754969358444, 0.029338130727410316, -0.05303001403808594, -0.166512131690979, -0.02544776163995266, 0.07584767043590546, 0.07180984318256378, -0.03542393445968628, 0.07848595827817917, -0.000009542359293845948, -0.14531388878822327, -0.21325793862342834, -0.21331287920475006, -0.0644022598862648, -0.07356926798820496, 0.024743489921092987, -0.018548838794231415, 0.0322696678340435, -0.1225830614566803, -0.03752557188272476, 0.11990412324666977, -0.12854446470737457, 0.08387119323015213, 0.06515943259000778, 0.07842526584863663, -0.06639008224010468, 0.04239343851804733, -0.04819966107606888, -0.040809135884046555, -0.1520712524652481, -0.06466139853000641, -0.20054231584072113, 0.028886809945106506, -0.07118146866559982, 0.05484773963689804, -0.10399539768695831, 0.11806287616491318, 0.023229006677865982, -0.14845356345176697, 0.06765469908714294, -0.03870841860771179, -0.041925642639398575, 0.05814867466688156, -0.061310600489377975, -0.1300940215587616, 0.007931738160550594, 0.13434654474258423, -0.15168479084968567, 0.06665649265050888, 0.03716237097978592, -0.12569384276866913, 0.006427078042179346, 0.2003600299358368, 0.014173010364174843, -0.08126542717218399, 0.16503575444221497, -0.054429031908512115, 0.10951340943574905, -0.0143744433298707, 0.010486016049981117, 0.1607750803232193, 0.20092816650867462, 0.050092969089746475, -0.04269903525710106, -0.0021609258837997913, 0.01306682825088501, 0.0030739803332835436, 0.07917706668376923, -0.09616303443908691, -0.08326347917318344, 0.11974451690912247, -0.10734584927558899, 0.003016964066773653, -0.03117598593235016, 0.12930914759635925, 0.03779491409659386, 0.12009234726428986, 0.11387445032596588, 0.005765869747847319, -0.09352105855941772, -0.025650739669799805, -0.08767291158437729, 0.01249655894935131, -0.07579634338617325, -0.007193080615252256, 0.014179740101099014, 0.04569855332374573, -0.1857389360666275, -0.04182989150285721, -0.1925874501466751, 0.15043406188488007, -0.0511772520840168, 0.06645116955041885, 0.04970313236117363, -0.11001084744930267, -0.28247392177581787, 0.09710311889648438, 0.11223635077476501, 0.08915826678276062, 0.048279114067554474, -0.10585028678178787, 0.14557108283042908, 0.09447850286960602, -0.0822543352842331, -0.04526471346616745, -0.0509168840944767, 0.04885733127593994, 0.20159289240837097, -0.039871010929346085, 0.056487131863832474, 0.01794748194515705, -0.06455321609973907, -0.009847666136920452, 0.07344323396682739, 0.22130373120307922, -0.03136806562542915, 0.1406712830066681, -0.2782388925552368, -0.058070361614227295, 0.10440327227115631, 0.10404953360557556, -0.1127619668841362, -0.03808732330799103, 0.10525139421224594, -0.15720340609550476, 0.06089862436056137, -0.15409457683563232, 7.808267810105463e-7, -0.05493340641260147, 0.11263952404260635, 0.029712431132793427, -0.009420071728527546, 0.08028024435043335, -0.07754553109407425, -0.16435496509075165, 0.1759546548128128, 0.03606240451335907, 0.05329537391662598, -0.038358427584171295, 0.03967815637588501, 0.0991394892334938, -0.02870085835456848, 0.027675388380885124, -0.03884134069085121, -0.17025581002235413, 0.02161795273423195, -0.036815568804740906, -0.029075155034661293, -0.11524149775505066, 0.11748860776424408, -0.004530876409262419, 0.10136439651250839, 0.05472055450081825, -0.10605227947235107, -0.07681816071271896, -0.050594937056303024, 0.05083168298006058, -0.18722586333751678, -0.10025231540203094, 0.039253175258636475, 0.051346227526664734, -0.07564543187618256, 0.06524967402219772, -0.16494934260845184, -0.25673454999923706, -0.06851664185523987, 0.03650510683655739, 0.15876956284046173, 0.00500172283500433, -0.15859846770763397, 0.06535538285970688, 0.08115499466657639, 0.03538230061531067, -0.0356188528239727, -0.11616659164428711, 0.17081999778747559, -0.10199705511331558, 0.04405736178159714, 0.1357012242078781, 0.053456518799066544, -0.044237565249204636, 0.0789477676153183, -0.16438832879066467, -0.029759684577584267, 0.04076036065816879, -0.05873667821288109, 0.11043518036603928, -0.0755629688501358, 0.09804537892341614, -0.10440051555633545, 0.12302517890930176, -0.11511891335248947, -0.006291715428233147, -0.14517426490783691, -0.07925818860530853, 1.0996345575759404e-34, 0.07618363946676254, 0.013587524183094501, -0.014968202449381351, -0.13679872453212738, 0.08486846834421158, -0.13474217057228088, 0.15356780588626862, 0.04399770125746727, -0.06416219472885132, -0.13136760890483856, 0.03925706818699837 ]
https://github.com/huggingface/datasets/issues/6273
Broken Link to PubMed Abstracts dataset .
Keeping the video is maybe fine, we can add a note on youtube to suggest to load a dataset with a different name. Maybe C4 ? And update the code snippets on the website ?
### Describe the bug The link provided for the dataset is broken, data_files = [https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url) The ### Steps to reproduce the bug Steps to reproduce: 1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url) 2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link. ### Expected behavior The link should Redirect to the "PubMed Abstracts dataset" as expected . ### Environment info .
35
Broken Link to PubMed Abstracts dataset . ### Describe the bug The link provided for the dataset is broken, data_files = [https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url) The ### Steps to reproduce the bug Steps to reproduce: 1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url) 2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link. ### Expected behavior The link should Redirect to the "PubMed Abstracts dataset" as expected . ### Environment info . Keeping the video is maybe fine, we can add a note on youtube to suggest to load a dataset with a different name. Maybe C4 ? And update the code snippets on the website ?
[ 0.19639399647712708, 0.1881607621908188, -0.02008688822388649, -0.026863332837820053, 0.15986020863056183, 0.12936240434646606, 0.08565706014633179, -0.004778227303177118, -0.05633631721138954, 0.1039680764079094, 0.02030857466161251, 0.0756056159734726, 0.04936177656054497, 0.11519506573677063, 0.1615239530801773, -0.013030031695961952, -0.014240715652704239, -0.005963209085166454, 0.06792765855789185, 0.0018319254741072655, 0.011389683932065964, 0.08986449986696243, -0.025740189477801323, -0.040234293788671494, 0.1493251770734787, 0.12541568279266357, -0.1498064398765564, -0.11960788071155548, 0.06470820307731628, -0.21739231050014496, 0.055392708629369736, 0.03230435773730278, -0.0708942860364914, 0.11545670032501221, 0.000006126471362222219, -0.12999631464481354, 0.04902096092700958, 0.09971467405557632, -0.04715998098254204, -0.027983728796243668, 0.051118362694978714, -0.03923622891306877, -0.1177542433142662, -0.06732720136642456, 0.025071127340197563, -0.1730341613292694, 0.034807320684194565, 0.10438107699155807, -0.033271051943302155, 0.05095910653471947, 0.06818493455648422, 0.09757143259048462, 0.18519480526447296, -0.16183651983737946, 0.005591478198766708, 0.0735432580113411, 0.11609720438718796, 0.0627840906381607, -0.0951080322265625, 0.03725823387503624, -0.006258032750338316, -0.0058572725392878056, 0.06597963720560074, 0.07688171416521072, -0.08347005397081375, -0.030464179813861847, -0.1230931356549263, -0.1168055310845375, 0.012089095078408718, 0.19520312547683716, 0.16789783537387848, 0.01320383045822382, -0.023924587294459343, 0.12517008185386658, -0.0664241760969162, -0.016536705195903778, 0.049120377749204636, 0.14699193835258484, 0.040518440306186676, 0.036277756094932556, -0.06912263482809067, -0.013895250856876373, 0.08411330729722977, 0.15103814005851746, 0.0880594253540039, -0.10260365903377533, -0.2249099761247635, -0.10021965950727463, 0.04742453992366791, -0.07973421365022659, 0.11746666580438614, 0.0888863205909729, 0.03722201660275459, -0.07714106142520905, 0.15682657063007355, 0.025005804374814034, -0.07881941646337509, -0.07005660235881805, 0.144052192568779, -0.09944585710763931, -0.042096782475709915, -0.10116724669933319, -0.04295772314071655, -0.1965171992778778, 0.14104972779750824, -0.14370903372764587, 0.029272088780999184, -0.05446629971265793, 0.23345986008644104, 0.20356416702270508, 0.1688644140958786, 0.033917203545570374, 0.01278376393020153, -0.06303470581769943, 0.07209863513708115, 0.0015467730117961764, -0.05104061961174011, -0.07752853631973267, 0.05891692265868187, 0.24174509942531586, 0.013434777967631817, 0.11172275990247726, -0.24768254160881042, 0.12838232517242432, -0.05364708974957466, 0.10299473255872726, 0.12648123502731323, 0.0014536718372255564, 0.012104514054954052, -0.09292543679475784, -0.01005470473319292, -0.03913910314440727, -0.2188461273908615, 0.10127384215593338, 0.17209267616271973, -0.006152127403765917, 0.01118411123752594, -0.1049952432513237, 0.08149153739213943, -0.09206459671258926, -0.08411050587892532, -0.0600791871547699, -0.08157835155725479, -0.013762559741735458, 0.2297915816307068, 0.02343088760972023, 0.0717412605881691, 0.02574513666331768, 0.063009113073349, 0.008606676943600178, -0.333072304725647, 0.23967117071151733, -0.21717047691345215, -0.15956741571426392, -0.05590127035975456, 0.023498717695474625, 0.008925097994506359, -0.10395590215921402, -0.1484050452709198, -0.1247313842177391, -0.018571535125374794, 0.07534085214138031, 0.1399560421705246, -0.1765497475862503, 0.19820579886436462, -0.031160425394773483, 0.1350916624069214, 0.021269459277391434, -0.12541772425174713, 0.11541058868169785, 0.06759718805551529, 0.08066936582326889, -0.1177840381860733, -0.05853744596242905, -0.19234202802181244, 0.07934905588626862, -0.05422581732273102, 0.07849454879760742, -0.1975836604833603, -0.06865593045949936, 0.06788434088230133, -0.16130979359149933, -0.23153291642665863, -0.11582961678504944, 0.017120296135544777, -0.005846710875630379, -0.09494656324386597, 0.032329875975847244, 0.09010059386491776, -0.017860937863588333, -0.06080777570605278, 0.044437818229198456, -0.08727339655160904, -0.07156854122877121, 0.1365112066268921, -0.10186462849378586, 0.009062099270522594, 0.020585399121046066, 0.1162920668721199, 0.06391668319702148, -0.01897890493273735, 0.027354847639799118, -0.009928748942911625, 0.0026309953536838293, 0.07530083507299423, 0.07353638112545013, -0.16901685297489166, -0.04459771886467934, 0.04525420814752579, 0.00542271975427866, -0.13935571908950806, -0.0596868172287941, -0.08954252302646637, 0.042468421161174774, -0.046852074563503265, 0.0056418911553919315, -0.017523281276226044, -0.0584644079208374, -0.14606870710849762, 0.20822714269161224, -0.06545313447713852, -0.06194716691970825, 0.058949727565050125, -0.05188973993062973, -0.08735993504524231, 0.0987267941236496, -0.1694018840789795, -0.029182497411966324, 0.09380751848220825, -0.03376100957393646, -0.07212647795677185, 0.024325409904122353, 0.2388613224029541, 0.14920508861541748, -0.01889152079820633, 0.164712592959404, 0.03658610209822655, -0.1857791244983673, 0.20382530987262726, -0.20194083452224731, -0.08383821696043015, 0.16513147950172424, -0.1144208088517189, 0.036458197981119156, 0.24120737612247467, -0.05191075801849365, -0.12272818386554718, 0.042551543563604355, 0.022390779107809067, 0.18467164039611816, 0.15500879287719727, 0.014430379495024681, -0.1567990481853485, -0.0304486695677042, 0.030447611585259438, 0.07961089164018631, -0.08384683728218079, -0.12955163419246674, -0.15136560797691345, -0.007032537832856178, 0.2312782257795334, -0.06306524574756622, 0.05147630348801613, -0.02596176229417324, -0.048344891518354416, -0.003510236507281661, -0.05410454422235489, 0.05001291260123253, -0.057679031044244766, 0.13568520545959473, 0.024323957040905952, 0.021546024829149246, -0.12535956501960754, -0.11400693655014038, -0.025438660755753517, 0.04714568331837654, -0.146058589220047, 0.05939287692308426, 0.014407062903046608, -0.0739801898598671, -0.09406287223100662, 0.17385676503181458, -0.0841510072350502, -0.028412990272045135, 0.06387177854776382, 0.0024121408350765705, -0.2023167610168457, -0.05063151568174362, -0.22904829680919647, 0.07384385913610458, 0.008583828806877136, 0.005507847759872675, -0.14854107797145844, -0.017747316509485245, -0.1498851627111435, -0.04292822256684303, -0.13012096285820007, 0.06485352665185928, -0.16271185874938965, 0.10476145148277283, 0.016450000926852226, 0.07111860066652298, 0.030725667253136635, -0.04572464898228645, -0.015627453103661537, 0.007861845195293427, 0.06646368652582169, 0.07534339278936386, -0.13605362176895142, -0.21862363815307617, -0.04591535031795502, 0.038019001483917236, 0.19361156225204468, 0.05207924172282219, -0.03144792839884758, -0.06715127825737, -0.008142814040184021, -0.10761073976755142, 0.0313827246427536, 0.022359676659107208, 0.14046074450016022, 0.07819118350744247, -0.1806623935699463, 0.006180356256663799, 0.02167377807199955, -0.07701341062784195, -0.18451039493083954, 0.08052980154752731, -0.07207929342985153, 0.0352332703769207, -0.017553972080349922, 0.08848483860492706, 0.04987677186727524, -0.18194285035133362, 0.05964863672852516, -0.1739501953125, -0.020960703492164612, -0.08814900368452072, 0.20305192470550537, 0.02310881018638611, -0.11145931482315063, -0.030111044645309448, 0.04481080174446106, 0.02844356559216976, 0.040825437754392624, -0.11668441444635391, 0.055288203060626984, 0.005465890746563673, -0.09746987372636795, -0.09643203020095825, 0.09818841516971588, -0.009963157586753368, 0.019831068813800812, -0.15118427574634552, 0.0772651880979538, -0.03832989186048508, 0.034744564443826675, 0.042664363980293274, 0.08270667493343353, 0.09359835833311081, 0.08519721031188965, 0.16582940518856049, 0.13359160721302032, -0.012927505187690258, -0.1690213829278946, 0.09205789119005203, 0.018265794962644577, 0.1095924973487854, 0.0357486791908741, -0.0370369516313076, -0.0749971941113472, -0.03319356590509415, 0.0459790900349617, 0.09421773254871368, 0.042764659970998764, -0.06587149202823639, -0.06230977550148964, -0.02824036218225956, -0.04587128013372421, -0.16418898105621338, 0.002041271422058344, -0.09706640243530273, 0.027974022552371025, 0.1065756231546402, 0.020859329029917717, 0.057537030428647995, -0.0418156199157238, 0.0678035169839859, -0.09309542924165726, 0.09537682682275772, 0.017215924337506294, -0.0685926303267479, -0.1383381187915802, -0.05253327637910843, 0.05789642035961151, -0.1459938883781433, 0.2631956934928894, 0.08717221021652222, 0.00047484529204666615, 0.06892121583223343, 0.07883109897375107, 0.09265335649251938, -0.13700079917907715, 0.15489168465137482, 0.04231128469109535, 0.2803807854652405, 0.051345791667699814, -0.034348394721746445, 0.037601735442876816, -0.018547946587204933, 0.20855754613876343, -0.08893238753080368, -0.021653151139616966, 0.032097842544317245, 0.25501787662506104, -0.15559759736061096, 0.12090807408094406, 0.03237336501479149, -0.006976864766329527, -0.19060689210891724, -0.03966452181339264, -0.17061284184455872, 0.16556602716445923, -0.07369137555360794, 0.054416704922914505, -0.11126753687858582, 0.06306256353855133, -0.17313601076602936, 0.07753204554319382, -0.2267899066209793, 0.12883728742599487, 0.03777502849698067, 0.04324467107653618, 0.07418502867221832, 0.08970988541841507, -0.030676057562232018, 0.1372055560350418, -0.1136058121919632, -0.1292240172624588, 0.06939242035150528, -0.1539175808429718, -0.006577642634510994, 0.08815465867519379, -0.20658889412879944, -0.18977530300617218, 0.06179273501038551, 0.005075536668300629, -0.08461587131023407, 0.08382401615381241, 0.006569643504917622, -0.048335544764995575, -0.22071152925491333, 0.01082679070532322, 0.021127447485923767, 0.031080832704901695, 0.00646972144022584, 0.2367476522922516, -0.033063940703868866, 0.012252233922481537, -0.051214560866355896, -0.10494684427976608, -0.048207107931375504, 0.0006051260861568153, -0.09269116818904877, 0.11795836687088013, -0.005779472645372152, 0.16807590425014496, -0.1896752566099167, 0.10338608175516129, 0.020427139475941658, 0.022069502621889114, -0.013208410702645779, -0.07028651237487793, 0.03776027634739876, 0.0633867159485817, 0.02337682619690895, 0.055287186056375504, -0.01756659895181656, 0.005027433391660452, -0.0543895922601223, 0.07775980979204178, 0.21778304874897003, -0.06035579741001129, -0.03948487341403961, -0.04997676983475685, -0.008365933783352375, 0.03592027723789215, -0.03893326595425606, -0.08371346443891525, -0.04869462549686432, 0.1585180014371872, 0.08516719192266464, 0.18315474689006805, 0.13936953246593475, 0.06894000619649887, -0.0688730925321579, -0.1444285362958908, -0.02824229560792446, 0.04565032944083214, -0.0592457614839077, 0.2036551982164383, -0.017423376441001892, 0.18265128135681152, -0.142292782664299, -0.13135382533073425, -0.04782799631357193, 0.08322378247976303, -0.07989532500505447, 0.09427833557128906, -0.16962113976478577, 0.01023599412292242, 0.134932279586792, -0.07999435067176819, -0.08244352787733078, 0.06800326704978943, -0.03732958063483238, 0.04103242605924606, -0.0061816200613975525, 0.07488548755645752, 0.08094339817762375, -0.05800505727529526, -0.042454201728105545, 0.021962318569421768, 0.07579674571752548, -0.030157513916492462, 0.15379543602466583, -0.009318331256508827, 0.029956718906760216, 0.22856876254081726, 0.0025505172088742256, 0.04243381693959236, 0.15787222981452942, 0.20110438764095306, -0.14405979216098785, 0.015630098059773445, 0.07461845129728317, 0.00015737503417767584, -0.06117546558380127, -0.005862017627805471, -0.05476443096995354, 0.03516622632741928, -0.20680741965770721, -0.07823983579874039, 0.013344909064471722, 0.1372099369764328, 0.043696481734514236, -0.02919815666973591, 0.13534636795520782, -0.011107751168310642, -0.12233064323663712, 0.13942505419254303, 0.1123078316450119, 0.02058723196387291, -0.06853239983320236, -0.18638132512569427, -2.407833551335227e-32, -0.011850832030177116, 0.15217271447181702, -0.09543532133102417, -0.0037015073467046022, -0.20617830753326416, 0.14324221014976501, -0.009361195378005505, -0.02017790824174881, -0.16251488029956818, -0.03945630416274071, 0.12115564942359924, 0.07732684910297394, -0.036261606961488724, 0.06930694729089737, 0.01772700808942318, -0.14774321019649506, -0.19277715682983398, -0.20914418995380402, -0.04693235084414482, -0.09580276161432266, -0.006529560778290033, -0.03160974755883217, 0.04386584088206291, -0.14379653334617615, -0.008584764786064625, 0.1472654938697815, -0.1472516804933548, 0.058365412056446075, 0.1067105233669281, 0.1217043399810791, -0.0646287053823471, 0.05360418185591698, -0.05973760038614273, -0.020761968567967415, -0.13856114447116852, -0.04292858764529228, -0.19577649235725403, 0.016151659190654755, -0.09317018836736679, 0.03040318563580513, -0.12694774568080902, 0.11085804551839828, -0.0008588679484091699, -0.19071900844573975, 0.052884992212057114, 0.003479297272861004, -0.01881454698741436, 0.016509806737303734, -0.05202009528875351, -0.15616260468959808, -0.00007229467883007601, 0.12616631388664246, -0.13050197064876556, 0.042601536959409714, 0.046024154871702194, -0.12039701640605927, 0.004810837097465992, 0.172623872756958, 0.0014916588552296162, -0.05726834759116173, 0.13945621252059937, -0.014165379106998444, 0.09551911801099777, -0.006387766916304827, 0.02886715903878212, 0.1702520251274109, 0.17918117344379425, 0.03218602389097214, -0.05321934074163437, -0.036148663610219955, 0.008947763592004776, -0.007840712554752827, 0.09466046094894409, -0.10147284716367722, -0.08626730740070343, 0.09598235785961151, -0.0913730189204216, -0.0035362711641937494, 0.010028776712715626, 0.11374325305223465, 0.03257304057478905, 0.08781053870916367, 0.09431006759405136, 0.010246822610497475, -0.07984340935945511, 0.009286084212362766, -0.1030936986207962, 0.013765714131295681, -0.09405440837144852, 0.02470923215150833, 0.052461303770542145, 0.09609875828027725, -0.17004215717315674, -0.030581749975681305, -0.20658716559410095, 0.12160424143075943, -0.05383254960179329, 0.10186024755239487, 0.03797273337841034, -0.11080775409936905, -0.26601338386535645, 0.09378598630428314, 0.07862500846385956, 0.08017086982727051, 0.029616836458444595, -0.12659141421318054, 0.17467765510082245, 0.07919885963201523, -0.09065940231084824, -0.04131797328591347, -0.0541689395904541, 0.038278788328170776, 0.1758880913257599, -0.021298250183463097, 0.08502303063869476, -0.005599332973361015, -0.05549135431647301, -0.00643180450424552, 0.11481563746929169, 0.22099311649799347, -0.05449199676513672, 0.12641103565692902, -0.30987539887428284, -0.0712292268872261, 0.10124710202217102, 0.12563961744308472, -0.13761454820632935, -0.050982337445020676, 0.11203794181346893, -0.11380946636199951, 0.041745927184820175, -0.15003713965415955, 7.867308227105241e-7, -0.05278503894805908, 0.14848238229751587, -0.01679791510105133, 0.0033982659224420786, 0.04206402227282524, -0.1146036833524704, -0.15696793794631958, 0.12873336672782898, 0.01647285558283329, 0.08252574503421783, -0.06149625778198242, 0.03701414540410042, 0.11806689947843552, -0.04873371124267578, 0.05622880533337593, -0.03204778954386711, -0.1527732014656067, 0.014535599388182163, -0.017707372084259987, -0.0015709649305790663, -0.11151079833507538, 0.14788387715816498, 0.0019554859027266502, 0.09280763566493988, 0.0117297088727355, -0.09295602142810822, -0.05686022713780403, -0.10459472239017487, 0.06058504432439804, -0.16868902742862701, -0.1533631980419159, 0.07279951125383377, 0.003941413015127182, -0.05198698118329048, 0.07085046172142029, -0.21277247369289398, -0.2484789490699768, -0.06760694086551666, 0.05216475576162338, 0.1784714311361313, 0.03547852113842964, -0.12139493972063065, 0.06420068442821503, 0.08452977985143661, 0.047900039702653885, -0.02844064123928547, -0.11339524388313293, 0.12963233888149261, -0.1301538199186325, 0.07409541308879852, 0.12404894828796387, 0.0662725418806076, -0.024842040613293648, 0.08835185319185257, -0.162904292345047, -0.03373769298195839, 0.043021488934755325, -0.03879665955901146, 0.12116312980651855, -0.08467719703912735, 0.11646034568548203, -0.10726256668567657, 0.12747210264205933, -0.12069054692983627, 0.011185518465936184, -0.18296152353286743, -0.1032276302576065, 1.419809831381161e-34, 0.08823655545711517, 0.011358031071722507, -0.042564403265714645, -0.1946048140525818, 0.06276994198560715, -0.10415983200073242, 0.13605767488479614, 0.0651884377002716, -0.09899462014436722, -0.14255790412425995, 0.054427728056907654 ]
https://github.com/huggingface/datasets/issues/6272
Duplicate `data_files` when named `<split>/<split>.parquet`
I think it's best to drop duplicates with a `set` (as a temporary fix) and improve the patterns when/if https://github.com/fsspec/filesystem_spec/pull/1382 gets merged. @lhoestq Do you have some other ideas?
e.g. with `u23429/stock_1_minute_ticker` ```ipython In [1]: from datasets import * In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker") Downloading readme: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 627/627 [00:00<00:00, 246kB/s] In [3]: b.config.data_files Out[3]: {NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'], NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'], NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']} ``` This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko
29
Duplicate `data_files` when named `<split>/<split>.parquet` e.g. with `u23429/stock_1_minute_ticker` ```ipython In [1]: from datasets import * In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker") Downloading readme: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 627/627 [00:00<00:00, 246kB/s] In [3]: b.config.data_files Out[3]: {NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'], NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'], NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']} ``` This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko I think it's best to drop duplicates with a `set` (as a temporary fix) and improve the patterns when/if https://github.com/fsspec/filesystem_spec/pull/1382 gets merged. @lhoestq Do you have some other ideas?
[ 0.18385575711727142, -0.04695388302206993, -0.10813008248806, 0.1709885150194168, 0.08261077105998993, 0.11738274246454239, 0.1236359104514122, 0.06868387013673782, -0.1835310161113739, 0.07316076755523682, -0.006323616951704025, 0.006051028613001108, -0.07012715190649033, -0.004866116680204868, 0.08356845378875732, 0.013018960133194923, 0.005809127818793058, 0.12235993891954422, -0.009452525526285172, 0.02033481001853943, -0.12905161082744598, 0.04654514417052269, 0.20164018869400024, -0.06278379261493683, -0.08093675225973129, -0.027060432359576225, -0.06133465841412544, 0.16828520596027374, -0.05293973535299301, -0.17051443457603455, 0.0344298891723156, -0.0319996103644371, -0.04958973452448845, 0.1855328381061554, 0.000005707631316909101, 0.10734392702579498, 0.022253502160310745, -0.10201126337051392, -0.09412285685539246, -0.11800599098205566, -0.007160014472901821, 0.03221727907657623, 0.05543734133243561, -0.055150557309389114, 0.06506078690290451, -0.1370459944009781, -0.1716715395450592, 0.12694133818149567, 0.22200524806976318, 0.09677526354789734, -0.0029435409232974052, -0.0015682870289310813, 0.06639732420444489, -0.02018524706363678, 0.1654019057750702, -0.034672390669584274, -0.10050909966230392, 0.029449887573719025, -0.07723037898540497, 0.00881217047572136, -0.004038888495415449, 0.0873817428946495, 0.15683484077453613, 0.13491912186145782, -0.1850937008857727, 0.07841566205024719, -0.14433714747428894, -0.19722962379455566, 0.04016892984509468, 0.1931391805410385, -0.031225645914673805, -0.05279546603560448, 0.08599859476089478, -0.06404136121273041, 0.015562951564788818, -0.24403546750545502, -0.04043637588620186, 0.25011277198791504, -0.06369011104106903, 0.04449532926082611, -0.008207758888602257, 0.1470034420490265, 0.02433876320719719, -0.027920151129364967, -0.07911599427461624, 0.02713250368833542, -0.10744234174489975, 0.1805770993232727, 0.05880468338727951, -0.03189942240715027, 0.0719744861125946, -0.027510738000273705, -0.12854769825935364, -0.1422196924686432, -0.15108440816402435, 0.00984656997025013, -0.126891627907753, -0.19400863349437714, -0.13274329900741577, 0.027739636600017548, -0.11484654992818832, -0.11882061511278152, -0.07214105129241943, -0.08251114934682846, 0.013579120859503746, -0.12177394330501556, -0.1041112169623375, 0.06754159182310104, -0.022909803315997124, -0.06965126097202301, -0.05670570954680443, 0.039136018604040146, -0.023077717050909996, 0.13526496291160583, 0.06600341200828552, -0.15592078864574432, 0.10416349023580551, 0.15216007828712463, -0.0854891836643219, -0.016373762860894203, -0.05373692139983177, -0.027464069426059723, 0.01249341107904911, 0.06244383007287979, 0.20170937478542328, -0.10375504195690155, -0.058265216648578644, 0.028610054403543472, -0.0958198681473732, -0.16245590150356293, -0.0391869880259037, 0.12923145294189453, 0.07715494185686111, 0.10632815212011337, -0.0981115847826004, -0.15275360643863678, 0.08249369263648987, -0.0018659227062016726, -0.07534372061491013, -0.21937543153762817, 0.028879737481474876, -0.06265802681446075, -0.14877940714359283, -0.009306981228291988, -0.09609661996364594, 0.09352491796016693, 0.08092033118009567, -0.06010765954852104, -0.012461049482226372, -0.02119356393814087, -0.21190741658210754, 0.08679944276809692, -0.13209012150764465, 0.18049611151218414, 0.04685252532362938, 0.15369033813476562, -0.03831181675195694, -0.04374261200428009, -0.19301371276378632, -0.019301537424325943, -0.008527244441211224, 0.05559645965695381, 0.06571462750434875, -0.10066509246826172, -0.19637645781040192, -0.13961999118328094, 0.053321629762649536, -0.0501713789999485, -0.07680725306272507, -0.006305384915322065, 0.16916429996490479, 0.07036837190389633, -0.14541980624198914, 0.08760280907154083, -0.2367175966501236, 0.09072978049516678, 0.015211207792162895, 0.07521085441112518, -0.016737932339310646, 0.024157056584954262, 0.056461211293935776, 0.07239684462547302, 0.05578698217868805, -0.2022629678249359, 0.15358535945415497, -0.11993742734193802, -0.09870436042547226, -0.1828535795211792, -0.027851391583681107, -0.13164155185222626, -0.023012667894363403, 0.09599721431732178, -0.024468183517456055, -0.09076054394245148, -0.13423149287700653, -0.005370444618165493, -0.06479215621948242, 0.02395722083747387, 0.04541151225566864, -0.1831570863723755, 0.013000166043639183, -0.0811031311750412, -0.018515711650252342, 0.06816847622394562, -0.15022233128547668, 0.15667007863521576, -0.07134924829006195, 0.14747440814971924, 0.0020059063099324703, -0.09070158004760742, -0.08514288812875748, -0.01490236446261406, 0.006404743995517492, 0.1339983493089676, -0.2030664086341858, -0.03503463417291641, -0.13570423424243927, 0.04266466200351715, -0.15095263719558716, 0.04426485300064087, 0.015601875260472298, 0.17375800013542175, -0.06038513407111168, 0.06750860065221786, 0.00003852810914395377, 0.11716733127832413, 0.00016999637591652572, -0.02511298842728138, 0.05954701080918312, 0.04733852297067642, -0.11557678878307343, 0.11758825182914734, 0.15493671596050262, 0.0012797146337106824, 0.094110868871212, 0.18945994973182678, 0.022035416215658188, -0.1779138445854187, 0.10397306084632874, 0.03825489431619644, -0.21560455858707428, -0.10827847570180893, 0.05573827028274536, -0.04806896671652794, -0.1361771523952484, -0.01252775453031063, 0.09267190843820572, 0.060446687042713165, 0.10248952358961105, -0.15195244550704956, 0.09956342726945877, -0.054585907608270645, -0.11642099916934967, 0.09291016310453415, -0.06935278326272964, -0.0015422303695231676, 0.039685752242803574, 0.1571178436279297, -0.06067420914769173, 0.1474781632423401, 0.05043406039476395, -0.01911458559334278, -0.09123235940933228, 0.0018890727078542113, 0.1003388911485672, -0.1553586721420288, -0.0503840297460556, 0.2202392816543579, -0.03979944810271263, 0.03814836964011192, 0.2724844515323639, 0.00008475239883409813, -0.03212116286158562, -0.03551974520087242, -0.06802248954772949, -0.056946925818920135, -0.12422992289066315, 0.1724911481142044, -0.05258869007229805, -0.019902199506759644, -0.08708270639181137, 0.008225821889936924, 0.11315328627824783, -0.07437857985496521, 0.08577698469161987, 0.10750394314527512, 0.019802043214440346, 0.009255814366042614, -0.23279297351837158, 0.06885754317045212, 0.05629408359527588, -0.12733784317970276, 0.04414699971675873, 0.0577022060751915, 0.07035402953624725, 0.14780953526496887, 0.06047918274998665, -0.17104578018188477, 0.0067961690947413445, 0.00713998032733798, 0.020373953506350517, 0.0791793093085289, 0.033296503126621246, 0.06264449656009674, 0.0611262246966362, 0.11352015286684036, 0.06027756631374359, 0.08890336751937866, -0.009058874100446701, -0.19567221403121948, -0.050633735954761505, 0.11343391984701157, 0.14282962679862976, 0.13114714622497559, 0.17506371438503265, -0.08169234544038773, 0.012735589407384396, -0.34823864698410034, 0.019307345151901245, 0.03253258392214775, 0.03264744579792023, 0.018196899443864822, -0.17740513384342194, -0.054246000945568085, -0.06255064904689789, -0.11994819343090057, -0.0028200517408549786, 0.06034531444311142, 0.04128297418355942, 0.0593964084982872, 0.07866279035806656, -0.044882092624902725, -0.1807606816291809, -0.25092804431915283, -0.04345904290676117, -0.06097431108355522, -0.10554824024438858, 0.05746038630604744, 0.19443722069263458, 0.025768093764781952, 0.17753002047538757, 0.061416253447532654, -0.1500694304704666, -0.020058780908584595, -0.03586693853139877, -0.12846286594867706, -0.015765493735671043, 0.06272765249013901, 0.037798959761857986, -0.03288750350475311, 0.17067475616931915, -0.07072620093822479, 0.09270002692937851, -0.07812187075614929, -0.029081618413329124, 0.14664947986602783, -0.02698129415512085, 0.07689407467842102, 0.1675308793783188, -0.031076794490218163, 0.1456630527973175, -0.0026666924823075533, -0.0016517750918865204, 0.1886228322982788, 0.05948276072740555, 0.021547069773077965, -0.06524942815303802, 0.00447166059166193, 0.01518356055021286, -0.14583314955234528, -0.0688832551240921, 0.052645180374383926, -0.044372886419296265, 0.16310270130634308, -0.1389465630054474, 0.09047208726406097, 0.12038058787584305, -0.013255137950181961, 0.1774561107158661, -0.13477562367916107, -0.06504888832569122, 0.11437352001667023, -0.035331401973962784, 0.024087956175208092, -0.09141754359006882, 0.1776372343301773, 0.11861361563205719, 0.027653660625219345, -0.14096599817276, -0.042442962527275085, 0.0908217653632164, -0.07546204328536987, -0.0396060086786747, 0.10354742407798767, -0.290221244096756, 0.00008289548713946715, 0.0792766883969307, 0.1830657571554184, -0.010519253090023994, -0.0548294335603714, 0.08322547376155853, 0.18892881274223328, 0.12202154844999313, -0.028787365183234215, 0.03388958051800728, -0.034533824771642685, -0.013513152487576008, 0.023329606279730797, -0.03849327191710472, 0.03372694179415703, 0.23640237748622894, 0.0862879827618599, 0.042830538004636765, 0.05659492313861847, 0.1505666971206665, 0.08549493551254272, -0.017539383843541145, -0.19872403144836426, -0.08945293724536896, -0.08311144262552261, -0.17268797755241394, -0.09340602904558182, -0.012921118177473545, 0.11033228039741516, -0.06769617646932602, 0.02710038796067238, 0.03663908690214157, -0.11198665201663971, 0.16967986524105072, -0.015013438649475574, 0.1549040675163269, 0.05913735553622246, 0.16419708728790283, -0.034720517694950104, 0.049483779817819595, 0.013116729445755482, 0.35967347025871277, -0.29091939330101013, -0.11686471849679947, -0.0682196170091629, -0.13267166912555695, -0.07085306942462921, 0.07943648844957352, -0.15554296970367432, 0.18457981944084167, -0.0732312798500061, 0.00229545752517879, 0.03302081301808357, 0.08033376932144165, 0.09472644329071045, -0.22373288869857788, -0.19655372202396393, -0.15144214034080505, -0.1394280046224594, 0.13295964896678925, 0.026462791487574577, 0.2485509067773819, -0.23056566715240479, -0.08229191601276398, -0.0910930261015892, -0.18537038564682007, -0.02355407364666462, 0.012805362232029438, 0.2140195071697235, 0.07062514871358871, -0.04603130370378494, 0.14223597943782806, 0.02021965943276882, 0.014359619468450546, -0.030181806534528732, -0.17241837084293365, 0.06173328310251236, 0.13297441601753235, 0.07425862550735474, 0.22257846593856812, 0.1423356682062149, 0.01412105280905962, 0.008548946119844913, 0.09690108895301819, -0.04563024267554283, 0.24534174799919128, 0.10278596729040146, 0.08337057381868362, -0.0792500302195549, 0.048201240599155426, 0.0033702938817441463, -0.034521326422691345, 0.03392482176423073, -0.10314851999282837, 0.08540757745504379, -0.07459145039319992, 0.048998989164829254, 0.04322529584169388, 0.05046238377690315, 0.10220596939325333, -0.07578868418931961, -0.012120365165174007, -0.040136512368917465, -0.01003305520862341, 0.021797943860292435, -0.04191040247678757, -0.071599081158638, 0.02420838177204132, 0.07920992374420166, 0.06080440431833267, -0.18961967527866364, 0.036526158452034, -0.1727919727563858, 0.0903933048248291, -0.12708503007888794, -0.17584377527236938, -0.044059764593839645, 0.08951903134584427, -0.21391496062278748, 0.16023388504981995, 0.034990474581718445, -0.14637677371501923, 0.05124848708510399, 0.08217915892601013, 0.12938673794269562, -0.10370706766843796, -0.09070514142513275, 0.017352789640426636, -0.14271628856658936, 0.07994074374437332, -0.20129448175430298, -0.059401486068964005, -0.17612947523593903, -0.036206960678100586, 0.16717307269573212, -0.00948099885135889, 0.10310933738946915, 0.09084544330835342, -0.21330009400844574, -0.03185167536139488, 0.08657423406839371, 0.0356023795902729, -0.12081389129161835, 0.04656471312046051, 0.023156264796853065, -0.03654342144727707, -0.009595329873263836, -0.06907310336828232, 0.12186073511838913, -0.0016514313174411654, 0.005423231516033411, 0.024830037727952003, 0.10688164830207825, -0.09736688435077667, -0.12490413337945938, 0.12339301407337189, 0.20637786388397217, 0.09917628765106201, -0.12064150720834732, 0.16642159223556519, -2.3453870302525253e-32, 0.13324464857578278, -0.0073854499496519566, 0.03530268371105194, -0.011410162784159184, -0.16625311970710754, 0.169180229306221, -0.01089426688849926, 0.02550344169139862, 0.06134136766195297, -0.13298702239990234, 0.1175789013504982, -0.10406869649887085, 0.07438243180513382, -0.11620175093412399, 0.13265608251094818, -0.01454772986471653, -0.050357937812805176, 0.2021135538816452, -0.06688734889030457, 0.12918700277805328, 0.1484752744436264, 0.14130771160125732, 0.055159732699394226, 0.09520886093378067, -0.2603910267353058, -0.06478551775217056, -0.08007009327411652, -0.17782168090343475, 0.07110077887773514, 0.02384115941822529, 0.04293030500411987, -0.011661467142403126, 0.06407610327005386, -0.07871948182582855, -0.15821847319602966, 0.08761806041002274, -0.030272845178842545, -0.18293766677379608, -0.18511341512203217, -0.04451257735490799, -0.002061959356069565, 0.19886471331119537, 0.3373396694660187, -0.25894200801849365, -0.09179878979921341, 0.13653606176376343, -0.09941205382347107, 0.03604966402053833, -0.10223815590143204, 0.10695919394493103, 0.0014058127999305725, 0.004735141526907682, 0.1016232967376709, 0.10706523060798645, 0.05356539785861969, -0.05348055437207222, -0.05801572650671005, 0.12527471780776978, -0.15954531729221344, 0.24939145147800446, 0.06282959878444672, -0.06151525676250458, 0.029739998281002045, -0.12845395505428314, -0.000603477586992085, 0.059237439185380936, 0.2483569085597992, -0.02345840074121952, 0.27004575729370117, -0.0787329226732254, -0.016599144786596298, 0.19527819752693176, -0.15170599520206451, -0.15568916499614716, 0.023040322586894035, -0.19080570340156555, -0.07958833128213882, 0.13809260725975037, 0.05824121832847595, -0.11716392636299133, -0.10729186236858368, -0.07082220911979675, 0.05121101438999176, -0.009128126315772533, -0.10197477787733078, 0.20060865581035614, 0.08904748409986496, 0.06489985436201096, 0.010677052661776543, -0.06935179978609085, 0.0040866173803806305, 0.13962872326374054, -0.06722408533096313, -0.04707758501172066, -0.1610117107629776, 0.009153124876320362, -0.074805848300457, -0.08436426520347595, -0.1788649708032608, 0.027453400194644928, 0.25028735399246216, -0.04052488133311272, -0.0048554143868386745, -0.09190050512552261, 0.010188157670199871, -0.04032342880964279, 0.2231394648551941, 0.0059244283474981785, -0.1645941138267517, -0.047341495752334595, -0.0018742858665063977, -0.21970976889133453, 0.05110342800617218, 0.11347057670354843, 0.14302119612693787, -0.02819184772670269, -0.005264290142804384, -0.2517238259315491, 0.1415429711341858, -0.10883542150259018, -0.09608039259910583, 0.044638741761446, -0.23780591785907745, 0.057897355407476425, -0.11634336411952972, 0.1617984026670456, -0.1810152381658554, -0.015414074063301086, 0.11572176963090897, 0.04040778800845146, -0.00916612520813942, -0.0820082351565361, 7.368839192167798e-7, -0.11496460437774658, -0.03781089559197426, -0.1226867213845253, -0.25061216950416565, -0.09208749979734421, 0.04679339751601219, -0.21329422295093536, 0.05700104683637619, -0.1981053650379181, 0.07716833800077438, 0.08950432389974594, -0.04472940042614937, 0.022359929978847504, -0.11398616433143616, 0.08652153611183167, 0.025437090545892715, -0.14667730033397675, -0.030345633625984192, -0.10570146143436432, 0.09960229694843292, 0.057492535561323166, 0.1283443421125412, 0.05789026990532875, -0.11575362086296082, -0.004430453758686781, 0.011632061563432217, -0.12309035658836365, -0.009722772054374218, 0.07097528129816055, 0.04516316205263138, -0.0022654449567198753, -0.0932774767279625, 0.08510994911193848, -0.06615117937326431, 0.07883913069963455, -0.05826832354068756, -0.044472090899944305, -0.07298123091459274, 0.08683886379003525, 0.08297531306743622, 0.18528100848197937, -0.05810929462313652, -0.05187788978219032, -0.03469706326723099, -0.07793477177619934, 0.04864369332790375, -0.048635274171829224, 0.0244004987180233, 0.01151952426880598, 0.028354212641716003, 0.12124872207641602, 0.20499877631664276, 0.05366382375359535, 0.30239182710647583, -0.05711799114942551, -0.11593013256788254, 0.03553188964724541, -0.1232224553823471, 0.12947939336299896, -0.002984768943861127, -0.1537279486656189, -0.03734251484274864, 0.038053933531045914, -0.06890949606895447, 0.174125075340271, -0.09218081086874008, 0.07175680249929428, 1.5803389674315508e-34, -0.10615961998701096, 0.10988868772983551, 0.11952478438615799, -0.06726442277431488, -0.0015154849970713258, 0.08473052829504013, -0.01729799248278141, 0.10712529718875885, -0.12663070857524872, 0.009819615632295609, -0.016002990305423737 ]
https://github.com/huggingface/datasets/issues/6272
Duplicate `data_files` when named `<split>/<split>.parquet`
Alternatively we could just use this no ? ```python if config.FSSPEC_VERSION < version.parse("2023.9.0"): KEYWORDS_IN_PATH_NAME_BASE_PATTERNS = [ "{keyword}[{sep}/]**", "**[{sep}]{keyword}[{sep}/]**", "**/{keyword}[{sep}/]**", ] else: KEYWORDS_IN_PATH_NAME_BASE_PATTERNS = [ "{keyword}[{sep}/]**", "**/*[{sep}]{keyword}[{sep}/]**", "**/*/{keyword}[{sep}/]**", ] ``` This way no need to implement sets, which would require a bit of work since we've always considered a list of pattern to be resolved as the concatenated list of resolved files for each pattern (including duplicates)
e.g. with `u23429/stock_1_minute_ticker` ```ipython In [1]: from datasets import * In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker") Downloading readme: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 627/627 [00:00<00:00, 246kB/s] In [3]: b.config.data_files Out[3]: {NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'], NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'], NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']} ``` This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko
66
Duplicate `data_files` when named `<split>/<split>.parquet` e.g. with `u23429/stock_1_minute_ticker` ```ipython In [1]: from datasets import * In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker") Downloading readme: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 627/627 [00:00<00:00, 246kB/s] In [3]: b.config.data_files Out[3]: {NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'], NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'], NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']} ``` This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko Alternatively we could just use this no ? ```python if config.FSSPEC_VERSION < version.parse("2023.9.0"): KEYWORDS_IN_PATH_NAME_BASE_PATTERNS = [ "{keyword}[{sep}/]**", "**[{sep}]{keyword}[{sep}/]**", "**/{keyword}[{sep}/]**", ] else: KEYWORDS_IN_PATH_NAME_BASE_PATTERNS = [ "{keyword}[{sep}/]**", "**/*[{sep}]{keyword}[{sep}/]**", "**/*/{keyword}[{sep}/]**", ] ``` This way no need to implement sets, which would require a bit of work since we've always considered a list of pattern to be resolved as the concatenated list of resolved files for each pattern (including duplicates)
[ 0.18385575711727142, -0.04695388302206993, -0.10813008248806, 0.1709885150194168, 0.08261077105998993, 0.11738274246454239, 0.1236359104514122, 0.06868387013673782, -0.1835310161113739, 0.07316076755523682, -0.006323616951704025, 0.006051028613001108, -0.07012715190649033, -0.004866116680204868, 0.08356845378875732, 0.013018960133194923, 0.005809127818793058, 0.12235993891954422, -0.009452525526285172, 0.02033481001853943, -0.12905161082744598, 0.04654514417052269, 0.20164018869400024, -0.06278379261493683, -0.08093675225973129, -0.027060432359576225, -0.06133465841412544, 0.16828520596027374, -0.05293973535299301, -0.17051443457603455, 0.0344298891723156, -0.0319996103644371, -0.04958973452448845, 0.1855328381061554, 0.000005707631316909101, 0.10734392702579498, 0.022253502160310745, -0.10201126337051392, -0.09412285685539246, -0.11800599098205566, -0.007160014472901821, 0.03221727907657623, 0.05543734133243561, -0.055150557309389114, 0.06506078690290451, -0.1370459944009781, -0.1716715395450592, 0.12694133818149567, 0.22200524806976318, 0.09677526354789734, -0.0029435409232974052, -0.0015682870289310813, 0.06639732420444489, -0.02018524706363678, 0.1654019057750702, -0.034672390669584274, -0.10050909966230392, 0.029449887573719025, -0.07723037898540497, 0.00881217047572136, -0.004038888495415449, 0.0873817428946495, 0.15683484077453613, 0.13491912186145782, -0.1850937008857727, 0.07841566205024719, -0.14433714747428894, -0.19722962379455566, 0.04016892984509468, 0.1931391805410385, -0.031225645914673805, -0.05279546603560448, 0.08599859476089478, -0.06404136121273041, 0.015562951564788818, -0.24403546750545502, -0.04043637588620186, 0.25011277198791504, -0.06369011104106903, 0.04449532926082611, -0.008207758888602257, 0.1470034420490265, 0.02433876320719719, -0.027920151129364967, -0.07911599427461624, 0.02713250368833542, -0.10744234174489975, 0.1805770993232727, 0.05880468338727951, -0.03189942240715027, 0.0719744861125946, -0.027510738000273705, -0.12854769825935364, -0.1422196924686432, -0.15108440816402435, 0.00984656997025013, -0.126891627907753, -0.19400863349437714, -0.13274329900741577, 0.027739636600017548, -0.11484654992818832, -0.11882061511278152, -0.07214105129241943, -0.08251114934682846, 0.013579120859503746, -0.12177394330501556, -0.1041112169623375, 0.06754159182310104, -0.022909803315997124, -0.06965126097202301, -0.05670570954680443, 0.039136018604040146, -0.023077717050909996, 0.13526496291160583, 0.06600341200828552, -0.15592078864574432, 0.10416349023580551, 0.15216007828712463, -0.0854891836643219, -0.016373762860894203, -0.05373692139983177, -0.027464069426059723, 0.01249341107904911, 0.06244383007287979, 0.20170937478542328, -0.10375504195690155, -0.058265216648578644, 0.028610054403543472, -0.0958198681473732, -0.16245590150356293, -0.0391869880259037, 0.12923145294189453, 0.07715494185686111, 0.10632815212011337, -0.0981115847826004, -0.15275360643863678, 0.08249369263648987, -0.0018659227062016726, -0.07534372061491013, -0.21937543153762817, 0.028879737481474876, -0.06265802681446075, -0.14877940714359283, -0.009306981228291988, -0.09609661996364594, 0.09352491796016693, 0.08092033118009567, -0.06010765954852104, -0.012461049482226372, -0.02119356393814087, -0.21190741658210754, 0.08679944276809692, -0.13209012150764465, 0.18049611151218414, 0.04685252532362938, 0.15369033813476562, -0.03831181675195694, -0.04374261200428009, -0.19301371276378632, -0.019301537424325943, -0.008527244441211224, 0.05559645965695381, 0.06571462750434875, -0.10066509246826172, -0.19637645781040192, -0.13961999118328094, 0.053321629762649536, -0.0501713789999485, -0.07680725306272507, -0.006305384915322065, 0.16916429996490479, 0.07036837190389633, -0.14541980624198914, 0.08760280907154083, -0.2367175966501236, 0.09072978049516678, 0.015211207792162895, 0.07521085441112518, -0.016737932339310646, 0.024157056584954262, 0.056461211293935776, 0.07239684462547302, 0.05578698217868805, -0.2022629678249359, 0.15358535945415497, -0.11993742734193802, -0.09870436042547226, -0.1828535795211792, -0.027851391583681107, -0.13164155185222626, -0.023012667894363403, 0.09599721431732178, -0.024468183517456055, -0.09076054394245148, -0.13423149287700653, -0.005370444618165493, -0.06479215621948242, 0.02395722083747387, 0.04541151225566864, -0.1831570863723755, 0.013000166043639183, -0.0811031311750412, -0.018515711650252342, 0.06816847622394562, -0.15022233128547668, 0.15667007863521576, -0.07134924829006195, 0.14747440814971924, 0.0020059063099324703, -0.09070158004760742, -0.08514288812875748, -0.01490236446261406, 0.006404743995517492, 0.1339983493089676, -0.2030664086341858, -0.03503463417291641, -0.13570423424243927, 0.04266466200351715, -0.15095263719558716, 0.04426485300064087, 0.015601875260472298, 0.17375800013542175, -0.06038513407111168, 0.06750860065221786, 0.00003852810914395377, 0.11716733127832413, 0.00016999637591652572, -0.02511298842728138, 0.05954701080918312, 0.04733852297067642, -0.11557678878307343, 0.11758825182914734, 0.15493671596050262, 0.0012797146337106824, 0.094110868871212, 0.18945994973182678, 0.022035416215658188, -0.1779138445854187, 0.10397306084632874, 0.03825489431619644, -0.21560455858707428, -0.10827847570180893, 0.05573827028274536, -0.04806896671652794, -0.1361771523952484, -0.01252775453031063, 0.09267190843820572, 0.060446687042713165, 0.10248952358961105, -0.15195244550704956, 0.09956342726945877, -0.054585907608270645, -0.11642099916934967, 0.09291016310453415, -0.06935278326272964, -0.0015422303695231676, 0.039685752242803574, 0.1571178436279297, -0.06067420914769173, 0.1474781632423401, 0.05043406039476395, -0.01911458559334278, -0.09123235940933228, 0.0018890727078542113, 0.1003388911485672, -0.1553586721420288, -0.0503840297460556, 0.2202392816543579, -0.03979944810271263, 0.03814836964011192, 0.2724844515323639, 0.00008475239883409813, -0.03212116286158562, -0.03551974520087242, -0.06802248954772949, -0.056946925818920135, -0.12422992289066315, 0.1724911481142044, -0.05258869007229805, -0.019902199506759644, -0.08708270639181137, 0.008225821889936924, 0.11315328627824783, -0.07437857985496521, 0.08577698469161987, 0.10750394314527512, 0.019802043214440346, 0.009255814366042614, -0.23279297351837158, 0.06885754317045212, 0.05629408359527588, -0.12733784317970276, 0.04414699971675873, 0.0577022060751915, 0.07035402953624725, 0.14780953526496887, 0.06047918274998665, -0.17104578018188477, 0.0067961690947413445, 0.00713998032733798, 0.020373953506350517, 0.0791793093085289, 0.033296503126621246, 0.06264449656009674, 0.0611262246966362, 0.11352015286684036, 0.06027756631374359, 0.08890336751937866, -0.009058874100446701, -0.19567221403121948, -0.050633735954761505, 0.11343391984701157, 0.14282962679862976, 0.13114714622497559, 0.17506371438503265, -0.08169234544038773, 0.012735589407384396, -0.34823864698410034, 0.019307345151901245, 0.03253258392214775, 0.03264744579792023, 0.018196899443864822, -0.17740513384342194, -0.054246000945568085, -0.06255064904689789, -0.11994819343090057, -0.0028200517408549786, 0.06034531444311142, 0.04128297418355942, 0.0593964084982872, 0.07866279035806656, -0.044882092624902725, -0.1807606816291809, -0.25092804431915283, -0.04345904290676117, -0.06097431108355522, -0.10554824024438858, 0.05746038630604744, 0.19443722069263458, 0.025768093764781952, 0.17753002047538757, 0.061416253447532654, -0.1500694304704666, -0.020058780908584595, -0.03586693853139877, -0.12846286594867706, -0.015765493735671043, 0.06272765249013901, 0.037798959761857986, -0.03288750350475311, 0.17067475616931915, -0.07072620093822479, 0.09270002692937851, -0.07812187075614929, -0.029081618413329124, 0.14664947986602783, -0.02698129415512085, 0.07689407467842102, 0.1675308793783188, -0.031076794490218163, 0.1456630527973175, -0.0026666924823075533, -0.0016517750918865204, 0.1886228322982788, 0.05948276072740555, 0.021547069773077965, -0.06524942815303802, 0.00447166059166193, 0.01518356055021286, -0.14583314955234528, -0.0688832551240921, 0.052645180374383926, -0.044372886419296265, 0.16310270130634308, -0.1389465630054474, 0.09047208726406097, 0.12038058787584305, -0.013255137950181961, 0.1774561107158661, -0.13477562367916107, -0.06504888832569122, 0.11437352001667023, -0.035331401973962784, 0.024087956175208092, -0.09141754359006882, 0.1776372343301773, 0.11861361563205719, 0.027653660625219345, -0.14096599817276, -0.042442962527275085, 0.0908217653632164, -0.07546204328536987, -0.0396060086786747, 0.10354742407798767, -0.290221244096756, 0.00008289548713946715, 0.0792766883969307, 0.1830657571554184, -0.010519253090023994, -0.0548294335603714, 0.08322547376155853, 0.18892881274223328, 0.12202154844999313, -0.028787365183234215, 0.03388958051800728, -0.034533824771642685, -0.013513152487576008, 0.023329606279730797, -0.03849327191710472, 0.03372694179415703, 0.23640237748622894, 0.0862879827618599, 0.042830538004636765, 0.05659492313861847, 0.1505666971206665, 0.08549493551254272, -0.017539383843541145, -0.19872403144836426, -0.08945293724536896, -0.08311144262552261, -0.17268797755241394, -0.09340602904558182, -0.012921118177473545, 0.11033228039741516, -0.06769617646932602, 0.02710038796067238, 0.03663908690214157, -0.11198665201663971, 0.16967986524105072, -0.015013438649475574, 0.1549040675163269, 0.05913735553622246, 0.16419708728790283, -0.034720517694950104, 0.049483779817819595, 0.013116729445755482, 0.35967347025871277, -0.29091939330101013, -0.11686471849679947, -0.0682196170091629, -0.13267166912555695, -0.07085306942462921, 0.07943648844957352, -0.15554296970367432, 0.18457981944084167, -0.0732312798500061, 0.00229545752517879, 0.03302081301808357, 0.08033376932144165, 0.09472644329071045, -0.22373288869857788, -0.19655372202396393, -0.15144214034080505, -0.1394280046224594, 0.13295964896678925, 0.026462791487574577, 0.2485509067773819, -0.23056566715240479, -0.08229191601276398, -0.0910930261015892, -0.18537038564682007, -0.02355407364666462, 0.012805362232029438, 0.2140195071697235, 0.07062514871358871, -0.04603130370378494, 0.14223597943782806, 0.02021965943276882, 0.014359619468450546, -0.030181806534528732, -0.17241837084293365, 0.06173328310251236, 0.13297441601753235, 0.07425862550735474, 0.22257846593856812, 0.1423356682062149, 0.01412105280905962, 0.008548946119844913, 0.09690108895301819, -0.04563024267554283, 0.24534174799919128, 0.10278596729040146, 0.08337057381868362, -0.0792500302195549, 0.048201240599155426, 0.0033702938817441463, -0.034521326422691345, 0.03392482176423073, -0.10314851999282837, 0.08540757745504379, -0.07459145039319992, 0.048998989164829254, 0.04322529584169388, 0.05046238377690315, 0.10220596939325333, -0.07578868418931961, -0.012120365165174007, -0.040136512368917465, -0.01003305520862341, 0.021797943860292435, -0.04191040247678757, -0.071599081158638, 0.02420838177204132, 0.07920992374420166, 0.06080440431833267, -0.18961967527866364, 0.036526158452034, -0.1727919727563858, 0.0903933048248291, -0.12708503007888794, -0.17584377527236938, -0.044059764593839645, 0.08951903134584427, -0.21391496062278748, 0.16023388504981995, 0.034990474581718445, -0.14637677371501923, 0.05124848708510399, 0.08217915892601013, 0.12938673794269562, -0.10370706766843796, -0.09070514142513275, 0.017352789640426636, -0.14271628856658936, 0.07994074374437332, -0.20129448175430298, -0.059401486068964005, -0.17612947523593903, -0.036206960678100586, 0.16717307269573212, -0.00948099885135889, 0.10310933738946915, 0.09084544330835342, -0.21330009400844574, -0.03185167536139488, 0.08657423406839371, 0.0356023795902729, -0.12081389129161835, 0.04656471312046051, 0.023156264796853065, -0.03654342144727707, -0.009595329873263836, -0.06907310336828232, 0.12186073511838913, -0.0016514313174411654, 0.005423231516033411, 0.024830037727952003, 0.10688164830207825, -0.09736688435077667, -0.12490413337945938, 0.12339301407337189, 0.20637786388397217, 0.09917628765106201, -0.12064150720834732, 0.16642159223556519, -2.3453870302525253e-32, 0.13324464857578278, -0.0073854499496519566, 0.03530268371105194, -0.011410162784159184, -0.16625311970710754, 0.169180229306221, -0.01089426688849926, 0.02550344169139862, 0.06134136766195297, -0.13298702239990234, 0.1175789013504982, -0.10406869649887085, 0.07438243180513382, -0.11620175093412399, 0.13265608251094818, -0.01454772986471653, -0.050357937812805176, 0.2021135538816452, -0.06688734889030457, 0.12918700277805328, 0.1484752744436264, 0.14130771160125732, 0.055159732699394226, 0.09520886093378067, -0.2603910267353058, -0.06478551775217056, -0.08007009327411652, -0.17782168090343475, 0.07110077887773514, 0.02384115941822529, 0.04293030500411987, -0.011661467142403126, 0.06407610327005386, -0.07871948182582855, -0.15821847319602966, 0.08761806041002274, -0.030272845178842545, -0.18293766677379608, -0.18511341512203217, -0.04451257735490799, -0.002061959356069565, 0.19886471331119537, 0.3373396694660187, -0.25894200801849365, -0.09179878979921341, 0.13653606176376343, -0.09941205382347107, 0.03604966402053833, -0.10223815590143204, 0.10695919394493103, 0.0014058127999305725, 0.004735141526907682, 0.1016232967376709, 0.10706523060798645, 0.05356539785861969, -0.05348055437207222, -0.05801572650671005, 0.12527471780776978, -0.15954531729221344, 0.24939145147800446, 0.06282959878444672, -0.06151525676250458, 0.029739998281002045, -0.12845395505428314, -0.000603477586992085, 0.059237439185380936, 0.2483569085597992, -0.02345840074121952, 0.27004575729370117, -0.0787329226732254, -0.016599144786596298, 0.19527819752693176, -0.15170599520206451, -0.15568916499614716, 0.023040322586894035, -0.19080570340156555, -0.07958833128213882, 0.13809260725975037, 0.05824121832847595, -0.11716392636299133, -0.10729186236858368, -0.07082220911979675, 0.05121101438999176, -0.009128126315772533, -0.10197477787733078, 0.20060865581035614, 0.08904748409986496, 0.06489985436201096, 0.010677052661776543, -0.06935179978609085, 0.0040866173803806305, 0.13962872326374054, -0.06722408533096313, -0.04707758501172066, -0.1610117107629776, 0.009153124876320362, -0.074805848300457, -0.08436426520347595, -0.1788649708032608, 0.027453400194644928, 0.25028735399246216, -0.04052488133311272, -0.0048554143868386745, -0.09190050512552261, 0.010188157670199871, -0.04032342880964279, 0.2231394648551941, 0.0059244283474981785, -0.1645941138267517, -0.047341495752334595, -0.0018742858665063977, -0.21970976889133453, 0.05110342800617218, 0.11347057670354843, 0.14302119612693787, -0.02819184772670269, -0.005264290142804384, -0.2517238259315491, 0.1415429711341858, -0.10883542150259018, -0.09608039259910583, 0.044638741761446, -0.23780591785907745, 0.057897355407476425, -0.11634336411952972, 0.1617984026670456, -0.1810152381658554, -0.015414074063301086, 0.11572176963090897, 0.04040778800845146, -0.00916612520813942, -0.0820082351565361, 7.368839192167798e-7, -0.11496460437774658, -0.03781089559197426, -0.1226867213845253, -0.25061216950416565, -0.09208749979734421, 0.04679339751601219, -0.21329422295093536, 0.05700104683637619, -0.1981053650379181, 0.07716833800077438, 0.08950432389974594, -0.04472940042614937, 0.022359929978847504, -0.11398616433143616, 0.08652153611183167, 0.025437090545892715, -0.14667730033397675, -0.030345633625984192, -0.10570146143436432, 0.09960229694843292, 0.057492535561323166, 0.1283443421125412, 0.05789026990532875, -0.11575362086296082, -0.004430453758686781, 0.011632061563432217, -0.12309035658836365, -0.009722772054374218, 0.07097528129816055, 0.04516316205263138, -0.0022654449567198753, -0.0932774767279625, 0.08510994911193848, -0.06615117937326431, 0.07883913069963455, -0.05826832354068756, -0.044472090899944305, -0.07298123091459274, 0.08683886379003525, 0.08297531306743622, 0.18528100848197937, -0.05810929462313652, -0.05187788978219032, -0.03469706326723099, -0.07793477177619934, 0.04864369332790375, -0.048635274171829224, 0.0244004987180233, 0.01151952426880598, 0.028354212641716003, 0.12124872207641602, 0.20499877631664276, 0.05366382375359535, 0.30239182710647583, -0.05711799114942551, -0.11593013256788254, 0.03553188964724541, -0.1232224553823471, 0.12947939336299896, -0.002984768943861127, -0.1537279486656189, -0.03734251484274864, 0.038053933531045914, -0.06890949606895447, 0.174125075340271, -0.09218081086874008, 0.07175680249929428, 1.5803389674315508e-34, -0.10615961998701096, 0.10988868772983551, 0.11952478438615799, -0.06726442277431488, -0.0015154849970713258, 0.08473052829504013, -0.01729799248278141, 0.10712529718875885, -0.12663070857524872, 0.009819615632295609, -0.016002990305423737 ]
https://github.com/huggingface/datasets/issues/6272
Duplicate `data_files` when named `<split>/<split>.parquet`
Arf `"**/*/{keyword}[{sep}/]**"` does return `data/keyword.txt` in latest `fsspec` but not in `glob.glob` EDIT: actually forgot to set `recursive=True`
e.g. with `u23429/stock_1_minute_ticker` ```ipython In [1]: from datasets import * In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker") Downloading readme: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 627/627 [00:00<00:00, 246kB/s] In [3]: b.config.data_files Out[3]: {NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'], NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'], NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']} ``` This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko
18
Duplicate `data_files` when named `<split>/<split>.parquet` e.g. with `u23429/stock_1_minute_ticker` ```ipython In [1]: from datasets import * In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker") Downloading readme: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 627/627 [00:00<00:00, 246kB/s] In [3]: b.config.data_files Out[3]: {NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'], NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'], NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']} ``` This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko Arf `"**/*/{keyword}[{sep}/]**"` does return `data/keyword.txt` in latest `fsspec` but not in `glob.glob` EDIT: actually forgot to set `recursive=True`
[ 0.18385575711727142, -0.04695388302206993, -0.10813008248806, 0.1709885150194168, 0.08261077105998993, 0.11738274246454239, 0.1236359104514122, 0.06868387013673782, -0.1835310161113739, 0.07316076755523682, -0.006323616951704025, 0.006051028613001108, -0.07012715190649033, -0.004866116680204868, 0.08356845378875732, 0.013018960133194923, 0.005809127818793058, 0.12235993891954422, -0.009452525526285172, 0.02033481001853943, -0.12905161082744598, 0.04654514417052269, 0.20164018869400024, -0.06278379261493683, -0.08093675225973129, -0.027060432359576225, -0.06133465841412544, 0.16828520596027374, -0.05293973535299301, -0.17051443457603455, 0.0344298891723156, -0.0319996103644371, -0.04958973452448845, 0.1855328381061554, 0.000005707631316909101, 0.10734392702579498, 0.022253502160310745, -0.10201126337051392, -0.09412285685539246, -0.11800599098205566, -0.007160014472901821, 0.03221727907657623, 0.05543734133243561, -0.055150557309389114, 0.06506078690290451, -0.1370459944009781, -0.1716715395450592, 0.12694133818149567, 0.22200524806976318, 0.09677526354789734, -0.0029435409232974052, -0.0015682870289310813, 0.06639732420444489, -0.02018524706363678, 0.1654019057750702, -0.034672390669584274, -0.10050909966230392, 0.029449887573719025, -0.07723037898540497, 0.00881217047572136, -0.004038888495415449, 0.0873817428946495, 0.15683484077453613, 0.13491912186145782, -0.1850937008857727, 0.07841566205024719, -0.14433714747428894, -0.19722962379455566, 0.04016892984509468, 0.1931391805410385, -0.031225645914673805, -0.05279546603560448, 0.08599859476089478, -0.06404136121273041, 0.015562951564788818, -0.24403546750545502, -0.04043637588620186, 0.25011277198791504, -0.06369011104106903, 0.04449532926082611, -0.008207758888602257, 0.1470034420490265, 0.02433876320719719, -0.027920151129364967, -0.07911599427461624, 0.02713250368833542, -0.10744234174489975, 0.1805770993232727, 0.05880468338727951, -0.03189942240715027, 0.0719744861125946, -0.027510738000273705, -0.12854769825935364, -0.1422196924686432, -0.15108440816402435, 0.00984656997025013, -0.126891627907753, -0.19400863349437714, -0.13274329900741577, 0.027739636600017548, -0.11484654992818832, -0.11882061511278152, -0.07214105129241943, -0.08251114934682846, 0.013579120859503746, -0.12177394330501556, -0.1041112169623375, 0.06754159182310104, -0.022909803315997124, -0.06965126097202301, -0.05670570954680443, 0.039136018604040146, -0.023077717050909996, 0.13526496291160583, 0.06600341200828552, -0.15592078864574432, 0.10416349023580551, 0.15216007828712463, -0.0854891836643219, -0.016373762860894203, -0.05373692139983177, -0.027464069426059723, 0.01249341107904911, 0.06244383007287979, 0.20170937478542328, -0.10375504195690155, -0.058265216648578644, 0.028610054403543472, -0.0958198681473732, -0.16245590150356293, -0.0391869880259037, 0.12923145294189453, 0.07715494185686111, 0.10632815212011337, -0.0981115847826004, -0.15275360643863678, 0.08249369263648987, -0.0018659227062016726, -0.07534372061491013, -0.21937543153762817, 0.028879737481474876, -0.06265802681446075, -0.14877940714359283, -0.009306981228291988, -0.09609661996364594, 0.09352491796016693, 0.08092033118009567, -0.06010765954852104, -0.012461049482226372, -0.02119356393814087, -0.21190741658210754, 0.08679944276809692, -0.13209012150764465, 0.18049611151218414, 0.04685252532362938, 0.15369033813476562, -0.03831181675195694, -0.04374261200428009, -0.19301371276378632, -0.019301537424325943, -0.008527244441211224, 0.05559645965695381, 0.06571462750434875, -0.10066509246826172, -0.19637645781040192, -0.13961999118328094, 0.053321629762649536, -0.0501713789999485, -0.07680725306272507, -0.006305384915322065, 0.16916429996490479, 0.07036837190389633, -0.14541980624198914, 0.08760280907154083, -0.2367175966501236, 0.09072978049516678, 0.015211207792162895, 0.07521085441112518, -0.016737932339310646, 0.024157056584954262, 0.056461211293935776, 0.07239684462547302, 0.05578698217868805, -0.2022629678249359, 0.15358535945415497, -0.11993742734193802, -0.09870436042547226, -0.1828535795211792, -0.027851391583681107, -0.13164155185222626, -0.023012667894363403, 0.09599721431732178, -0.024468183517456055, -0.09076054394245148, -0.13423149287700653, -0.005370444618165493, -0.06479215621948242, 0.02395722083747387, 0.04541151225566864, -0.1831570863723755, 0.013000166043639183, -0.0811031311750412, -0.018515711650252342, 0.06816847622394562, -0.15022233128547668, 0.15667007863521576, -0.07134924829006195, 0.14747440814971924, 0.0020059063099324703, -0.09070158004760742, -0.08514288812875748, -0.01490236446261406, 0.006404743995517492, 0.1339983493089676, -0.2030664086341858, -0.03503463417291641, -0.13570423424243927, 0.04266466200351715, -0.15095263719558716, 0.04426485300064087, 0.015601875260472298, 0.17375800013542175, -0.06038513407111168, 0.06750860065221786, 0.00003852810914395377, 0.11716733127832413, 0.00016999637591652572, -0.02511298842728138, 0.05954701080918312, 0.04733852297067642, -0.11557678878307343, 0.11758825182914734, 0.15493671596050262, 0.0012797146337106824, 0.094110868871212, 0.18945994973182678, 0.022035416215658188, -0.1779138445854187, 0.10397306084632874, 0.03825489431619644, -0.21560455858707428, -0.10827847570180893, 0.05573827028274536, -0.04806896671652794, -0.1361771523952484, -0.01252775453031063, 0.09267190843820572, 0.060446687042713165, 0.10248952358961105, -0.15195244550704956, 0.09956342726945877, -0.054585907608270645, -0.11642099916934967, 0.09291016310453415, -0.06935278326272964, -0.0015422303695231676, 0.039685752242803574, 0.1571178436279297, -0.06067420914769173, 0.1474781632423401, 0.05043406039476395, -0.01911458559334278, -0.09123235940933228, 0.0018890727078542113, 0.1003388911485672, -0.1553586721420288, -0.0503840297460556, 0.2202392816543579, -0.03979944810271263, 0.03814836964011192, 0.2724844515323639, 0.00008475239883409813, -0.03212116286158562, -0.03551974520087242, -0.06802248954772949, -0.056946925818920135, -0.12422992289066315, 0.1724911481142044, -0.05258869007229805, -0.019902199506759644, -0.08708270639181137, 0.008225821889936924, 0.11315328627824783, -0.07437857985496521, 0.08577698469161987, 0.10750394314527512, 0.019802043214440346, 0.009255814366042614, -0.23279297351837158, 0.06885754317045212, 0.05629408359527588, -0.12733784317970276, 0.04414699971675873, 0.0577022060751915, 0.07035402953624725, 0.14780953526496887, 0.06047918274998665, -0.17104578018188477, 0.0067961690947413445, 0.00713998032733798, 0.020373953506350517, 0.0791793093085289, 0.033296503126621246, 0.06264449656009674, 0.0611262246966362, 0.11352015286684036, 0.06027756631374359, 0.08890336751937866, -0.009058874100446701, -0.19567221403121948, -0.050633735954761505, 0.11343391984701157, 0.14282962679862976, 0.13114714622497559, 0.17506371438503265, -0.08169234544038773, 0.012735589407384396, -0.34823864698410034, 0.019307345151901245, 0.03253258392214775, 0.03264744579792023, 0.018196899443864822, -0.17740513384342194, -0.054246000945568085, -0.06255064904689789, -0.11994819343090057, -0.0028200517408549786, 0.06034531444311142, 0.04128297418355942, 0.0593964084982872, 0.07866279035806656, -0.044882092624902725, -0.1807606816291809, -0.25092804431915283, -0.04345904290676117, -0.06097431108355522, -0.10554824024438858, 0.05746038630604744, 0.19443722069263458, 0.025768093764781952, 0.17753002047538757, 0.061416253447532654, -0.1500694304704666, -0.020058780908584595, -0.03586693853139877, -0.12846286594867706, -0.015765493735671043, 0.06272765249013901, 0.037798959761857986, -0.03288750350475311, 0.17067475616931915, -0.07072620093822479, 0.09270002692937851, -0.07812187075614929, -0.029081618413329124, 0.14664947986602783, -0.02698129415512085, 0.07689407467842102, 0.1675308793783188, -0.031076794490218163, 0.1456630527973175, -0.0026666924823075533, -0.0016517750918865204, 0.1886228322982788, 0.05948276072740555, 0.021547069773077965, -0.06524942815303802, 0.00447166059166193, 0.01518356055021286, -0.14583314955234528, -0.0688832551240921, 0.052645180374383926, -0.044372886419296265, 0.16310270130634308, -0.1389465630054474, 0.09047208726406097, 0.12038058787584305, -0.013255137950181961, 0.1774561107158661, -0.13477562367916107, -0.06504888832569122, 0.11437352001667023, -0.035331401973962784, 0.024087956175208092, -0.09141754359006882, 0.1776372343301773, 0.11861361563205719, 0.027653660625219345, -0.14096599817276, -0.042442962527275085, 0.0908217653632164, -0.07546204328536987, -0.0396060086786747, 0.10354742407798767, -0.290221244096756, 0.00008289548713946715, 0.0792766883969307, 0.1830657571554184, -0.010519253090023994, -0.0548294335603714, 0.08322547376155853, 0.18892881274223328, 0.12202154844999313, -0.028787365183234215, 0.03388958051800728, -0.034533824771642685, -0.013513152487576008, 0.023329606279730797, -0.03849327191710472, 0.03372694179415703, 0.23640237748622894, 0.0862879827618599, 0.042830538004636765, 0.05659492313861847, 0.1505666971206665, 0.08549493551254272, -0.017539383843541145, -0.19872403144836426, -0.08945293724536896, -0.08311144262552261, -0.17268797755241394, -0.09340602904558182, -0.012921118177473545, 0.11033228039741516, -0.06769617646932602, 0.02710038796067238, 0.03663908690214157, -0.11198665201663971, 0.16967986524105072, -0.015013438649475574, 0.1549040675163269, 0.05913735553622246, 0.16419708728790283, -0.034720517694950104, 0.049483779817819595, 0.013116729445755482, 0.35967347025871277, -0.29091939330101013, -0.11686471849679947, -0.0682196170091629, -0.13267166912555695, -0.07085306942462921, 0.07943648844957352, -0.15554296970367432, 0.18457981944084167, -0.0732312798500061, 0.00229545752517879, 0.03302081301808357, 0.08033376932144165, 0.09472644329071045, -0.22373288869857788, -0.19655372202396393, -0.15144214034080505, -0.1394280046224594, 0.13295964896678925, 0.026462791487574577, 0.2485509067773819, -0.23056566715240479, -0.08229191601276398, -0.0910930261015892, -0.18537038564682007, -0.02355407364666462, 0.012805362232029438, 0.2140195071697235, 0.07062514871358871, -0.04603130370378494, 0.14223597943782806, 0.02021965943276882, 0.014359619468450546, -0.030181806534528732, -0.17241837084293365, 0.06173328310251236, 0.13297441601753235, 0.07425862550735474, 0.22257846593856812, 0.1423356682062149, 0.01412105280905962, 0.008548946119844913, 0.09690108895301819, -0.04563024267554283, 0.24534174799919128, 0.10278596729040146, 0.08337057381868362, -0.0792500302195549, 0.048201240599155426, 0.0033702938817441463, -0.034521326422691345, 0.03392482176423073, -0.10314851999282837, 0.08540757745504379, -0.07459145039319992, 0.048998989164829254, 0.04322529584169388, 0.05046238377690315, 0.10220596939325333, -0.07578868418931961, -0.012120365165174007, -0.040136512368917465, -0.01003305520862341, 0.021797943860292435, -0.04191040247678757, -0.071599081158638, 0.02420838177204132, 0.07920992374420166, 0.06080440431833267, -0.18961967527866364, 0.036526158452034, -0.1727919727563858, 0.0903933048248291, -0.12708503007888794, -0.17584377527236938, -0.044059764593839645, 0.08951903134584427, -0.21391496062278748, 0.16023388504981995, 0.034990474581718445, -0.14637677371501923, 0.05124848708510399, 0.08217915892601013, 0.12938673794269562, -0.10370706766843796, -0.09070514142513275, 0.017352789640426636, -0.14271628856658936, 0.07994074374437332, -0.20129448175430298, -0.059401486068964005, -0.17612947523593903, -0.036206960678100586, 0.16717307269573212, -0.00948099885135889, 0.10310933738946915, 0.09084544330835342, -0.21330009400844574, -0.03185167536139488, 0.08657423406839371, 0.0356023795902729, -0.12081389129161835, 0.04656471312046051, 0.023156264796853065, -0.03654342144727707, -0.009595329873263836, -0.06907310336828232, 0.12186073511838913, -0.0016514313174411654, 0.005423231516033411, 0.024830037727952003, 0.10688164830207825, -0.09736688435077667, -0.12490413337945938, 0.12339301407337189, 0.20637786388397217, 0.09917628765106201, -0.12064150720834732, 0.16642159223556519, -2.3453870302525253e-32, 0.13324464857578278, -0.0073854499496519566, 0.03530268371105194, -0.011410162784159184, -0.16625311970710754, 0.169180229306221, -0.01089426688849926, 0.02550344169139862, 0.06134136766195297, -0.13298702239990234, 0.1175789013504982, -0.10406869649887085, 0.07438243180513382, -0.11620175093412399, 0.13265608251094818, -0.01454772986471653, -0.050357937812805176, 0.2021135538816452, -0.06688734889030457, 0.12918700277805328, 0.1484752744436264, 0.14130771160125732, 0.055159732699394226, 0.09520886093378067, -0.2603910267353058, -0.06478551775217056, -0.08007009327411652, -0.17782168090343475, 0.07110077887773514, 0.02384115941822529, 0.04293030500411987, -0.011661467142403126, 0.06407610327005386, -0.07871948182582855, -0.15821847319602966, 0.08761806041002274, -0.030272845178842545, -0.18293766677379608, -0.18511341512203217, -0.04451257735490799, -0.002061959356069565, 0.19886471331119537, 0.3373396694660187, -0.25894200801849365, -0.09179878979921341, 0.13653606176376343, -0.09941205382347107, 0.03604966402053833, -0.10223815590143204, 0.10695919394493103, 0.0014058127999305725, 0.004735141526907682, 0.1016232967376709, 0.10706523060798645, 0.05356539785861969, -0.05348055437207222, -0.05801572650671005, 0.12527471780776978, -0.15954531729221344, 0.24939145147800446, 0.06282959878444672, -0.06151525676250458, 0.029739998281002045, -0.12845395505428314, -0.000603477586992085, 0.059237439185380936, 0.2483569085597992, -0.02345840074121952, 0.27004575729370117, -0.0787329226732254, -0.016599144786596298, 0.19527819752693176, -0.15170599520206451, -0.15568916499614716, 0.023040322586894035, -0.19080570340156555, -0.07958833128213882, 0.13809260725975037, 0.05824121832847595, -0.11716392636299133, -0.10729186236858368, -0.07082220911979675, 0.05121101438999176, -0.009128126315772533, -0.10197477787733078, 0.20060865581035614, 0.08904748409986496, 0.06489985436201096, 0.010677052661776543, -0.06935179978609085, 0.0040866173803806305, 0.13962872326374054, -0.06722408533096313, -0.04707758501172066, -0.1610117107629776, 0.009153124876320362, -0.074805848300457, -0.08436426520347595, -0.1788649708032608, 0.027453400194644928, 0.25028735399246216, -0.04052488133311272, -0.0048554143868386745, -0.09190050512552261, 0.010188157670199871, -0.04032342880964279, 0.2231394648551941, 0.0059244283474981785, -0.1645941138267517, -0.047341495752334595, -0.0018742858665063977, -0.21970976889133453, 0.05110342800617218, 0.11347057670354843, 0.14302119612693787, -0.02819184772670269, -0.005264290142804384, -0.2517238259315491, 0.1415429711341858, -0.10883542150259018, -0.09608039259910583, 0.044638741761446, -0.23780591785907745, 0.057897355407476425, -0.11634336411952972, 0.1617984026670456, -0.1810152381658554, -0.015414074063301086, 0.11572176963090897, 0.04040778800845146, -0.00916612520813942, -0.0820082351565361, 7.368839192167798e-7, -0.11496460437774658, -0.03781089559197426, -0.1226867213845253, -0.25061216950416565, -0.09208749979734421, 0.04679339751601219, -0.21329422295093536, 0.05700104683637619, -0.1981053650379181, 0.07716833800077438, 0.08950432389974594, -0.04472940042614937, 0.022359929978847504, -0.11398616433143616, 0.08652153611183167, 0.025437090545892715, -0.14667730033397675, -0.030345633625984192, -0.10570146143436432, 0.09960229694843292, 0.057492535561323166, 0.1283443421125412, 0.05789026990532875, -0.11575362086296082, -0.004430453758686781, 0.011632061563432217, -0.12309035658836365, -0.009722772054374218, 0.07097528129816055, 0.04516316205263138, -0.0022654449567198753, -0.0932774767279625, 0.08510994911193848, -0.06615117937326431, 0.07883913069963455, -0.05826832354068756, -0.044472090899944305, -0.07298123091459274, 0.08683886379003525, 0.08297531306743622, 0.18528100848197937, -0.05810929462313652, -0.05187788978219032, -0.03469706326723099, -0.07793477177619934, 0.04864369332790375, -0.048635274171829224, 0.0244004987180233, 0.01151952426880598, 0.028354212641716003, 0.12124872207641602, 0.20499877631664276, 0.05366382375359535, 0.30239182710647583, -0.05711799114942551, -0.11593013256788254, 0.03553188964724541, -0.1232224553823471, 0.12947939336299896, -0.002984768943861127, -0.1537279486656189, -0.03734251484274864, 0.038053933531045914, -0.06890949606895447, 0.174125075340271, -0.09218081086874008, 0.07175680249929428, 1.5803389674315508e-34, -0.10615961998701096, 0.10988868772983551, 0.11952478438615799, -0.06726442277431488, -0.0015154849970713258, 0.08473052829504013, -0.01729799248278141, 0.10712529718875885, -0.12663070857524872, 0.009819615632295609, -0.016002990305423737 ]
https://github.com/huggingface/datasets/issues/6272
Duplicate `data_files` when named `<split>/<split>.parquet`
> I think it's best to drop duplicates with a set (as a temporary fix) I started https://github.com/huggingface/datasets/pull/6278 to use DataFilesSet objects instead of DataFilesList
e.g. with `u23429/stock_1_minute_ticker` ```ipython In [1]: from datasets import * In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker") Downloading readme: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 627/627 [00:00<00:00, 246kB/s] In [3]: b.config.data_files Out[3]: {NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'], NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'], NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']} ``` This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko
25
Duplicate `data_files` when named `<split>/<split>.parquet` e.g. with `u23429/stock_1_minute_ticker` ```ipython In [1]: from datasets import * In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker") Downloading readme: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 627/627 [00:00<00:00, 246kB/s] In [3]: b.config.data_files Out[3]: {NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'], NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'], NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']} ``` This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko > I think it's best to drop duplicates with a set (as a temporary fix) I started https://github.com/huggingface/datasets/pull/6278 to use DataFilesSet objects instead of DataFilesList
[ 0.18385575711727142, -0.04695388302206993, -0.10813008248806, 0.1709885150194168, 0.08261077105998993, 0.11738274246454239, 0.1236359104514122, 0.06868387013673782, -0.1835310161113739, 0.07316076755523682, -0.006323616951704025, 0.006051028613001108, -0.07012715190649033, -0.004866116680204868, 0.08356845378875732, 0.013018960133194923, 0.005809127818793058, 0.12235993891954422, -0.009452525526285172, 0.02033481001853943, -0.12905161082744598, 0.04654514417052269, 0.20164018869400024, -0.06278379261493683, -0.08093675225973129, -0.027060432359576225, -0.06133465841412544, 0.16828520596027374, -0.05293973535299301, -0.17051443457603455, 0.0344298891723156, -0.0319996103644371, -0.04958973452448845, 0.1855328381061554, 0.000005707631316909101, 0.10734392702579498, 0.022253502160310745, -0.10201126337051392, -0.09412285685539246, -0.11800599098205566, -0.007160014472901821, 0.03221727907657623, 0.05543734133243561, -0.055150557309389114, 0.06506078690290451, -0.1370459944009781, -0.1716715395450592, 0.12694133818149567, 0.22200524806976318, 0.09677526354789734, -0.0029435409232974052, -0.0015682870289310813, 0.06639732420444489, -0.02018524706363678, 0.1654019057750702, -0.034672390669584274, -0.10050909966230392, 0.029449887573719025, -0.07723037898540497, 0.00881217047572136, -0.004038888495415449, 0.0873817428946495, 0.15683484077453613, 0.13491912186145782, -0.1850937008857727, 0.07841566205024719, -0.14433714747428894, -0.19722962379455566, 0.04016892984509468, 0.1931391805410385, -0.031225645914673805, -0.05279546603560448, 0.08599859476089478, -0.06404136121273041, 0.015562951564788818, -0.24403546750545502, -0.04043637588620186, 0.25011277198791504, -0.06369011104106903, 0.04449532926082611, -0.008207758888602257, 0.1470034420490265, 0.02433876320719719, -0.027920151129364967, -0.07911599427461624, 0.02713250368833542, -0.10744234174489975, 0.1805770993232727, 0.05880468338727951, -0.03189942240715027, 0.0719744861125946, -0.027510738000273705, -0.12854769825935364, -0.1422196924686432, -0.15108440816402435, 0.00984656997025013, -0.126891627907753, -0.19400863349437714, -0.13274329900741577, 0.027739636600017548, -0.11484654992818832, -0.11882061511278152, -0.07214105129241943, -0.08251114934682846, 0.013579120859503746, -0.12177394330501556, -0.1041112169623375, 0.06754159182310104, -0.022909803315997124, -0.06965126097202301, -0.05670570954680443, 0.039136018604040146, -0.023077717050909996, 0.13526496291160583, 0.06600341200828552, -0.15592078864574432, 0.10416349023580551, 0.15216007828712463, -0.0854891836643219, -0.016373762860894203, -0.05373692139983177, -0.027464069426059723, 0.01249341107904911, 0.06244383007287979, 0.20170937478542328, -0.10375504195690155, -0.058265216648578644, 0.028610054403543472, -0.0958198681473732, -0.16245590150356293, -0.0391869880259037, 0.12923145294189453, 0.07715494185686111, 0.10632815212011337, -0.0981115847826004, -0.15275360643863678, 0.08249369263648987, -0.0018659227062016726, -0.07534372061491013, -0.21937543153762817, 0.028879737481474876, -0.06265802681446075, -0.14877940714359283, -0.009306981228291988, -0.09609661996364594, 0.09352491796016693, 0.08092033118009567, -0.06010765954852104, -0.012461049482226372, -0.02119356393814087, -0.21190741658210754, 0.08679944276809692, -0.13209012150764465, 0.18049611151218414, 0.04685252532362938, 0.15369033813476562, -0.03831181675195694, -0.04374261200428009, -0.19301371276378632, -0.019301537424325943, -0.008527244441211224, 0.05559645965695381, 0.06571462750434875, -0.10066509246826172, -0.19637645781040192, -0.13961999118328094, 0.053321629762649536, -0.0501713789999485, -0.07680725306272507, -0.006305384915322065, 0.16916429996490479, 0.07036837190389633, -0.14541980624198914, 0.08760280907154083, -0.2367175966501236, 0.09072978049516678, 0.015211207792162895, 0.07521085441112518, -0.016737932339310646, 0.024157056584954262, 0.056461211293935776, 0.07239684462547302, 0.05578698217868805, -0.2022629678249359, 0.15358535945415497, -0.11993742734193802, -0.09870436042547226, -0.1828535795211792, -0.027851391583681107, -0.13164155185222626, -0.023012667894363403, 0.09599721431732178, -0.024468183517456055, -0.09076054394245148, -0.13423149287700653, -0.005370444618165493, -0.06479215621948242, 0.02395722083747387, 0.04541151225566864, -0.1831570863723755, 0.013000166043639183, -0.0811031311750412, -0.018515711650252342, 0.06816847622394562, -0.15022233128547668, 0.15667007863521576, -0.07134924829006195, 0.14747440814971924, 0.0020059063099324703, -0.09070158004760742, -0.08514288812875748, -0.01490236446261406, 0.006404743995517492, 0.1339983493089676, -0.2030664086341858, -0.03503463417291641, -0.13570423424243927, 0.04266466200351715, -0.15095263719558716, 0.04426485300064087, 0.015601875260472298, 0.17375800013542175, -0.06038513407111168, 0.06750860065221786, 0.00003852810914395377, 0.11716733127832413, 0.00016999637591652572, -0.02511298842728138, 0.05954701080918312, 0.04733852297067642, -0.11557678878307343, 0.11758825182914734, 0.15493671596050262, 0.0012797146337106824, 0.094110868871212, 0.18945994973182678, 0.022035416215658188, -0.1779138445854187, 0.10397306084632874, 0.03825489431619644, -0.21560455858707428, -0.10827847570180893, 0.05573827028274536, -0.04806896671652794, -0.1361771523952484, -0.01252775453031063, 0.09267190843820572, 0.060446687042713165, 0.10248952358961105, -0.15195244550704956, 0.09956342726945877, -0.054585907608270645, -0.11642099916934967, 0.09291016310453415, -0.06935278326272964, -0.0015422303695231676, 0.039685752242803574, 0.1571178436279297, -0.06067420914769173, 0.1474781632423401, 0.05043406039476395, -0.01911458559334278, -0.09123235940933228, 0.0018890727078542113, 0.1003388911485672, -0.1553586721420288, -0.0503840297460556, 0.2202392816543579, -0.03979944810271263, 0.03814836964011192, 0.2724844515323639, 0.00008475239883409813, -0.03212116286158562, -0.03551974520087242, -0.06802248954772949, -0.056946925818920135, -0.12422992289066315, 0.1724911481142044, -0.05258869007229805, -0.019902199506759644, -0.08708270639181137, 0.008225821889936924, 0.11315328627824783, -0.07437857985496521, 0.08577698469161987, 0.10750394314527512, 0.019802043214440346, 0.009255814366042614, -0.23279297351837158, 0.06885754317045212, 0.05629408359527588, -0.12733784317970276, 0.04414699971675873, 0.0577022060751915, 0.07035402953624725, 0.14780953526496887, 0.06047918274998665, -0.17104578018188477, 0.0067961690947413445, 0.00713998032733798, 0.020373953506350517, 0.0791793093085289, 0.033296503126621246, 0.06264449656009674, 0.0611262246966362, 0.11352015286684036, 0.06027756631374359, 0.08890336751937866, -0.009058874100446701, -0.19567221403121948, -0.050633735954761505, 0.11343391984701157, 0.14282962679862976, 0.13114714622497559, 0.17506371438503265, -0.08169234544038773, 0.012735589407384396, -0.34823864698410034, 0.019307345151901245, 0.03253258392214775, 0.03264744579792023, 0.018196899443864822, -0.17740513384342194, -0.054246000945568085, -0.06255064904689789, -0.11994819343090057, -0.0028200517408549786, 0.06034531444311142, 0.04128297418355942, 0.0593964084982872, 0.07866279035806656, -0.044882092624902725, -0.1807606816291809, -0.25092804431915283, -0.04345904290676117, -0.06097431108355522, -0.10554824024438858, 0.05746038630604744, 0.19443722069263458, 0.025768093764781952, 0.17753002047538757, 0.061416253447532654, -0.1500694304704666, -0.020058780908584595, -0.03586693853139877, -0.12846286594867706, -0.015765493735671043, 0.06272765249013901, 0.037798959761857986, -0.03288750350475311, 0.17067475616931915, -0.07072620093822479, 0.09270002692937851, -0.07812187075614929, -0.029081618413329124, 0.14664947986602783, -0.02698129415512085, 0.07689407467842102, 0.1675308793783188, -0.031076794490218163, 0.1456630527973175, -0.0026666924823075533, -0.0016517750918865204, 0.1886228322982788, 0.05948276072740555, 0.021547069773077965, -0.06524942815303802, 0.00447166059166193, 0.01518356055021286, -0.14583314955234528, -0.0688832551240921, 0.052645180374383926, -0.044372886419296265, 0.16310270130634308, -0.1389465630054474, 0.09047208726406097, 0.12038058787584305, -0.013255137950181961, 0.1774561107158661, -0.13477562367916107, -0.06504888832569122, 0.11437352001667023, -0.035331401973962784, 0.024087956175208092, -0.09141754359006882, 0.1776372343301773, 0.11861361563205719, 0.027653660625219345, -0.14096599817276, -0.042442962527275085, 0.0908217653632164, -0.07546204328536987, -0.0396060086786747, 0.10354742407798767, -0.290221244096756, 0.00008289548713946715, 0.0792766883969307, 0.1830657571554184, -0.010519253090023994, -0.0548294335603714, 0.08322547376155853, 0.18892881274223328, 0.12202154844999313, -0.028787365183234215, 0.03388958051800728, -0.034533824771642685, -0.013513152487576008, 0.023329606279730797, -0.03849327191710472, 0.03372694179415703, 0.23640237748622894, 0.0862879827618599, 0.042830538004636765, 0.05659492313861847, 0.1505666971206665, 0.08549493551254272, -0.017539383843541145, -0.19872403144836426, -0.08945293724536896, -0.08311144262552261, -0.17268797755241394, -0.09340602904558182, -0.012921118177473545, 0.11033228039741516, -0.06769617646932602, 0.02710038796067238, 0.03663908690214157, -0.11198665201663971, 0.16967986524105072, -0.015013438649475574, 0.1549040675163269, 0.05913735553622246, 0.16419708728790283, -0.034720517694950104, 0.049483779817819595, 0.013116729445755482, 0.35967347025871277, -0.29091939330101013, -0.11686471849679947, -0.0682196170091629, -0.13267166912555695, -0.07085306942462921, 0.07943648844957352, -0.15554296970367432, 0.18457981944084167, -0.0732312798500061, 0.00229545752517879, 0.03302081301808357, 0.08033376932144165, 0.09472644329071045, -0.22373288869857788, -0.19655372202396393, -0.15144214034080505, -0.1394280046224594, 0.13295964896678925, 0.026462791487574577, 0.2485509067773819, -0.23056566715240479, -0.08229191601276398, -0.0910930261015892, -0.18537038564682007, -0.02355407364666462, 0.012805362232029438, 0.2140195071697235, 0.07062514871358871, -0.04603130370378494, 0.14223597943782806, 0.02021965943276882, 0.014359619468450546, -0.030181806534528732, -0.17241837084293365, 0.06173328310251236, 0.13297441601753235, 0.07425862550735474, 0.22257846593856812, 0.1423356682062149, 0.01412105280905962, 0.008548946119844913, 0.09690108895301819, -0.04563024267554283, 0.24534174799919128, 0.10278596729040146, 0.08337057381868362, -0.0792500302195549, 0.048201240599155426, 0.0033702938817441463, -0.034521326422691345, 0.03392482176423073, -0.10314851999282837, 0.08540757745504379, -0.07459145039319992, 0.048998989164829254, 0.04322529584169388, 0.05046238377690315, 0.10220596939325333, -0.07578868418931961, -0.012120365165174007, -0.040136512368917465, -0.01003305520862341, 0.021797943860292435, -0.04191040247678757, -0.071599081158638, 0.02420838177204132, 0.07920992374420166, 0.06080440431833267, -0.18961967527866364, 0.036526158452034, -0.1727919727563858, 0.0903933048248291, -0.12708503007888794, -0.17584377527236938, -0.044059764593839645, 0.08951903134584427, -0.21391496062278748, 0.16023388504981995, 0.034990474581718445, -0.14637677371501923, 0.05124848708510399, 0.08217915892601013, 0.12938673794269562, -0.10370706766843796, -0.09070514142513275, 0.017352789640426636, -0.14271628856658936, 0.07994074374437332, -0.20129448175430298, -0.059401486068964005, -0.17612947523593903, -0.036206960678100586, 0.16717307269573212, -0.00948099885135889, 0.10310933738946915, 0.09084544330835342, -0.21330009400844574, -0.03185167536139488, 0.08657423406839371, 0.0356023795902729, -0.12081389129161835, 0.04656471312046051, 0.023156264796853065, -0.03654342144727707, -0.009595329873263836, -0.06907310336828232, 0.12186073511838913, -0.0016514313174411654, 0.005423231516033411, 0.024830037727952003, 0.10688164830207825, -0.09736688435077667, -0.12490413337945938, 0.12339301407337189, 0.20637786388397217, 0.09917628765106201, -0.12064150720834732, 0.16642159223556519, -2.3453870302525253e-32, 0.13324464857578278, -0.0073854499496519566, 0.03530268371105194, -0.011410162784159184, -0.16625311970710754, 0.169180229306221, -0.01089426688849926, 0.02550344169139862, 0.06134136766195297, -0.13298702239990234, 0.1175789013504982, -0.10406869649887085, 0.07438243180513382, -0.11620175093412399, 0.13265608251094818, -0.01454772986471653, -0.050357937812805176, 0.2021135538816452, -0.06688734889030457, 0.12918700277805328, 0.1484752744436264, 0.14130771160125732, 0.055159732699394226, 0.09520886093378067, -0.2603910267353058, -0.06478551775217056, -0.08007009327411652, -0.17782168090343475, 0.07110077887773514, 0.02384115941822529, 0.04293030500411987, -0.011661467142403126, 0.06407610327005386, -0.07871948182582855, -0.15821847319602966, 0.08761806041002274, -0.030272845178842545, -0.18293766677379608, -0.18511341512203217, -0.04451257735490799, -0.002061959356069565, 0.19886471331119537, 0.3373396694660187, -0.25894200801849365, -0.09179878979921341, 0.13653606176376343, -0.09941205382347107, 0.03604966402053833, -0.10223815590143204, 0.10695919394493103, 0.0014058127999305725, 0.004735141526907682, 0.1016232967376709, 0.10706523060798645, 0.05356539785861969, -0.05348055437207222, -0.05801572650671005, 0.12527471780776978, -0.15954531729221344, 0.24939145147800446, 0.06282959878444672, -0.06151525676250458, 0.029739998281002045, -0.12845395505428314, -0.000603477586992085, 0.059237439185380936, 0.2483569085597992, -0.02345840074121952, 0.27004575729370117, -0.0787329226732254, -0.016599144786596298, 0.19527819752693176, -0.15170599520206451, -0.15568916499614716, 0.023040322586894035, -0.19080570340156555, -0.07958833128213882, 0.13809260725975037, 0.05824121832847595, -0.11716392636299133, -0.10729186236858368, -0.07082220911979675, 0.05121101438999176, -0.009128126315772533, -0.10197477787733078, 0.20060865581035614, 0.08904748409986496, 0.06489985436201096, 0.010677052661776543, -0.06935179978609085, 0.0040866173803806305, 0.13962872326374054, -0.06722408533096313, -0.04707758501172066, -0.1610117107629776, 0.009153124876320362, -0.074805848300457, -0.08436426520347595, -0.1788649708032608, 0.027453400194644928, 0.25028735399246216, -0.04052488133311272, -0.0048554143868386745, -0.09190050512552261, 0.010188157670199871, -0.04032342880964279, 0.2231394648551941, 0.0059244283474981785, -0.1645941138267517, -0.047341495752334595, -0.0018742858665063977, -0.21970976889133453, 0.05110342800617218, 0.11347057670354843, 0.14302119612693787, -0.02819184772670269, -0.005264290142804384, -0.2517238259315491, 0.1415429711341858, -0.10883542150259018, -0.09608039259910583, 0.044638741761446, -0.23780591785907745, 0.057897355407476425, -0.11634336411952972, 0.1617984026670456, -0.1810152381658554, -0.015414074063301086, 0.11572176963090897, 0.04040778800845146, -0.00916612520813942, -0.0820082351565361, 7.368839192167798e-7, -0.11496460437774658, -0.03781089559197426, -0.1226867213845253, -0.25061216950416565, -0.09208749979734421, 0.04679339751601219, -0.21329422295093536, 0.05700104683637619, -0.1981053650379181, 0.07716833800077438, 0.08950432389974594, -0.04472940042614937, 0.022359929978847504, -0.11398616433143616, 0.08652153611183167, 0.025437090545892715, -0.14667730033397675, -0.030345633625984192, -0.10570146143436432, 0.09960229694843292, 0.057492535561323166, 0.1283443421125412, 0.05789026990532875, -0.11575362086296082, -0.004430453758686781, 0.011632061563432217, -0.12309035658836365, -0.009722772054374218, 0.07097528129816055, 0.04516316205263138, -0.0022654449567198753, -0.0932774767279625, 0.08510994911193848, -0.06615117937326431, 0.07883913069963455, -0.05826832354068756, -0.044472090899944305, -0.07298123091459274, 0.08683886379003525, 0.08297531306743622, 0.18528100848197937, -0.05810929462313652, -0.05187788978219032, -0.03469706326723099, -0.07793477177619934, 0.04864369332790375, -0.048635274171829224, 0.0244004987180233, 0.01151952426880598, 0.028354212641716003, 0.12124872207641602, 0.20499877631664276, 0.05366382375359535, 0.30239182710647583, -0.05711799114942551, -0.11593013256788254, 0.03553188964724541, -0.1232224553823471, 0.12947939336299896, -0.002984768943861127, -0.1537279486656189, -0.03734251484274864, 0.038053933531045914, -0.06890949606895447, 0.174125075340271, -0.09218081086874008, 0.07175680249929428, 1.5803389674315508e-34, -0.10615961998701096, 0.10988868772983551, 0.11952478438615799, -0.06726442277431488, -0.0015154849970713258, 0.08473052829504013, -0.01729799248278141, 0.10712529718875885, -0.12663070857524872, 0.009819615632295609, -0.016002990305423737 ]
https://github.com/huggingface/datasets/issues/6270
Dataset.from_generator raises with sharded gen_args
`gen_kwargs` should be a `dict`, as stated in the docstring, but you are passing a `list`. So, to fix the error, replace the list of dicts with a dict of lists (and slightly modify the generator function): ```python from pathlib import Path import datasets def process_yaml(files): for f in files: # process yield dict(...) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs={'files': [f for f in dir.glob('*.yml')]}) ds.to_json('training.jsonl') ```
### Describe the bug According to the docs of Datasets.from_generator: ``` gen_kwargs(`dict`, *optional*): Keyword arguments to be passed to the `generator` callable. You can define a sharded dataset by passing the list of shards in `gen_kwargs`. ``` So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element. It doesn't work that way though. ### Steps to reproduce the bug ```python #!/usr/bin/python from pathlib import Path import datasets def process_yaml(file): yield dict(example=42) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ) ds.to_json('training.jsonl') ``` ``` Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File "/tmp/dataset_bug.py", line 13, in <module> ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator ).read() ^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read self.builder.download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare super()._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single generator = self._generate_examples(**gen_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ``` mapping, not list ### Expected behavior I would expect that process_yaml would be called once for each yaml file in the directory where the script is run. I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list. ### Environment info - `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0) - Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3
74
Dataset.from_generator raises with sharded gen_args ### Describe the bug According to the docs of Datasets.from_generator: ``` gen_kwargs(`dict`, *optional*): Keyword arguments to be passed to the `generator` callable. You can define a sharded dataset by passing the list of shards in `gen_kwargs`. ``` So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element. It doesn't work that way though. ### Steps to reproduce the bug ```python #!/usr/bin/python from pathlib import Path import datasets def process_yaml(file): yield dict(example=42) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ) ds.to_json('training.jsonl') ``` ``` Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File "/tmp/dataset_bug.py", line 13, in <module> ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator ).read() ^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read self.builder.download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare super()._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single generator = self._generate_examples(**gen_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ``` mapping, not list ### Expected behavior I would expect that process_yaml would be called once for each yaml file in the directory where the script is run. I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list. ### Environment info - `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0) - Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 `gen_kwargs` should be a `dict`, as stated in the docstring, but you are passing a `list`. So, to fix the error, replace the list of dicts with a dict of lists (and slightly modify the generator function): ```python from pathlib import Path import datasets def process_yaml(files): for f in files: # process yield dict(...) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs={'files': [f for f in dir.glob('*.yml')]}) ds.to_json('training.jsonl') ```
[ 0.10313498228788376, -0.004205336328595877, -0.04959315434098244, 0.11198350787162781, 0.2503035366535187, 0.11277437210083008, 0.10729693621397018, 0.027257123962044716, -0.06739849597215652, 0.16669291257858276, 0.09859459847211838, -0.07553824037313461, -0.04894908517599106, 0.02901710383594036, -0.020641455426812172, 0.044132329523563385, 0.05877521634101868, -0.028443243354558945, -0.006722837686538696, -0.09125570952892303, -0.21881398558616638, 0.07229812443256378, 0.10556191951036453, 0.031242458149790764, -0.022417288273572922, -0.18133628368377686, -0.11979396641254425, 0.2623496651649475, 0.0368354395031929, -0.012835637666285038, 0.0036758051719516516, -0.06834603101015091, -0.09703134000301361, 0.06385886669158936, 0.000005486469945026329, 0.12594643235206604, 0.30116334557533264, -0.039548490196466446, 0.0004133521288167685, -0.003941867034882307, 0.08651227504014969, -0.03327413275837898, 0.15086418390274048, -0.07212145626544952, -0.10114121437072754, -0.05896662548184395, -0.11148767918348312, 0.0458906851708889, 0.0967421606183052, -0.030728835612535477, -0.035163186490535736, -0.08800141513347626, 0.09008572995662689, -0.15698157250881195, 0.05923711135983467, -0.007308897562325001, 0.07911939173936844, -0.10990388691425323, -0.35164445638656616, -0.0791551023721695, 0.08646424114704132, -0.10097146034240723, -0.0068420907482504845, 0.0327516570687294, -0.04384410008788109, 0.04456170275807381, -0.2359626740217209, -0.13205035030841827, 0.06098748371005058, 0.05156952142715454, -0.21917201578617096, -0.02523070201277733, -0.07844214886426926, -0.010352697223424911, -0.028321510180830956, -0.0707145482301712, -0.03190188482403755, 0.16704389452934265, -0.09356268495321274, 0.11132439225912094, 0.09724341332912445, 0.022192737087607384, -0.06427231431007385, -0.027787504717707634, -0.1726253181695938, -0.024048645049333572, -0.036399658769369125, 0.17960932850837708, -0.11218027770519257, 0.0013673981884494424, -0.10627097636461258, -0.0148343276232481, -0.17328450083732605, -0.1156499832868576, -0.10337597876787186, 0.09823025017976761, -0.03747973591089249, -0.10094320774078369, 0.04298669099807739, -0.14496351778507233, -0.09733723849058151, -0.08042463660240173, 0.10087571293115616, 0.02693248726427555, 0.11258874088525772, -0.12429700046777725, 0.056918855756521225, -0.001704930909909308, -0.08226744830608368, 0.07359475642442703, -0.08772211521863937, 0.07005433738231659, -0.1177714392542839, -0.10486633330583572, 0.17687676846981049, 0.05383818596601486, 0.05699289217591286, 0.0993896871805191, 0.044634200632572174, 0.2489950954914093, -0.07094461470842361, 0.13082365691661835, -0.02836271934211254, 0.12927252054214478, 0.05765687674283981, -0.008276493288576603, -0.04827253893017769, 0.01571107842028141, -0.0006485909689217806, -0.12350476533174515, -0.08284400403499603, -0.1747051477432251, 0.02566213719546795, 0.05217883363366127, -0.03191737085580826, 0.04275473207235336, -0.035252735018730164, -0.038509853184223175, -0.025131240487098694, -0.21412178874015808, 0.14364729821681976, -0.02486654557287693, 0.10768456757068634, 0.0515265017747879, 0.10138704627752304, 0.12105430662631989, 0.11941143870353699, -0.03439069166779518, 0.03952028974890709, 0.0246413666754961, -0.3334151804447174, 0.06925883889198303, -0.10171802341938019, 0.1529429852962494, -0.017855288460850716, 0.13698770105838776, 0.06905709952116013, -0.007664893753826618, -0.14848467707633972, -0.024285778403282166, 0.06682959944009781, -0.028774317353963852, 0.0003827578038908541, -0.17273543775081635, 0.012630869634449482, 0.14559490978717804, 0.08862415701150894, 0.025789327919483185, -0.10329120606184006, -0.1256362944841385, 0.16930171847343445, -0.07399310916662216, -0.09538917988538742, -0.21443264186382294, -0.04512818530201912, 0.2176124006509781, -0.18824848532676697, 0.07631143927574158, -0.2497529834508896, -0.032853446900844574, 0.03527657687664032, 0.03777249902486801, 0.1084265187382698, -0.19869118928909302, 0.08067822456359863, -0.16831688582897186, -0.08254522830247879, 0.014665487222373486, -0.1026807352900505, -0.1621708869934082, -0.10164803266525269, 0.13407915830612183, -0.1709490716457367, 0.05569912865757942, 0.032196950167417526, 0.03470882400870323, -0.0038311106618493795, 0.03538765385746956, 0.09113990515470505, -0.161671981215477, -0.01996605470776558, 0.0005281682242639363, 0.17308072745800018, -0.004679511301219463, 0.10171673446893692, 0.1128140538930893, -0.19995161890983582, 0.13058386743068695, -0.14332520961761475, -0.15629464387893677, -0.19393524527549744, -0.0206880122423172, 0.015756186097860336, 0.1585792899131775, -0.2621559202671051, -0.052504513412714005, -0.06525138020515442, 0.018466636538505554, -0.15346777439117432, 0.041215814650058746, -0.04342637583613396, 0.10630615055561066, -0.06747809052467346, 0.020665960386395454, 0.03507746383547783, 0.03605390712618828, 0.003285012673586607, -0.1348775178194046, 0.01819157414138317, -0.041810423135757446, -0.1039801687002182, -0.030954210087656975, 0.1890823096036911, 0.13322865962982178, 0.00669214129447937, -0.018763087689876556, -0.0084577277302742, -0.1853744387626648, 0.020474886521697044, 0.035085707902908325, -0.004628922790288925, 0.00017581415886525065, -0.11760241538286209, -0.04558223858475685, 0.09415913373231888, 0.10215817391872406, -0.03192666545510292, 0.2202172428369522, -0.086898572742939, 0.07883994281291962, 0.11090107262134552, 0.11713425815105438, -0.03380197659134865, 0.002452124608680606, -0.0565643347799778, -0.11068340390920639, 0.17715758085250854, 0.1850028783082962, -0.06338325887918472, -0.06407839804887772, 0.339718759059906, -0.07432243973016739, -0.12580257654190063, -0.022102639079093933, 0.020170772448182106, -0.12464325875043869, 0.048888787627220154, 0.16876424849033356, -0.07303036004304886, 0.02695922739803791, 0.17030788958072662, -0.06267896294593811, -0.1218862384557724, -0.09149034321308136, -0.007080978713929653, -0.09790991246700287, 0.02021469548344612, 0.08117597550153732, 0.1622851938009262, -0.00013690779451280832, -0.09182554483413696, 0.13948607444763184, 0.15664587914943695, -0.10754282027482986, 0.11942706257104874, 0.2394101768732071, -0.08426810801029205, 0.3338295817375183, -0.10431651771068573, 0.08599763363599777, -0.12356314063072205, -0.07571865618228912, -0.0975833535194397, -0.1374174803495407, 0.07339659333229065, -0.026901409029960632, 0.13965663313865662, -0.08038265258073807, 0.08963499963283539, -0.13643380999565125, -0.043306369334459305, 0.055773936212062836, 0.12763430178165436, -0.05402010306715965, 0.04226148501038551, -0.08704917877912521, 0.1550145447254181, 0.041387442499399185, -0.2957608103752136, 0.04185236990451813, -0.047996312379837036, 0.03759245201945305, -0.05201224982738495, 0.2219116985797882, 0.08800795674324036, -0.04901951551437378, -0.09947378933429718, -0.24007278680801392, 0.16992902755737305, 0.20296256244182587, -0.10235918313264847, 0.06751643121242523, -0.18880227208137512, 0.049969401210546494, -0.03805741295218468, 0.07048654556274414, 0.011110842227935791, -0.03835855424404144, 0.022049259394407272, 0.07358511537313461, -0.0008412341121584177, 0.1489613950252533, -0.03275347128510475, -0.15098077058792114, 0.0923290029168129, 0.0058713871985673904, -0.2160254269838333, 0.012788910418748856, 0.2866777181625366, -0.007577773183584213, -0.09612693637609482, 0.06935203075408936, -0.2079334706068039, 0.055482909083366394, 0.20281098783016205, -0.0688953697681427, -0.04410160705447197, -0.05102243646979332, 0.0696943998336792, 0.058132752776145935, -0.15422730147838593, 0.07272615283727646, -0.10840483009815216, -0.08294206857681274, -0.12504613399505615, 0.15828949213027954, -0.03243668004870415, -0.022322703152894974, -0.115634985268116, 0.2424800992012024, 0.060571759939193726, 0.1007547676563263, 0.2431986778974533, -0.046299953013658524, -0.05283990502357483, 0.07504962384700775, 0.10892752557992935, 0.0074929129332304, 0.020188340917229652, -0.21221549808979034, -0.09781662374734879, 0.06307347118854523, -0.15651017427444458, -0.09700477123260498, 0.02423962578177452, -0.0553300566971302, 0.09261566400527954, -0.1414652317762375, 0.09405994415283203, 0.01613369956612587, 0.061498772352933884, -0.24161772429943085, 0.08418817818164825, 0.04509225860238075, 0.14908315241336823, 0.07457249611616135, -0.02087286114692688, -0.011773240752518177, -0.092066690325737, 0.31934309005737305, 0.0008668939117342234, 0.1306294947862625, -0.005959778092801571, -0.06737181544303894, -0.007979979738593102, -0.08785781264305115, 0.1129252091050148, 0.06639072299003601, -0.036501556634902954, 0.10971441119909286, 0.15065997838974, 0.19198456406593323, -0.047258976846933365, 0.07569855451583862, 0.12726065516471863, -0.03876936808228493, 0.13575102388858795, -0.045524969696998596, 0.092990443110466, -0.09018249064683914, -0.08222930878400803, 0.005946958903223276, -0.008964134380221367, -0.024837825447320938, 0.17717336118221283, 0.09381436556577682, -0.1017141044139862, 0.08192837238311768, -0.0069792792201042175, -0.19332662224769592, -0.18373414874076843, -0.0931391641497612, 0.009625057689845562, 0.08321855217218399, -0.01474839448928833, -0.021265381947159767, -0.0546162985265255, 0.05355355888605118, 0.14360782504081726, 0.07230252027511597, 0.17221221327781677, -0.08826281875371933, -0.01325986161828041, -0.0014542746357619762, 0.11616243422031403, -0.06157578155398369, 0.2669998109340668, -0.12542887032032013, -0.15887942910194397, -0.1762077957391739, -0.23331400752067566, 0.08755937963724136, -0.12505438923835754, -0.167854443192482, 0.07074777036905289, -0.11753660440444946, -0.010794924572110176, 0.017547983676195145, 0.059825628995895386, 0.1212158054113388, -0.22151286900043488, -0.04916002228856087, -0.13049514591693878, -0.03815371170639992, 0.022922193631529808, -0.006182762794196606, 0.11541379988193512, -0.15007473528385162, 0.007673997897654772, 0.03251880779862404, -0.0027778807561844587, -0.04013305529952049, 0.08538226038217545, 0.07292325794696808, 0.021703414618968964, 0.32803839445114136, 0.11972265690565109, -0.021090444177389145, -0.020415745675563812, 0.023561889305710793, -0.034829914569854736, 0.05011608824133873, 0.04397209733724594, 0.12608401477336884, 0.12314969301223755, 0.15286636352539062, -0.07480110228061676, -0.07933025807142258, -0.023483196273446083, -0.06330058723688126, 0.16966117918491364, 0.06507586687803268, 0.09885668009519577, -0.04633776471018791, -0.03107045218348503, 0.1616750955581665, -0.021999644115567207, 0.06593915820121765, -0.25980448722839355, 0.10328810662031174, -0.00033697253093123436, -0.09173375368118286, -0.0692141205072403, 0.12371315062046051, -0.0660998597741127, 0.09665719419717789, -0.11128094047307968, -0.03664547577500343, 0.045129988342523575, 0.05471593141555786, 0.07660280168056488, -0.010243785567581654, 0.05504331737756729, -0.012352230027318, -0.04488354176282883, -0.12898299098014832, -0.007317479699850082, -0.01507044117897749, 0.06508033722639084, 0.0020774714648723602, 0.08241018652915955, -0.00523186894133687, -0.09103109687566757, -0.15060602128505707, 0.0391170009970665, -0.03474912792444229, -0.1208033636212349, 0.08128131926059723, 0.17001725733280182, -0.00964860524982214, -0.009585650637745857, 0.020575281232595444, 0.04346730187535286, -0.10801835358142853, 0.07157708704471588, -0.05584416538476944, 0.060655377805233, -0.06117263063788414, 0.06239179149270058, 0.2116210162639618, 0.20731739699840546, 0.20631477236747742, 0.18202370405197144, 0.01789068430662155, 0.007358606904745102, -0.032926302403211594, 0.15268824994564056, -0.09146300703287125, 0.07526269555091858, 0.06283692270517349, 0.09223287552595139, -0.24460437893867493, -0.1537303924560547, 0.07608404010534286, 0.16138756275177002, -0.08496081084012985, -0.04922379180788994, 0.055933479219675064, -0.05144083872437477, -0.2642955183982849, -0.061269767582416534, 0.11973267793655396, -0.09945269674062729, -0.1007123813033104, -0.06007221341133118, -2.65043854067686e-32, 0.004222497344017029, 0.02237684838473797, -0.007111780811101198, 0.03630691021680832, 0.01794559694826603, 0.01685480587184429, -0.02480996958911419, -0.005494825541973114, -0.00875858310610056, -0.014235076494514942, -0.21026188135147095, 0.08158828318119049, 0.14208188652992249, -0.043299999088048935, 0.05547569319605827, -0.08163216710090637, 0.11608809232711792, -0.19628849625587463, -0.004078549332916737, 0.061928603798151016, 0.1186789870262146, 0.014638135209679604, 0.13322408497333527, 0.05432617664337158, -0.06116762012243271, -0.050717517733573914, -0.0750381126999855, -0.26142844557762146, -0.06515435874462128, -0.008609400130808353, -0.09646817296743393, 0.12681357562541962, 0.024243418127298355, -0.03779638186097145, -0.07329607009887695, -0.1425233781337738, -0.2215634435415268, 0.05215979367494583, 0.07216562330722809, -0.09946468472480774, -0.15184567868709564, 0.14087936282157898, 0.14968688786029816, 0.03321902081370354, -0.006448189727962017, -0.002236024010926485, -0.003452457720413804, -0.023824283853173256, -0.17220059037208557, -0.19958911836147308, 0.12476718425750732, -0.03161291405558586, 0.09274429827928543, 0.031896740198135376, -0.09389365464448929, -0.25210514664649963, 0.04827521741390228, 0.06898298859596252, -0.13148915767669678, 0.05917235463857651, 0.24515002965927124, -0.08736523240804672, 0.016169149428606033, -0.045359592884778976, -0.0004610107862390578, -0.08152033388614655, 0.20728443562984467, 0.10431566834449768, 0.20821860432624817, -0.030961526557803154, -0.06920779496431351, 0.13098788261413574, -0.20472893118858337, -0.04567849263548851, 0.03345967084169388, -0.06299073249101639, -0.17366281151771545, 0.01624484732747078, -0.0027492817025631666, 0.09968101978302002, -0.026652270928025246, -0.1535899043083191, 0.10334891825914383, -0.006937015801668167, -0.016387606039643288, -0.0853547751903534, 0.04898805171251297, -0.008197011426091194, -0.039057839661836624, -0.05251270905137062, -0.05262819677591324, 0.1638900488615036, -0.034296467900276184, -0.012647113762795925, 0.03319773077964783, 0.24908317625522614, -0.07963721454143524, 0.03593898564577103, -0.1609601378440857, -0.04870797321200371, 0.04949748516082764, -0.08680611848831177, 0.19536782801151276, -0.10173891484737396, 0.04620892181992531, 0.02492663823068142, 0.16443173587322235, -0.039196718484163284, -0.10541659593582153, -0.03371664881706238, -0.1686714142560959, 0.1700701117515564, 0.036363087594509125, 0.207026407122612, 0.15906663239002228, -0.05675497278571129, 0.043992914259433746, -0.1279703825712204, 0.052308980375528336, 0.2237345576286316, -0.08724123984575272, -0.004674322437494993, -0.14638715982437134, 0.013736710883677006, 0.013480700552463531, 0.11420777440071106, -0.2545510530471802, -0.1600145697593689, 0.13871783018112183, 0.05487643554806709, 0.01808100938796997, -0.0070495870895683765, 7.268827175721526e-7, -0.16743692755699158, 0.0273304246366024, -0.0018395062070339918, 0.1572040468454361, 0.07386630028486252, 0.08812426775693893, -0.04223918914794922, 0.18770340085029602, -0.018298177048563957, 0.05270587280392647, 0.1843668818473816, -0.0989469364285469, 0.009668559767305851, -0.02629060670733452, -0.008036252111196518, -0.14631186425685883, -0.26651206612586975, 0.04921753704547882, -0.06408661603927612, -0.01940266415476799, 0.07335076481103897, 0.08266696333885193, -0.04955112189054489, -0.13246336579322815, 0.06493215262889862, -0.0447319857776165, 0.023576321080327034, -0.04002995789051056, 0.007962783798575401, 0.03420416638255119, -0.0037437896244227886, -0.06650301069021225, 0.1476154327392578, 0.1526118516921997, -0.050420038402080536, -0.038360532373189926, -0.21372447907924652, -0.012071467936038971, -0.016134899109601974, -0.07992180436849594, 0.031159482896327972, 0.018129773437976837, 0.05341876670718193, -0.08217651396989822, 0.19218669831752777, 0.13529464602470398, -0.011586745269596577, -0.03854265809059143, -0.06886730343103409, 0.05013708397746086, -0.0524078868329525, 0.08072645217180252, 0.07375526428222656, 0.1654546707868576, -0.03200012445449829, -0.08330739289522171, 0.02003316953778267, -0.17686496675014496, 0.20611482858657837, -0.021779920905828476, -0.0839715227484703, -0.053331077098846436, 0.047837335616350174, -0.03792224079370499, -0.04892844706773758, 0.1297931671142578, -0.05939957872033119, 9.282086121213514e-38, -0.06218817085027695, 0.07804404199123383, -0.08301036059856415, -0.12415019422769547, -0.07544320821762085, -0.060187049210071564, -0.08397602289915085, 0.11343493312597275, -0.08068407326936722, -0.11837419867515564, -0.12460194528102875 ]
https://github.com/huggingface/datasets/issues/6270
Dataset.from_generator raises with sharded gen_args
That runs, and because my dataset is small, it's what I did to get past the problem. However, it does not produce a sharded dataset. From the doc string I expect there ought to be a way to call from_generator such that num_shards in the resulting data set is equal to the number of items in the list. The part of the doc string that your suggestion is not responsive to is: ` You can define a sharded dataset by passing the list of shards in *g en_kwargs*. ` What your suggestion does is calls the generator once, with the list argument, and produces a single shard dataset.
### Describe the bug According to the docs of Datasets.from_generator: ``` gen_kwargs(`dict`, *optional*): Keyword arguments to be passed to the `generator` callable. You can define a sharded dataset by passing the list of shards in `gen_kwargs`. ``` So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element. It doesn't work that way though. ### Steps to reproduce the bug ```python #!/usr/bin/python from pathlib import Path import datasets def process_yaml(file): yield dict(example=42) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ) ds.to_json('training.jsonl') ``` ``` Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File "/tmp/dataset_bug.py", line 13, in <module> ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator ).read() ^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read self.builder.download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare super()._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single generator = self._generate_examples(**gen_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ``` mapping, not list ### Expected behavior I would expect that process_yaml would be called once for each yaml file in the directory where the script is run. I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list. ### Environment info - `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0) - Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3
108
Dataset.from_generator raises with sharded gen_args ### Describe the bug According to the docs of Datasets.from_generator: ``` gen_kwargs(`dict`, *optional*): Keyword arguments to be passed to the `generator` callable. You can define a sharded dataset by passing the list of shards in `gen_kwargs`. ``` So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element. It doesn't work that way though. ### Steps to reproduce the bug ```python #!/usr/bin/python from pathlib import Path import datasets def process_yaml(file): yield dict(example=42) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ) ds.to_json('training.jsonl') ``` ``` Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File "/tmp/dataset_bug.py", line 13, in <module> ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator ).read() ^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read self.builder.download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare super()._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single generator = self._generate_examples(**gen_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ``` mapping, not list ### Expected behavior I would expect that process_yaml would be called once for each yaml file in the directory where the script is run. I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list. ### Environment info - `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0) - Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 That runs, and because my dataset is small, it's what I did to get past the problem. However, it does not produce a sharded dataset. From the doc string I expect there ought to be a way to call from_generator such that num_shards in the resulting data set is equal to the number of items in the list. The part of the doc string that your suggestion is not responsive to is: ` You can define a sharded dataset by passing the list of shards in *g en_kwargs*. ` What your suggestion does is calls the generator once, with the list argument, and produces a single shard dataset.
[ 0.10313498228788376, -0.004205336328595877, -0.04959315434098244, 0.11198350787162781, 0.2503035366535187, 0.11277437210083008, 0.10729693621397018, 0.027257123962044716, -0.06739849597215652, 0.16669291257858276, 0.09859459847211838, -0.07553824037313461, -0.04894908517599106, 0.02901710383594036, -0.020641455426812172, 0.044132329523563385, 0.05877521634101868, -0.028443243354558945, -0.006722837686538696, -0.09125570952892303, -0.21881398558616638, 0.07229812443256378, 0.10556191951036453, 0.031242458149790764, -0.022417288273572922, -0.18133628368377686, -0.11979396641254425, 0.2623496651649475, 0.0368354395031929, -0.012835637666285038, 0.0036758051719516516, -0.06834603101015091, -0.09703134000301361, 0.06385886669158936, 0.000005486469945026329, 0.12594643235206604, 0.30116334557533264, -0.039548490196466446, 0.0004133521288167685, -0.003941867034882307, 0.08651227504014969, -0.03327413275837898, 0.15086418390274048, -0.07212145626544952, -0.10114121437072754, -0.05896662548184395, -0.11148767918348312, 0.0458906851708889, 0.0967421606183052, -0.030728835612535477, -0.035163186490535736, -0.08800141513347626, 0.09008572995662689, -0.15698157250881195, 0.05923711135983467, -0.007308897562325001, 0.07911939173936844, -0.10990388691425323, -0.35164445638656616, -0.0791551023721695, 0.08646424114704132, -0.10097146034240723, -0.0068420907482504845, 0.0327516570687294, -0.04384410008788109, 0.04456170275807381, -0.2359626740217209, -0.13205035030841827, 0.06098748371005058, 0.05156952142715454, -0.21917201578617096, -0.02523070201277733, -0.07844214886426926, -0.010352697223424911, -0.028321510180830956, -0.0707145482301712, -0.03190188482403755, 0.16704389452934265, -0.09356268495321274, 0.11132439225912094, 0.09724341332912445, 0.022192737087607384, -0.06427231431007385, -0.027787504717707634, -0.1726253181695938, -0.024048645049333572, -0.036399658769369125, 0.17960932850837708, -0.11218027770519257, 0.0013673981884494424, -0.10627097636461258, -0.0148343276232481, -0.17328450083732605, -0.1156499832868576, -0.10337597876787186, 0.09823025017976761, -0.03747973591089249, -0.10094320774078369, 0.04298669099807739, -0.14496351778507233, -0.09733723849058151, -0.08042463660240173, 0.10087571293115616, 0.02693248726427555, 0.11258874088525772, -0.12429700046777725, 0.056918855756521225, -0.001704930909909308, -0.08226744830608368, 0.07359475642442703, -0.08772211521863937, 0.07005433738231659, -0.1177714392542839, -0.10486633330583572, 0.17687676846981049, 0.05383818596601486, 0.05699289217591286, 0.0993896871805191, 0.044634200632572174, 0.2489950954914093, -0.07094461470842361, 0.13082365691661835, -0.02836271934211254, 0.12927252054214478, 0.05765687674283981, -0.008276493288576603, -0.04827253893017769, 0.01571107842028141, -0.0006485909689217806, -0.12350476533174515, -0.08284400403499603, -0.1747051477432251, 0.02566213719546795, 0.05217883363366127, -0.03191737085580826, 0.04275473207235336, -0.035252735018730164, -0.038509853184223175, -0.025131240487098694, -0.21412178874015808, 0.14364729821681976, -0.02486654557287693, 0.10768456757068634, 0.0515265017747879, 0.10138704627752304, 0.12105430662631989, 0.11941143870353699, -0.03439069166779518, 0.03952028974890709, 0.0246413666754961, -0.3334151804447174, 0.06925883889198303, -0.10171802341938019, 0.1529429852962494, -0.017855288460850716, 0.13698770105838776, 0.06905709952116013, -0.007664893753826618, -0.14848467707633972, -0.024285778403282166, 0.06682959944009781, -0.028774317353963852, 0.0003827578038908541, -0.17273543775081635, 0.012630869634449482, 0.14559490978717804, 0.08862415701150894, 0.025789327919483185, -0.10329120606184006, -0.1256362944841385, 0.16930171847343445, -0.07399310916662216, -0.09538917988538742, -0.21443264186382294, -0.04512818530201912, 0.2176124006509781, -0.18824848532676697, 0.07631143927574158, -0.2497529834508896, -0.032853446900844574, 0.03527657687664032, 0.03777249902486801, 0.1084265187382698, -0.19869118928909302, 0.08067822456359863, -0.16831688582897186, -0.08254522830247879, 0.014665487222373486, -0.1026807352900505, -0.1621708869934082, -0.10164803266525269, 0.13407915830612183, -0.1709490716457367, 0.05569912865757942, 0.032196950167417526, 0.03470882400870323, -0.0038311106618493795, 0.03538765385746956, 0.09113990515470505, -0.161671981215477, -0.01996605470776558, 0.0005281682242639363, 0.17308072745800018, -0.004679511301219463, 0.10171673446893692, 0.1128140538930893, -0.19995161890983582, 0.13058386743068695, -0.14332520961761475, -0.15629464387893677, -0.19393524527549744, -0.0206880122423172, 0.015756186097860336, 0.1585792899131775, -0.2621559202671051, -0.052504513412714005, -0.06525138020515442, 0.018466636538505554, -0.15346777439117432, 0.041215814650058746, -0.04342637583613396, 0.10630615055561066, -0.06747809052467346, 0.020665960386395454, 0.03507746383547783, 0.03605390712618828, 0.003285012673586607, -0.1348775178194046, 0.01819157414138317, -0.041810423135757446, -0.1039801687002182, -0.030954210087656975, 0.1890823096036911, 0.13322865962982178, 0.00669214129447937, -0.018763087689876556, -0.0084577277302742, -0.1853744387626648, 0.020474886521697044, 0.035085707902908325, -0.004628922790288925, 0.00017581415886525065, -0.11760241538286209, -0.04558223858475685, 0.09415913373231888, 0.10215817391872406, -0.03192666545510292, 0.2202172428369522, -0.086898572742939, 0.07883994281291962, 0.11090107262134552, 0.11713425815105438, -0.03380197659134865, 0.002452124608680606, -0.0565643347799778, -0.11068340390920639, 0.17715758085250854, 0.1850028783082962, -0.06338325887918472, -0.06407839804887772, 0.339718759059906, -0.07432243973016739, -0.12580257654190063, -0.022102639079093933, 0.020170772448182106, -0.12464325875043869, 0.048888787627220154, 0.16876424849033356, -0.07303036004304886, 0.02695922739803791, 0.17030788958072662, -0.06267896294593811, -0.1218862384557724, -0.09149034321308136, -0.007080978713929653, -0.09790991246700287, 0.02021469548344612, 0.08117597550153732, 0.1622851938009262, -0.00013690779451280832, -0.09182554483413696, 0.13948607444763184, 0.15664587914943695, -0.10754282027482986, 0.11942706257104874, 0.2394101768732071, -0.08426810801029205, 0.3338295817375183, -0.10431651771068573, 0.08599763363599777, -0.12356314063072205, -0.07571865618228912, -0.0975833535194397, -0.1374174803495407, 0.07339659333229065, -0.026901409029960632, 0.13965663313865662, -0.08038265258073807, 0.08963499963283539, -0.13643380999565125, -0.043306369334459305, 0.055773936212062836, 0.12763430178165436, -0.05402010306715965, 0.04226148501038551, -0.08704917877912521, 0.1550145447254181, 0.041387442499399185, -0.2957608103752136, 0.04185236990451813, -0.047996312379837036, 0.03759245201945305, -0.05201224982738495, 0.2219116985797882, 0.08800795674324036, -0.04901951551437378, -0.09947378933429718, -0.24007278680801392, 0.16992902755737305, 0.20296256244182587, -0.10235918313264847, 0.06751643121242523, -0.18880227208137512, 0.049969401210546494, -0.03805741295218468, 0.07048654556274414, 0.011110842227935791, -0.03835855424404144, 0.022049259394407272, 0.07358511537313461, -0.0008412341121584177, 0.1489613950252533, -0.03275347128510475, -0.15098077058792114, 0.0923290029168129, 0.0058713871985673904, -0.2160254269838333, 0.012788910418748856, 0.2866777181625366, -0.007577773183584213, -0.09612693637609482, 0.06935203075408936, -0.2079334706068039, 0.055482909083366394, 0.20281098783016205, -0.0688953697681427, -0.04410160705447197, -0.05102243646979332, 0.0696943998336792, 0.058132752776145935, -0.15422730147838593, 0.07272615283727646, -0.10840483009815216, -0.08294206857681274, -0.12504613399505615, 0.15828949213027954, -0.03243668004870415, -0.022322703152894974, -0.115634985268116, 0.2424800992012024, 0.060571759939193726, 0.1007547676563263, 0.2431986778974533, -0.046299953013658524, -0.05283990502357483, 0.07504962384700775, 0.10892752557992935, 0.0074929129332304, 0.020188340917229652, -0.21221549808979034, -0.09781662374734879, 0.06307347118854523, -0.15651017427444458, -0.09700477123260498, 0.02423962578177452, -0.0553300566971302, 0.09261566400527954, -0.1414652317762375, 0.09405994415283203, 0.01613369956612587, 0.061498772352933884, -0.24161772429943085, 0.08418817818164825, 0.04509225860238075, 0.14908315241336823, 0.07457249611616135, -0.02087286114692688, -0.011773240752518177, -0.092066690325737, 0.31934309005737305, 0.0008668939117342234, 0.1306294947862625, -0.005959778092801571, -0.06737181544303894, -0.007979979738593102, -0.08785781264305115, 0.1129252091050148, 0.06639072299003601, -0.036501556634902954, 0.10971441119909286, 0.15065997838974, 0.19198456406593323, -0.047258976846933365, 0.07569855451583862, 0.12726065516471863, -0.03876936808228493, 0.13575102388858795, -0.045524969696998596, 0.092990443110466, -0.09018249064683914, -0.08222930878400803, 0.005946958903223276, -0.008964134380221367, -0.024837825447320938, 0.17717336118221283, 0.09381436556577682, -0.1017141044139862, 0.08192837238311768, -0.0069792792201042175, -0.19332662224769592, -0.18373414874076843, -0.0931391641497612, 0.009625057689845562, 0.08321855217218399, -0.01474839448928833, -0.021265381947159767, -0.0546162985265255, 0.05355355888605118, 0.14360782504081726, 0.07230252027511597, 0.17221221327781677, -0.08826281875371933, -0.01325986161828041, -0.0014542746357619762, 0.11616243422031403, -0.06157578155398369, 0.2669998109340668, -0.12542887032032013, -0.15887942910194397, -0.1762077957391739, -0.23331400752067566, 0.08755937963724136, -0.12505438923835754, -0.167854443192482, 0.07074777036905289, -0.11753660440444946, -0.010794924572110176, 0.017547983676195145, 0.059825628995895386, 0.1212158054113388, -0.22151286900043488, -0.04916002228856087, -0.13049514591693878, -0.03815371170639992, 0.022922193631529808, -0.006182762794196606, 0.11541379988193512, -0.15007473528385162, 0.007673997897654772, 0.03251880779862404, -0.0027778807561844587, -0.04013305529952049, 0.08538226038217545, 0.07292325794696808, 0.021703414618968964, 0.32803839445114136, 0.11972265690565109, -0.021090444177389145, -0.020415745675563812, 0.023561889305710793, -0.034829914569854736, 0.05011608824133873, 0.04397209733724594, 0.12608401477336884, 0.12314969301223755, 0.15286636352539062, -0.07480110228061676, -0.07933025807142258, -0.023483196273446083, -0.06330058723688126, 0.16966117918491364, 0.06507586687803268, 0.09885668009519577, -0.04633776471018791, -0.03107045218348503, 0.1616750955581665, -0.021999644115567207, 0.06593915820121765, -0.25980448722839355, 0.10328810662031174, -0.00033697253093123436, -0.09173375368118286, -0.0692141205072403, 0.12371315062046051, -0.0660998597741127, 0.09665719419717789, -0.11128094047307968, -0.03664547577500343, 0.045129988342523575, 0.05471593141555786, 0.07660280168056488, -0.010243785567581654, 0.05504331737756729, -0.012352230027318, -0.04488354176282883, -0.12898299098014832, -0.007317479699850082, -0.01507044117897749, 0.06508033722639084, 0.0020774714648723602, 0.08241018652915955, -0.00523186894133687, -0.09103109687566757, -0.15060602128505707, 0.0391170009970665, -0.03474912792444229, -0.1208033636212349, 0.08128131926059723, 0.17001725733280182, -0.00964860524982214, -0.009585650637745857, 0.020575281232595444, 0.04346730187535286, -0.10801835358142853, 0.07157708704471588, -0.05584416538476944, 0.060655377805233, -0.06117263063788414, 0.06239179149270058, 0.2116210162639618, 0.20731739699840546, 0.20631477236747742, 0.18202370405197144, 0.01789068430662155, 0.007358606904745102, -0.032926302403211594, 0.15268824994564056, -0.09146300703287125, 0.07526269555091858, 0.06283692270517349, 0.09223287552595139, -0.24460437893867493, -0.1537303924560547, 0.07608404010534286, 0.16138756275177002, -0.08496081084012985, -0.04922379180788994, 0.055933479219675064, -0.05144083872437477, -0.2642955183982849, -0.061269767582416534, 0.11973267793655396, -0.09945269674062729, -0.1007123813033104, -0.06007221341133118, -2.65043854067686e-32, 0.004222497344017029, 0.02237684838473797, -0.007111780811101198, 0.03630691021680832, 0.01794559694826603, 0.01685480587184429, -0.02480996958911419, -0.005494825541973114, -0.00875858310610056, -0.014235076494514942, -0.21026188135147095, 0.08158828318119049, 0.14208188652992249, -0.043299999088048935, 0.05547569319605827, -0.08163216710090637, 0.11608809232711792, -0.19628849625587463, -0.004078549332916737, 0.061928603798151016, 0.1186789870262146, 0.014638135209679604, 0.13322408497333527, 0.05432617664337158, -0.06116762012243271, -0.050717517733573914, -0.0750381126999855, -0.26142844557762146, -0.06515435874462128, -0.008609400130808353, -0.09646817296743393, 0.12681357562541962, 0.024243418127298355, -0.03779638186097145, -0.07329607009887695, -0.1425233781337738, -0.2215634435415268, 0.05215979367494583, 0.07216562330722809, -0.09946468472480774, -0.15184567868709564, 0.14087936282157898, 0.14968688786029816, 0.03321902081370354, -0.006448189727962017, -0.002236024010926485, -0.003452457720413804, -0.023824283853173256, -0.17220059037208557, -0.19958911836147308, 0.12476718425750732, -0.03161291405558586, 0.09274429827928543, 0.031896740198135376, -0.09389365464448929, -0.25210514664649963, 0.04827521741390228, 0.06898298859596252, -0.13148915767669678, 0.05917235463857651, 0.24515002965927124, -0.08736523240804672, 0.016169149428606033, -0.045359592884778976, -0.0004610107862390578, -0.08152033388614655, 0.20728443562984467, 0.10431566834449768, 0.20821860432624817, -0.030961526557803154, -0.06920779496431351, 0.13098788261413574, -0.20472893118858337, -0.04567849263548851, 0.03345967084169388, -0.06299073249101639, -0.17366281151771545, 0.01624484732747078, -0.0027492817025631666, 0.09968101978302002, -0.026652270928025246, -0.1535899043083191, 0.10334891825914383, -0.006937015801668167, -0.016387606039643288, -0.0853547751903534, 0.04898805171251297, -0.008197011426091194, -0.039057839661836624, -0.05251270905137062, -0.05262819677591324, 0.1638900488615036, -0.034296467900276184, -0.012647113762795925, 0.03319773077964783, 0.24908317625522614, -0.07963721454143524, 0.03593898564577103, -0.1609601378440857, -0.04870797321200371, 0.04949748516082764, -0.08680611848831177, 0.19536782801151276, -0.10173891484737396, 0.04620892181992531, 0.02492663823068142, 0.16443173587322235, -0.039196718484163284, -0.10541659593582153, -0.03371664881706238, -0.1686714142560959, 0.1700701117515564, 0.036363087594509125, 0.207026407122612, 0.15906663239002228, -0.05675497278571129, 0.043992914259433746, -0.1279703825712204, 0.052308980375528336, 0.2237345576286316, -0.08724123984575272, -0.004674322437494993, -0.14638715982437134, 0.013736710883677006, 0.013480700552463531, 0.11420777440071106, -0.2545510530471802, -0.1600145697593689, 0.13871783018112183, 0.05487643554806709, 0.01808100938796997, -0.0070495870895683765, 7.268827175721526e-7, -0.16743692755699158, 0.0273304246366024, -0.0018395062070339918, 0.1572040468454361, 0.07386630028486252, 0.08812426775693893, -0.04223918914794922, 0.18770340085029602, -0.018298177048563957, 0.05270587280392647, 0.1843668818473816, -0.0989469364285469, 0.009668559767305851, -0.02629060670733452, -0.008036252111196518, -0.14631186425685883, -0.26651206612586975, 0.04921753704547882, -0.06408661603927612, -0.01940266415476799, 0.07335076481103897, 0.08266696333885193, -0.04955112189054489, -0.13246336579322815, 0.06493215262889862, -0.0447319857776165, 0.023576321080327034, -0.04002995789051056, 0.007962783798575401, 0.03420416638255119, -0.0037437896244227886, -0.06650301069021225, 0.1476154327392578, 0.1526118516921997, -0.050420038402080536, -0.038360532373189926, -0.21372447907924652, -0.012071467936038971, -0.016134899109601974, -0.07992180436849594, 0.031159482896327972, 0.018129773437976837, 0.05341876670718193, -0.08217651396989822, 0.19218669831752777, 0.13529464602470398, -0.011586745269596577, -0.03854265809059143, -0.06886730343103409, 0.05013708397746086, -0.0524078868329525, 0.08072645217180252, 0.07375526428222656, 0.1654546707868576, -0.03200012445449829, -0.08330739289522171, 0.02003316953778267, -0.17686496675014496, 0.20611482858657837, -0.021779920905828476, -0.0839715227484703, -0.053331077098846436, 0.047837335616350174, -0.03792224079370499, -0.04892844706773758, 0.1297931671142578, -0.05939957872033119, 9.282086121213514e-38, -0.06218817085027695, 0.07804404199123383, -0.08301036059856415, -0.12415019422769547, -0.07544320821762085, -0.060187049210071564, -0.08397602289915085, 0.11343493312597275, -0.08068407326936722, -0.11837419867515564, -0.12460194528102875 ]
https://github.com/huggingface/datasets/issues/6270
Dataset.from_generator raises with sharded gen_args
The sharding mentioned here refers to using this function with `num_proc` (multiprocessing splits the `kwargs` into shards and passes them to the generator function) > That runs, and because my dataset is small, it's what I did to get past the problem. `from_generator` generates a memory-mapped dataset (can be larger than RAM), so the dataset size should not be an issue unless the generator function's implementation does not properly free the memory.
### Describe the bug According to the docs of Datasets.from_generator: ``` gen_kwargs(`dict`, *optional*): Keyword arguments to be passed to the `generator` callable. You can define a sharded dataset by passing the list of shards in `gen_kwargs`. ``` So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element. It doesn't work that way though. ### Steps to reproduce the bug ```python #!/usr/bin/python from pathlib import Path import datasets def process_yaml(file): yield dict(example=42) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ) ds.to_json('training.jsonl') ``` ``` Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File "/tmp/dataset_bug.py", line 13, in <module> ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator ).read() ^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read self.builder.download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare super()._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single generator = self._generate_examples(**gen_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ``` mapping, not list ### Expected behavior I would expect that process_yaml would be called once for each yaml file in the directory where the script is run. I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list. ### Environment info - `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0) - Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3
72
Dataset.from_generator raises with sharded gen_args ### Describe the bug According to the docs of Datasets.from_generator: ``` gen_kwargs(`dict`, *optional*): Keyword arguments to be passed to the `generator` callable. You can define a sharded dataset by passing the list of shards in `gen_kwargs`. ``` So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element. It doesn't work that way though. ### Steps to reproduce the bug ```python #!/usr/bin/python from pathlib import Path import datasets def process_yaml(file): yield dict(example=42) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ) ds.to_json('training.jsonl') ``` ``` Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File "/tmp/dataset_bug.py", line 13, in <module> ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator ).read() ^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read self.builder.download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare super()._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single generator = self._generate_examples(**gen_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ``` mapping, not list ### Expected behavior I would expect that process_yaml would be called once for each yaml file in the directory where the script is run. I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list. ### Environment info - `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0) - Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 The sharding mentioned here refers to using this function with `num_proc` (multiprocessing splits the `kwargs` into shards and passes them to the generator function) > That runs, and because my dataset is small, it's what I did to get past the problem. `from_generator` generates a memory-mapped dataset (can be larger than RAM), so the dataset size should not be an issue unless the generator function's implementation does not properly free the memory.
[ 0.10313498228788376, -0.004205336328595877, -0.04959315434098244, 0.11198350787162781, 0.2503035366535187, 0.11277437210083008, 0.10729693621397018, 0.027257123962044716, -0.06739849597215652, 0.16669291257858276, 0.09859459847211838, -0.07553824037313461, -0.04894908517599106, 0.02901710383594036, -0.020641455426812172, 0.044132329523563385, 0.05877521634101868, -0.028443243354558945, -0.006722837686538696, -0.09125570952892303, -0.21881398558616638, 0.07229812443256378, 0.10556191951036453, 0.031242458149790764, -0.022417288273572922, -0.18133628368377686, -0.11979396641254425, 0.2623496651649475, 0.0368354395031929, -0.012835637666285038, 0.0036758051719516516, -0.06834603101015091, -0.09703134000301361, 0.06385886669158936, 0.000005486469945026329, 0.12594643235206604, 0.30116334557533264, -0.039548490196466446, 0.0004133521288167685, -0.003941867034882307, 0.08651227504014969, -0.03327413275837898, 0.15086418390274048, -0.07212145626544952, -0.10114121437072754, -0.05896662548184395, -0.11148767918348312, 0.0458906851708889, 0.0967421606183052, -0.030728835612535477, -0.035163186490535736, -0.08800141513347626, 0.09008572995662689, -0.15698157250881195, 0.05923711135983467, -0.007308897562325001, 0.07911939173936844, -0.10990388691425323, -0.35164445638656616, -0.0791551023721695, 0.08646424114704132, -0.10097146034240723, -0.0068420907482504845, 0.0327516570687294, -0.04384410008788109, 0.04456170275807381, -0.2359626740217209, -0.13205035030841827, 0.06098748371005058, 0.05156952142715454, -0.21917201578617096, -0.02523070201277733, -0.07844214886426926, -0.010352697223424911, -0.028321510180830956, -0.0707145482301712, -0.03190188482403755, 0.16704389452934265, -0.09356268495321274, 0.11132439225912094, 0.09724341332912445, 0.022192737087607384, -0.06427231431007385, -0.027787504717707634, -0.1726253181695938, -0.024048645049333572, -0.036399658769369125, 0.17960932850837708, -0.11218027770519257, 0.0013673981884494424, -0.10627097636461258, -0.0148343276232481, -0.17328450083732605, -0.1156499832868576, -0.10337597876787186, 0.09823025017976761, -0.03747973591089249, -0.10094320774078369, 0.04298669099807739, -0.14496351778507233, -0.09733723849058151, -0.08042463660240173, 0.10087571293115616, 0.02693248726427555, 0.11258874088525772, -0.12429700046777725, 0.056918855756521225, -0.001704930909909308, -0.08226744830608368, 0.07359475642442703, -0.08772211521863937, 0.07005433738231659, -0.1177714392542839, -0.10486633330583572, 0.17687676846981049, 0.05383818596601486, 0.05699289217591286, 0.0993896871805191, 0.044634200632572174, 0.2489950954914093, -0.07094461470842361, 0.13082365691661835, -0.02836271934211254, 0.12927252054214478, 0.05765687674283981, -0.008276493288576603, -0.04827253893017769, 0.01571107842028141, -0.0006485909689217806, -0.12350476533174515, -0.08284400403499603, -0.1747051477432251, 0.02566213719546795, 0.05217883363366127, -0.03191737085580826, 0.04275473207235336, -0.035252735018730164, -0.038509853184223175, -0.025131240487098694, -0.21412178874015808, 0.14364729821681976, -0.02486654557287693, 0.10768456757068634, 0.0515265017747879, 0.10138704627752304, 0.12105430662631989, 0.11941143870353699, -0.03439069166779518, 0.03952028974890709, 0.0246413666754961, -0.3334151804447174, 0.06925883889198303, -0.10171802341938019, 0.1529429852962494, -0.017855288460850716, 0.13698770105838776, 0.06905709952116013, -0.007664893753826618, -0.14848467707633972, -0.024285778403282166, 0.06682959944009781, -0.028774317353963852, 0.0003827578038908541, -0.17273543775081635, 0.012630869634449482, 0.14559490978717804, 0.08862415701150894, 0.025789327919483185, -0.10329120606184006, -0.1256362944841385, 0.16930171847343445, -0.07399310916662216, -0.09538917988538742, -0.21443264186382294, -0.04512818530201912, 0.2176124006509781, -0.18824848532676697, 0.07631143927574158, -0.2497529834508896, -0.032853446900844574, 0.03527657687664032, 0.03777249902486801, 0.1084265187382698, -0.19869118928909302, 0.08067822456359863, -0.16831688582897186, -0.08254522830247879, 0.014665487222373486, -0.1026807352900505, -0.1621708869934082, -0.10164803266525269, 0.13407915830612183, -0.1709490716457367, 0.05569912865757942, 0.032196950167417526, 0.03470882400870323, -0.0038311106618493795, 0.03538765385746956, 0.09113990515470505, -0.161671981215477, -0.01996605470776558, 0.0005281682242639363, 0.17308072745800018, -0.004679511301219463, 0.10171673446893692, 0.1128140538930893, -0.19995161890983582, 0.13058386743068695, -0.14332520961761475, -0.15629464387893677, -0.19393524527549744, -0.0206880122423172, 0.015756186097860336, 0.1585792899131775, -0.2621559202671051, -0.052504513412714005, -0.06525138020515442, 0.018466636538505554, -0.15346777439117432, 0.041215814650058746, -0.04342637583613396, 0.10630615055561066, -0.06747809052467346, 0.020665960386395454, 0.03507746383547783, 0.03605390712618828, 0.003285012673586607, -0.1348775178194046, 0.01819157414138317, -0.041810423135757446, -0.1039801687002182, -0.030954210087656975, 0.1890823096036911, 0.13322865962982178, 0.00669214129447937, -0.018763087689876556, -0.0084577277302742, -0.1853744387626648, 0.020474886521697044, 0.035085707902908325, -0.004628922790288925, 0.00017581415886525065, -0.11760241538286209, -0.04558223858475685, 0.09415913373231888, 0.10215817391872406, -0.03192666545510292, 0.2202172428369522, -0.086898572742939, 0.07883994281291962, 0.11090107262134552, 0.11713425815105438, -0.03380197659134865, 0.002452124608680606, -0.0565643347799778, -0.11068340390920639, 0.17715758085250854, 0.1850028783082962, -0.06338325887918472, -0.06407839804887772, 0.339718759059906, -0.07432243973016739, -0.12580257654190063, -0.022102639079093933, 0.020170772448182106, -0.12464325875043869, 0.048888787627220154, 0.16876424849033356, -0.07303036004304886, 0.02695922739803791, 0.17030788958072662, -0.06267896294593811, -0.1218862384557724, -0.09149034321308136, -0.007080978713929653, -0.09790991246700287, 0.02021469548344612, 0.08117597550153732, 0.1622851938009262, -0.00013690779451280832, -0.09182554483413696, 0.13948607444763184, 0.15664587914943695, -0.10754282027482986, 0.11942706257104874, 0.2394101768732071, -0.08426810801029205, 0.3338295817375183, -0.10431651771068573, 0.08599763363599777, -0.12356314063072205, -0.07571865618228912, -0.0975833535194397, -0.1374174803495407, 0.07339659333229065, -0.026901409029960632, 0.13965663313865662, -0.08038265258073807, 0.08963499963283539, -0.13643380999565125, -0.043306369334459305, 0.055773936212062836, 0.12763430178165436, -0.05402010306715965, 0.04226148501038551, -0.08704917877912521, 0.1550145447254181, 0.041387442499399185, -0.2957608103752136, 0.04185236990451813, -0.047996312379837036, 0.03759245201945305, -0.05201224982738495, 0.2219116985797882, 0.08800795674324036, -0.04901951551437378, -0.09947378933429718, -0.24007278680801392, 0.16992902755737305, 0.20296256244182587, -0.10235918313264847, 0.06751643121242523, -0.18880227208137512, 0.049969401210546494, -0.03805741295218468, 0.07048654556274414, 0.011110842227935791, -0.03835855424404144, 0.022049259394407272, 0.07358511537313461, -0.0008412341121584177, 0.1489613950252533, -0.03275347128510475, -0.15098077058792114, 0.0923290029168129, 0.0058713871985673904, -0.2160254269838333, 0.012788910418748856, 0.2866777181625366, -0.007577773183584213, -0.09612693637609482, 0.06935203075408936, -0.2079334706068039, 0.055482909083366394, 0.20281098783016205, -0.0688953697681427, -0.04410160705447197, -0.05102243646979332, 0.0696943998336792, 0.058132752776145935, -0.15422730147838593, 0.07272615283727646, -0.10840483009815216, -0.08294206857681274, -0.12504613399505615, 0.15828949213027954, -0.03243668004870415, -0.022322703152894974, -0.115634985268116, 0.2424800992012024, 0.060571759939193726, 0.1007547676563263, 0.2431986778974533, -0.046299953013658524, -0.05283990502357483, 0.07504962384700775, 0.10892752557992935, 0.0074929129332304, 0.020188340917229652, -0.21221549808979034, -0.09781662374734879, 0.06307347118854523, -0.15651017427444458, -0.09700477123260498, 0.02423962578177452, -0.0553300566971302, 0.09261566400527954, -0.1414652317762375, 0.09405994415283203, 0.01613369956612587, 0.061498772352933884, -0.24161772429943085, 0.08418817818164825, 0.04509225860238075, 0.14908315241336823, 0.07457249611616135, -0.02087286114692688, -0.011773240752518177, -0.092066690325737, 0.31934309005737305, 0.0008668939117342234, 0.1306294947862625, -0.005959778092801571, -0.06737181544303894, -0.007979979738593102, -0.08785781264305115, 0.1129252091050148, 0.06639072299003601, -0.036501556634902954, 0.10971441119909286, 0.15065997838974, 0.19198456406593323, -0.047258976846933365, 0.07569855451583862, 0.12726065516471863, -0.03876936808228493, 0.13575102388858795, -0.045524969696998596, 0.092990443110466, -0.09018249064683914, -0.08222930878400803, 0.005946958903223276, -0.008964134380221367, -0.024837825447320938, 0.17717336118221283, 0.09381436556577682, -0.1017141044139862, 0.08192837238311768, -0.0069792792201042175, -0.19332662224769592, -0.18373414874076843, -0.0931391641497612, 0.009625057689845562, 0.08321855217218399, -0.01474839448928833, -0.021265381947159767, -0.0546162985265255, 0.05355355888605118, 0.14360782504081726, 0.07230252027511597, 0.17221221327781677, -0.08826281875371933, -0.01325986161828041, -0.0014542746357619762, 0.11616243422031403, -0.06157578155398369, 0.2669998109340668, -0.12542887032032013, -0.15887942910194397, -0.1762077957391739, -0.23331400752067566, 0.08755937963724136, -0.12505438923835754, -0.167854443192482, 0.07074777036905289, -0.11753660440444946, -0.010794924572110176, 0.017547983676195145, 0.059825628995895386, 0.1212158054113388, -0.22151286900043488, -0.04916002228856087, -0.13049514591693878, -0.03815371170639992, 0.022922193631529808, -0.006182762794196606, 0.11541379988193512, -0.15007473528385162, 0.007673997897654772, 0.03251880779862404, -0.0027778807561844587, -0.04013305529952049, 0.08538226038217545, 0.07292325794696808, 0.021703414618968964, 0.32803839445114136, 0.11972265690565109, -0.021090444177389145, -0.020415745675563812, 0.023561889305710793, -0.034829914569854736, 0.05011608824133873, 0.04397209733724594, 0.12608401477336884, 0.12314969301223755, 0.15286636352539062, -0.07480110228061676, -0.07933025807142258, -0.023483196273446083, -0.06330058723688126, 0.16966117918491364, 0.06507586687803268, 0.09885668009519577, -0.04633776471018791, -0.03107045218348503, 0.1616750955581665, -0.021999644115567207, 0.06593915820121765, -0.25980448722839355, 0.10328810662031174, -0.00033697253093123436, -0.09173375368118286, -0.0692141205072403, 0.12371315062046051, -0.0660998597741127, 0.09665719419717789, -0.11128094047307968, -0.03664547577500343, 0.045129988342523575, 0.05471593141555786, 0.07660280168056488, -0.010243785567581654, 0.05504331737756729, -0.012352230027318, -0.04488354176282883, -0.12898299098014832, -0.007317479699850082, -0.01507044117897749, 0.06508033722639084, 0.0020774714648723602, 0.08241018652915955, -0.00523186894133687, -0.09103109687566757, -0.15060602128505707, 0.0391170009970665, -0.03474912792444229, -0.1208033636212349, 0.08128131926059723, 0.17001725733280182, -0.00964860524982214, -0.009585650637745857, 0.020575281232595444, 0.04346730187535286, -0.10801835358142853, 0.07157708704471588, -0.05584416538476944, 0.060655377805233, -0.06117263063788414, 0.06239179149270058, 0.2116210162639618, 0.20731739699840546, 0.20631477236747742, 0.18202370405197144, 0.01789068430662155, 0.007358606904745102, -0.032926302403211594, 0.15268824994564056, -0.09146300703287125, 0.07526269555091858, 0.06283692270517349, 0.09223287552595139, -0.24460437893867493, -0.1537303924560547, 0.07608404010534286, 0.16138756275177002, -0.08496081084012985, -0.04922379180788994, 0.055933479219675064, -0.05144083872437477, -0.2642955183982849, -0.061269767582416534, 0.11973267793655396, -0.09945269674062729, -0.1007123813033104, -0.06007221341133118, -2.65043854067686e-32, 0.004222497344017029, 0.02237684838473797, -0.007111780811101198, 0.03630691021680832, 0.01794559694826603, 0.01685480587184429, -0.02480996958911419, -0.005494825541973114, -0.00875858310610056, -0.014235076494514942, -0.21026188135147095, 0.08158828318119049, 0.14208188652992249, -0.043299999088048935, 0.05547569319605827, -0.08163216710090637, 0.11608809232711792, -0.19628849625587463, -0.004078549332916737, 0.061928603798151016, 0.1186789870262146, 0.014638135209679604, 0.13322408497333527, 0.05432617664337158, -0.06116762012243271, -0.050717517733573914, -0.0750381126999855, -0.26142844557762146, -0.06515435874462128, -0.008609400130808353, -0.09646817296743393, 0.12681357562541962, 0.024243418127298355, -0.03779638186097145, -0.07329607009887695, -0.1425233781337738, -0.2215634435415268, 0.05215979367494583, 0.07216562330722809, -0.09946468472480774, -0.15184567868709564, 0.14087936282157898, 0.14968688786029816, 0.03321902081370354, -0.006448189727962017, -0.002236024010926485, -0.003452457720413804, -0.023824283853173256, -0.17220059037208557, -0.19958911836147308, 0.12476718425750732, -0.03161291405558586, 0.09274429827928543, 0.031896740198135376, -0.09389365464448929, -0.25210514664649963, 0.04827521741390228, 0.06898298859596252, -0.13148915767669678, 0.05917235463857651, 0.24515002965927124, -0.08736523240804672, 0.016169149428606033, -0.045359592884778976, -0.0004610107862390578, -0.08152033388614655, 0.20728443562984467, 0.10431566834449768, 0.20821860432624817, -0.030961526557803154, -0.06920779496431351, 0.13098788261413574, -0.20472893118858337, -0.04567849263548851, 0.03345967084169388, -0.06299073249101639, -0.17366281151771545, 0.01624484732747078, -0.0027492817025631666, 0.09968101978302002, -0.026652270928025246, -0.1535899043083191, 0.10334891825914383, -0.006937015801668167, -0.016387606039643288, -0.0853547751903534, 0.04898805171251297, -0.008197011426091194, -0.039057839661836624, -0.05251270905137062, -0.05262819677591324, 0.1638900488615036, -0.034296467900276184, -0.012647113762795925, 0.03319773077964783, 0.24908317625522614, -0.07963721454143524, 0.03593898564577103, -0.1609601378440857, -0.04870797321200371, 0.04949748516082764, -0.08680611848831177, 0.19536782801151276, -0.10173891484737396, 0.04620892181992531, 0.02492663823068142, 0.16443173587322235, -0.039196718484163284, -0.10541659593582153, -0.03371664881706238, -0.1686714142560959, 0.1700701117515564, 0.036363087594509125, 0.207026407122612, 0.15906663239002228, -0.05675497278571129, 0.043992914259433746, -0.1279703825712204, 0.052308980375528336, 0.2237345576286316, -0.08724123984575272, -0.004674322437494993, -0.14638715982437134, 0.013736710883677006, 0.013480700552463531, 0.11420777440071106, -0.2545510530471802, -0.1600145697593689, 0.13871783018112183, 0.05487643554806709, 0.01808100938796997, -0.0070495870895683765, 7.268827175721526e-7, -0.16743692755699158, 0.0273304246366024, -0.0018395062070339918, 0.1572040468454361, 0.07386630028486252, 0.08812426775693893, -0.04223918914794922, 0.18770340085029602, -0.018298177048563957, 0.05270587280392647, 0.1843668818473816, -0.0989469364285469, 0.009668559767305851, -0.02629060670733452, -0.008036252111196518, -0.14631186425685883, -0.26651206612586975, 0.04921753704547882, -0.06408661603927612, -0.01940266415476799, 0.07335076481103897, 0.08266696333885193, -0.04955112189054489, -0.13246336579322815, 0.06493215262889862, -0.0447319857776165, 0.023576321080327034, -0.04002995789051056, 0.007962783798575401, 0.03420416638255119, -0.0037437896244227886, -0.06650301069021225, 0.1476154327392578, 0.1526118516921997, -0.050420038402080536, -0.038360532373189926, -0.21372447907924652, -0.012071467936038971, -0.016134899109601974, -0.07992180436849594, 0.031159482896327972, 0.018129773437976837, 0.05341876670718193, -0.08217651396989822, 0.19218669831752777, 0.13529464602470398, -0.011586745269596577, -0.03854265809059143, -0.06886730343103409, 0.05013708397746086, -0.0524078868329525, 0.08072645217180252, 0.07375526428222656, 0.1654546707868576, -0.03200012445449829, -0.08330739289522171, 0.02003316953778267, -0.17686496675014496, 0.20611482858657837, -0.021779920905828476, -0.0839715227484703, -0.053331077098846436, 0.047837335616350174, -0.03792224079370499, -0.04892844706773758, 0.1297931671142578, -0.05939957872033119, 9.282086121213514e-38, -0.06218817085027695, 0.07804404199123383, -0.08301036059856415, -0.12415019422769547, -0.07544320821762085, -0.060187049210071564, -0.08397602289915085, 0.11343493312597275, -0.08068407326936722, -0.11837419867515564, -0.12460194528102875 ]
https://github.com/huggingface/datasets/issues/6270
Dataset.from_generator raises with sharded gen_args
It sounds like you are saying that num_proc affects the form of gen_kwargs. Are you saying that for non-zero num_proc gen_kwargs should be a list whose length is the same as num_proc? Or are you saying that for non-zero num_proc, gen_kwargs should be a dict whose elements are lists the length of num_proc?
### Describe the bug According to the docs of Datasets.from_generator: ``` gen_kwargs(`dict`, *optional*): Keyword arguments to be passed to the `generator` callable. You can define a sharded dataset by passing the list of shards in `gen_kwargs`. ``` So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element. It doesn't work that way though. ### Steps to reproduce the bug ```python #!/usr/bin/python from pathlib import Path import datasets def process_yaml(file): yield dict(example=42) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ) ds.to_json('training.jsonl') ``` ``` Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File "/tmp/dataset_bug.py", line 13, in <module> ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator ).read() ^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read self.builder.download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare super()._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single generator = self._generate_examples(**gen_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ``` mapping, not list ### Expected behavior I would expect that process_yaml would be called once for each yaml file in the directory where the script is run. I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list. ### Environment info - `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0) - Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3
53
Dataset.from_generator raises with sharded gen_args ### Describe the bug According to the docs of Datasets.from_generator: ``` gen_kwargs(`dict`, *optional*): Keyword arguments to be passed to the `generator` callable. You can define a sharded dataset by passing the list of shards in `gen_kwargs`. ``` So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element. It doesn't work that way though. ### Steps to reproduce the bug ```python #!/usr/bin/python from pathlib import Path import datasets def process_yaml(file): yield dict(example=42) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ) ds.to_json('training.jsonl') ``` ``` Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File "/tmp/dataset_bug.py", line 13, in <module> ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator ).read() ^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read self.builder.download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare super()._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single generator = self._generate_examples(**gen_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ``` mapping, not list ### Expected behavior I would expect that process_yaml would be called once for each yaml file in the directory where the script is run. I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list. ### Environment info - `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0) - Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 It sounds like you are saying that num_proc affects the form of gen_kwargs. Are you saying that for non-zero num_proc gen_kwargs should be a list whose length is the same as num_proc? Or are you saying that for non-zero num_proc, gen_kwargs should be a dict whose elements are lists the length of num_proc?
[ 0.10313498228788376, -0.004205336328595877, -0.04959315434098244, 0.11198350787162781, 0.2503035366535187, 0.11277437210083008, 0.10729693621397018, 0.027257123962044716, -0.06739849597215652, 0.16669291257858276, 0.09859459847211838, -0.07553824037313461, -0.04894908517599106, 0.02901710383594036, -0.020641455426812172, 0.044132329523563385, 0.05877521634101868, -0.028443243354558945, -0.006722837686538696, -0.09125570952892303, -0.21881398558616638, 0.07229812443256378, 0.10556191951036453, 0.031242458149790764, -0.022417288273572922, -0.18133628368377686, -0.11979396641254425, 0.2623496651649475, 0.0368354395031929, -0.012835637666285038, 0.0036758051719516516, -0.06834603101015091, -0.09703134000301361, 0.06385886669158936, 0.000005486469945026329, 0.12594643235206604, 0.30116334557533264, -0.039548490196466446, 0.0004133521288167685, -0.003941867034882307, 0.08651227504014969, -0.03327413275837898, 0.15086418390274048, -0.07212145626544952, -0.10114121437072754, -0.05896662548184395, -0.11148767918348312, 0.0458906851708889, 0.0967421606183052, -0.030728835612535477, -0.035163186490535736, -0.08800141513347626, 0.09008572995662689, -0.15698157250881195, 0.05923711135983467, -0.007308897562325001, 0.07911939173936844, -0.10990388691425323, -0.35164445638656616, -0.0791551023721695, 0.08646424114704132, -0.10097146034240723, -0.0068420907482504845, 0.0327516570687294, -0.04384410008788109, 0.04456170275807381, -0.2359626740217209, -0.13205035030841827, 0.06098748371005058, 0.05156952142715454, -0.21917201578617096, -0.02523070201277733, -0.07844214886426926, -0.010352697223424911, -0.028321510180830956, -0.0707145482301712, -0.03190188482403755, 0.16704389452934265, -0.09356268495321274, 0.11132439225912094, 0.09724341332912445, 0.022192737087607384, -0.06427231431007385, -0.027787504717707634, -0.1726253181695938, -0.024048645049333572, -0.036399658769369125, 0.17960932850837708, -0.11218027770519257, 0.0013673981884494424, -0.10627097636461258, -0.0148343276232481, -0.17328450083732605, -0.1156499832868576, -0.10337597876787186, 0.09823025017976761, -0.03747973591089249, -0.10094320774078369, 0.04298669099807739, -0.14496351778507233, -0.09733723849058151, -0.08042463660240173, 0.10087571293115616, 0.02693248726427555, 0.11258874088525772, -0.12429700046777725, 0.056918855756521225, -0.001704930909909308, -0.08226744830608368, 0.07359475642442703, -0.08772211521863937, 0.07005433738231659, -0.1177714392542839, -0.10486633330583572, 0.17687676846981049, 0.05383818596601486, 0.05699289217591286, 0.0993896871805191, 0.044634200632572174, 0.2489950954914093, -0.07094461470842361, 0.13082365691661835, -0.02836271934211254, 0.12927252054214478, 0.05765687674283981, -0.008276493288576603, -0.04827253893017769, 0.01571107842028141, -0.0006485909689217806, -0.12350476533174515, -0.08284400403499603, -0.1747051477432251, 0.02566213719546795, 0.05217883363366127, -0.03191737085580826, 0.04275473207235336, -0.035252735018730164, -0.038509853184223175, -0.025131240487098694, -0.21412178874015808, 0.14364729821681976, -0.02486654557287693, 0.10768456757068634, 0.0515265017747879, 0.10138704627752304, 0.12105430662631989, 0.11941143870353699, -0.03439069166779518, 0.03952028974890709, 0.0246413666754961, -0.3334151804447174, 0.06925883889198303, -0.10171802341938019, 0.1529429852962494, -0.017855288460850716, 0.13698770105838776, 0.06905709952116013, -0.007664893753826618, -0.14848467707633972, -0.024285778403282166, 0.06682959944009781, -0.028774317353963852, 0.0003827578038908541, -0.17273543775081635, 0.012630869634449482, 0.14559490978717804, 0.08862415701150894, 0.025789327919483185, -0.10329120606184006, -0.1256362944841385, 0.16930171847343445, -0.07399310916662216, -0.09538917988538742, -0.21443264186382294, -0.04512818530201912, 0.2176124006509781, -0.18824848532676697, 0.07631143927574158, -0.2497529834508896, -0.032853446900844574, 0.03527657687664032, 0.03777249902486801, 0.1084265187382698, -0.19869118928909302, 0.08067822456359863, -0.16831688582897186, -0.08254522830247879, 0.014665487222373486, -0.1026807352900505, -0.1621708869934082, -0.10164803266525269, 0.13407915830612183, -0.1709490716457367, 0.05569912865757942, 0.032196950167417526, 0.03470882400870323, -0.0038311106618493795, 0.03538765385746956, 0.09113990515470505, -0.161671981215477, -0.01996605470776558, 0.0005281682242639363, 0.17308072745800018, -0.004679511301219463, 0.10171673446893692, 0.1128140538930893, -0.19995161890983582, 0.13058386743068695, -0.14332520961761475, -0.15629464387893677, -0.19393524527549744, -0.0206880122423172, 0.015756186097860336, 0.1585792899131775, -0.2621559202671051, -0.052504513412714005, -0.06525138020515442, 0.018466636538505554, -0.15346777439117432, 0.041215814650058746, -0.04342637583613396, 0.10630615055561066, -0.06747809052467346, 0.020665960386395454, 0.03507746383547783, 0.03605390712618828, 0.003285012673586607, -0.1348775178194046, 0.01819157414138317, -0.041810423135757446, -0.1039801687002182, -0.030954210087656975, 0.1890823096036911, 0.13322865962982178, 0.00669214129447937, -0.018763087689876556, -0.0084577277302742, -0.1853744387626648, 0.020474886521697044, 0.035085707902908325, -0.004628922790288925, 0.00017581415886525065, -0.11760241538286209, -0.04558223858475685, 0.09415913373231888, 0.10215817391872406, -0.03192666545510292, 0.2202172428369522, -0.086898572742939, 0.07883994281291962, 0.11090107262134552, 0.11713425815105438, -0.03380197659134865, 0.002452124608680606, -0.0565643347799778, -0.11068340390920639, 0.17715758085250854, 0.1850028783082962, -0.06338325887918472, -0.06407839804887772, 0.339718759059906, -0.07432243973016739, -0.12580257654190063, -0.022102639079093933, 0.020170772448182106, -0.12464325875043869, 0.048888787627220154, 0.16876424849033356, -0.07303036004304886, 0.02695922739803791, 0.17030788958072662, -0.06267896294593811, -0.1218862384557724, -0.09149034321308136, -0.007080978713929653, -0.09790991246700287, 0.02021469548344612, 0.08117597550153732, 0.1622851938009262, -0.00013690779451280832, -0.09182554483413696, 0.13948607444763184, 0.15664587914943695, -0.10754282027482986, 0.11942706257104874, 0.2394101768732071, -0.08426810801029205, 0.3338295817375183, -0.10431651771068573, 0.08599763363599777, -0.12356314063072205, -0.07571865618228912, -0.0975833535194397, -0.1374174803495407, 0.07339659333229065, -0.026901409029960632, 0.13965663313865662, -0.08038265258073807, 0.08963499963283539, -0.13643380999565125, -0.043306369334459305, 0.055773936212062836, 0.12763430178165436, -0.05402010306715965, 0.04226148501038551, -0.08704917877912521, 0.1550145447254181, 0.041387442499399185, -0.2957608103752136, 0.04185236990451813, -0.047996312379837036, 0.03759245201945305, -0.05201224982738495, 0.2219116985797882, 0.08800795674324036, -0.04901951551437378, -0.09947378933429718, -0.24007278680801392, 0.16992902755737305, 0.20296256244182587, -0.10235918313264847, 0.06751643121242523, -0.18880227208137512, 0.049969401210546494, -0.03805741295218468, 0.07048654556274414, 0.011110842227935791, -0.03835855424404144, 0.022049259394407272, 0.07358511537313461, -0.0008412341121584177, 0.1489613950252533, -0.03275347128510475, -0.15098077058792114, 0.0923290029168129, 0.0058713871985673904, -0.2160254269838333, 0.012788910418748856, 0.2866777181625366, -0.007577773183584213, -0.09612693637609482, 0.06935203075408936, -0.2079334706068039, 0.055482909083366394, 0.20281098783016205, -0.0688953697681427, -0.04410160705447197, -0.05102243646979332, 0.0696943998336792, 0.058132752776145935, -0.15422730147838593, 0.07272615283727646, -0.10840483009815216, -0.08294206857681274, -0.12504613399505615, 0.15828949213027954, -0.03243668004870415, -0.022322703152894974, -0.115634985268116, 0.2424800992012024, 0.060571759939193726, 0.1007547676563263, 0.2431986778974533, -0.046299953013658524, -0.05283990502357483, 0.07504962384700775, 0.10892752557992935, 0.0074929129332304, 0.020188340917229652, -0.21221549808979034, -0.09781662374734879, 0.06307347118854523, -0.15651017427444458, -0.09700477123260498, 0.02423962578177452, -0.0553300566971302, 0.09261566400527954, -0.1414652317762375, 0.09405994415283203, 0.01613369956612587, 0.061498772352933884, -0.24161772429943085, 0.08418817818164825, 0.04509225860238075, 0.14908315241336823, 0.07457249611616135, -0.02087286114692688, -0.011773240752518177, -0.092066690325737, 0.31934309005737305, 0.0008668939117342234, 0.1306294947862625, -0.005959778092801571, -0.06737181544303894, -0.007979979738593102, -0.08785781264305115, 0.1129252091050148, 0.06639072299003601, -0.036501556634902954, 0.10971441119909286, 0.15065997838974, 0.19198456406593323, -0.047258976846933365, 0.07569855451583862, 0.12726065516471863, -0.03876936808228493, 0.13575102388858795, -0.045524969696998596, 0.092990443110466, -0.09018249064683914, -0.08222930878400803, 0.005946958903223276, -0.008964134380221367, -0.024837825447320938, 0.17717336118221283, 0.09381436556577682, -0.1017141044139862, 0.08192837238311768, -0.0069792792201042175, -0.19332662224769592, -0.18373414874076843, -0.0931391641497612, 0.009625057689845562, 0.08321855217218399, -0.01474839448928833, -0.021265381947159767, -0.0546162985265255, 0.05355355888605118, 0.14360782504081726, 0.07230252027511597, 0.17221221327781677, -0.08826281875371933, -0.01325986161828041, -0.0014542746357619762, 0.11616243422031403, -0.06157578155398369, 0.2669998109340668, -0.12542887032032013, -0.15887942910194397, -0.1762077957391739, -0.23331400752067566, 0.08755937963724136, -0.12505438923835754, -0.167854443192482, 0.07074777036905289, -0.11753660440444946, -0.010794924572110176, 0.017547983676195145, 0.059825628995895386, 0.1212158054113388, -0.22151286900043488, -0.04916002228856087, -0.13049514591693878, -0.03815371170639992, 0.022922193631529808, -0.006182762794196606, 0.11541379988193512, -0.15007473528385162, 0.007673997897654772, 0.03251880779862404, -0.0027778807561844587, -0.04013305529952049, 0.08538226038217545, 0.07292325794696808, 0.021703414618968964, 0.32803839445114136, 0.11972265690565109, -0.021090444177389145, -0.020415745675563812, 0.023561889305710793, -0.034829914569854736, 0.05011608824133873, 0.04397209733724594, 0.12608401477336884, 0.12314969301223755, 0.15286636352539062, -0.07480110228061676, -0.07933025807142258, -0.023483196273446083, -0.06330058723688126, 0.16966117918491364, 0.06507586687803268, 0.09885668009519577, -0.04633776471018791, -0.03107045218348503, 0.1616750955581665, -0.021999644115567207, 0.06593915820121765, -0.25980448722839355, 0.10328810662031174, -0.00033697253093123436, -0.09173375368118286, -0.0692141205072403, 0.12371315062046051, -0.0660998597741127, 0.09665719419717789, -0.11128094047307968, -0.03664547577500343, 0.045129988342523575, 0.05471593141555786, 0.07660280168056488, -0.010243785567581654, 0.05504331737756729, -0.012352230027318, -0.04488354176282883, -0.12898299098014832, -0.007317479699850082, -0.01507044117897749, 0.06508033722639084, 0.0020774714648723602, 0.08241018652915955, -0.00523186894133687, -0.09103109687566757, -0.15060602128505707, 0.0391170009970665, -0.03474912792444229, -0.1208033636212349, 0.08128131926059723, 0.17001725733280182, -0.00964860524982214, -0.009585650637745857, 0.020575281232595444, 0.04346730187535286, -0.10801835358142853, 0.07157708704471588, -0.05584416538476944, 0.060655377805233, -0.06117263063788414, 0.06239179149270058, 0.2116210162639618, 0.20731739699840546, 0.20631477236747742, 0.18202370405197144, 0.01789068430662155, 0.007358606904745102, -0.032926302403211594, 0.15268824994564056, -0.09146300703287125, 0.07526269555091858, 0.06283692270517349, 0.09223287552595139, -0.24460437893867493, -0.1537303924560547, 0.07608404010534286, 0.16138756275177002, -0.08496081084012985, -0.04922379180788994, 0.055933479219675064, -0.05144083872437477, -0.2642955183982849, -0.061269767582416534, 0.11973267793655396, -0.09945269674062729, -0.1007123813033104, -0.06007221341133118, -2.65043854067686e-32, 0.004222497344017029, 0.02237684838473797, -0.007111780811101198, 0.03630691021680832, 0.01794559694826603, 0.01685480587184429, -0.02480996958911419, -0.005494825541973114, -0.00875858310610056, -0.014235076494514942, -0.21026188135147095, 0.08158828318119049, 0.14208188652992249, -0.043299999088048935, 0.05547569319605827, -0.08163216710090637, 0.11608809232711792, -0.19628849625587463, -0.004078549332916737, 0.061928603798151016, 0.1186789870262146, 0.014638135209679604, 0.13322408497333527, 0.05432617664337158, -0.06116762012243271, -0.050717517733573914, -0.0750381126999855, -0.26142844557762146, -0.06515435874462128, -0.008609400130808353, -0.09646817296743393, 0.12681357562541962, 0.024243418127298355, -0.03779638186097145, -0.07329607009887695, -0.1425233781337738, -0.2215634435415268, 0.05215979367494583, 0.07216562330722809, -0.09946468472480774, -0.15184567868709564, 0.14087936282157898, 0.14968688786029816, 0.03321902081370354, -0.006448189727962017, -0.002236024010926485, -0.003452457720413804, -0.023824283853173256, -0.17220059037208557, -0.19958911836147308, 0.12476718425750732, -0.03161291405558586, 0.09274429827928543, 0.031896740198135376, -0.09389365464448929, -0.25210514664649963, 0.04827521741390228, 0.06898298859596252, -0.13148915767669678, 0.05917235463857651, 0.24515002965927124, -0.08736523240804672, 0.016169149428606033, -0.045359592884778976, -0.0004610107862390578, -0.08152033388614655, 0.20728443562984467, 0.10431566834449768, 0.20821860432624817, -0.030961526557803154, -0.06920779496431351, 0.13098788261413574, -0.20472893118858337, -0.04567849263548851, 0.03345967084169388, -0.06299073249101639, -0.17366281151771545, 0.01624484732747078, -0.0027492817025631666, 0.09968101978302002, -0.026652270928025246, -0.1535899043083191, 0.10334891825914383, -0.006937015801668167, -0.016387606039643288, -0.0853547751903534, 0.04898805171251297, -0.008197011426091194, -0.039057839661836624, -0.05251270905137062, -0.05262819677591324, 0.1638900488615036, -0.034296467900276184, -0.012647113762795925, 0.03319773077964783, 0.24908317625522614, -0.07963721454143524, 0.03593898564577103, -0.1609601378440857, -0.04870797321200371, 0.04949748516082764, -0.08680611848831177, 0.19536782801151276, -0.10173891484737396, 0.04620892181992531, 0.02492663823068142, 0.16443173587322235, -0.039196718484163284, -0.10541659593582153, -0.03371664881706238, -0.1686714142560959, 0.1700701117515564, 0.036363087594509125, 0.207026407122612, 0.15906663239002228, -0.05675497278571129, 0.043992914259433746, -0.1279703825712204, 0.052308980375528336, 0.2237345576286316, -0.08724123984575272, -0.004674322437494993, -0.14638715982437134, 0.013736710883677006, 0.013480700552463531, 0.11420777440071106, -0.2545510530471802, -0.1600145697593689, 0.13871783018112183, 0.05487643554806709, 0.01808100938796997, -0.0070495870895683765, 7.268827175721526e-7, -0.16743692755699158, 0.0273304246366024, -0.0018395062070339918, 0.1572040468454361, 0.07386630028486252, 0.08812426775693893, -0.04223918914794922, 0.18770340085029602, -0.018298177048563957, 0.05270587280392647, 0.1843668818473816, -0.0989469364285469, 0.009668559767305851, -0.02629060670733452, -0.008036252111196518, -0.14631186425685883, -0.26651206612586975, 0.04921753704547882, -0.06408661603927612, -0.01940266415476799, 0.07335076481103897, 0.08266696333885193, -0.04955112189054489, -0.13246336579322815, 0.06493215262889862, -0.0447319857776165, 0.023576321080327034, -0.04002995789051056, 0.007962783798575401, 0.03420416638255119, -0.0037437896244227886, -0.06650301069021225, 0.1476154327392578, 0.1526118516921997, -0.050420038402080536, -0.038360532373189926, -0.21372447907924652, -0.012071467936038971, -0.016134899109601974, -0.07992180436849594, 0.031159482896327972, 0.018129773437976837, 0.05341876670718193, -0.08217651396989822, 0.19218669831752777, 0.13529464602470398, -0.011586745269596577, -0.03854265809059143, -0.06886730343103409, 0.05013708397746086, -0.0524078868329525, 0.08072645217180252, 0.07375526428222656, 0.1654546707868576, -0.03200012445449829, -0.08330739289522171, 0.02003316953778267, -0.17686496675014496, 0.20611482858657837, -0.021779920905828476, -0.0839715227484703, -0.053331077098846436, 0.047837335616350174, -0.03792224079370499, -0.04892844706773758, 0.1297931671142578, -0.05939957872033119, 9.282086121213514e-38, -0.06218817085027695, 0.07804404199123383, -0.08301036059856415, -0.12415019422769547, -0.07544320821762085, -0.060187049210071564, -0.08397602289915085, 0.11343493312597275, -0.08068407326936722, -0.11837419867515564, -0.12460194528102875 ]
https://github.com/huggingface/datasets/issues/6270
Dataset.from_generator raises with sharded gen_args
I ran some tests. So, it looks like with num_proc greater than 1, gen_kwargs is expected to be a dict of lists. It calls the generator also with a dict of lists, but the lists are split. I.E. if my original has `gen_kwargs=dict(a=[0,1,2])`, then my generator might get called with `gen_kwalrgs=dict([0])`. That all makes sense, but I definitely think there is room for improvement in the doc string here. In order to suggest improvements to the doc string, I need to look at how the gen_kwargs are split, and figure out if: * num_proc needs to exactly equal the length of the lists * num_proc needs to evenly divide the length of the lists * Or there's no required relationship. I'll look into that and then propose an improved doc string if no one else gets to it first.
### Describe the bug According to the docs of Datasets.from_generator: ``` gen_kwargs(`dict`, *optional*): Keyword arguments to be passed to the `generator` callable. You can define a sharded dataset by passing the list of shards in `gen_kwargs`. ``` So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element. It doesn't work that way though. ### Steps to reproduce the bug ```python #!/usr/bin/python from pathlib import Path import datasets def process_yaml(file): yield dict(example=42) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ) ds.to_json('training.jsonl') ``` ``` Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File "/tmp/dataset_bug.py", line 13, in <module> ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator ).read() ^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read self.builder.download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare super()._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single generator = self._generate_examples(**gen_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ``` mapping, not list ### Expected behavior I would expect that process_yaml would be called once for each yaml file in the directory where the script is run. I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list. ### Environment info - `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0) - Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3
139
Dataset.from_generator raises with sharded gen_args ### Describe the bug According to the docs of Datasets.from_generator: ``` gen_kwargs(`dict`, *optional*): Keyword arguments to be passed to the `generator` callable. You can define a sharded dataset by passing the list of shards in `gen_kwargs`. ``` So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element. It doesn't work that way though. ### Steps to reproduce the bug ```python #!/usr/bin/python from pathlib import Path import datasets def process_yaml(file): yield dict(example=42) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ) ds.to_json('training.jsonl') ``` ``` Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File "/tmp/dataset_bug.py", line 13, in <module> ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator ).read() ^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read self.builder.download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare super()._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single generator = self._generate_examples(**gen_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ``` mapping, not list ### Expected behavior I would expect that process_yaml would be called once for each yaml file in the directory where the script is run. I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list. ### Environment info - `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0) - Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 I ran some tests. So, it looks like with num_proc greater than 1, gen_kwargs is expected to be a dict of lists. It calls the generator also with a dict of lists, but the lists are split. I.E. if my original has `gen_kwargs=dict(a=[0,1,2])`, then my generator might get called with `gen_kwalrgs=dict([0])`. That all makes sense, but I definitely think there is room for improvement in the doc string here. In order to suggest improvements to the doc string, I need to look at how the gen_kwargs are split, and figure out if: * num_proc needs to exactly equal the length of the lists * num_proc needs to evenly divide the length of the lists * Or there's no required relationship. I'll look into that and then propose an improved doc string if no one else gets to it first.
[ 0.10313498228788376, -0.004205336328595877, -0.04959315434098244, 0.11198350787162781, 0.2503035366535187, 0.11277437210083008, 0.10729693621397018, 0.027257123962044716, -0.06739849597215652, 0.16669291257858276, 0.09859459847211838, -0.07553824037313461, -0.04894908517599106, 0.02901710383594036, -0.020641455426812172, 0.044132329523563385, 0.05877521634101868, -0.028443243354558945, -0.006722837686538696, -0.09125570952892303, -0.21881398558616638, 0.07229812443256378, 0.10556191951036453, 0.031242458149790764, -0.022417288273572922, -0.18133628368377686, -0.11979396641254425, 0.2623496651649475, 0.0368354395031929, -0.012835637666285038, 0.0036758051719516516, -0.06834603101015091, -0.09703134000301361, 0.06385886669158936, 0.000005486469945026329, 0.12594643235206604, 0.30116334557533264, -0.039548490196466446, 0.0004133521288167685, -0.003941867034882307, 0.08651227504014969, -0.03327413275837898, 0.15086418390274048, -0.07212145626544952, -0.10114121437072754, -0.05896662548184395, -0.11148767918348312, 0.0458906851708889, 0.0967421606183052, -0.030728835612535477, -0.035163186490535736, -0.08800141513347626, 0.09008572995662689, -0.15698157250881195, 0.05923711135983467, -0.007308897562325001, 0.07911939173936844, -0.10990388691425323, -0.35164445638656616, -0.0791551023721695, 0.08646424114704132, -0.10097146034240723, -0.0068420907482504845, 0.0327516570687294, -0.04384410008788109, 0.04456170275807381, -0.2359626740217209, -0.13205035030841827, 0.06098748371005058, 0.05156952142715454, -0.21917201578617096, -0.02523070201277733, -0.07844214886426926, -0.010352697223424911, -0.028321510180830956, -0.0707145482301712, -0.03190188482403755, 0.16704389452934265, -0.09356268495321274, 0.11132439225912094, 0.09724341332912445, 0.022192737087607384, -0.06427231431007385, -0.027787504717707634, -0.1726253181695938, -0.024048645049333572, -0.036399658769369125, 0.17960932850837708, -0.11218027770519257, 0.0013673981884494424, -0.10627097636461258, -0.0148343276232481, -0.17328450083732605, -0.1156499832868576, -0.10337597876787186, 0.09823025017976761, -0.03747973591089249, -0.10094320774078369, 0.04298669099807739, -0.14496351778507233, -0.09733723849058151, -0.08042463660240173, 0.10087571293115616, 0.02693248726427555, 0.11258874088525772, -0.12429700046777725, 0.056918855756521225, -0.001704930909909308, -0.08226744830608368, 0.07359475642442703, -0.08772211521863937, 0.07005433738231659, -0.1177714392542839, -0.10486633330583572, 0.17687676846981049, 0.05383818596601486, 0.05699289217591286, 0.0993896871805191, 0.044634200632572174, 0.2489950954914093, -0.07094461470842361, 0.13082365691661835, -0.02836271934211254, 0.12927252054214478, 0.05765687674283981, -0.008276493288576603, -0.04827253893017769, 0.01571107842028141, -0.0006485909689217806, -0.12350476533174515, -0.08284400403499603, -0.1747051477432251, 0.02566213719546795, 0.05217883363366127, -0.03191737085580826, 0.04275473207235336, -0.035252735018730164, -0.038509853184223175, -0.025131240487098694, -0.21412178874015808, 0.14364729821681976, -0.02486654557287693, 0.10768456757068634, 0.0515265017747879, 0.10138704627752304, 0.12105430662631989, 0.11941143870353699, -0.03439069166779518, 0.03952028974890709, 0.0246413666754961, -0.3334151804447174, 0.06925883889198303, -0.10171802341938019, 0.1529429852962494, -0.017855288460850716, 0.13698770105838776, 0.06905709952116013, -0.007664893753826618, -0.14848467707633972, -0.024285778403282166, 0.06682959944009781, -0.028774317353963852, 0.0003827578038908541, -0.17273543775081635, 0.012630869634449482, 0.14559490978717804, 0.08862415701150894, 0.025789327919483185, -0.10329120606184006, -0.1256362944841385, 0.16930171847343445, -0.07399310916662216, -0.09538917988538742, -0.21443264186382294, -0.04512818530201912, 0.2176124006509781, -0.18824848532676697, 0.07631143927574158, -0.2497529834508896, -0.032853446900844574, 0.03527657687664032, 0.03777249902486801, 0.1084265187382698, -0.19869118928909302, 0.08067822456359863, -0.16831688582897186, -0.08254522830247879, 0.014665487222373486, -0.1026807352900505, -0.1621708869934082, -0.10164803266525269, 0.13407915830612183, -0.1709490716457367, 0.05569912865757942, 0.032196950167417526, 0.03470882400870323, -0.0038311106618493795, 0.03538765385746956, 0.09113990515470505, -0.161671981215477, -0.01996605470776558, 0.0005281682242639363, 0.17308072745800018, -0.004679511301219463, 0.10171673446893692, 0.1128140538930893, -0.19995161890983582, 0.13058386743068695, -0.14332520961761475, -0.15629464387893677, -0.19393524527549744, -0.0206880122423172, 0.015756186097860336, 0.1585792899131775, -0.2621559202671051, -0.052504513412714005, -0.06525138020515442, 0.018466636538505554, -0.15346777439117432, 0.041215814650058746, -0.04342637583613396, 0.10630615055561066, -0.06747809052467346, 0.020665960386395454, 0.03507746383547783, 0.03605390712618828, 0.003285012673586607, -0.1348775178194046, 0.01819157414138317, -0.041810423135757446, -0.1039801687002182, -0.030954210087656975, 0.1890823096036911, 0.13322865962982178, 0.00669214129447937, -0.018763087689876556, -0.0084577277302742, -0.1853744387626648, 0.020474886521697044, 0.035085707902908325, -0.004628922790288925, 0.00017581415886525065, -0.11760241538286209, -0.04558223858475685, 0.09415913373231888, 0.10215817391872406, -0.03192666545510292, 0.2202172428369522, -0.086898572742939, 0.07883994281291962, 0.11090107262134552, 0.11713425815105438, -0.03380197659134865, 0.002452124608680606, -0.0565643347799778, -0.11068340390920639, 0.17715758085250854, 0.1850028783082962, -0.06338325887918472, -0.06407839804887772, 0.339718759059906, -0.07432243973016739, -0.12580257654190063, -0.022102639079093933, 0.020170772448182106, -0.12464325875043869, 0.048888787627220154, 0.16876424849033356, -0.07303036004304886, 0.02695922739803791, 0.17030788958072662, -0.06267896294593811, -0.1218862384557724, -0.09149034321308136, -0.007080978713929653, -0.09790991246700287, 0.02021469548344612, 0.08117597550153732, 0.1622851938009262, -0.00013690779451280832, -0.09182554483413696, 0.13948607444763184, 0.15664587914943695, -0.10754282027482986, 0.11942706257104874, 0.2394101768732071, -0.08426810801029205, 0.3338295817375183, -0.10431651771068573, 0.08599763363599777, -0.12356314063072205, -0.07571865618228912, -0.0975833535194397, -0.1374174803495407, 0.07339659333229065, -0.026901409029960632, 0.13965663313865662, -0.08038265258073807, 0.08963499963283539, -0.13643380999565125, -0.043306369334459305, 0.055773936212062836, 0.12763430178165436, -0.05402010306715965, 0.04226148501038551, -0.08704917877912521, 0.1550145447254181, 0.041387442499399185, -0.2957608103752136, 0.04185236990451813, -0.047996312379837036, 0.03759245201945305, -0.05201224982738495, 0.2219116985797882, 0.08800795674324036, -0.04901951551437378, -0.09947378933429718, -0.24007278680801392, 0.16992902755737305, 0.20296256244182587, -0.10235918313264847, 0.06751643121242523, -0.18880227208137512, 0.049969401210546494, -0.03805741295218468, 0.07048654556274414, 0.011110842227935791, -0.03835855424404144, 0.022049259394407272, 0.07358511537313461, -0.0008412341121584177, 0.1489613950252533, -0.03275347128510475, -0.15098077058792114, 0.0923290029168129, 0.0058713871985673904, -0.2160254269838333, 0.012788910418748856, 0.2866777181625366, -0.007577773183584213, -0.09612693637609482, 0.06935203075408936, -0.2079334706068039, 0.055482909083366394, 0.20281098783016205, -0.0688953697681427, -0.04410160705447197, -0.05102243646979332, 0.0696943998336792, 0.058132752776145935, -0.15422730147838593, 0.07272615283727646, -0.10840483009815216, -0.08294206857681274, -0.12504613399505615, 0.15828949213027954, -0.03243668004870415, -0.022322703152894974, -0.115634985268116, 0.2424800992012024, 0.060571759939193726, 0.1007547676563263, 0.2431986778974533, -0.046299953013658524, -0.05283990502357483, 0.07504962384700775, 0.10892752557992935, 0.0074929129332304, 0.020188340917229652, -0.21221549808979034, -0.09781662374734879, 0.06307347118854523, -0.15651017427444458, -0.09700477123260498, 0.02423962578177452, -0.0553300566971302, 0.09261566400527954, -0.1414652317762375, 0.09405994415283203, 0.01613369956612587, 0.061498772352933884, -0.24161772429943085, 0.08418817818164825, 0.04509225860238075, 0.14908315241336823, 0.07457249611616135, -0.02087286114692688, -0.011773240752518177, -0.092066690325737, 0.31934309005737305, 0.0008668939117342234, 0.1306294947862625, -0.005959778092801571, -0.06737181544303894, -0.007979979738593102, -0.08785781264305115, 0.1129252091050148, 0.06639072299003601, -0.036501556634902954, 0.10971441119909286, 0.15065997838974, 0.19198456406593323, -0.047258976846933365, 0.07569855451583862, 0.12726065516471863, -0.03876936808228493, 0.13575102388858795, -0.045524969696998596, 0.092990443110466, -0.09018249064683914, -0.08222930878400803, 0.005946958903223276, -0.008964134380221367, -0.024837825447320938, 0.17717336118221283, 0.09381436556577682, -0.1017141044139862, 0.08192837238311768, -0.0069792792201042175, -0.19332662224769592, -0.18373414874076843, -0.0931391641497612, 0.009625057689845562, 0.08321855217218399, -0.01474839448928833, -0.021265381947159767, -0.0546162985265255, 0.05355355888605118, 0.14360782504081726, 0.07230252027511597, 0.17221221327781677, -0.08826281875371933, -0.01325986161828041, -0.0014542746357619762, 0.11616243422031403, -0.06157578155398369, 0.2669998109340668, -0.12542887032032013, -0.15887942910194397, -0.1762077957391739, -0.23331400752067566, 0.08755937963724136, -0.12505438923835754, -0.167854443192482, 0.07074777036905289, -0.11753660440444946, -0.010794924572110176, 0.017547983676195145, 0.059825628995895386, 0.1212158054113388, -0.22151286900043488, -0.04916002228856087, -0.13049514591693878, -0.03815371170639992, 0.022922193631529808, -0.006182762794196606, 0.11541379988193512, -0.15007473528385162, 0.007673997897654772, 0.03251880779862404, -0.0027778807561844587, -0.04013305529952049, 0.08538226038217545, 0.07292325794696808, 0.021703414618968964, 0.32803839445114136, 0.11972265690565109, -0.021090444177389145, -0.020415745675563812, 0.023561889305710793, -0.034829914569854736, 0.05011608824133873, 0.04397209733724594, 0.12608401477336884, 0.12314969301223755, 0.15286636352539062, -0.07480110228061676, -0.07933025807142258, -0.023483196273446083, -0.06330058723688126, 0.16966117918491364, 0.06507586687803268, 0.09885668009519577, -0.04633776471018791, -0.03107045218348503, 0.1616750955581665, -0.021999644115567207, 0.06593915820121765, -0.25980448722839355, 0.10328810662031174, -0.00033697253093123436, -0.09173375368118286, -0.0692141205072403, 0.12371315062046051, -0.0660998597741127, 0.09665719419717789, -0.11128094047307968, -0.03664547577500343, 0.045129988342523575, 0.05471593141555786, 0.07660280168056488, -0.010243785567581654, 0.05504331737756729, -0.012352230027318, -0.04488354176282883, -0.12898299098014832, -0.007317479699850082, -0.01507044117897749, 0.06508033722639084, 0.0020774714648723602, 0.08241018652915955, -0.00523186894133687, -0.09103109687566757, -0.15060602128505707, 0.0391170009970665, -0.03474912792444229, -0.1208033636212349, 0.08128131926059723, 0.17001725733280182, -0.00964860524982214, -0.009585650637745857, 0.020575281232595444, 0.04346730187535286, -0.10801835358142853, 0.07157708704471588, -0.05584416538476944, 0.060655377805233, -0.06117263063788414, 0.06239179149270058, 0.2116210162639618, 0.20731739699840546, 0.20631477236747742, 0.18202370405197144, 0.01789068430662155, 0.007358606904745102, -0.032926302403211594, 0.15268824994564056, -0.09146300703287125, 0.07526269555091858, 0.06283692270517349, 0.09223287552595139, -0.24460437893867493, -0.1537303924560547, 0.07608404010534286, 0.16138756275177002, -0.08496081084012985, -0.04922379180788994, 0.055933479219675064, -0.05144083872437477, -0.2642955183982849, -0.061269767582416534, 0.11973267793655396, -0.09945269674062729, -0.1007123813033104, -0.06007221341133118, -2.65043854067686e-32, 0.004222497344017029, 0.02237684838473797, -0.007111780811101198, 0.03630691021680832, 0.01794559694826603, 0.01685480587184429, -0.02480996958911419, -0.005494825541973114, -0.00875858310610056, -0.014235076494514942, -0.21026188135147095, 0.08158828318119049, 0.14208188652992249, -0.043299999088048935, 0.05547569319605827, -0.08163216710090637, 0.11608809232711792, -0.19628849625587463, -0.004078549332916737, 0.061928603798151016, 0.1186789870262146, 0.014638135209679604, 0.13322408497333527, 0.05432617664337158, -0.06116762012243271, -0.050717517733573914, -0.0750381126999855, -0.26142844557762146, -0.06515435874462128, -0.008609400130808353, -0.09646817296743393, 0.12681357562541962, 0.024243418127298355, -0.03779638186097145, -0.07329607009887695, -0.1425233781337738, -0.2215634435415268, 0.05215979367494583, 0.07216562330722809, -0.09946468472480774, -0.15184567868709564, 0.14087936282157898, 0.14968688786029816, 0.03321902081370354, -0.006448189727962017, -0.002236024010926485, -0.003452457720413804, -0.023824283853173256, -0.17220059037208557, -0.19958911836147308, 0.12476718425750732, -0.03161291405558586, 0.09274429827928543, 0.031896740198135376, -0.09389365464448929, -0.25210514664649963, 0.04827521741390228, 0.06898298859596252, -0.13148915767669678, 0.05917235463857651, 0.24515002965927124, -0.08736523240804672, 0.016169149428606033, -0.045359592884778976, -0.0004610107862390578, -0.08152033388614655, 0.20728443562984467, 0.10431566834449768, 0.20821860432624817, -0.030961526557803154, -0.06920779496431351, 0.13098788261413574, -0.20472893118858337, -0.04567849263548851, 0.03345967084169388, -0.06299073249101639, -0.17366281151771545, 0.01624484732747078, -0.0027492817025631666, 0.09968101978302002, -0.026652270928025246, -0.1535899043083191, 0.10334891825914383, -0.006937015801668167, -0.016387606039643288, -0.0853547751903534, 0.04898805171251297, -0.008197011426091194, -0.039057839661836624, -0.05251270905137062, -0.05262819677591324, 0.1638900488615036, -0.034296467900276184, -0.012647113762795925, 0.03319773077964783, 0.24908317625522614, -0.07963721454143524, 0.03593898564577103, -0.1609601378440857, -0.04870797321200371, 0.04949748516082764, -0.08680611848831177, 0.19536782801151276, -0.10173891484737396, 0.04620892181992531, 0.02492663823068142, 0.16443173587322235, -0.039196718484163284, -0.10541659593582153, -0.03371664881706238, -0.1686714142560959, 0.1700701117515564, 0.036363087594509125, 0.207026407122612, 0.15906663239002228, -0.05675497278571129, 0.043992914259433746, -0.1279703825712204, 0.052308980375528336, 0.2237345576286316, -0.08724123984575272, -0.004674322437494993, -0.14638715982437134, 0.013736710883677006, 0.013480700552463531, 0.11420777440071106, -0.2545510530471802, -0.1600145697593689, 0.13871783018112183, 0.05487643554806709, 0.01808100938796997, -0.0070495870895683765, 7.268827175721526e-7, -0.16743692755699158, 0.0273304246366024, -0.0018395062070339918, 0.1572040468454361, 0.07386630028486252, 0.08812426775693893, -0.04223918914794922, 0.18770340085029602, -0.018298177048563957, 0.05270587280392647, 0.1843668818473816, -0.0989469364285469, 0.009668559767305851, -0.02629060670733452, -0.008036252111196518, -0.14631186425685883, -0.26651206612586975, 0.04921753704547882, -0.06408661603927612, -0.01940266415476799, 0.07335076481103897, 0.08266696333885193, -0.04955112189054489, -0.13246336579322815, 0.06493215262889862, -0.0447319857776165, 0.023576321080327034, -0.04002995789051056, 0.007962783798575401, 0.03420416638255119, -0.0037437896244227886, -0.06650301069021225, 0.1476154327392578, 0.1526118516921997, -0.050420038402080536, -0.038360532373189926, -0.21372447907924652, -0.012071467936038971, -0.016134899109601974, -0.07992180436849594, 0.031159482896327972, 0.018129773437976837, 0.05341876670718193, -0.08217651396989822, 0.19218669831752777, 0.13529464602470398, -0.011586745269596577, -0.03854265809059143, -0.06886730343103409, 0.05013708397746086, -0.0524078868329525, 0.08072645217180252, 0.07375526428222656, 0.1654546707868576, -0.03200012445449829, -0.08330739289522171, 0.02003316953778267, -0.17686496675014496, 0.20611482858657837, -0.021779920905828476, -0.0839715227484703, -0.053331077098846436, 0.047837335616350174, -0.03792224079370499, -0.04892844706773758, 0.1297931671142578, -0.05939957872033119, 9.282086121213514e-38, -0.06218817085027695, 0.07804404199123383, -0.08301036059856415, -0.12415019422769547, -0.07544320821762085, -0.060187049210071564, -0.08397602289915085, 0.11343493312597275, -0.08068407326936722, -0.11837419867515564, -0.12460194528102875 ]
https://github.com/huggingface/datasets/issues/6270
Dataset.from_generator raises with sharded gen_args
Okay, that was fun; I took a dive through the dataset code and feel like I have a much better understanding. Here is my understanding of the behavior: * max_proc is an upper limit on the number of shards that `from_generator` produces * If `max_proc` is greater than 1, then all lists in *gen_kwargs* must be the same length * If the lists in *gen_kwargs* are shorter than *num_proc* elements, *num_proc* will be reduced and a warning produced. Put another way, `min(list_length, num_shards)` shards will be produced * The members of the lists in *gen_kwargs* will be partitioned among the created jobs. To validate the above, take a look at `_number_of_shards_in_gen_kwargs` and `_distribute_shards` and `_split_gen_kwargs` in utils/sharding.py. I've also chased down starting at *from_generator* all the way through to GeneratorBuilder and the calls to the functions in sharding.py. Tomorrow I'll take a look at the contributing guidelines and see what's involved in putting together a PR to improve the doc string.
### Describe the bug According to the docs of Datasets.from_generator: ``` gen_kwargs(`dict`, *optional*): Keyword arguments to be passed to the `generator` callable. You can define a sharded dataset by passing the list of shards in `gen_kwargs`. ``` So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element. It doesn't work that way though. ### Steps to reproduce the bug ```python #!/usr/bin/python from pathlib import Path import datasets def process_yaml(file): yield dict(example=42) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ) ds.to_json('training.jsonl') ``` ``` Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File "/tmp/dataset_bug.py", line 13, in <module> ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator ).read() ^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read self.builder.download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare super()._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single generator = self._generate_examples(**gen_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ``` mapping, not list ### Expected behavior I would expect that process_yaml would be called once for each yaml file in the directory where the script is run. I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list. ### Environment info - `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0) - Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3
161
Dataset.from_generator raises with sharded gen_args ### Describe the bug According to the docs of Datasets.from_generator: ``` gen_kwargs(`dict`, *optional*): Keyword arguments to be passed to the `generator` callable. You can define a sharded dataset by passing the list of shards in `gen_kwargs`. ``` So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element. It doesn't work that way though. ### Steps to reproduce the bug ```python #!/usr/bin/python from pathlib import Path import datasets def process_yaml(file): yield dict(example=42) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ) ds.to_json('training.jsonl') ``` ``` Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File "/tmp/dataset_bug.py", line 13, in <module> ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator ).read() ^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read self.builder.download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare super()._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single generator = self._generate_examples(**gen_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ``` mapping, not list ### Expected behavior I would expect that process_yaml would be called once for each yaml file in the directory where the script is run. I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list. ### Environment info - `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0) - Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 Okay, that was fun; I took a dive through the dataset code and feel like I have a much better understanding. Here is my understanding of the behavior: * max_proc is an upper limit on the number of shards that `from_generator` produces * If `max_proc` is greater than 1, then all lists in *gen_kwargs* must be the same length * If the lists in *gen_kwargs* are shorter than *num_proc* elements, *num_proc* will be reduced and a warning produced. Put another way, `min(list_length, num_shards)` shards will be produced * The members of the lists in *gen_kwargs* will be partitioned among the created jobs. To validate the above, take a look at `_number_of_shards_in_gen_kwargs` and `_distribute_shards` and `_split_gen_kwargs` in utils/sharding.py. I've also chased down starting at *from_generator* all the way through to GeneratorBuilder and the calls to the functions in sharding.py. Tomorrow I'll take a look at the contributing guidelines and see what's involved in putting together a PR to improve the doc string.
[ 0.10313498228788376, -0.004205336328595877, -0.04959315434098244, 0.11198350787162781, 0.2503035366535187, 0.11277437210083008, 0.10729693621397018, 0.027257123962044716, -0.06739849597215652, 0.16669291257858276, 0.09859459847211838, -0.07553824037313461, -0.04894908517599106, 0.02901710383594036, -0.020641455426812172, 0.044132329523563385, 0.05877521634101868, -0.028443243354558945, -0.006722837686538696, -0.09125570952892303, -0.21881398558616638, 0.07229812443256378, 0.10556191951036453, 0.031242458149790764, -0.022417288273572922, -0.18133628368377686, -0.11979396641254425, 0.2623496651649475, 0.0368354395031929, -0.012835637666285038, 0.0036758051719516516, -0.06834603101015091, -0.09703134000301361, 0.06385886669158936, 0.000005486469945026329, 0.12594643235206604, 0.30116334557533264, -0.039548490196466446, 0.0004133521288167685, -0.003941867034882307, 0.08651227504014969, -0.03327413275837898, 0.15086418390274048, -0.07212145626544952, -0.10114121437072754, -0.05896662548184395, -0.11148767918348312, 0.0458906851708889, 0.0967421606183052, -0.030728835612535477, -0.035163186490535736, -0.08800141513347626, 0.09008572995662689, -0.15698157250881195, 0.05923711135983467, -0.007308897562325001, 0.07911939173936844, -0.10990388691425323, -0.35164445638656616, -0.0791551023721695, 0.08646424114704132, -0.10097146034240723, -0.0068420907482504845, 0.0327516570687294, -0.04384410008788109, 0.04456170275807381, -0.2359626740217209, -0.13205035030841827, 0.06098748371005058, 0.05156952142715454, -0.21917201578617096, -0.02523070201277733, -0.07844214886426926, -0.010352697223424911, -0.028321510180830956, -0.0707145482301712, -0.03190188482403755, 0.16704389452934265, -0.09356268495321274, 0.11132439225912094, 0.09724341332912445, 0.022192737087607384, -0.06427231431007385, -0.027787504717707634, -0.1726253181695938, -0.024048645049333572, -0.036399658769369125, 0.17960932850837708, -0.11218027770519257, 0.0013673981884494424, -0.10627097636461258, -0.0148343276232481, -0.17328450083732605, -0.1156499832868576, -0.10337597876787186, 0.09823025017976761, -0.03747973591089249, -0.10094320774078369, 0.04298669099807739, -0.14496351778507233, -0.09733723849058151, -0.08042463660240173, 0.10087571293115616, 0.02693248726427555, 0.11258874088525772, -0.12429700046777725, 0.056918855756521225, -0.001704930909909308, -0.08226744830608368, 0.07359475642442703, -0.08772211521863937, 0.07005433738231659, -0.1177714392542839, -0.10486633330583572, 0.17687676846981049, 0.05383818596601486, 0.05699289217591286, 0.0993896871805191, 0.044634200632572174, 0.2489950954914093, -0.07094461470842361, 0.13082365691661835, -0.02836271934211254, 0.12927252054214478, 0.05765687674283981, -0.008276493288576603, -0.04827253893017769, 0.01571107842028141, -0.0006485909689217806, -0.12350476533174515, -0.08284400403499603, -0.1747051477432251, 0.02566213719546795, 0.05217883363366127, -0.03191737085580826, 0.04275473207235336, -0.035252735018730164, -0.038509853184223175, -0.025131240487098694, -0.21412178874015808, 0.14364729821681976, -0.02486654557287693, 0.10768456757068634, 0.0515265017747879, 0.10138704627752304, 0.12105430662631989, 0.11941143870353699, -0.03439069166779518, 0.03952028974890709, 0.0246413666754961, -0.3334151804447174, 0.06925883889198303, -0.10171802341938019, 0.1529429852962494, -0.017855288460850716, 0.13698770105838776, 0.06905709952116013, -0.007664893753826618, -0.14848467707633972, -0.024285778403282166, 0.06682959944009781, -0.028774317353963852, 0.0003827578038908541, -0.17273543775081635, 0.012630869634449482, 0.14559490978717804, 0.08862415701150894, 0.025789327919483185, -0.10329120606184006, -0.1256362944841385, 0.16930171847343445, -0.07399310916662216, -0.09538917988538742, -0.21443264186382294, -0.04512818530201912, 0.2176124006509781, -0.18824848532676697, 0.07631143927574158, -0.2497529834508896, -0.032853446900844574, 0.03527657687664032, 0.03777249902486801, 0.1084265187382698, -0.19869118928909302, 0.08067822456359863, -0.16831688582897186, -0.08254522830247879, 0.014665487222373486, -0.1026807352900505, -0.1621708869934082, -0.10164803266525269, 0.13407915830612183, -0.1709490716457367, 0.05569912865757942, 0.032196950167417526, 0.03470882400870323, -0.0038311106618493795, 0.03538765385746956, 0.09113990515470505, -0.161671981215477, -0.01996605470776558, 0.0005281682242639363, 0.17308072745800018, -0.004679511301219463, 0.10171673446893692, 0.1128140538930893, -0.19995161890983582, 0.13058386743068695, -0.14332520961761475, -0.15629464387893677, -0.19393524527549744, -0.0206880122423172, 0.015756186097860336, 0.1585792899131775, -0.2621559202671051, -0.052504513412714005, -0.06525138020515442, 0.018466636538505554, -0.15346777439117432, 0.041215814650058746, -0.04342637583613396, 0.10630615055561066, -0.06747809052467346, 0.020665960386395454, 0.03507746383547783, 0.03605390712618828, 0.003285012673586607, -0.1348775178194046, 0.01819157414138317, -0.041810423135757446, -0.1039801687002182, -0.030954210087656975, 0.1890823096036911, 0.13322865962982178, 0.00669214129447937, -0.018763087689876556, -0.0084577277302742, -0.1853744387626648, 0.020474886521697044, 0.035085707902908325, -0.004628922790288925, 0.00017581415886525065, -0.11760241538286209, -0.04558223858475685, 0.09415913373231888, 0.10215817391872406, -0.03192666545510292, 0.2202172428369522, -0.086898572742939, 0.07883994281291962, 0.11090107262134552, 0.11713425815105438, -0.03380197659134865, 0.002452124608680606, -0.0565643347799778, -0.11068340390920639, 0.17715758085250854, 0.1850028783082962, -0.06338325887918472, -0.06407839804887772, 0.339718759059906, -0.07432243973016739, -0.12580257654190063, -0.022102639079093933, 0.020170772448182106, -0.12464325875043869, 0.048888787627220154, 0.16876424849033356, -0.07303036004304886, 0.02695922739803791, 0.17030788958072662, -0.06267896294593811, -0.1218862384557724, -0.09149034321308136, -0.007080978713929653, -0.09790991246700287, 0.02021469548344612, 0.08117597550153732, 0.1622851938009262, -0.00013690779451280832, -0.09182554483413696, 0.13948607444763184, 0.15664587914943695, -0.10754282027482986, 0.11942706257104874, 0.2394101768732071, -0.08426810801029205, 0.3338295817375183, -0.10431651771068573, 0.08599763363599777, -0.12356314063072205, -0.07571865618228912, -0.0975833535194397, -0.1374174803495407, 0.07339659333229065, -0.026901409029960632, 0.13965663313865662, -0.08038265258073807, 0.08963499963283539, -0.13643380999565125, -0.043306369334459305, 0.055773936212062836, 0.12763430178165436, -0.05402010306715965, 0.04226148501038551, -0.08704917877912521, 0.1550145447254181, 0.041387442499399185, -0.2957608103752136, 0.04185236990451813, -0.047996312379837036, 0.03759245201945305, -0.05201224982738495, 0.2219116985797882, 0.08800795674324036, -0.04901951551437378, -0.09947378933429718, -0.24007278680801392, 0.16992902755737305, 0.20296256244182587, -0.10235918313264847, 0.06751643121242523, -0.18880227208137512, 0.049969401210546494, -0.03805741295218468, 0.07048654556274414, 0.011110842227935791, -0.03835855424404144, 0.022049259394407272, 0.07358511537313461, -0.0008412341121584177, 0.1489613950252533, -0.03275347128510475, -0.15098077058792114, 0.0923290029168129, 0.0058713871985673904, -0.2160254269838333, 0.012788910418748856, 0.2866777181625366, -0.007577773183584213, -0.09612693637609482, 0.06935203075408936, -0.2079334706068039, 0.055482909083366394, 0.20281098783016205, -0.0688953697681427, -0.04410160705447197, -0.05102243646979332, 0.0696943998336792, 0.058132752776145935, -0.15422730147838593, 0.07272615283727646, -0.10840483009815216, -0.08294206857681274, -0.12504613399505615, 0.15828949213027954, -0.03243668004870415, -0.022322703152894974, -0.115634985268116, 0.2424800992012024, 0.060571759939193726, 0.1007547676563263, 0.2431986778974533, -0.046299953013658524, -0.05283990502357483, 0.07504962384700775, 0.10892752557992935, 0.0074929129332304, 0.020188340917229652, -0.21221549808979034, -0.09781662374734879, 0.06307347118854523, -0.15651017427444458, -0.09700477123260498, 0.02423962578177452, -0.0553300566971302, 0.09261566400527954, -0.1414652317762375, 0.09405994415283203, 0.01613369956612587, 0.061498772352933884, -0.24161772429943085, 0.08418817818164825, 0.04509225860238075, 0.14908315241336823, 0.07457249611616135, -0.02087286114692688, -0.011773240752518177, -0.092066690325737, 0.31934309005737305, 0.0008668939117342234, 0.1306294947862625, -0.005959778092801571, -0.06737181544303894, -0.007979979738593102, -0.08785781264305115, 0.1129252091050148, 0.06639072299003601, -0.036501556634902954, 0.10971441119909286, 0.15065997838974, 0.19198456406593323, -0.047258976846933365, 0.07569855451583862, 0.12726065516471863, -0.03876936808228493, 0.13575102388858795, -0.045524969696998596, 0.092990443110466, -0.09018249064683914, -0.08222930878400803, 0.005946958903223276, -0.008964134380221367, -0.024837825447320938, 0.17717336118221283, 0.09381436556577682, -0.1017141044139862, 0.08192837238311768, -0.0069792792201042175, -0.19332662224769592, -0.18373414874076843, -0.0931391641497612, 0.009625057689845562, 0.08321855217218399, -0.01474839448928833, -0.021265381947159767, -0.0546162985265255, 0.05355355888605118, 0.14360782504081726, 0.07230252027511597, 0.17221221327781677, -0.08826281875371933, -0.01325986161828041, -0.0014542746357619762, 0.11616243422031403, -0.06157578155398369, 0.2669998109340668, -0.12542887032032013, -0.15887942910194397, -0.1762077957391739, -0.23331400752067566, 0.08755937963724136, -0.12505438923835754, -0.167854443192482, 0.07074777036905289, -0.11753660440444946, -0.010794924572110176, 0.017547983676195145, 0.059825628995895386, 0.1212158054113388, -0.22151286900043488, -0.04916002228856087, -0.13049514591693878, -0.03815371170639992, 0.022922193631529808, -0.006182762794196606, 0.11541379988193512, -0.15007473528385162, 0.007673997897654772, 0.03251880779862404, -0.0027778807561844587, -0.04013305529952049, 0.08538226038217545, 0.07292325794696808, 0.021703414618968964, 0.32803839445114136, 0.11972265690565109, -0.021090444177389145, -0.020415745675563812, 0.023561889305710793, -0.034829914569854736, 0.05011608824133873, 0.04397209733724594, 0.12608401477336884, 0.12314969301223755, 0.15286636352539062, -0.07480110228061676, -0.07933025807142258, -0.023483196273446083, -0.06330058723688126, 0.16966117918491364, 0.06507586687803268, 0.09885668009519577, -0.04633776471018791, -0.03107045218348503, 0.1616750955581665, -0.021999644115567207, 0.06593915820121765, -0.25980448722839355, 0.10328810662031174, -0.00033697253093123436, -0.09173375368118286, -0.0692141205072403, 0.12371315062046051, -0.0660998597741127, 0.09665719419717789, -0.11128094047307968, -0.03664547577500343, 0.045129988342523575, 0.05471593141555786, 0.07660280168056488, -0.010243785567581654, 0.05504331737756729, -0.012352230027318, -0.04488354176282883, -0.12898299098014832, -0.007317479699850082, -0.01507044117897749, 0.06508033722639084, 0.0020774714648723602, 0.08241018652915955, -0.00523186894133687, -0.09103109687566757, -0.15060602128505707, 0.0391170009970665, -0.03474912792444229, -0.1208033636212349, 0.08128131926059723, 0.17001725733280182, -0.00964860524982214, -0.009585650637745857, 0.020575281232595444, 0.04346730187535286, -0.10801835358142853, 0.07157708704471588, -0.05584416538476944, 0.060655377805233, -0.06117263063788414, 0.06239179149270058, 0.2116210162639618, 0.20731739699840546, 0.20631477236747742, 0.18202370405197144, 0.01789068430662155, 0.007358606904745102, -0.032926302403211594, 0.15268824994564056, -0.09146300703287125, 0.07526269555091858, 0.06283692270517349, 0.09223287552595139, -0.24460437893867493, -0.1537303924560547, 0.07608404010534286, 0.16138756275177002, -0.08496081084012985, -0.04922379180788994, 0.055933479219675064, -0.05144083872437477, -0.2642955183982849, -0.061269767582416534, 0.11973267793655396, -0.09945269674062729, -0.1007123813033104, -0.06007221341133118, -2.65043854067686e-32, 0.004222497344017029, 0.02237684838473797, -0.007111780811101198, 0.03630691021680832, 0.01794559694826603, 0.01685480587184429, -0.02480996958911419, -0.005494825541973114, -0.00875858310610056, -0.014235076494514942, -0.21026188135147095, 0.08158828318119049, 0.14208188652992249, -0.043299999088048935, 0.05547569319605827, -0.08163216710090637, 0.11608809232711792, -0.19628849625587463, -0.004078549332916737, 0.061928603798151016, 0.1186789870262146, 0.014638135209679604, 0.13322408497333527, 0.05432617664337158, -0.06116762012243271, -0.050717517733573914, -0.0750381126999855, -0.26142844557762146, -0.06515435874462128, -0.008609400130808353, -0.09646817296743393, 0.12681357562541962, 0.024243418127298355, -0.03779638186097145, -0.07329607009887695, -0.1425233781337738, -0.2215634435415268, 0.05215979367494583, 0.07216562330722809, -0.09946468472480774, -0.15184567868709564, 0.14087936282157898, 0.14968688786029816, 0.03321902081370354, -0.006448189727962017, -0.002236024010926485, -0.003452457720413804, -0.023824283853173256, -0.17220059037208557, -0.19958911836147308, 0.12476718425750732, -0.03161291405558586, 0.09274429827928543, 0.031896740198135376, -0.09389365464448929, -0.25210514664649963, 0.04827521741390228, 0.06898298859596252, -0.13148915767669678, 0.05917235463857651, 0.24515002965927124, -0.08736523240804672, 0.016169149428606033, -0.045359592884778976, -0.0004610107862390578, -0.08152033388614655, 0.20728443562984467, 0.10431566834449768, 0.20821860432624817, -0.030961526557803154, -0.06920779496431351, 0.13098788261413574, -0.20472893118858337, -0.04567849263548851, 0.03345967084169388, -0.06299073249101639, -0.17366281151771545, 0.01624484732747078, -0.0027492817025631666, 0.09968101978302002, -0.026652270928025246, -0.1535899043083191, 0.10334891825914383, -0.006937015801668167, -0.016387606039643288, -0.0853547751903534, 0.04898805171251297, -0.008197011426091194, -0.039057839661836624, -0.05251270905137062, -0.05262819677591324, 0.1638900488615036, -0.034296467900276184, -0.012647113762795925, 0.03319773077964783, 0.24908317625522614, -0.07963721454143524, 0.03593898564577103, -0.1609601378440857, -0.04870797321200371, 0.04949748516082764, -0.08680611848831177, 0.19536782801151276, -0.10173891484737396, 0.04620892181992531, 0.02492663823068142, 0.16443173587322235, -0.039196718484163284, -0.10541659593582153, -0.03371664881706238, -0.1686714142560959, 0.1700701117515564, 0.036363087594509125, 0.207026407122612, 0.15906663239002228, -0.05675497278571129, 0.043992914259433746, -0.1279703825712204, 0.052308980375528336, 0.2237345576286316, -0.08724123984575272, -0.004674322437494993, -0.14638715982437134, 0.013736710883677006, 0.013480700552463531, 0.11420777440071106, -0.2545510530471802, -0.1600145697593689, 0.13871783018112183, 0.05487643554806709, 0.01808100938796997, -0.0070495870895683765, 7.268827175721526e-7, -0.16743692755699158, 0.0273304246366024, -0.0018395062070339918, 0.1572040468454361, 0.07386630028486252, 0.08812426775693893, -0.04223918914794922, 0.18770340085029602, -0.018298177048563957, 0.05270587280392647, 0.1843668818473816, -0.0989469364285469, 0.009668559767305851, -0.02629060670733452, -0.008036252111196518, -0.14631186425685883, -0.26651206612586975, 0.04921753704547882, -0.06408661603927612, -0.01940266415476799, 0.07335076481103897, 0.08266696333885193, -0.04955112189054489, -0.13246336579322815, 0.06493215262889862, -0.0447319857776165, 0.023576321080327034, -0.04002995789051056, 0.007962783798575401, 0.03420416638255119, -0.0037437896244227886, -0.06650301069021225, 0.1476154327392578, 0.1526118516921997, -0.050420038402080536, -0.038360532373189926, -0.21372447907924652, -0.012071467936038971, -0.016134899109601974, -0.07992180436849594, 0.031159482896327972, 0.018129773437976837, 0.05341876670718193, -0.08217651396989822, 0.19218669831752777, 0.13529464602470398, -0.011586745269596577, -0.03854265809059143, -0.06886730343103409, 0.05013708397746086, -0.0524078868329525, 0.08072645217180252, 0.07375526428222656, 0.1654546707868576, -0.03200012445449829, -0.08330739289522171, 0.02003316953778267, -0.17686496675014496, 0.20611482858657837, -0.021779920905828476, -0.0839715227484703, -0.053331077098846436, 0.047837335616350174, -0.03792224079370499, -0.04892844706773758, 0.1297931671142578, -0.05939957872033119, 9.282086121213514e-38, -0.06218817085027695, 0.07804404199123383, -0.08301036059856415, -0.12415019422769547, -0.07544320821762085, -0.060187049210071564, -0.08397602289915085, 0.11343493312597275, -0.08068407326936722, -0.11837419867515564, -0.12460194528102875 ]
https://github.com/huggingface/datasets/issues/6267
Multi label class encoding
You can use a `Sequence(ClassLabel(...))` feature type to represent a list of labels, and `cast_column`/`cast` to perform the "string to label" conversion (`class_encode_column` does support nested fields), e.g., in your case: ```python from datasets import Dataset, Sequence, ClassLabel data = { 'text': ['one', 'two', 'three', 'four'], 'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']] } dataset = Dataset.from_dict(data) dataset = dataset.cast_column('labels', Sequence(ClassLabel(names=["a", "b", "c", "d"]))) ```
### Feature request I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels. Here's an example of what I'd like to encode: ``` data = { 'text': ['one', 'two', 'three', 'four'], 'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']] } dataset = Dataset.from_dict(data) dataset = dataset.class_encode_column('labels') ``` I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow. I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected. After digging more I did notice a few issues - After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this. - I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior. ### Motivation See above - would like to support multi label class encodings. ### Your contribution This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests.
66
Multi label class encoding ### Feature request I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels. Here's an example of what I'd like to encode: ``` data = { 'text': ['one', 'two', 'three', 'four'], 'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']] } dataset = Dataset.from_dict(data) dataset = dataset.class_encode_column('labels') ``` I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow. I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected. After digging more I did notice a few issues - After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this. - I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior. ### Motivation See above - would like to support multi label class encodings. ### Your contribution This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests. You can use a `Sequence(ClassLabel(...))` feature type to represent a list of labels, and `cast_column`/`cast` to perform the "string to label" conversion (`class_encode_column` does support nested fields), e.g., in your case: ```python from datasets import Dataset, Sequence, ClassLabel data = { 'text': ['one', 'two', 'three', 'four'], 'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']] } dataset = Dataset.from_dict(data) dataset = dataset.cast_column('labels', Sequence(ClassLabel(names=["a", "b", "c", "d"]))) ```
[ -0.0516032837331295, 0.37303945422172546, 0.06480216234922409, 0.037810102105140686, 0.19814683496952057, 0.038758739829063416, 0.07895494252443314, 0.09392275661230087, -0.14809191226959229, 0.002135738031938672, 0.040449049323797226, -0.012604251503944397, 0.015641745179891586, 0.18803229928016663, 0.07598191499710083, -0.09243763238191605, -0.11684251576662064, -0.03176802769303322, -0.031138982623815536, 0.08327311277389526, -0.03194509819149971, 0.014394758269190788, 0.1668880730867386, 0.0941605195403099, -0.0424932986497879, -0.10222489386796951, -0.1686694324016571, -0.08160621672868729, -0.08906552195549011, -0.18465369939804077, 0.1872411072254181, 0.2404380440711975, 0.15594562888145447, -0.008713471703231335, 0.0000052260252232372295, 0.03738245368003845, 0.054881252348423004, -0.06598683446645737, -0.06672810018062592, 0.038338061422109604, 0.005956440232694149, -0.04629077762365341, 0.11514870822429657, -0.01992959901690483, -0.030008448287844658, -0.0335184670984745, -0.00842093676328659, -0.011382629163563251, 0.16107243299484253, -0.057506218552589417, -0.0650232583284378, -0.19130082428455353, -0.19055284559726715, -0.032492250204086304, 0.04528813809156418, 0.1221555545926094, 0.03782268613576889, 0.04177822545170784, -0.2029014378786087, 0.163254514336586, 0.009789546020328999, 0.05343217775225639, -0.0065858936868608, -0.02945130504667759, -0.05812915787100792, -0.12031985074281693, -0.03230194002389908, -0.1982928216457367, 0.04460619390010834, 0.03808305040001869, -0.001334533910267055, 0.06684692949056625, -0.14790576696395874, 0.0844622552394867, 0.0654996857047081, -0.27367913722991943, 0.03219390660524368, -0.021954050287604332, -0.01867825724184513, 0.012428632006049156, -0.05256671831011772, 0.09170829504728317, 0.018660372123122215, -0.05479273945093155, -0.14294999837875366, -0.04027533158659935, -0.034736502915620804, 0.1462075114250183, 0.030206186696887016, -0.03662337735295296, -0.025280483067035675, 0.04303239658474922, 0.13207979500293732, 0.05872470885515213, 0.05299011245369911, 0.025621455162763596, -0.17193099856376648, -0.14273394644260406, 0.15684238076210022, 0.03839189559221268, -0.06263446807861328, 0.14519043266773224, -0.05186498537659645, -0.29958099126815796, 0.029934639111161232, 0.02526337280869484, -0.0479188896715641, 0.01915724389255047, -0.05752072110772133, -0.0654110312461853, -0.10617291927337646, 0.011551707983016968, -0.14496493339538574, 0.0527159720659256, 0.25952789187431335, 0.12803177535533905, -0.07497809082269669, 0.15487335622310638, 0.14484940469264984, 0.01725941337645054, 0.021702399477362633, 0.03966432809829712, 0.048857785761356354, 0.07933859527111053, 0.25437524914741516, 0.14399291574954987, 0.0029217032715678215, -0.12251042574644089, 0.029863497242331505, 0.01967564970254898, 0.03137168660759926, 0.026661038398742676, 0.04166504368185997, 0.08209888637065887, 0.06354178488254547, 0.0911618322134018, -0.08732309192419052, -0.12369564920663834, 0.05090028792619705, -0.1245293989777565, -0.05831008404493332, 0.1565924882888794, -0.07934350520372391, -0.07984983175992966, -0.03027747943997383, 0.1566532403230667, 0.10641812533140182, 0.00567993987351656, -0.019593937322497368, 0.0011586087057366967, -0.1087111160159111, 0.1110030859708786, -0.17673249542713165, -0.023193536326289177, -0.0557495653629303, 0.09301616996526718, 0.11902426928281784, 0.008224898017942905, -0.023071659728884697, -0.09300699084997177, 0.08420295268297195, -0.042215295135974884, -0.015759682282805443, -0.036003537476062775, 0.04772375896573067, 0.09284119307994843, 0.1281806230545044, -0.196106418967247, 0.24773789942264557, 0.04332369565963745, -0.028969798237085342, -0.029297567903995514, -0.08827624469995499, -0.2202109545469284, 0.003188340924680233, 0.053703319281339645, -0.17531698942184448, -0.08283364772796631, -0.1825994849205017, -0.08825893700122833, -0.06749370694160461, -0.10820752382278442, 0.40038976073265076, -0.041071634739637375, 0.20151853561401367, 0.008045285940170288, 0.14605562388896942, 0.09866713732481003, -0.04936373606324196, -0.1926085203886032, -0.16171716153621674, -0.011518036015331745, 0.05243019759654999, -0.07326213270425797, -0.012126055546104908, -0.035813022404909134, -0.005486535374075174, -0.08926240354776382, -0.07277578115463257, -0.20482558012008667, -0.08892723172903061, 0.02162986993789673, -0.21055801212787628, -0.03238741680979729, -0.10737533867359161, 0.06582245230674744, -0.14547500014305115, -0.04903537780046463, -0.026676880195736885, -0.01190644595772028, -0.041501615196466446, -0.06648222357034683, 0.0759228989481926, -0.03835136815905571, -0.1457667499780655, -0.058469001203775406, -0.012716555036604404, -0.002969448221847415, -0.24276438355445862, 0.03754144161939621, 0.008898986503481865, 0.0744120255112648, -0.04132123664021492, 0.12927666306495667, 0.04302274063229561, -0.005940244998782873, -0.013540760613977909, -0.037008136510849, -0.056878380477428436, 0.12996073067188263, 0.0032090747263282537, -0.059283796697854996, 0.1975460648536682, -0.09426948428153992, -0.009383760392665863, -0.24807846546173096, -0.10472440719604492, -0.1803583949804306, 0.17488087713718414, 0.08606480062007904, -0.21395066380500793, -0.04348888620734215, -0.15821364521980286, -0.010897351428866386, -0.22894255816936493, 0.055383939296007156, -0.1729867309331894, 0.060738615691661835, -0.04940395802259445, 0.025440910831093788, 0.18901999294757843, 0.007237067446112633, -0.23276597261428833, -0.03140883892774582, -0.025525877252221107, -0.13551448285579681, -0.0539955236017704, 0.11923501640558243, 0.10634024441242218, -0.0064744967967271805, 0.30084940791130066, 0.00007797073340043426, 0.0800827220082283, -0.049909502267837524, 0.13676166534423828, 0.03907446190714836, 0.04335475340485573, 0.08388680219650269, 0.013547194190323353, 0.07568300515413284, 0.09425332397222519, -0.018963176757097244, -0.08216603845357895, 0.10309316217899323, -0.03593818098306656, -0.28163355588912964, -0.016472607851028442, 0.03348610922694206, -0.00339106353931129, 0.14361944794654846, -0.22915096580982208, -0.12535764276981354, 0.1406642347574234, -0.09991508722305298, 0.0625990480184555, 0.10485665500164032, -0.183923602104187, -0.052439603954553604, -0.13190537691116333, -0.053165633231401443, -0.10911067575216293, -0.04217822104692459, 0.09360824525356293, -0.13835616409778595, 0.13818441331386566, -0.025639668107032776, -0.12123765796422958, -0.23544849455356598, 0.06399717926979065, 0.08830985426902771, 0.030501963570713997, 0.14480739831924438, 0.14947235584259033, -0.00859147123992443, -0.055337995290756226, -0.06034478545188904, -0.036334868520498276, 0.17833386361598969, -0.16348373889923096, 0.02551901713013649, -0.13902246952056885, 0.0037628277204930782, -0.12966890633106232, -0.18899743258953094, 0.10617250949144363, -0.03313850238919258, -0.2621431052684784, -0.14071273803710938, 0.1325201690196991, 0.09894389659166336, 0.12120462208986282, 0.037302881479263306, -0.00030445624724961817, -0.04455847665667534, -0.10324297100305557, 0.025618446990847588, -0.19613349437713623, -0.1755729764699936, 0.2286818027496338, -0.003590390319004655, 0.038694024085998535, 0.16070963442325592, -0.06772956252098083, -0.11450188606977463, 0.13733747601509094, -0.09232529997825623, -0.229562908411026, -0.02143985405564308, 0.09808161854743958, -0.03658834844827652, -0.00673698028549552, -0.06641653925180435, -0.0378694161772728, 0.05011908337473869, 0.09835512191057205, 0.042318444699048996, -0.0511179156601429, 0.007466713432222605, -0.04981239140033722, 0.03873797506093979, -0.0549854151904583, 0.2089754045009613, 0.07254665344953537, -0.06610848009586334, -0.004863368347287178, 0.2108011394739151, -0.1900639533996582, 0.06456287950277328, -0.3181942105293274, -0.031086724251508713, -0.12223965674638748, 0.07646889239549637, -0.04330715164542198, 0.02553625777363777, 0.09475186467170715, 0.16173094511032104, 0.3038448989391327, -0.006988138891756535, -0.03123294562101364, -0.05791851505637169, -0.07548224180936813, -0.05435860529541969, -0.12322209775447845, 0.033505428582429886, 0.020919624716043472, -0.03885721042752266, 0.1645420789718628, 0.007646918762475252, 0.30054962635040283, 0.01748635619878769, -0.034592144191265106, -0.1954418420791626, -0.12042296677827835, -0.0015657342737540603, 0.03844548016786575, -0.043264929205179214, 0.17301690578460693, -0.06861425191164017, -0.16004398465156555, 0.060588736087083817, 0.14732635021209717, -0.06762684881687164, -0.11187076568603516, -0.036947596818208694, -0.22973939776420593, 0.12106990069150925, 0.18550240993499756, 0.06324509531259537, 0.28534555435180664, 0.017948482185602188, 0.2094307243824005, 0.027488304302096367, -0.12210042029619217, -0.0006181995267979801, 0.18968075513839722, 0.005115855019539595, 0.12218715250492096, -0.026724325492978096, 0.08195139467716217, -0.2000565528869629, -0.07180125266313553, 0.13206882774829865, -0.10129272937774658, -0.022328874096274376, 0.24610525369644165, -0.18051040172576904, -0.1417486071586609, 0.031007524579763412, 0.0636131763458252, -0.29811593890190125, -0.08850488811731339, -0.044242896139621735, 0.1723400205373764, 0.1126246228814125, 0.024952959269285202, -0.16039328277111053, -0.20018665492534637, -0.007712853606790304, 0.04097265377640724, 0.06819100677967072, -0.1029370129108429, 0.15780659019947052, -0.11936359107494354, -0.025874681770801544, 0.1436535269021988, -0.08622220903635025, 0.264231413602829, -0.025806879624724388, -0.159611776471138, -0.04785383492708206, -0.1491830199956894, 0.09729710221290588, 0.016331572085618973, -0.12062972038984299, -0.010595045052468777, -0.1364964246749878, -0.08187274634838104, -0.19718679785728455, -0.20358906686306, 0.03481969237327576, -0.1575624793767929, -0.08680350333452225, -0.08674509078264236, -0.025563426315784454, 0.09079402685165405, 0.01774834655225277, 0.04040762037038803, -0.043187327682971954, -0.08241114020347595, 0.11429880559444427, 0.0480271577835083, -0.05011485889554024, 0.047973260283470154, 0.18029974400997162, -0.010863636620342731, 0.1297093629837036, 0.2817143201828003, -0.022481460124254227, -0.025841636583209038, 0.15043769776821136, -0.08585812896490097, 0.06916716694831848, -0.06315743178129196, 0.011600648052990437, 0.11163973063230515, -0.059761565178632736, 0.11040997505187988, 0.048937007784843445, -0.07252487540245056, 0.2052716165781021, 0.11212804168462753, 0.06602786481380463, 0.03805231302976608, -0.06417077779769897, 0.09181524068117142, 0.06553008407354355, -0.06033271551132202, -0.11404260247945786, -0.15402281284332275, 0.024365637451410294, -0.025035396218299866, -0.07492274045944214, -0.004535882268100977, -0.02828275039792061, 0.1795564889907837, -0.02093631774187088, 0.1528192013502121, 0.05888674780726433, -0.12161296606063843, 0.0970056802034378, -0.08404704928398132, -0.04978087916970253, -0.009225313551723957, 0.016834231093525887, -0.04254257306456566, -0.11177558451890945, -0.02931932359933853, 0.03578348085284233, 0.11434050649404526, 0.11677836626768112, 0.1519232988357544, 0.10381395369768143, -0.017276398837566376, 0.07264011353254318, -0.1439676433801651, -0.0729450061917305, -0.15202853083610535, 0.12651540338993073, -0.0023155745584517717, 0.037228796631097794, 0.0074035306461155415, -0.0441952608525753, 0.09287155419588089, -0.20634785294532776, -0.1587286740541458, -0.04416685923933983, 0.025267722085118294, -0.20076966285705566, 0.0012642836663872004, 0.15199925005435944, 0.03509588912129402, 0.039870575070381165, 0.08875676989555359, -0.07613810896873474, 0.021097932010889053, 0.1557171791791916, 0.13703547418117523, -0.10266826301813126, 0.17590509355068207, -0.15959136188030243, 0.03188017010688782, -0.12111297249794006, 0.044458720833063126, -0.006478508934378624, 0.12974286079406738, -0.03172968327999115, -0.01262758206576109, -0.12957319617271423, 0.09713976085186005, 0.003949028439819813, 0.093102365732193, -0.009254633449018002, 0.020159142091870308, -0.14330701529979706, -0.006497012451291084, -2.514120868915815e-32, -0.064266636967659, -0.0893075168132782, -0.19334882497787476, 0.038941286504268646, -0.06735902279615402, -0.06191086769104004, 0.047973234206438065, 0.05499890074133873, 0.04114213213324547, 0.03340767323970795, 0.08538950979709625, -0.0019868852104991674, 0.009369974955916405, 0.09348822385072708, 0.21303246915340424, 0.006123181898146868, 0.053970593959093094, 0.07293204963207245, -0.005280578508973122, 0.07363694906234741, 0.22591976821422577, 0.041106849908828735, 0.24672435224056244, 0.019757553935050964, 0.04103776440024376, -0.14296366274356842, -0.07786966115236282, -0.12865625321865082, -0.020583301782608032, 0.06468024849891663, -0.10515237599611282, 0.15690426528453827, 0.011611667461693287, -0.025940855965018272, 0.011929242871701717, -0.01918928138911724, -0.06301677227020264, -0.06759285926818848, -0.36310875415802, 0.07482846081256866, -0.00022385096235666424, 0.03607795760035515, 0.16869999468326569, -0.037441499531269073, -0.040818993002176285, 0.04321245476603508, -0.06901581585407257, 0.007581386715173721, -0.08477778732776642, -0.11286051571369171, 0.0292208194732666, -0.0758335217833519, -0.07857401669025421, 0.12619347870349884, 0.03259095177054405, 0.05177316069602966, 0.055896881967782974, 0.06117785722017288, -0.08686333894729614, 0.07362140715122223, 0.07002505660057068, 0.11737658828496933, 0.08373834192752838, 0.04712687060236931, -0.021669605746865273, 0.14210927486419678, 0.17215216159820557, -0.003048236947506666, 0.09738785773515701, 0.1936768740415573, 0.04619406908750534, -0.09752678126096725, 0.23756994307041168, 0.08284959942102432, -0.03608843684196472, 0.03836207464337349, -0.05098828300833702, 0.03632624074816704, -0.0734640508890152, -0.33991652727127075, -0.06816238909959793, 0.14817050099372864, 0.17832818627357483, -0.0009340073447674513, -0.13466358184814453, -0.034319888800382614, 0.028905758634209633, 0.10054806619882584, 0.013109632767736912, -0.19766369462013245, -0.1371748298406601, 0.12994728982448578, -0.02049427106976509, 0.02209579013288021, -0.25524675846099854, 0.09760159254074097, -0.08888454735279083, 0.19419485330581665, -0.09823234379291534, 0.023142049089074135, 0.12362480908632278, -0.07646166533231735, 0.08042193949222565, -0.13437777757644653, 0.12684233486652374, -0.07108259201049805, 0.11146517097949982, 0.015974143519997597, -0.19554740190505981, 0.0037494448479264975, -0.060044895857572556, -0.1637037992477417, 0.16890819370746613, -0.0027251504361629486, 0.1261322796344757, -0.16639693081378937, -0.040580667555332184, 0.08672516793012619, 0.19767408072948456, 0.05225314572453499, -0.08679620921611786, -0.05108761042356491, 0.046749893575906754, -0.059444185346364975, 0.04216967895627022, -0.021352076902985573, -0.05399050563573837, -0.04663761705160141, 0.18307852745056152, 0.07109709084033966, 0.03561853989958763, 0.025952761992812157, 6.958608196327987e-7, 0.09211374819278717, 0.07733690738677979, 0.1485031545162201, -0.12717673182487488, -0.15013661980628967, 0.21622437238693237, 0.03492645174264908, 0.026205183938145638, 0.09045343846082687, -0.17111708223819733, 0.08721509575843811, -0.1719808280467987, 0.08451136946678162, 0.09071412682533264, 0.1146450862288475, -0.10043741762638092, -0.05963226780295372, 0.14768658578395844, -0.1911608874797821, 0.20281504094600677, 0.43776723742485046, 0.10506360977888107, 0.0011279761092737317, -0.016969995573163033, 0.08543878048658371, 0.05701003223657608, -0.09315398335456848, 0.1223604679107666, 0.11100619286298752, -0.10108057409524918, -0.16152414679527283, -0.05462121218442917, 0.08832228928804398, 0.1492260992527008, -0.03851369395852089, -0.12798447906970978, 0.016220510005950928, 0.09693331271409988, -0.12795333564281464, 0.0428343266248703, -0.015185671858489513, 0.11234820634126663, -0.005763724446296692, 0.06519970297813416, -0.026796512305736542, 0.04916108027100563, -0.2975552976131439, 0.10765622556209564, -0.056901220232248306, 0.11534009128808975, 0.054289985448122025, 0.07310313731431961, 0.13975797593593597, 0.19503025710582733, -0.03890220448374748, 0.1477050632238388, -0.1340738832950592, -0.12372414022684097, 0.06816528737545013, -0.1443859189748764, -0.06762038171291351, 0.02607286535203457, -0.18068499863147736, -0.025932954624295235, -0.021699637174606323, -0.2149837464094162, -0.06550923734903336, 1.1984915661814313e-34, -0.0036077385302633047, -0.013131402432918549, 0.04069523885846138, 0.14422520995140076, -0.038031574338674545, -0.16971689462661743, 0.10412168502807617, 0.11982456594705582, 0.07876557111740112, -0.05685998126864433, -0.14623409509658813 ]
https://github.com/huggingface/datasets/issues/6267
Multi label class encoding
Great! Can you elaborate on "class_encode_column does support nested fields"? Do you mean that there is a way to `class_encode_column` on a Sequence?
### Feature request I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels. Here's an example of what I'd like to encode: ``` data = { 'text': ['one', 'two', 'three', 'four'], 'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']] } dataset = Dataset.from_dict(data) dataset = dataset.class_encode_column('labels') ``` I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow. I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected. After digging more I did notice a few issues - After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this. - I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior. ### Motivation See above - would like to support multi label class encodings. ### Your contribution This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests.
23
Multi label class encoding ### Feature request I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels. Here's an example of what I'd like to encode: ``` data = { 'text': ['one', 'two', 'three', 'four'], 'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']] } dataset = Dataset.from_dict(data) dataset = dataset.class_encode_column('labels') ``` I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow. I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected. After digging more I did notice a few issues - After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this. - I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior. ### Motivation See above - would like to support multi label class encodings. ### Your contribution This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests. Great! Can you elaborate on "class_encode_column does support nested fields"? Do you mean that there is a way to `class_encode_column` on a Sequence?
[ -0.0516032837331295, 0.37303945422172546, 0.06480216234922409, 0.037810102105140686, 0.19814683496952057, 0.038758739829063416, 0.07895494252443314, 0.09392275661230087, -0.14809191226959229, 0.002135738031938672, 0.040449049323797226, -0.012604251503944397, 0.015641745179891586, 0.18803229928016663, 0.07598191499710083, -0.09243763238191605, -0.11684251576662064, -0.03176802769303322, -0.031138982623815536, 0.08327311277389526, -0.03194509819149971, 0.014394758269190788, 0.1668880730867386, 0.0941605195403099, -0.0424932986497879, -0.10222489386796951, -0.1686694324016571, -0.08160621672868729, -0.08906552195549011, -0.18465369939804077, 0.1872411072254181, 0.2404380440711975, 0.15594562888145447, -0.008713471703231335, 0.0000052260252232372295, 0.03738245368003845, 0.054881252348423004, -0.06598683446645737, -0.06672810018062592, 0.038338061422109604, 0.005956440232694149, -0.04629077762365341, 0.11514870822429657, -0.01992959901690483, -0.030008448287844658, -0.0335184670984745, -0.00842093676328659, -0.011382629163563251, 0.16107243299484253, -0.057506218552589417, -0.0650232583284378, -0.19130082428455353, -0.19055284559726715, -0.032492250204086304, 0.04528813809156418, 0.1221555545926094, 0.03782268613576889, 0.04177822545170784, -0.2029014378786087, 0.163254514336586, 0.009789546020328999, 0.05343217775225639, -0.0065858936868608, -0.02945130504667759, -0.05812915787100792, -0.12031985074281693, -0.03230194002389908, -0.1982928216457367, 0.04460619390010834, 0.03808305040001869, -0.001334533910267055, 0.06684692949056625, -0.14790576696395874, 0.0844622552394867, 0.0654996857047081, -0.27367913722991943, 0.03219390660524368, -0.021954050287604332, -0.01867825724184513, 0.012428632006049156, -0.05256671831011772, 0.09170829504728317, 0.018660372123122215, -0.05479273945093155, -0.14294999837875366, -0.04027533158659935, -0.034736502915620804, 0.1462075114250183, 0.030206186696887016, -0.03662337735295296, -0.025280483067035675, 0.04303239658474922, 0.13207979500293732, 0.05872470885515213, 0.05299011245369911, 0.025621455162763596, -0.17193099856376648, -0.14273394644260406, 0.15684238076210022, 0.03839189559221268, -0.06263446807861328, 0.14519043266773224, -0.05186498537659645, -0.29958099126815796, 0.029934639111161232, 0.02526337280869484, -0.0479188896715641, 0.01915724389255047, -0.05752072110772133, -0.0654110312461853, -0.10617291927337646, 0.011551707983016968, -0.14496493339538574, 0.0527159720659256, 0.25952789187431335, 0.12803177535533905, -0.07497809082269669, 0.15487335622310638, 0.14484940469264984, 0.01725941337645054, 0.021702399477362633, 0.03966432809829712, 0.048857785761356354, 0.07933859527111053, 0.25437524914741516, 0.14399291574954987, 0.0029217032715678215, -0.12251042574644089, 0.029863497242331505, 0.01967564970254898, 0.03137168660759926, 0.026661038398742676, 0.04166504368185997, 0.08209888637065887, 0.06354178488254547, 0.0911618322134018, -0.08732309192419052, -0.12369564920663834, 0.05090028792619705, -0.1245293989777565, -0.05831008404493332, 0.1565924882888794, -0.07934350520372391, -0.07984983175992966, -0.03027747943997383, 0.1566532403230667, 0.10641812533140182, 0.00567993987351656, -0.019593937322497368, 0.0011586087057366967, -0.1087111160159111, 0.1110030859708786, -0.17673249542713165, -0.023193536326289177, -0.0557495653629303, 0.09301616996526718, 0.11902426928281784, 0.008224898017942905, -0.023071659728884697, -0.09300699084997177, 0.08420295268297195, -0.042215295135974884, -0.015759682282805443, -0.036003537476062775, 0.04772375896573067, 0.09284119307994843, 0.1281806230545044, -0.196106418967247, 0.24773789942264557, 0.04332369565963745, -0.028969798237085342, -0.029297567903995514, -0.08827624469995499, -0.2202109545469284, 0.003188340924680233, 0.053703319281339645, -0.17531698942184448, -0.08283364772796631, -0.1825994849205017, -0.08825893700122833, -0.06749370694160461, -0.10820752382278442, 0.40038976073265076, -0.041071634739637375, 0.20151853561401367, 0.008045285940170288, 0.14605562388896942, 0.09866713732481003, -0.04936373606324196, -0.1926085203886032, -0.16171716153621674, -0.011518036015331745, 0.05243019759654999, -0.07326213270425797, -0.012126055546104908, -0.035813022404909134, -0.005486535374075174, -0.08926240354776382, -0.07277578115463257, -0.20482558012008667, -0.08892723172903061, 0.02162986993789673, -0.21055801212787628, -0.03238741680979729, -0.10737533867359161, 0.06582245230674744, -0.14547500014305115, -0.04903537780046463, -0.026676880195736885, -0.01190644595772028, -0.041501615196466446, -0.06648222357034683, 0.0759228989481926, -0.03835136815905571, -0.1457667499780655, -0.058469001203775406, -0.012716555036604404, -0.002969448221847415, -0.24276438355445862, 0.03754144161939621, 0.008898986503481865, 0.0744120255112648, -0.04132123664021492, 0.12927666306495667, 0.04302274063229561, -0.005940244998782873, -0.013540760613977909, -0.037008136510849, -0.056878380477428436, 0.12996073067188263, 0.0032090747263282537, -0.059283796697854996, 0.1975460648536682, -0.09426948428153992, -0.009383760392665863, -0.24807846546173096, -0.10472440719604492, -0.1803583949804306, 0.17488087713718414, 0.08606480062007904, -0.21395066380500793, -0.04348888620734215, -0.15821364521980286, -0.010897351428866386, -0.22894255816936493, 0.055383939296007156, -0.1729867309331894, 0.060738615691661835, -0.04940395802259445, 0.025440910831093788, 0.18901999294757843, 0.007237067446112633, -0.23276597261428833, -0.03140883892774582, -0.025525877252221107, -0.13551448285579681, -0.0539955236017704, 0.11923501640558243, 0.10634024441242218, -0.0064744967967271805, 0.30084940791130066, 0.00007797073340043426, 0.0800827220082283, -0.049909502267837524, 0.13676166534423828, 0.03907446190714836, 0.04335475340485573, 0.08388680219650269, 0.013547194190323353, 0.07568300515413284, 0.09425332397222519, -0.018963176757097244, -0.08216603845357895, 0.10309316217899323, -0.03593818098306656, -0.28163355588912964, -0.016472607851028442, 0.03348610922694206, -0.00339106353931129, 0.14361944794654846, -0.22915096580982208, -0.12535764276981354, 0.1406642347574234, -0.09991508722305298, 0.0625990480184555, 0.10485665500164032, -0.183923602104187, -0.052439603954553604, -0.13190537691116333, -0.053165633231401443, -0.10911067575216293, -0.04217822104692459, 0.09360824525356293, -0.13835616409778595, 0.13818441331386566, -0.025639668107032776, -0.12123765796422958, -0.23544849455356598, 0.06399717926979065, 0.08830985426902771, 0.030501963570713997, 0.14480739831924438, 0.14947235584259033, -0.00859147123992443, -0.055337995290756226, -0.06034478545188904, -0.036334868520498276, 0.17833386361598969, -0.16348373889923096, 0.02551901713013649, -0.13902246952056885, 0.0037628277204930782, -0.12966890633106232, -0.18899743258953094, 0.10617250949144363, -0.03313850238919258, -0.2621431052684784, -0.14071273803710938, 0.1325201690196991, 0.09894389659166336, 0.12120462208986282, 0.037302881479263306, -0.00030445624724961817, -0.04455847665667534, -0.10324297100305557, 0.025618446990847588, -0.19613349437713623, -0.1755729764699936, 0.2286818027496338, -0.003590390319004655, 0.038694024085998535, 0.16070963442325592, -0.06772956252098083, -0.11450188606977463, 0.13733747601509094, -0.09232529997825623, -0.229562908411026, -0.02143985405564308, 0.09808161854743958, -0.03658834844827652, -0.00673698028549552, -0.06641653925180435, -0.0378694161772728, 0.05011908337473869, 0.09835512191057205, 0.042318444699048996, -0.0511179156601429, 0.007466713432222605, -0.04981239140033722, 0.03873797506093979, -0.0549854151904583, 0.2089754045009613, 0.07254665344953537, -0.06610848009586334, -0.004863368347287178, 0.2108011394739151, -0.1900639533996582, 0.06456287950277328, -0.3181942105293274, -0.031086724251508713, -0.12223965674638748, 0.07646889239549637, -0.04330715164542198, 0.02553625777363777, 0.09475186467170715, 0.16173094511032104, 0.3038448989391327, -0.006988138891756535, -0.03123294562101364, -0.05791851505637169, -0.07548224180936813, -0.05435860529541969, -0.12322209775447845, 0.033505428582429886, 0.020919624716043472, -0.03885721042752266, 0.1645420789718628, 0.007646918762475252, 0.30054962635040283, 0.01748635619878769, -0.034592144191265106, -0.1954418420791626, -0.12042296677827835, -0.0015657342737540603, 0.03844548016786575, -0.043264929205179214, 0.17301690578460693, -0.06861425191164017, -0.16004398465156555, 0.060588736087083817, 0.14732635021209717, -0.06762684881687164, -0.11187076568603516, -0.036947596818208694, -0.22973939776420593, 0.12106990069150925, 0.18550240993499756, 0.06324509531259537, 0.28534555435180664, 0.017948482185602188, 0.2094307243824005, 0.027488304302096367, -0.12210042029619217, -0.0006181995267979801, 0.18968075513839722, 0.005115855019539595, 0.12218715250492096, -0.026724325492978096, 0.08195139467716217, -0.2000565528869629, -0.07180125266313553, 0.13206882774829865, -0.10129272937774658, -0.022328874096274376, 0.24610525369644165, -0.18051040172576904, -0.1417486071586609, 0.031007524579763412, 0.0636131763458252, -0.29811593890190125, -0.08850488811731339, -0.044242896139621735, 0.1723400205373764, 0.1126246228814125, 0.024952959269285202, -0.16039328277111053, -0.20018665492534637, -0.007712853606790304, 0.04097265377640724, 0.06819100677967072, -0.1029370129108429, 0.15780659019947052, -0.11936359107494354, -0.025874681770801544, 0.1436535269021988, -0.08622220903635025, 0.264231413602829, -0.025806879624724388, -0.159611776471138, -0.04785383492708206, -0.1491830199956894, 0.09729710221290588, 0.016331572085618973, -0.12062972038984299, -0.010595045052468777, -0.1364964246749878, -0.08187274634838104, -0.19718679785728455, -0.20358906686306, 0.03481969237327576, -0.1575624793767929, -0.08680350333452225, -0.08674509078264236, -0.025563426315784454, 0.09079402685165405, 0.01774834655225277, 0.04040762037038803, -0.043187327682971954, -0.08241114020347595, 0.11429880559444427, 0.0480271577835083, -0.05011485889554024, 0.047973260283470154, 0.18029974400997162, -0.010863636620342731, 0.1297093629837036, 0.2817143201828003, -0.022481460124254227, -0.025841636583209038, 0.15043769776821136, -0.08585812896490097, 0.06916716694831848, -0.06315743178129196, 0.011600648052990437, 0.11163973063230515, -0.059761565178632736, 0.11040997505187988, 0.048937007784843445, -0.07252487540245056, 0.2052716165781021, 0.11212804168462753, 0.06602786481380463, 0.03805231302976608, -0.06417077779769897, 0.09181524068117142, 0.06553008407354355, -0.06033271551132202, -0.11404260247945786, -0.15402281284332275, 0.024365637451410294, -0.025035396218299866, -0.07492274045944214, -0.004535882268100977, -0.02828275039792061, 0.1795564889907837, -0.02093631774187088, 0.1528192013502121, 0.05888674780726433, -0.12161296606063843, 0.0970056802034378, -0.08404704928398132, -0.04978087916970253, -0.009225313551723957, 0.016834231093525887, -0.04254257306456566, -0.11177558451890945, -0.02931932359933853, 0.03578348085284233, 0.11434050649404526, 0.11677836626768112, 0.1519232988357544, 0.10381395369768143, -0.017276398837566376, 0.07264011353254318, -0.1439676433801651, -0.0729450061917305, -0.15202853083610535, 0.12651540338993073, -0.0023155745584517717, 0.037228796631097794, 0.0074035306461155415, -0.0441952608525753, 0.09287155419588089, -0.20634785294532776, -0.1587286740541458, -0.04416685923933983, 0.025267722085118294, -0.20076966285705566, 0.0012642836663872004, 0.15199925005435944, 0.03509588912129402, 0.039870575070381165, 0.08875676989555359, -0.07613810896873474, 0.021097932010889053, 0.1557171791791916, 0.13703547418117523, -0.10266826301813126, 0.17590509355068207, -0.15959136188030243, 0.03188017010688782, -0.12111297249794006, 0.044458720833063126, -0.006478508934378624, 0.12974286079406738, -0.03172968327999115, -0.01262758206576109, -0.12957319617271423, 0.09713976085186005, 0.003949028439819813, 0.093102365732193, -0.009254633449018002, 0.020159142091870308, -0.14330701529979706, -0.006497012451291084, -2.514120868915815e-32, -0.064266636967659, -0.0893075168132782, -0.19334882497787476, 0.038941286504268646, -0.06735902279615402, -0.06191086769104004, 0.047973234206438065, 0.05499890074133873, 0.04114213213324547, 0.03340767323970795, 0.08538950979709625, -0.0019868852104991674, 0.009369974955916405, 0.09348822385072708, 0.21303246915340424, 0.006123181898146868, 0.053970593959093094, 0.07293204963207245, -0.005280578508973122, 0.07363694906234741, 0.22591976821422577, 0.041106849908828735, 0.24672435224056244, 0.019757553935050964, 0.04103776440024376, -0.14296366274356842, -0.07786966115236282, -0.12865625321865082, -0.020583301782608032, 0.06468024849891663, -0.10515237599611282, 0.15690426528453827, 0.011611667461693287, -0.025940855965018272, 0.011929242871701717, -0.01918928138911724, -0.06301677227020264, -0.06759285926818848, -0.36310875415802, 0.07482846081256866, -0.00022385096235666424, 0.03607795760035515, 0.16869999468326569, -0.037441499531269073, -0.040818993002176285, 0.04321245476603508, -0.06901581585407257, 0.007581386715173721, -0.08477778732776642, -0.11286051571369171, 0.0292208194732666, -0.0758335217833519, -0.07857401669025421, 0.12619347870349884, 0.03259095177054405, 0.05177316069602966, 0.055896881967782974, 0.06117785722017288, -0.08686333894729614, 0.07362140715122223, 0.07002505660057068, 0.11737658828496933, 0.08373834192752838, 0.04712687060236931, -0.021669605746865273, 0.14210927486419678, 0.17215216159820557, -0.003048236947506666, 0.09738785773515701, 0.1936768740415573, 0.04619406908750534, -0.09752678126096725, 0.23756994307041168, 0.08284959942102432, -0.03608843684196472, 0.03836207464337349, -0.05098828300833702, 0.03632624074816704, -0.0734640508890152, -0.33991652727127075, -0.06816238909959793, 0.14817050099372864, 0.17832818627357483, -0.0009340073447674513, -0.13466358184814453, -0.034319888800382614, 0.028905758634209633, 0.10054806619882584, 0.013109632767736912, -0.19766369462013245, -0.1371748298406601, 0.12994728982448578, -0.02049427106976509, 0.02209579013288021, -0.25524675846099854, 0.09760159254074097, -0.08888454735279083, 0.19419485330581665, -0.09823234379291534, 0.023142049089074135, 0.12362480908632278, -0.07646166533231735, 0.08042193949222565, -0.13437777757644653, 0.12684233486652374, -0.07108259201049805, 0.11146517097949982, 0.015974143519997597, -0.19554740190505981, 0.0037494448479264975, -0.060044895857572556, -0.1637037992477417, 0.16890819370746613, -0.0027251504361629486, 0.1261322796344757, -0.16639693081378937, -0.040580667555332184, 0.08672516793012619, 0.19767408072948456, 0.05225314572453499, -0.08679620921611786, -0.05108761042356491, 0.046749893575906754, -0.059444185346364975, 0.04216967895627022, -0.021352076902985573, -0.05399050563573837, -0.04663761705160141, 0.18307852745056152, 0.07109709084033966, 0.03561853989958763, 0.025952761992812157, 6.958608196327987e-7, 0.09211374819278717, 0.07733690738677979, 0.1485031545162201, -0.12717673182487488, -0.15013661980628967, 0.21622437238693237, 0.03492645174264908, 0.026205183938145638, 0.09045343846082687, -0.17111708223819733, 0.08721509575843811, -0.1719808280467987, 0.08451136946678162, 0.09071412682533264, 0.1146450862288475, -0.10043741762638092, -0.05963226780295372, 0.14768658578395844, -0.1911608874797821, 0.20281504094600677, 0.43776723742485046, 0.10506360977888107, 0.0011279761092737317, -0.016969995573163033, 0.08543878048658371, 0.05701003223657608, -0.09315398335456848, 0.1223604679107666, 0.11100619286298752, -0.10108057409524918, -0.16152414679527283, -0.05462121218442917, 0.08832228928804398, 0.1492260992527008, -0.03851369395852089, -0.12798447906970978, 0.016220510005950928, 0.09693331271409988, -0.12795333564281464, 0.0428343266248703, -0.015185671858489513, 0.11234820634126663, -0.005763724446296692, 0.06519970297813416, -0.026796512305736542, 0.04916108027100563, -0.2975552976131439, 0.10765622556209564, -0.056901220232248306, 0.11534009128808975, 0.054289985448122025, 0.07310313731431961, 0.13975797593593597, 0.19503025710582733, -0.03890220448374748, 0.1477050632238388, -0.1340738832950592, -0.12372414022684097, 0.06816528737545013, -0.1443859189748764, -0.06762038171291351, 0.02607286535203457, -0.18068499863147736, -0.025932954624295235, -0.021699637174606323, -0.2149837464094162, -0.06550923734903336, 1.1984915661814313e-34, -0.0036077385302633047, -0.013131402432918549, 0.04069523885846138, 0.14422520995140076, -0.038031574338674545, -0.16971689462661743, 0.10412168502807617, 0.11982456594705582, 0.07876557111740112, -0.05685998126864433, -0.14623409509658813 ]
https://github.com/huggingface/datasets/issues/6267
Multi label class encoding
Sorry, I'm still not following. Are you saying that there currently exists a way to call `class_encode_column` on a `Sequence(ClassLabel)` type? Or that the underlying data structures support it and a contribution of a method to do that would be welcome?
### Feature request I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels. Here's an example of what I'd like to encode: ``` data = { 'text': ['one', 'two', 'three', 'four'], 'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']] } dataset = Dataset.from_dict(data) dataset = dataset.class_encode_column('labels') ``` I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow. I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected. After digging more I did notice a few issues - After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this. - I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior. ### Motivation See above - would like to support multi label class encodings. ### Your contribution This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests.
41
Multi label class encoding ### Feature request I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels. Here's an example of what I'd like to encode: ``` data = { 'text': ['one', 'two', 'three', 'four'], 'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']] } dataset = Dataset.from_dict(data) dataset = dataset.class_encode_column('labels') ``` I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow. I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected. After digging more I did notice a few issues - After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this. - I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior. ### Motivation See above - would like to support multi label class encodings. ### Your contribution This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests. Sorry, I'm still not following. Are you saying that there currently exists a way to call `class_encode_column` on a `Sequence(ClassLabel)` type? Or that the underlying data structures support it and a contribution of a method to do that would be welcome?
[ -0.0516032837331295, 0.37303945422172546, 0.06480216234922409, 0.037810102105140686, 0.19814683496952057, 0.038758739829063416, 0.07895494252443314, 0.09392275661230087, -0.14809191226959229, 0.002135738031938672, 0.040449049323797226, -0.012604251503944397, 0.015641745179891586, 0.18803229928016663, 0.07598191499710083, -0.09243763238191605, -0.11684251576662064, -0.03176802769303322, -0.031138982623815536, 0.08327311277389526, -0.03194509819149971, 0.014394758269190788, 0.1668880730867386, 0.0941605195403099, -0.0424932986497879, -0.10222489386796951, -0.1686694324016571, -0.08160621672868729, -0.08906552195549011, -0.18465369939804077, 0.1872411072254181, 0.2404380440711975, 0.15594562888145447, -0.008713471703231335, 0.0000052260252232372295, 0.03738245368003845, 0.054881252348423004, -0.06598683446645737, -0.06672810018062592, 0.038338061422109604, 0.005956440232694149, -0.04629077762365341, 0.11514870822429657, -0.01992959901690483, -0.030008448287844658, -0.0335184670984745, -0.00842093676328659, -0.011382629163563251, 0.16107243299484253, -0.057506218552589417, -0.0650232583284378, -0.19130082428455353, -0.19055284559726715, -0.032492250204086304, 0.04528813809156418, 0.1221555545926094, 0.03782268613576889, 0.04177822545170784, -0.2029014378786087, 0.163254514336586, 0.009789546020328999, 0.05343217775225639, -0.0065858936868608, -0.02945130504667759, -0.05812915787100792, -0.12031985074281693, -0.03230194002389908, -0.1982928216457367, 0.04460619390010834, 0.03808305040001869, -0.001334533910267055, 0.06684692949056625, -0.14790576696395874, 0.0844622552394867, 0.0654996857047081, -0.27367913722991943, 0.03219390660524368, -0.021954050287604332, -0.01867825724184513, 0.012428632006049156, -0.05256671831011772, 0.09170829504728317, 0.018660372123122215, -0.05479273945093155, -0.14294999837875366, -0.04027533158659935, -0.034736502915620804, 0.1462075114250183, 0.030206186696887016, -0.03662337735295296, -0.025280483067035675, 0.04303239658474922, 0.13207979500293732, 0.05872470885515213, 0.05299011245369911, 0.025621455162763596, -0.17193099856376648, -0.14273394644260406, 0.15684238076210022, 0.03839189559221268, -0.06263446807861328, 0.14519043266773224, -0.05186498537659645, -0.29958099126815796, 0.029934639111161232, 0.02526337280869484, -0.0479188896715641, 0.01915724389255047, -0.05752072110772133, -0.0654110312461853, -0.10617291927337646, 0.011551707983016968, -0.14496493339538574, 0.0527159720659256, 0.25952789187431335, 0.12803177535533905, -0.07497809082269669, 0.15487335622310638, 0.14484940469264984, 0.01725941337645054, 0.021702399477362633, 0.03966432809829712, 0.048857785761356354, 0.07933859527111053, 0.25437524914741516, 0.14399291574954987, 0.0029217032715678215, -0.12251042574644089, 0.029863497242331505, 0.01967564970254898, 0.03137168660759926, 0.026661038398742676, 0.04166504368185997, 0.08209888637065887, 0.06354178488254547, 0.0911618322134018, -0.08732309192419052, -0.12369564920663834, 0.05090028792619705, -0.1245293989777565, -0.05831008404493332, 0.1565924882888794, -0.07934350520372391, -0.07984983175992966, -0.03027747943997383, 0.1566532403230667, 0.10641812533140182, 0.00567993987351656, -0.019593937322497368, 0.0011586087057366967, -0.1087111160159111, 0.1110030859708786, -0.17673249542713165, -0.023193536326289177, -0.0557495653629303, 0.09301616996526718, 0.11902426928281784, 0.008224898017942905, -0.023071659728884697, -0.09300699084997177, 0.08420295268297195, -0.042215295135974884, -0.015759682282805443, -0.036003537476062775, 0.04772375896573067, 0.09284119307994843, 0.1281806230545044, -0.196106418967247, 0.24773789942264557, 0.04332369565963745, -0.028969798237085342, -0.029297567903995514, -0.08827624469995499, -0.2202109545469284, 0.003188340924680233, 0.053703319281339645, -0.17531698942184448, -0.08283364772796631, -0.1825994849205017, -0.08825893700122833, -0.06749370694160461, -0.10820752382278442, 0.40038976073265076, -0.041071634739637375, 0.20151853561401367, 0.008045285940170288, 0.14605562388896942, 0.09866713732481003, -0.04936373606324196, -0.1926085203886032, -0.16171716153621674, -0.011518036015331745, 0.05243019759654999, -0.07326213270425797, -0.012126055546104908, -0.035813022404909134, -0.005486535374075174, -0.08926240354776382, -0.07277578115463257, -0.20482558012008667, -0.08892723172903061, 0.02162986993789673, -0.21055801212787628, -0.03238741680979729, -0.10737533867359161, 0.06582245230674744, -0.14547500014305115, -0.04903537780046463, -0.026676880195736885, -0.01190644595772028, -0.041501615196466446, -0.06648222357034683, 0.0759228989481926, -0.03835136815905571, -0.1457667499780655, -0.058469001203775406, -0.012716555036604404, -0.002969448221847415, -0.24276438355445862, 0.03754144161939621, 0.008898986503481865, 0.0744120255112648, -0.04132123664021492, 0.12927666306495667, 0.04302274063229561, -0.005940244998782873, -0.013540760613977909, -0.037008136510849, -0.056878380477428436, 0.12996073067188263, 0.0032090747263282537, -0.059283796697854996, 0.1975460648536682, -0.09426948428153992, -0.009383760392665863, -0.24807846546173096, -0.10472440719604492, -0.1803583949804306, 0.17488087713718414, 0.08606480062007904, -0.21395066380500793, -0.04348888620734215, -0.15821364521980286, -0.010897351428866386, -0.22894255816936493, 0.055383939296007156, -0.1729867309331894, 0.060738615691661835, -0.04940395802259445, 0.025440910831093788, 0.18901999294757843, 0.007237067446112633, -0.23276597261428833, -0.03140883892774582, -0.025525877252221107, -0.13551448285579681, -0.0539955236017704, 0.11923501640558243, 0.10634024441242218, -0.0064744967967271805, 0.30084940791130066, 0.00007797073340043426, 0.0800827220082283, -0.049909502267837524, 0.13676166534423828, 0.03907446190714836, 0.04335475340485573, 0.08388680219650269, 0.013547194190323353, 0.07568300515413284, 0.09425332397222519, -0.018963176757097244, -0.08216603845357895, 0.10309316217899323, -0.03593818098306656, -0.28163355588912964, -0.016472607851028442, 0.03348610922694206, -0.00339106353931129, 0.14361944794654846, -0.22915096580982208, -0.12535764276981354, 0.1406642347574234, -0.09991508722305298, 0.0625990480184555, 0.10485665500164032, -0.183923602104187, -0.052439603954553604, -0.13190537691116333, -0.053165633231401443, -0.10911067575216293, -0.04217822104692459, 0.09360824525356293, -0.13835616409778595, 0.13818441331386566, -0.025639668107032776, -0.12123765796422958, -0.23544849455356598, 0.06399717926979065, 0.08830985426902771, 0.030501963570713997, 0.14480739831924438, 0.14947235584259033, -0.00859147123992443, -0.055337995290756226, -0.06034478545188904, -0.036334868520498276, 0.17833386361598969, -0.16348373889923096, 0.02551901713013649, -0.13902246952056885, 0.0037628277204930782, -0.12966890633106232, -0.18899743258953094, 0.10617250949144363, -0.03313850238919258, -0.2621431052684784, -0.14071273803710938, 0.1325201690196991, 0.09894389659166336, 0.12120462208986282, 0.037302881479263306, -0.00030445624724961817, -0.04455847665667534, -0.10324297100305557, 0.025618446990847588, -0.19613349437713623, -0.1755729764699936, 0.2286818027496338, -0.003590390319004655, 0.038694024085998535, 0.16070963442325592, -0.06772956252098083, -0.11450188606977463, 0.13733747601509094, -0.09232529997825623, -0.229562908411026, -0.02143985405564308, 0.09808161854743958, -0.03658834844827652, -0.00673698028549552, -0.06641653925180435, -0.0378694161772728, 0.05011908337473869, 0.09835512191057205, 0.042318444699048996, -0.0511179156601429, 0.007466713432222605, -0.04981239140033722, 0.03873797506093979, -0.0549854151904583, 0.2089754045009613, 0.07254665344953537, -0.06610848009586334, -0.004863368347287178, 0.2108011394739151, -0.1900639533996582, 0.06456287950277328, -0.3181942105293274, -0.031086724251508713, -0.12223965674638748, 0.07646889239549637, -0.04330715164542198, 0.02553625777363777, 0.09475186467170715, 0.16173094511032104, 0.3038448989391327, -0.006988138891756535, -0.03123294562101364, -0.05791851505637169, -0.07548224180936813, -0.05435860529541969, -0.12322209775447845, 0.033505428582429886, 0.020919624716043472, -0.03885721042752266, 0.1645420789718628, 0.007646918762475252, 0.30054962635040283, 0.01748635619878769, -0.034592144191265106, -0.1954418420791626, -0.12042296677827835, -0.0015657342737540603, 0.03844548016786575, -0.043264929205179214, 0.17301690578460693, -0.06861425191164017, -0.16004398465156555, 0.060588736087083817, 0.14732635021209717, -0.06762684881687164, -0.11187076568603516, -0.036947596818208694, -0.22973939776420593, 0.12106990069150925, 0.18550240993499756, 0.06324509531259537, 0.28534555435180664, 0.017948482185602188, 0.2094307243824005, 0.027488304302096367, -0.12210042029619217, -0.0006181995267979801, 0.18968075513839722, 0.005115855019539595, 0.12218715250492096, -0.026724325492978096, 0.08195139467716217, -0.2000565528869629, -0.07180125266313553, 0.13206882774829865, -0.10129272937774658, -0.022328874096274376, 0.24610525369644165, -0.18051040172576904, -0.1417486071586609, 0.031007524579763412, 0.0636131763458252, -0.29811593890190125, -0.08850488811731339, -0.044242896139621735, 0.1723400205373764, 0.1126246228814125, 0.024952959269285202, -0.16039328277111053, -0.20018665492534637, -0.007712853606790304, 0.04097265377640724, 0.06819100677967072, -0.1029370129108429, 0.15780659019947052, -0.11936359107494354, -0.025874681770801544, 0.1436535269021988, -0.08622220903635025, 0.264231413602829, -0.025806879624724388, -0.159611776471138, -0.04785383492708206, -0.1491830199956894, 0.09729710221290588, 0.016331572085618973, -0.12062972038984299, -0.010595045052468777, -0.1364964246749878, -0.08187274634838104, -0.19718679785728455, -0.20358906686306, 0.03481969237327576, -0.1575624793767929, -0.08680350333452225, -0.08674509078264236, -0.025563426315784454, 0.09079402685165405, 0.01774834655225277, 0.04040762037038803, -0.043187327682971954, -0.08241114020347595, 0.11429880559444427, 0.0480271577835083, -0.05011485889554024, 0.047973260283470154, 0.18029974400997162, -0.010863636620342731, 0.1297093629837036, 0.2817143201828003, -0.022481460124254227, -0.025841636583209038, 0.15043769776821136, -0.08585812896490097, 0.06916716694831848, -0.06315743178129196, 0.011600648052990437, 0.11163973063230515, -0.059761565178632736, 0.11040997505187988, 0.048937007784843445, -0.07252487540245056, 0.2052716165781021, 0.11212804168462753, 0.06602786481380463, 0.03805231302976608, -0.06417077779769897, 0.09181524068117142, 0.06553008407354355, -0.06033271551132202, -0.11404260247945786, -0.15402281284332275, 0.024365637451410294, -0.025035396218299866, -0.07492274045944214, -0.004535882268100977, -0.02828275039792061, 0.1795564889907837, -0.02093631774187088, 0.1528192013502121, 0.05888674780726433, -0.12161296606063843, 0.0970056802034378, -0.08404704928398132, -0.04978087916970253, -0.009225313551723957, 0.016834231093525887, -0.04254257306456566, -0.11177558451890945, -0.02931932359933853, 0.03578348085284233, 0.11434050649404526, 0.11677836626768112, 0.1519232988357544, 0.10381395369768143, -0.017276398837566376, 0.07264011353254318, -0.1439676433801651, -0.0729450061917305, -0.15202853083610535, 0.12651540338993073, -0.0023155745584517717, 0.037228796631097794, 0.0074035306461155415, -0.0441952608525753, 0.09287155419588089, -0.20634785294532776, -0.1587286740541458, -0.04416685923933983, 0.025267722085118294, -0.20076966285705566, 0.0012642836663872004, 0.15199925005435944, 0.03509588912129402, 0.039870575070381165, 0.08875676989555359, -0.07613810896873474, 0.021097932010889053, 0.1557171791791916, 0.13703547418117523, -0.10266826301813126, 0.17590509355068207, -0.15959136188030243, 0.03188017010688782, -0.12111297249794006, 0.044458720833063126, -0.006478508934378624, 0.12974286079406738, -0.03172968327999115, -0.01262758206576109, -0.12957319617271423, 0.09713976085186005, 0.003949028439819813, 0.093102365732193, -0.009254633449018002, 0.020159142091870308, -0.14330701529979706, -0.006497012451291084, -2.514120868915815e-32, -0.064266636967659, -0.0893075168132782, -0.19334882497787476, 0.038941286504268646, -0.06735902279615402, -0.06191086769104004, 0.047973234206438065, 0.05499890074133873, 0.04114213213324547, 0.03340767323970795, 0.08538950979709625, -0.0019868852104991674, 0.009369974955916405, 0.09348822385072708, 0.21303246915340424, 0.006123181898146868, 0.053970593959093094, 0.07293204963207245, -0.005280578508973122, 0.07363694906234741, 0.22591976821422577, 0.041106849908828735, 0.24672435224056244, 0.019757553935050964, 0.04103776440024376, -0.14296366274356842, -0.07786966115236282, -0.12865625321865082, -0.020583301782608032, 0.06468024849891663, -0.10515237599611282, 0.15690426528453827, 0.011611667461693287, -0.025940855965018272, 0.011929242871701717, -0.01918928138911724, -0.06301677227020264, -0.06759285926818848, -0.36310875415802, 0.07482846081256866, -0.00022385096235666424, 0.03607795760035515, 0.16869999468326569, -0.037441499531269073, -0.040818993002176285, 0.04321245476603508, -0.06901581585407257, 0.007581386715173721, -0.08477778732776642, -0.11286051571369171, 0.0292208194732666, -0.0758335217833519, -0.07857401669025421, 0.12619347870349884, 0.03259095177054405, 0.05177316069602966, 0.055896881967782974, 0.06117785722017288, -0.08686333894729614, 0.07362140715122223, 0.07002505660057068, 0.11737658828496933, 0.08373834192752838, 0.04712687060236931, -0.021669605746865273, 0.14210927486419678, 0.17215216159820557, -0.003048236947506666, 0.09738785773515701, 0.1936768740415573, 0.04619406908750534, -0.09752678126096725, 0.23756994307041168, 0.08284959942102432, -0.03608843684196472, 0.03836207464337349, -0.05098828300833702, 0.03632624074816704, -0.0734640508890152, -0.33991652727127075, -0.06816238909959793, 0.14817050099372864, 0.17832818627357483, -0.0009340073447674513, -0.13466358184814453, -0.034319888800382614, 0.028905758634209633, 0.10054806619882584, 0.013109632767736912, -0.19766369462013245, -0.1371748298406601, 0.12994728982448578, -0.02049427106976509, 0.02209579013288021, -0.25524675846099854, 0.09760159254074097, -0.08888454735279083, 0.19419485330581665, -0.09823234379291534, 0.023142049089074135, 0.12362480908632278, -0.07646166533231735, 0.08042193949222565, -0.13437777757644653, 0.12684233486652374, -0.07108259201049805, 0.11146517097949982, 0.015974143519997597, -0.19554740190505981, 0.0037494448479264975, -0.060044895857572556, -0.1637037992477417, 0.16890819370746613, -0.0027251504361629486, 0.1261322796344757, -0.16639693081378937, -0.040580667555332184, 0.08672516793012619, 0.19767408072948456, 0.05225314572453499, -0.08679620921611786, -0.05108761042356491, 0.046749893575906754, -0.059444185346364975, 0.04216967895627022, -0.021352076902985573, -0.05399050563573837, -0.04663761705160141, 0.18307852745056152, 0.07109709084033966, 0.03561853989958763, 0.025952761992812157, 6.958608196327987e-7, 0.09211374819278717, 0.07733690738677979, 0.1485031545162201, -0.12717673182487488, -0.15013661980628967, 0.21622437238693237, 0.03492645174264908, 0.026205183938145638, 0.09045343846082687, -0.17111708223819733, 0.08721509575843811, -0.1719808280467987, 0.08451136946678162, 0.09071412682533264, 0.1146450862288475, -0.10043741762638092, -0.05963226780295372, 0.14768658578395844, -0.1911608874797821, 0.20281504094600677, 0.43776723742485046, 0.10506360977888107, 0.0011279761092737317, -0.016969995573163033, 0.08543878048658371, 0.05701003223657608, -0.09315398335456848, 0.1223604679107666, 0.11100619286298752, -0.10108057409524918, -0.16152414679527283, -0.05462121218442917, 0.08832228928804398, 0.1492260992527008, -0.03851369395852089, -0.12798447906970978, 0.016220510005950928, 0.09693331271409988, -0.12795333564281464, 0.0428343266248703, -0.015185671858489513, 0.11234820634126663, -0.005763724446296692, 0.06519970297813416, -0.026796512305736542, 0.04916108027100563, -0.2975552976131439, 0.10765622556209564, -0.056901220232248306, 0.11534009128808975, 0.054289985448122025, 0.07310313731431961, 0.13975797593593597, 0.19503025710582733, -0.03890220448374748, 0.1477050632238388, -0.1340738832950592, -0.12372414022684097, 0.06816528737545013, -0.1443859189748764, -0.06762038171291351, 0.02607286535203457, -0.18068499863147736, -0.025932954624295235, -0.021699637174606323, -0.2149837464094162, -0.06550923734903336, 1.1984915661814313e-34, -0.0036077385302633047, -0.013131402432918549, 0.04069523885846138, 0.14422520995140076, -0.038031574338674545, -0.16971689462661743, 0.10412168502807617, 0.11982456594705582, 0.07876557111740112, -0.05685998126864433, -0.14623409509658813 ]
https://github.com/huggingface/datasets/issues/6267
Multi label class encoding
`class_encode_column ` currently does not support `Sequence(ClassLabel)`. Implementing support for this would be a nice contribution. In the meantime, this limitation can be circumvented by fetching (unique) labels and calling `.cast_column(col, Sequence(ClassLabel(names=labels)))`.
### Feature request I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels. Here's an example of what I'd like to encode: ``` data = { 'text': ['one', 'two', 'three', 'four'], 'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']] } dataset = Dataset.from_dict(data) dataset = dataset.class_encode_column('labels') ``` I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow. I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected. After digging more I did notice a few issues - After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this. - I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior. ### Motivation See above - would like to support multi label class encodings. ### Your contribution This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests.
32
Multi label class encoding ### Feature request I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels. Here's an example of what I'd like to encode: ``` data = { 'text': ['one', 'two', 'three', 'four'], 'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']] } dataset = Dataset.from_dict(data) dataset = dataset.class_encode_column('labels') ``` I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow. I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected. After digging more I did notice a few issues - After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this. - I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior. ### Motivation See above - would like to support multi label class encodings. ### Your contribution This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests. `class_encode_column ` currently does not support `Sequence(ClassLabel)`. Implementing support for this would be a nice contribution. In the meantime, this limitation can be circumvented by fetching (unique) labels and calling `.cast_column(col, Sequence(ClassLabel(names=labels)))`.
[ -0.0516032837331295, 0.37303945422172546, 0.06480216234922409, 0.037810102105140686, 0.19814683496952057, 0.038758739829063416, 0.07895494252443314, 0.09392275661230087, -0.14809191226959229, 0.002135738031938672, 0.040449049323797226, -0.012604251503944397, 0.015641745179891586, 0.18803229928016663, 0.07598191499710083, -0.09243763238191605, -0.11684251576662064, -0.03176802769303322, -0.031138982623815536, 0.08327311277389526, -0.03194509819149971, 0.014394758269190788, 0.1668880730867386, 0.0941605195403099, -0.0424932986497879, -0.10222489386796951, -0.1686694324016571, -0.08160621672868729, -0.08906552195549011, -0.18465369939804077, 0.1872411072254181, 0.2404380440711975, 0.15594562888145447, -0.008713471703231335, 0.0000052260252232372295, 0.03738245368003845, 0.054881252348423004, -0.06598683446645737, -0.06672810018062592, 0.038338061422109604, 0.005956440232694149, -0.04629077762365341, 0.11514870822429657, -0.01992959901690483, -0.030008448287844658, -0.0335184670984745, -0.00842093676328659, -0.011382629163563251, 0.16107243299484253, -0.057506218552589417, -0.0650232583284378, -0.19130082428455353, -0.19055284559726715, -0.032492250204086304, 0.04528813809156418, 0.1221555545926094, 0.03782268613576889, 0.04177822545170784, -0.2029014378786087, 0.163254514336586, 0.009789546020328999, 0.05343217775225639, -0.0065858936868608, -0.02945130504667759, -0.05812915787100792, -0.12031985074281693, -0.03230194002389908, -0.1982928216457367, 0.04460619390010834, 0.03808305040001869, -0.001334533910267055, 0.06684692949056625, -0.14790576696395874, 0.0844622552394867, 0.0654996857047081, -0.27367913722991943, 0.03219390660524368, -0.021954050287604332, -0.01867825724184513, 0.012428632006049156, -0.05256671831011772, 0.09170829504728317, 0.018660372123122215, -0.05479273945093155, -0.14294999837875366, -0.04027533158659935, -0.034736502915620804, 0.1462075114250183, 0.030206186696887016, -0.03662337735295296, -0.025280483067035675, 0.04303239658474922, 0.13207979500293732, 0.05872470885515213, 0.05299011245369911, 0.025621455162763596, -0.17193099856376648, -0.14273394644260406, 0.15684238076210022, 0.03839189559221268, -0.06263446807861328, 0.14519043266773224, -0.05186498537659645, -0.29958099126815796, 0.029934639111161232, 0.02526337280869484, -0.0479188896715641, 0.01915724389255047, -0.05752072110772133, -0.0654110312461853, -0.10617291927337646, 0.011551707983016968, -0.14496493339538574, 0.0527159720659256, 0.25952789187431335, 0.12803177535533905, -0.07497809082269669, 0.15487335622310638, 0.14484940469264984, 0.01725941337645054, 0.021702399477362633, 0.03966432809829712, 0.048857785761356354, 0.07933859527111053, 0.25437524914741516, 0.14399291574954987, 0.0029217032715678215, -0.12251042574644089, 0.029863497242331505, 0.01967564970254898, 0.03137168660759926, 0.026661038398742676, 0.04166504368185997, 0.08209888637065887, 0.06354178488254547, 0.0911618322134018, -0.08732309192419052, -0.12369564920663834, 0.05090028792619705, -0.1245293989777565, -0.05831008404493332, 0.1565924882888794, -0.07934350520372391, -0.07984983175992966, -0.03027747943997383, 0.1566532403230667, 0.10641812533140182, 0.00567993987351656, -0.019593937322497368, 0.0011586087057366967, -0.1087111160159111, 0.1110030859708786, -0.17673249542713165, -0.023193536326289177, -0.0557495653629303, 0.09301616996526718, 0.11902426928281784, 0.008224898017942905, -0.023071659728884697, -0.09300699084997177, 0.08420295268297195, -0.042215295135974884, -0.015759682282805443, -0.036003537476062775, 0.04772375896573067, 0.09284119307994843, 0.1281806230545044, -0.196106418967247, 0.24773789942264557, 0.04332369565963745, -0.028969798237085342, -0.029297567903995514, -0.08827624469995499, -0.2202109545469284, 0.003188340924680233, 0.053703319281339645, -0.17531698942184448, -0.08283364772796631, -0.1825994849205017, -0.08825893700122833, -0.06749370694160461, -0.10820752382278442, 0.40038976073265076, -0.041071634739637375, 0.20151853561401367, 0.008045285940170288, 0.14605562388896942, 0.09866713732481003, -0.04936373606324196, -0.1926085203886032, -0.16171716153621674, -0.011518036015331745, 0.05243019759654999, -0.07326213270425797, -0.012126055546104908, -0.035813022404909134, -0.005486535374075174, -0.08926240354776382, -0.07277578115463257, -0.20482558012008667, -0.08892723172903061, 0.02162986993789673, -0.21055801212787628, -0.03238741680979729, -0.10737533867359161, 0.06582245230674744, -0.14547500014305115, -0.04903537780046463, -0.026676880195736885, -0.01190644595772028, -0.041501615196466446, -0.06648222357034683, 0.0759228989481926, -0.03835136815905571, -0.1457667499780655, -0.058469001203775406, -0.012716555036604404, -0.002969448221847415, -0.24276438355445862, 0.03754144161939621, 0.008898986503481865, 0.0744120255112648, -0.04132123664021492, 0.12927666306495667, 0.04302274063229561, -0.005940244998782873, -0.013540760613977909, -0.037008136510849, -0.056878380477428436, 0.12996073067188263, 0.0032090747263282537, -0.059283796697854996, 0.1975460648536682, -0.09426948428153992, -0.009383760392665863, -0.24807846546173096, -0.10472440719604492, -0.1803583949804306, 0.17488087713718414, 0.08606480062007904, -0.21395066380500793, -0.04348888620734215, -0.15821364521980286, -0.010897351428866386, -0.22894255816936493, 0.055383939296007156, -0.1729867309331894, 0.060738615691661835, -0.04940395802259445, 0.025440910831093788, 0.18901999294757843, 0.007237067446112633, -0.23276597261428833, -0.03140883892774582, -0.025525877252221107, -0.13551448285579681, -0.0539955236017704, 0.11923501640558243, 0.10634024441242218, -0.0064744967967271805, 0.30084940791130066, 0.00007797073340043426, 0.0800827220082283, -0.049909502267837524, 0.13676166534423828, 0.03907446190714836, 0.04335475340485573, 0.08388680219650269, 0.013547194190323353, 0.07568300515413284, 0.09425332397222519, -0.018963176757097244, -0.08216603845357895, 0.10309316217899323, -0.03593818098306656, -0.28163355588912964, -0.016472607851028442, 0.03348610922694206, -0.00339106353931129, 0.14361944794654846, -0.22915096580982208, -0.12535764276981354, 0.1406642347574234, -0.09991508722305298, 0.0625990480184555, 0.10485665500164032, -0.183923602104187, -0.052439603954553604, -0.13190537691116333, -0.053165633231401443, -0.10911067575216293, -0.04217822104692459, 0.09360824525356293, -0.13835616409778595, 0.13818441331386566, -0.025639668107032776, -0.12123765796422958, -0.23544849455356598, 0.06399717926979065, 0.08830985426902771, 0.030501963570713997, 0.14480739831924438, 0.14947235584259033, -0.00859147123992443, -0.055337995290756226, -0.06034478545188904, -0.036334868520498276, 0.17833386361598969, -0.16348373889923096, 0.02551901713013649, -0.13902246952056885, 0.0037628277204930782, -0.12966890633106232, -0.18899743258953094, 0.10617250949144363, -0.03313850238919258, -0.2621431052684784, -0.14071273803710938, 0.1325201690196991, 0.09894389659166336, 0.12120462208986282, 0.037302881479263306, -0.00030445624724961817, -0.04455847665667534, -0.10324297100305557, 0.025618446990847588, -0.19613349437713623, -0.1755729764699936, 0.2286818027496338, -0.003590390319004655, 0.038694024085998535, 0.16070963442325592, -0.06772956252098083, -0.11450188606977463, 0.13733747601509094, -0.09232529997825623, -0.229562908411026, -0.02143985405564308, 0.09808161854743958, -0.03658834844827652, -0.00673698028549552, -0.06641653925180435, -0.0378694161772728, 0.05011908337473869, 0.09835512191057205, 0.042318444699048996, -0.0511179156601429, 0.007466713432222605, -0.04981239140033722, 0.03873797506093979, -0.0549854151904583, 0.2089754045009613, 0.07254665344953537, -0.06610848009586334, -0.004863368347287178, 0.2108011394739151, -0.1900639533996582, 0.06456287950277328, -0.3181942105293274, -0.031086724251508713, -0.12223965674638748, 0.07646889239549637, -0.04330715164542198, 0.02553625777363777, 0.09475186467170715, 0.16173094511032104, 0.3038448989391327, -0.006988138891756535, -0.03123294562101364, -0.05791851505637169, -0.07548224180936813, -0.05435860529541969, -0.12322209775447845, 0.033505428582429886, 0.020919624716043472, -0.03885721042752266, 0.1645420789718628, 0.007646918762475252, 0.30054962635040283, 0.01748635619878769, -0.034592144191265106, -0.1954418420791626, -0.12042296677827835, -0.0015657342737540603, 0.03844548016786575, -0.043264929205179214, 0.17301690578460693, -0.06861425191164017, -0.16004398465156555, 0.060588736087083817, 0.14732635021209717, -0.06762684881687164, -0.11187076568603516, -0.036947596818208694, -0.22973939776420593, 0.12106990069150925, 0.18550240993499756, 0.06324509531259537, 0.28534555435180664, 0.017948482185602188, 0.2094307243824005, 0.027488304302096367, -0.12210042029619217, -0.0006181995267979801, 0.18968075513839722, 0.005115855019539595, 0.12218715250492096, -0.026724325492978096, 0.08195139467716217, -0.2000565528869629, -0.07180125266313553, 0.13206882774829865, -0.10129272937774658, -0.022328874096274376, 0.24610525369644165, -0.18051040172576904, -0.1417486071586609, 0.031007524579763412, 0.0636131763458252, -0.29811593890190125, -0.08850488811731339, -0.044242896139621735, 0.1723400205373764, 0.1126246228814125, 0.024952959269285202, -0.16039328277111053, -0.20018665492534637, -0.007712853606790304, 0.04097265377640724, 0.06819100677967072, -0.1029370129108429, 0.15780659019947052, -0.11936359107494354, -0.025874681770801544, 0.1436535269021988, -0.08622220903635025, 0.264231413602829, -0.025806879624724388, -0.159611776471138, -0.04785383492708206, -0.1491830199956894, 0.09729710221290588, 0.016331572085618973, -0.12062972038984299, -0.010595045052468777, -0.1364964246749878, -0.08187274634838104, -0.19718679785728455, -0.20358906686306, 0.03481969237327576, -0.1575624793767929, -0.08680350333452225, -0.08674509078264236, -0.025563426315784454, 0.09079402685165405, 0.01774834655225277, 0.04040762037038803, -0.043187327682971954, -0.08241114020347595, 0.11429880559444427, 0.0480271577835083, -0.05011485889554024, 0.047973260283470154, 0.18029974400997162, -0.010863636620342731, 0.1297093629837036, 0.2817143201828003, -0.022481460124254227, -0.025841636583209038, 0.15043769776821136, -0.08585812896490097, 0.06916716694831848, -0.06315743178129196, 0.011600648052990437, 0.11163973063230515, -0.059761565178632736, 0.11040997505187988, 0.048937007784843445, -0.07252487540245056, 0.2052716165781021, 0.11212804168462753, 0.06602786481380463, 0.03805231302976608, -0.06417077779769897, 0.09181524068117142, 0.06553008407354355, -0.06033271551132202, -0.11404260247945786, -0.15402281284332275, 0.024365637451410294, -0.025035396218299866, -0.07492274045944214, -0.004535882268100977, -0.02828275039792061, 0.1795564889907837, -0.02093631774187088, 0.1528192013502121, 0.05888674780726433, -0.12161296606063843, 0.0970056802034378, -0.08404704928398132, -0.04978087916970253, -0.009225313551723957, 0.016834231093525887, -0.04254257306456566, -0.11177558451890945, -0.02931932359933853, 0.03578348085284233, 0.11434050649404526, 0.11677836626768112, 0.1519232988357544, 0.10381395369768143, -0.017276398837566376, 0.07264011353254318, -0.1439676433801651, -0.0729450061917305, -0.15202853083610535, 0.12651540338993073, -0.0023155745584517717, 0.037228796631097794, 0.0074035306461155415, -0.0441952608525753, 0.09287155419588089, -0.20634785294532776, -0.1587286740541458, -0.04416685923933983, 0.025267722085118294, -0.20076966285705566, 0.0012642836663872004, 0.15199925005435944, 0.03509588912129402, 0.039870575070381165, 0.08875676989555359, -0.07613810896873474, 0.021097932010889053, 0.1557171791791916, 0.13703547418117523, -0.10266826301813126, 0.17590509355068207, -0.15959136188030243, 0.03188017010688782, -0.12111297249794006, 0.044458720833063126, -0.006478508934378624, 0.12974286079406738, -0.03172968327999115, -0.01262758206576109, -0.12957319617271423, 0.09713976085186005, 0.003949028439819813, 0.093102365732193, -0.009254633449018002, 0.020159142091870308, -0.14330701529979706, -0.006497012451291084, -2.514120868915815e-32, -0.064266636967659, -0.0893075168132782, -0.19334882497787476, 0.038941286504268646, -0.06735902279615402, -0.06191086769104004, 0.047973234206438065, 0.05499890074133873, 0.04114213213324547, 0.03340767323970795, 0.08538950979709625, -0.0019868852104991674, 0.009369974955916405, 0.09348822385072708, 0.21303246915340424, 0.006123181898146868, 0.053970593959093094, 0.07293204963207245, -0.005280578508973122, 0.07363694906234741, 0.22591976821422577, 0.041106849908828735, 0.24672435224056244, 0.019757553935050964, 0.04103776440024376, -0.14296366274356842, -0.07786966115236282, -0.12865625321865082, -0.020583301782608032, 0.06468024849891663, -0.10515237599611282, 0.15690426528453827, 0.011611667461693287, -0.025940855965018272, 0.011929242871701717, -0.01918928138911724, -0.06301677227020264, -0.06759285926818848, -0.36310875415802, 0.07482846081256866, -0.00022385096235666424, 0.03607795760035515, 0.16869999468326569, -0.037441499531269073, -0.040818993002176285, 0.04321245476603508, -0.06901581585407257, 0.007581386715173721, -0.08477778732776642, -0.11286051571369171, 0.0292208194732666, -0.0758335217833519, -0.07857401669025421, 0.12619347870349884, 0.03259095177054405, 0.05177316069602966, 0.055896881967782974, 0.06117785722017288, -0.08686333894729614, 0.07362140715122223, 0.07002505660057068, 0.11737658828496933, 0.08373834192752838, 0.04712687060236931, -0.021669605746865273, 0.14210927486419678, 0.17215216159820557, -0.003048236947506666, 0.09738785773515701, 0.1936768740415573, 0.04619406908750534, -0.09752678126096725, 0.23756994307041168, 0.08284959942102432, -0.03608843684196472, 0.03836207464337349, -0.05098828300833702, 0.03632624074816704, -0.0734640508890152, -0.33991652727127075, -0.06816238909959793, 0.14817050099372864, 0.17832818627357483, -0.0009340073447674513, -0.13466358184814453, -0.034319888800382614, 0.028905758634209633, 0.10054806619882584, 0.013109632767736912, -0.19766369462013245, -0.1371748298406601, 0.12994728982448578, -0.02049427106976509, 0.02209579013288021, -0.25524675846099854, 0.09760159254074097, -0.08888454735279083, 0.19419485330581665, -0.09823234379291534, 0.023142049089074135, 0.12362480908632278, -0.07646166533231735, 0.08042193949222565, -0.13437777757644653, 0.12684233486652374, -0.07108259201049805, 0.11146517097949982, 0.015974143519997597, -0.19554740190505981, 0.0037494448479264975, -0.060044895857572556, -0.1637037992477417, 0.16890819370746613, -0.0027251504361629486, 0.1261322796344757, -0.16639693081378937, -0.040580667555332184, 0.08672516793012619, 0.19767408072948456, 0.05225314572453499, -0.08679620921611786, -0.05108761042356491, 0.046749893575906754, -0.059444185346364975, 0.04216967895627022, -0.021352076902985573, -0.05399050563573837, -0.04663761705160141, 0.18307852745056152, 0.07109709084033966, 0.03561853989958763, 0.025952761992812157, 6.958608196327987e-7, 0.09211374819278717, 0.07733690738677979, 0.1485031545162201, -0.12717673182487488, -0.15013661980628967, 0.21622437238693237, 0.03492645174264908, 0.026205183938145638, 0.09045343846082687, -0.17111708223819733, 0.08721509575843811, -0.1719808280467987, 0.08451136946678162, 0.09071412682533264, 0.1146450862288475, -0.10043741762638092, -0.05963226780295372, 0.14768658578395844, -0.1911608874797821, 0.20281504094600677, 0.43776723742485046, 0.10506360977888107, 0.0011279761092737317, -0.016969995573163033, 0.08543878048658371, 0.05701003223657608, -0.09315398335456848, 0.1223604679107666, 0.11100619286298752, -0.10108057409524918, -0.16152414679527283, -0.05462121218442917, 0.08832228928804398, 0.1492260992527008, -0.03851369395852089, -0.12798447906970978, 0.016220510005950928, 0.09693331271409988, -0.12795333564281464, 0.0428343266248703, -0.015185671858489513, 0.11234820634126663, -0.005763724446296692, 0.06519970297813416, -0.026796512305736542, 0.04916108027100563, -0.2975552976131439, 0.10765622556209564, -0.056901220232248306, 0.11534009128808975, 0.054289985448122025, 0.07310313731431961, 0.13975797593593597, 0.19503025710582733, -0.03890220448374748, 0.1477050632238388, -0.1340738832950592, -0.12372414022684097, 0.06816528737545013, -0.1443859189748764, -0.06762038171291351, 0.02607286535203457, -0.18068499863147736, -0.025932954624295235, -0.021699637174606323, -0.2149837464094162, -0.06550923734903336, 1.1984915661814313e-34, -0.0036077385302633047, -0.013131402432918549, 0.04069523885846138, 0.14422520995140076, -0.038031574338674545, -0.16971689462661743, 0.10412168502807617, 0.11982456594705582, 0.07876557111740112, -0.05685998126864433, -0.14623409509658813 ]
https://github.com/huggingface/datasets/issues/6261
Can't load a dataset
`JourneyDB/JourneyDB` is a gated dataset, so this error means you are not authenticated to access it, either by using an invalid token or by not agreeing to the terms in the dialog on the dataset page. > I believe is due to the fact that doesn't work with .tgz files. Indeed, the dataset's data files structure is not supported natively by `datasets`. To load it, one option is to clone the repo (or download it with `huggingface_hub.snapshot_download`) and use `Dataset.from_generator` to process the files.
### Describe the bug Can't seem to load the JourneyDB dataset. It throws the following error: ``` --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) Cell In[15], line 2 1 # If the dataset is gated/private, make sure you have run huggingface-cli login ----> 2 dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True) File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1664, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1661 ignore_verifications = ignore_verifications or save_infos 1663 # Create a dataset builder -> 1664 builder_instance = load_dataset_builder( 1665 path=path, 1666 name=name, 1667 data_dir=data_dir, 1668 data_files=data_files, 1669 cache_dir=cache_dir, 1670 features=features, 1671 download_config=download_config, 1672 download_mode=download_mode, 1673 revision=revision, 1674 use_auth_token=use_auth_token, 1675 **config_kwargs, 1676 ) 1678 # Return iterable dataset in case of streaming 1679 if streaming: File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1490, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, **config_kwargs) 1488 download_config = download_config.copy() if download_config else DownloadConfig() 1489 download_config.use_auth_token = use_auth_token -> 1490 dataset_module = dataset_module_factory( 1491 path, 1492 revision=revision, 1493 download_config=download_config, 1494 download_mode=download_mode, 1495 data_dir=data_dir, 1496 data_files=data_files, 1497 ) 1499 # Get dataset builder class from the processing script 1500 builder_cls = import_main_class(dataset_module.module_path) File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1238, in dataset_module_factory(path, revision, download_config, download_mode, force_local_path, dynamic_modules_path, data_dir, data_files, **download_kwargs) 1236 raise ConnectionError(f"Couln't reach the Hugging Face Hub for dataset '{path}': {e1}") from None 1237 if isinstance(e1, FileNotFoundError): -> 1238 raise FileNotFoundError( 1239 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. " 1240 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}" 1241 ) from None 1242 raise e1 from None 1243 else: FileNotFoundError: Couldn't find a dataset script at /kaggle/working/JourneyDB/JourneyDB/JourneyDB.py or any data file in the same directory. Couldn't find 'JourneyDB/JourneyDB' on the Hugging Face Hub either: FileNotFoundError: Unable to find data in dataset repository JourneyDB/JourneyDB with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] ``` ### Steps to reproduce the bug 1) ``` from huggingface_hub import notebook_login notebook_login() ``` 2) ``` !pip install -q datasets from datasets import load_dataset ``` 3) `dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)` ### Expected behavior Load the dataset ### Environment info Notebook
84
Can't load a dataset ### Describe the bug Can't seem to load the JourneyDB dataset. It throws the following error: ``` --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) Cell In[15], line 2 1 # If the dataset is gated/private, make sure you have run huggingface-cli login ----> 2 dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True) File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1664, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1661 ignore_verifications = ignore_verifications or save_infos 1663 # Create a dataset builder -> 1664 builder_instance = load_dataset_builder( 1665 path=path, 1666 name=name, 1667 data_dir=data_dir, 1668 data_files=data_files, 1669 cache_dir=cache_dir, 1670 features=features, 1671 download_config=download_config, 1672 download_mode=download_mode, 1673 revision=revision, 1674 use_auth_token=use_auth_token, 1675 **config_kwargs, 1676 ) 1678 # Return iterable dataset in case of streaming 1679 if streaming: File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1490, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, **config_kwargs) 1488 download_config = download_config.copy() if download_config else DownloadConfig() 1489 download_config.use_auth_token = use_auth_token -> 1490 dataset_module = dataset_module_factory( 1491 path, 1492 revision=revision, 1493 download_config=download_config, 1494 download_mode=download_mode, 1495 data_dir=data_dir, 1496 data_files=data_files, 1497 ) 1499 # Get dataset builder class from the processing script 1500 builder_cls = import_main_class(dataset_module.module_path) File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1238, in dataset_module_factory(path, revision, download_config, download_mode, force_local_path, dynamic_modules_path, data_dir, data_files, **download_kwargs) 1236 raise ConnectionError(f"Couln't reach the Hugging Face Hub for dataset '{path}': {e1}") from None 1237 if isinstance(e1, FileNotFoundError): -> 1238 raise FileNotFoundError( 1239 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. " 1240 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}" 1241 ) from None 1242 raise e1 from None 1243 else: FileNotFoundError: Couldn't find a dataset script at /kaggle/working/JourneyDB/JourneyDB/JourneyDB.py or any data file in the same directory. Couldn't find 'JourneyDB/JourneyDB' on the Hugging Face Hub either: FileNotFoundError: Unable to find data in dataset repository JourneyDB/JourneyDB with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] ``` ### Steps to reproduce the bug 1) ``` from huggingface_hub import notebook_login notebook_login() ``` 2) ``` !pip install -q datasets from datasets import load_dataset ``` 3) `dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)` ### Expected behavior Load the dataset ### Environment info Notebook `JourneyDB/JourneyDB` is a gated dataset, so this error means you are not authenticated to access it, either by using an invalid token or by not agreeing to the terms in the dialog on the dataset page. > I believe is due to the fact that doesn't work with .tgz files. Indeed, the dataset's data files structure is not supported natively by `datasets`. To load it, one option is to clone the repo (or download it with `huggingface_hub.snapshot_download`) and use `Dataset.from_generator` to process the files.
[ 0.0275250393897295, 0.020098794251680374, -0.03406011313199997, -0.0532824881374836, 0.22631344199180603, 0.054627444595098495, 0.16491729021072388, -0.002472198335453868, -0.007282711565494537, 0.18711090087890625, -0.014829772524535656, -0.12124999612569809, -0.025810519233345985, 0.03420545905828476, -0.012391125783324242, -0.015898069366812706, -0.09960699826478958, -0.06391613930463791, -0.05945359542965889, 0.032982077449560165, -0.08655545115470886, 0.0784585028886795, 0.11688756197690964, -0.09532724320888519, -0.09057218581438065, -0.08656009286642075, 0.04439965635538101, 0.11475500464439392, 0.0018932846141979098, -0.14559446275234222, 0.19287611544132233, 0.014345493167638779, 0.06958841532468796, 0.22857072949409485, 0.000005568777851294726, 0.029177410528063774, 0.189137801527977, 0.08841519802808762, -0.08566685020923615, -0.10710594803094864, 0.06585251539945602, 0.027349257841706276, -0.013393678702414036, -0.06243705749511719, -0.09397933632135391, -0.2311093956232071, -0.12239117175340652, 0.020655499771237373, 0.0719001442193985, 0.16053764522075653, -0.0021544857881963253, -0.03979562595486641, -0.07136852294206619, -0.21906262636184692, 0.04083295539021492, -0.022564513608813286, 0.01346292532980442, 0.13190510869026184, -0.168070986866951, -0.12248477339744568, -0.044722799211740494, -0.17186643183231354, -0.03811419755220413, 0.011360530741512775, 0.006996129173785448, -0.03405963256955147, 0.0011362402001395822, -0.01703558675944805, 0.03406926989555359, 0.2569197714328766, 0.1010921373963356, 0.183113232254982, -0.12135548144578934, 0.014234701171517372, -0.014413776807487011, -0.054111797362565994, 0.005250710528343916, -0.0848318487405777, -0.19542284309864044, 0.2084427922964096, -0.14773288369178772, -0.09568778425455093, 0.008124150335788727, 0.03988399729132652, -0.10157656669616699, 0.005774438381195068, -0.21057459712028503, 0.030654897913336754, -0.050537336617708206, -0.1081390231847763, 0.22248975932598114, 0.0837150290608406, 0.024518072605133057, -0.16309981048107147, 0.23003213107585907, 0.12924183905124664, 0.023305658251047134, 0.12263888865709305, -0.060736581683158875, 0.04330385476350784, -0.10478542745113373, -0.21509170532226562, -0.013995430432260036, 0.16689099371433258, 0.06513567268848419, -0.011290655471384525, 0.02696891687810421, -0.08423763513565063, -0.018390042707324028, 0.18054862320423126, -0.0665372684597969, 0.17435379326343536, -0.21519950032234192, -0.22897763550281525, 0.08430595695972443, 0.09104341268539429, 0.10866537690162659, 0.07946766167879105, 0.08463533222675323, 0.03838839754462242, 0.011347014456987381, 0.13592752814292908, 0.12625253200531006, 0.26123568415641785, 0.10411453992128372, -0.08983105421066284, -0.015650302171707153, 0.13544543087482452, 0.06859849393367767, -0.05236204341053963, -0.13626272976398468, -0.08197986334562302, -0.040635574609041214, -0.033840566873550415, 0.10067476332187653, -0.07847916334867477, 0.006936124060302973, -0.19212649762630463, -0.058918699622154236, 0.04539848119020462, 0.0680062547326088, -0.07200112193822861, -0.12857681512832642, 0.03669308125972748, 0.17034360766410828, -0.008523561991751194, 0.17366480827331543, -0.09972574561834335, 0.05578652024269104, -0.06938076764345169, -0.2821974456310272, 0.10006853938102722, -0.20835398137569427, 0.07249381393194199, -0.15859127044677734, -0.009066340513527393, -0.021044274792075157, -0.07572448998689651, -0.13015994429588318, -0.11104586720466614, 0.11409343034029007, 0.0753927007317543, 0.031818874180316925, -0.12445623427629471, 0.25232502818107605, 0.13103453814983368, 0.12202177941799164, -0.005867442116141319, -0.08991029858589172, -0.10718688368797302, 0.034728359431028366, 0.047867100685834885, -0.09244073927402496, 0.15009085834026337, -0.19737471640110016, 0.05061402916908264, -0.08057244122028351, 0.03278910368680954, -0.23070622980594635, 0.0842379555106163, 0.13069868087768555, -0.05625326931476593, -0.035769712179899216, -0.20292270183563232, 0.015113327652215958, -0.08430346846580505, 0.03407678380608559, 0.07407400757074356, -0.018073992803692818, -0.13466501235961914, 0.08152556419372559, 0.038771867752075195, 0.17678171396255493, -0.016688179224729538, 0.10344649106264114, -0.11727539449930191, -0.0002545528404880315, -0.1308542937040329, 0.0003103001799900085, -0.2599656283855438, -0.2046978622674942, 0.0978432223200798, -0.02952435426414013, 0.05766269937157631, 0.021369827911257744, -0.015472792088985443, -0.09793177247047424, 0.231806680560112, 0.03647173196077347, -0.2404453456401825, -0.10588230192661285, 0.02521512471139431, -0.12926775217056274, -0.03104075975716114, -0.17353303730487823, -0.0054677329026162624, 0.0801817923784256, 0.034359805285930634, -0.038293540477752686, 0.16906854510307312, -0.093269944190979, 0.036889687180519104, 0.06253309547901154, -0.025164710357785225, -0.0072964890860021114, 0.08143286406993866, 0.04110543057322502, -0.04232713580131531, -0.0016796387499198318, 0.13783280551433563, -0.18298719823360443, -0.09423903375864029, 0.06474807113409042, 0.10090743005275726, 0.018934762105345726, 0.002436729148030281, 0.05048251897096634, -0.16118063032627106, -0.05452360957860947, -0.036752358078956604, -0.19620169699192047, 0.025658732280135155, -0.04680413380265236, -0.0645136758685112, 0.011397269554436207, -0.020287049934267998, -0.08345738798379898, 0.1544390618801117, -0.013105548918247223, 0.043187446892261505, 0.22343270480632782, 0.06336463242769241, -0.14948873221874237, 0.12410513311624527, 0.18975511193275452, -0.19919219613075256, 0.04647251218557358, 0.07805737853050232, -0.1019793227314949, -0.1893630176782608, 0.14558739960193634, -0.011526701040565968, 0.017883092164993286, -0.09252548217773438, 0.03501569479703903, -0.12294530868530273, 0.15072841942310333, -0.06116677075624466, -0.08737602084875107, 0.05658368021249771, -0.039739351719617844, -0.0740373432636261, -0.12880079448223114, -0.18912595510482788, 0.10249842703342438, -0.010701683349907398, 0.06406624615192413, -0.013097022660076618, -0.013272414915263653, -0.04568256065249443, -0.20443220436573029, 0.09723041206598282, 0.12701134383678436, -0.05266188830137253, 0.0780177041888237, 0.05196705833077431, -0.15717796981334686, 0.011565245687961578, 0.03343215212225914, -0.08415690809488297, 0.0476788766682148, 0.08944615721702576, 0.009757484309375286, -0.06550492346286774, -0.11796744912862778, 0.04488883167505264, 0.12904739379882812, -0.026182595640420914, -0.00022065959637984633, 0.02060667984187603, -0.07586351037025452, -0.0042226240038871765, 0.10436283051967621, 0.02825034223496914, 0.12948782742023468, 0.030635327100753784, 0.1708136796951294, 0.1037977784872055, -0.08904757350683212, -0.09258320182561874, 0.11299867182970047, -0.09360043704509735, 0.06030890718102455, 0.16432982683181763, 0.07152338325977325, 0.09440133720636368, 0.05303887277841568, -0.10310237854719162, 0.20020492374897003, 0.19385971128940582, 0.00592912407591939, 0.12709476053714752, -0.04025400057435036, 0.011254102922976017, 0.016504522413015366, 0.1787363886833191, -0.3007016181945801, -0.1156998872756958, -0.048167433589696884, -0.022563450038433075, -0.0779942199587822, 0.20249395072460175, -0.047889839857816696, 0.01996724307537079, 0.04511979594826698, -0.09238190203905106, -0.15042069554328918, -0.07345746457576752, 0.25809505581855774, -0.11659295111894608, -0.03808228671550751, 0.012716296128928661, -0.037537768483161926, 0.11389335989952087, 0.07234521955251694, -0.05436132475733757, 0.02277440018951893, -0.04494800791144371, -0.09768949449062347, -0.16454222798347473, -0.035859059542417526, 0.10009755194187164, -0.07554485648870468, -0.04965702071785927, 0.043447259813547134, 0.049924757331609726, -0.09414658695459366, 0.13684318959712982, 0.06403183192014694, -0.023117009550333023, 0.07918096333742142, 0.09296231716871262, 0.03082738071680069, -0.005299323704093695, -0.02941981516778469, 0.2375316619873047, 0.11924875527620316, 0.027850329875946045, -0.06270731985569, -0.1749807447195053, -0.015741292387247086, -0.04884340614080429, -0.016822636127471924, -0.010592401959002018, 0.009154973551630974, 0.07340361922979355, -0.04141463339328766, -0.23833067715168, 0.0717807188630104, 0.0028185490518808365, -0.084011510014534, -0.19814863801002502, -0.030927764251828194, 0.034992337226867676, 0.15134111046791077, 0.012289115227758884, -0.020120685920119286, 0.02400129660964012, 0.02443394809961319, 0.08438954502344131, 0.08011924475431442, 0.13693013787269592, -0.013220169581472874, -0.2237212061882019, 0.06739147752523422, -0.1726960688829422, 0.16299410164356232, 0.08182644844055176, 0.027073511853814125, -0.05774601921439171, 0.009150099009275436, 0.20136350393295288, -0.03703642636537552, 0.12905699014663696, 0.0686243548989296, -0.026240678504109383, 0.11626239120960236, -0.08090510964393616, 0.08660748600959778, -0.0803186371922493, 0.04800158739089966, 0.08661281317472458, 0.028146350756287575, -0.038380347192287445, 0.09061355888843536, -0.04387844726443291, -0.025274228304624557, -0.08010685443878174, -0.215987429022789, -0.225411519408226, -0.1759101003408432, -0.09827665984630585, 0.14716479182243347, 0.23771803081035614, 0.033199820667505264, -0.09892521798610687, 0.10210679471492767, -0.04819290339946747, 0.1712065190076828, -0.0840776264667511, 0.05471927300095558, -0.11775091290473938, 0.07719150930643082, 0.1789124757051468, 0.04719628393650055, -0.03695351630449295, 0.4390234351158142, 0.02638815902173519, -0.08888572454452515, 0.06500356644392014, -0.15321677923202515, -0.07354573905467987, 0.08026418834924698, -0.07020338624715805, 0.02955756150186062, 0.014418174512684345, -0.13887405395507812, -0.018924811854958534, 0.07556092739105225, -0.05992745980620384, -0.05852528661489487, -0.1381378471851349, -0.0823427066206932, -0.3365992307662964, 0.11084596812725067, 0.09901224076747894, 0.10394972562789917, -0.0376821868121624, 0.028422413393855095, 0.073330819606781, -0.17609067261219025, -0.045465268194675446, -0.11753836274147034, 0.03097611293196678, 0.14715395867824554, -0.012175878509879112, 0.2042209357023239, -0.18571504950523376, -0.09116494655609131, 0.1239442303776741, -0.09541932493448257, 0.09365860372781754, -0.10296803712844849, 0.010363451205193996, 0.1132315993309021, -0.10505039244890213, 0.05778215080499649, -0.12031703442335129, -0.0012641726061701775, 0.008257021196186543, 0.12506310641765594, 0.03334496542811394, 0.1349947601556778, -0.09044187515974045, -0.021476980298757553, 0.14586302638053894, 0.1583012491464615, -0.08105972409248352, -0.11584313958883286, -0.03193984553217888, 0.18524427711963654, -0.0032522063702344894, 0.05784105509519577, -0.04302237182855606, 0.09641902893781662, -0.06036173924803734, -0.12842130661010742, 0.07974934577941895, 0.08686630427837372, 0.05754418671131134, 0.035424601286649704, -0.13578179478645325, 0.02069947123527527, 0.07880601286888123, -0.036883220076560974, -0.31806400418281555, 0.09125450253486633, 0.058184489607810974, -0.0747983381152153, -0.13523004949092865, 0.03700445964932442, 0.09066616743803024, -0.14546453952789307, 0.0044694761745631695, 0.12414015084505081, -0.00860722828656435, -0.018232783302664757, -0.019915465265512466, -0.09240283817052841, 0.04504561051726341, 0.05730430409312248, -0.03240850567817688, -0.01956055499613285, -0.03603900969028473, 0.01964510977268219, 0.15123103559017181, -0.00526264775544405, 0.22198878228664398, 0.20305182039737701, -0.005642227362841368, 0.07388081401586533, 0.2592127323150635, 0.22124344110488892, 0.07426335662603378, -0.10145802795886993, 0.12426497787237167, 0.19625934958457947, -0.08847066015005112, 0.13894633948802948, 0.10471663624048233, 0.07169941067695618, -0.06195579096674919, 0.09240716695785522, 0.11975554376840591, 0.10923171043395996, 0.11229346692562103, 0.0037813722155988216, -0.014676941558718681, -0.09541579335927963, -0.1329001933336258, -0.08481216430664062, 0.14397796988487244, 0.04555240646004677, -0.004004805348813534, -0.05451894551515579, -2.569510456600149e-32, -0.10558956116437912, 0.0037390412762761116, -0.11506113409996033, 0.08994273096323013, -0.1981653869152069, 0.061935290694236755, -0.08701705187559128, 0.015194940380752087, -0.21179461479187012, -0.08239731937646866, -0.06124415621161461, -0.089499831199646, -0.00907989963889122, 0.09300874918699265, -0.14822572469711304, 0.0010471625719219446, -0.07263056188821793, -0.02043585292994976, 0.011475157923996449, 0.10881735384464264, -0.04590108245611191, 0.07519426196813583, -0.014750989153981209, 0.13359621167182922, 0.036702439188957214, -0.09899551421403885, -0.1891201138496399, -0.07509183138608932, 0.07785794883966446, -0.0424603708088398, -0.09746972471475601, 0.034231141209602356, 0.05323898792266846, -0.06065762788057327, -0.17255938053131104, -0.018711091950535774, -0.1549476534128189, -0.0637279599905014, -0.03229692578315735, 0.10173670202493668, -0.028285101056098938, 0.1193261370062828, 0.046977344900369644, -0.2922191619873047, 0.027617674320936203, 0.1604442596435547, 0.05015595257282257, -0.025940531864762306, 0.007467195857316256, -0.13898853957653046, 0.06404609978199005, 0.02455667220056057, -0.10119566321372986, 0.06429068744182587, 0.10441981256008148, -0.06258466094732285, -0.10817738622426987, 0.060348380357027054, -0.08838053792715073, 0.011426339857280254, 0.03598149120807648, -0.17304784059524536, 0.04713878780603409, 0.0008228839142248034, 0.10487688332796097, -0.1009797528386116, 0.2686401605606079, 0.06730518490076065, -0.10801763832569122, -0.09992208331823349, 0.13507968187332153, 0.17331460118293762, -0.08327993750572205, -0.003452755743637681, -0.2466062307357788, -0.0759284645318985, -0.17748267948627472, 0.01902979053556919, 0.0341661162674427, -0.1442277729511261, 0.1540597826242447, 0.01521601527929306, -0.028967678546905518, 0.02080157957971096, 0.02158106118440628, -0.031238561496138573, 0.022664183750748634, 0.009082425385713577, -0.25049328804016113, -0.028995618224143982, 0.0248397346585989, 0.012721170671284199, -0.13576604425907135, -0.06444116681814194, -0.16717717051506042, 0.13501060009002686, 0.07808542251586914, 0.019647089764475822, -0.06445259600877762, 0.11163438856601715, -0.21799220144748688, 0.021215805783867836, 0.10958356410264969, 0.1283697783946991, 0.12596549093723297, 0.014013857580721378, 0.04574677720665932, -0.09573716670274734, -0.1984846442937851, -0.008263709023594856, -0.03772321343421936, 0.10644352436065674, 0.12638060748577118, 0.17932702600955963, 0.14114412665367126, 0.042320843786001205, -0.0709792748093605, -0.08084522187709808, 0.11195700615644455, 0.12272578477859497, -0.18513183295726776, -0.004224599339067936, -0.1121470108628273, 0.05653422698378563, -0.014166897162795067, 0.0232028067111969, -0.2163306474685669, -0.0518915094435215, 0.019428608939051628, 0.040580447763204575, 0.02777470275759697, -0.06907851994037628, 7.2116603178074e-7, -0.2795960009098053, 0.1610279381275177, 0.007700982969254255, 0.017783600836992264, -0.0152587890625, -0.02995227463543415, -0.2916729152202606, 0.11799407750368118, 0.00259313709102571, 0.0813942700624466, 0.1447245478630066, 0.03190716356039047, -0.17721356451511383, 0.040176115930080414, 0.03258324787020683, -0.1902168095111847, -0.045446448028087616, 0.010506423190236092, 0.027247479185461998, 0.045691777020692825, 0.09175454080104828, 0.19327157735824585, 0.1063770055770874, -0.03553743660449982, 0.04509750008583069, -0.040555957704782486, -0.022467665374279022, -0.09095699340105057, 0.01658778451383114, 0.01695415750145912, -0.06354907155036926, 0.17830297350883484, -0.16726921498775482, 0.22973252832889557, 0.06147237494587898, -0.06367133557796478, -0.18459036946296692, -0.1582423746585846, 0.1229071244597435, 0.08936542272567749, -0.029287898913025856, 0.11013845354318619, -0.059094540774822235, -0.06678144633769989, 0.10886186361312866, 0.16100630164146423, -0.03453947603702545, 0.023084230720996857, -0.10521161556243896, 0.18299154937267303, 0.15476453304290771, 0.18970723450183868, 0.11383889615535736, 0.10846402496099472, -0.07613971829414368, 0.01773480512201786, -0.1294691413640976, -0.1424412876367569, 0.1800336092710495, -0.00013635109644383192, -0.0562361516058445, -0.0035129240714013577, 0.04120030999183655, 0.055275555700063705, -0.03436429053544998, -0.003323032520711422, -0.11501665413379669, 3.91776310711611e-35, 0.03861211612820625, -0.0795898512005806, 0.06427451223134995, -0.2605421543121338, -0.035063568502664566, -0.08154553174972534, 0.1602553427219391, -0.07910820096731186, 0.03679325431585312, -0.21771357953548431, 0.06896430253982544 ]
https://github.com/huggingface/datasets/issues/6261
Can't load a dataset
> JourneyDB/JourneyDB is a gated dataset, so this error means you are not authenticated to access it, either by using an invalid token or by not agreeing to the terms in the dialog on the dataset page.Β΄ I did authentication with: ``` from huggingface_hub import notebook_login notebook_login() ``` Isn't that the correct way to do it? > Indeed, the dataset's data files structure is not supported natively by datasets. To load it, one option is to clone the repo (or download it with huggingface_hub.snapshot_download) and use Dataset.from_generator to process the files. Great suggestion I will give it a try.
### Describe the bug Can't seem to load the JourneyDB dataset. It throws the following error: ``` --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) Cell In[15], line 2 1 # If the dataset is gated/private, make sure you have run huggingface-cli login ----> 2 dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True) File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1664, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1661 ignore_verifications = ignore_verifications or save_infos 1663 # Create a dataset builder -> 1664 builder_instance = load_dataset_builder( 1665 path=path, 1666 name=name, 1667 data_dir=data_dir, 1668 data_files=data_files, 1669 cache_dir=cache_dir, 1670 features=features, 1671 download_config=download_config, 1672 download_mode=download_mode, 1673 revision=revision, 1674 use_auth_token=use_auth_token, 1675 **config_kwargs, 1676 ) 1678 # Return iterable dataset in case of streaming 1679 if streaming: File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1490, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, **config_kwargs) 1488 download_config = download_config.copy() if download_config else DownloadConfig() 1489 download_config.use_auth_token = use_auth_token -> 1490 dataset_module = dataset_module_factory( 1491 path, 1492 revision=revision, 1493 download_config=download_config, 1494 download_mode=download_mode, 1495 data_dir=data_dir, 1496 data_files=data_files, 1497 ) 1499 # Get dataset builder class from the processing script 1500 builder_cls = import_main_class(dataset_module.module_path) File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1238, in dataset_module_factory(path, revision, download_config, download_mode, force_local_path, dynamic_modules_path, data_dir, data_files, **download_kwargs) 1236 raise ConnectionError(f"Couln't reach the Hugging Face Hub for dataset '{path}': {e1}") from None 1237 if isinstance(e1, FileNotFoundError): -> 1238 raise FileNotFoundError( 1239 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. " 1240 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}" 1241 ) from None 1242 raise e1 from None 1243 else: FileNotFoundError: Couldn't find a dataset script at /kaggle/working/JourneyDB/JourneyDB/JourneyDB.py or any data file in the same directory. Couldn't find 'JourneyDB/JourneyDB' on the Hugging Face Hub either: FileNotFoundError: Unable to find data in dataset repository JourneyDB/JourneyDB with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] ``` ### Steps to reproduce the bug 1) ``` from huggingface_hub import notebook_login notebook_login() ``` 2) ``` !pip install -q datasets from datasets import load_dataset ``` 3) `dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)` ### Expected behavior Load the dataset ### Environment info Notebook
99
Can't load a dataset ### Describe the bug Can't seem to load the JourneyDB dataset. It throws the following error: ``` --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) Cell In[15], line 2 1 # If the dataset is gated/private, make sure you have run huggingface-cli login ----> 2 dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True) File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1664, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1661 ignore_verifications = ignore_verifications or save_infos 1663 # Create a dataset builder -> 1664 builder_instance = load_dataset_builder( 1665 path=path, 1666 name=name, 1667 data_dir=data_dir, 1668 data_files=data_files, 1669 cache_dir=cache_dir, 1670 features=features, 1671 download_config=download_config, 1672 download_mode=download_mode, 1673 revision=revision, 1674 use_auth_token=use_auth_token, 1675 **config_kwargs, 1676 ) 1678 # Return iterable dataset in case of streaming 1679 if streaming: File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1490, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, **config_kwargs) 1488 download_config = download_config.copy() if download_config else DownloadConfig() 1489 download_config.use_auth_token = use_auth_token -> 1490 dataset_module = dataset_module_factory( 1491 path, 1492 revision=revision, 1493 download_config=download_config, 1494 download_mode=download_mode, 1495 data_dir=data_dir, 1496 data_files=data_files, 1497 ) 1499 # Get dataset builder class from the processing script 1500 builder_cls = import_main_class(dataset_module.module_path) File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1238, in dataset_module_factory(path, revision, download_config, download_mode, force_local_path, dynamic_modules_path, data_dir, data_files, **download_kwargs) 1236 raise ConnectionError(f"Couln't reach the Hugging Face Hub for dataset '{path}': {e1}") from None 1237 if isinstance(e1, FileNotFoundError): -> 1238 raise FileNotFoundError( 1239 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. " 1240 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}" 1241 ) from None 1242 raise e1 from None 1243 else: FileNotFoundError: Couldn't find a dataset script at /kaggle/working/JourneyDB/JourneyDB/JourneyDB.py or any data file in the same directory. Couldn't find 'JourneyDB/JourneyDB' on the Hugging Face Hub either: FileNotFoundError: Unable to find data in dataset repository JourneyDB/JourneyDB with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] ``` ### Steps to reproduce the bug 1) ``` from huggingface_hub import notebook_login notebook_login() ``` 2) ``` !pip install -q datasets from datasets import load_dataset ``` 3) `dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)` ### Expected behavior Load the dataset ### Environment info Notebook > JourneyDB/JourneyDB is a gated dataset, so this error means you are not authenticated to access it, either by using an invalid token or by not agreeing to the terms in the dialog on the dataset page.Β΄ I did authentication with: ``` from huggingface_hub import notebook_login notebook_login() ``` Isn't that the correct way to do it? > Indeed, the dataset's data files structure is not supported natively by datasets. To load it, one option is to clone the repo (or download it with huggingface_hub.snapshot_download) and use Dataset.from_generator to process the files. Great suggestion I will give it a try.
[ 0.0275250393897295, 0.020098794251680374, -0.03406011313199997, -0.0532824881374836, 0.22631344199180603, 0.054627444595098495, 0.16491729021072388, -0.002472198335453868, -0.007282711565494537, 0.18711090087890625, -0.014829772524535656, -0.12124999612569809, -0.025810519233345985, 0.03420545905828476, -0.012391125783324242, -0.015898069366812706, -0.09960699826478958, -0.06391613930463791, -0.05945359542965889, 0.032982077449560165, -0.08655545115470886, 0.0784585028886795, 0.11688756197690964, -0.09532724320888519, -0.09057218581438065, -0.08656009286642075, 0.04439965635538101, 0.11475500464439392, 0.0018932846141979098, -0.14559446275234222, 0.19287611544132233, 0.014345493167638779, 0.06958841532468796, 0.22857072949409485, 0.000005568777851294726, 0.029177410528063774, 0.189137801527977, 0.08841519802808762, -0.08566685020923615, -0.10710594803094864, 0.06585251539945602, 0.027349257841706276, -0.013393678702414036, -0.06243705749511719, -0.09397933632135391, -0.2311093956232071, -0.12239117175340652, 0.020655499771237373, 0.0719001442193985, 0.16053764522075653, -0.0021544857881963253, -0.03979562595486641, -0.07136852294206619, -0.21906262636184692, 0.04083295539021492, -0.022564513608813286, 0.01346292532980442, 0.13190510869026184, -0.168070986866951, -0.12248477339744568, -0.044722799211740494, -0.17186643183231354, -0.03811419755220413, 0.011360530741512775, 0.006996129173785448, -0.03405963256955147, 0.0011362402001395822, -0.01703558675944805, 0.03406926989555359, 0.2569197714328766, 0.1010921373963356, 0.183113232254982, -0.12135548144578934, 0.014234701171517372, -0.014413776807487011, -0.054111797362565994, 0.005250710528343916, -0.0848318487405777, -0.19542284309864044, 0.2084427922964096, -0.14773288369178772, -0.09568778425455093, 0.008124150335788727, 0.03988399729132652, -0.10157656669616699, 0.005774438381195068, -0.21057459712028503, 0.030654897913336754, -0.050537336617708206, -0.1081390231847763, 0.22248975932598114, 0.0837150290608406, 0.024518072605133057, -0.16309981048107147, 0.23003213107585907, 0.12924183905124664, 0.023305658251047134, 0.12263888865709305, -0.060736581683158875, 0.04330385476350784, -0.10478542745113373, -0.21509170532226562, -0.013995430432260036, 0.16689099371433258, 0.06513567268848419, -0.011290655471384525, 0.02696891687810421, -0.08423763513565063, -0.018390042707324028, 0.18054862320423126, -0.0665372684597969, 0.17435379326343536, -0.21519950032234192, -0.22897763550281525, 0.08430595695972443, 0.09104341268539429, 0.10866537690162659, 0.07946766167879105, 0.08463533222675323, 0.03838839754462242, 0.011347014456987381, 0.13592752814292908, 0.12625253200531006, 0.26123568415641785, 0.10411453992128372, -0.08983105421066284, -0.015650302171707153, 0.13544543087482452, 0.06859849393367767, -0.05236204341053963, -0.13626272976398468, -0.08197986334562302, -0.040635574609041214, -0.033840566873550415, 0.10067476332187653, -0.07847916334867477, 0.006936124060302973, -0.19212649762630463, -0.058918699622154236, 0.04539848119020462, 0.0680062547326088, -0.07200112193822861, -0.12857681512832642, 0.03669308125972748, 0.17034360766410828, -0.008523561991751194, 0.17366480827331543, -0.09972574561834335, 0.05578652024269104, -0.06938076764345169, -0.2821974456310272, 0.10006853938102722, -0.20835398137569427, 0.07249381393194199, -0.15859127044677734, -0.009066340513527393, -0.021044274792075157, -0.07572448998689651, -0.13015994429588318, -0.11104586720466614, 0.11409343034029007, 0.0753927007317543, 0.031818874180316925, -0.12445623427629471, 0.25232502818107605, 0.13103453814983368, 0.12202177941799164, -0.005867442116141319, -0.08991029858589172, -0.10718688368797302, 0.034728359431028366, 0.047867100685834885, -0.09244073927402496, 0.15009085834026337, -0.19737471640110016, 0.05061402916908264, -0.08057244122028351, 0.03278910368680954, -0.23070622980594635, 0.0842379555106163, 0.13069868087768555, -0.05625326931476593, -0.035769712179899216, -0.20292270183563232, 0.015113327652215958, -0.08430346846580505, 0.03407678380608559, 0.07407400757074356, -0.018073992803692818, -0.13466501235961914, 0.08152556419372559, 0.038771867752075195, 0.17678171396255493, -0.016688179224729538, 0.10344649106264114, -0.11727539449930191, -0.0002545528404880315, -0.1308542937040329, 0.0003103001799900085, -0.2599656283855438, -0.2046978622674942, 0.0978432223200798, -0.02952435426414013, 0.05766269937157631, 0.021369827911257744, -0.015472792088985443, -0.09793177247047424, 0.231806680560112, 0.03647173196077347, -0.2404453456401825, -0.10588230192661285, 0.02521512471139431, -0.12926775217056274, -0.03104075975716114, -0.17353303730487823, -0.0054677329026162624, 0.0801817923784256, 0.034359805285930634, -0.038293540477752686, 0.16906854510307312, -0.093269944190979, 0.036889687180519104, 0.06253309547901154, -0.025164710357785225, -0.0072964890860021114, 0.08143286406993866, 0.04110543057322502, -0.04232713580131531, -0.0016796387499198318, 0.13783280551433563, -0.18298719823360443, -0.09423903375864029, 0.06474807113409042, 0.10090743005275726, 0.018934762105345726, 0.002436729148030281, 0.05048251897096634, -0.16118063032627106, -0.05452360957860947, -0.036752358078956604, -0.19620169699192047, 0.025658732280135155, -0.04680413380265236, -0.0645136758685112, 0.011397269554436207, -0.020287049934267998, -0.08345738798379898, 0.1544390618801117, -0.013105548918247223, 0.043187446892261505, 0.22343270480632782, 0.06336463242769241, -0.14948873221874237, 0.12410513311624527, 0.18975511193275452, -0.19919219613075256, 0.04647251218557358, 0.07805737853050232, -0.1019793227314949, -0.1893630176782608, 0.14558739960193634, -0.011526701040565968, 0.017883092164993286, -0.09252548217773438, 0.03501569479703903, -0.12294530868530273, 0.15072841942310333, -0.06116677075624466, -0.08737602084875107, 0.05658368021249771, -0.039739351719617844, -0.0740373432636261, -0.12880079448223114, -0.18912595510482788, 0.10249842703342438, -0.010701683349907398, 0.06406624615192413, -0.013097022660076618, -0.013272414915263653, -0.04568256065249443, -0.20443220436573029, 0.09723041206598282, 0.12701134383678436, -0.05266188830137253, 0.0780177041888237, 0.05196705833077431, -0.15717796981334686, 0.011565245687961578, 0.03343215212225914, -0.08415690809488297, 0.0476788766682148, 0.08944615721702576, 0.009757484309375286, -0.06550492346286774, -0.11796744912862778, 0.04488883167505264, 0.12904739379882812, -0.026182595640420914, -0.00022065959637984633, 0.02060667984187603, -0.07586351037025452, -0.0042226240038871765, 0.10436283051967621, 0.02825034223496914, 0.12948782742023468, 0.030635327100753784, 0.1708136796951294, 0.1037977784872055, -0.08904757350683212, -0.09258320182561874, 0.11299867182970047, -0.09360043704509735, 0.06030890718102455, 0.16432982683181763, 0.07152338325977325, 0.09440133720636368, 0.05303887277841568, -0.10310237854719162, 0.20020492374897003, 0.19385971128940582, 0.00592912407591939, 0.12709476053714752, -0.04025400057435036, 0.011254102922976017, 0.016504522413015366, 0.1787363886833191, -0.3007016181945801, -0.1156998872756958, -0.048167433589696884, -0.022563450038433075, -0.0779942199587822, 0.20249395072460175, -0.047889839857816696, 0.01996724307537079, 0.04511979594826698, -0.09238190203905106, -0.15042069554328918, -0.07345746457576752, 0.25809505581855774, -0.11659295111894608, -0.03808228671550751, 0.012716296128928661, -0.037537768483161926, 0.11389335989952087, 0.07234521955251694, -0.05436132475733757, 0.02277440018951893, -0.04494800791144371, -0.09768949449062347, -0.16454222798347473, -0.035859059542417526, 0.10009755194187164, -0.07554485648870468, -0.04965702071785927, 0.043447259813547134, 0.049924757331609726, -0.09414658695459366, 0.13684318959712982, 0.06403183192014694, -0.023117009550333023, 0.07918096333742142, 0.09296231716871262, 0.03082738071680069, -0.005299323704093695, -0.02941981516778469, 0.2375316619873047, 0.11924875527620316, 0.027850329875946045, -0.06270731985569, -0.1749807447195053, -0.015741292387247086, -0.04884340614080429, -0.016822636127471924, -0.010592401959002018, 0.009154973551630974, 0.07340361922979355, -0.04141463339328766, -0.23833067715168, 0.0717807188630104, 0.0028185490518808365, -0.084011510014534, -0.19814863801002502, -0.030927764251828194, 0.034992337226867676, 0.15134111046791077, 0.012289115227758884, -0.020120685920119286, 0.02400129660964012, 0.02443394809961319, 0.08438954502344131, 0.08011924475431442, 0.13693013787269592, -0.013220169581472874, -0.2237212061882019, 0.06739147752523422, -0.1726960688829422, 0.16299410164356232, 0.08182644844055176, 0.027073511853814125, -0.05774601921439171, 0.009150099009275436, 0.20136350393295288, -0.03703642636537552, 0.12905699014663696, 0.0686243548989296, -0.026240678504109383, 0.11626239120960236, -0.08090510964393616, 0.08660748600959778, -0.0803186371922493, 0.04800158739089966, 0.08661281317472458, 0.028146350756287575, -0.038380347192287445, 0.09061355888843536, -0.04387844726443291, -0.025274228304624557, -0.08010685443878174, -0.215987429022789, -0.225411519408226, -0.1759101003408432, -0.09827665984630585, 0.14716479182243347, 0.23771803081035614, 0.033199820667505264, -0.09892521798610687, 0.10210679471492767, -0.04819290339946747, 0.1712065190076828, -0.0840776264667511, 0.05471927300095558, -0.11775091290473938, 0.07719150930643082, 0.1789124757051468, 0.04719628393650055, -0.03695351630449295, 0.4390234351158142, 0.02638815902173519, -0.08888572454452515, 0.06500356644392014, -0.15321677923202515, -0.07354573905467987, 0.08026418834924698, -0.07020338624715805, 0.02955756150186062, 0.014418174512684345, -0.13887405395507812, -0.018924811854958534, 0.07556092739105225, -0.05992745980620384, -0.05852528661489487, -0.1381378471851349, -0.0823427066206932, -0.3365992307662964, 0.11084596812725067, 0.09901224076747894, 0.10394972562789917, -0.0376821868121624, 0.028422413393855095, 0.073330819606781, -0.17609067261219025, -0.045465268194675446, -0.11753836274147034, 0.03097611293196678, 0.14715395867824554, -0.012175878509879112, 0.2042209357023239, -0.18571504950523376, -0.09116494655609131, 0.1239442303776741, -0.09541932493448257, 0.09365860372781754, -0.10296803712844849, 0.010363451205193996, 0.1132315993309021, -0.10505039244890213, 0.05778215080499649, -0.12031703442335129, -0.0012641726061701775, 0.008257021196186543, 0.12506310641765594, 0.03334496542811394, 0.1349947601556778, -0.09044187515974045, -0.021476980298757553, 0.14586302638053894, 0.1583012491464615, -0.08105972409248352, -0.11584313958883286, -0.03193984553217888, 0.18524427711963654, -0.0032522063702344894, 0.05784105509519577, -0.04302237182855606, 0.09641902893781662, -0.06036173924803734, -0.12842130661010742, 0.07974934577941895, 0.08686630427837372, 0.05754418671131134, 0.035424601286649704, -0.13578179478645325, 0.02069947123527527, 0.07880601286888123, -0.036883220076560974, -0.31806400418281555, 0.09125450253486633, 0.058184489607810974, -0.0747983381152153, -0.13523004949092865, 0.03700445964932442, 0.09066616743803024, -0.14546453952789307, 0.0044694761745631695, 0.12414015084505081, -0.00860722828656435, -0.018232783302664757, -0.019915465265512466, -0.09240283817052841, 0.04504561051726341, 0.05730430409312248, -0.03240850567817688, -0.01956055499613285, -0.03603900969028473, 0.01964510977268219, 0.15123103559017181, -0.00526264775544405, 0.22198878228664398, 0.20305182039737701, -0.005642227362841368, 0.07388081401586533, 0.2592127323150635, 0.22124344110488892, 0.07426335662603378, -0.10145802795886993, 0.12426497787237167, 0.19625934958457947, -0.08847066015005112, 0.13894633948802948, 0.10471663624048233, 0.07169941067695618, -0.06195579096674919, 0.09240716695785522, 0.11975554376840591, 0.10923171043395996, 0.11229346692562103, 0.0037813722155988216, -0.014676941558718681, -0.09541579335927963, -0.1329001933336258, -0.08481216430664062, 0.14397796988487244, 0.04555240646004677, -0.004004805348813534, -0.05451894551515579, -2.569510456600149e-32, -0.10558956116437912, 0.0037390412762761116, -0.11506113409996033, 0.08994273096323013, -0.1981653869152069, 0.061935290694236755, -0.08701705187559128, 0.015194940380752087, -0.21179461479187012, -0.08239731937646866, -0.06124415621161461, -0.089499831199646, -0.00907989963889122, 0.09300874918699265, -0.14822572469711304, 0.0010471625719219446, -0.07263056188821793, -0.02043585292994976, 0.011475157923996449, 0.10881735384464264, -0.04590108245611191, 0.07519426196813583, -0.014750989153981209, 0.13359621167182922, 0.036702439188957214, -0.09899551421403885, -0.1891201138496399, -0.07509183138608932, 0.07785794883966446, -0.0424603708088398, -0.09746972471475601, 0.034231141209602356, 0.05323898792266846, -0.06065762788057327, -0.17255938053131104, -0.018711091950535774, -0.1549476534128189, -0.0637279599905014, -0.03229692578315735, 0.10173670202493668, -0.028285101056098938, 0.1193261370062828, 0.046977344900369644, -0.2922191619873047, 0.027617674320936203, 0.1604442596435547, 0.05015595257282257, -0.025940531864762306, 0.007467195857316256, -0.13898853957653046, 0.06404609978199005, 0.02455667220056057, -0.10119566321372986, 0.06429068744182587, 0.10441981256008148, -0.06258466094732285, -0.10817738622426987, 0.060348380357027054, -0.08838053792715073, 0.011426339857280254, 0.03598149120807648, -0.17304784059524536, 0.04713878780603409, 0.0008228839142248034, 0.10487688332796097, -0.1009797528386116, 0.2686401605606079, 0.06730518490076065, -0.10801763832569122, -0.09992208331823349, 0.13507968187332153, 0.17331460118293762, -0.08327993750572205, -0.003452755743637681, -0.2466062307357788, -0.0759284645318985, -0.17748267948627472, 0.01902979053556919, 0.0341661162674427, -0.1442277729511261, 0.1540597826242447, 0.01521601527929306, -0.028967678546905518, 0.02080157957971096, 0.02158106118440628, -0.031238561496138573, 0.022664183750748634, 0.009082425385713577, -0.25049328804016113, -0.028995618224143982, 0.0248397346585989, 0.012721170671284199, -0.13576604425907135, -0.06444116681814194, -0.16717717051506042, 0.13501060009002686, 0.07808542251586914, 0.019647089764475822, -0.06445259600877762, 0.11163438856601715, -0.21799220144748688, 0.021215805783867836, 0.10958356410264969, 0.1283697783946991, 0.12596549093723297, 0.014013857580721378, 0.04574677720665932, -0.09573716670274734, -0.1984846442937851, -0.008263709023594856, -0.03772321343421936, 0.10644352436065674, 0.12638060748577118, 0.17932702600955963, 0.14114412665367126, 0.042320843786001205, -0.0709792748093605, -0.08084522187709808, 0.11195700615644455, 0.12272578477859497, -0.18513183295726776, -0.004224599339067936, -0.1121470108628273, 0.05653422698378563, -0.014166897162795067, 0.0232028067111969, -0.2163306474685669, -0.0518915094435215, 0.019428608939051628, 0.040580447763204575, 0.02777470275759697, -0.06907851994037628, 7.2116603178074e-7, -0.2795960009098053, 0.1610279381275177, 0.007700982969254255, 0.017783600836992264, -0.0152587890625, -0.02995227463543415, -0.2916729152202606, 0.11799407750368118, 0.00259313709102571, 0.0813942700624466, 0.1447245478630066, 0.03190716356039047, -0.17721356451511383, 0.040176115930080414, 0.03258324787020683, -0.1902168095111847, -0.045446448028087616, 0.010506423190236092, 0.027247479185461998, 0.045691777020692825, 0.09175454080104828, 0.19327157735824585, 0.1063770055770874, -0.03553743660449982, 0.04509750008583069, -0.040555957704782486, -0.022467665374279022, -0.09095699340105057, 0.01658778451383114, 0.01695415750145912, -0.06354907155036926, 0.17830297350883484, -0.16726921498775482, 0.22973252832889557, 0.06147237494587898, -0.06367133557796478, -0.18459036946296692, -0.1582423746585846, 0.1229071244597435, 0.08936542272567749, -0.029287898913025856, 0.11013845354318619, -0.059094540774822235, -0.06678144633769989, 0.10886186361312866, 0.16100630164146423, -0.03453947603702545, 0.023084230720996857, -0.10521161556243896, 0.18299154937267303, 0.15476453304290771, 0.18970723450183868, 0.11383889615535736, 0.10846402496099472, -0.07613971829414368, 0.01773480512201786, -0.1294691413640976, -0.1424412876367569, 0.1800336092710495, -0.00013635109644383192, -0.0562361516058445, -0.0035129240714013577, 0.04120030999183655, 0.055275555700063705, -0.03436429053544998, -0.003323032520711422, -0.11501665413379669, 3.91776310711611e-35, 0.03861211612820625, -0.0795898512005806, 0.06427451223134995, -0.2605421543121338, -0.035063568502664566, -0.08154553174972534, 0.1602553427219391, -0.07910820096731186, 0.03679325431585312, -0.21771357953548431, 0.06896430253982544 ]
https://github.com/huggingface/datasets/issues/6261
Can't load a dataset
Have you accepted the terms in the dialog [here](https://huggingface.co/datasets/JourneyDB/JourneyDB)? IIRC Kaggle preinstalls an outdated `datasets` version, so it's also a good idea to update it before importing `datasets` (and do the same for `huggingface_hub`)
### Describe the bug Can't seem to load the JourneyDB dataset. It throws the following error: ``` --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) Cell In[15], line 2 1 # If the dataset is gated/private, make sure you have run huggingface-cli login ----> 2 dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True) File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1664, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1661 ignore_verifications = ignore_verifications or save_infos 1663 # Create a dataset builder -> 1664 builder_instance = load_dataset_builder( 1665 path=path, 1666 name=name, 1667 data_dir=data_dir, 1668 data_files=data_files, 1669 cache_dir=cache_dir, 1670 features=features, 1671 download_config=download_config, 1672 download_mode=download_mode, 1673 revision=revision, 1674 use_auth_token=use_auth_token, 1675 **config_kwargs, 1676 ) 1678 # Return iterable dataset in case of streaming 1679 if streaming: File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1490, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, **config_kwargs) 1488 download_config = download_config.copy() if download_config else DownloadConfig() 1489 download_config.use_auth_token = use_auth_token -> 1490 dataset_module = dataset_module_factory( 1491 path, 1492 revision=revision, 1493 download_config=download_config, 1494 download_mode=download_mode, 1495 data_dir=data_dir, 1496 data_files=data_files, 1497 ) 1499 # Get dataset builder class from the processing script 1500 builder_cls = import_main_class(dataset_module.module_path) File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1238, in dataset_module_factory(path, revision, download_config, download_mode, force_local_path, dynamic_modules_path, data_dir, data_files, **download_kwargs) 1236 raise ConnectionError(f"Couln't reach the Hugging Face Hub for dataset '{path}': {e1}") from None 1237 if isinstance(e1, FileNotFoundError): -> 1238 raise FileNotFoundError( 1239 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. " 1240 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}" 1241 ) from None 1242 raise e1 from None 1243 else: FileNotFoundError: Couldn't find a dataset script at /kaggle/working/JourneyDB/JourneyDB/JourneyDB.py or any data file in the same directory. Couldn't find 'JourneyDB/JourneyDB' on the Hugging Face Hub either: FileNotFoundError: Unable to find data in dataset repository JourneyDB/JourneyDB with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] ``` ### Steps to reproduce the bug 1) ``` from huggingface_hub import notebook_login notebook_login() ``` 2) ``` !pip install -q datasets from datasets import load_dataset ``` 3) `dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)` ### Expected behavior Load the dataset ### Environment info Notebook
34
Can't load a dataset ### Describe the bug Can't seem to load the JourneyDB dataset. It throws the following error: ``` --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) Cell In[15], line 2 1 # If the dataset is gated/private, make sure you have run huggingface-cli login ----> 2 dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True) File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1664, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, **config_kwargs) 1661 ignore_verifications = ignore_verifications or save_infos 1663 # Create a dataset builder -> 1664 builder_instance = load_dataset_builder( 1665 path=path, 1666 name=name, 1667 data_dir=data_dir, 1668 data_files=data_files, 1669 cache_dir=cache_dir, 1670 features=features, 1671 download_config=download_config, 1672 download_mode=download_mode, 1673 revision=revision, 1674 use_auth_token=use_auth_token, 1675 **config_kwargs, 1676 ) 1678 # Return iterable dataset in case of streaming 1679 if streaming: File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1490, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, **config_kwargs) 1488 download_config = download_config.copy() if download_config else DownloadConfig() 1489 download_config.use_auth_token = use_auth_token -> 1490 dataset_module = dataset_module_factory( 1491 path, 1492 revision=revision, 1493 download_config=download_config, 1494 download_mode=download_mode, 1495 data_dir=data_dir, 1496 data_files=data_files, 1497 ) 1499 # Get dataset builder class from the processing script 1500 builder_cls = import_main_class(dataset_module.module_path) File /opt/conda/lib/python3.10/site-packages/datasets/load.py:1238, in dataset_module_factory(path, revision, download_config, download_mode, force_local_path, dynamic_modules_path, data_dir, data_files, **download_kwargs) 1236 raise ConnectionError(f"Couln't reach the Hugging Face Hub for dataset '{path}': {e1}") from None 1237 if isinstance(e1, FileNotFoundError): -> 1238 raise FileNotFoundError( 1239 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. " 1240 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}" 1241 ) from None 1242 raise e1 from None 1243 else: FileNotFoundError: Couldn't find a dataset script at /kaggle/working/JourneyDB/JourneyDB/JourneyDB.py or any data file in the same directory. Couldn't find 'JourneyDB/JourneyDB' on the Hugging Face Hub either: FileNotFoundError: Unable to find data in dataset repository JourneyDB/JourneyDB with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] ``` ### Steps to reproduce the bug 1) ``` from huggingface_hub import notebook_login notebook_login() ``` 2) ``` !pip install -q datasets from datasets import load_dataset ``` 3) `dataset = load_dataset("JourneyDB/JourneyDB", data_files="data", use_auth_token=True)` ### Expected behavior Load the dataset ### Environment info Notebook Have you accepted the terms in the dialog [here](https://huggingface.co/datasets/JourneyDB/JourneyDB)? IIRC Kaggle preinstalls an outdated `datasets` version, so it's also a good idea to update it before importing `datasets` (and do the same for `huggingface_hub`)
[ 0.0275250393897295, 0.020098794251680374, -0.03406011313199997, -0.0532824881374836, 0.22631344199180603, 0.054627444595098495, 0.16491729021072388, -0.002472198335453868, -0.007282711565494537, 0.18711090087890625, -0.014829772524535656, -0.12124999612569809, -0.025810519233345985, 0.03420545905828476, -0.012391125783324242, -0.015898069366812706, -0.09960699826478958, -0.06391613930463791, -0.05945359542965889, 0.032982077449560165, -0.08655545115470886, 0.0784585028886795, 0.11688756197690964, -0.09532724320888519, -0.09057218581438065, -0.08656009286642075, 0.04439965635538101, 0.11475500464439392, 0.0018932846141979098, -0.14559446275234222, 0.19287611544132233, 0.014345493167638779, 0.06958841532468796, 0.22857072949409485, 0.000005568777851294726, 0.029177410528063774, 0.189137801527977, 0.08841519802808762, -0.08566685020923615, -0.10710594803094864, 0.06585251539945602, 0.027349257841706276, -0.013393678702414036, -0.06243705749511719, -0.09397933632135391, -0.2311093956232071, -0.12239117175340652, 0.020655499771237373, 0.0719001442193985, 0.16053764522075653, -0.0021544857881963253, -0.03979562595486641, -0.07136852294206619, -0.21906262636184692, 0.04083295539021492, -0.022564513608813286, 0.01346292532980442, 0.13190510869026184, -0.168070986866951, -0.12248477339744568, -0.044722799211740494, -0.17186643183231354, -0.03811419755220413, 0.011360530741512775, 0.006996129173785448, -0.03405963256955147, 0.0011362402001395822, -0.01703558675944805, 0.03406926989555359, 0.2569197714328766, 0.1010921373963356, 0.183113232254982, -0.12135548144578934, 0.014234701171517372, -0.014413776807487011, -0.054111797362565994, 0.005250710528343916, -0.0848318487405777, -0.19542284309864044, 0.2084427922964096, -0.14773288369178772, -0.09568778425455093, 0.008124150335788727, 0.03988399729132652, -0.10157656669616699, 0.005774438381195068, -0.21057459712028503, 0.030654897913336754, -0.050537336617708206, -0.1081390231847763, 0.22248975932598114, 0.0837150290608406, 0.024518072605133057, -0.16309981048107147, 0.23003213107585907, 0.12924183905124664, 0.023305658251047134, 0.12263888865709305, -0.060736581683158875, 0.04330385476350784, -0.10478542745113373, -0.21509170532226562, -0.013995430432260036, 0.16689099371433258, 0.06513567268848419, -0.011290655471384525, 0.02696891687810421, -0.08423763513565063, -0.018390042707324028, 0.18054862320423126, -0.0665372684597969, 0.17435379326343536, -0.21519950032234192, -0.22897763550281525, 0.08430595695972443, 0.09104341268539429, 0.10866537690162659, 0.07946766167879105, 0.08463533222675323, 0.03838839754462242, 0.011347014456987381, 0.13592752814292908, 0.12625253200531006, 0.26123568415641785, 0.10411453992128372, -0.08983105421066284, -0.015650302171707153, 0.13544543087482452, 0.06859849393367767, -0.05236204341053963, -0.13626272976398468, -0.08197986334562302, -0.040635574609041214, -0.033840566873550415, 0.10067476332187653, -0.07847916334867477, 0.006936124060302973, -0.19212649762630463, -0.058918699622154236, 0.04539848119020462, 0.0680062547326088, -0.07200112193822861, -0.12857681512832642, 0.03669308125972748, 0.17034360766410828, -0.008523561991751194, 0.17366480827331543, -0.09972574561834335, 0.05578652024269104, -0.06938076764345169, -0.2821974456310272, 0.10006853938102722, -0.20835398137569427, 0.07249381393194199, -0.15859127044677734, -0.009066340513527393, -0.021044274792075157, -0.07572448998689651, -0.13015994429588318, -0.11104586720466614, 0.11409343034029007, 0.0753927007317543, 0.031818874180316925, -0.12445623427629471, 0.25232502818107605, 0.13103453814983368, 0.12202177941799164, -0.005867442116141319, -0.08991029858589172, -0.10718688368797302, 0.034728359431028366, 0.047867100685834885, -0.09244073927402496, 0.15009085834026337, -0.19737471640110016, 0.05061402916908264, -0.08057244122028351, 0.03278910368680954, -0.23070622980594635, 0.0842379555106163, 0.13069868087768555, -0.05625326931476593, -0.035769712179899216, -0.20292270183563232, 0.015113327652215958, -0.08430346846580505, 0.03407678380608559, 0.07407400757074356, -0.018073992803692818, -0.13466501235961914, 0.08152556419372559, 0.038771867752075195, 0.17678171396255493, -0.016688179224729538, 0.10344649106264114, -0.11727539449930191, -0.0002545528404880315, -0.1308542937040329, 0.0003103001799900085, -0.2599656283855438, -0.2046978622674942, 0.0978432223200798, -0.02952435426414013, 0.05766269937157631, 0.021369827911257744, -0.015472792088985443, -0.09793177247047424, 0.231806680560112, 0.03647173196077347, -0.2404453456401825, -0.10588230192661285, 0.02521512471139431, -0.12926775217056274, -0.03104075975716114, -0.17353303730487823, -0.0054677329026162624, 0.0801817923784256, 0.034359805285930634, -0.038293540477752686, 0.16906854510307312, -0.093269944190979, 0.036889687180519104, 0.06253309547901154, -0.025164710357785225, -0.0072964890860021114, 0.08143286406993866, 0.04110543057322502, -0.04232713580131531, -0.0016796387499198318, 0.13783280551433563, -0.18298719823360443, -0.09423903375864029, 0.06474807113409042, 0.10090743005275726, 0.018934762105345726, 0.002436729148030281, 0.05048251897096634, -0.16118063032627106, -0.05452360957860947, -0.036752358078956604, -0.19620169699192047, 0.025658732280135155, -0.04680413380265236, -0.0645136758685112, 0.011397269554436207, -0.020287049934267998, -0.08345738798379898, 0.1544390618801117, -0.013105548918247223, 0.043187446892261505, 0.22343270480632782, 0.06336463242769241, -0.14948873221874237, 0.12410513311624527, 0.18975511193275452, -0.19919219613075256, 0.04647251218557358, 0.07805737853050232, -0.1019793227314949, -0.1893630176782608, 0.14558739960193634, -0.011526701040565968, 0.017883092164993286, -0.09252548217773438, 0.03501569479703903, -0.12294530868530273, 0.15072841942310333, -0.06116677075624466, -0.08737602084875107, 0.05658368021249771, -0.039739351719617844, -0.0740373432636261, -0.12880079448223114, -0.18912595510482788, 0.10249842703342438, -0.010701683349907398, 0.06406624615192413, -0.013097022660076618, -0.013272414915263653, -0.04568256065249443, -0.20443220436573029, 0.09723041206598282, 0.12701134383678436, -0.05266188830137253, 0.0780177041888237, 0.05196705833077431, -0.15717796981334686, 0.011565245687961578, 0.03343215212225914, -0.08415690809488297, 0.0476788766682148, 0.08944615721702576, 0.009757484309375286, -0.06550492346286774, -0.11796744912862778, 0.04488883167505264, 0.12904739379882812, -0.026182595640420914, -0.00022065959637984633, 0.02060667984187603, -0.07586351037025452, -0.0042226240038871765, 0.10436283051967621, 0.02825034223496914, 0.12948782742023468, 0.030635327100753784, 0.1708136796951294, 0.1037977784872055, -0.08904757350683212, -0.09258320182561874, 0.11299867182970047, -0.09360043704509735, 0.06030890718102455, 0.16432982683181763, 0.07152338325977325, 0.09440133720636368, 0.05303887277841568, -0.10310237854719162, 0.20020492374897003, 0.19385971128940582, 0.00592912407591939, 0.12709476053714752, -0.04025400057435036, 0.011254102922976017, 0.016504522413015366, 0.1787363886833191, -0.3007016181945801, -0.1156998872756958, -0.048167433589696884, -0.022563450038433075, -0.0779942199587822, 0.20249395072460175, -0.047889839857816696, 0.01996724307537079, 0.04511979594826698, -0.09238190203905106, -0.15042069554328918, -0.07345746457576752, 0.25809505581855774, -0.11659295111894608, -0.03808228671550751, 0.012716296128928661, -0.037537768483161926, 0.11389335989952087, 0.07234521955251694, -0.05436132475733757, 0.02277440018951893, -0.04494800791144371, -0.09768949449062347, -0.16454222798347473, -0.035859059542417526, 0.10009755194187164, -0.07554485648870468, -0.04965702071785927, 0.043447259813547134, 0.049924757331609726, -0.09414658695459366, 0.13684318959712982, 0.06403183192014694, -0.023117009550333023, 0.07918096333742142, 0.09296231716871262, 0.03082738071680069, -0.005299323704093695, -0.02941981516778469, 0.2375316619873047, 0.11924875527620316, 0.027850329875946045, -0.06270731985569, -0.1749807447195053, -0.015741292387247086, -0.04884340614080429, -0.016822636127471924, -0.010592401959002018, 0.009154973551630974, 0.07340361922979355, -0.04141463339328766, -0.23833067715168, 0.0717807188630104, 0.0028185490518808365, -0.084011510014534, -0.19814863801002502, -0.030927764251828194, 0.034992337226867676, 0.15134111046791077, 0.012289115227758884, -0.020120685920119286, 0.02400129660964012, 0.02443394809961319, 0.08438954502344131, 0.08011924475431442, 0.13693013787269592, -0.013220169581472874, -0.2237212061882019, 0.06739147752523422, -0.1726960688829422, 0.16299410164356232, 0.08182644844055176, 0.027073511853814125, -0.05774601921439171, 0.009150099009275436, 0.20136350393295288, -0.03703642636537552, 0.12905699014663696, 0.0686243548989296, -0.026240678504109383, 0.11626239120960236, -0.08090510964393616, 0.08660748600959778, -0.0803186371922493, 0.04800158739089966, 0.08661281317472458, 0.028146350756287575, -0.038380347192287445, 0.09061355888843536, -0.04387844726443291, -0.025274228304624557, -0.08010685443878174, -0.215987429022789, -0.225411519408226, -0.1759101003408432, -0.09827665984630585, 0.14716479182243347, 0.23771803081035614, 0.033199820667505264, -0.09892521798610687, 0.10210679471492767, -0.04819290339946747, 0.1712065190076828, -0.0840776264667511, 0.05471927300095558, -0.11775091290473938, 0.07719150930643082, 0.1789124757051468, 0.04719628393650055, -0.03695351630449295, 0.4390234351158142, 0.02638815902173519, -0.08888572454452515, 0.06500356644392014, -0.15321677923202515, -0.07354573905467987, 0.08026418834924698, -0.07020338624715805, 0.02955756150186062, 0.014418174512684345, -0.13887405395507812, -0.018924811854958534, 0.07556092739105225, -0.05992745980620384, -0.05852528661489487, -0.1381378471851349, -0.0823427066206932, -0.3365992307662964, 0.11084596812725067, 0.09901224076747894, 0.10394972562789917, -0.0376821868121624, 0.028422413393855095, 0.073330819606781, -0.17609067261219025, -0.045465268194675446, -0.11753836274147034, 0.03097611293196678, 0.14715395867824554, -0.012175878509879112, 0.2042209357023239, -0.18571504950523376, -0.09116494655609131, 0.1239442303776741, -0.09541932493448257, 0.09365860372781754, -0.10296803712844849, 0.010363451205193996, 0.1132315993309021, -0.10505039244890213, 0.05778215080499649, -0.12031703442335129, -0.0012641726061701775, 0.008257021196186543, 0.12506310641765594, 0.03334496542811394, 0.1349947601556778, -0.09044187515974045, -0.021476980298757553, 0.14586302638053894, 0.1583012491464615, -0.08105972409248352, -0.11584313958883286, -0.03193984553217888, 0.18524427711963654, -0.0032522063702344894, 0.05784105509519577, -0.04302237182855606, 0.09641902893781662, -0.06036173924803734, -0.12842130661010742, 0.07974934577941895, 0.08686630427837372, 0.05754418671131134, 0.035424601286649704, -0.13578179478645325, 0.02069947123527527, 0.07880601286888123, -0.036883220076560974, -0.31806400418281555, 0.09125450253486633, 0.058184489607810974, -0.0747983381152153, -0.13523004949092865, 0.03700445964932442, 0.09066616743803024, -0.14546453952789307, 0.0044694761745631695, 0.12414015084505081, -0.00860722828656435, -0.018232783302664757, -0.019915465265512466, -0.09240283817052841, 0.04504561051726341, 0.05730430409312248, -0.03240850567817688, -0.01956055499613285, -0.03603900969028473, 0.01964510977268219, 0.15123103559017181, -0.00526264775544405, 0.22198878228664398, 0.20305182039737701, -0.005642227362841368, 0.07388081401586533, 0.2592127323150635, 0.22124344110488892, 0.07426335662603378, -0.10145802795886993, 0.12426497787237167, 0.19625934958457947, -0.08847066015005112, 0.13894633948802948, 0.10471663624048233, 0.07169941067695618, -0.06195579096674919, 0.09240716695785522, 0.11975554376840591, 0.10923171043395996, 0.11229346692562103, 0.0037813722155988216, -0.014676941558718681, -0.09541579335927963, -0.1329001933336258, -0.08481216430664062, 0.14397796988487244, 0.04555240646004677, -0.004004805348813534, -0.05451894551515579, -2.569510456600149e-32, -0.10558956116437912, 0.0037390412762761116, -0.11506113409996033, 0.08994273096323013, -0.1981653869152069, 0.061935290694236755, -0.08701705187559128, 0.015194940380752087, -0.21179461479187012, -0.08239731937646866, -0.06124415621161461, -0.089499831199646, -0.00907989963889122, 0.09300874918699265, -0.14822572469711304, 0.0010471625719219446, -0.07263056188821793, -0.02043585292994976, 0.011475157923996449, 0.10881735384464264, -0.04590108245611191, 0.07519426196813583, -0.014750989153981209, 0.13359621167182922, 0.036702439188957214, -0.09899551421403885, -0.1891201138496399, -0.07509183138608932, 0.07785794883966446, -0.0424603708088398, -0.09746972471475601, 0.034231141209602356, 0.05323898792266846, -0.06065762788057327, -0.17255938053131104, -0.018711091950535774, -0.1549476534128189, -0.0637279599905014, -0.03229692578315735, 0.10173670202493668, -0.028285101056098938, 0.1193261370062828, 0.046977344900369644, -0.2922191619873047, 0.027617674320936203, 0.1604442596435547, 0.05015595257282257, -0.025940531864762306, 0.007467195857316256, -0.13898853957653046, 0.06404609978199005, 0.02455667220056057, -0.10119566321372986, 0.06429068744182587, 0.10441981256008148, -0.06258466094732285, -0.10817738622426987, 0.060348380357027054, -0.08838053792715073, 0.011426339857280254, 0.03598149120807648, -0.17304784059524536, 0.04713878780603409, 0.0008228839142248034, 0.10487688332796097, -0.1009797528386116, 0.2686401605606079, 0.06730518490076065, -0.10801763832569122, -0.09992208331823349, 0.13507968187332153, 0.17331460118293762, -0.08327993750572205, -0.003452755743637681, -0.2466062307357788, -0.0759284645318985, -0.17748267948627472, 0.01902979053556919, 0.0341661162674427, -0.1442277729511261, 0.1540597826242447, 0.01521601527929306, -0.028967678546905518, 0.02080157957971096, 0.02158106118440628, -0.031238561496138573, 0.022664183750748634, 0.009082425385713577, -0.25049328804016113, -0.028995618224143982, 0.0248397346585989, 0.012721170671284199, -0.13576604425907135, -0.06444116681814194, -0.16717717051506042, 0.13501060009002686, 0.07808542251586914, 0.019647089764475822, -0.06445259600877762, 0.11163438856601715, -0.21799220144748688, 0.021215805783867836, 0.10958356410264969, 0.1283697783946991, 0.12596549093723297, 0.014013857580721378, 0.04574677720665932, -0.09573716670274734, -0.1984846442937851, -0.008263709023594856, -0.03772321343421936, 0.10644352436065674, 0.12638060748577118, 0.17932702600955963, 0.14114412665367126, 0.042320843786001205, -0.0709792748093605, -0.08084522187709808, 0.11195700615644455, 0.12272578477859497, -0.18513183295726776, -0.004224599339067936, -0.1121470108628273, 0.05653422698378563, -0.014166897162795067, 0.0232028067111969, -0.2163306474685669, -0.0518915094435215, 0.019428608939051628, 0.040580447763204575, 0.02777470275759697, -0.06907851994037628, 7.2116603178074e-7, -0.2795960009098053, 0.1610279381275177, 0.007700982969254255, 0.017783600836992264, -0.0152587890625, -0.02995227463543415, -0.2916729152202606, 0.11799407750368118, 0.00259313709102571, 0.0813942700624466, 0.1447245478630066, 0.03190716356039047, -0.17721356451511383, 0.040176115930080414, 0.03258324787020683, -0.1902168095111847, -0.045446448028087616, 0.010506423190236092, 0.027247479185461998, 0.045691777020692825, 0.09175454080104828, 0.19327157735824585, 0.1063770055770874, -0.03553743660449982, 0.04509750008583069, -0.040555957704782486, -0.022467665374279022, -0.09095699340105057, 0.01658778451383114, 0.01695415750145912, -0.06354907155036926, 0.17830297350883484, -0.16726921498775482, 0.22973252832889557, 0.06147237494587898, -0.06367133557796478, -0.18459036946296692, -0.1582423746585846, 0.1229071244597435, 0.08936542272567749, -0.029287898913025856, 0.11013845354318619, -0.059094540774822235, -0.06678144633769989, 0.10886186361312866, 0.16100630164146423, -0.03453947603702545, 0.023084230720996857, -0.10521161556243896, 0.18299154937267303, 0.15476453304290771, 0.18970723450183868, 0.11383889615535736, 0.10846402496099472, -0.07613971829414368, 0.01773480512201786, -0.1294691413640976, -0.1424412876367569, 0.1800336092710495, -0.00013635109644383192, -0.0562361516058445, -0.0035129240714013577, 0.04120030999183655, 0.055275555700063705, -0.03436429053544998, -0.003323032520711422, -0.11501665413379669, 3.91776310711611e-35, 0.03861211612820625, -0.0795898512005806, 0.06427451223134995, -0.2605421543121338, -0.035063568502664566, -0.08154553174972534, 0.1602553427219391, -0.07910820096731186, 0.03679325431585312, -0.21771357953548431, 0.06896430253982544 ]
https://github.com/huggingface/datasets/issues/6260
REUSE_DATASET_IF_EXISTS don't work
Hi! Unfortunately, the current behavior is to delete the downloaded data when this error happens. So, I've opened a PR that removes the problematic import to avoid losing data due to `apache_beam` not being installed (we host the preprocessed version of `natual_questions` on the HF GCS, so requiring `apache_beam` in that case doesn't make sense)
### Describe the bug I use the following code to download natural_question dataset. Even though I have completely download it, the next time I run this code, the new download procedure will start and cover the original /data/lxy/NQ config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ') data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS) --- Since I don't have apache_beam installed, it throw a exception. After I pip install apache_beam ,the download restart.. ![image](https://github.com/huggingface/datasets/assets/88258534/f28ce7fe-29ea-4348-b87f-e69182a8bd41) ### Steps to reproduce the bug run this two line code config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ') data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS) ### Expected behavior Download behavior can be correctly follow DownloadMode ### Environment info - `datasets` version: 2.14.4 - Platform: Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.9.17 - Huggingface_hub version: 0.16.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.3
55
REUSE_DATASET_IF_EXISTS don't work ### Describe the bug I use the following code to download natural_question dataset. Even though I have completely download it, the next time I run this code, the new download procedure will start and cover the original /data/lxy/NQ config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ') data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS) --- Since I don't have apache_beam installed, it throw a exception. After I pip install apache_beam ,the download restart.. ![image](https://github.com/huggingface/datasets/assets/88258534/f28ce7fe-29ea-4348-b87f-e69182a8bd41) ### Steps to reproduce the bug run this two line code config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ') data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS) ### Expected behavior Download behavior can be correctly follow DownloadMode ### Environment info - `datasets` version: 2.14.4 - Platform: Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.9.17 - Huggingface_hub version: 0.16.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.3 Hi! Unfortunately, the current behavior is to delete the downloaded data when this error happens. So, I've opened a PR that removes the problematic import to avoid losing data due to `apache_beam` not being installed (we host the preprocessed version of `natual_questions` on the HF GCS, so requiring `apache_beam` in that case doesn't make sense)
[ 0.11477875709533691, 0.167545348405838, -0.07024736702442169, 0.18350093066692352, 0.1925254464149475, 0.04094266518950462, 0.07985435426235199, 0.04625146836042404, 0.08888711780309677, 0.2836020290851593, -0.06600707769393921, 0.018676558509469032, -0.09908914566040039, 0.036557458341121674, 0.04377756267786026, 0.022437915205955505, -0.12705011665821075, 0.05134010687470436, -0.06744376569986343, -0.06874283403158188, -0.042439356446266174, 0.07080979645252228, 0.06245778128504753, -0.12890656292438507, -0.004184458404779434, -0.0709405317902565, -0.08519905805587769, 0.09884975105524063, 0.04851527139544487, -0.14214526116847992, 0.17285799980163574, 0.04469592869281769, 0.038016170263290405, 0.04080204665660858, 0.000005836036052642157, 0.04588465392589569, 0.15140867233276367, -0.1467956155538559, -0.15242643654346466, -0.06096366047859192, 0.1654175966978073, 0.020704269409179688, 0.09970036894083023, -0.04942207410931587, -0.05411574989557266, -0.020174475386738777, -0.05433911085128784, -0.02396383136510849, 0.2643463611602783, 0.02482888288795948, -0.07782154530286789, 0.08029805123806, -0.002083735540509224, -0.09650245308876038, 0.19758446514606476, -0.0731598511338234, 0.0704273134469986, 0.10166449844837189, -0.10372388362884521, -0.10094453394412994, 0.04497158154845238, 0.14009065926074982, 0.11884362995624542, 0.10789775848388672, -0.09920154511928558, 0.018817519769072533, -0.04850435256958008, -0.17847450077533722, -0.03599364683032036, 0.17893297970294952, 0.08626653999090195, -0.047860246151685715, 0.06121673807501793, -0.04709058254957199, -0.029088646173477173, -0.03870250657200813, -0.14555597305297852, -0.024486210197210312, -0.012356694787740707, 0.00045662911725230515, -0.0874204933643341, 0.009932798333466053, 0.013416181318461895, 0.0015055678086355329, -0.025208519771695137, -0.12593230605125427, -0.010233118198812008, 0.24716056883335114, -0.13036596775054932, -0.12057814002037048, 0.12693779170513153, -0.006292040925472975, -0.020242759957909584, -0.14603376388549805, -0.08513030409812927, 0.13244101405143738, -0.08880798518657684, -0.00742407888174057, 0.019456110894680023, 0.15658436715602875, -0.044182516634464264, -0.07458825409412384, -0.059066351503133774, 0.04884454607963562, 0.01150430366396904, -0.02304047718644142, -0.07215232402086258, -0.05590948089957237, 0.020747099071741104, -0.024775976315140724, -0.04267304018139839, -0.05751848220825195, 0.024401383474469185, -0.02718300186097622, 0.1439024955034256, 0.01287207379937172, 0.24967509508132935, 0.22192156314849854, -0.04280807450413704, -0.046645887196063995, 0.09297897666692734, 0.06748653203248978, -0.11542634665966034, 0.15352940559387207, 0.005949708633124828, -0.05549653619527817, -0.0006337001686915755, 0.11791738122701645, 0.037830840796232224, -0.1583748459815979, -0.01988053135573864, -0.06477133184671402, 0.047966450452804565, -0.02918737195432186, 0.12165284156799316, 0.018655039370059967, -0.062117837369441986, -0.07557465881109238, -0.0581587553024292, -0.014692160300910473, 0.13541169464588165, -0.0764252319931984, -0.02006961964070797, -0.020193347707390785, 0.08727560937404633, 0.0506572462618351, 0.05031002312898636, 0.09310854971408844, -0.014764050953090191, 0.049633823335170746, -0.07713141292333603, 0.0980837270617485, -0.030014045536518097, 0.14971773326396942, -0.1208513155579567, 0.10328881442546844, 0.13731475174427032, 0.04041615501046181, -0.18733800947666168, -0.16153091192245483, 0.13836230337619781, -0.027064843103289604, -0.033269211649894714, -0.12699668109416962, -0.03859948739409447, 0.2596990764141083, 0.030578473582863808, -0.05146721750497818, -0.06052278354763985, -0.08636089414358139, 0.07799525558948517, -0.09983555972576141, -0.15497086942195892, -0.05616163834929466, -0.2504897713661194, 0.08260111510753632, 0.08336633443832397, -0.041922427713871, -0.2245086282491684, 0.08996858447790146, -0.0001194929500343278, 0.032263658940792084, -0.0743107944726944, -0.0131700299680233, 0.057525184005498886, -0.01794722117483616, -0.22892975807189941, -0.006677006371319294, -0.09454317390918732, -0.05661999061703682, -0.10665395110845566, 0.08390877395868301, -0.011260990984737873, -0.0007679894333705306, -0.06203508749604225, 0.08032508939504623, 0.07901410013437271, -0.05431594327092171, 0.034378185868263245, -0.23341064155101776, 0.10097424685955048, -0.011380338110029697, 0.09851884841918945, 0.09107992053031921, 0.08179865032434464, -0.09650535136461258, -0.2401963770389557, 0.30054929852485657, -0.1076967716217041, -0.18820656836032867, -0.0930430144071579, 0.010036272928118706, -0.07766367495059967, -0.04315068945288658, -0.17475351691246033, -0.010074484162032604, -0.06640821695327759, 0.03758243843913078, -0.01116381399333477, 0.189907506108284, -0.1517227292060852, 0.1232856810092926, 0.05445878207683563, 0.06059768423438072, -0.2055392563343048, 0.05847495049238205, 0.11469113826751709, -0.016855940222740173, 0.059015024453401566, -0.055346764624118805, -0.02613183483481407, -0.021446917206048965, 0.10078833997249603, 0.1405060887336731, -0.17263783514499664, 0.12231768667697906, -0.10256507247686386, -0.26399582624435425, 0.033977750688791275, -0.035606205463409424, 0.004513843450695276, 0.09947691857814789, -0.08416600525379181, -0.05535822734236717, -0.08568017184734344, 0.062091995030641556, -0.05155152454972267, 0.08379490673542023, 0.005700491834431887, -0.087804414331913, 0.13307465612888336, 0.05059437453746796, -0.13853208720684052, -0.016580557450652122, 0.02626742050051689, 0.06418941915035248, 0.10125122219324112, 0.26361268758773804, -0.07799948006868362, -0.020983025431632996, 0.10986631363630295, 0.023658957332372665, -0.008965703658759594, 0.017996923997998238, 0.25632745027542114, -0.12344418466091156, 0.1282615214586258, 0.1675274819135666, 0.07212014496326447, 0.12953683733940125, 0.12368817627429962, 0.034095074981451035, -0.046446118503808975, -0.14891456067562103, -0.05784009397029877, -0.12858133018016815, -0.07443665713071823, 0.008809625171124935, 0.058937814086675644, 0.09789513051509857, -0.19858711957931519, 0.01601480133831501, 0.14210212230682373, -0.13294477760791779, 0.17134341597557068, 0.09399697929620743, -0.14531691372394562, -0.09493643045425415, -0.23966100811958313, 0.03905266895890236, 0.051455579698085785, -0.14508207142353058, -0.0164217259734869, -0.08829759806394577, 0.0027154444251209497, 0.023607393726706505, 0.04145124554634094, 0.01448601670563221, 0.04375540465116501, -0.1429106444120407, -0.04888581484556198, 0.10708077996969223, 0.06944956630468369, -0.09841755032539368, 0.03825566917657852, -0.0673213005065918, 0.12251953780651093, 0.041621074080467224, -0.23588059842586517, -0.16267551481723785, 0.08799842745065689, 0.015770429745316505, 0.1356218308210373, 0.10123574733734131, 0.06222254037857056, -0.06432201713323593, -0.20603534579277039, -0.0801045224070549, 0.10869617015123367, 0.014598309062421322, 0.06763308495283127, 0.10456330329179764, -0.08846864104270935, 0.1729281097650528, -0.10889913141727448, -0.14072607457637787, -0.058382511138916016, -0.13641953468322754, 0.04703948274254799, -0.09227669984102249, -0.061038583517074585, 0.12253780663013458, -0.08674290031194687, -0.17962758243083954, 0.012869085185229778, -0.10569120943546295, -0.11983133852481842, -0.07972333580255508, 0.13567885756492615, 0.08698995411396027, 0.0354812853038311, 0.010437886230647564, -0.24193857610225677, 0.10995616018772125, 0.11688527464866638, -0.2473299205303192, -0.058826740831136703, 0.05187484994530678, 0.09913459420204163, -0.06646431982517242, 0.18581987917423248, 0.05586593970656395, -0.09471185505390167, -0.05894187092781067, -0.018369484692811966, 0.26351243257522583, -0.1608167439699173, 0.1233084425330162, -0.006016937550157309, 0.0957234799861908, -0.017570871859788895, 0.06272375583648682, 0.07684127241373062, -0.034259092062711716, 0.014411147683858871, 0.27508172392845154, 0.029830731451511383, 0.10638517141342163, 0.10486356168985367, -0.037901174277067184, 0.10261129587888718, -0.11071009188890457, 0.04152540862560272, -0.10774929821491241, -0.05896902084350586, 0.06381309777498245, -0.0016349074430763721, 0.001806264859624207, -0.04698986932635307, -0.12784089148044586, -0.07948184758424759, -0.2536132335662842, -0.11019562929868698, 0.0943571925163269, 0.017165539786219597, 0.06317409127950668, 0.08453740924596786, 0.03392428904771805, -0.07106822729110718, 0.12378436326980591, 0.013855437748134136, 0.009887981228530407, 0.09902181476354599, -0.10579709708690643, 0.012892147526144981, -0.15867799520492554, 0.037759486585855484, 0.09496188908815384, -0.016571607440710068, 0.010574921034276485, -0.08692606538534164, 0.13248972594738007, -0.050016071647405624, -0.005087132565677166, 0.04891792684793472, -0.03549664095044136, -0.05449840426445007, 0.05169500410556793, 0.07691880315542221, -0.061739806085824966, -0.06167108938097954, -0.06726887077093124, -0.04375249147415161, 0.06224082410335541, 0.07797820121049881, 0.18058207631111145, -0.1212063878774643, -0.20250868797302246, 0.04388643801212311, -0.15288041532039642, -0.2160404920578003, -0.12897445261478424, -0.01938026398420334, 0.1412084549665451, -0.0022479500621557236, -0.012307579629123211, -0.10468795895576477, -0.022306613624095917, 0.1786181479692459, 0.019567914307117462, 0.028931856155395508, -0.03000657632946968, 0.20001979172229767, -0.08581481128931046, -0.008559265173971653, -0.06919623166322708, 0.3021985590457916, -0.21989232301712036, 0.020288191735744476, -0.11574487388134003, 0.07152967154979706, -0.08932328224182129, 0.09222503751516342, -0.13117191195487976, 0.08440828323364258, -0.07353635132312775, -0.0917385146021843, -0.046021103858947754, 0.02789399027824402, -0.06781448423862457, -0.19675244390964508, -0.12177284061908722, -0.1559499204158783, -0.0926845446228981, 0.06443343311548233, -0.0490894690155983, 0.11626597493886948, -0.09418628364801407, 0.06329409778118134, -0.09269417077302933, -0.17291612923145294, -0.06171783432364464, -0.05722319707274437, 0.07695821672677994, 0.14077556133270264, 0.07922808080911636, 0.28713858127593994, -0.06659305095672607, 0.017721787095069885, 0.024250566959381104, -0.01050040777772665, 0.10882451385259628, 0.027375798672437668, 0.04666899889707565, 0.10062186419963837, 0.08620120584964752, 0.07652390003204346, 0.026299020275473595, 0.09235908836126328, -0.14782550930976868, 0.20224545896053314, -0.19971849024295807, 0.0980193018913269, -0.10410474985837936, -0.09095899015665054, 0.09544763714075089, 0.275270015001297, 0.0173219945281744, -0.12683546543121338, 0.09639052301645279, 0.017049331218004227, -0.02429250068962574, 0.04399421811103821, -0.016040069982409477, -0.0293894000351429, -0.03239350765943527, -0.10765859484672546, -0.07117688655853271, 0.01945461332798004, 0.04795815795660019, 0.07898881286382675, -0.03695036843419075, 0.04639210179448128, -0.0009221817599609494, 0.041214775294065475, -0.1479111611843109, 0.0012674577301368117, -0.10075483471155167, 0.04961138963699341, -0.07067853957414627, 0.1116405725479126, 0.17899493873119354, 0.022752124816179276, -0.0927651971578598, 0.0703665167093277, -0.07841689139604568, -0.1409318596124649, 0.066025510430336, 0.02057287096977234, 0.034666407853364944, -0.03449295088648796, -0.11833764612674713, 0.09539411962032318, -0.07710574567317963, 0.03396301344037056, 0.015197720378637314, -0.02125900238752365, -0.07019113749265671, 0.030045052990317345, 0.12342611700296402, -0.1955389380455017, 0.06846543401479721, -0.011547352187335491, 0.09483714401721954, -0.12465719878673553, 0.04057582840323448, 0.09300415217876434, -0.21698273718357086, 0.09229359030723572, 0.036397356539964676, 0.061517685651779175, -0.15426096320152283, -0.14537441730499268, -0.0195003692060709, 0.12541189789772034, 0.0823347344994545, -0.0183322262018919, -0.019742824137210846, -0.20491428673267365, -0.06340906023979187, 0.10229358822107315, 0.1503484845161438, 0.121383436024189, -0.03368651866912842, 0.08576318621635437, -2.623726019301599e-32, 0.11364521831274033, -0.005122561473399401, 0.013906486332416534, -0.05177663639187813, -0.1152779832482338, 0.1543906331062317, 0.027408571913838387, -0.08182265609502792, 0.08016107976436615, -0.0777108445763588, -0.027615003287792206, -0.08681493997573853, 0.07692701369524002, -0.0018428752664476633, -0.015529372729361057, -0.08961017429828644, -0.08032409846782684, 0.07454392313957214, -0.0798504576086998, 0.1674729734659195, 0.13509601354599, -0.001051018014550209, 0.09888391941785812, -0.08094138652086258, -0.09278760105371475, -0.07063397765159607, 0.00662379851564765, -0.10090846568346024, -0.0952887311577797, -0.016539258882403374, -0.06130506098270416, 0.08339546620845795, 0.04772387444972992, -0.13595284521579742, -0.16407983005046844, 0.10897964239120483, -0.18357864022254944, -0.16379211843013763, -0.09418414533138275, 0.01660156436264515, -0.05179043114185333, 0.16415798664093018, -0.005894464906305075, -0.14353781938552856, -0.021407103165984154, 0.1395970731973648, -0.025365618988871574, -0.012047511525452137, 0.02269621193408966, 0.002613904420286417, 0.021483642980456352, 0.02299659512937069, 0.08807478100061417, 0.05028592050075531, -0.025773337110877037, 0.06253624707460403, -0.06103392690420151, 0.09791666269302368, -0.1326819360256195, -0.008280608803033829, 0.07897914201021194, -0.0676664263010025, -0.021166877821087837, 0.01742609776556492, 0.23903414607048035, 0.09269685298204422, 0.3251587152481079, -0.09362921118736267, 0.2592209577560425, -0.09650665521621704, 0.08753728866577148, 0.038496796041727066, -0.06193599849939346, 0.04152754321694374, -0.02925204299390316, -0.04406990855932236, 0.0016344470204785466, -0.03890685737133026, -0.013750729151070118, 0.03743362054228783, 0.061074864119291306, 0.0018314201151952147, 0.0780591145157814, -0.03829772025346756, -0.062226343899965286, 0.0674537941813469, -0.03828507661819458, 0.057234857231378555, -0.03174171224236488, -0.053865354508161545, -0.028423089534044266, 0.10455041378736496, -0.04744628816843033, 0.00003063978147110902, -0.07012800872325897, 0.11400308459997177, 0.02268276736140251, -0.028074350208044052, -0.035891350358724594, -0.012428234331309795, 0.024668173864483833, -0.0794190987944603, 0.1145315021276474, -0.05626685172319412, -0.013124830089509487, -0.04370860382914543, 0.09258446097373962, 0.05686328560113907, -0.1376647800207138, 0.048887550830841064, -0.09257478266954422, 0.02214142307639122, 0.24985826015472412, 0.08128011971712112, 0.11519009619951248, 0.0773230493068695, -0.0959068313241005, 0.013052165508270264, 0.14463670551776886, 0.03181234374642372, -0.21968649327754974, -0.03749048337340355, -0.14427870512008667, 0.11810316890478134, -0.05334032326936722, 0.14014530181884766, -0.2469465583562851, -0.07343786954879761, 0.05308447405695915, -0.10800395905971527, 0.05903713405132294, -0.12259774655103683, 7.797070793458261e-7, -0.26705384254455566, -0.13057366013526917, 0.022708814591169357, -0.05290130898356438, -0.0905042216181755, 0.059434473514556885, -0.3898667097091675, 0.08688775449991226, -0.14461065828800201, 0.16635996103286743, 0.1158193051815033, 0.0037884716875851154, 0.021326523274183273, -0.17664435505867004, -0.10182451456785202, 0.044227682054042816, -0.09272327274084091, 0.017795393243432045, -0.01702193170785904, -0.006195817142724991, -0.11519183963537216, 0.02970080077648163, 0.1340447962284088, -0.049714867025613785, 0.039780281484127045, -0.08184613287448883, -0.18515652418136597, -0.0203823484480381, 0.08610548824071884, 0.05477102845907211, 0.038888849318027496, 0.09018310904502869, 0.14502713084220886, 0.07004871964454651, 0.03718796744942665, -0.09388168901205063, -0.11584366112947464, -0.07741911709308624, 0.08642169833183289, -0.08495647460222244, 0.0567619614303112, 0.0226993877440691, -0.001317468355409801, -0.013633375987410545, 0.15106132626533508, 0.043538898229599, -0.002605895744636655, 0.08035080134868622, 0.008052104152739048, -0.10089386254549026, 0.09702767431735992, 0.1783672571182251, 0.07711748033761978, 0.18847250938415527, -0.03489299118518829, 0.04105224087834358, -0.024846253916621208, -0.12647515535354614, 0.2763679325580597, 0.013902413658797741, -0.08886104822158813, -0.08844053745269775, 0.012545224279165268, -0.09541179239749908, 0.096841000020504, -0.20038869976997375, 0.0339382104575634, 1.4108538042070933e-34, -0.013239951804280281, 0.1044536679983139, -0.08268171548843384, -0.10994593799114227, 0.0825534537434578, -0.040891364216804504, 0.09421202540397644, 0.1483515352010727, 0.015306987799704075, 0.02909325249493122, -0.06562342494726181 ]
https://github.com/huggingface/datasets/issues/6260
REUSE_DATASET_IF_EXISTS don't work
Thanks for your reply. I met another question that I set `export HF_DATASETS_CACHE=/data/lxy/.cache` , but each time I run load_datasets, the datasets module still looking for NQ in the wrong default cache dir '/home/lxy/.cache' 。How to avoid this incorrect behavior. I am sure HF_DATASETS_CACHE was set correctly since I use echo & to check it. ![image](https://github.com/huggingface/datasets/assets/88258534/e7029f27-b9f9-496c-8948-6234ef695646) by the way I delete the file in '/home/lxy/.cache' since I found there has some kb size file seems useless.
### Describe the bug I use the following code to download natural_question dataset. Even though I have completely download it, the next time I run this code, the new download procedure will start and cover the original /data/lxy/NQ config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ') data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS) --- Since I don't have apache_beam installed, it throw a exception. After I pip install apache_beam ,the download restart.. ![image](https://github.com/huggingface/datasets/assets/88258534/f28ce7fe-29ea-4348-b87f-e69182a8bd41) ### Steps to reproduce the bug run this two line code config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ') data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS) ### Expected behavior Download behavior can be correctly follow DownloadMode ### Environment info - `datasets` version: 2.14.4 - Platform: Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.9.17 - Huggingface_hub version: 0.16.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.3
76
REUSE_DATASET_IF_EXISTS don't work ### Describe the bug I use the following code to download natural_question dataset. Even though I have completely download it, the next time I run this code, the new download procedure will start and cover the original /data/lxy/NQ config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ') data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS) --- Since I don't have apache_beam installed, it throw a exception. After I pip install apache_beam ,the download restart.. ![image](https://github.com/huggingface/datasets/assets/88258534/f28ce7fe-29ea-4348-b87f-e69182a8bd41) ### Steps to reproduce the bug run this two line code config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ') data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS) ### Expected behavior Download behavior can be correctly follow DownloadMode ### Environment info - `datasets` version: 2.14.4 - Platform: Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.9.17 - Huggingface_hub version: 0.16.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.3 Thanks for your reply. I met another question that I set `export HF_DATASETS_CACHE=/data/lxy/.cache` , but each time I run load_datasets, the datasets module still looking for NQ in the wrong default cache dir '/home/lxy/.cache' 。How to avoid this incorrect behavior. I am sure HF_DATASETS_CACHE was set correctly since I use echo & to check it. ![image](https://github.com/huggingface/datasets/assets/88258534/e7029f27-b9f9-496c-8948-6234ef695646) by the way I delete the file in '/home/lxy/.cache' since I found there has some kb size file seems useless.
[ 0.11180876940488815, 0.16148734092712402, -0.07156636565923691, 0.1810782551765442, 0.19340470433235168, 0.04106925055384636, 0.08312442153692245, 0.04457475617527962, 0.09016692638397217, 0.2871665060520172, -0.06423012912273407, 0.016091613098978996, -0.09876260906457901, 0.03512515872716904, 0.04641685262322426, 0.022668160498142242, -0.12502776086330414, 0.052056603133678436, -0.0692126676440239, -0.07114800810813904, -0.04155843332409859, 0.0719560757279396, 0.06253823637962341, -0.12921106815338135, 0.0014077574014663696, -0.07019994407892227, -0.08295056223869324, 0.09916441887617111, 0.048203613609075546, -0.14390037953853607, 0.17415136098861694, 0.04526648670434952, 0.03919318690896034, 0.03717605397105217, 0.000005831219368701568, 0.04849046841263771, 0.1525806188583374, -0.1480899602174759, -0.15099671483039856, -0.06192123889923096, 0.1638806313276291, 0.019843818619847298, 0.10399418324232101, -0.04731317609548569, -0.05498506501317024, -0.020042793825268745, -0.05498627573251724, -0.02266102470457554, 0.2655700147151947, 0.025978397578001022, -0.07694990187883377, 0.07799161225557327, -0.0031150190625339746, -0.09835066646337509, 0.19856636226177216, -0.07210788130760193, 0.07172923535108566, 0.103387251496315, -0.10595108568668365, -0.10000716149806976, 0.044411830604076385, 0.1388128697872162, 0.11891981214284897, 0.10989804565906525, -0.10015121102333069, 0.015780365094542503, -0.04773546755313873, -0.18004389107227325, -0.03521684184670448, 0.1795777529478073, 0.08730922639369965, -0.04901445284485817, 0.061534762382507324, -0.04523608461022377, -0.029599737375974655, -0.039012305438518524, -0.14483721554279327, -0.02404729649424553, -0.012708267197012901, 0.0012849142076447606, -0.08589509129524231, 0.011148855090141296, 0.013049416244029999, 0.001584802521392703, -0.024262016639113426, -0.12326072156429291, -0.011243420653045177, 0.24581855535507202, -0.13424669206142426, -0.12130620330572128, 0.1264975368976593, -0.006575455889105797, -0.01825830526649952, -0.14843271672725677, -0.08430596441030502, 0.13158974051475525, -0.09116102755069733, -0.006428938824683428, 0.021763473749160767, 0.1603906750679016, -0.04675581678748131, -0.0755447968840599, -0.05999462679028511, 0.04665451869368553, 0.012685514986515045, -0.025547031313180923, -0.07197238504886627, -0.05814652517437935, 0.021105578169226646, -0.023354478180408478, -0.04248858988285065, -0.055901456624269485, 0.02575036883354187, -0.02680758200585842, 0.14332278072834015, 0.01337510347366333, 0.24981719255447388, 0.220473051071167, -0.04215193912386894, -0.04775284230709076, 0.09368418157100677, 0.06564145535230637, -0.11805600672960281, 0.1543155461549759, 0.0074813272804021835, -0.05616976320743561, -0.004957830533385277, 0.1215352714061737, 0.03691255673766136, -0.15666119754314423, -0.02108103595674038, -0.06475715339183807, 0.04664728790521622, -0.026423649862408638, 0.12241474539041519, 0.01839839294552803, -0.05820481479167938, -0.07475073635578156, -0.05924581363797188, -0.014813908375799656, 0.13871271908283234, -0.07605872303247452, -0.016982577741146088, -0.022756798192858696, 0.08630047738552094, 0.050681229680776596, 0.04900925233960152, 0.09357376396656036, -0.014755787327885628, 0.05104750767350197, -0.07762209326028824, 0.09829238802194595, -0.028579698875546455, 0.15145590901374817, -0.12154984474182129, 0.10150337219238281, 0.13934457302093506, 0.04265322536230087, -0.18738508224487305, -0.16263411939144135, 0.13997872173786163, -0.026235904544591904, -0.03139663115143776, -0.12981663644313812, -0.0383734330534935, 0.25997182726860046, 0.02903524413704872, -0.05391353741288185, -0.06263457238674164, -0.08857297897338867, 0.07830728590488434, -0.10337209701538086, -0.15605436265468597, -0.056794553995132446, -0.25224804878234863, 0.0836838036775589, 0.08450928330421448, -0.0439881905913353, -0.22518113255500793, 0.092225082218647, -0.002345428103581071, 0.03280682489275932, -0.07386364787817001, -0.011979770846664906, 0.058780696243047714, -0.018403636291623116, -0.23022164404392242, -0.00803436804562807, -0.09213828295469284, -0.05399414524435997, -0.10717632621526718, 0.0872708335518837, -0.011242725886404514, -0.0031890510581433773, -0.061438608914613724, 0.08210837095975876, 0.0773899182677269, -0.05223669484257698, 0.03548918291926384, -0.23076696693897247, 0.10071730613708496, -0.00983578059822321, 0.0994572564959526, 0.0914231538772583, 0.08114149421453476, -0.09644652903079987, -0.2403137981891632, 0.3009966313838959, -0.10805114358663559, -0.18891164660453796, -0.09140965342521667, 0.00989642832428217, -0.07844395190477371, -0.042834118008613586, -0.173786461353302, -0.00969464797526598, -0.06700682640075684, 0.03775181621313095, -0.010060617700219154, 0.1918654441833496, -0.15281543135643005, 0.12473718076944351, 0.055009424686431885, 0.06283412128686905, -0.20253224670886993, 0.05998247116804123, 0.11457555741071701, -0.01692829839885235, 0.058170419186353683, -0.057348188012838364, -0.02496432512998581, -0.02350766770541668, 0.09828400611877441, 0.14276854693889618, -0.17161160707473755, 0.12158336490392685, -0.1040571928024292, -0.26592063903808594, 0.03250943124294281, -0.035850003361701965, 0.006481850985437632, 0.09994352608919144, -0.0836651474237442, -0.05509193241596222, -0.08341464400291443, 0.06367705762386322, -0.04913274571299553, 0.08403873443603516, 0.007334911730140448, -0.0873517319560051, 0.13557125627994537, 0.050926484167575836, -0.1389733999967575, -0.013818025588989258, 0.023839544504880905, 0.06510081142187119, 0.10154809057712555, 0.26109257340431213, -0.07613091915845871, -0.023249749094247818, 0.11194805055856705, 0.023415597155690193, -0.0073885004967451096, 0.019228635355830193, 0.2568055987358093, -0.12555347383022308, 0.12892590463161469, 0.16561438143253326, 0.07399426400661469, 0.12907925248146057, 0.12248357385396957, 0.03466615453362465, -0.047105010598897934, -0.149102583527565, -0.05781308934092522, -0.12776343524456024, -0.07512281835079193, 0.008719873614609241, 0.057915765792131424, 0.09666379541158676, -0.19816535711288452, 0.01730218715965748, 0.1418328881263733, -0.13377653062343597, 0.17261338233947754, 0.09514754265546799, -0.14586585760116577, -0.09498945623636246, -0.24296319484710693, 0.040102217346429825, 0.05365440621972084, -0.14530262351036072, -0.015714092180132866, -0.09013640135526657, 0.002236825181171298, 0.02433551661670208, 0.04008520394563675, 0.015008832328021526, 0.04526521638035774, -0.14370635151863098, -0.047421276569366455, 0.10736354440450668, 0.07157362252473831, -0.09903047233819962, 0.03867899626493454, -0.06648450344800949, 0.12326192855834961, 0.04458185285329819, -0.236488938331604, -0.16247600317001343, 0.0908995270729065, 0.016646426171064377, 0.13509973883628845, 0.10061921179294586, 0.060918278992176056, -0.0631716325879097, -0.20231086015701294, -0.07719168066978455, 0.1056448370218277, 0.016310764476656914, 0.06603359431028366, 0.10542957484722137, -0.08775608986616135, 0.17453721165657043, -0.10793616622686386, -0.14169937372207642, -0.05586877837777138, -0.13437603414058685, 0.04477595165371895, -0.09052630513906479, -0.061099257320165634, 0.12134760618209839, -0.08539968729019165, -0.1794356256723404, 0.015971031039953232, -0.10406327247619629, -0.11933764070272446, -0.07834254950284958, 0.13383303582668304, 0.08535515516996384, 0.03508466109633446, 0.013415828347206116, -0.2437809258699417, 0.11226024478673935, 0.11819406598806381, -0.24640969932079315, -0.05785936862230301, 0.04990869015455246, 0.09609220176935196, -0.0675252303481102, 0.18630695343017578, 0.05703844502568245, -0.09624926745891571, -0.05923857167363167, -0.01689564250409603, 0.26321303844451904, -0.15980179607868195, 0.12217198312282562, -0.009850099682807922, 0.09682237356901169, -0.018105871975421906, 0.05923369899392128, 0.07661118358373642, -0.031275905668735504, 0.010636737570166588, 0.2745174169540405, 0.03109440952539444, 0.10329670459032059, 0.10645820945501328, -0.038572609424591064, 0.1022605299949646, -0.11100871860980988, 0.043450526893138885, -0.1058567464351654, -0.060142602771520615, 0.06389416009187698, -0.0011045495048165321, 0.0024056644178926945, -0.04633703455328941, -0.12688826024532318, -0.07913870364427567, -0.252838671207428, -0.11315035820007324, 0.09469996392726898, 0.017284920439124107, 0.06395406275987625, 0.0849963054060936, 0.034161005169153214, -0.06957252323627472, 0.12150515615940094, 0.013780278153717518, 0.007475340273231268, 0.09933049976825714, -0.1063290610909462, 0.012440568767488003, -0.158069908618927, 0.03367915004491806, 0.09608074277639389, -0.017858855426311493, 0.010053332895040512, -0.08670011162757874, 0.12935249507427216, -0.052714645862579346, -0.001786062610335648, 0.04856666177511215, -0.030561570078134537, -0.05383874848484993, 0.048319797962903976, 0.07280353456735611, -0.06197269633412361, -0.06181100755929947, -0.06649298220872879, -0.04429694637656212, 0.06206248328089714, 0.08071327209472656, 0.17882002890110016, -0.1204834133386612, -0.20161491632461548, 0.04210464656352997, -0.15456201136112213, -0.21867793798446655, -0.1261727660894394, -0.01926339790225029, 0.1410512775182724, -0.002401553327217698, -0.013605374842882156, -0.10297790169715881, -0.022243548184633255, 0.1761736273765564, 0.015431634150445461, 0.0285045076161623, -0.03060728684067726, 0.2020113319158554, -0.08816273510456085, -0.009669460356235504, -0.06934245675802231, 0.30288398265838623, -0.22179149091243744, 0.019551701843738556, -0.11763086915016174, 0.06952890753746033, -0.08946054428815842, 0.09013257175683975, -0.13176564872264862, 0.08441665768623352, -0.07549823075532913, -0.08761338144540787, -0.04340815171599388, 0.027090026065707207, -0.06646919250488281, -0.1955636888742447, -0.12216528505086899, -0.1573333740234375, -0.09174732118844986, 0.0643172636628151, -0.04814251512289047, 0.11448001861572266, -0.09615923464298248, 0.06339319795370102, -0.09479732066392899, -0.17569011449813843, -0.06145929917693138, -0.057412318885326385, 0.07710357755422592, 0.13961021602153778, 0.07661191374063492, 0.28448981046676636, -0.06704051047563553, 0.01588318683207035, 0.024284468963742256, -0.012649350799620152, 0.10980606079101562, 0.02765560895204544, 0.04651079326868057, 0.10150973498821259, 0.08598700910806656, 0.07582361996173859, 0.027095023542642593, 0.09195020794868469, -0.1495511531829834, 0.20107053220272064, -0.2004406452178955, 0.09576763957738876, -0.10017162561416626, -0.09152344614267349, 0.09414616972208023, 0.2760337293148041, 0.015498544089496136, -0.12466557323932648, 0.0992477759718895, 0.013265418820083141, -0.02762746997177601, 0.04452229663729668, -0.016432203352451324, -0.030406268313527107, -0.033592890948057175, -0.10420363396406174, -0.06913170218467712, 0.017798883840441704, 0.04991937428712845, 0.07718509435653687, -0.035853926092386246, 0.04384119063615799, -0.0014902952825650573, 0.04091789573431015, -0.14874112606048584, 0.001904496573843062, -0.09881605952978134, 0.048620376735925674, -0.07006343454122543, 0.10842176526784897, 0.18045245110988617, 0.025274906307458878, -0.0904296413064003, 0.07021525502204895, -0.07677068561315536, -0.14120031893253326, 0.06247382238507271, 0.020493855699896812, 0.03703133389353752, -0.03317007049918175, -0.11845221370458603, 0.0957929864525795, -0.08152177184820175, 0.034022003412246704, 0.014398457482457161, -0.020612342283129692, -0.07041023671627045, 0.02926483191549778, 0.12443330883979797, -0.19715656340122223, 0.06629544496536255, -0.012472419999539852, 0.09628720581531525, -0.12418823689222336, 0.0401560477912426, 0.09182101488113403, -0.21685808897018433, 0.09590959548950195, 0.03677666559815407, 0.0649726539850235, -0.15375939011573792, -0.14295077323913574, -0.019192488864064217, 0.127960205078125, 0.08411111682653427, -0.01685640774667263, -0.017443086951971054, -0.2052718549966812, -0.06525465101003647, 0.10214447975158691, 0.14965827763080597, 0.12313494831323624, -0.02966563031077385, 0.08272000402212143, -2.6227206777580583e-32, 0.11339215934276581, -0.0014287397498264909, 0.01461024209856987, -0.05181309953331947, -0.112686887383461, 0.15319596230983734, 0.029416508972644806, -0.08111613243818283, 0.08027958124876022, -0.07881534844636917, -0.02836720645427704, -0.08442243933677673, 0.0767674371600151, -0.0030316186603158712, -0.017051002010703087, -0.09089672565460205, -0.07905768603086472, 0.07388988882303238, -0.07793071866035461, 0.16675953567028046, 0.13172362744808197, -0.004566022660583258, 0.10082362592220306, -0.07811598479747772, -0.09232660382986069, -0.0745820701122284, 0.006766383070498705, -0.10509289056062698, -0.09557058662176132, -0.01610909216105938, -0.059925928711891174, 0.08176581561565399, 0.046616990119218826, -0.13659468293190002, -0.1657097041606903, 0.10753732174634933, -0.17890234291553497, -0.165621817111969, -0.09421968460083008, 0.016312291845679283, -0.05446324124932289, 0.1634974628686905, -0.0063958242535591125, -0.1445298194885254, -0.021348856389522552, 0.1394307017326355, -0.02251271717250347, -0.015130223706364632, 0.022969737648963928, 0.0008094151853583753, 0.021798288449645042, 0.023922016844153404, 0.09076067060232162, 0.051955584436655045, -0.025724738836288452, 0.062467314302921295, -0.06287785619497299, 0.09918411076068878, -0.1336153745651245, -0.00852623488754034, 0.07892890274524689, -0.06733900308609009, -0.021054450422525406, 0.01748938113451004, 0.23880986869335175, 0.09112711995840073, 0.3251067101955414, -0.09198250621557236, 0.2592025697231293, -0.09685671329498291, 0.0842483639717102, 0.040914177894592285, -0.06393825262784958, 0.04278293251991272, -0.029606055468320847, -0.04715261980891228, 0.004712814465165138, -0.037445686757564545, -0.01446460746228695, 0.04042184725403786, 0.06072419881820679, 0.00016086272080428898, 0.07934924960136414, -0.03850233927369118, -0.06284468621015549, 0.06345066428184509, -0.0377514623105526, 0.05728916451334953, -0.031937409192323685, -0.0552976094186306, -0.027491074055433273, 0.1042957529425621, -0.04717077687382698, -0.002401358215138316, -0.06973815709352493, 0.1170712262392044, 0.01792345754802227, -0.03168182447552681, -0.035538800060749054, -0.012583638541400433, 0.025192227214574814, -0.08073186129331589, 0.11509734392166138, -0.059189461171627045, -0.014533073641359806, -0.04595383629202843, 0.09418588131666183, 0.056234702467918396, -0.13657352328300476, 0.05039215087890625, -0.09104987233877182, 0.024358270689845085, 0.24831999838352203, 0.08156946301460266, 0.11607837677001953, 0.0773240178823471, -0.09534779191017151, 0.015223969705402851, 0.1463424414396286, 0.028156721964478493, -0.22197753190994263, -0.03879937902092934, -0.14348237216472626, 0.12003076076507568, -0.05637926608324051, 0.13901163637638092, -0.2467077076435089, -0.0736013799905777, 0.05319233238697052, -0.10971057415008545, 0.057575348764657974, -0.1236596405506134, 7.793634040353936e-7, -0.2674252986907959, -0.1314372420310974, 0.02239784225821495, -0.0514412559568882, -0.09229374676942825, 0.06135359779000282, -0.388143926858902, 0.08667829632759094, -0.14497779309749603, 0.1649482250213623, 0.11313881725072861, 0.003138609230518341, 0.02186843939125538, -0.17476116120815277, -0.1020258367061615, 0.04605929180979729, -0.09355150908231735, 0.01864987425506115, -0.015033192001283169, -0.005929969251155853, -0.11410458385944366, 0.030100561678409576, 0.1381811946630478, -0.047748103737831116, 0.03761869668960571, -0.0808928906917572, -0.1841816008090973, -0.019572677090764046, 0.0877770259976387, 0.05608704313635826, 0.03442373126745224, 0.09153106808662415, 0.1452234834432602, 0.07231780886650085, 0.03714399039745331, -0.09561584144830704, -0.1146128699183464, -0.07562476396560669, 0.08586908131837845, -0.08640211075544357, 0.05869603902101517, 0.020471587777137756, -0.0027546233031898737, -0.010645243339240551, 0.15149959921836853, 0.042517226189374924, 0.0002001717803068459, 0.07865604013204575, 0.00612329738214612, -0.099788136780262, 0.09758233278989792, 0.17995674908161163, 0.07679960876703262, 0.1894332766532898, -0.03313123807311058, 0.038815923035144806, -0.027607955038547516, -0.12734641134738922, 0.27508777379989624, 0.015540962107479572, -0.08973408490419388, -0.08744984865188599, 0.01805737242102623, -0.09663213044404984, 0.09623614698648453, -0.19833935797214508, 0.033639512956142426, 1.3964740874243048e-34, -0.01303878240287304, 0.10471417754888535, -0.08393514901399612, -0.11216673254966736, 0.07932586967945099, -0.042447786778211594, 0.09200739860534668, 0.14806930720806122, 0.011859854683279991, 0.030856383964419365, -0.0670333281159401 ]
https://github.com/huggingface/datasets/issues/6260
REUSE_DATASET_IF_EXISTS don't work
You need to set this variable before the `datasets` import. Then, you can use `import datasets; datasets.config.HF_DATASETS_CACHE` to verify the cache location.
### Describe the bug I use the following code to download natural_question dataset. Even though I have completely download it, the next time I run this code, the new download procedure will start and cover the original /data/lxy/NQ config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ') data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS) --- Since I don't have apache_beam installed, it throw a exception. After I pip install apache_beam ,the download restart.. ![image](https://github.com/huggingface/datasets/assets/88258534/f28ce7fe-29ea-4348-b87f-e69182a8bd41) ### Steps to reproduce the bug run this two line code config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ') data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS) ### Expected behavior Download behavior can be correctly follow DownloadMode ### Environment info - `datasets` version: 2.14.4 - Platform: Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.9.17 - Huggingface_hub version: 0.16.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.3
22
REUSE_DATASET_IF_EXISTS don't work ### Describe the bug I use the following code to download natural_question dataset. Even though I have completely download it, the next time I run this code, the new download procedure will start and cover the original /data/lxy/NQ config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ') data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS) --- Since I don't have apache_beam installed, it throw a exception. After I pip install apache_beam ,the download restart.. ![image](https://github.com/huggingface/datasets/assets/88258534/f28ce7fe-29ea-4348-b87f-e69182a8bd41) ### Steps to reproduce the bug run this two line code config=datasets.DownloadConfig(resume_download=True,max_retries=100,cache_dir=r'/data/lxy/NQ',download_desc='NQ') data=datasets.load_dataset('natural_questions',cache_dir=r'/data/lxy/NQ',download_config=config,download_mode=DownloadMode.REUSE_DATASET_IF_EXISTS) ### Expected behavior Download behavior can be correctly follow DownloadMode ### Environment info - `datasets` version: 2.14.4 - Platform: Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.9.17 - Huggingface_hub version: 0.16.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.3 You need to set this variable before the `datasets` import. Then, you can use `import datasets; datasets.config.HF_DATASETS_CACHE` to verify the cache location.
[ 0.11312749981880188, 0.1663367599248886, -0.07308435440063477, 0.18169593811035156, 0.19443084299564362, 0.04299455136060715, 0.07980614900588989, 0.046895138919353485, 0.0895322859287262, 0.28922998905181885, -0.06382467597723007, 0.016384568065404892, -0.09811322391033173, 0.03798208758234978, 0.047284677624702454, 0.020150894299149513, -0.1261035054922104, 0.04525178298354149, -0.07161684334278107, -0.0699290782213211, -0.04209189489483833, 0.07323174178600311, 0.06236180663108826, -0.1323639154434204, 0.0006020994042046368, -0.07222222536802292, -0.08309930562973022, 0.10571940243244171, 0.04726916924118996, -0.14319774508476257, 0.17495447397232056, 0.04825792834162712, 0.044255901128053665, 0.036723341792821884, 0.00000582949178351555, 0.049357444047927856, 0.1523575335741043, -0.14787526428699493, -0.14914250373840332, -0.06076174974441528, 0.1662353277206421, 0.01925089955329895, 0.10539235919713974, -0.05003931373357773, -0.05764064937829971, -0.019214781001210213, -0.05242232233285904, -0.02402801811695099, 0.26258111000061035, 0.02383270114660263, -0.07522834837436676, 0.07768723368644714, -0.005256809759885073, -0.09889036417007446, 0.19645485281944275, -0.07165638357400894, 0.07475879043340683, 0.10399328172206879, -0.10418424755334854, -0.10145002603530884, 0.044049423187971115, 0.13985642790794373, 0.1168484166264534, 0.10924124717712402, -0.09413425624370575, 0.017356278374791145, -0.04900005832314491, -0.18108104169368744, -0.03758242353796959, 0.17653430998325348, 0.0878230407834053, -0.05078886076807976, 0.058393992483615875, -0.043387334793806076, -0.028560124337673187, -0.03938624635338783, -0.14359049499034882, -0.02977653406560421, -0.013506673276424408, 0.0034894491545856, -0.08470139652490616, 0.0076632024720311165, 0.010929943062365055, 0.0031316836830228567, -0.02589835412800312, -0.12221849709749222, -0.011407722719013691, 0.24257870018482208, -0.13320232927799225, -0.1183646097779274, 0.12863539159297943, -0.009769700467586517, -0.015613578259944916, -0.14741821587085724, -0.0835188627243042, 0.13289597630500793, -0.09117037802934647, -0.007438883651047945, 0.022868650034070015, 0.1591651737689972, -0.04810720309615135, -0.07639257609844208, -0.06266604363918304, 0.04883335903286934, 0.016790416091680527, -0.02590257301926613, -0.07500126212835312, -0.05671914666891098, 0.02287447638809681, -0.018824895843863487, -0.03973972797393799, -0.05384528264403343, 0.022602712735533714, -0.03389525040984154, 0.14323340356349945, 0.012786868028342724, 0.2501234710216522, 0.22302311658859253, -0.04566537216305733, -0.044416643679142, 0.0945114865899086, 0.06750069558620453, -0.11732424795627594, 0.15402904152870178, 0.004129238426685333, -0.054575346410274506, -0.005047619808465242, 0.12138644605875015, 0.039770618081092834, -0.15685832500457764, -0.023652780801057816, -0.0628400444984436, 0.045400362461805344, -0.026563510298728943, 0.12515074014663696, 0.019282272085547447, -0.0585174523293972, -0.07616746425628662, -0.058225616812705994, -0.014114993624389172, 0.13656412065029144, -0.07283216714859009, -0.02048053778707981, -0.022139897570014, 0.08408759534358978, 0.0514921210706234, 0.047248393297195435, 0.09275852143764496, -0.01600697822868824, 0.0511806458234787, -0.07851089537143707, 0.09806317836046219, -0.031332120299339294, 0.1534305363893509, -0.12438417971134186, 0.10047416388988495, 0.1342330127954483, 0.04312054440379143, -0.18919861316680908, -0.16001573204994202, 0.1414831280708313, -0.02483462542295456, -0.030222803354263306, -0.13029074668884277, -0.032624080777168274, 0.2632991373538971, 0.03239622712135315, -0.05379139259457588, -0.06252536177635193, -0.08917121589183807, 0.07875916361808777, -0.10669902712106705, -0.1516026109457016, -0.0579274483025074, -0.2514193058013916, 0.08233384788036346, 0.08047023415565491, -0.04401183873414993, -0.2210332751274109, 0.08816412091255188, -0.0013476877938956022, 0.039867229759693146, -0.07024091482162476, -0.015504463575780392, 0.05556521564722061, -0.01892145723104477, -0.2297840267419815, -0.0041826823726296425, -0.09367044270038605, -0.05383383110165596, -0.10781097412109375, 0.08491523563861847, -0.009816483594477177, -0.0011038961820304394, -0.057352542877197266, 0.08088753372430801, 0.0766470730304718, -0.04885748028755188, 0.03790693357586861, -0.2300136834383011, 0.10285134613513947, -0.008858393877744675, 0.09481003135442734, 0.09342244267463684, 0.08343204855918884, -0.09895119071006775, -0.23889246582984924, 0.30334505438804626, -0.10577108711004257, -0.18845760822296143, -0.09428880363702774, 0.010320408269762993, -0.08231279999017715, -0.04517173767089844, -0.17175288498401642, -0.011644158512353897, -0.0684712752699852, 0.03719167411327362, -0.009207852184772491, 0.18912027776241302, -0.15200935304164886, 0.12528979778289795, 0.05638142675161362, 0.06241677701473236, -0.2020477056503296, 0.06158473342657089, 0.11527830362319946, -0.017319325357675552, 0.05977192893624306, -0.05791458487510681, -0.02512173354625702, -0.026111098006367683, 0.0989217534661293, 0.14672647416591644, -0.1726110726594925, 0.1209941953420639, -0.10559288412332535, -0.2643216550350189, 0.028209958225488663, -0.0340813510119915, 0.005658978130668402, 0.09771940857172012, -0.08484052866697311, -0.05087878182530403, -0.08346125483512878, 0.06594706326723099, -0.04941291734576225, 0.08659789711236954, 0.00856434553861618, -0.08759795874357224, 0.1392705738544464, 0.05138266086578369, -0.1386842429637909, -0.015785731375217438, 0.02006331831216812, 0.06488428264856339, 0.10199502110481262, 0.2572472393512726, -0.08079127222299576, -0.02119792066514492, 0.11368133127689362, 0.02015652507543564, -0.009823081083595753, 0.015648555010557175, 0.25982871651649475, -0.12603601813316345, 0.1266360729932785, 0.16558116674423218, 0.06933127343654633, 0.12737976014614105, 0.12293177843093872, 0.03516920655965805, -0.04974241927266121, -0.14812956750392914, -0.056716542690992355, -0.12446799129247665, -0.07470300048589706, 0.007592778652906418, 0.0566655769944191, 0.09568705409765244, -0.1998528391122818, 0.01741768792271614, 0.14066223800182343, -0.13351298868656158, 0.17358189821243286, 0.09457790106534958, -0.14337506890296936, -0.09456881135702133, -0.24447675049304962, 0.04053692892193794, 0.05485837906599045, -0.14353258907794952, -0.016090866178274155, -0.08814241737127304, 0.0014048913726583123, 0.021365143358707428, 0.03922590613365173, 0.011003418825566769, 0.041090138256549835, -0.14129826426506042, -0.049132339656353, 0.10545796900987625, 0.07598590850830078, -0.0974620059132576, 0.03974361717700958, -0.06699793040752411, 0.12395459413528442, 0.0445396862924099, -0.23915517330169678, -0.16132651269435883, 0.08803438395261765, 0.01730840653181076, 0.13516463339328766, 0.09911330044269562, 0.05888468399643898, -0.06465017050504684, -0.1999824047088623, -0.07991672307252884, 0.10862687975168228, 0.014612694270908833, 0.06630560755729675, 0.10605841130018234, -0.08491494506597519, 0.1724333018064499, -0.10794511437416077, -0.14163018763065338, -0.05944130942225456, -0.136167511343956, 0.044355280697345734, -0.08876777440309525, -0.06363844126462936, 0.12276938557624817, -0.08323909342288971, -0.17615872621536255, 0.017902029678225517, -0.1041390597820282, -0.11835997551679611, -0.07988870143890381, 0.13344413042068481, 0.08898726850748062, 0.03269239142537117, 0.008176058530807495, -0.24390380084514618, 0.11075400561094284, 0.11646237969398499, -0.24695292115211487, -0.05854186788201332, 0.05167980119585991, 0.0948997363448143, -0.06572838127613068, 0.18738438189029694, 0.05593196675181389, -0.09622088074684143, -0.060637544840574265, -0.014061198569834232, 0.2641597092151642, -0.16370059549808502, 0.12371177971363068, -0.011174367740750313, 0.09868661314249039, -0.019885072484612465, 0.06033562496304512, 0.08273883908987045, -0.03606075420975685, 0.009467520751059055, 0.27621230483055115, 0.035693682730197906, 0.10346490144729614, 0.10989630967378616, -0.03970525041222572, 0.10218007117509842, -0.11424222588539124, 0.0407569520175457, -0.10899507999420166, -0.06044754013419151, 0.06485775113105774, -0.00028473249403759837, 0.0009394295630045235, -0.048063818365335464, -0.12917019426822662, -0.07953047752380371, -0.25622397661209106, -0.11196689307689667, 0.09634082019329071, 0.017989149317145348, 0.06199643015861511, 0.08490264415740967, 0.03522590175271034, -0.06888792663812637, 0.12520673871040344, 0.013726558536291122, 0.008616992272436619, 0.09947387129068375, -0.10808338969945908, 0.01255712192505598, -0.1559745818376541, 0.0354565791785717, 0.09777393937110901, -0.020028121769428253, 0.009962962940335274, -0.08847207576036453, 0.13351911306381226, -0.05644553154706955, -0.0028556077741086483, 0.05026954412460327, -0.03059164620935917, -0.0548829659819603, 0.04617400839924812, 0.07627888768911362, -0.06167421117424965, -0.0633353516459465, -0.06781726330518723, -0.04311301186680794, 0.05696820095181465, 0.08300720155239105, 0.179302379488945, -0.12071645259857178, -0.19753168523311615, 0.04258844256401062, -0.1585792750120163, -0.2202443778514862, -0.12943416833877563, -0.018163368105888367, 0.14033183455467224, -0.0004417983873281628, -0.012385517358779907, -0.1007925495505333, -0.017256831750273705, 0.17850862443447113, 0.01675146259367466, 0.030665701255202293, -0.029851088300347328, 0.20222347974777222, -0.08482479304075241, -0.010809986852109432, -0.06890784949064255, 0.3042892515659332, -0.2230207622051239, 0.019671212881803513, -0.1164170652627945, 0.0710664913058281, -0.08691387623548508, 0.08991936594247818, -0.13330356776714325, 0.08125561475753784, -0.07642895728349686, -0.0876382514834404, -0.044758349657058716, 0.02886502631008625, -0.06413570791482925, -0.19327159225940704, -0.1207071989774704, -0.16174355149269104, -0.09225765615701675, 0.0626797303557396, -0.048355866223573685, 0.11465979367494583, -0.09232112765312195, 0.0623251274228096, -0.09167841076850891, -0.1782759130001068, -0.06098896265029907, -0.053895749151706696, 0.07439860701560974, 0.13932877779006958, 0.07687518745660782, 0.28540870547294617, -0.07176856696605682, 0.01779407076537609, 0.024371962994337082, -0.013823416084051132, 0.11036054790019989, 0.028442038223147392, 0.045249346643686295, 0.10324543714523315, 0.08679929375648499, 0.07902337610721588, 0.02783486805856228, 0.09249173849821091, -0.14790914952754974, 0.20347575843334198, -0.19935378432273865, 0.09677667170763016, -0.10245349258184433, -0.09110857546329498, 0.09658913314342499, 0.2739972174167633, 0.01365575473755598, -0.1253531128168106, 0.09846224635839462, 0.013620968908071518, -0.028007518500089645, 0.045713964849710464, -0.013737130910158157, -0.03185507282614708, -0.030702102929353714, -0.10485576093196869, -0.07123847305774689, 0.019617339596152306, 0.050927456468343735, 0.07658558338880539, -0.03673664480447769, 0.04407259076833725, -0.0018463839078322053, 0.03989000990986824, -0.14727085828781128, -0.0006623160443268716, -0.09447184950113297, 0.047082699835300446, -0.0719088539481163, 0.10910113155841827, 0.18174898624420166, 0.02519935742020607, -0.0903601124882698, 0.07056862115859985, -0.07560298591852188, -0.14071890711784363, 0.06304695457220078, 0.02608380652964115, 0.036264631897211075, -0.03745736926794052, -0.11754568666219711, 0.09309443086385727, -0.08198359608650208, 0.03449365869164467, 0.010546412318944931, -0.019164156168699265, -0.0710221529006958, 0.030195297673344612, 0.11952946335077286, -0.19707033038139343, 0.065855972468853, -0.011389249935746193, 0.09427259117364883, -0.1223931759595871, 0.03781430795788765, 0.09051688015460968, -0.2197815179824829, 0.09593931585550308, 0.03226856142282486, 0.06225183978676796, -0.15631607174873352, -0.14284132421016693, -0.016193680465221405, 0.12806321680545807, 0.08333245664834976, -0.017071908339858055, -0.018117690458893776, -0.20288792252540588, -0.05829552188515663, 0.10427617281675339, 0.1529611498117447, 0.12314987182617188, -0.031606920063495636, 0.07934416830539703, -2.626601866230886e-32, 0.1126936674118042, -0.000301069492707029, 0.016910212114453316, -0.05262026935815811, -0.11180952191352844, 0.15430431067943573, 0.028933417052030563, -0.08123043924570084, 0.07757863402366638, -0.07778145372867584, -0.03090749680995941, -0.08743053674697876, 0.07705242931842804, -0.003914915025234222, -0.019633516669273376, -0.08818148821592331, -0.07782548666000366, 0.07348985970020294, -0.07913226634263992, 0.1680065095424652, 0.13432906568050385, -0.005688320845365524, 0.10121329128742218, -0.08177635818719864, -0.09302664548158646, -0.07476882636547089, 0.005437632091343403, -0.10484493523836136, -0.0939081683754921, -0.014498373493552208, -0.06138309836387634, 0.08622021228075027, 0.04808657988905907, -0.13183452188968658, -0.1652611792087555, 0.11025135964155197, -0.18498258292675018, -0.16295982897281647, -0.09484714269638062, 0.015256702899932861, -0.054067689925432205, 0.16526085138320923, -0.0041353111155331135, -0.14122919738292694, -0.01751156896352768, 0.13941098749637604, -0.020639289170503616, -0.015301012434065342, 0.025511430576443672, 0.0012349658645689487, 0.02100340835750103, 0.02359958179295063, 0.0919027104973793, 0.05189681798219681, -0.02563774213194847, 0.0601874478161335, -0.06215682253241539, 0.10012846440076828, -0.13146346807479858, -0.006211975589394569, 0.08125320076942444, -0.06822171807289124, -0.020211897790431976, 0.01755235157907009, 0.23521040380001068, 0.09253525733947754, 0.32224389910697937, -0.09306751191616058, 0.2581755220890045, -0.10043838620185852, 0.08440883457660675, 0.037757743149995804, -0.06194973737001419, 0.043278422206640244, -0.031021161004900932, -0.045473866164684296, 0.0027392066549509764, -0.03921908512711525, -0.01398902852088213, 0.0399722084403038, 0.060977548360824585, -0.00031879247399047017, 0.07652328163385391, -0.036843735724687576, -0.060484182089567184, 0.06220027431845665, -0.03984971344470978, 0.057121392339468, -0.03165435418486595, -0.05403706058859825, -0.03234287351369858, 0.10601916909217834, -0.048404861241579056, -0.0019615681376308203, -0.06913567334413528, 0.11979807168245316, 0.015907054767012596, -0.028279591351747513, -0.033519186079502106, -0.012980678118765354, 0.027454014867544174, -0.08307959139347076, 0.11911187320947647, -0.05575941503047943, -0.012443684972822666, -0.047465864568948746, 0.09077185392379761, 0.057292960584163666, -0.1344733089208603, 0.05032723397016525, -0.0936194658279419, 0.02749982848763466, 0.24849358201026917, 0.07933758199214935, 0.1177486777305603, 0.07878242433071136, -0.09808052331209183, 0.014263398945331573, 0.14433830976486206, 0.025286337360739708, -0.2216404229402542, -0.03790365904569626, -0.14082525670528412, 0.11878764629364014, -0.05589553713798523, 0.13836877048015594, -0.24748864769935608, -0.07941234111785889, 0.0528889000415802, -0.11063215136528015, 0.05740414559841156, -0.11936180293560028, 7.78656328748184e-7, -0.2648443281650543, -0.1295623630285263, 0.023735791444778442, -0.05011650547385216, -0.09211768954992294, 0.06045912206172943, -0.3890165388584137, 0.08382129669189453, -0.14095060527324677, 0.1607668399810791, 0.1167634055018425, 0.0030908265616744757, 0.022169029340147972, -0.1741897612810135, -0.09954395890235901, 0.04696183279156685, -0.09339731186628342, 0.01894938386976719, -0.013775353319942951, -0.009568896144628525, -0.11300777643918991, 0.029583072289824486, 0.1378880888223648, -0.048953380435705185, 0.0381053164601326, -0.08032520115375519, -0.18318526446819305, -0.017796915024518967, 0.08833783864974976, 0.05398842692375183, 0.0329069085419178, 0.09328016638755798, 0.14457879960536957, 0.07234543561935425, 0.03521101921796799, -0.09845741838216782, -0.11858799308538437, -0.07419133931398392, 0.08133909106254578, -0.08442535251379013, 0.057039450854063034, 0.022052695974707603, -0.0023340906482189894, -0.012903920374810696, 0.14987029135227203, 0.04072468727827072, 0.0007841908372938633, 0.08061938732862473, 0.004041357897222042, -0.09886742383241653, 0.09125269204378128, 0.178274005651474, 0.07669223845005035, 0.1921500563621521, -0.034898895770311356, 0.04225756227970123, -0.031252965331077576, -0.1288117915391922, 0.27805599570274353, 0.015029765665531158, -0.09156440198421478, -0.08714462071657181, 0.016683565452694893, -0.09375544637441635, 0.09132460504770279, -0.19987724721431732, 0.03370804712176323, 1.4153703887025135e-34, -0.011037182994186878, 0.10432174056768417, -0.08502410352230072, -0.11316052824258804, 0.07791347056627274, -0.039109718054533005, 0.09221600741147995, 0.1490546315908432, 0.009689711965620518, 0.028642062097787857, -0.06672561913728714 ]
https://github.com/huggingface/datasets/issues/6259
Duplicated Rows When Loading Parquet Files from Root Directory with Subdirectories
Thanks for reporting this issue! We should be able to avoid this by making our `glob` patterns more precise. In the meantime, you can load the dataset by directly assigning splits to the data files: ```python from datasets import load_dataset ds = load_dataset("parquet", data_files={"train": "testing123/train/output_train.parquet", "validation": "testing123/val/output_val.parquet"}) ```
### Describe the bug When parquet files are saved in "train" and "val" subdirectories under a root directory, and datasets are then loaded using `load_dataset("parquet", data_dir="root_directory")`, the resulting dataset has duplicated rows for both the training and validation sets. ### Steps to reproduce the bug 1. Create a root directory, e.g., "testing123". 2. Under "testing123", create two subdirectories: "train" and "val". 3. Create and save a parquet file with 3 unique rows in the "train" subdirectory. 4. Create and save a parquet file with 4 unique rows in the "val" subdirectory. 5. Load the datasets from the root directory using `load_dataset("parquet", data_dir="testing123")` 6. Iterate through the datasets and print the rows Here's a collab reproducing these steps: https://colab.research.google.com/drive/11NEdImnQ3OqJlwKSHRMhr7jCBesNdLY4?usp=sharing ### Expected behavior - Training set should contain 3 unique rows. - Validation set should contain 4 unique rows. ### Environment info - `datasets` version: 2.14.5 - Platform: Linux-5.15.120+-x86_64-with-glibc2.35 - Python version: 3.10.12 - Huggingface_hub version: 0.17.2 - PyArrow version: 9.0.0 - Pandas version: 1.5.3
48
Duplicated Rows When Loading Parquet Files from Root Directory with Subdirectories ### Describe the bug When parquet files are saved in "train" and "val" subdirectories under a root directory, and datasets are then loaded using `load_dataset("parquet", data_dir="root_directory")`, the resulting dataset has duplicated rows for both the training and validation sets. ### Steps to reproduce the bug 1. Create a root directory, e.g., "testing123". 2. Under "testing123", create two subdirectories: "train" and "val". 3. Create and save a parquet file with 3 unique rows in the "train" subdirectory. 4. Create and save a parquet file with 4 unique rows in the "val" subdirectory. 5. Load the datasets from the root directory using `load_dataset("parquet", data_dir="testing123")` 6. Iterate through the datasets and print the rows Here's a collab reproducing these steps: https://colab.research.google.com/drive/11NEdImnQ3OqJlwKSHRMhr7jCBesNdLY4?usp=sharing ### Expected behavior - Training set should contain 3 unique rows. - Validation set should contain 4 unique rows. ### Environment info - `datasets` version: 2.14.5 - Platform: Linux-5.15.120+-x86_64-with-glibc2.35 - Python version: 3.10.12 - Huggingface_hub version: 0.17.2 - PyArrow version: 9.0.0 - Pandas version: 1.5.3 Thanks for reporting this issue! We should be able to avoid this by making our `glob` patterns more precise. In the meantime, you can load the dataset by directly assigning splits to the data files: ```python from datasets import load_dataset ds = load_dataset("parquet", data_files={"train": "testing123/train/output_train.parquet", "validation": "testing123/val/output_val.parquet"}) ```
[ 0.1447679102420807, -0.04246775805950165, -0.13095098733901978, 0.1854659467935562, 0.004900931380689144, 0.04510427266359329, 0.1026972159743309, 0.17880061268806458, -0.25387245416641235, 0.07782568037509918, 0.032088059931993484, 0.10877178609371185, 0.018128767609596252, -0.060509487986564636, 0.10730835050344467, 0.04145020619034767, 0.04126080125570297, 0.03127273544669151, -0.08926279097795486, -0.04863239824771881, -0.0850701630115509, -0.05862320959568024, 0.2252640426158905, -0.07155231386423111, -0.22938062250614166, -0.019527442753314972, -0.11604751646518707, 0.20783518254756927, 0.04549442231655121, -0.1265220195055008, 0.03497769311070442, -0.0332726314663887, -0.021643085405230522, 0.21355943381786346, 0.0000052342120397952385, 0.0427507683634758, -0.0814272090792656, -0.04641509801149368, 0.0037846986670047045, -0.1606532335281372, 0.067518450319767, 0.08901739120483398, 0.14522437751293182, 0.004777088761329651, 0.031826529651880264, -0.12193866074085236, -0.1628352701663971, 0.20971396565437317, 0.2007213532924652, -0.022102950140833855, -0.02716122195124626, -0.06791771948337555, -0.015965964645147324, 0.03007935732603073, 0.1636836975812912, -0.025437302887439728, -0.1308143436908722, 0.23757782578468323, -0.10207618027925491, 0.05676909536123276, -0.06490515917539597, -0.03293996304273605, 0.1634833663702011, 0.10329584777355194, -0.217946395277977, 0.1335732787847519, -0.09626944363117218, -0.11925329267978668, 0.08242879807949066, 0.1908722072839737, -0.04354079067707062, -0.09112312644720078, 0.08018624037504196, -0.015308721922338009, 0.11374742537736893, -0.17643962800502777, 0.11733441799879074, 0.2147921770811081, -0.03974663466215134, 0.023241011425852776, 0.012908962555229664, 0.22183851897716522, -0.04338003322482109, -0.0844142958521843, -0.17565856873989105, -0.03080601803958416, 0.0074900416657328606, 0.01782027631998062, 0.020969582721590996, 0.00837205071002245, 0.02114040032029152, 0.00012129332026233897, -0.14753128588199615, -0.1919737607240677, -0.2331884503364563, 0.04199611023068428, -0.09376433491706848, -0.22992564737796783, -0.11139136552810669, 0.10368642956018448, -0.016916124150156975, 0.04111122339963913, -0.1932157576084137, -0.12443404644727707, 0.0015127219958230853, -0.057430047541856766, -0.06964842230081558, 0.03782527148723602, 0.008103313855826855, -0.08868115395307541, -0.07204126566648483, 0.11147475242614746, -0.05386675149202347, 0.12304002046585083, -0.004494416527450085, -0.21461988985538483, 0.13790440559387207, 0.02702852338552475, -0.07828952372074127, 0.03476899862289429, -0.16904695332050323, 0.006864049471914768, -0.014607957564294338, 0.05791378393769264, 0.2600732147693634, -0.0678265169262886, -0.07158683240413666, 0.04001561552286148, -0.11531053483486176, -0.10492309927940369, -0.054102275520563126, 0.12678976356983185, -0.05570144206285477, 0.07432974874973297, -0.025272296741604805, -0.21124117076396942, 0.023134876042604446, 0.08547766506671906, -0.005282331258058548, -0.24799981713294983, 0.02184293232858181, -0.016720563173294067, -0.19312240183353424, 0.013829234056174755, 0.03816010057926178, 0.12988542020320892, 0.03855316340923309, -0.08171457797288895, -0.025192955508828163, -0.04667062684893608, -0.16804449260234833, 0.04245501011610031, -0.10499899089336395, 0.20442664623260498, 0.0838259905576706, 0.06245563179254532, -0.11298319697380066, -0.07404348999261856, -0.23994998633861542, -0.022115539759397507, -0.01207801140844822, 0.12718193233013153, 0.0440734326839447, -0.12525087594985962, -0.042415689677000046, -0.04884235933423042, -0.006198684219270945, -0.012874189764261246, 0.00626395782455802, -0.016165200620889664, 0.1600688099861145, 0.1887815147638321, -0.10166273266077042, 0.1492490917444229, -0.16751502454280853, 0.11087721586227417, -0.06936254352331161, 0.13795654475688934, -0.036494459956884384, 0.07515226304531097, 0.05556834489107132, 0.0436057485640049, -0.014470895752310753, -0.2670043408870697, 0.12884114682674408, -0.1189921572804451, -0.05048318952322006, -0.11435230821371078, -0.014098400250077248, -0.043562158942222595, -0.04181882366538048, 0.09772313386201859, -0.07411284744739532, -0.0560871921479702, -0.1659940630197525, 0.036824509501457214, -0.00040496353176422417, 0.018542872741818428, 0.040138740092515945, -0.22769832611083984, -0.10261284559965134, -0.010831382125616074, 0.043768759816884995, 0.10181654244661331, -0.09322549402713776, 0.14916178584098816, -0.09479475766420364, 0.13271509110927582, 0.07057886570692062, -0.07260064035654068, -0.06809891760349274, 0.0030641132034361362, -0.010563039220869541, 0.14064030349254608, -0.29913464188575745, -0.007566803600639105, -0.16113953292369843, 0.08173707127571106, -0.09335754811763763, 0.035730428993701935, 0.0727045089006424, 0.06147923693060875, -0.09135482460260391, 0.19211935997009277, 0.02437310293316841, 0.24471066892147064, 0.009478757157921791, -0.10753673315048218, 0.04361211508512497, 0.08093997091054916, -0.10919470340013504, 0.00210381206125021, 0.17476241290569305, 0.029706202447414398, 0.03770073503255844, 0.27187106013298035, 0.014634709805250168, -0.2301609218120575, 0.19231060147285461, 0.014519027434289455, -0.16373062133789062, -0.03528197482228279, -0.0015449735801666975, -0.11952193081378937, -0.13016340136528015, -0.015798911452293396, 0.026793159544467926, -0.019440025091171265, 0.00156118453014642, -0.18778009712696075, 0.011788822710514069, 0.0021519793663173914, -0.006681330502033234, 0.07953403145074844, -0.09720706194639206, 0.0006701581878587604, 0.09698472172021866, 0.21570444107055664, -0.02725583128631115, 0.16015174984931946, -0.08584820479154587, -0.07601681351661682, -0.059675414115190506, -0.07480312138795853, 0.03248890861868858, -0.2126331478357315, 0.0018882642034441233, 0.16330696642398834, -0.09187186509370804, 0.00954771414399147, 0.25487521290779114, -0.06662499159574509, -0.11524447053670883, 0.007896355353295803, -0.10231710970401764, -0.17052632570266724, -0.12054421007633209, 0.24699145555496216, -0.042071107774972916, 0.098749078810215, -0.17214378714561462, 0.115069679915905, 0.15556557476520538, -0.0005095729138702154, 0.08756846189498901, 0.031103694811463356, -0.0333440825343132, 0.0761573314666748, -0.14654242992401123, 0.15254254639148712, 0.09365116059780121, -0.09386304020881653, 0.10029453784227371, 0.12070021033287048, 0.08199577778577805, 0.11791117489337921, -0.0255275871604681, -0.0880570337176323, -0.00018946517957374454, 0.03623132407665253, -0.09822233021259308, 0.17197862267494202, -0.03375285118818283, 0.07701067626476288, 0.07046952098608017, 0.10463928431272507, 0.06791449338197708, 0.060815222561359406, -0.05842939391732216, -0.22455066442489624, -0.09111391752958298, 0.06099354848265648, 0.08352215588092804, 0.14039911329746246, 0.1523137390613556, 0.047209568321704865, 0.04971729964017868, -0.3551613986492157, -0.07037502527236938, 0.01962420716881752, -0.00955647137016058, 0.08599574863910675, -0.03678460791707039, -0.02042417787015438, -0.11802104115486145, -0.2085997760295868, 0.07703889906406403, 0.08525746315717697, 0.021040359511971474, 0.021140078082680702, 0.012240334413945675, 0.007702880073338747, -0.0966077670454979, -0.216122567653656, -0.0778595432639122, -0.13219988346099854, -0.09209903329610825, 0.11911199241876602, 0.3353092074394226, -0.049491532146930695, 0.07530948519706726, 0.008254804648458958, -0.17605839669704437, -0.08581764996051788, 0.04364938661456108, -0.09214536845684052, -0.08948298543691635, -0.06870515644550323, 0.03603137284517288, -0.039216671139001846, 0.13590490818023682, -0.018682992085814476, 0.004528318531811237, -0.14595027267932892, -0.08910610526800156, 0.06852476298809052, -0.02566811442375183, 0.06511984020471573, 0.07545056194067001, -0.0927223414182663, 0.18466047942638397, 0.04722156375646591, 0.05692846328020096, 0.24021150171756744, 0.029201261699199677, 0.017802685499191284, -0.06508786231279373, 0.053151268512010574, 0.038986433297395706, -0.1185530349612236, -0.09511271119117737, 0.0389869287610054, -0.08176055550575256, 0.1558055877685547, -0.1466098576784134, -0.018760694190859795, 0.1967536211013794, -0.044764239341020584, 0.16604968905448914, -0.07020173221826553, -0.03333064541220665, 0.003217978635802865, -0.05542844533920288, 0.09530559182167053, 0.0033316235058009624, 0.2605883777141571, 0.110456682741642, 0.13757042586803436, -0.2012709677219391, -0.02822653017938137, 0.14206048846244812, -0.04884243384003639, -0.02422233670949936, 0.2889952063560486, -0.2317398488521576, -0.02668362483382225, 0.031508032232522964, 0.13850300014019012, -0.018527554348111153, 0.017864765599370003, 0.07282136380672455, 0.21700729429721832, 0.014485198073089123, 0.13693922758102417, -0.008198801428079605, -0.09666388481855392, 0.01818997412919998, 0.004067535512149334, -0.04161804914474487, -0.04804106056690216, 0.2675141990184784, 0.1637047380208969, -0.005209330935031176, 0.040568094700574875, 0.13090777397155762, 0.04282025247812271, 0.03545359894633293, -0.18723468482494354, -0.07254374027252197, -0.07471146434545517, -0.16569986939430237, -0.09999377280473709, 0.03134822100400925, 0.05956711247563362, -0.017075348645448685, -0.022860735654830933, 0.02924482524394989, -0.1464308500289917, 0.1455184817314148, -0.01716645061969757, 0.0996389240026474, 0.11070913821458817, 0.19425950944423676, 0.13224756717681885, 0.16283823549747467, 0.09663762152194977, 0.4123111367225647, -0.2279045283794403, -0.07755710184574127, 0.012400725856423378, -0.07312792539596558, 0.010513058863580227, 0.17409493029117584, -0.05307308956980705, 0.14427690207958221, -0.14442957937717438, -0.11693471670150757, 0.05433015525341034, 0.0955367460846901, -0.019483640789985657, -0.07882412523031235, -0.011782711371779442, -0.01770005188882351, -0.27335411310195923, 0.08734717965126038, -0.04881156235933304, 0.07819187641143799, -0.15523885190486908, -0.052140768617391586, -0.03324064239859581, -0.1369427889585495, 0.00023748871171846986, 0.04326937347650528, 0.2365453988313675, 0.12804998457431793, -0.15588442981243134, 0.06617715209722519, -0.0149439861997962, 0.0174986831843853, -0.13502369821071625, -0.25264447927474976, 0.1051119714975357, 0.03485517576336861, 0.08982351422309875, 0.1664908081293106, 0.10304681211709976, -0.0744161307811737, 0.07402341812849045, 0.02237924188375473, -0.06410622596740723, 0.2722022533416748, 0.10428982973098755, 0.05320821329951286, -0.11996481567621231, 0.011454888619482517, 0.05668877437710762, -0.026411976665258408, 0.027787532657384872, -0.1075754165649414, 0.07818366587162018, -0.06457850337028503, 0.14213278889656067, 0.07838761806488037, 0.018904076889157295, 0.1002756878733635, 0.02251194790005684, -0.032766442745923996, -0.03822354972362518, 0.005186952650547028, 0.09410310536623001, -0.061321135610342026, -0.07685566693544388, 0.04392983019351959, 0.026595043018460274, 0.08582364022731781, -0.10544266551733017, -0.07781423628330231, -0.11764420568943024, 0.20601308345794678, -0.06496942043304443, -0.25029435753822327, -0.0552348718047142, 0.10468082875013351, -0.23533573746681213, 0.159788116812706, -0.07820466160774231, -0.13670051097869873, 0.07519974559545517, 0.14071564376354218, 0.06361586600542068, -0.0784144401550293, -0.04343416914343834, -0.10136833041906357, -0.08820494264364243, 0.11298758536577225, -0.22669222950935364, -0.06756892055273056, -0.18063117563724518, -0.04155610501766205, 0.012411207892000675, 0.02017996460199356, 0.020670779049396515, 0.04091086983680725, -0.19929639995098114, -0.005595228634774685, 0.0810379832983017, 0.09436340630054474, -0.06905995309352875, 0.11056018620729446, -0.04815145209431648, -0.1631428599357605, -0.03271199390292168, -0.060193199664354324, 0.20025743544101715, -0.07816234976053238, -0.13266322016716003, 0.10522644221782684, 0.13607795536518097, -0.0010483440710231662, -0.21053475141525269, 0.2137754112482071, 0.14183007180690765, 0.08195410668849945, -0.1366528570652008, 0.05094786360859871, -2.1264798600866755e-32, 0.12527237832546234, -0.0857088640332222, -0.030137931928038597, -0.07039251923561096, -0.25804170966148376, 0.10237810760736465, -0.07010012120008469, -0.10526548326015472, -0.01415388286113739, -0.03301125764846802, 0.0033100603614002466, -0.02782760001718998, 0.04251077398657799, -0.14973361790180206, 0.14701290428638458, 0.05792250111699104, 0.03188611939549446, 0.09639783203601837, -0.045720458030700684, 0.16646085679531097, 0.1489429771900177, 0.1786869317293167, -0.10971752554178238, 0.08356929570436478, -0.10857842862606049, -0.10629413276910782, -0.15838290750980377, -0.16215121746063232, -0.0017281732289120555, -0.017958082258701324, 0.0642208531498909, -0.003220074810087681, 0.06404710561037064, -0.10930156707763672, -0.1393873542547226, -0.06388884782791138, 0.018363982439041138, -0.1734851747751236, -0.14618416130542755, -0.1284141093492508, -0.032076552510261536, 0.17985467612743378, 0.33965733647346497, -0.2717739939689636, -0.14911706745624542, 0.1754770129919052, -0.10470044612884521, 0.027835188433527946, -0.05321703106164932, 0.05067496374249458, -0.13470172882080078, -0.08936317265033722, 0.08861619234085083, 0.043030887842178345, 0.005950736813247204, -0.1352258026599884, -0.06286407262086868, 0.1061568632721901, -0.1129784807562828, 0.2123616337776184, 0.007418536581099033, -0.05388503894209862, -0.03985326737165451, -0.04668806493282318, 0.013353673741221428, 0.005407807417213917, 0.3153855800628662, 0.05731477960944176, 0.25197917222976685, -0.1071539893746376, -0.025497138500213623, 0.21339373290538788, -0.1520124077796936, -0.1140114888548851, -0.010488647036254406, -0.09554343670606613, -0.056180503219366074, 0.1370038539171219, 0.026685137301683426, -0.06899756193161011, -0.08042462915182114, -0.13203683495521545, 0.020443476736545563, -0.08055093884468079, -0.11838434636592865, 0.0815846249461174, 0.06129419803619385, 0.07590014487504959, 0.01219927053898573, -0.055694207549095154, 0.018510974943637848, 0.12072665244340897, -0.06916230171918869, -0.04377933591604233, -0.16807921230793, 0.1616794764995575, -0.18745975196361542, -0.056768596172332764, -0.1514611840248108, 0.17539027333259583, 0.1303374469280243, -0.16554057598114014, -0.07790821045637131, 0.014368721283972263, 0.08999009430408478, 0.0023007576819509268, 0.2331271767616272, 0.07758940756320953, -0.20811888575553894, 0.03210955858230591, 0.06971198320388794, -0.17403246462345123, -0.02145136147737503, 0.16162049770355225, 0.14007537066936493, 0.02266407385468483, 0.062438610941171646, -0.25418853759765625, 0.16575941443443298, -0.0013670081971213222, -0.0680457130074501, -0.012918729335069656, -0.1674650013446808, 0.09185747802257538, 0.04206513613462448, 0.17032156884670258, -0.17274917662143707, -0.004290916491299868, 0.1177469864487648, 0.08663969486951828, -0.029887350276112556, -0.07425632327795029, 7.03249952493934e-7, -0.014850526116788387, -0.09126227349042892, -0.07863334566354752, -0.23829762637615204, -0.030940134078264236, 0.1467946618795395, -0.1989053636789322, 0.11689016222953796, -0.043706268072128296, 0.11597421765327454, 0.005105381831526756, 0.027481701225042343, 0.046102624386548996, -0.06189292296767235, 0.08588086813688278, 0.17245936393737793, -0.23174041509628296, -0.006215693894773722, -0.21728456020355225, 0.18425866961479187, 0.08289884775876999, 0.1416175663471222, -0.09008188545703888, -0.16715067625045776, 0.06424687057733536, 0.0385553315281868, -0.06513248383998871, 0.09489341080188751, 0.03306378051638603, 0.05016668140888214, -0.041552457958459854, -0.12815552949905396, 0.07672625780105591, 0.03259292617440224, 0.11673878133296967, 0.05053833872079849, -0.20055662095546722, -0.07074183225631714, 0.1325756311416626, 0.10333675891160965, 0.11574351042509079, -0.05294060334563255, -0.07542751729488373, -0.09406140446662903, -0.0688856691122055, 0.1043829619884491, 0.03396729379892349, -0.006176841910928488, 0.10724739730358124, 0.010210313834249973, 0.12196795642375946, 0.10354410856962204, 0.0075339279137551785, 0.3252119719982147, -0.13571631908416748, -0.1031714603304863, 0.0019723151344805956, -0.13098299503326416, -0.05633295699954033, -0.1374862790107727, -0.08012065291404724, -0.12717588245868683, 0.060488563030958176, -0.011147946119308472, 0.14150899648666382, -0.08228147774934769, 0.05148876830935478, 1.3003529730437308e-34, 0.04532307758927345, 0.09691482037305832, 0.1330927461385727, -0.14661040902137756, -0.0954359769821167, 0.018706336617469788, -0.06638040393590927, 0.12056142836809158, -0.1535026729106903, 0.008668585680425167, -0.05434677377343178 ]
https://github.com/huggingface/datasets/issues/6257
HfHubHTTPError - exceeded our hourly quotas for action: commit
how is your dataset structured? (file types, how many commits and files are you trying to push, etc)
### Describe the bug I try to upload a very large dataset of images, and get the following error: ``` File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future) 2710 try: 2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit") 2713 except RepositoryNotFoundError as e: 2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd) You have exceeded our hourly quotas for action: commit. We invite you to retry later. ``` this makes it much less convenient to host large datasets on HF hub. ### Steps to reproduce the bug Upload a very large dataset of images ### Expected behavior the upload to work well ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 1.5.3
18
HfHubHTTPError - exceeded our hourly quotas for action: commit ### Describe the bug I try to upload a very large dataset of images, and get the following error: ``` File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future) 2710 try: 2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit") 2713 except RepositoryNotFoundError as e: 2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd) You have exceeded our hourly quotas for action: commit. We invite you to retry later. ``` this makes it much less convenient to host large datasets on HF hub. ### Steps to reproduce the bug Upload a very large dataset of images ### Expected behavior the upload to work well ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 1.5.3 how is your dataset structured? (file types, how many commits and files are you trying to push, etc)
[ 0.191038116812706, -0.018120290711522102, 0.012614937499165535, -0.06899793446063995, 0.12030830979347229, -0.0055856360122561455, -0.04458249732851982, 0.12766148149967194, -0.04075680300593376, 0.020678188651800156, 0.03425333648920059, -0.17870067059993744, 0.014024773612618446, 0.10715512186288834, -0.04455557093024254, -0.0777784064412117, -0.07446718215942383, -0.12641018629074097, -0.0949423536658287, -0.12168251723051071, -0.0696653500199318, 0.02565286122262478, 0.018063830211758614, -0.1010020524263382, -0.10670523345470428, -0.11022910475730896, -0.025859514251351357, -0.005700777284801006, -0.0028116649482399225, -0.1733694225549698, 0.0605328194797039, 0.10125767439603806, 0.0771094337105751, 0.23872725665569305, 0.0000047589410314685665, -0.10261312872171402, 0.07753968983888626, 0.03443719819188118, -0.18532027304172516, 0.08287852257490158, -0.01372767798602581, -0.2536084055900574, -0.14279772341251373, 0.020049147307872772, 0.12437162548303604, 0.19296830892562866, -0.09219342470169067, 0.14054693281650543, 0.08580736815929413, 0.12054501473903656, -0.053955450654029846, 0.10700996220111847, 0.06551706790924072, 0.05875967815518379, -0.015595772303640842, 0.08756591379642487, -0.02020103670656681, 0.09587420523166656, -0.08266226202249527, -0.14353765547275543, -0.07960322499275208, 0.06258945167064667, 0.1350383162498474, -0.05757864564657211, 0.04158276319503784, -0.0037999257910996675, -0.16603894531726837, -0.23067785799503326, 0.19191011786460876, 0.2251119464635849, 0.028221769258379936, -0.05064079537987709, -0.10574118047952652, 0.01454521156847477, -0.18168629705905914, -0.12049040198326111, -0.1255747675895691, 0.2823837697505951, -0.1519499570131302, 0.056071024388074875, 0.07275886833667755, 0.06859180331230164, -0.05186326429247856, 0.023812798783183098, 0.07373490929603577, -0.15003056824207306, -0.043274879455566406, 0.13052931427955627, 0.044913534075021744, -0.11468997597694397, 0.14854446053504944, -0.011459684930741787, -0.10086622834205627, 0.051457248628139496, -0.12377811968326569, -0.06947428733110428, 0.0012190050911158323, -0.2004062682390213, 0.16434457898139954, -0.042049553245306015, -0.18233419954776764, 0.01071504969149828, -0.031349632889032364, 0.03379272297024727, 0.1696985512971878, -0.01232774369418621, -0.12804467976093292, -0.12383298575878143, 0.2170402556657791, 0.12847301363945007, 0.0626530647277832, 0.09621749073266983, -0.01594357378780842, -0.06992530077695847, 0.03013777546584606, -0.09433060139417648, 0.12773790955543518, 0.04826326668262482, 0.10523592680692673, 0.09324703365564346, 0.13634297251701355, 0.04228251427412033, -0.21584458649158478, 0.00545891746878624, 0.01897716149687767, 0.03309344872832298, 0.021587692201137543, -0.007837897166609764, -0.099101722240448, -0.08904197067022324, 0.006578987929970026, 0.005274462513625622, 0.03741813078522682, -0.10763370990753174, -0.023222196847200394, -0.03152018040418625, -0.03962636739015579, 0.1485205590724945, 0.21006400883197784, -0.12032845616340637, 0.10184579342603683, -0.23241856694221497, -0.10567879676818848, 0.12934252619743347, -0.07581441104412079, -0.000058316043578088284, 0.14706721901893616, 0.075996994972229, 0.010955197736620903, -0.01728864200413227, -0.08419699966907501, 0.11824315041303635, -0.11357730627059937, 0.05221635103225708, 0.19355762004852295, -0.008796603418886662, -0.17370863258838654, -0.03456002473831177, -0.12382230907678604, 0.1551782339811325, 0.05711284279823303, 0.04292340576648712, 0.24273574352264404, 0.02227133885025978, 0.029131967574357986, 0.04950091242790222, 0.17151597142219543, 0.0544101744890213, 0.09584621340036392, 0.04654983803629875, 0.07607933133840561, 0.2503015398979187, -0.03759977966547012, 0.12037123739719391, -0.12105641514062881, 0.015852829441428185, -0.22177726030349731, -0.10622444748878479, -0.10164385288953781, 0.0013073018053546548, -0.05902070552110672, -0.21326343715190887, -0.19972114264965057, 0.004104907158762217, -0.03248203918337822, 0.08341356366872787, 0.0461871400475502, -0.05443607270717621, 0.019852060824632645, 0.04140825942158699, 0.06087137758731842, -0.033017806708812714, -0.3332129716873169, -0.0451163612306118, 0.11298786103725433, -0.10035315155982971, 0.0768854022026062, -0.11225474625825882, 0.1621609330177307, -0.10685613006353378, 0.12149753421545029, -0.10680903494358063, -0.026324154809117317, 0.11365403234958649, 0.04049479961395264, -0.005574558395892382, 0.0024518787395209074, 0.05381625518202782, -0.020057126879692078, 0.06733683496713638, -0.05946676805615425, 0.05169128254055977, -0.085111603140831, 0.10772927105426788, 0.04002233222126961, -0.015795845538377762, -0.03898083418607712, -0.17417605221271515, -0.15902405977249146, 0.09718581289052963, -0.02563518099486828, 0.1845685839653015, -0.19049490988254547, -0.028324276208877563, 0.006675989832729101, 0.10922031849622726, -0.06455758959054947, 0.1848321259021759, 0.16605959832668304, -0.07950539886951447, 0.008060085587203503, -0.012467727065086365, 0.07941573113203049, -0.12417107820510864, -0.015463343821465969, 0.04918632656335831, 0.22825084626674652, -0.17350322008132935, 0.09675626456737518, 0.11393706500530243, -0.025648294016718864, 0.018334591761231422, -0.020242396742105484, -0.0362195149064064, 0.1408972144126892, -0.1328016072511673, -0.006919546518474817, 0.15817877650260925, 0.015539715066552162, 0.09166662395000458, 0.08490447700023651, -0.012114932760596275, -0.06136677786707878, 0.10130900144577026, -0.12928088009357452, -0.13003171980381012, -0.14297054708003998, 0.1186983734369278, -0.10829789191484451, -0.0016175808850675821, 0.3460386097431183, -0.11533775925636292, -0.009214474819600582, 0.07639853656291962, 0.0429280549287796, -0.13115249574184418, 0.10133302211761475, 0.018009385094046593, -0.06105298921465874, 0.07517654448747635, -0.05882049724459648, -0.11687014997005463, -0.0017671504756435752, 0.08387665450572968, -0.09920849651098251, -0.07559814304113388, -0.05514293909072876, -0.031021464616060257, 0.08315645158290863, 0.037993174046278, -0.13377255201339722, 0.0046958355233073235, 0.04737071692943573, -0.0012090137461200356, -0.023942185565829277, 0.11130613833665848, 0.08506578952074051, -0.18357285857200623, 0.04320390895009041, 0.027067366987466812, -0.04906615987420082, -0.07887402921915054, 0.015304933302104473, -0.25759750604629517, -0.10512614995241165, 0.017419276759028435, 0.197841614484787, 0.09705176949501038, -0.022651435807347298, 0.10037101805210114, -0.07054566591978073, 0.1651870310306549, 0.018393374979496002, -0.011217664927244186, 0.0760556012392044, -0.2178625464439392, 0.16610947251319885, 0.10955844819545746, -0.17236711084842682, -0.1950000673532486, -0.06521647423505783, 0.0007860239129513502, -0.002387223532423377, 0.038380421698093414, -0.004531195852905512, 0.06732229143381119, 0.06707524508237839, 0.17801764607429504, -0.04118645191192627, 0.14568063616752625, 0.016353245824575424, -0.05130589008331299, -0.1517244577407837, 0.23014412820339203, 0.07417058199644089, 0.20059071481227875, -0.1211242750287056, -0.09126012027263641, 0.013996679335832596, -0.026288900524377823, 0.16228385269641876, 0.09141601622104645, -0.1693904995918274, 0.04444480687379837, 0.016959069296717644, -0.26052045822143555, -0.06352239102125168, -0.09024760127067566, 0.05517517775297165, -0.04717281088232994, -0.011216887272894382, -0.05834493786096573, -0.005749496165663004, -0.03315948694944382, 0.007844947278499603, -0.07292204350233078, -0.13828082382678986, -0.1663612425327301, -0.019191961735486984, -0.1594463735818863, -0.02295803278684616, 0.04076217859983444, 0.025092512369155884, -0.10269269347190857, 0.0031479736790060997, -0.001708894851617515, -0.02725043147802353, 0.3956654667854309, -0.16891717910766602, 0.06330855190753937, 0.13724364340305328, 0.12729313969612122, 0.1751922369003296, 0.12771397829055786, -0.07021556049585342, 0.18817219138145447, -0.03350374847650528, 0.04041046276688576, -0.20462588965892792, -0.25860142707824707, -0.009065043181180954, 0.028935695067048073, 0.03782828524708748, 0.010399851948022842, 0.03485184535384178, 0.05982372537255287, 0.1203572005033493, -0.2520388960838318, 0.10782245546579361, -0.04899495467543602, 0.03910329192876816, 0.006299227010458708, -0.05268934369087219, 0.11185174435377121, 0.08907238394021988, -0.0454266257584095, -0.009652678854763508, -0.002211320446804166, -0.04495471343398094, 0.04119892790913582, 0.022990038618445396, -0.020976565778255463, 0.03696765378117561, -0.015215777792036533, -0.03705751895904541, -0.14509005844593048, -0.03881601244211197, 0.022641731426119804, 0.1611148566007614, 0.12314560264348984, 0.0026036666240543127, 0.13971419632434845, 0.06603565812110901, 0.19531100988388062, -0.13289102911949158, 0.019041258841753006, -0.1823917180299759, 0.029420150443911552, 0.11661987006664276, 0.05153217539191246, -0.023360421881079674, 0.04414208605885506, -0.16416077315807343, 0.058524101972579956, 0.1255975216627121, -0.029743686318397522, -0.11628271639347076, -0.07228204607963562, 0.06600234657526016, -0.2557779550552368, -0.21967844665050507, -0.17047886550426483, 0.1932636797428131, 0.09510532021522522, 0.20279461145401, -0.05954284965991974, 0.16587378084659576, -0.02724599651992321, 0.07151839137077332, -0.17132331430912018, -0.1685638427734375, 0.2665928602218628, 0.07234591990709305, -0.11369577795267105, -0.11043258756399155, 0.03944644331932068, 0.238930806517601, 0.04874259606003761, 0.04517272859811783, -0.012371390126645565, -0.06787364929914474, -0.0006879227585159242, 0.21925756335258484, -0.024359460920095444, 0.13065002858638763, 0.012988799251616001, 0.21446490287780762, -0.022943859919905663, 0.12970858812332153, 0.005390571895986795, -0.0493348091840744, -0.18976335227489471, 0.02909110113978386, -0.11653317511081696, 0.08381494134664536, 0.06008150428533554, 0.046957552433013916, 0.08337780088186264, 0.009119750931859016, 0.0026330435648560524, 0.07193591445684433, -0.04525874927639961, -0.22485853731632233, 0.133888840675354, 0.04306735098361969, -0.23472052812576294, 0.1228804811835289, -0.06630758196115494, 0.08027829974889755, 0.02202758751809597, 0.1175699308514595, 0.0897146537899971, -0.006835470907390118, -0.09488818794488907, 0.03746354579925537, 0.0491311214864254, 0.173060342669487, -0.06469298154115677, 0.022170504555106163, -0.07953783124685287, 0.21754217147827148, -0.22940199077129364, -0.14647668600082397, -0.12603577971458435, 0.033873677253723145, 0.07980642467737198, 0.10170896351337433, -0.03831109777092934, -0.11314608156681061, -0.03924814611673355, 0.033868446946144104, -0.07698449492454529, -0.09345877915620804, -0.03627976030111313, 0.22997058928012848, -0.13839289546012878, 0.22357913851737976, -0.03006334975361824, -0.12823991477489471, 0.05023013427853584, -0.040335651487112045, -0.036335498094558716, 0.06858216226100922, -0.0978807657957077, -0.019530758261680603, -0.22360417246818542, 0.1495417356491089, -0.1194518432021141, -0.08186432719230652, -0.15800081193447113, -0.12554959952831268, -0.05002013221383095, 0.016960516571998596, -0.04826875776052475, 0.21960800886154175, -0.1458994299173355, -0.1384604126214981, 0.13214647769927979, -0.015573415905237198, 0.08786631375551224, 0.06893312931060791, -0.14457060396671295, 0.07619219273328781, 0.005761010106652975, 0.06578507274389267, 0.05349218100309372, -0.0032305798958986998, -0.05256287753582001, 0.19053705036640167, 0.1668863296508789, 0.03377114608883858, 0.02190294861793518, 0.35950061678886414, -0.009616420604288578, -0.06595241278409958, 0.13236713409423828, -0.015626484528183937, -0.27753621339797974, 0.24046052992343903, 0.025790607556700706, 0.07584720849990845, -0.12372186779975891, -0.13028529286384583, 0.11749093979597092, -0.061561185866594315, 0.16034479439258575, -0.016976643353700638, -0.22824004292488098, -0.24617692828178406, -0.25083690881729126, -0.09876851737499237, 0.12397491186857224, -0.012696469202637672, 0.09846267849206924, 0.1570615917444229, -2.5435999162457363e-32, -0.07673565298318863, -0.18107418715953827, 0.04916786774992943, 0.05368007719516754, -0.34180381894111633, -0.00012084654008504003, -0.1431327760219574, -0.10739677399396896, 0.02429618313908577, -0.03838462755084038, 0.022771000862121582, -0.12357611954212189, 0.04401465505361557, 0.1120714619755745, 0.06936398893594742, 0.08898734301328659, -0.11784908175468445, -0.020120713859796524, -0.01740919053554535, 0.07141931354999542, 0.0843227207660675, -0.13341698050498962, -0.1746850162744522, 0.22702059149742126, -0.23741869628429413, 0.026240767911076546, -0.13241590559482574, 0.11918465793132782, 0.08392034471035004, 0.024110665544867516, -0.09353093057870865, 0.07558165490627289, -0.04836173728108406, -0.06444885581731796, 0.04118309170007706, 0.018550295382738113, -0.0561223030090332, -0.05433827266097069, -0.22538067400455475, -0.021931128576397896, -0.02013796754181385, 0.05574774742126465, 0.0025671536568552256, -0.15532159805297852, -0.059058044105768204, -0.015810221433639526, 0.030190547928214073, -0.07815975695848465, -0.12837396562099457, -0.03908422216773033, -0.21833688020706177, 0.10233091562986374, 0.08698660880327225, 0.13210150599479675, 0.09255822747945786, -0.012999246828258038, 0.029968637973070145, 0.16219960153102875, -0.050953030586242676, -0.22707898914813995, -0.01865451969206333, -0.05679382011294365, -0.03630673140287399, -0.0700148195028305, 0.004164246376603842, -0.003462517634034157, 0.02370617166161537, -0.003861529054120183, 0.08862198144197464, 0.012390953488647938, 0.09967245906591415, 0.07758496701717377, -0.18722741305828094, -0.04629616066813469, -0.10957285016775131, -0.05677565559744835, 0.17111040651798248, -0.10138431936502457, 0.08398723602294922, 0.14576484262943268, 0.04091969132423401, -0.052794016897678375, 0.004944163374602795, 0.03200264275074005, 0.078833669424057, 0.08280803263187408, 0.06599992513656616, 0.038903675973415375, -0.031176170334219933, 0.011244997382164001, -0.07410922646522522, 0.11085675656795502, -0.14517104625701904, -0.2056216150522232, -0.023309949785470963, 0.0981522649526596, 0.01721654273569584, 0.17802126705646515, -0.002374097006395459, -0.068331778049469, -0.07484380155801773, -0.09368567168712616, -0.14456048607826233, 0.09547724574804306, 0.20447279512882233, 0.08205684274435043, 0.21440286934375763, 0.24252024292945862, -0.0374596007168293, 0.09695032984018326, -0.03589355945587158, -0.07732675224542618, 0.11513874679803848, 0.1958136409521103, 0.06006021425127983, -0.20209211111068726, 0.039447106420993805, -0.06489244848489761, 0.008660624735057354, 0.008857729844748974, -0.05330286920070648, 0.013174698688089848, -0.05664784088730812, 0.06494145095348358, -0.039116021245718, 0.002973452676087618, 0.06392637640237808, 0.17388390004634857, -0.046480268239974976, -0.1849503517150879, -0.032060980796813965, -0.10880597680807114, 7.354248054980417e-7, -0.31614282727241516, 0.15043513476848602, -0.1637614518404007, -0.09757819771766663, -0.06460437178611755, 0.1312137246131897, -0.2491578608751297, -0.025213826447725296, -0.19802145659923553, 0.18495245277881622, 0.09948825091123581, -0.06321049481630325, 0.07255187630653381, -0.08130669593811035, 0.14364561438560486, -0.19871728122234344, -0.032754555344581604, 0.0352291502058506, -0.05558813363313675, 0.17177024483680725, 0.06410595774650574, 0.06110334396362305, 0.11512458324432373, -0.069524385035038, 0.14056678116321564, -0.08196929097175598, -0.09393435716629028, 0.013924997299909592, -0.005254763178527355, 0.08584833890199661, -0.0992027297616005, 0.08942826837301254, 0.01215431373566389, -0.07080723345279694, -0.04083428159356117, -0.11914366483688354, -0.013749429024755955, -0.10286051034927368, -0.18100112676620483, -0.20609977841377258, -0.15547335147857666, 0.08317968994379044, 0.04649968817830086, -0.2923195958137512, 0.0031930620316416025, 0.19707636535167694, -0.13188397884368896, 0.1635686755180359, 0.13958515226840973, -0.06373357772827148, 0.10126099735498428, -0.0553143136203289, 0.011822996661067009, 0.025492992252111435, 0.0740402340888977, -0.15925222635269165, -0.07907186448574066, -0.18495173752307892, 0.09874797612428665, 0.07525563985109329, -0.00279789580963552, 0.04628446698188782, 0.055888671427965164, 0.08588417619466782, -0.06955590844154358, 0.032687343657016754, 0.0007119618239812553, -9.171096722520098e-35, 0.24765285849571228, -0.11657004803419113, 0.21737901866436005, -0.1205160841345787, 0.003231111913919449, 0.05593506246805191, 0.22952648997306824, 0.014634701423346996, 0.05667884647846222, -0.042816516011953354, -0.030994273722171783 ]
https://github.com/huggingface/datasets/issues/6257
HfHubHTTPError - exceeded our hourly quotas for action: commit
I succeeded in uploading it after several attempts with an hour gap between each attempt (inconvenient but worked). The final dataset is [here](https://huggingface.co/datasets/yuvalkirstain/pickapic_v2), code and context to the dataset can be found [here](https://github.com/yuvalkirstain/PickScore/). I can close the issue if this behavior is intended, as most users probably do not need to upload large-scale datasets.
### Describe the bug I try to upload a very large dataset of images, and get the following error: ``` File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future) 2710 try: 2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit") 2713 except RepositoryNotFoundError as e: 2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd) You have exceeded our hourly quotas for action: commit. We invite you to retry later. ``` this makes it much less convenient to host large datasets on HF hub. ### Steps to reproduce the bug Upload a very large dataset of images ### Expected behavior the upload to work well ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 1.5.3
54
HfHubHTTPError - exceeded our hourly quotas for action: commit ### Describe the bug I try to upload a very large dataset of images, and get the following error: ``` File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future) 2710 try: 2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit") 2713 except RepositoryNotFoundError as e: 2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd) You have exceeded our hourly quotas for action: commit. We invite you to retry later. ``` this makes it much less convenient to host large datasets on HF hub. ### Steps to reproduce the bug Upload a very large dataset of images ### Expected behavior the upload to work well ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 1.5.3 I succeeded in uploading it after several attempts with an hour gap between each attempt (inconvenient but worked). The final dataset is [here](https://huggingface.co/datasets/yuvalkirstain/pickapic_v2), code and context to the dataset can be found [here](https://github.com/yuvalkirstain/PickScore/). I can close the issue if this behavior is intended, as most users probably do not need to upload large-scale datasets.
[ 0.191038116812706, -0.018120290711522102, 0.012614937499165535, -0.06899793446063995, 0.12030830979347229, -0.0055856360122561455, -0.04458249732851982, 0.12766148149967194, -0.04075680300593376, 0.020678188651800156, 0.03425333648920059, -0.17870067059993744, 0.014024773612618446, 0.10715512186288834, -0.04455557093024254, -0.0777784064412117, -0.07446718215942383, -0.12641018629074097, -0.0949423536658287, -0.12168251723051071, -0.0696653500199318, 0.02565286122262478, 0.018063830211758614, -0.1010020524263382, -0.10670523345470428, -0.11022910475730896, -0.025859514251351357, -0.005700777284801006, -0.0028116649482399225, -0.1733694225549698, 0.0605328194797039, 0.10125767439603806, 0.0771094337105751, 0.23872725665569305, 0.0000047589410314685665, -0.10261312872171402, 0.07753968983888626, 0.03443719819188118, -0.18532027304172516, 0.08287852257490158, -0.01372767798602581, -0.2536084055900574, -0.14279772341251373, 0.020049147307872772, 0.12437162548303604, 0.19296830892562866, -0.09219342470169067, 0.14054693281650543, 0.08580736815929413, 0.12054501473903656, -0.053955450654029846, 0.10700996220111847, 0.06551706790924072, 0.05875967815518379, -0.015595772303640842, 0.08756591379642487, -0.02020103670656681, 0.09587420523166656, -0.08266226202249527, -0.14353765547275543, -0.07960322499275208, 0.06258945167064667, 0.1350383162498474, -0.05757864564657211, 0.04158276319503784, -0.0037999257910996675, -0.16603894531726837, -0.23067785799503326, 0.19191011786460876, 0.2251119464635849, 0.028221769258379936, -0.05064079537987709, -0.10574118047952652, 0.01454521156847477, -0.18168629705905914, -0.12049040198326111, -0.1255747675895691, 0.2823837697505951, -0.1519499570131302, 0.056071024388074875, 0.07275886833667755, 0.06859180331230164, -0.05186326429247856, 0.023812798783183098, 0.07373490929603577, -0.15003056824207306, -0.043274879455566406, 0.13052931427955627, 0.044913534075021744, -0.11468997597694397, 0.14854446053504944, -0.011459684930741787, -0.10086622834205627, 0.051457248628139496, -0.12377811968326569, -0.06947428733110428, 0.0012190050911158323, -0.2004062682390213, 0.16434457898139954, -0.042049553245306015, -0.18233419954776764, 0.01071504969149828, -0.031349632889032364, 0.03379272297024727, 0.1696985512971878, -0.01232774369418621, -0.12804467976093292, -0.12383298575878143, 0.2170402556657791, 0.12847301363945007, 0.0626530647277832, 0.09621749073266983, -0.01594357378780842, -0.06992530077695847, 0.03013777546584606, -0.09433060139417648, 0.12773790955543518, 0.04826326668262482, 0.10523592680692673, 0.09324703365564346, 0.13634297251701355, 0.04228251427412033, -0.21584458649158478, 0.00545891746878624, 0.01897716149687767, 0.03309344872832298, 0.021587692201137543, -0.007837897166609764, -0.099101722240448, -0.08904197067022324, 0.006578987929970026, 0.005274462513625622, 0.03741813078522682, -0.10763370990753174, -0.023222196847200394, -0.03152018040418625, -0.03962636739015579, 0.1485205590724945, 0.21006400883197784, -0.12032845616340637, 0.10184579342603683, -0.23241856694221497, -0.10567879676818848, 0.12934252619743347, -0.07581441104412079, -0.000058316043578088284, 0.14706721901893616, 0.075996994972229, 0.010955197736620903, -0.01728864200413227, -0.08419699966907501, 0.11824315041303635, -0.11357730627059937, 0.05221635103225708, 0.19355762004852295, -0.008796603418886662, -0.17370863258838654, -0.03456002473831177, -0.12382230907678604, 0.1551782339811325, 0.05711284279823303, 0.04292340576648712, 0.24273574352264404, 0.02227133885025978, 0.029131967574357986, 0.04950091242790222, 0.17151597142219543, 0.0544101744890213, 0.09584621340036392, 0.04654983803629875, 0.07607933133840561, 0.2503015398979187, -0.03759977966547012, 0.12037123739719391, -0.12105641514062881, 0.015852829441428185, -0.22177726030349731, -0.10622444748878479, -0.10164385288953781, 0.0013073018053546548, -0.05902070552110672, -0.21326343715190887, -0.19972114264965057, 0.004104907158762217, -0.03248203918337822, 0.08341356366872787, 0.0461871400475502, -0.05443607270717621, 0.019852060824632645, 0.04140825942158699, 0.06087137758731842, -0.033017806708812714, -0.3332129716873169, -0.0451163612306118, 0.11298786103725433, -0.10035315155982971, 0.0768854022026062, -0.11225474625825882, 0.1621609330177307, -0.10685613006353378, 0.12149753421545029, -0.10680903494358063, -0.026324154809117317, 0.11365403234958649, 0.04049479961395264, -0.005574558395892382, 0.0024518787395209074, 0.05381625518202782, -0.020057126879692078, 0.06733683496713638, -0.05946676805615425, 0.05169128254055977, -0.085111603140831, 0.10772927105426788, 0.04002233222126961, -0.015795845538377762, -0.03898083418607712, -0.17417605221271515, -0.15902405977249146, 0.09718581289052963, -0.02563518099486828, 0.1845685839653015, -0.19049490988254547, -0.028324276208877563, 0.006675989832729101, 0.10922031849622726, -0.06455758959054947, 0.1848321259021759, 0.16605959832668304, -0.07950539886951447, 0.008060085587203503, -0.012467727065086365, 0.07941573113203049, -0.12417107820510864, -0.015463343821465969, 0.04918632656335831, 0.22825084626674652, -0.17350322008132935, 0.09675626456737518, 0.11393706500530243, -0.025648294016718864, 0.018334591761231422, -0.020242396742105484, -0.0362195149064064, 0.1408972144126892, -0.1328016072511673, -0.006919546518474817, 0.15817877650260925, 0.015539715066552162, 0.09166662395000458, 0.08490447700023651, -0.012114932760596275, -0.06136677786707878, 0.10130900144577026, -0.12928088009357452, -0.13003171980381012, -0.14297054708003998, 0.1186983734369278, -0.10829789191484451, -0.0016175808850675821, 0.3460386097431183, -0.11533775925636292, -0.009214474819600582, 0.07639853656291962, 0.0429280549287796, -0.13115249574184418, 0.10133302211761475, 0.018009385094046593, -0.06105298921465874, 0.07517654448747635, -0.05882049724459648, -0.11687014997005463, -0.0017671504756435752, 0.08387665450572968, -0.09920849651098251, -0.07559814304113388, -0.05514293909072876, -0.031021464616060257, 0.08315645158290863, 0.037993174046278, -0.13377255201339722, 0.0046958355233073235, 0.04737071692943573, -0.0012090137461200356, -0.023942185565829277, 0.11130613833665848, 0.08506578952074051, -0.18357285857200623, 0.04320390895009041, 0.027067366987466812, -0.04906615987420082, -0.07887402921915054, 0.015304933302104473, -0.25759750604629517, -0.10512614995241165, 0.017419276759028435, 0.197841614484787, 0.09705176949501038, -0.022651435807347298, 0.10037101805210114, -0.07054566591978073, 0.1651870310306549, 0.018393374979496002, -0.011217664927244186, 0.0760556012392044, -0.2178625464439392, 0.16610947251319885, 0.10955844819545746, -0.17236711084842682, -0.1950000673532486, -0.06521647423505783, 0.0007860239129513502, -0.002387223532423377, 0.038380421698093414, -0.004531195852905512, 0.06732229143381119, 0.06707524508237839, 0.17801764607429504, -0.04118645191192627, 0.14568063616752625, 0.016353245824575424, -0.05130589008331299, -0.1517244577407837, 0.23014412820339203, 0.07417058199644089, 0.20059071481227875, -0.1211242750287056, -0.09126012027263641, 0.013996679335832596, -0.026288900524377823, 0.16228385269641876, 0.09141601622104645, -0.1693904995918274, 0.04444480687379837, 0.016959069296717644, -0.26052045822143555, -0.06352239102125168, -0.09024760127067566, 0.05517517775297165, -0.04717281088232994, -0.011216887272894382, -0.05834493786096573, -0.005749496165663004, -0.03315948694944382, 0.007844947278499603, -0.07292204350233078, -0.13828082382678986, -0.1663612425327301, -0.019191961735486984, -0.1594463735818863, -0.02295803278684616, 0.04076217859983444, 0.025092512369155884, -0.10269269347190857, 0.0031479736790060997, -0.001708894851617515, -0.02725043147802353, 0.3956654667854309, -0.16891717910766602, 0.06330855190753937, 0.13724364340305328, 0.12729313969612122, 0.1751922369003296, 0.12771397829055786, -0.07021556049585342, 0.18817219138145447, -0.03350374847650528, 0.04041046276688576, -0.20462588965892792, -0.25860142707824707, -0.009065043181180954, 0.028935695067048073, 0.03782828524708748, 0.010399851948022842, 0.03485184535384178, 0.05982372537255287, 0.1203572005033493, -0.2520388960838318, 0.10782245546579361, -0.04899495467543602, 0.03910329192876816, 0.006299227010458708, -0.05268934369087219, 0.11185174435377121, 0.08907238394021988, -0.0454266257584095, -0.009652678854763508, -0.002211320446804166, -0.04495471343398094, 0.04119892790913582, 0.022990038618445396, -0.020976565778255463, 0.03696765378117561, -0.015215777792036533, -0.03705751895904541, -0.14509005844593048, -0.03881601244211197, 0.022641731426119804, 0.1611148566007614, 0.12314560264348984, 0.0026036666240543127, 0.13971419632434845, 0.06603565812110901, 0.19531100988388062, -0.13289102911949158, 0.019041258841753006, -0.1823917180299759, 0.029420150443911552, 0.11661987006664276, 0.05153217539191246, -0.023360421881079674, 0.04414208605885506, -0.16416077315807343, 0.058524101972579956, 0.1255975216627121, -0.029743686318397522, -0.11628271639347076, -0.07228204607963562, 0.06600234657526016, -0.2557779550552368, -0.21967844665050507, -0.17047886550426483, 0.1932636797428131, 0.09510532021522522, 0.20279461145401, -0.05954284965991974, 0.16587378084659576, -0.02724599651992321, 0.07151839137077332, -0.17132331430912018, -0.1685638427734375, 0.2665928602218628, 0.07234591990709305, -0.11369577795267105, -0.11043258756399155, 0.03944644331932068, 0.238930806517601, 0.04874259606003761, 0.04517272859811783, -0.012371390126645565, -0.06787364929914474, -0.0006879227585159242, 0.21925756335258484, -0.024359460920095444, 0.13065002858638763, 0.012988799251616001, 0.21446490287780762, -0.022943859919905663, 0.12970858812332153, 0.005390571895986795, -0.0493348091840744, -0.18976335227489471, 0.02909110113978386, -0.11653317511081696, 0.08381494134664536, 0.06008150428533554, 0.046957552433013916, 0.08337780088186264, 0.009119750931859016, 0.0026330435648560524, 0.07193591445684433, -0.04525874927639961, -0.22485853731632233, 0.133888840675354, 0.04306735098361969, -0.23472052812576294, 0.1228804811835289, -0.06630758196115494, 0.08027829974889755, 0.02202758751809597, 0.1175699308514595, 0.0897146537899971, -0.006835470907390118, -0.09488818794488907, 0.03746354579925537, 0.0491311214864254, 0.173060342669487, -0.06469298154115677, 0.022170504555106163, -0.07953783124685287, 0.21754217147827148, -0.22940199077129364, -0.14647668600082397, -0.12603577971458435, 0.033873677253723145, 0.07980642467737198, 0.10170896351337433, -0.03831109777092934, -0.11314608156681061, -0.03924814611673355, 0.033868446946144104, -0.07698449492454529, -0.09345877915620804, -0.03627976030111313, 0.22997058928012848, -0.13839289546012878, 0.22357913851737976, -0.03006334975361824, -0.12823991477489471, 0.05023013427853584, -0.040335651487112045, -0.036335498094558716, 0.06858216226100922, -0.0978807657957077, -0.019530758261680603, -0.22360417246818542, 0.1495417356491089, -0.1194518432021141, -0.08186432719230652, -0.15800081193447113, -0.12554959952831268, -0.05002013221383095, 0.016960516571998596, -0.04826875776052475, 0.21960800886154175, -0.1458994299173355, -0.1384604126214981, 0.13214647769927979, -0.015573415905237198, 0.08786631375551224, 0.06893312931060791, -0.14457060396671295, 0.07619219273328781, 0.005761010106652975, 0.06578507274389267, 0.05349218100309372, -0.0032305798958986998, -0.05256287753582001, 0.19053705036640167, 0.1668863296508789, 0.03377114608883858, 0.02190294861793518, 0.35950061678886414, -0.009616420604288578, -0.06595241278409958, 0.13236713409423828, -0.015626484528183937, -0.27753621339797974, 0.24046052992343903, 0.025790607556700706, 0.07584720849990845, -0.12372186779975891, -0.13028529286384583, 0.11749093979597092, -0.061561185866594315, 0.16034479439258575, -0.016976643353700638, -0.22824004292488098, -0.24617692828178406, -0.25083690881729126, -0.09876851737499237, 0.12397491186857224, -0.012696469202637672, 0.09846267849206924, 0.1570615917444229, -2.5435999162457363e-32, -0.07673565298318863, -0.18107418715953827, 0.04916786774992943, 0.05368007719516754, -0.34180381894111633, -0.00012084654008504003, -0.1431327760219574, -0.10739677399396896, 0.02429618313908577, -0.03838462755084038, 0.022771000862121582, -0.12357611954212189, 0.04401465505361557, 0.1120714619755745, 0.06936398893594742, 0.08898734301328659, -0.11784908175468445, -0.020120713859796524, -0.01740919053554535, 0.07141931354999542, 0.0843227207660675, -0.13341698050498962, -0.1746850162744522, 0.22702059149742126, -0.23741869628429413, 0.026240767911076546, -0.13241590559482574, 0.11918465793132782, 0.08392034471035004, 0.024110665544867516, -0.09353093057870865, 0.07558165490627289, -0.04836173728108406, -0.06444885581731796, 0.04118309170007706, 0.018550295382738113, -0.0561223030090332, -0.05433827266097069, -0.22538067400455475, -0.021931128576397896, -0.02013796754181385, 0.05574774742126465, 0.0025671536568552256, -0.15532159805297852, -0.059058044105768204, -0.015810221433639526, 0.030190547928214073, -0.07815975695848465, -0.12837396562099457, -0.03908422216773033, -0.21833688020706177, 0.10233091562986374, 0.08698660880327225, 0.13210150599479675, 0.09255822747945786, -0.012999246828258038, 0.029968637973070145, 0.16219960153102875, -0.050953030586242676, -0.22707898914813995, -0.01865451969206333, -0.05679382011294365, -0.03630673140287399, -0.0700148195028305, 0.004164246376603842, -0.003462517634034157, 0.02370617166161537, -0.003861529054120183, 0.08862198144197464, 0.012390953488647938, 0.09967245906591415, 0.07758496701717377, -0.18722741305828094, -0.04629616066813469, -0.10957285016775131, -0.05677565559744835, 0.17111040651798248, -0.10138431936502457, 0.08398723602294922, 0.14576484262943268, 0.04091969132423401, -0.052794016897678375, 0.004944163374602795, 0.03200264275074005, 0.078833669424057, 0.08280803263187408, 0.06599992513656616, 0.038903675973415375, -0.031176170334219933, 0.011244997382164001, -0.07410922646522522, 0.11085675656795502, -0.14517104625701904, -0.2056216150522232, -0.023309949785470963, 0.0981522649526596, 0.01721654273569584, 0.17802126705646515, -0.002374097006395459, -0.068331778049469, -0.07484380155801773, -0.09368567168712616, -0.14456048607826233, 0.09547724574804306, 0.20447279512882233, 0.08205684274435043, 0.21440286934375763, 0.24252024292945862, -0.0374596007168293, 0.09695032984018326, -0.03589355945587158, -0.07732675224542618, 0.11513874679803848, 0.1958136409521103, 0.06006021425127983, -0.20209211111068726, 0.039447106420993805, -0.06489244848489761, 0.008660624735057354, 0.008857729844748974, -0.05330286920070648, 0.013174698688089848, -0.05664784088730812, 0.06494145095348358, -0.039116021245718, 0.002973452676087618, 0.06392637640237808, 0.17388390004634857, -0.046480268239974976, -0.1849503517150879, -0.032060980796813965, -0.10880597680807114, 7.354248054980417e-7, -0.31614282727241516, 0.15043513476848602, -0.1637614518404007, -0.09757819771766663, -0.06460437178611755, 0.1312137246131897, -0.2491578608751297, -0.025213826447725296, -0.19802145659923553, 0.18495245277881622, 0.09948825091123581, -0.06321049481630325, 0.07255187630653381, -0.08130669593811035, 0.14364561438560486, -0.19871728122234344, -0.032754555344581604, 0.0352291502058506, -0.05558813363313675, 0.17177024483680725, 0.06410595774650574, 0.06110334396362305, 0.11512458324432373, -0.069524385035038, 0.14056678116321564, -0.08196929097175598, -0.09393435716629028, 0.013924997299909592, -0.005254763178527355, 0.08584833890199661, -0.0992027297616005, 0.08942826837301254, 0.01215431373566389, -0.07080723345279694, -0.04083428159356117, -0.11914366483688354, -0.013749429024755955, -0.10286051034927368, -0.18100112676620483, -0.20609977841377258, -0.15547335147857666, 0.08317968994379044, 0.04649968817830086, -0.2923195958137512, 0.0031930620316416025, 0.19707636535167694, -0.13188397884368896, 0.1635686755180359, 0.13958515226840973, -0.06373357772827148, 0.10126099735498428, -0.0553143136203289, 0.011822996661067009, 0.025492992252111435, 0.0740402340888977, -0.15925222635269165, -0.07907186448574066, -0.18495173752307892, 0.09874797612428665, 0.07525563985109329, -0.00279789580963552, 0.04628446698188782, 0.055888671427965164, 0.08588417619466782, -0.06955590844154358, 0.032687343657016754, 0.0007119618239812553, -9.171096722520098e-35, 0.24765285849571228, -0.11657004803419113, 0.21737901866436005, -0.1205160841345787, 0.003231111913919449, 0.05593506246805191, 0.22952648997306824, 0.014634701423346996, 0.05667884647846222, -0.042816516011953354, -0.030994273722171783 ]
https://github.com/huggingface/datasets/issues/6257
HfHubHTTPError - exceeded our hourly quotas for action: commit
We could fix this by creating a single commit for all the (Parquet) shards in `push_to_hub` instead of one commit per shard, as we currently do. @Wauplin Any updates on the 2-step commit process suggested by you that we need to implement this?
### Describe the bug I try to upload a very large dataset of images, and get the following error: ``` File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future) 2710 try: 2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit") 2713 except RepositoryNotFoundError as e: 2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd) You have exceeded our hourly quotas for action: commit. We invite you to retry later. ``` this makes it much less convenient to host large datasets on HF hub. ### Steps to reproduce the bug Upload a very large dataset of images ### Expected behavior the upload to work well ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 1.5.3
43
HfHubHTTPError - exceeded our hourly quotas for action: commit ### Describe the bug I try to upload a very large dataset of images, and get the following error: ``` File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future) 2710 try: 2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit") 2713 except RepositoryNotFoundError as e: 2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd) You have exceeded our hourly quotas for action: commit. We invite you to retry later. ``` this makes it much less convenient to host large datasets on HF hub. ### Steps to reproduce the bug Upload a very large dataset of images ### Expected behavior the upload to work well ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 1.5.3 We could fix this by creating a single commit for all the (Parquet) shards in `push_to_hub` instead of one commit per shard, as we currently do. @Wauplin Any updates on the 2-step commit process suggested by you that we need to implement this?
[ 0.191038116812706, -0.018120290711522102, 0.012614937499165535, -0.06899793446063995, 0.12030830979347229, -0.0055856360122561455, -0.04458249732851982, 0.12766148149967194, -0.04075680300593376, 0.020678188651800156, 0.03425333648920059, -0.17870067059993744, 0.014024773612618446, 0.10715512186288834, -0.04455557093024254, -0.0777784064412117, -0.07446718215942383, -0.12641018629074097, -0.0949423536658287, -0.12168251723051071, -0.0696653500199318, 0.02565286122262478, 0.018063830211758614, -0.1010020524263382, -0.10670523345470428, -0.11022910475730896, -0.025859514251351357, -0.005700777284801006, -0.0028116649482399225, -0.1733694225549698, 0.0605328194797039, 0.10125767439603806, 0.0771094337105751, 0.23872725665569305, 0.0000047589410314685665, -0.10261312872171402, 0.07753968983888626, 0.03443719819188118, -0.18532027304172516, 0.08287852257490158, -0.01372767798602581, -0.2536084055900574, -0.14279772341251373, 0.020049147307872772, 0.12437162548303604, 0.19296830892562866, -0.09219342470169067, 0.14054693281650543, 0.08580736815929413, 0.12054501473903656, -0.053955450654029846, 0.10700996220111847, 0.06551706790924072, 0.05875967815518379, -0.015595772303640842, 0.08756591379642487, -0.02020103670656681, 0.09587420523166656, -0.08266226202249527, -0.14353765547275543, -0.07960322499275208, 0.06258945167064667, 0.1350383162498474, -0.05757864564657211, 0.04158276319503784, -0.0037999257910996675, -0.16603894531726837, -0.23067785799503326, 0.19191011786460876, 0.2251119464635849, 0.028221769258379936, -0.05064079537987709, -0.10574118047952652, 0.01454521156847477, -0.18168629705905914, -0.12049040198326111, -0.1255747675895691, 0.2823837697505951, -0.1519499570131302, 0.056071024388074875, 0.07275886833667755, 0.06859180331230164, -0.05186326429247856, 0.023812798783183098, 0.07373490929603577, -0.15003056824207306, -0.043274879455566406, 0.13052931427955627, 0.044913534075021744, -0.11468997597694397, 0.14854446053504944, -0.011459684930741787, -0.10086622834205627, 0.051457248628139496, -0.12377811968326569, -0.06947428733110428, 0.0012190050911158323, -0.2004062682390213, 0.16434457898139954, -0.042049553245306015, -0.18233419954776764, 0.01071504969149828, -0.031349632889032364, 0.03379272297024727, 0.1696985512971878, -0.01232774369418621, -0.12804467976093292, -0.12383298575878143, 0.2170402556657791, 0.12847301363945007, 0.0626530647277832, 0.09621749073266983, -0.01594357378780842, -0.06992530077695847, 0.03013777546584606, -0.09433060139417648, 0.12773790955543518, 0.04826326668262482, 0.10523592680692673, 0.09324703365564346, 0.13634297251701355, 0.04228251427412033, -0.21584458649158478, 0.00545891746878624, 0.01897716149687767, 0.03309344872832298, 0.021587692201137543, -0.007837897166609764, -0.099101722240448, -0.08904197067022324, 0.006578987929970026, 0.005274462513625622, 0.03741813078522682, -0.10763370990753174, -0.023222196847200394, -0.03152018040418625, -0.03962636739015579, 0.1485205590724945, 0.21006400883197784, -0.12032845616340637, 0.10184579342603683, -0.23241856694221497, -0.10567879676818848, 0.12934252619743347, -0.07581441104412079, -0.000058316043578088284, 0.14706721901893616, 0.075996994972229, 0.010955197736620903, -0.01728864200413227, -0.08419699966907501, 0.11824315041303635, -0.11357730627059937, 0.05221635103225708, 0.19355762004852295, -0.008796603418886662, -0.17370863258838654, -0.03456002473831177, -0.12382230907678604, 0.1551782339811325, 0.05711284279823303, 0.04292340576648712, 0.24273574352264404, 0.02227133885025978, 0.029131967574357986, 0.04950091242790222, 0.17151597142219543, 0.0544101744890213, 0.09584621340036392, 0.04654983803629875, 0.07607933133840561, 0.2503015398979187, -0.03759977966547012, 0.12037123739719391, -0.12105641514062881, 0.015852829441428185, -0.22177726030349731, -0.10622444748878479, -0.10164385288953781, 0.0013073018053546548, -0.05902070552110672, -0.21326343715190887, -0.19972114264965057, 0.004104907158762217, -0.03248203918337822, 0.08341356366872787, 0.0461871400475502, -0.05443607270717621, 0.019852060824632645, 0.04140825942158699, 0.06087137758731842, -0.033017806708812714, -0.3332129716873169, -0.0451163612306118, 0.11298786103725433, -0.10035315155982971, 0.0768854022026062, -0.11225474625825882, 0.1621609330177307, -0.10685613006353378, 0.12149753421545029, -0.10680903494358063, -0.026324154809117317, 0.11365403234958649, 0.04049479961395264, -0.005574558395892382, 0.0024518787395209074, 0.05381625518202782, -0.020057126879692078, 0.06733683496713638, -0.05946676805615425, 0.05169128254055977, -0.085111603140831, 0.10772927105426788, 0.04002233222126961, -0.015795845538377762, -0.03898083418607712, -0.17417605221271515, -0.15902405977249146, 0.09718581289052963, -0.02563518099486828, 0.1845685839653015, -0.19049490988254547, -0.028324276208877563, 0.006675989832729101, 0.10922031849622726, -0.06455758959054947, 0.1848321259021759, 0.16605959832668304, -0.07950539886951447, 0.008060085587203503, -0.012467727065086365, 0.07941573113203049, -0.12417107820510864, -0.015463343821465969, 0.04918632656335831, 0.22825084626674652, -0.17350322008132935, 0.09675626456737518, 0.11393706500530243, -0.025648294016718864, 0.018334591761231422, -0.020242396742105484, -0.0362195149064064, 0.1408972144126892, -0.1328016072511673, -0.006919546518474817, 0.15817877650260925, 0.015539715066552162, 0.09166662395000458, 0.08490447700023651, -0.012114932760596275, -0.06136677786707878, 0.10130900144577026, -0.12928088009357452, -0.13003171980381012, -0.14297054708003998, 0.1186983734369278, -0.10829789191484451, -0.0016175808850675821, 0.3460386097431183, -0.11533775925636292, -0.009214474819600582, 0.07639853656291962, 0.0429280549287796, -0.13115249574184418, 0.10133302211761475, 0.018009385094046593, -0.06105298921465874, 0.07517654448747635, -0.05882049724459648, -0.11687014997005463, -0.0017671504756435752, 0.08387665450572968, -0.09920849651098251, -0.07559814304113388, -0.05514293909072876, -0.031021464616060257, 0.08315645158290863, 0.037993174046278, -0.13377255201339722, 0.0046958355233073235, 0.04737071692943573, -0.0012090137461200356, -0.023942185565829277, 0.11130613833665848, 0.08506578952074051, -0.18357285857200623, 0.04320390895009041, 0.027067366987466812, -0.04906615987420082, -0.07887402921915054, 0.015304933302104473, -0.25759750604629517, -0.10512614995241165, 0.017419276759028435, 0.197841614484787, 0.09705176949501038, -0.022651435807347298, 0.10037101805210114, -0.07054566591978073, 0.1651870310306549, 0.018393374979496002, -0.011217664927244186, 0.0760556012392044, -0.2178625464439392, 0.16610947251319885, 0.10955844819545746, -0.17236711084842682, -0.1950000673532486, -0.06521647423505783, 0.0007860239129513502, -0.002387223532423377, 0.038380421698093414, -0.004531195852905512, 0.06732229143381119, 0.06707524508237839, 0.17801764607429504, -0.04118645191192627, 0.14568063616752625, 0.016353245824575424, -0.05130589008331299, -0.1517244577407837, 0.23014412820339203, 0.07417058199644089, 0.20059071481227875, -0.1211242750287056, -0.09126012027263641, 0.013996679335832596, -0.026288900524377823, 0.16228385269641876, 0.09141601622104645, -0.1693904995918274, 0.04444480687379837, 0.016959069296717644, -0.26052045822143555, -0.06352239102125168, -0.09024760127067566, 0.05517517775297165, -0.04717281088232994, -0.011216887272894382, -0.05834493786096573, -0.005749496165663004, -0.03315948694944382, 0.007844947278499603, -0.07292204350233078, -0.13828082382678986, -0.1663612425327301, -0.019191961735486984, -0.1594463735818863, -0.02295803278684616, 0.04076217859983444, 0.025092512369155884, -0.10269269347190857, 0.0031479736790060997, -0.001708894851617515, -0.02725043147802353, 0.3956654667854309, -0.16891717910766602, 0.06330855190753937, 0.13724364340305328, 0.12729313969612122, 0.1751922369003296, 0.12771397829055786, -0.07021556049585342, 0.18817219138145447, -0.03350374847650528, 0.04041046276688576, -0.20462588965892792, -0.25860142707824707, -0.009065043181180954, 0.028935695067048073, 0.03782828524708748, 0.010399851948022842, 0.03485184535384178, 0.05982372537255287, 0.1203572005033493, -0.2520388960838318, 0.10782245546579361, -0.04899495467543602, 0.03910329192876816, 0.006299227010458708, -0.05268934369087219, 0.11185174435377121, 0.08907238394021988, -0.0454266257584095, -0.009652678854763508, -0.002211320446804166, -0.04495471343398094, 0.04119892790913582, 0.022990038618445396, -0.020976565778255463, 0.03696765378117561, -0.015215777792036533, -0.03705751895904541, -0.14509005844593048, -0.03881601244211197, 0.022641731426119804, 0.1611148566007614, 0.12314560264348984, 0.0026036666240543127, 0.13971419632434845, 0.06603565812110901, 0.19531100988388062, -0.13289102911949158, 0.019041258841753006, -0.1823917180299759, 0.029420150443911552, 0.11661987006664276, 0.05153217539191246, -0.023360421881079674, 0.04414208605885506, -0.16416077315807343, 0.058524101972579956, 0.1255975216627121, -0.029743686318397522, -0.11628271639347076, -0.07228204607963562, 0.06600234657526016, -0.2557779550552368, -0.21967844665050507, -0.17047886550426483, 0.1932636797428131, 0.09510532021522522, 0.20279461145401, -0.05954284965991974, 0.16587378084659576, -0.02724599651992321, 0.07151839137077332, -0.17132331430912018, -0.1685638427734375, 0.2665928602218628, 0.07234591990709305, -0.11369577795267105, -0.11043258756399155, 0.03944644331932068, 0.238930806517601, 0.04874259606003761, 0.04517272859811783, -0.012371390126645565, -0.06787364929914474, -0.0006879227585159242, 0.21925756335258484, -0.024359460920095444, 0.13065002858638763, 0.012988799251616001, 0.21446490287780762, -0.022943859919905663, 0.12970858812332153, 0.005390571895986795, -0.0493348091840744, -0.18976335227489471, 0.02909110113978386, -0.11653317511081696, 0.08381494134664536, 0.06008150428533554, 0.046957552433013916, 0.08337780088186264, 0.009119750931859016, 0.0026330435648560524, 0.07193591445684433, -0.04525874927639961, -0.22485853731632233, 0.133888840675354, 0.04306735098361969, -0.23472052812576294, 0.1228804811835289, -0.06630758196115494, 0.08027829974889755, 0.02202758751809597, 0.1175699308514595, 0.0897146537899971, -0.006835470907390118, -0.09488818794488907, 0.03746354579925537, 0.0491311214864254, 0.173060342669487, -0.06469298154115677, 0.022170504555106163, -0.07953783124685287, 0.21754217147827148, -0.22940199077129364, -0.14647668600082397, -0.12603577971458435, 0.033873677253723145, 0.07980642467737198, 0.10170896351337433, -0.03831109777092934, -0.11314608156681061, -0.03924814611673355, 0.033868446946144104, -0.07698449492454529, -0.09345877915620804, -0.03627976030111313, 0.22997058928012848, -0.13839289546012878, 0.22357913851737976, -0.03006334975361824, -0.12823991477489471, 0.05023013427853584, -0.040335651487112045, -0.036335498094558716, 0.06858216226100922, -0.0978807657957077, -0.019530758261680603, -0.22360417246818542, 0.1495417356491089, -0.1194518432021141, -0.08186432719230652, -0.15800081193447113, -0.12554959952831268, -0.05002013221383095, 0.016960516571998596, -0.04826875776052475, 0.21960800886154175, -0.1458994299173355, -0.1384604126214981, 0.13214647769927979, -0.015573415905237198, 0.08786631375551224, 0.06893312931060791, -0.14457060396671295, 0.07619219273328781, 0.005761010106652975, 0.06578507274389267, 0.05349218100309372, -0.0032305798958986998, -0.05256287753582001, 0.19053705036640167, 0.1668863296508789, 0.03377114608883858, 0.02190294861793518, 0.35950061678886414, -0.009616420604288578, -0.06595241278409958, 0.13236713409423828, -0.015626484528183937, -0.27753621339797974, 0.24046052992343903, 0.025790607556700706, 0.07584720849990845, -0.12372186779975891, -0.13028529286384583, 0.11749093979597092, -0.061561185866594315, 0.16034479439258575, -0.016976643353700638, -0.22824004292488098, -0.24617692828178406, -0.25083690881729126, -0.09876851737499237, 0.12397491186857224, -0.012696469202637672, 0.09846267849206924, 0.1570615917444229, -2.5435999162457363e-32, -0.07673565298318863, -0.18107418715953827, 0.04916786774992943, 0.05368007719516754, -0.34180381894111633, -0.00012084654008504003, -0.1431327760219574, -0.10739677399396896, 0.02429618313908577, -0.03838462755084038, 0.022771000862121582, -0.12357611954212189, 0.04401465505361557, 0.1120714619755745, 0.06936398893594742, 0.08898734301328659, -0.11784908175468445, -0.020120713859796524, -0.01740919053554535, 0.07141931354999542, 0.0843227207660675, -0.13341698050498962, -0.1746850162744522, 0.22702059149742126, -0.23741869628429413, 0.026240767911076546, -0.13241590559482574, 0.11918465793132782, 0.08392034471035004, 0.024110665544867516, -0.09353093057870865, 0.07558165490627289, -0.04836173728108406, -0.06444885581731796, 0.04118309170007706, 0.018550295382738113, -0.0561223030090332, -0.05433827266097069, -0.22538067400455475, -0.021931128576397896, -0.02013796754181385, 0.05574774742126465, 0.0025671536568552256, -0.15532159805297852, -0.059058044105768204, -0.015810221433639526, 0.030190547928214073, -0.07815975695848465, -0.12837396562099457, -0.03908422216773033, -0.21833688020706177, 0.10233091562986374, 0.08698660880327225, 0.13210150599479675, 0.09255822747945786, -0.012999246828258038, 0.029968637973070145, 0.16219960153102875, -0.050953030586242676, -0.22707898914813995, -0.01865451969206333, -0.05679382011294365, -0.03630673140287399, -0.0700148195028305, 0.004164246376603842, -0.003462517634034157, 0.02370617166161537, -0.003861529054120183, 0.08862198144197464, 0.012390953488647938, 0.09967245906591415, 0.07758496701717377, -0.18722741305828094, -0.04629616066813469, -0.10957285016775131, -0.05677565559744835, 0.17111040651798248, -0.10138431936502457, 0.08398723602294922, 0.14576484262943268, 0.04091969132423401, -0.052794016897678375, 0.004944163374602795, 0.03200264275074005, 0.078833669424057, 0.08280803263187408, 0.06599992513656616, 0.038903675973415375, -0.031176170334219933, 0.011244997382164001, -0.07410922646522522, 0.11085675656795502, -0.14517104625701904, -0.2056216150522232, -0.023309949785470963, 0.0981522649526596, 0.01721654273569584, 0.17802126705646515, -0.002374097006395459, -0.068331778049469, -0.07484380155801773, -0.09368567168712616, -0.14456048607826233, 0.09547724574804306, 0.20447279512882233, 0.08205684274435043, 0.21440286934375763, 0.24252024292945862, -0.0374596007168293, 0.09695032984018326, -0.03589355945587158, -0.07732675224542618, 0.11513874679803848, 0.1958136409521103, 0.06006021425127983, -0.20209211111068726, 0.039447106420993805, -0.06489244848489761, 0.008660624735057354, 0.008857729844748974, -0.05330286920070648, 0.013174698688089848, -0.05664784088730812, 0.06494145095348358, -0.039116021245718, 0.002973452676087618, 0.06392637640237808, 0.17388390004634857, -0.046480268239974976, -0.1849503517150879, -0.032060980796813965, -0.10880597680807114, 7.354248054980417e-7, -0.31614282727241516, 0.15043513476848602, -0.1637614518404007, -0.09757819771766663, -0.06460437178611755, 0.1312137246131897, -0.2491578608751297, -0.025213826447725296, -0.19802145659923553, 0.18495245277881622, 0.09948825091123581, -0.06321049481630325, 0.07255187630653381, -0.08130669593811035, 0.14364561438560486, -0.19871728122234344, -0.032754555344581604, 0.0352291502058506, -0.05558813363313675, 0.17177024483680725, 0.06410595774650574, 0.06110334396362305, 0.11512458324432373, -0.069524385035038, 0.14056678116321564, -0.08196929097175598, -0.09393435716629028, 0.013924997299909592, -0.005254763178527355, 0.08584833890199661, -0.0992027297616005, 0.08942826837301254, 0.01215431373566389, -0.07080723345279694, -0.04083428159356117, -0.11914366483688354, -0.013749429024755955, -0.10286051034927368, -0.18100112676620483, -0.20609977841377258, -0.15547335147857666, 0.08317968994379044, 0.04649968817830086, -0.2923195958137512, 0.0031930620316416025, 0.19707636535167694, -0.13188397884368896, 0.1635686755180359, 0.13958515226840973, -0.06373357772827148, 0.10126099735498428, -0.0553143136203289, 0.011822996661067009, 0.025492992252111435, 0.0740402340888977, -0.15925222635269165, -0.07907186448574066, -0.18495173752307892, 0.09874797612428665, 0.07525563985109329, -0.00279789580963552, 0.04628446698188782, 0.055888671427965164, 0.08588417619466782, -0.06955590844154358, 0.032687343657016754, 0.0007119618239812553, -9.171096722520098e-35, 0.24765285849571228, -0.11657004803419113, 0.21737901866436005, -0.1205160841345787, 0.003231111913919449, 0.05593506246805191, 0.22952648997306824, 0.014634701423346996, 0.05667884647846222, -0.042816516011953354, -0.030994273722171783 ]
https://github.com/huggingface/datasets/issues/6257
HfHubHTTPError - exceeded our hourly quotas for action: commit
> Any updates on the 2-step commit process suggested by you that we need to implement this? Re-prioritizing this, sorry. Will let you know but probably can be done this week.
### Describe the bug I try to upload a very large dataset of images, and get the following error: ``` File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future) 2710 try: 2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit") 2713 except RepositoryNotFoundError as e: 2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd) You have exceeded our hourly quotas for action: commit. We invite you to retry later. ``` this makes it much less convenient to host large datasets on HF hub. ### Steps to reproduce the bug Upload a very large dataset of images ### Expected behavior the upload to work well ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 1.5.3
31
HfHubHTTPError - exceeded our hourly quotas for action: commit ### Describe the bug I try to upload a very large dataset of images, and get the following error: ``` File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/hf_api.py:2712, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit, run_as_future) 2710 try: 2711 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2712 hf_raise_for_status(commit_resp, endpoint_name="commit") 2713 except RepositoryNotFoundError as e: 2714 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File /fsx-multigen/yuvalkirstain/miniconda/envs/pickapic/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/yuvalkirstain/pickapic_v2/commit/main (Request ID: Root=1-65112399-12d63f7d7f28bfa40a36a0fd) You have exceeded our hourly quotas for action: commit. We invite you to retry later. ``` this makes it much less convenient to host large datasets on HF hub. ### Steps to reproduce the bug Upload a very large dataset of images ### Expected behavior the upload to work well ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-5.15.0-1033-aws-x86_64-with-glibc2.31 - Python version: 3.10.11 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 1.5.3 > Any updates on the 2-step commit process suggested by you that we need to implement this? Re-prioritizing this, sorry. Will let you know but probably can be done this week.
[ 0.191038116812706, -0.018120290711522102, 0.012614937499165535, -0.06899793446063995, 0.12030830979347229, -0.0055856360122561455, -0.04458249732851982, 0.12766148149967194, -0.04075680300593376, 0.020678188651800156, 0.03425333648920059, -0.17870067059993744, 0.014024773612618446, 0.10715512186288834, -0.04455557093024254, -0.0777784064412117, -0.07446718215942383, -0.12641018629074097, -0.0949423536658287, -0.12168251723051071, -0.0696653500199318, 0.02565286122262478, 0.018063830211758614, -0.1010020524263382, -0.10670523345470428, -0.11022910475730896, -0.025859514251351357, -0.005700777284801006, -0.0028116649482399225, -0.1733694225549698, 0.0605328194797039, 0.10125767439603806, 0.0771094337105751, 0.23872725665569305, 0.0000047589410314685665, -0.10261312872171402, 0.07753968983888626, 0.03443719819188118, -0.18532027304172516, 0.08287852257490158, -0.01372767798602581, -0.2536084055900574, -0.14279772341251373, 0.020049147307872772, 0.12437162548303604, 0.19296830892562866, -0.09219342470169067, 0.14054693281650543, 0.08580736815929413, 0.12054501473903656, -0.053955450654029846, 0.10700996220111847, 0.06551706790924072, 0.05875967815518379, -0.015595772303640842, 0.08756591379642487, -0.02020103670656681, 0.09587420523166656, -0.08266226202249527, -0.14353765547275543, -0.07960322499275208, 0.06258945167064667, 0.1350383162498474, -0.05757864564657211, 0.04158276319503784, -0.0037999257910996675, -0.16603894531726837, -0.23067785799503326, 0.19191011786460876, 0.2251119464635849, 0.028221769258379936, -0.05064079537987709, -0.10574118047952652, 0.01454521156847477, -0.18168629705905914, -0.12049040198326111, -0.1255747675895691, 0.2823837697505951, -0.1519499570131302, 0.056071024388074875, 0.07275886833667755, 0.06859180331230164, -0.05186326429247856, 0.023812798783183098, 0.07373490929603577, -0.15003056824207306, -0.043274879455566406, 0.13052931427955627, 0.044913534075021744, -0.11468997597694397, 0.14854446053504944, -0.011459684930741787, -0.10086622834205627, 0.051457248628139496, -0.12377811968326569, -0.06947428733110428, 0.0012190050911158323, -0.2004062682390213, 0.16434457898139954, -0.042049553245306015, -0.18233419954776764, 0.01071504969149828, -0.031349632889032364, 0.03379272297024727, 0.1696985512971878, -0.01232774369418621, -0.12804467976093292, -0.12383298575878143, 0.2170402556657791, 0.12847301363945007, 0.0626530647277832, 0.09621749073266983, -0.01594357378780842, -0.06992530077695847, 0.03013777546584606, -0.09433060139417648, 0.12773790955543518, 0.04826326668262482, 0.10523592680692673, 0.09324703365564346, 0.13634297251701355, 0.04228251427412033, -0.21584458649158478, 0.00545891746878624, 0.01897716149687767, 0.03309344872832298, 0.021587692201137543, -0.007837897166609764, -0.099101722240448, -0.08904197067022324, 0.006578987929970026, 0.005274462513625622, 0.03741813078522682, -0.10763370990753174, -0.023222196847200394, -0.03152018040418625, -0.03962636739015579, 0.1485205590724945, 0.21006400883197784, -0.12032845616340637, 0.10184579342603683, -0.23241856694221497, -0.10567879676818848, 0.12934252619743347, -0.07581441104412079, -0.000058316043578088284, 0.14706721901893616, 0.075996994972229, 0.010955197736620903, -0.01728864200413227, -0.08419699966907501, 0.11824315041303635, -0.11357730627059937, 0.05221635103225708, 0.19355762004852295, -0.008796603418886662, -0.17370863258838654, -0.03456002473831177, -0.12382230907678604, 0.1551782339811325, 0.05711284279823303, 0.04292340576648712, 0.24273574352264404, 0.02227133885025978, 0.029131967574357986, 0.04950091242790222, 0.17151597142219543, 0.0544101744890213, 0.09584621340036392, 0.04654983803629875, 0.07607933133840561, 0.2503015398979187, -0.03759977966547012, 0.12037123739719391, -0.12105641514062881, 0.015852829441428185, -0.22177726030349731, -0.10622444748878479, -0.10164385288953781, 0.0013073018053546548, -0.05902070552110672, -0.21326343715190887, -0.19972114264965057, 0.004104907158762217, -0.03248203918337822, 0.08341356366872787, 0.0461871400475502, -0.05443607270717621, 0.019852060824632645, 0.04140825942158699, 0.06087137758731842, -0.033017806708812714, -0.3332129716873169, -0.0451163612306118, 0.11298786103725433, -0.10035315155982971, 0.0768854022026062, -0.11225474625825882, 0.1621609330177307, -0.10685613006353378, 0.12149753421545029, -0.10680903494358063, -0.026324154809117317, 0.11365403234958649, 0.04049479961395264, -0.005574558395892382, 0.0024518787395209074, 0.05381625518202782, -0.020057126879692078, 0.06733683496713638, -0.05946676805615425, 0.05169128254055977, -0.085111603140831, 0.10772927105426788, 0.04002233222126961, -0.015795845538377762, -0.03898083418607712, -0.17417605221271515, -0.15902405977249146, 0.09718581289052963, -0.02563518099486828, 0.1845685839653015, -0.19049490988254547, -0.028324276208877563, 0.006675989832729101, 0.10922031849622726, -0.06455758959054947, 0.1848321259021759, 0.16605959832668304, -0.07950539886951447, 0.008060085587203503, -0.012467727065086365, 0.07941573113203049, -0.12417107820510864, -0.015463343821465969, 0.04918632656335831, 0.22825084626674652, -0.17350322008132935, 0.09675626456737518, 0.11393706500530243, -0.025648294016718864, 0.018334591761231422, -0.020242396742105484, -0.0362195149064064, 0.1408972144126892, -0.1328016072511673, -0.006919546518474817, 0.15817877650260925, 0.015539715066552162, 0.09166662395000458, 0.08490447700023651, -0.012114932760596275, -0.06136677786707878, 0.10130900144577026, -0.12928088009357452, -0.13003171980381012, -0.14297054708003998, 0.1186983734369278, -0.10829789191484451, -0.0016175808850675821, 0.3460386097431183, -0.11533775925636292, -0.009214474819600582, 0.07639853656291962, 0.0429280549287796, -0.13115249574184418, 0.10133302211761475, 0.018009385094046593, -0.06105298921465874, 0.07517654448747635, -0.05882049724459648, -0.11687014997005463, -0.0017671504756435752, 0.08387665450572968, -0.09920849651098251, -0.07559814304113388, -0.05514293909072876, -0.031021464616060257, 0.08315645158290863, 0.037993174046278, -0.13377255201339722, 0.0046958355233073235, 0.04737071692943573, -0.0012090137461200356, -0.023942185565829277, 0.11130613833665848, 0.08506578952074051, -0.18357285857200623, 0.04320390895009041, 0.027067366987466812, -0.04906615987420082, -0.07887402921915054, 0.015304933302104473, -0.25759750604629517, -0.10512614995241165, 0.017419276759028435, 0.197841614484787, 0.09705176949501038, -0.022651435807347298, 0.10037101805210114, -0.07054566591978073, 0.1651870310306549, 0.018393374979496002, -0.011217664927244186, 0.0760556012392044, -0.2178625464439392, 0.16610947251319885, 0.10955844819545746, -0.17236711084842682, -0.1950000673532486, -0.06521647423505783, 0.0007860239129513502, -0.002387223532423377, 0.038380421698093414, -0.004531195852905512, 0.06732229143381119, 0.06707524508237839, 0.17801764607429504, -0.04118645191192627, 0.14568063616752625, 0.016353245824575424, -0.05130589008331299, -0.1517244577407837, 0.23014412820339203, 0.07417058199644089, 0.20059071481227875, -0.1211242750287056, -0.09126012027263641, 0.013996679335832596, -0.026288900524377823, 0.16228385269641876, 0.09141601622104645, -0.1693904995918274, 0.04444480687379837, 0.016959069296717644, -0.26052045822143555, -0.06352239102125168, -0.09024760127067566, 0.05517517775297165, -0.04717281088232994, -0.011216887272894382, -0.05834493786096573, -0.005749496165663004, -0.03315948694944382, 0.007844947278499603, -0.07292204350233078, -0.13828082382678986, -0.1663612425327301, -0.019191961735486984, -0.1594463735818863, -0.02295803278684616, 0.04076217859983444, 0.025092512369155884, -0.10269269347190857, 0.0031479736790060997, -0.001708894851617515, -0.02725043147802353, 0.3956654667854309, -0.16891717910766602, 0.06330855190753937, 0.13724364340305328, 0.12729313969612122, 0.1751922369003296, 0.12771397829055786, -0.07021556049585342, 0.18817219138145447, -0.03350374847650528, 0.04041046276688576, -0.20462588965892792, -0.25860142707824707, -0.009065043181180954, 0.028935695067048073, 0.03782828524708748, 0.010399851948022842, 0.03485184535384178, 0.05982372537255287, 0.1203572005033493, -0.2520388960838318, 0.10782245546579361, -0.04899495467543602, 0.03910329192876816, 0.006299227010458708, -0.05268934369087219, 0.11185174435377121, 0.08907238394021988, -0.0454266257584095, -0.009652678854763508, -0.002211320446804166, -0.04495471343398094, 0.04119892790913582, 0.022990038618445396, -0.020976565778255463, 0.03696765378117561, -0.015215777792036533, -0.03705751895904541, -0.14509005844593048, -0.03881601244211197, 0.022641731426119804, 0.1611148566007614, 0.12314560264348984, 0.0026036666240543127, 0.13971419632434845, 0.06603565812110901, 0.19531100988388062, -0.13289102911949158, 0.019041258841753006, -0.1823917180299759, 0.029420150443911552, 0.11661987006664276, 0.05153217539191246, -0.023360421881079674, 0.04414208605885506, -0.16416077315807343, 0.058524101972579956, 0.1255975216627121, -0.029743686318397522, -0.11628271639347076, -0.07228204607963562, 0.06600234657526016, -0.2557779550552368, -0.21967844665050507, -0.17047886550426483, 0.1932636797428131, 0.09510532021522522, 0.20279461145401, -0.05954284965991974, 0.16587378084659576, -0.02724599651992321, 0.07151839137077332, -0.17132331430912018, -0.1685638427734375, 0.2665928602218628, 0.07234591990709305, -0.11369577795267105, -0.11043258756399155, 0.03944644331932068, 0.238930806517601, 0.04874259606003761, 0.04517272859811783, -0.012371390126645565, -0.06787364929914474, -0.0006879227585159242, 0.21925756335258484, -0.024359460920095444, 0.13065002858638763, 0.012988799251616001, 0.21446490287780762, -0.022943859919905663, 0.12970858812332153, 0.005390571895986795, -0.0493348091840744, -0.18976335227489471, 0.02909110113978386, -0.11653317511081696, 0.08381494134664536, 0.06008150428533554, 0.046957552433013916, 0.08337780088186264, 0.009119750931859016, 0.0026330435648560524, 0.07193591445684433, -0.04525874927639961, -0.22485853731632233, 0.133888840675354, 0.04306735098361969, -0.23472052812576294, 0.1228804811835289, -0.06630758196115494, 0.08027829974889755, 0.02202758751809597, 0.1175699308514595, 0.0897146537899971, -0.006835470907390118, -0.09488818794488907, 0.03746354579925537, 0.0491311214864254, 0.173060342669487, -0.06469298154115677, 0.022170504555106163, -0.07953783124685287, 0.21754217147827148, -0.22940199077129364, -0.14647668600082397, -0.12603577971458435, 0.033873677253723145, 0.07980642467737198, 0.10170896351337433, -0.03831109777092934, -0.11314608156681061, -0.03924814611673355, 0.033868446946144104, -0.07698449492454529, -0.09345877915620804, -0.03627976030111313, 0.22997058928012848, -0.13839289546012878, 0.22357913851737976, -0.03006334975361824, -0.12823991477489471, 0.05023013427853584, -0.040335651487112045, -0.036335498094558716, 0.06858216226100922, -0.0978807657957077, -0.019530758261680603, -0.22360417246818542, 0.1495417356491089, -0.1194518432021141, -0.08186432719230652, -0.15800081193447113, -0.12554959952831268, -0.05002013221383095, 0.016960516571998596, -0.04826875776052475, 0.21960800886154175, -0.1458994299173355, -0.1384604126214981, 0.13214647769927979, -0.015573415905237198, 0.08786631375551224, 0.06893312931060791, -0.14457060396671295, 0.07619219273328781, 0.005761010106652975, 0.06578507274389267, 0.05349218100309372, -0.0032305798958986998, -0.05256287753582001, 0.19053705036640167, 0.1668863296508789, 0.03377114608883858, 0.02190294861793518, 0.35950061678886414, -0.009616420604288578, -0.06595241278409958, 0.13236713409423828, -0.015626484528183937, -0.27753621339797974, 0.24046052992343903, 0.025790607556700706, 0.07584720849990845, -0.12372186779975891, -0.13028529286384583, 0.11749093979597092, -0.061561185866594315, 0.16034479439258575, -0.016976643353700638, -0.22824004292488098, -0.24617692828178406, -0.25083690881729126, -0.09876851737499237, 0.12397491186857224, -0.012696469202637672, 0.09846267849206924, 0.1570615917444229, -2.5435999162457363e-32, -0.07673565298318863, -0.18107418715953827, 0.04916786774992943, 0.05368007719516754, -0.34180381894111633, -0.00012084654008504003, -0.1431327760219574, -0.10739677399396896, 0.02429618313908577, -0.03838462755084038, 0.022771000862121582, -0.12357611954212189, 0.04401465505361557, 0.1120714619755745, 0.06936398893594742, 0.08898734301328659, -0.11784908175468445, -0.020120713859796524, -0.01740919053554535, 0.07141931354999542, 0.0843227207660675, -0.13341698050498962, -0.1746850162744522, 0.22702059149742126, -0.23741869628429413, 0.026240767911076546, -0.13241590559482574, 0.11918465793132782, 0.08392034471035004, 0.024110665544867516, -0.09353093057870865, 0.07558165490627289, -0.04836173728108406, -0.06444885581731796, 0.04118309170007706, 0.018550295382738113, -0.0561223030090332, -0.05433827266097069, -0.22538067400455475, -0.021931128576397896, -0.02013796754181385, 0.05574774742126465, 0.0025671536568552256, -0.15532159805297852, -0.059058044105768204, -0.015810221433639526, 0.030190547928214073, -0.07815975695848465, -0.12837396562099457, -0.03908422216773033, -0.21833688020706177, 0.10233091562986374, 0.08698660880327225, 0.13210150599479675, 0.09255822747945786, -0.012999246828258038, 0.029968637973070145, 0.16219960153102875, -0.050953030586242676, -0.22707898914813995, -0.01865451969206333, -0.05679382011294365, -0.03630673140287399, -0.0700148195028305, 0.004164246376603842, -0.003462517634034157, 0.02370617166161537, -0.003861529054120183, 0.08862198144197464, 0.012390953488647938, 0.09967245906591415, 0.07758496701717377, -0.18722741305828094, -0.04629616066813469, -0.10957285016775131, -0.05677565559744835, 0.17111040651798248, -0.10138431936502457, 0.08398723602294922, 0.14576484262943268, 0.04091969132423401, -0.052794016897678375, 0.004944163374602795, 0.03200264275074005, 0.078833669424057, 0.08280803263187408, 0.06599992513656616, 0.038903675973415375, -0.031176170334219933, 0.011244997382164001, -0.07410922646522522, 0.11085675656795502, -0.14517104625701904, -0.2056216150522232, -0.023309949785470963, 0.0981522649526596, 0.01721654273569584, 0.17802126705646515, -0.002374097006395459, -0.068331778049469, -0.07484380155801773, -0.09368567168712616, -0.14456048607826233, 0.09547724574804306, 0.20447279512882233, 0.08205684274435043, 0.21440286934375763, 0.24252024292945862, -0.0374596007168293, 0.09695032984018326, -0.03589355945587158, -0.07732675224542618, 0.11513874679803848, 0.1958136409521103, 0.06006021425127983, -0.20209211111068726, 0.039447106420993805, -0.06489244848489761, 0.008660624735057354, 0.008857729844748974, -0.05330286920070648, 0.013174698688089848, -0.05664784088730812, 0.06494145095348358, -0.039116021245718, 0.002973452676087618, 0.06392637640237808, 0.17388390004634857, -0.046480268239974976, -0.1849503517150879, -0.032060980796813965, -0.10880597680807114, 7.354248054980417e-7, -0.31614282727241516, 0.15043513476848602, -0.1637614518404007, -0.09757819771766663, -0.06460437178611755, 0.1312137246131897, -0.2491578608751297, -0.025213826447725296, -0.19802145659923553, 0.18495245277881622, 0.09948825091123581, -0.06321049481630325, 0.07255187630653381, -0.08130669593811035, 0.14364561438560486, -0.19871728122234344, -0.032754555344581604, 0.0352291502058506, -0.05558813363313675, 0.17177024483680725, 0.06410595774650574, 0.06110334396362305, 0.11512458324432373, -0.069524385035038, 0.14056678116321564, -0.08196929097175598, -0.09393435716629028, 0.013924997299909592, -0.005254763178527355, 0.08584833890199661, -0.0992027297616005, 0.08942826837301254, 0.01215431373566389, -0.07080723345279694, -0.04083428159356117, -0.11914366483688354, -0.013749429024755955, -0.10286051034927368, -0.18100112676620483, -0.20609977841377258, -0.15547335147857666, 0.08317968994379044, 0.04649968817830086, -0.2923195958137512, 0.0031930620316416025, 0.19707636535167694, -0.13188397884368896, 0.1635686755180359, 0.13958515226840973, -0.06373357772827148, 0.10126099735498428, -0.0553143136203289, 0.011822996661067009, 0.025492992252111435, 0.0740402340888977, -0.15925222635269165, -0.07907186448574066, -0.18495173752307892, 0.09874797612428665, 0.07525563985109329, -0.00279789580963552, 0.04628446698188782, 0.055888671427965164, 0.08588417619466782, -0.06955590844154358, 0.032687343657016754, 0.0007119618239812553, -9.171096722520098e-35, 0.24765285849571228, -0.11657004803419113, 0.21737901866436005, -0.1205160841345787, 0.003231111913919449, 0.05593506246805191, 0.22952648997306824, 0.014634701423346996, 0.05667884647846222, -0.042816516011953354, -0.030994273722171783 ]
https://github.com/huggingface/datasets/issues/6256
load_dataset() function's cache_dir does not seems to work
Can you share the error message? Also, it would help if you could check whether `huggingface_hub`'s download behaves the same: ```python from huggingface_hub import snapshot_download snapshot_download("trec", repo_type="dataset", cache_dir='/path/to/my/dir) ``` In the next major release, we aim to switch to `huggingface_hub` for file download/caching, but we could align the `cache_dir`'s `umask` behavior earlier than this if their solution works for your use case.
### Describe the bug datasets version: 2.14.5 when trying to run the following command trec = load_dataset('trec', split='train[:1000]', cache_dir='/path/to/my/dir') I keep getting error saying the command does not have permission to the default cache directory on my macbook pro machine. It seems the cache_dir parameter cannot change the dataset saving directory from the default what ever explained in the https://huggingface.co/docs/datasets/cache does not seem to work ### Steps to reproduce the bug datasets version: 2.14.5 when trying to run the following command trec = load_dataset('trec', split='train[:1000]', cache_dir='/path/to/my/dir') I keep getting error saying the command does not have permission to the default cache directory on my macbook pro machine. It seems the cache_dir parameter cannot change the dataset saving directory from the default what ever explained in the https://huggingface.co/docs/datasets/cache does not seem to work ### Expected behavior the dataset should be saved to the cache_dir points to ### Environment info datasets version: 2.14.5 macos X: Ventura 13.4.1 (c)
62
load_dataset() function's cache_dir does not seems to work ### Describe the bug datasets version: 2.14.5 when trying to run the following command trec = load_dataset('trec', split='train[:1000]', cache_dir='/path/to/my/dir') I keep getting error saying the command does not have permission to the default cache directory on my macbook pro machine. It seems the cache_dir parameter cannot change the dataset saving directory from the default what ever explained in the https://huggingface.co/docs/datasets/cache does not seem to work ### Steps to reproduce the bug datasets version: 2.14.5 when trying to run the following command trec = load_dataset('trec', split='train[:1000]', cache_dir='/path/to/my/dir') I keep getting error saying the command does not have permission to the default cache directory on my macbook pro machine. It seems the cache_dir parameter cannot change the dataset saving directory from the default what ever explained in the https://huggingface.co/docs/datasets/cache does not seem to work ### Expected behavior the dataset should be saved to the cache_dir points to ### Environment info datasets version: 2.14.5 macos X: Ventura 13.4.1 (c) Can you share the error message? Also, it would help if you could check whether `huggingface_hub`'s download behaves the same: ```python from huggingface_hub import snapshot_download snapshot_download("trec", repo_type="dataset", cache_dir='/path/to/my/dir) ``` In the next major release, we aim to switch to `huggingface_hub` for file download/caching, but we could align the `cache_dir`'s `umask` behavior earlier than this if their solution works for your use case.
[ 0.08891388773918152, -0.04736633598804474, -0.028736833482980728, 0.03678787127137184, 0.18129964172840118, 0.03981345519423485, 0.057795293629169464, -0.02205134928226471, 0.17210499942302704, 0.1492542177438736, -0.17053593695163727, -0.037438128143548965, 0.03886730223894119, -0.21782024204730988, 0.022823592647910118, -0.03852512687444687, -0.0007456897874362767, 0.00817530695348978, -0.1218293160200119, 0.003122601192444563, -0.01995116099715233, 0.103889100253582, 0.17231522500514984, -0.024443354457616806, -0.08058862388134003, -0.06264015287160873, 0.021508514881134033, 0.17893217504024506, 0.10056232661008835, -0.012312422506511211, 0.20459918677806854, 0.03382723778486252, 0.07552210986614227, 0.13920451700687408, 0.000006032102646713611, 0.05982682853937149, 0.012686800211668015, 0.13433915376663208, -0.05969848483800888, -0.17936958372592926, 0.22077576816082, -0.04683342203497887, -0.03322929888963699, -0.03367350995540619, -0.0700794905424118, -0.0751270279288292, -0.04915196821093559, -0.019786326214671135, -0.013716834597289562, 0.07456115633249283, -0.08125852793455124, 0.022079626098275185, -0.11421092599630356, -0.19870875775814056, 0.10708557814359665, 0.06132536008954048, -0.0761747881770134, 0.11341871321201324, -0.24684102833271027, -0.05336500331759453, -0.14001911878585815, -0.07556810230016708, -0.010955671779811382, 0.08449427038431168, 0.021889757364988327, 0.051703330129384995, -0.10130517184734344, -0.06282908469438553, 0.06715692579746246, 0.23102843761444092, 0.05364040285348892, 0.1595543771982193, -0.04834209755063057, 0.02491588145494461, -0.005063747055828571, 0.055033355951309204, -0.007848123088479042, 0.015843821689486504, -0.17383411526679993, 0.15761230885982513, -0.15599027276039124, -0.17245212197303772, -0.04758536443114281, -0.04052329435944557, -0.09753309935331345, -0.02996976114809513, -0.15076769888401031, -0.037102483212947845, 0.013159040361642838, -0.12104899436235428, 0.19579346477985382, 0.053139932453632355, -0.11258431524038315, -0.10311010479927063, 0.10580123215913773, 0.16371938586235046, 0.07070421427488327, 0.11814770102500916, 0.057912085205316544, 0.07673534005880356, 0.05741139501333237, -0.08011709153652191, -0.09675140678882599, 0.13907156884670258, 0.010653282515704632, -0.02443179115653038, 0.013057008385658264, -0.037308163940906525, 0.11867015063762665, 0.03241398185491562, -0.13914740085601807, 0.06404124945402145, -0.1472383439540863, -0.13008522987365723, 0.07930560410022736, -0.027388378977775574, -0.03132783621549606, 0.1059032678604126, 0.0709867924451828, 0.05911363661289215, 0.14840567111968994, 0.046241410076618195, 0.02619672752916813, 0.22265151143074036, 0.07405194640159607, 0.03630397096276283, -0.07737881690263748, 0.011471646837890148, -0.029751388356089592, 0.048729222267866135, -0.07011732459068298, -0.10265370458364487, -0.12106337398290634, 0.023056715726852417, 0.16498737037181854, -0.17389054596424103, -0.0021590744145214558, -0.18564943969249725, 0.06106121465563774, -0.1301097273826599, 0.12556469440460205, -0.11139163374900818, -0.15575717389583588, 0.0072767785750329494, 0.040442828088998795, 0.014669423922896385, 0.06278347223997116, 0.15057431161403656, -0.01993214152753353, -0.023983152583241463, -0.2768700420856476, -0.010583661496639252, -0.1653316766023636, 0.030556248500943184, -0.09446825087070465, -0.059678275138139725, -0.1388241946697235, 0.0022808427456766367, -0.25949129462242126, -0.011513177305459976, 0.11436651647090912, 0.0019733973313122988, -0.07228272408246994, -0.10604144632816315, 0.19812771677970886, 0.05089333653450012, 0.12125205248594284, 0.018737221136689186, -0.0596545934677124, -0.04376605898141861, -0.0665191262960434, -0.03951204568147659, -0.04558572173118591, -0.00422432366758585, -0.27526965737342834, 0.13171422481536865, -0.01627352461218834, -0.06234154477715492, -0.2051171064376831, 0.0004921066574752331, 0.13263750076293945, -0.0022780257277190685, 0.03603644296526909, -0.10458735376596451, -0.05134223774075508, -0.05851566419005394, -0.09441164135932922, 0.0943237766623497, -0.0010431483387947083, -0.05269414931535721, 0.01854620687663555, -0.03565029427409172, 0.009678283706307411, 0.05075481906533241, -0.06022527068853378, -0.04478451982140541, 0.07148794084787369, -0.02505146712064743, 0.042979367077350616, -0.273478627204895, -0.09052196890115738, 0.10453587770462036, 0.09052896499633789, 0.11508418619632721, -0.015527138486504555, -0.14452992379665375, -0.11023497581481934, 0.20685453712940216, 0.06290210783481598, -0.2617562711238861, -0.14335843920707703, 0.07396978884935379, -0.07881299406290054, -0.022237801924347878, -0.09292367845773697, -0.08073475956916809, -0.142326220870018, 0.20045481622219086, -0.019261948764324188, 0.18068130314350128, -0.057333484292030334, 0.17245693504810333, 0.12391962110996246, 0.15392449498176575, -0.026395441964268684, 0.06938342750072479, 0.006496733985841274, 0.0659988522529602, 0.010625705122947693, 0.009553738869726658, -0.1684369146823883, -0.12142098695039749, 0.08374019712209702, 0.15674522519111633, -0.03630942851305008, 0.05583743378520012, 0.012552222236990929, -0.09670168906450272, 0.07387719303369522, -0.014154801145195961, -0.18328657746315002, 0.0659937709569931, -0.011548345908522606, -0.03427491709589958, -0.014544262550771236, 0.15004464983940125, -0.12095222622156143, 0.0685395672917366, -0.06007063388824463, -0.033355627208948135, 0.2963763475418091, 0.278865247964859, -0.06936214119195938, 0.02867298014461994, 0.10256601870059967, 0.026999564841389656, 0.08049730956554413, 0.1812850385904312, -0.049068838357925415, -0.08684644848108292, 0.18890343606472015, 0.0600263886153698, -0.013395349495112896, 0.023923395201563835, 0.16252540051937103, -0.05648251995444298, 0.005970668513327837, -0.12879370152950287, 0.10741478204727173, 0.10848398506641388, -0.011261558160185814, -0.12281691282987595, -0.18179355561733246, -0.0645744651556015, -0.02118830196559429, -0.048716429620981216, 0.10108254104852676, -0.1132536455988884, 0.004579938016831875, -0.05370156466960907, -0.16652709245681763, 0.2306165248155594, 0.1379876583814621, -0.10435328632593155, 0.11408539116382599, 0.09287089109420776, -0.05695266276597977, -0.03491269052028656, 0.028222525492310524, -0.09505873173475266, 0.009369892999529839, -0.02039089798927307, 0.05345863848924637, -0.08560941368341446, 0.07648357003927231, 0.056171927601099014, 0.05983491986989975, 0.08433996140956879, 0.04024815186858177, 0.0552188865840435, -0.10709280520677567, 0.09211049228906631, -0.013707145117223263, 0.023672590032219887, 0.05650091916322708, 0.031244657933712006, 0.02689311094582081, 0.014694624580442905, -0.15327800810337067, -0.013221812434494495, -0.03631310537457466, -0.047582801431417465, 0.01865626499056816, 0.05045333877205849, -0.014216585084795952, -0.05818265676498413, -0.05452853441238403, -0.1491519808769226, 0.12063415348529816, 0.04449881985783577, 0.056363631039857864, 0.1672438383102417, 0.04258823022246361, -0.01455859374254942, -0.032620299607515335, 0.07483912259340286, -0.15405374765396118, -0.2394653707742691, 0.052476901561021805, -0.05127031356096268, -0.10701438784599304, 0.07108397781848907, 0.055070336908102036, -0.1094566285610199, -0.044360607862472534, -0.11092536896467209, -0.09106031060218811, -0.25605133175849915, 0.30264776945114136, -0.09733930975198746, -0.02189508080482483, 0.0020171585492789745, -0.003305218182504177, -0.06116139143705368, 0.07530802488327026, -0.05972421169281006, -0.07102344930171967, -0.19274088740348816, 0.03385861963033676, -0.073176309466362, 0.08563809841871262, -0.11740438640117645, -0.09421171247959137, -0.05807104706764221, 0.029244184494018555, -0.04818981885910034, 0.017764413729310036, -0.010935921221971512, 0.0067859129048883915, 0.11213665455579758, -0.05396425351500511, -0.025735817849636078, -0.057192303240299225, 0.027314910665154457, -0.053871456533670425, 0.1387186348438263, 0.11640182137489319, 0.119575135409832, 0.006086776964366436, -0.1865067332983017, -0.04054940119385719, 0.049210257828235626, 0.05610481649637222, -0.035789940506219864, 0.06136316433548927, 0.04906919226050377, -0.06884662806987762, -0.15977342426776886, 0.19625350832939148, -0.0000703775804140605, 0.02235056273639202, -0.1642960011959076, -0.027515089139342308, 0.06703758239746094, 0.22306792438030243, -0.008556382730603218, -0.1406276673078537, 0.13140343129634857, 0.0019057850586250424, 0.17373234033584595, 0.10692707449197769, 0.07824007421731949, 0.1254134625196457, -0.23059727251529694, -0.03217637166380882, -0.051271505653858185, 0.23472024500370026, 0.10771092772483826, 0.11375592648983002, 0.05587444826960564, 0.1620064079761505, 0.1863187998533249, 0.10430966317653656, 0.11076770722866058, 0.06015878915786743, 0.014716721139848232, -0.0008718164172023535, 0.03130233287811279, 0.07458987087011337, 0.016018718481063843, -0.04245319962501526, 0.07666882872581482, 0.03884720802307129, -0.1325177401304245, 0.00815557036548853, -0.07563862204551697, -0.06784869730472565, -0.04134263098239899, -0.20905010402202606, -0.13091132044792175, -0.08730562776327133, -0.12490787357091904, 0.11121147871017456, 0.20502062141895294, 0.06980985403060913, 0.02910652570426464, 0.052334632724523544, -0.0839013084769249, 0.18826419115066528, -0.12972186505794525, 0.06406679004430771, 0.0496428906917572, 0.11024311929941177, 0.11881464719772339, 0.07614471763372421, -0.04241548106074333, 0.3726765513420105, -0.16547389328479767, -0.08193688839673996, 0.044079121202230453, -0.09181532263755798, -0.2122068852186203, 0.0022895627189427614, 0.006963071413338184, -0.051561497151851654, -0.07682441920042038, -0.1361217200756073, -0.013968080282211304, -0.015536287799477577, -0.15733647346496582, -0.10247558355331421, 0.004954219795763493, -0.14118130505084991, -0.1792037934064865, 0.07995519042015076, -0.026967359706759453, 0.020973090082406998, 0.06403492391109467, 0.044394876807928085, 0.09545678645372391, -0.10859108716249466, -0.0812387615442276, -0.08927825838327408, 0.16471664607524872, -0.08929898589849472, 0.09270055592060089, 0.28596606850624084, -0.2587449252605438, -0.0012765461578965187, 0.12943747639656067, -0.060112446546554565, 0.07634325325489044, -0.10052688419818878, -0.031851690262556076, 0.10589123517274857, 0.044348426163196564, 0.06042709946632385, -0.02797975204885006, -0.003048744285479188, -0.04383555427193642, 0.14418715238571167, 0.05176885426044464, 0.07362959533929825, -0.12599118053913116, -0.04329347983002663, 0.1521403044462204, 0.04758073017001152, -0.07411568611860275, -0.13859127461910248, -0.01138942502439022, 0.17624305188655853, 0.02659897319972515, 0.028690185397863388, -0.07699887454509735, 0.14701707661151886, 0.041822269558906555, -0.010874162428081036, 0.04168030619621277, 0.05565604194998741, 0.21948935091495514, 0.035772766917943954, -0.07007695734500885, -0.006938350386917591, -0.07395381480455399, 0.07868120074272156, -0.19063501060009003, 0.07115229964256287, 0.02557152323424816, 0.06161175295710564, -0.04973883926868439, -0.030063599348068237, 0.02852911688387394, -0.12219280004501343, 0.011981180869042873, 0.2358349710702896, -0.06275571882724762, -0.15307630598545074, 0.017873939126729965, -0.05477118119597435, -0.0068700192496180534, 0.11273519694805145, -0.08952048420906067, 0.06999299675226212, -0.0726136639714241, -0.03552591800689697, 0.13874104619026184, -0.10323192924261093, 0.05803524702787399, 0.2241308093070984, -0.19695979356765747, -0.0373118557035923, 0.038246627897024155, 0.19474908709526062, -0.04994777590036392, 0.007888834923505783, 0.010424052365124226, 0.21211156249046326, -0.24487531185150146, 0.08154714107513428, 0.031757671386003494, -0.059645023196935654, -0.1585872322320938, -0.010370200499892235, 0.14521843194961548, 0.02049977146089077, 0.1388063132762909, 0.06341712921857834, -0.08530773967504501, 0.03342514485120773, -0.16865983605384827, -0.04968193545937538, 0.14798498153686523, -0.07404765486717224, 0.060429465025663376, -0.020163316279649734, -2.524913376424302e-32, -0.06790033727884293, 0.05641354247927666, -0.1441403329372406, -0.007776341866701841, -0.20576834678649902, 0.07390645891427994, -0.05028577148914337, -0.04721935838460922, -0.10337978601455688, -0.11494795233011246, -0.0918964222073555, -0.026859475299715996, 0.06840229034423828, 0.011411391198635101, -0.25336453318595886, -0.05601857230067253, -0.11715581268072128, -0.15474583208560944, -0.09209690243005753, 0.19261765480041504, 0.08553533256053925, 0.09805409610271454, -0.08550362288951874, -0.08041435480117798, 0.03666713461279869, -0.06903113424777985, 0.04140949621796608, -0.13061745464801788, -0.043570563197135925, 0.006482413504272699, -0.05330350622534752, 0.06227830424904823, -0.04480048269033432, -0.08543308079242706, 0.021632539108395576, 0.016033951193094254, -0.2537766396999359, -0.11238561570644379, 0.054879169911146164, -0.025750573724508286, -0.0021963799372315407, 0.10989036411046982, -0.07028328627347946, -0.0802474096417427, 0.007408859673887491, -0.04663348197937012, 0.0646727979183197, 0.023204771801829338, -0.09043817222118378, -0.041489701718091965, -0.01920122653245926, 0.014947028830647469, 0.10004095733165741, 0.004443425685167313, 0.061353664845228195, -0.03493606671690941, 0.07812488079071045, 0.153036430478096, -0.08945203572511673, -0.036382388323545456, -0.04270530492067337, -0.11964108049869537, -0.09154554456472397, -0.05269800126552582, 0.22161002457141876, -0.04083351790904999, 0.35887250304222107, 0.009141294285655022, -0.03001410700380802, -0.11918990314006805, 0.10925198346376419, 0.14873705804347992, -0.11508163064718246, -0.04751451313495636, -0.15137965977191925, -0.0730225220322609, -0.07104353606700897, -0.09244516491889954, 0.08515281975269318, -0.0970497652888298, 0.13897082209587097, -0.11554111540317535, -0.06363824754953384, 0.05301005765795708, -0.030760521069169044, 0.05343329906463623, -0.047591518610715866, -0.026898756623268127, -0.18642181158065796, -0.042824503034353256, -0.024604083970189095, -0.0958663746714592, -0.0892765149474144, -0.03860871121287346, -0.05751485750079155, 0.036293432116508484, -0.044800225645303726, 0.024343255907297134, -0.046404555439949036, 0.210484117269516, -0.08506907522678375, -0.05960965156555176, 0.2606361508369446, -0.08348719775676727, 0.042591892182826996, 0.04586762934923172, 0.15386563539505005, 0.005960937589406967, -0.10455026477575302, -0.018855702131986618, 0.043553076684474945, 0.17992016673088074, 0.10236304253339767, 0.14915800094604492, 0.14729227125644684, 0.043800901621580124, -0.07608522474765778, -0.05647038668394089, 0.09666065126657486, 0.15757997334003448, -0.1974305361509323, -0.08464224636554718, -0.013938609510660172, 0.007137560285627842, -0.06815699487924576, 0.16431699693202972, -0.15162189304828644, 0.00735720107331872, -0.012857817113399506, -0.025354523211717606, 0.02221699245274067, -0.07919686287641525, 7.587090067318059e-7, -0.2032671719789505, 0.12070982158184052, 0.043903641402721405, -0.10761923342943192, 0.03530091047286987, -0.015795335173606873, -0.29671192169189453, 0.050774868577718735, 0.12086925655603409, 0.17614781856536865, 0.20993581414222717, -0.0035095668863505125, -0.11057113856077194, -0.07811175286769867, 0.0219135582447052, -0.1491219848394394, -0.06312994658946991, 0.004526670090854168, -0.017052069306373596, 0.09717446565628052, 0.07910017669200897, 0.16260047256946564, -0.016065435484051704, 0.003219697391614318, -0.02059001289308071, -0.06209593266248703, 0.04422536492347717, -0.06882422417402267, 0.1468069702386856, -0.03963533788919449, -0.04032258316874504, 0.09454002976417542, -0.08950769901275635, 0.08956786245107651, 0.07939764857292175, 0.018764914944767952, -0.17404672503471375, -0.17833822965621948, 0.11885103583335876, -0.04962560534477234, 0.12624523043632507, 0.09535359591245651, -0.020519908517599106, -0.1715461015701294, 0.08724600821733475, 0.09547031670808792, -0.07592951506376266, -0.03341002017259598, 0.016952214762568474, 0.053913719952106476, 0.05867515131831169, 0.013519707135856152, 0.1518251746892929, 0.19865618646144867, 0.09903872758150101, 0.027166452258825302, -0.058701660484075546, -0.1814524382352829, 0.10895136743783951, -0.11939366906881332, -0.0969531312584877, -0.09717421978712082, 0.12022894620895386, 0.11741054803133011, -0.0025394076947122812, -0.06614577025175095, 0.052073296159505844, 1.0992284150941817e-34, 0.007490700576454401, -0.02641557902097702, -0.001060834270901978, -0.17208053171634674, 0.012048502452671528, -0.0542694553732872, 0.052981384098529816, -0.03707624226808548, 0.0569162592291832, -0.170066699385643, -0.034423232078552246 ]
https://github.com/huggingface/datasets/issues/6252
exif_transpose not done to Image (PIL problem)
Indeed, it makes sense to do this by default. In the meantime, you can use `.with_transform` to transpose the images when accessing them: ```python import PIL.ImageOps def exif_transpose_transform(batch): batch["image"] = [PIL.ImageOps.exif_transpose(image) for image in batch["image"]] return batch dataset = dataset.with_transform(exif_transpose_transform) ```
### Feature request I noticed that some of my images loaded using PIL have some metadata related to exif that can rotate them when loading. Since the dataset.features.Image uses PIL for loading, the loaded image may be rotated (width and height will be inverted) thus for tasks as object detection and layoutLM this can create some inconsistencies (between input bboxes and input images). For now there is no option in datasets.features.Image to specify that. We need to do the following when preparing examples (when preparing images for training, test or inference): ``` from PIL import Image, ImageOps pil = ImageOps.exif_transpose(pil) ``` reference: https://stackoverflow.com/a/63950647/5720150 Is it possible to add this by default to the datasets.feature.Image ? or to add the option to do the ImageOps.exif_transpose? Thank you ### Motivation Prevent having inverted data related to exif metadata that may affect object detection tasks ### Your contribution Changing in datasets.featrues.Image I can help with that.
41
exif_transpose not done to Image (PIL problem) ### Feature request I noticed that some of my images loaded using PIL have some metadata related to exif that can rotate them when loading. Since the dataset.features.Image uses PIL for loading, the loaded image may be rotated (width and height will be inverted) thus for tasks as object detection and layoutLM this can create some inconsistencies (between input bboxes and input images). For now there is no option in datasets.features.Image to specify that. We need to do the following when preparing examples (when preparing images for training, test or inference): ``` from PIL import Image, ImageOps pil = ImageOps.exif_transpose(pil) ``` reference: https://stackoverflow.com/a/63950647/5720150 Is it possible to add this by default to the datasets.feature.Image ? or to add the option to do the ImageOps.exif_transpose? Thank you ### Motivation Prevent having inverted data related to exif metadata that may affect object detection tasks ### Your contribution Changing in datasets.featrues.Image I can help with that. Indeed, it makes sense to do this by default. In the meantime, you can use `.with_transform` to transpose the images when accessing them: ```python import PIL.ImageOps def exif_transpose_transform(batch): batch["image"] = [PIL.ImageOps.exif_transpose(image) for image in batch["image"]] return batch dataset = dataset.with_transform(exif_transpose_transform) ```
[ -0.14003179967403412, 0.0061479355208575726, -0.01984780840575695, 0.04482210427522659, -0.026597902178764343, -0.05096003785729408, 0.20965346693992615, -0.12186672538518906, -0.12693364918231964, 0.02151881344616413, 0.08630366623401642, 0.0297489445656538, -0.04081185907125473, 0.040505267679691315, -0.0677558183670044, 0.04474152624607086, -0.14594130218029022, -0.03861021623015404, 0.0007720220019109547, 0.012499266304075718, -0.14152072370052338, 0.013548800721764565, 0.00508691044524312, -0.110214464366436, 0.11357443779706955, 0.04859234765172005, -0.09425239264965057, -0.04645062983036041, -0.1831924021244049, 0.010024098679423332, -0.2526871860027313, 0.17322570085525513, 0.02371150255203247, -0.04881047457456589, 0.000006064927674742648, -0.05258038267493248, 0.0766509622335434, 0.06603728979825974, 0.0730598196387291, 0.03147989884018898, -0.017182819545269012, -0.06369654089212418, -0.006853008177131414, -0.04180924594402313, -0.04867739975452423, -0.15994903445243835, 0.19746673107147217, 0.06874114274978638, 0.06612052768468857, 0.025010019540786743, -0.010255837813019753, 0.12697866559028625, 0.12079055607318878, -0.054215386509895325, 0.1425650715827942, 0.0872870534658432, -0.11097713559865952, -0.1293015331029892, -0.26652297377586365, -0.0034645977430045605, -0.04427049681544304, 0.05663624405860901, -0.017839772626757622, 0.03530913218855858, -0.1622142642736435, 0.01808275282382965, 0.06944738328456879, -0.05677744373679161, 0.03800288587808609, 0.06525059789419174, -0.009833869524300098, 0.01252960879355669, -0.057816281914711, -0.06798402220010757, 0.05885172635316849, -0.1857687532901764, 0.04115409776568413, 0.09677775204181671, 0.045657455921173096, -0.09200192987918854, 0.0465022511780262, 0.01820688135921955, 0.02404850721359253, -0.021998880431056023, -0.26122117042541504, 0.14381097257137299, -0.05954158306121826, 0.08478417992591858, -0.028523804619908333, -0.10365202277898788, 0.2317504584789276, 0.20469145476818085, 0.02966301143169403, -0.1111016646027565, 0.11255558580160141, 0.11016301810741425, 0.19117380678653717, -0.1722852736711502, -0.08117356151342392, -0.0206211619079113, -0.04354425519704819, -0.06582098454236984, 0.029183682054281235, 0.09362474828958511, 0.13690565526485443, 0.07322114706039429, 0.032949045300483704, 0.13466757535934448, 0.05386226624250412, -0.004495532251894474, 0.01562817022204399, 0.021737856790423393, -0.0028004145715385675, -0.019960589706897736, 0.07114464044570923, -0.03744690492749214, 0.18361392617225647, 0.1887943297624588, -0.15489353239536285, -0.1740371733903885, 0.06810132414102554, 0.10524419695138931, -0.09577686339616776, -0.11047801375389099, 0.0619768463075161, 0.2715121805667877, 0.18397988379001617, 0.03923293948173523, 0.015570242889225483, 0.09335074573755264, 0.14657403528690338, 0.08204948157072067, 0.11856593936681747, -0.13428717851638794, -0.017686942592263222, -0.10347841680049896, 0.0842820554971695, -0.06038225069642067, 0.030655166134238243, 0.2301948368549347, -0.11202248185873032, -0.009737204760313034, 0.2049548625946045, -0.11002308130264282, -0.10438010841608047, 0.0077844955958426, 0.06592795252799988, 0.008358195424079895, -0.06843184679746628, 0.049914661794900894, -0.18815837800502777, 0.2023371160030365, 0.032867323607206345, -0.03709845244884491, -0.07512382417917252, -0.11813010275363922, -0.1677837073802948, -0.09481535106897354, -0.12165848910808563, -0.14007948338985443, 0.12345893681049347, -0.06508195400238037, -0.007929688319563866, 0.040368352085351944, 0.09555581212043762, -0.027048995718359947, -0.02376994490623474, 0.0881028026342392, -0.069108746945858, -0.03759293630719185, 0.05521233752369881, -0.11311574280261993, 0.11149967461824417, 0.11511752009391785, -0.0721055343747139, -0.08359259366989136, -0.24083369970321655, -0.06548909097909927, -0.12367285788059235, -0.09320295602083206, -0.027374347671866417, -0.07821967452764511, -0.12567508220672607, 0.05699119716882706, 0.1407308429479599, 0.0950070321559906, -0.19478124380111694, 0.19597427546977997, -0.07126785814762115, 0.04331296309828758, 0.09317284822463989, -0.09234895557165146, -0.07352179288864136, 0.10137195885181427, -0.004726529587060213, 0.0667041540145874, -0.01297892164438963, -0.003717768006026745, -0.013356992043554783, -0.19357270002365112, -0.025048844516277313, -0.04952913522720337, -0.12414796650409698, -0.005258110351860523, 0.05694210156798363, 0.16537517309188843, -0.18076281249523163, 0.024151833727955818, 0.06949230283498764, 0.06842127442359924, -0.029732828959822655, 0.14584070444107056, -0.010775686241686344, 0.022021086886525154, -0.012698212638497353, -0.03868107870221138, -0.015920741483569145, 0.14335323870182037, -0.09551792591810226, -0.09232105314731598, -0.025457480922341347, -0.0394744835793972, -0.149184450507164, -0.04813455417752266, -0.00891178846359253, -0.1374957263469696, 0.11709251999855042, 0.13262611627578735, 0.016970273107290268, -0.07233080267906189, -0.03743711858987808, -0.053294457495212555, 0.10503873229026794, 0.0786522850394249, 0.042256828397512436, 0.13172060251235962, 0.0735626220703125, -0.21713784337043762, 0.06418564170598984, -0.1565403789281845, -0.11096560209989548, -0.028864353895187378, 0.08222910016775131, -0.019929375499486923, 0.043623048812150955, -0.06028803437948227, -0.07234708964824677, -0.15660813450813293, 0.0674402192234993, -0.06069999188184738, 0.03346719592809677, -0.05000224709510803, -0.23759283125400543, -0.00381833896972239, -0.10042464733123779, -0.10410253703594208, -0.1296481341123581, 0.03027156926691532, 0.13870655000209808, -0.04429183900356293, 0.28899043798446655, 0.08387840539216995, -0.08761648088693619, 0.0887020155787468, 0.2162572145462036, -0.10678424686193466, -0.00634035374969244, -0.1180860847234726, 0.08893552422523499, 0.10103047639131546, -0.014048568904399872, -0.06193462014198303, -0.033618148416280746, 0.05295766144990921, 0.012689298018813133, -0.3572959005832672, -0.027898281812667847, -0.0036937720142304897, -0.10848965495824814, 0.1549748033285141, -0.13861671090126038, -0.046449191868305206, 0.21875159442424774, 0.06385263800621033, 0.10737892240285873, 0.007452209014445543, -0.2313678115606308, -0.0023424606770277023, 0.02911616675555706, 0.018028685823082924, 0.14235930144786835, -0.15511661767959595, 0.019498180598020554, 0.09749021381139755, -0.10451512038707733, 0.09051963686943054, 0.047842156141996384, 0.07878373563289642, 0.09998694062232971, -0.1591329723596573, -0.2980891168117523, 0.043159063905477524, -0.027474364265799522, 0.02578073926270008, -0.06987060606479645, -0.05638384073972702, 0.2018858641386032, -0.003396648680791259, -0.07315099239349365, -0.19231468439102173, -0.19422732293605804, 0.08161903917789459, -0.018966179341077805, 0.015210703946650028, -0.22489407658576965, -0.17389987409114838, -0.01962423510849476, -0.030618323013186455, 0.1285015195608139, -0.06122450530529022, -0.04133249446749687, -0.013322131708264351, 0.020305581390857697, -0.08962495625019073, -0.10206255316734314, 0.010953514836728573, -0.0035759038291871548, -0.04136469215154648, -0.0013345403131097555, 0.1295279711484909, 0.03328412026166916, 0.17929081618785858, 0.054585572332143784, -0.1433039754629135, 0.010514551773667336, -0.15031492710113525, 0.04275788366794586, 0.016951652243733406, -0.006190206855535507, 0.010275600478053093, 0.09247943013906479, -0.13375957310199738, 0.009436750784516335, 0.03305373713374138, 0.2512662410736084, -0.18203718960285187, -0.06439761817455292, -0.1008899137377739, -0.04223528131842613, -0.0530015230178833, 0.07202262431383133, -0.07906828075647354, -0.08493021875619888, -0.018956150859594345, -0.017565233632922173, -0.05087481439113617, -0.02837958373129368, -0.26551881432533264, 0.13996979594230652, 0.028524532914161682, -0.032235171645879745, -0.06108115613460541, 0.0550946407020092, -0.0778266191482544, -0.002278307918459177, 0.04637990519404411, 0.04428943619132042, 0.09838318079710007, 0.04172983020544052, -0.041585132479667664, -0.031130101531744003, 0.14514349400997162, -0.12709353864192963, 0.130796417593956, -0.04844526946544647, -0.1640799641609192, -0.16768735647201538, 0.0657363086938858, -0.10137034952640533, 0.030501358211040497, -0.023173466324806213, 0.007455296814441681, -0.09242784976959229, -0.03012283518910408, 0.13858379423618317, 0.09923552721738815, 0.16469156742095947, 0.004152094013988972, -0.10711738467216492, 0.04761630296707153, 0.003605195786803961, -0.0987045094370842, -0.15230248868465424, -0.055695127695798874, -0.05808766186237335, -0.1633586585521698, 0.2816509008407593, 0.0644695982336998, -0.05864495411515236, -0.03551134839653969, 0.015177911147475243, 0.12491855025291443, 0.17824195325374603, -0.07323747128248215, -0.06687354296445847, -0.21446873247623444, 0.14596353471279144, -0.11253156512975693, -0.10020481050014496, -0.14927686750888824, 0.052649106830358505, 0.2388940006494522, -0.16708901524543762, 0.04578753188252449, 0.16521359980106354, 0.02109307423233986, -0.08981149643659592, -0.06638789921998978, 0.01047850213944912, -0.27650365233421326, 0.016204548999667168, -0.14961864054203033, 0.19376543164253235, 0.029120003804564476, -0.05498568341135979, 0.06919367611408234, -0.1546974629163742, -0.007842054590582848, -0.010151860304176807, -0.01278767641633749, -0.038608502596616745, 0.1332959532737732, 0.0358487069606781, 0.04244042560458183, -0.0676875114440918, 0.0466197170317173, 0.11132366210222244, -0.05964561551809311, -0.10461927950382233, 0.05876096338033676, 0.049050815403461456, -0.0575813464820385, 0.2923906445503235, -0.21569816768169403, -0.09873410314321518, 0.006816683802753687, -0.059905536472797394, -0.1035139262676239, 0.010408017784357071, -0.12974588572978973, 0.06508098542690277, -0.020763393491506577, -0.10383154451847076, -0.04799599573016167, 0.21384315192699432, 0.07538481801748276, 0.0022209130693227053, -0.048136379569768906, -0.0342208594083786, 0.08080539107322693, 0.011392919346690178, -0.02605339139699936, -0.03694714978337288, 0.00481930747628212, 0.25900644063949585, -0.04119636118412018, 0.25751927495002747, -0.05871688202023506, 0.08370184153318405, -0.06747062504291534, -0.2904946506023407, 0.12176864594221115, -0.01965155638754368, 0.17035987973213196, 0.03079075738787651, -0.09354222565889359, -0.14633892476558685, 0.07920508086681366, -0.11313512176275253, -0.00020485726417973638, 0.0906902626156807, 0.04494866728782654, -0.12232977896928787, -0.08106803148984909, 0.03288210183382034, 0.10925358533859253, 0.08525479584932327, -0.0022616263013333082, 0.0917106568813324, -0.06226883828639984, 0.08073034137487411, 0.18236345052719116, 0.043273862451314926, 0.08401894569396973, 0.07049919664859772, -0.16788673400878906, 0.05028640106320381, -0.051561351865530014, -0.04869470000267029, 0.03122975118458271, 0.0387045256793499, 0.018231255933642387, 0.1020965725183487, 0.06360236555337906, 0.14226669073104858, -0.06610605865716934, -0.014894424006342888, 0.025531021878123283, -0.009213344193994999, 0.04520430788397789, -0.08757011592388153, 0.1257738471031189, 0.10634228587150574, -0.09744773805141449, -0.048672985285520554, 0.02768167294561863, -0.032003890722990036, -0.027339225634932518, 0.08509333431720734, -0.037710633128881454, 0.027467381209135056, 0.0032433669548481703, 0.019519593566656113, -0.06425010412931442, 0.0847182646393776, -0.011462362483143806, -0.12983918190002441, -0.05009499937295914, 0.013021337799727917, 0.1277088224887848, 0.04447386413812637, 0.043333347886800766, 0.0742078647017479, 0.07853616774082184, 0.06263330578804016, 0.022730443626642227, -0.05155430734157562, -0.08018860965967178, -0.06519051641225815, 0.18593360483646393, -0.05029866471886635, -0.0633232444524765, -0.20284020900726318, 0.12865543365478516, 0.059588685631752014, -0.037400878965854645, -0.05600746348500252, 0.10164991021156311, -0.06372079253196716, 0.0135857705026865, 0.07182079553604126, 0.09412220865488052, 0.10081746429204941, 0.1261325627565384, -0.12448018789291382, -2.527857989773112e-32, -0.06613986194133759, -0.029101885855197906, 0.15036919713020325, 0.1618179827928543, 0.0407697968184948, 0.03551829606294632, 0.19874532520771027, 0.04881583899259567, -0.02124292217195034, -0.051473986357450485, 0.08707156777381897, -0.13028298318386078, 0.019678082317113876, 0.09585119038820267, -0.04476238042116165, -0.0014601489529013634, -0.21047979593276978, 0.036017898470163345, 0.14306560158729553, 0.054299116134643555, 0.108812615275383, 0.06956464052200317, 0.05974612757563591, -0.04884630814194679, -0.0841100886464119, 0.10374243557453156, -0.11132881790399551, -0.09481649100780487, 0.01419769786298275, -0.12468956410884857, 0.174897238612175, -0.17080573737621307, 0.08355594426393509, -0.10470817238092422, -0.07761634141206741, -0.12827356159687042, -0.0621630996465683, 0.1136213093996048, 0.13052621483802795, 0.15724849700927734, -0.09803841263055801, 0.13554005324840546, 0.018828988075256348, -0.10930251330137253, 0.06400935351848602, 0.010270592756569386, 0.10215604305267334, -0.041052352637052536, 0.13576534390449524, 0.09374462813138962, -0.008115410804748535, -0.04713501036167145, 0.056011296808719635, -0.05662280693650246, -0.08558019995689392, -0.13628548383712769, -0.016500364989042282, 0.017354123294353485, -0.059674620628356934, -0.09043814241886139, 0.06579575687646866, -0.052856169641017914, 0.13056640326976776, 0.1194683164358139, 0.015794662758708, -0.21583250164985657, 0.1896192878484726, 0.1806982159614563, 0.20875702798366547, 0.009117652662098408, 0.1984192430973053, 0.18653903901576996, -0.058862242847681046, 0.05234989896416664, 0.06188666447997093, 0.014865966513752937, -0.057994164526462555, 0.01654229313135147, -0.047294240444898605, -0.08555638790130615, 0.05511730536818504, -0.04130256921052933, -0.022084837779402733, -0.009303901344537735, -0.030496759340167046, 0.036195795983076096, -0.022322243079543114, 0.10194773972034454, -0.040560271590948105, 0.17390328645706177, 0.07219528406858444, 0.08900263160467148, -0.024652721360325813, -0.029569191858172417, -0.08711794018745422, 0.015067408792674541, -0.14112800359725952, 0.12041236460208893, -0.1643560230731964, 0.03702007234096527, -0.1379171460866928, -0.032433103770017624, 0.03443825989961624, 0.12772350013256073, 0.103300541639328, 0.19296157360076904, 0.3351220190525055, -0.006040418054908514, -0.0824202299118042, -0.01942153461277485, -0.2353280931711197, -0.08480305969715118, 0.15422579646110535, 0.12781067192554474, -0.0901891216635704, -0.0495685450732708, -0.09761910140514374, 0.040919773280620575, 0.007339684292674065, 0.123918317258358, -0.13319547474384308, -0.14360478520393372, -0.057261474430561066, -0.13917621970176697, -0.027788596227765083, 0.028255846351385117, -0.028874708339571953, -0.20344451069831848, -0.0881619080901146, -0.0019278863910585642, -0.024916233494877815, -0.22086012363433838, 7.440568197125685e-7, -0.013794834725558758, -0.010194065049290657, 0.22006887197494507, 0.03105420060455799, 0.06368640810251236, 0.2724354565143585, -0.3864898979663849, -0.10359968990087509, 0.13359525799751282, 0.1296880841255188, 0.20327647030353546, -0.1564594954252243, -0.09380998462438583, -0.1124887689948082, 0.012834844179451466, 0.029639868065714836, 0.09783944487571716, 0.22034421563148499, -0.16271977126598358, 0.07622261345386505, -0.12100797891616821, 0.1267019808292389, -0.06373277306556702, -0.037819258868694305, 0.19017241895198822, -0.0366661474108696, 0.06649159640073776, -0.18578337132930756, 0.11420140415430069, -0.13768969476222992, -0.050684548914432526, 0.09627927094697952, -0.022424766793847084, -0.015043034218251705, -0.10772247612476349, 0.1320190131664276, -0.19172637164592743, -0.11424751579761505, -0.020412467420101166, -0.07074040174484253, 0.13034090399742126, -0.016469473019242287, 0.0012508351355791092, -0.1682022362947464, 0.008943499065935612, 0.031748611479997635, 0.050687190145254135, -0.10374372452497482, -0.06573952734470367, 0.32019832730293274, 0.07333352416753769, -0.013001589104533195, 0.01580335758626461, 0.16056759655475616, 0.05286869406700134, -0.16457507014274597, -0.17875663936138153, -0.023288466036319733, 0.03788361698389053, 0.01744139939546585, 0.0029038949869573116, -0.05902528017759323, -0.332855761051178, 0.06368760019540787, 0.29094287753105164, 0.1809970587491989, 0.16854266822338104, 1.728040291789852e-34, -0.11003874242305756, 0.12202613055706024, 0.10737535357475281, -0.11053535342216492, 0.0478583425283432, -0.02022879384458065, 0.17907322943210602, -0.020939309149980545, -0.14307734370231628, 0.02108101174235344, 0.04698072001338005 ]
https://github.com/huggingface/datasets/issues/6252
exif_transpose not done to Image (PIL problem)
This operation sets some `Image` attributes to `None` (`.format`, `.filename`, etc.), causing our tests to fail, so I think we should wait for Datasets 3.0 to make this change. In version 3.0, storing image paths will be replaced by embedding image bytes, so there will be fewer instances where we use the `.filename` attribute.
### Feature request I noticed that some of my images loaded using PIL have some metadata related to exif that can rotate them when loading. Since the dataset.features.Image uses PIL for loading, the loaded image may be rotated (width and height will be inverted) thus for tasks as object detection and layoutLM this can create some inconsistencies (between input bboxes and input images). For now there is no option in datasets.features.Image to specify that. We need to do the following when preparing examples (when preparing images for training, test or inference): ``` from PIL import Image, ImageOps pil = ImageOps.exif_transpose(pil) ``` reference: https://stackoverflow.com/a/63950647/5720150 Is it possible to add this by default to the datasets.feature.Image ? or to add the option to do the ImageOps.exif_transpose? Thank you ### Motivation Prevent having inverted data related to exif metadata that may affect object detection tasks ### Your contribution Changing in datasets.featrues.Image I can help with that.
54
exif_transpose not done to Image (PIL problem) ### Feature request I noticed that some of my images loaded using PIL have some metadata related to exif that can rotate them when loading. Since the dataset.features.Image uses PIL for loading, the loaded image may be rotated (width and height will be inverted) thus for tasks as object detection and layoutLM this can create some inconsistencies (between input bboxes and input images). For now there is no option in datasets.features.Image to specify that. We need to do the following when preparing examples (when preparing images for training, test or inference): ``` from PIL import Image, ImageOps pil = ImageOps.exif_transpose(pil) ``` reference: https://stackoverflow.com/a/63950647/5720150 Is it possible to add this by default to the datasets.feature.Image ? or to add the option to do the ImageOps.exif_transpose? Thank you ### Motivation Prevent having inverted data related to exif metadata that may affect object detection tasks ### Your contribution Changing in datasets.featrues.Image I can help with that. This operation sets some `Image` attributes to `None` (`.format`, `.filename`, etc.), causing our tests to fail, so I think we should wait for Datasets 3.0 to make this change. In version 3.0, storing image paths will be replaced by embedding image bytes, so there will be fewer instances where we use the `.filename` attribute.
[ -0.12991853058338165, 0.027721600607037544, -0.030439389869570732, 0.032463133335113525, -0.025869222357869148, -0.02827543579041958, 0.23465396463871002, -0.07283186167478561, -0.1522717922925949, 0.0647430568933487, 0.11397197842597961, 0.032942064106464386, -0.06165619567036629, 0.07055285573005676, -0.08998987823724747, 0.029676320031285286, -0.10528920590877533, -0.03125381097197533, 0.027426134794950485, 0.02279614843428135, -0.1429181843996048, 0.006791767198592424, 0.030072003602981567, -0.10883895307779312, 0.11707692593336105, 0.06500786542892456, -0.06991931051015854, -0.027004897594451904, -0.23400554060935974, -0.035669077187776566, -0.25943997502326965, 0.18393868207931519, 0.03874507546424866, -0.006309897173196077, 0.000005890793545404449, -0.05353543534874916, 0.07223155349493027, 0.08674702793359756, 0.053318411111831665, -0.016229523345828056, -0.024548254907131195, -0.04070001468062401, 0.016221672296524048, -0.059312645345926285, -0.03580155596137047, -0.14506201446056366, 0.17323699593544006, 0.0970345064997673, 0.06743934005498886, 0.06763795018196106, -0.002638674108311534, 0.1388968527317047, 0.09021042287349701, -0.07763134688138962, 0.19257093966007233, 0.12535306811332703, -0.16200374066829681, -0.0880090594291687, -0.28736409544944763, 0.03365092724561691, -0.010114474222064018, 0.0868510976433754, -0.006175445392727852, 0.05803892761468887, -0.16598480939865112, 0.016850359737873077, 0.039037950336933136, -0.06308924406766891, 0.03956497833132744, 0.07967914640903473, -0.04207228124141693, 0.035983096808195114, -0.06547663360834122, -0.03323455527424812, 0.06355290859937668, -0.2080657184123993, 0.05838466063141823, 0.05868123471736908, 0.05931404232978821, -0.10894861072301865, 0.05288929119706154, 0.05016807094216347, 0.014699695631861687, -0.043745338916778564, -0.21730370819568634, 0.08958812057971954, -0.05745619907975197, 0.08095592260360718, -0.01665656827390194, -0.101409412920475, 0.2262921929359436, 0.22932034730911255, 0.014736190438270569, -0.1326415091753006, 0.14018066227436066, 0.0776054859161377, 0.16501401364803314, -0.1467888206243515, -0.11215854436159134, -0.04307364299893379, -0.038477472960948944, -0.07098102569580078, 0.05113236978650093, 0.07912218570709229, 0.11461164802312851, 0.06391093134880066, 0.07485335320234299, 0.11357185989618301, 0.0700996145606041, 0.020783381536602974, -0.006318386644124985, 0.05250486359000206, -0.023550136014819145, 0.018782109022140503, 0.01250886358320713, -0.06422268599271774, 0.19995270669460297, 0.16999119520187378, -0.14082179963588715, -0.181658536195755, 0.059063371270895004, 0.12419930845499039, -0.12857620418071747, -0.06225107982754707, 0.04479974880814552, 0.3143385052680969, 0.2135830968618393, 0.049502067267894745, 0.02115646004676819, 0.07025133818387985, 0.14548663794994354, 0.09705284237861633, 0.11762360483407974, -0.1147007942199707, 0.007552667986601591, -0.07903215289115906, 0.08566290140151978, -0.1192406415939331, 0.05997732654213905, 0.19854576885700226, -0.09652795642614365, -0.021160170435905457, 0.24801407754421234, -0.13139867782592773, -0.10186567902565002, -0.004566953517496586, 0.044353388249874115, -0.02817223221063614, -0.06309248507022858, 0.059062033891677856, -0.19259198009967804, 0.23031428456306458, 0.01249416172504425, -0.07277357578277588, -0.08346737176179886, -0.09407129138708115, -0.1503758728504181, -0.13301973044872284, -0.09458373486995697, -0.15633466839790344, 0.10871320962905884, -0.06893756240606308, 0.009874237701296806, 0.022949889302253723, 0.112751804292202, 0.003738780040293932, 0.0035732542164623737, 0.07621386647224426, -0.0630636140704155, -0.02095465548336506, 0.037276290357112885, -0.12014216929674149, 0.1439586877822876, 0.021366862580180168, -0.07013271003961563, -0.07582598924636841, -0.2566898465156555, -0.06136564537882805, -0.12704478204250336, -0.0882997140288353, -0.0249955877661705, -0.10345513373613358, -0.101084403693676, 0.000035437813494354486, 0.09374493360519409, 0.08366929739713669, -0.1928844004869461, 0.19584378600120544, -0.08939279615879059, 0.027230223640799522, 0.06434918195009232, -0.07446212321519852, -0.06228319928050041, 0.07033363729715347, -0.020970800891518593, 0.03675990179181099, -0.04476208612322807, -0.020456941798329353, -0.013382223434746265, -0.24691028892993927, -0.023301858454942703, -0.05593593418598175, -0.1169181689620018, 0.007004083599895239, 0.042287807911634445, 0.16863369941711426, -0.1999310851097107, 0.034163977950811386, 0.07028330862522125, 0.05441870167851448, -0.047068774700164795, 0.13647034764289856, 0.022539902478456497, 0.042164355516433716, -0.007357428781688213, -0.03683852031826973, -0.018365252763032913, 0.14688625931739807, -0.08417469263076782, -0.08954160660505295, -0.013716721907258034, -0.01812845841050148, -0.1473231166601181, -0.062431760132312775, 0.01386958546936512, -0.12855899333953857, 0.10874642431735992, 0.11544190347194672, 0.03806393966078758, -0.04978340491652489, -0.04801272600889206, -0.06570655852556229, 0.09438184648752213, 0.07602918148040771, 0.034417666494846344, 0.13102638721466064, 0.08460862934589386, -0.22048766911029816, 0.044345129281282425, -0.14077265560626984, -0.12180871516466141, -0.05899423733353615, 0.0724024772644043, -0.03165094554424286, 0.041572149842977524, -0.09997688233852386, -0.10166812688112259, -0.10128630697727203, 0.06413782387971878, -0.035263657569885254, 0.04715242609381676, -0.04511605575680733, -0.2389410436153412, -0.018025454133749008, -0.07718408852815628, -0.07793448120355606, -0.13497841358184814, 0.011641268618404865, 0.12418201565742493, -0.04624694958329201, 0.292165607213974, 0.0936216339468956, -0.12863808870315552, 0.0868643969297409, 0.23448650538921356, -0.09091874957084656, 0.004128140863031149, -0.07293329387903214, 0.09932234138250351, 0.11670060455799103, 0.03849209472537041, -0.0860402062535286, -0.015931250527501106, 0.05287279933691025, 0.007626797072589397, -0.3463594615459442, -0.029312193393707275, 0.042961299419403076, -0.11849933117628098, 0.13254952430725098, -0.1517152637243271, -0.028717374429106712, 0.2466217428445816, 0.03302298113703728, 0.08734558522701263, 0.02876228839159012, -0.2285638451576233, 0.007294368930160999, 0.013842703774571419, 0.03567720577120781, 0.08522269129753113, -0.10142211616039276, 0.0042820880189538, 0.10008277744054794, -0.15137900412082672, 0.09941806644201279, 0.07108038663864136, -0.01829742081463337, 0.06156749650835991, -0.14497828483581543, -0.2749611735343933, 0.043633606284856796, -0.015573518350720406, 0.04456840828061104, -0.09705506265163422, -0.03595653548836708, 0.20099765062332153, -0.028510533273220062, -0.043796759098768234, -0.19261693954467773, -0.192221000790596, 0.08025863766670227, -0.07427109032869339, 0.02576323412358761, -0.21825629472732544, -0.19235563278198242, 0.016847603023052216, -0.011902004480361938, 0.1687229573726654, -0.077541783452034, -0.030749810859560966, -0.024362726137042046, 0.03969397023320198, -0.16332858800888062, -0.06074484437704086, 0.020506298169493675, -0.05524339899420738, -0.029424550011754036, 0.06714185327291489, 0.09746358543634415, 0.012644845061004162, 0.20658740401268005, 0.04834949970245361, -0.12739335000514984, 0.021029239520430565, -0.1685396283864975, 0.05186878517270088, 0.019350918009877205, -0.01036356296390295, 0.022247958928346634, 0.07879682630300522, -0.13502328097820282, 0.040671978145837784, 0.010826748795807362, 0.2726103961467743, -0.14730028808116913, -0.11828642338514328, -0.07769527286291122, -0.05137059465050697, -0.031589847058057785, 0.07985186576843262, -0.060130637139081955, -0.0982414111495018, -0.010771036148071289, -0.009449310600757599, -0.039415840059518814, -0.07428041100502014, -0.24728383123874664, 0.11308711022138596, 0.05785377323627472, -0.055132970213890076, -0.049828629940748215, 0.04799612984061241, -0.05221079662442207, -0.014270767569541931, 0.08172718435525894, 0.04807383194565773, 0.09719178825616837, 0.026777902618050575, -0.03856026753783226, -0.047269776463508606, 0.12557452917099, -0.14705246686935425, 0.13650792837142944, -0.059568073600530624, -0.1328658163547516, -0.16499248147010803, 0.06486979126930237, -0.05699850618839264, 0.05737391486763954, -0.019949594512581825, -0.032597776502370834, -0.10576938092708588, -0.014526556245982647, 0.10721214860677719, 0.11571645736694336, 0.159925177693367, 0.01322218868881464, -0.11353742331266403, 0.0638771653175354, 0.006043236702680588, -0.0830860286951065, -0.17890918254852295, -0.0842103436589241, -0.07307812571525574, -0.1442960649728775, 0.29945212602615356, 0.04053296148777008, -0.05231170728802681, -0.0025828813668340445, 0.059624455869197845, 0.14255283772945404, 0.1637399047613144, -0.07152572274208069, -0.0547737181186676, -0.21573582291603088, 0.12956568598747253, -0.09163804352283478, -0.08431800454854965, -0.1798384189605713, 0.02666654996573925, 0.2494635283946991, -0.13707707822322845, 0.03416825085878372, 0.19571731984615326, 0.036065228283405304, -0.08816983550786972, -0.05836882442235947, -0.015285865403711796, -0.26680630445480347, 0.019290724769234657, -0.14004182815551758, 0.18421168625354767, -0.015585013665258884, -0.05144582316279411, 0.06381146609783173, -0.10120236873626709, -0.023190630599856377, -0.0233834870159626, -0.02968912199139595, 0.006448022089898586, 0.12944087386131287, 0.03475315868854523, 0.07370030134916306, -0.08533422648906708, 0.004110249690711498, 0.12257178872823715, -0.06366199254989624, -0.08437851071357727, 0.04138650745153427, 0.04751010611653328, -0.03212017938494682, 0.32831600308418274, -0.2193676382303238, -0.09183882921934128, -0.04266205430030823, -0.03015436977148056, -0.1264706254005432, 0.039555273950099945, -0.13103534281253815, 0.02275426685810089, -0.022677885368466377, -0.07694856077432632, -0.0838550254702568, 0.2270762175321579, 0.07954412698745728, -0.02116544358432293, -0.0578111968934536, -0.046730902045965195, 0.06879684329032898, 0.05976313725113869, -0.024108996614813805, -0.05379059910774231, 0.02512742020189762, 0.2736164629459381, -0.04864881932735443, 0.2355465441942215, -0.05134262517094612, 0.07363595068454742, -0.07876093685626984, -0.2802563011646271, 0.14127404987812042, -0.019614562392234802, 0.18401403725147247, 0.028198977932333946, -0.08366753906011581, -0.16292139887809753, 0.0918685793876648, -0.1144522875547409, -0.017981983721256256, 0.12807504832744598, 0.022005556151270866, -0.11634889990091324, -0.11636555194854736, 0.036950092762708664, 0.12665149569511414, 0.040428441017866135, 0.0036740070208907127, 0.05958876386284828, -0.08983185142278671, 0.06779414415359497, 0.22170740365982056, 0.061993557959795, 0.0875093936920166, 0.06612924486398697, -0.17171119153499603, -0.012513929046690464, -0.04956666752696037, 0.002191962441429496, 0.04574126750230789, 0.02687615528702736, -0.017401300370693207, 0.10898534208536148, 0.026581747457385063, 0.12504832446575165, -0.05693810433149338, -0.05442395806312561, 0.03238283097743988, -0.025106601417064667, 0.04562033712863922, -0.09748328477144241, 0.11284299194812775, 0.09849286079406738, -0.06991063803434372, -0.06156365945935249, 0.07671071588993073, -0.060121066868305206, -0.03925924003124237, 0.08276986330747604, -0.053229302167892456, 0.004240038339048624, 0.05863668769598007, 0.04509853944182396, -0.07567360997200012, 0.052721843123435974, -0.022612450644373894, -0.12783554196357727, -0.051010023802518845, -0.010178240947425365, 0.13550329208374023, 0.07917749136686325, 0.0859280377626419, 0.09779717773199081, 0.08397301286458969, 0.04412897676229477, 0.023463904857635498, -0.06348274648189545, -0.07239895313978195, -0.04061148315668106, 0.14999161660671234, -0.08094749599695206, -0.072561115026474, -0.23032425343990326, 0.15205790102481842, 0.0993458554148674, -0.040744297206401825, -0.05526311695575714, 0.08955661207437515, -0.03927503526210785, -0.010271837934851646, 0.11152380704879761, 0.07128395885229111, 0.049690231680870056, 0.09703213721513748, -0.1477814018726349, -2.550803639501163e-32, -0.06844694912433624, -0.018529651686549187, 0.15662741661071777, 0.11183460801839828, 0.01184223871678114, 0.05758381262421608, 0.14508992433547974, 0.0782170444726944, 0.018444884568452835, -0.058839160948991776, 0.07560840994119644, -0.1373596042394638, 0.026399975642561913, 0.09860087186098099, -0.059633802622556686, 0.0014837851049378514, -0.19198130071163177, 0.03778325766324997, 0.09251779317855835, 0.0473083034157753, 0.12291602045297623, 0.042663414031267166, 0.07022873312234879, -0.05997220054268837, -0.07583878189325333, 0.13728110492229462, -0.13262939453125, -0.06830807030200958, 0.016134915873408318, -0.13486720621585846, 0.16703960299491882, -0.18274162709712982, 0.09584935754537582, -0.10037758946418762, -0.03284554183483124, -0.1365051418542862, -0.09682166576385498, 0.10303911566734314, 0.11563579738140106, 0.11231930553913116, -0.08974118530750275, 0.15172170102596283, 0.0378977470099926, -0.12498147040605545, 0.09167008101940155, 0.045777466148138046, 0.08445119112730026, -0.02498934417963028, 0.1550084948539734, 0.11087246239185333, -0.04471774399280548, -0.05033322051167488, 0.03650498017668724, -0.019122879952192307, -0.07309316098690033, -0.09102923423051834, 0.012575555592775345, -0.024632249027490616, -0.04298275709152222, -0.07742518931627274, 0.05483975633978844, -0.002271123928949237, 0.17008225619792938, 0.09165450185537338, 0.010406465269625187, -0.2286985069513321, 0.18486450612545013, 0.1847834289073944, 0.2045004665851593, 0.007283264771103859, 0.21798811852931976, 0.20164261758327484, 0.0063414243049919605, 0.03198489919304848, 0.012298041023314, 0.02868368662893772, -0.03910975530743599, 0.04159766435623169, 0.022782539948821068, -0.1316327601671219, 0.03945111855864525, -0.06541727483272552, -0.05179978907108307, 0.009342683479189873, -0.03894194960594177, 0.018827347084879875, -0.033971965312957764, 0.06911357492208481, -0.03365255147218704, 0.13761597871780396, 0.07456754893064499, 0.11147621273994446, 0.010489176027476788, 0.002762549091130495, -0.07434967905282974, 0.00851263664662838, -0.15285886824131012, 0.12059624493122101, -0.1842336505651474, 0.029216980561614037, -0.09494682401418686, -0.07147996127605438, 0.04585127532482147, 0.12152811884880066, 0.1220354288816452, 0.13359799981117249, 0.3242204189300537, -0.017202608287334442, -0.09652993083000183, -0.02105209417641163, -0.24012435972690582, -0.07498706132173538, 0.13152295351028442, 0.15240666270256042, -0.08463701605796814, -0.0454142764210701, -0.12272244691848755, -0.004011085256934166, 0.03579557314515114, 0.14602895081043243, -0.10984570533037186, -0.1582736223936081, -0.045768577605485916, -0.11615606397390366, -0.010463867336511612, 0.036731671541929245, -0.06940074265003204, -0.21105362474918365, -0.07530930638313293, -0.008935137651860714, -0.048718471080064774, -0.19998794794082642, 7.449784789059777e-7, -0.039039336144924164, 0.011988802812993526, 0.19754870235919952, 0.03627055510878563, 0.005165010690689087, 0.2860489785671234, -0.3430921137332916, -0.13081878423690796, 0.13888539373874664, 0.1657959520816803, 0.2253994345664978, -0.17275676131248474, -0.11267325282096863, -0.08795313537120819, 0.034033384174108505, 0.010351977311074734, 0.12348435074090958, 0.19117392599582672, -0.17220774292945862, 0.11250295490026474, -0.097625233232975, 0.1528082638978958, -0.04407024011015892, -0.03199543431401253, 0.16479504108428955, -0.011430163867771626, 0.035496342927217484, -0.197624072432518, 0.09646502882242203, -0.12526406347751617, -0.014327911660075188, 0.11048705130815506, -0.048102185130119324, -0.050867367535829544, -0.10077652335166931, 0.11534999310970306, -0.1996271014213562, -0.10678738355636597, -0.012512053363025188, -0.05292472988367081, 0.10094979405403137, 0.0011852618772536516, 0.0023804677184671164, -0.13499948382377625, 0.011162285692989826, 0.05252594128251076, -0.011180120520293713, -0.07207678258419037, -0.07700706273317337, 0.31552425026893616, 0.0701855719089508, -0.0019664443098008633, -0.0030011434573680162, 0.15209172666072845, 0.03410321846604347, -0.17704354226589203, -0.2001623809337616, -0.027040256187319756, 0.04285341873764992, 0.02854013629257679, 0.031459104269742966, -0.018750596791505814, -0.3477749526500702, 0.048584356904029846, 0.29386866092681885, 0.11760670691728592, 0.18922848999500275, 1.9306289371369e-34, -0.13417550921440125, 0.11492553353309631, 0.1247342973947525, -0.14605414867401123, 0.039661142975091934, -0.005217107478529215, 0.2454799860715866, -0.051749393343925476, -0.12404356151819229, 0.02422354929149151, 0.028392808511853218 ]
https://github.com/huggingface/datasets/issues/6246
Add new column to dataset
I think it's an issue with the code. Specifically: ```python dataset = dataset['train'].add_column("/workspace/data", new_column) ``` Now `dataset` is the train set with a new column. To fix this, you can do: ```python dataset['train'] = dataset['train'].add_column("/workspace/data", new_column) ```
### Describe the bug ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) [<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>() ----> 1 dataset['train']['/workspace/data'] 3 frames [/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns) 518 def _check_valid_column_key(key: str, columns: List[str]) -> None: 519 if key not in columns: --> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}") 521 522 KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']" ``` ### Steps to reproduce the bug please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing ### Expected behavior add column to the dataset ### Environment info colab pro
37
Add new column to dataset ### Describe the bug ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) [<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>() ----> 1 dataset['train']['/workspace/data'] 3 frames [/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns) 518 def _check_valid_column_key(key: str, columns: List[str]) -> None: 519 if key not in columns: --> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}") 521 522 KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']" ``` ### Steps to reproduce the bug please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing ### Expected behavior add column to the dataset ### Environment info colab pro I think it's an issue with the code. Specifically: ```python dataset = dataset['train'].add_column("/workspace/data", new_column) ``` Now `dataset` is the train set with a new column. To fix this, you can do: ```python dataset['train'] = dataset['train'].add_column("/workspace/data", new_column) ```
[ 0.15766170620918274, 0.09596261382102966, 0.05822635442018509, -0.09615638852119446, 0.3018941283226013, 0.12480787187814713, 0.10524475574493408, 0.0023280750028789043, -0.11917683482170105, 0.13997425138950348, -0.04849379137158394, -0.036543432623147964, -0.07971088588237762, 0.10958123207092285, 0.27487707138061523, -0.09254641830921173, 0.027113769203424454, -0.024490632116794586, 0.02919001132249832, 0.14756415784358978, -0.14628714323043823, -0.09789606928825378, 0.03752664849162102, -0.14853981137275696, -0.09393260627985, -0.024367021396756172, -0.3098255395889282, 0.046598948538303375, -0.01528950221836567, -0.10308270156383514, 0.021708883345127106, -0.08058273792266846, 0.06890185922384262, 0.005219810176640749, 0.00000507239019498229, 0.04166098311543465, 0.1321064531803131, -0.10782875120639801, 0.07960875332355499, -0.2208729237318039, -0.016110680997371674, -0.09609432518482208, -0.07656779885292053, -0.08440031856298447, -0.0218657199293375, -0.029727034270763397, -0.03533616662025452, 0.11631697416305542, 0.05002368241548538, 0.18811693787574768, -0.038826584815979004, -0.008965895511209965, 0.02280624955892563, -0.13008785247802734, 0.052195291966199875, 0.011264676228165627, -0.006822546944022179, 0.1670951098203659, -0.3049030900001526, -0.055766623467206955, -0.0341818630695343, -0.07365009188652039, 0.06904138624668121, -0.04554570093750954, -0.1338830441236496, -0.01146315410733223, -0.2446923851966858, -0.19639559090137482, -0.009207908995449543, 0.15644901990890503, -0.004797008819878101, -0.02290126495063305, 0.07413902878761292, -0.04241638630628586, 0.2778569161891937, -0.2293935865163803, 0.029703810811042786, -0.04814818128943443, -0.01088586077094078, -0.05004538968205452, 0.10711901634931564, -0.1733313798904419, -0.02336982637643814, 0.11167003959417343, -0.026139099150896072, -0.04720599576830864, -0.19019146263599396, 0.03473269194364548, -0.10552608966827393, -0.008922570385038853, 0.11314154416322708, -0.06105556711554527, -0.20872369408607483, 0.02235219068825245, -0.06078135594725609, -0.04322875291109085, 0.011758990585803986, -0.0963033139705658, 0.0304929967969656, -0.11610648036003113, -0.2180047184228897, -0.08245959877967834, 0.0002940857957582921, 0.011571784503757954, 0.05641993135213852, -0.011959545314311981, -0.19585494697093964, 0.044502582401037216, 0.04957791417837143, 0.044503726065158844, -0.058543309569358826, 0.07335831969976425, -0.08523862063884735, -0.10483883321285248, 0.12430764734745026, 0.14630639553070068, -0.005674129817634821, 0.2639836072921753, 0.02768748626112938, 0.11933735758066177, 0.012218068353831768, -0.06125631183385849, -0.020019596442580223, 0.2468288242816925, 0.08135486394166946, -0.053267184644937515, 0.052676260471343994, 0.09528642147779465, 0.02168939635157585, -0.0007819134625606239, -0.0073041957803070545, 0.1081550344824791, 0.052592214196920395, -0.01886860467493534, 0.042535200715065, -0.12639206647872925, -0.08411204069852829, 0.03323255851864815, -0.047958627343177795, -0.24183456599712372, -0.10556836426258087, -0.10596808791160583, -0.03180346265435219, 0.02608201466500759, 0.005283832550048828, 0.039773765951395035, 0.03589637577533722, -0.036638371646404266, -0.04614910110831261, 0.09204317629337311, -0.14710009098052979, 0.03364747390151024, -0.26629194617271423, 0.11629978567361832, -0.04874568432569504, -0.11039802432060242, -0.20283333957195282, -0.13766269385814667, -0.10848672688007355, 0.04897306114435196, 0.05220234394073486, -0.021119672805070877, -0.04704754054546356, -0.13538570702075958, 0.10240320861339569, 0.24109897017478943, -0.04224252700805664, 0.06294138729572296, -0.05514182895421982, 0.17764422297477722, 0.0717405453324318, -0.11255613714456558, -0.07327830791473389, 0.03786826133728027, -0.013664166443049908, -0.06057072803378105, -0.051048219203948975, 0.15277914702892303, -0.2138265073299408, -0.05845066159963608, -0.008243418298661709, -0.029256019741296768, 0.07635436952114105, 0.021594587713479996, 0.07311738282442093, 0.129830464720726, -0.03702505677938461, -0.02821880206465721, 0.07863017171621323, -0.18443278968334198, -0.01567424088716507, 0.12228221446275711, -0.0751989483833313, -0.05519837513566017, 0.0038749929517507553, -0.016665900126099586, -0.020973458886146545, -0.009103389456868172, -0.07454798370599747, -0.22188904881477356, -0.057844650000333786, -0.06575191020965576, 0.27040553092956543, 0.04091043770313263, -0.06646187603473663, -0.08913158625364304, -0.12928256392478943, -0.11765836924314499, 0.1712600290775299, -0.13218416273593903, 0.040407903492450714, -0.07891609519720078, -0.05155939236283302, -0.0672396793961525, -0.1836308091878891, -0.02128700725734234, -0.08480025082826614, -0.10152830928564072, -0.09750667214393616, 0.09190350770950317, 0.0240218173712492, 0.13001790642738342, 0.03853543475270271, 0.1263873279094696, 0.1293228417634964, 0.11712335050106049, -0.04850587248802185, -0.03632594645023346, -0.05655151605606079, 0.1745324581861496, -0.0420873798429966, -0.08598800748586655, 0.06304973363876343, 0.1629209816455841, -0.13803540170192719, 0.058868907392024994, -0.005866142455488443, -0.10992039740085602, 0.0007754188263788819, 0.2299225926399231, -0.28513187170028687, -0.07361777871847153, -0.04637556150555611, -0.01083829440176487, -0.08706026524305344, 0.10246598720550537, -0.051597099751234055, -0.022013841196894646, -0.006856299005448818, -0.07944059371948242, 0.07101226598024368, 0.06960935890674591, 0.028714865446090698, -0.06678581982851028, -0.09975062310695648, -0.10002923011779785, 0.028911666944622993, 0.14653301239013672, 0.02102380245923996, -0.03923133760690689, 0.17627131938934326, 0.018137127161026, -0.0404028482735157, -0.007021824363619089, 0.038074642419815063, -0.09995087236166, 0.11838086694478989, 0.164000004529953, 0.12456628680229187, 0.12045077234506607, 0.03823826462030411, -0.11757964640855789, -0.15146411955356598, -0.050722457468509674, 0.06138244643807411, -0.11979760229587555, -0.019192064180970192, -0.01365202572196722, 0.13183465600013733, 0.06102603301405907, 0.07879871129989624, 0.05025852099061012, 0.12066064774990082, -0.07340327650308609, 0.0567583292722702, 0.16571511328220367, -0.0016334082465618849, 0.06073781102895737, -0.06427563726902008, 0.14024092257022858, 0.10069750994443893, -0.13756784796714783, 0.03777684271335602, 0.025075603276491165, 0.062061186879873276, -0.06969141960144043, 0.14696025848388672, -0.08559358865022659, -0.10743293911218643, -0.023804042488336563, -0.08314494788646698, 0.19212590157985687, 0.35093292593955994, 0.03316781669855118, 0.10517312586307526, 0.017643166705965996, 0.20917893946170807, 0.2521229088306427, -0.1571575552225113, -0.07980772852897644, -0.17702250182628632, -0.06011183187365532, -0.06406666338443756, 0.1846262812614441, 0.0947040244936943, 0.09451603889465332, -0.15454187989234924, -0.12977342307567596, 0.04146402329206467, 0.11136531084775925, -0.06294718384742737, 0.06822909414768219, -0.011557096615433693, 0.08943212032318115, 0.04005362093448639, -0.03964875638484955, -0.09085115790367126, -0.008286191150546074, 0.024297421798110008, 0.07272970676422119, -0.05162116885185242, 0.040356382727622986, 0.08736151456832886, -0.17766618728637695, 0.1829427182674408, -0.14090017974376678, -0.1223682165145874, 0.1804737001657486, 0.20637257397174835, -0.08483864367008209, -0.03161051496863365, 0.08342061191797256, -0.24640944600105286, -0.03605930507183075, -0.02164185605943203, -0.17727187275886536, -0.009339847601950169, -0.11350861191749573, 0.11943239718675613, -0.1056898757815361, -0.013877775520086288, 0.08541566878557205, 0.024378107860684395, -0.09984254837036133, -0.1055808812379837, 0.1223345473408699, -0.1690729260444641, 0.2963642179965973, 0.02202305942773819, 0.030995475128293037, 0.14813867211341858, 0.12274254113435745, -0.1132437065243721, -0.11844796687364578, -0.15268996357917786, 0.2572079598903656, -0.10884013772010803, 0.17744269967079163, -0.027560021728277206, -0.15448766946792603, -0.05064448341727257, -0.09682054817676544, -0.025090370327234268, 0.023780660703778267, -0.08492764085531235, 0.0415336899459362, 0.11174546927213669, -0.11206454038619995, 0.17551009356975555, 0.1336759328842163, 0.0566745400428772, -0.07793084532022476, -0.01775585673749447, 0.041476618498563766, 0.0764789804816246, -0.18752138316631317, -0.025217020884156227, 0.013119303621351719, -0.09698482602834702, 0.12791912257671356, -0.08200303465127945, 0.08480054140090942, -0.13020814955234528, 0.018950751051306725, -0.0982237160205841, 0.08879949152469635, 0.20341011881828308, 0.14498749375343323, 0.06701859086751938, 0.05015673488378525, 0.10947420448064804, 0.035794902592897415, -0.15301485359668732, -0.28336650133132935, 0.13457874953746796, 0.12198331952095032, 0.034975241869688034, 0.01008693128824234, -0.06799254566431046, -0.10496577620506287, -0.02810976281762123, 0.22483259439468384, 0.002782822586596012, 0.06640996783971786, 0.30528566241264343, 0.16102716326713562, -0.17954008281230927, -0.09928213804960251, -0.08904486894607544, -0.19963029026985168, -0.20741994678974152, 0.0801253542304039, -0.016822196543216705, 0.08102733641862869, 0.08562155812978745, -0.057349782437086105, -0.09819243848323822, 0.014669649302959442, 0.049851465970277786, 0.0018298161448910832, 0.03992851823568344, 0.3641801178455353, 0.05795876681804657, -0.1338992714881897, 0.041587937623262405, 0.08237040787935257, 0.2580793797969818, -0.2276197224855423, 0.12607373297214508, -0.23582205176353455, -0.174166738986969, 0.08555280417203903, -0.03220684453845024, -0.026283646002411842, 0.06257925182580948, -0.21941305696964264, -0.13794191181659698, -0.027606505900621414, 0.033561185002326965, 0.27705273032188416, -0.10003700107336044, 0.014845830388367176, -0.22481729090213776, 0.023251818493008614, -0.022376826032996178, 0.0029350118711590767, -0.002267061732709408, -0.02625330351293087, 0.056063637137413025, 0.09479717165231705, -0.2036053091287613, -0.11154983937740326, -0.1434139907360077, 0.11281276494264603, 0.11494149267673492, -0.023623421788215637, 0.2830040752887726, -0.02905263938009739, 0.0695938915014267, -0.08268208056688309, -0.07442343235015869, -0.008515067398548126, -0.10653690993785858, 0.028555596247315407, 0.015601398423314095, -0.03391876444220543, -0.018397396430373192, -0.04986784607172012, 0.20445483922958374, 0.09527145326137543, 0.06444335728883743, -0.04813331738114357, 0.0383005328476429, -0.04995668679475784, -0.050008561462163925, 0.11935153603553772, 0.004165792837738991, -0.05383005738258362, 0.022839713841676712, -0.08247307687997818, -0.11450222879648209, 0.0023149766493588686, -0.010027450509369373, 0.02232530526816845, 0.03126267343759537, -0.0962441936135292, -0.08584832400083542, 0.13300353288650513, -0.025430778041481972, 0.22805152833461761, 0.026965001598000526, 0.019812649115920067, 0.01650792919099331, -0.011837086640298367, -0.029906485229730606, -0.1668325662612915, 0.0361984446644783, 0.05495094880461693, 0.04753733053803444, -0.19032226502895355, 0.06430314481258392, 0.02206226997077465, -0.028205007314682007, 0.1728217452764511, 0.06451298296451569, 0.05158030614256859, -0.15129216015338898, -0.045924603939056396, -0.011301765218377113, 0.052173301577568054, -0.18512199819087982, 0.035996224731206894, -0.0024229283444583416, -0.1563187539577484, -0.013116656802594662, -0.14314672350883484, 0.07148590683937073, -0.13551878929138184, 0.10508476942777634, 0.1634722203016281, 0.16122466325759888, 0.18468518555164337, 0.10314548760652542, -0.01045920792967081, 0.049377717077732086, 0.15358203649520874, 0.1980837732553482, -0.12329535186290741, 0.04297750070691109, 0.14115259051322937, 0.048035334795713425, -0.2443239390850067, -0.17822003364562988, 0.07481656223535538, 0.14173606038093567, -0.0348251610994339, -0.0859772264957428, -0.06921081244945526, 0.0289373230189085, -0.004750512074679136, 0.059105947613716125, 0.08250236511230469, 0.1578981876373291, -0.06268106400966644, -0.05382664129137993, -2.3382219513738819e-32, 0.021583769470453262, -0.18122625350952148, -0.0032787283416837454, 0.11601503938436508, -0.042332641780376434, 0.013502183370292187, -0.05506177619099617, 0.06206430867314339, 0.05580546706914902, 0.04620856046676636, -0.05852771922945976, 0.07550833374261856, -0.05704571306705475, -0.0010741843143478036, -0.027546407654881477, -0.04516797885298729, 0.04135880619287491, 0.0192316435277462, 0.10354842245578766, 0.08013659715652466, 0.030623480677604675, 0.05301732197403908, 0.03866777569055557, -0.07402491569519043, -0.05445127934217453, -0.04010700806975365, -0.0908869281411171, -0.07721114903688431, -0.07298842817544937, 0.10373807698488235, -0.019167741760611534, 0.209111750125885, 0.21463477611541748, -0.10350064933300018, 0.00006555829895660281, -0.020825950428843498, -0.0986110270023346, 0.06453531235456467, -0.2271607667207718, 0.0646786093711853, -0.09262152016162872, 0.08815973252058029, 0.11161569505929947, -0.10281854122877121, 0.13749352097511292, 0.13284751772880554, -0.12252964824438095, -0.15316738188266754, 0.09442047774791718, -0.05077989399433136, 0.1883724331855774, 0.04755214974284172, 0.006245922297239304, -0.02128220722079277, 0.10197999328374863, -0.12377980351448059, 0.07893170416355133, -0.14587923884391785, -0.0494888536632061, 0.0096704987809062, 0.14394447207450867, 0.014743609353899956, -0.020126575604081154, -0.009003834798932076, -0.039614737033843994, -0.0717359185218811, 0.1347455233335495, -0.003288478823378682, 0.1729120910167694, -0.028498142957687378, -0.14378374814987183, 0.18752111494541168, 0.010506241582334042, 0.017204953357577324, -0.2206822633743286, 0.06866027414798737, -0.2103121131658554, -0.13583962619304657, 0.04426327720284462, -0.12130121141672134, -0.17250296473503113, -0.018980663269758224, 0.07823293656110764, -0.01205429621040821, 0.04580601304769516, 0.12945422530174255, -0.00740013225004077, 0.07410014420747757, 0.045045893639326096, -0.04949110373854637, -0.11598961055278778, 0.14092476665973663, -0.04641371965408325, -0.11778190732002258, -0.005983200389891863, 0.12961894273757935, -0.07001208513975143, 0.0643952265381813, -0.0652761235833168, -0.08238913118839264, 0.09150271862745285, -0.04250040650367737, 0.08317376673221588, -0.016458585858345032, 0.17688873410224915, 0.02586316503584385, 0.24284671247005463, 0.2656511664390564, -0.20070381462574005, 0.012137491255998611, 0.007607244420796633, -0.02155391313135624, 0.1548803150653839, 0.17993637919425964, -0.008808508515357971, -0.03118206560611725, -0.04381367564201355, -0.0634552389383316, 0.15604396164417267, 0.07839327305555344, -0.18205782771110535, -0.09787455201148987, -0.17480604350566864, -0.024351082742214203, 0.03069491498172283, 0.046832162886857986, -0.09212809056043625, -0.05977494269609451, 0.015597005374729633, -0.038612063974142075, -0.03667311742901802, -0.0737249106168747, 7.529604317824123e-7, -0.2333463430404663, 0.052129730582237244, -0.02365732379257679, -0.12995442748069763, -0.06757353991270065, 0.14799197018146515, -0.11619949340820312, 0.15480278432369232, -0.08637955784797668, 0.056086983531713486, 0.10203272104263306, -0.28840702772140503, -0.1205076202750206, -0.1673387587070465, 0.06261588633060455, 0.024228297173976898, -0.07560143619775772, 0.07318198680877686, -0.10800157487392426, 0.03420662879943848, 0.15382510423660278, 0.047659073024988174, -0.0014349691336974502, -0.003535335883498192, 0.09194919466972351, 0.013688669539988041, -0.11848246306180954, 0.0486881397664547, 0.00004892229480901733, 0.052569106221199036, 0.06656842678785324, 0.17395982146263123, -0.10193757712841034, 0.26774752140045166, -0.16875770688056946, -0.09219080209732056, -0.17480596899986267, -0.04479782655835152, -0.021103259176015854, 0.023842334747314453, 0.04651833325624466, 0.17337298393249512, -0.010607291013002396, -0.05216832086443901, -0.004240948241204023, 0.11928814649581909, 0.03602932393550873, -0.0008983779698610306, -0.007846469059586525, 0.02113577350974083, -0.0403289869427681, 0.13931512832641602, 0.13448789715766907, 0.00927286222577095, -0.10884559899568558, 0.1633511632680893, 0.09956169873476028, -0.15081042051315308, 0.04191582277417183, 0.006774560548365116, 0.0006647781701758504, -0.04913794621825218, -0.03365660086274147, -0.09095395356416702, 0.17110440135002136, -0.02916429191827774, -0.05961985141038895, 1.3259863263200897e-34, -0.09338265657424927, -0.0030005944427102804, 0.2077326625585556, -0.13865472376346588, 0.07551219314336777, 0.0525846965610981, 0.12969544529914856, -0.06700456142425537, 0.16808608174324036, -0.057554636150598526, -0.0072567034512758255 ]
https://github.com/huggingface/datasets/issues/6246
Add new column to dataset
> I think it's an issue with the code. > > Specifically: > > ```python > dataset = dataset['train'].add_column("/workspace/data", new_column) > ``` > > Now `dataset` is the train set with a new column. To fix this, you can do: > > ```python > dataset['train'] = dataset['train'].add_column("/workspace/data", new_column) > ``` Thanks for your response, but i can not access mask images, please let me know why the problem still persists. Here is the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing
### Describe the bug ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) [<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>() ----> 1 dataset['train']['/workspace/data'] 3 frames [/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns) 518 def _check_valid_column_key(key: str, columns: List[str]) -> None: 519 if key not in columns: --> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}") 521 522 KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']" ``` ### Steps to reproduce the bug please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing ### Expected behavior add column to the dataset ### Environment info colab pro
77
Add new column to dataset ### Describe the bug ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) [<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>() ----> 1 dataset['train']['/workspace/data'] 3 frames [/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns) 518 def _check_valid_column_key(key: str, columns: List[str]) -> None: 519 if key not in columns: --> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}") 521 522 KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']" ``` ### Steps to reproduce the bug please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing ### Expected behavior add column to the dataset ### Environment info colab pro > I think it's an issue with the code. > > Specifically: > > ```python > dataset = dataset['train'].add_column("/workspace/data", new_column) > ``` > > Now `dataset` is the train set with a new column. To fix this, you can do: > > ```python > dataset['train'] = dataset['train'].add_column("/workspace/data", new_column) > ``` Thanks for your response, but i can not access mask images, please let me know why the problem still persists. Here is the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing
[ 0.14696557819843292, 0.09345635771751404, 0.06257647275924683, -0.09359046816825867, 0.3096163868904114, 0.12802979350090027, 0.09683766961097717, 0.002232328522950411, -0.11942272633314133, 0.14377759397029877, -0.04751874879002571, -0.03096633590757847, -0.08067003637552261, 0.10931376367807388, 0.2795298099517822, -0.0935104712843895, 0.025419363752007484, -0.022239869460463524, 0.02974485419690609, 0.14138606190681458, -0.1415979564189911, -0.09324437379837036, 0.05029687285423279, -0.15040156245231628, -0.09646996110677719, -0.03413713350892067, -0.3046486973762512, 0.04738188907504082, -0.011106498539447784, -0.10253189504146576, 0.03005017712712288, -0.08080662786960602, 0.06909167766571045, -0.003398916916921735, 0.000005081400104245404, 0.03398250415921211, 0.14208288490772247, -0.10475567728281021, 0.07642283290624619, -0.22022408246994019, -0.021537570282816887, -0.10247145593166351, -0.06990008801221848, -0.08747666329145432, -0.020155493170022964, -0.036230478435754776, -0.03826405107975006, 0.11889021843671799, 0.04593620076775551, 0.17828592658042908, -0.03317292407155037, -0.009054222144186497, 0.02400152198970318, -0.13487644493579865, 0.06015222892165184, 0.01838148571550846, -0.012104898691177368, 0.16582708060741425, -0.30786043405532837, -0.05869928374886513, -0.02902199886739254, -0.07510269433259964, 0.06778161227703094, -0.042963046580553055, -0.13285042345523834, -0.009753847494721413, -0.25214049220085144, -0.19538705050945282, -0.00673502404242754, 0.15992291271686554, 0.002089081099256873, -0.019063187763094902, 0.07003920525312424, -0.04317812621593475, 0.27639058232307434, -0.21847131848335266, 0.029379766434431076, -0.048044122755527496, -0.014494352973997593, -0.05302240327000618, 0.11229261010885239, -0.1669480949640274, -0.016821658238768578, 0.10868129134178162, -0.027984390035271645, -0.04698767513036728, -0.1946587711572647, 0.041679006069898605, -0.11283601820468903, -0.006480151787400246, 0.10500217229127884, -0.05616622790694237, -0.2115255892276764, 0.01997232623398304, -0.052931275218725204, -0.04240771755576134, 0.017268106341362, -0.09496132284402847, 0.036706600338220596, -0.11939459294080734, -0.2194509208202362, -0.08267691731452942, -0.008540935814380646, 0.014374276623129845, 0.05818265303969383, -0.01658025197684765, -0.1906791627407074, 0.04102452099323273, 0.04712498560547829, 0.044712044298648834, -0.05327976495027542, 0.07970037311315536, -0.08366034924983978, -0.09755495190620422, 0.1287994235754013, 0.14812688529491425, 0.004587184172123671, 0.2590705454349518, 0.03271127864718437, 0.11269908398389816, 0.020690610632300377, -0.061309874057769775, -0.02906125970184803, 0.2402631938457489, 0.08410430699586868, -0.050706226378679276, 0.05051559954881668, 0.08876799792051315, 0.023979440331459045, -0.011431797407567501, -0.006006775889545679, 0.09456663578748703, 0.05162544175982475, -0.022533632814884186, 0.04430780187249184, -0.1269388496875763, -0.0849379301071167, 0.03988558426499367, -0.05004249885678291, -0.2414330393075943, -0.09782905131578445, -0.108197882771492, -0.03801748901605606, 0.022468136623501778, 0.010712286457419395, 0.0446460023522377, 0.039716169238090515, -0.03008834272623062, -0.043671175837516785, 0.08569177985191345, -0.15386426448822021, 0.043795645236968994, -0.2645016014575958, 0.11840150505304337, -0.04678470268845558, -0.10872144997119904, -0.19859579205513, -0.1269238293170929, -0.11747072637081146, 0.041079070419073105, 0.051928453147411346, -0.02034364826977253, -0.04677668586373329, -0.13229984045028687, 0.10508624464273453, 0.2541928291320801, -0.04891384392976761, 0.060285791754722595, -0.058910008519887924, 0.17090602219104767, 0.07250257581472397, -0.11812197417020798, -0.07026378065347672, 0.04739426076412201, -0.013295244425535202, -0.06305844336748123, -0.04433849826455116, 0.15015225112438202, -0.22085507214069366, -0.059515438973903656, -0.010250781662762165, -0.027895336970686913, 0.07116948813199997, 0.021831052377820015, 0.07716351747512817, 0.13413353264331818, -0.03628367558121681, -0.0264863483607769, 0.06776783615350723, -0.18605637550354004, -0.01743253692984581, 0.12110757827758789, -0.07401100546121597, -0.04480317234992981, 0.0035306226927787066, -0.01394537091255188, -0.011503344401717186, -0.008384233340620995, -0.07514410465955734, -0.22533778846263885, -0.05471815541386604, -0.0637892484664917, 0.27654093503952026, 0.041915297508239746, -0.06221070885658264, -0.08681780844926834, -0.13368579745292664, -0.11761745065450668, 0.17949508130550385, -0.12420261651277542, 0.04921647906303406, -0.08185936510562897, -0.05016627162694931, -0.06515258550643921, -0.1895814836025238, -0.02285105548799038, -0.083574578166008, -0.10009098798036575, -0.09799867868423462, 0.09193508327007294, 0.02161252312362194, 0.1288260519504547, 0.04341728612780571, 0.12618890404701233, 0.12615978717803955, 0.12248877435922623, -0.04446159675717354, -0.03656814992427826, -0.05562352016568184, 0.16728508472442627, -0.04365219920873642, -0.08256075531244278, 0.06436493247747421, 0.1575724184513092, -0.14178766310214996, 0.05878817290067673, -0.003680265974253416, -0.11832624673843384, 0.003085687290877104, 0.22215165197849274, -0.28290286660194397, -0.07001273334026337, -0.05370023474097252, -0.015253759920597076, -0.08694674074649811, 0.09711173176765442, -0.04402092471718788, -0.02017182856798172, -0.010489700362086296, -0.08083479106426239, 0.07424580305814743, 0.07222814112901688, 0.03055725246667862, -0.07905740290880203, -0.10241629928350449, -0.10710021108388901, 0.03239664435386658, 0.14326448738574982, 0.02213052287697792, -0.03282221779227257, 0.18145829439163208, 0.020911403000354767, -0.03964819386601448, -0.004415122326463461, 0.03510648012161255, -0.09615448862314224, 0.11939875781536102, 0.17033393681049347, 0.12532714009284973, 0.12906375527381897, 0.0368875227868557, -0.11659114062786102, -0.15067259967327118, -0.04989802837371826, 0.05896921828389168, -0.12451193481683731, -0.024001814424991608, -0.010612417943775654, 0.13227754831314087, 0.05634206533432007, 0.07158342003822327, 0.0507303848862648, 0.12623777985572815, -0.07440230995416641, 0.06232275441288948, 0.1636546403169632, -0.003693267470225692, 0.05277998745441437, -0.06280729919672012, 0.1509074866771698, 0.09789707511663437, -0.13545271754264832, 0.03785105049610138, 0.024443848058581352, 0.06293600797653198, -0.07574745267629623, 0.1491149514913559, -0.08674541115760803, -0.10736918449401855, -0.022308027371764183, -0.08852726966142654, 0.18854840099811554, 0.34357938170433044, 0.03376007452607155, 0.096871018409729, 0.013757782988250256, 0.2151893824338913, 0.24486136436462402, -0.16420075297355652, -0.09283025562763214, -0.1718478500843048, -0.06271099299192429, -0.06215398758649826, 0.18917754292488098, 0.09974529594182968, 0.0913507491350174, -0.14836135506629944, -0.13049013912677765, 0.04492628201842308, 0.11606045067310333, -0.07171225547790527, 0.06293030828237534, -0.011731641367077827, 0.09818433225154877, 0.03452786058187485, -0.036025259643793106, -0.08337825536727905, -0.01178338099271059, 0.022176679223775864, 0.07191586494445801, -0.05581986904144287, 0.0315246619284153, 0.09006411582231522, -0.1784677654504776, 0.17183078825473785, -0.13806162774562836, -0.12793712317943573, 0.18199901282787323, 0.21642276644706726, -0.08793725818395615, -0.03238875791430473, 0.08432971686124802, -0.24836395680904388, -0.032280612736940384, -0.018411457538604736, -0.18507157266139984, -0.005833058152347803, -0.10499510914087296, 0.1247469112277031, -0.10370881110429764, -0.017356734722852707, 0.0873241126537323, 0.027363749220967293, -0.1005641296505928, -0.10745896399021149, 0.12299742549657822, -0.16600459814071655, 0.29003819823265076, 0.03066706657409668, 0.027646970003843307, 0.15487948060035706, 0.11546444147825241, -0.10898544639348984, -0.12177475541830063, -0.15620563924312592, 0.25385382771492004, -0.1049293801188469, 0.18380828201770782, -0.033646780997514725, -0.15760740637779236, -0.0518934391438961, -0.10353250801563263, -0.01626654528081417, 0.028713835403323174, -0.08523430675268173, 0.03444160521030426, 0.10763658583164215, -0.1190388947725296, 0.17519061267375946, 0.12802518904209137, 0.05725714564323425, -0.08168365806341171, -0.016587937250733376, 0.037988364696502686, 0.07591615617275238, -0.18789686262607574, -0.030179398134350777, 0.016531288623809814, -0.1012536808848381, 0.13088266551494598, -0.07800979167222977, 0.07981455326080322, -0.12522971630096436, 0.02673603966832161, -0.09801056981086731, 0.08318665623664856, 0.20671087503433228, 0.137923464179039, 0.06761748343706131, 0.0543283075094223, 0.11123684048652649, 0.041595395654439926, -0.14987388253211975, -0.2748015820980072, 0.12974180281162262, 0.12413496524095535, 0.043379172682762146, 0.006182083860039711, -0.07219034433364868, -0.10479314625263214, -0.028051339089870453, 0.22166748344898224, 0.0001210754198837094, 0.06529805064201355, 0.30580130219459534, 0.16221392154693604, -0.18442265689373016, -0.09037052094936371, -0.08033663779497147, -0.1923070102930069, -0.20244313776493073, 0.07896039634943008, -0.015428944490849972, 0.07084807753562927, 0.0881577655673027, -0.053782545030117035, -0.10534019768238068, 0.00544891320168972, 0.04308569058775902, -0.0004771210078615695, 0.04282030835747719, 0.36348339915275574, 0.06810975074768066, -0.13054408133029938, 0.0387147031724453, 0.0832386463880539, 0.25714245438575745, -0.22620785236358643, 0.11902637034654617, -0.2392583042383194, -0.173804372549057, 0.08646237105131149, -0.04016966372728348, -0.019967233762145042, 0.0692174881696701, -0.22236205637454987, -0.13382989168167114, -0.02789544314146042, 0.03097856231033802, 0.2702755331993103, -0.10642588883638382, 0.013053761795163155, -0.22308270633220673, 0.026219747960567474, -0.021585287526249886, 0.006064846180379391, 0.004614107310771942, -0.03165304288268089, 0.05807555094361305, 0.09012090414762497, -0.2006119340658188, -0.1120954230427742, -0.1374388039112091, 0.10976096987724304, 0.10789871960878372, -0.02700204774737358, 0.2874365448951721, -0.027716314420104027, 0.06573121249675751, -0.08542405813932419, -0.07000237703323364, -0.00846596248447895, -0.10185719281435013, 0.02857392653822899, 0.02927994914352894, -0.03020179644227028, -0.02286638878285885, -0.05117073655128479, 0.206701397895813, 0.1007758378982544, 0.06660673022270203, -0.04928993061184883, 0.03722053021192551, -0.04350053519010544, -0.048985619097948074, 0.11353851109743118, 0.002926013432443142, -0.0630369707942009, 0.016070237383246422, -0.0689624547958374, -0.11683395504951477, -0.004840394016355276, -0.008261796087026596, 0.01880459673702717, 0.026481984183192253, -0.09609152376651764, -0.08777310699224472, 0.1349160373210907, -0.027183078229427338, 0.23194308578968048, 0.030644839629530907, 0.021071601659059525, 0.02266049012541771, -0.006896087434142828, -0.02282596379518509, -0.16817282140254974, 0.038459647446870804, 0.05397757142782211, 0.04854311794042587, -0.1888779252767563, 0.07031657546758652, 0.022201141342520714, -0.03181074932217598, 0.17205438017845154, 0.06158457696437836, 0.04514196142554283, -0.15867112576961517, -0.04181942343711853, -0.009999669156968594, 0.05871639400720596, -0.18405833840370178, 0.030348623171448708, 0.004056112375110388, -0.15400733053684235, -0.011374206282198429, -0.13716113567352295, 0.07966836541891098, -0.13347528874874115, 0.10344089567661285, 0.16907189786434174, 0.16290423274040222, 0.18707306683063507, 0.10521606355905533, -0.019426455721259117, 0.056089192628860474, 0.15265192091464996, 0.19815459847450256, -0.12742581963539124, 0.04069390520453453, 0.14112168550491333, 0.057979702949523926, -0.24409516155719757, -0.18068759143352509, 0.07405591011047363, 0.1392139494419098, -0.024645576253533363, -0.08614590018987656, -0.07291323691606522, 0.025489462539553642, -0.009915498085319996, 0.057918258011341095, 0.08496705442667007, 0.15231552720069885, -0.060113582760095596, -0.049979839473962784, -2.344871135169308e-32, 0.014197690412402153, -0.18098607659339905, -0.010809347033500671, 0.11807050555944443, -0.040970854461193085, 0.01735598035156727, -0.05228590592741966, 0.049396101385354996, 0.04889947175979614, 0.0434785895049572, -0.06054740399122238, 0.08183401823043823, -0.05321185663342476, 0.003331325249746442, -0.027832789346575737, -0.05232291296124458, 0.038540925830602646, 0.017118172720074654, 0.10847558081150055, 0.08306069672107697, 0.025844277814030647, 0.04960111528635025, 0.03650674596428871, -0.07412225008010864, -0.0621345080435276, -0.04252804070711136, -0.0909721851348877, -0.07393591105937958, -0.07139954715967178, 0.10283472388982773, -0.015104105696082115, 0.20374366641044617, 0.2148420661687851, -0.10715808719396591, -0.0043443068861961365, -0.02574428915977478, -0.10053282976150513, 0.06350843608379364, -0.22499150037765503, 0.06535153836011887, -0.09160663187503815, 0.08834033459424973, 0.1076417863368988, -0.10849395394325256, 0.1418142318725586, 0.13110500574111938, -0.1233653649687767, -0.16053380072116852, 0.08285431563854218, -0.056595783680677414, 0.1942240446805954, 0.04682295024394989, 0.004467437509447336, -0.027418000623583794, 0.09821131825447083, -0.11810499429702759, 0.07544567435979843, -0.14191539585590363, -0.05510294809937477, 0.014565546996891499, 0.1571342498064041, 0.016713738441467285, -0.027325820177793503, 0.000041726932977326214, -0.032783474773168564, -0.08406639099121094, 0.13941648602485657, -0.009458175860345364, 0.1695418506860733, -0.02389661967754364, -0.1403101086616516, 0.19101987779140472, 0.009463340044021606, 0.022352706640958786, -0.22302713990211487, 0.06869202852249146, -0.20720553398132324, -0.1368914097547531, 0.030869485810399055, -0.11415319889783859, -0.17863065004348755, -0.025017408654093742, 0.07764817774295807, -0.013656454160809517, 0.046068672090768814, 0.12377341091632843, -0.01077169831842184, 0.07706078141927719, 0.04360326752066612, -0.049844250082969666, -0.1153884157538414, 0.14638099074363708, -0.04168292135000229, -0.12382137030363083, -0.008346999995410442, 0.12967528402805328, -0.0674571767449379, 0.07554181665182114, -0.06870659440755844, -0.08833175152540207, 0.0887160375714302, -0.045052360743284225, 0.08475129306316376, -0.006403577513992786, 0.18114423751831055, 0.02905602939426899, 0.25102612376213074, 0.264251708984375, -0.20118948817253113, 0.00997907668352127, 0.00459780590608716, -0.01723416894674301, 0.14900320768356323, 0.17847532033920288, -0.00823117420077324, -0.03702125325798988, -0.04429344832897186, -0.05872141942381859, 0.16048462688922882, 0.07917631417512894, -0.18603932857513428, -0.10220951586961746, -0.16563719511032104, -0.01974506676197052, 0.028373777866363525, 0.052590981125831604, -0.09280944615602493, -0.06546595692634583, 0.0289008729159832, -0.03722883388400078, -0.04266146570444107, -0.08278217911720276, 7.522401119786082e-7, -0.23650647699832916, 0.04424120485782623, -0.023190179839730263, -0.1311272531747818, -0.05996120348572731, 0.1457509696483612, -0.11398100852966309, 0.15722009539604187, -0.09025329351425171, 0.05666949227452278, 0.10432913154363632, -0.28718727827072144, -0.11567523330450058, -0.16656146943569183, 0.06577564030885696, 0.027413496747612953, -0.08223793655633926, 0.0715988427400589, -0.10942888259887695, 0.026706235483288765, 0.14447203278541565, 0.04931176081299782, -0.003603898221626878, -0.005936040543019772, 0.08777886629104614, 0.01278455276042223, -0.11735248565673828, 0.040841251611709595, -0.008092919364571571, 0.05350204557180405, 0.06375642120838165, 0.1813308745622635, -0.10227938741445541, 0.26798269152641296, -0.17008748650550842, -0.09354811161756516, -0.1710468977689743, -0.04972868040204048, -0.021650046110153198, 0.0215540062636137, 0.04067306965589523, 0.17234013974666595, -0.011682810261845589, -0.04872220754623413, 0.0041718618012964725, 0.12492184340953827, 0.03346344083547592, 0.003987018950283527, -0.009132841601967812, 0.023427655920386314, -0.038478538393974304, 0.1313764601945877, 0.13404637575149536, 0.010848747566342354, -0.10127675533294678, 0.15959815680980682, 0.0994320884346962, -0.1550872027873993, 0.03573490306735039, 0.008707992732524872, 0.005296020768582821, -0.04740975424647331, -0.030108371749520302, -0.09110783040523529, 0.1728542000055313, -0.03353830426931381, -0.06332564353942871, 1.3419659322403205e-34, -0.0903596431016922, -0.006198551971465349, 0.20427782833576202, -0.13622726500034332, 0.08024618774652481, 0.05115493759512901, 0.13319453597068787, -0.07007864117622375, 0.16905860602855682, -0.05056744068861008, -0.004943176172673702 ]
https://github.com/huggingface/datasets/issues/6246
Add new column to dataset
I think there is a slight misunderstanding. ```python new_column = ["mask"] * len(dataset["train"]) dataset['train'] = dataset['train'].add_column("/workspace/data", new_column) ``` adds a column with the string `mask` to your dataset. If you're trying to load the images `"mask_{idx}.png"` in your dataset, you could try: ``` from datasets import Image dataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f"/workspace/data/mask_{idx}.png", with_indices=True).cast_column("mask", Image()) ``` What this does is that it adds a column to your dataset name `mask` with the path to the mask, then it cast the column as an `Image` feature. This [link](https://huggingface.co/docs/datasets/v2.5.1/en/image_load) explains how to load images. Hope this helps!
### Describe the bug ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) [<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>() ----> 1 dataset['train']['/workspace/data'] 3 frames [/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns) 518 def _check_valid_column_key(key: str, columns: List[str]) -> None: 519 if key not in columns: --> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}") 521 522 KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']" ``` ### Steps to reproduce the bug please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing ### Expected behavior add column to the dataset ### Environment info colab pro
96
Add new column to dataset ### Describe the bug ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) [<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>() ----> 1 dataset['train']['/workspace/data'] 3 frames [/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns) 518 def _check_valid_column_key(key: str, columns: List[str]) -> None: 519 if key not in columns: --> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}") 521 522 KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']" ``` ### Steps to reproduce the bug please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing ### Expected behavior add column to the dataset ### Environment info colab pro I think there is a slight misunderstanding. ```python new_column = ["mask"] * len(dataset["train"]) dataset['train'] = dataset['train'].add_column("/workspace/data", new_column) ``` adds a column with the string `mask` to your dataset. If you're trying to load the images `"mask_{idx}.png"` in your dataset, you could try: ``` from datasets import Image dataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f"/workspace/data/mask_{idx}.png", with_indices=True).cast_column("mask", Image()) ``` What this does is that it adds a column to your dataset name `mask` with the path to the mask, then it cast the column as an `Image` feature. This [link](https://huggingface.co/docs/datasets/v2.5.1/en/image_load) explains how to load images. Hope this helps!
[ 0.15614570677280426, 0.10780016332864761, 0.05445946753025055, -0.06684673577547073, 0.24252411723136902, 0.12896281480789185, 0.16030237078666687, 0.0125469034537673, -0.08782663196325302, 0.10194793343544006, -0.053475428372621536, -0.05190759897232056, -0.11394095420837402, 0.12089823186397552, 0.277449369430542, -0.09406726807355881, 0.01147883478552103, -0.05710373818874359, 0.011780443601310253, 0.12098369747400284, -0.16866782307624817, -0.07248740643262863, 0.03783080726861954, -0.15011155605316162, -0.08991335332393646, -0.02173233963549137, -0.2775808274745941, 0.04212581366300583, 0.00035540206590667367, -0.11118443310260773, 0.08242142200469971, -0.11661228537559509, 0.06771624833345413, 0.011643221601843834, 0.0000051144493227184284, 0.012868139892816544, 0.12763388454914093, -0.08611726760864258, 0.06799367815256119, -0.26344820857048035, -0.015722382813692093, -0.13905717432498932, -0.07354491949081421, -0.09088383615016937, -0.011992072686553001, 0.029465360566973686, -0.06641284376382828, 0.0849369615316391, 0.046064138412475586, 0.18610215187072754, -0.030676420778036118, -0.035508960485458374, -0.04324677586555481, -0.15928570926189423, 0.03864216431975365, 0.0003838444536086172, 0.02351328916847706, 0.13448849320411682, -0.3437453806400299, -0.09015702456235886, -0.030281301587820053, -0.02525891549885273, 0.09572800248861313, -0.018909877166152, -0.12845423817634583, 0.011416557244956493, -0.24518325924873352, -0.23744697868824005, -0.04336615651845932, 0.10506691783666611, -0.07135290652513504, -0.03095671348273754, 0.1134055107831955, -0.035355307161808014, 0.22348712384700775, -0.19766707718372345, 0.036993008106946945, -0.018507707864046097, 0.011160501278936863, -0.045239947736263275, 0.06982866674661636, -0.1313411295413971, -0.003830111352726817, 0.09446310997009277, -0.07343339920043945, -0.052581485360860825, -0.21190579235553741, 0.05443610996007919, -0.08858458697795868, -0.06584437191486359, 0.06215415149927139, -0.042141806334257126, -0.1976676732301712, 0.01921626180410385, -0.007752693723887205, 0.024684585630893707, 0.012297830544412136, -0.18433235585689545, 0.034362249076366425, -0.09877107292413712, -0.2503128945827484, -0.09473204612731934, -0.0025591019075363874, 0.050452928990125656, 0.006484568119049072, -0.03726447373628616, -0.18838278949260712, 0.041044723242521286, 0.0466192327439785, -0.026229513809084892, -0.026047440245747566, 0.08975742757320404, -0.060786206275224686, -0.08794208616018295, 0.10206744074821472, 0.09413933753967285, 0.027622364461421967, 0.18597693741321564, -0.01067381352186203, 0.14445869624614716, 0.003954789601266384, -0.09746388345956802, -0.009797108359634876, 0.20881469547748566, 0.0842008963227272, -0.16019052267074585, 0.056085992604494095, 0.05032537132501602, 0.020314106717705727, 0.01617870107293129, -0.0189716424793005, 0.06040624529123306, 0.002204688498750329, -0.055311378091573715, 0.042180560529232025, -0.13552990555763245, -0.09117074310779572, 0.030949270352721214, -0.007539477664977312, -0.2164130061864853, -0.14027906954288483, -0.08244684338569641, -0.00409182533621788, 0.05943605303764343, 0.010225484147667885, 0.007015570532530546, 0.06226637214422226, -0.06088567152619362, -0.006345908157527447, 0.08468322455883026, -0.16446831822395325, 0.04002702236175537, -0.23559372127056122, 0.08397798240184784, -0.04463416337966919, -0.058697208762168884, -0.2533803880214691, -0.14716681838035583, -0.142558753490448, 0.012884380295872688, 0.05323948338627815, -0.031447481364011765, -0.08625056594610214, -0.11601294577121735, 0.16764485836029053, 0.2673559784889221, -0.0737340971827507, 0.05305628851056099, -0.003037853632122278, 0.1163097694516182, 0.08029773831367493, -0.09687233716249466, -0.07031576335430145, -0.023445362225174904, -0.011751774698495865, -0.05866219848394394, -0.07142779976129532, 0.1701529622077942, -0.16345347464084625, -0.06135830655694008, -0.0016029698308557272, -0.039831988513469696, 0.09134960174560547, -0.01953071355819702, 0.09759298712015152, 0.1447369009256363, -0.02587950974702835, 0.01111209113150835, 0.09142211079597473, -0.2007579356431961, -0.0337458960711956, 0.13969027996063232, -0.06264778971672058, -0.01474553532898426, 0.0042413524352014065, 0.013892533257603645, -0.006462058052420616, -0.08705638349056244, -0.12388324737548828, -0.19786031544208527, -0.06490257382392883, -0.08467242866754532, 0.28704559803009033, -0.015247605741024017, -0.06634506583213806, -0.029159998521208763, -0.12508895993232727, -0.07118602842092514, 0.11804807186126709, -0.19399112462997437, 0.014695375226438046, -0.033994290977716446, -0.04628153145313263, -0.07044736295938492, -0.13588199019432068, -0.036097072064876556, -0.12106981873512268, -0.03708568215370178, -0.10051395744085312, 0.06991904973983765, 0.03005724772810936, 0.18132935464382172, 0.0604618564248085, 0.13884341716766357, 0.06891395151615143, 0.11156763881444931, -0.01303008385002613, -0.055374033749103546, -0.06421211361885071, 0.1476161628961563, -0.04111754894256592, -0.11350192874670029, 0.05010352283716202, 0.10927686095237732, -0.15293189883232117, 0.03851078450679779, -0.04419700428843498, -0.1439351737499237, 0.01189388707280159, 0.180531308054924, -0.25466564297676086, 0.03587187081575394, -0.017838504165410995, -0.019698521122336388, -0.1237831711769104, 0.1302850991487503, -0.07762061059474945, -0.016411129385232925, -0.0026853021699935198, -0.04536996781826019, 0.09821029752492905, 0.10089153051376343, 0.018224000930786133, -0.057961199432611465, -0.08049326390028, -0.04552866518497467, 0.04452432319521904, 0.1196776032447815, 0.05048204958438873, -0.04570019990205765, 0.16082625091075897, 0.05014738440513611, -0.08865140378475189, -0.008904313668608665, 0.041860103607177734, -0.07410461455583572, 0.097825787961483, 0.1586844027042389, 0.12263073027133942, 0.1496528685092926, -0.002066737739369273, -0.14086060225963593, -0.18421559035778046, -0.05755883455276489, 0.02826930396258831, -0.11345554888248444, -0.06266191601753235, -0.015623335726559162, 0.12001839280128479, 0.037226080894470215, 0.07946842163801193, 0.02013980597257614, 0.12486065924167633, -0.07103195786476135, 0.07387058436870575, 0.1637924611568451, -0.018977226689457893, -0.03919016942381859, -0.053185973316431046, 0.1635219305753708, 0.10305740684270859, -0.09195802360773087, 0.012184716761112213, 0.06168404966592789, 0.02377406693994999, -0.05611258000135422, 0.1710493564605713, -0.05714211240410805, -0.10418175905942917, -0.03404419869184494, -0.1317160278558731, 0.17366233468055725, 0.29757609963417053, 0.07702315598726273, 0.10691148787736893, 0.03232136741280556, 0.19092504680156708, 0.2220936268568039, -0.11305953562259674, -0.07371240109205246, -0.13080698251724243, -0.07730553299188614, -0.10327143222093582, 0.18688839673995972, 0.06345763802528381, 0.06918824464082718, -0.1889435350894928, -0.1985974907875061, 0.06939364224672318, 0.11578579246997833, -0.06640848517417908, 0.08776462823152542, -0.02624489739537239, 0.06045311689376831, 0.0013113850727677345, -0.045301634818315506, -0.10939859598875046, -0.01935769058763981, 0.002980725606903434, 0.1659887433052063, -0.06378042697906494, 0.11780062317848206, 0.15029627084732056, -0.14530712366104126, 0.20959460735321045, -0.17360760271549225, -0.11710693687200546, 0.1231488510966301, 0.16581003367900848, -0.0738593116402626, -0.008946406655013561, 0.05336378514766693, -0.22367829084396362, -0.07981975376605988, 0.011424299329519272, -0.18066488206386566, 0.048291873186826706, -0.08503430336713791, 0.14172928035259247, -0.09165619313716888, -0.0040687392465770245, 0.07117396593093872, 0.060287900269031525, -0.13136187195777893, -0.11628635972738266, 0.06061754748225212, -0.11236381530761719, 0.2689346969127655, 0.07729512453079224, 0.02619343437254429, 0.19198991358280182, 0.11524569988250732, -0.039098408073186874, -0.0819898322224617, -0.16310963034629822, 0.272626668214798, -0.0767056792974472, 0.22459422051906586, -0.027599019929766655, -0.16159258782863617, -0.037726983428001404, -0.10581251233816147, 0.010283776558935642, 0.03963084891438484, -0.08688727766275406, 0.03395276516675949, 0.08239565789699554, -0.143332839012146, 0.11849608272314072, 0.10588380694389343, 0.0456475131213665, -0.09053262323141098, -0.000760519178584218, 0.03510908782482147, 0.09545227885246277, -0.16518545150756836, -0.01693953387439251, 0.0462634339928627, -0.11942537873983383, 0.14758719503879547, -0.11145199090242386, 0.10512210428714752, -0.11051502823829651, 0.08280161768198013, -0.11165665835142136, 0.04907313734292984, 0.19965079426765442, 0.09371720999479294, 0.07493084669113159, 0.03370054066181183, 0.15496161580085754, 0.06622564047574997, -0.1273048222064972, -0.24960027635097504, 0.16715145111083984, 0.13366612792015076, -0.0036086037289351225, -0.046901408582925797, -0.02284596860408783, -0.1361726075410843, 0.01409992203116417, 0.2013813555240631, 0.010874534957110882, 0.08280544728040695, 0.3180829882621765, 0.127905011177063, -0.23134656250476837, -0.05781519040465355, -0.0862981379032135, -0.1655525267124176, -0.2546592056751251, 0.08828841894865036, -0.029878728091716766, 0.10849156975746155, 0.11384397745132446, -0.059394143521785736, -0.07554195076227188, -0.021702127531170845, 0.041304923593997955, -0.00389797892421484, 0.04175015166401863, 0.3693249821662903, 0.08318459987640381, -0.1300782561302185, -0.0270858071744442, 0.10132595896720886, 0.2883315682411194, -0.29887962341308594, 0.1406949758529663, -0.20612989366054535, -0.12373287975788116, 0.0841769203543663, 0.015704045072197914, -0.009972619824111462, 0.028177713975310326, -0.20487086474895477, -0.15127825736999512, -0.015036270022392273, 0.05668770149350166, 0.22539575397968292, -0.0745864287018776, 0.0337517186999321, -0.19273501634597778, -0.008217901922762394, -0.025436192750930786, -0.038113657385110855, 0.03845449537038803, -0.022373516112565994, 0.025752568617463112, 0.11431306600570679, -0.16094893217086792, -0.11422727257013321, -0.15129375457763672, 0.1353832185268402, 0.06227588281035423, 0.01123216561973095, 0.21960091590881348, 0.019710198044776917, 0.029864901676774025, -0.07182414084672928, -0.11114667356014252, 0.022518452256917953, -0.08537577837705612, 0.08316536247730255, 0.00043110447586514056, 0.0009898667922243476, -0.01005652453750372, -0.0512448213994503, 0.27970144152641296, 0.10297200083732605, 0.03722069784998894, -0.04324447363615036, 0.009396747685968876, -0.01480844896286726, -0.0022968025878071785, 0.16623830795288086, -0.01032430399209261, -0.07943717390298843, 0.013398442417383194, -0.09201879054307938, -0.09923115372657776, -0.008552324958145618, -0.0023733191192150116, 0.06485676765441895, 0.049743957817554474, -0.10216821730136871, -0.11318599432706833, 0.03792179375886917, -0.06241414695978165, 0.21667985618114471, 0.03601550683379173, 0.01716284640133381, 0.02839411050081253, -0.014722990803420544, 0.0027581111062318087, -0.15913039445877075, 0.06041404604911804, 0.05509599670767784, 0.09071016311645508, -0.1289922446012497, 0.07747223228216171, 0.011271544732153416, -0.005643709562718868, 0.15475024282932281, 0.0935346782207489, -0.021734125912189484, -0.11542066186666489, -0.06612418591976166, -0.011793850921094418, 0.03873439505696297, -0.176302969455719, 0.045261479914188385, -0.03104950673878193, -0.19606231153011322, 0.003654806176200509, -0.11902889609336853, 0.04445534199476242, -0.11941671371459961, 0.10073955357074738, 0.14186015725135803, 0.19239088892936707, 0.16633234918117523, 0.10992391407489777, -0.0507211871445179, 0.07555465400218964, 0.1772971898317337, 0.23781615495681763, -0.08342676609754562, 0.09231220185756683, 0.0790020227432251, 0.056878868490457535, -0.29124486446380615, -0.12176653742790222, 0.09806838631629944, 0.14588570594787598, -0.02354271337389946, -0.051960524171590805, -0.07675795257091522, 0.034098293632268906, -0.005439843516796827, 0.055916570127010345, 0.10818374156951904, 0.15164656937122345, -0.05775422602891922, -0.03214777261018753, -2.3775059440208057e-32, 0.01195385493338108, -0.1826321929693222, 0.02876952476799488, 0.14811603724956512, -0.04884625971317291, -0.0173021350055933, -0.01912032999098301, 0.025905700400471687, 0.10072393715381622, 0.07852428406476974, -0.03191233053803444, 0.026190772652626038, -0.04080183804035187, 0.0148989362642169, -0.04656682536005974, -0.026394512504339218, -0.007063361816108227, 0.031199665740132332, 0.11374332010746002, 0.05052996426820755, 0.007748355623334646, 0.07444202899932861, -0.00382324680685997, -0.07530967146158218, -0.05270981043577194, -0.019609864801168442, -0.10468719154596329, -0.120539091527462, -0.05528895929455757, 0.10255206376314163, -0.017816361039876938, 0.15766900777816772, 0.1928601711988449, -0.11374157667160034, -0.009509654715657234, 0.0016331286169588566, -0.09407186508178711, 0.09894970059394836, -0.18742847442626953, 0.059986889362335205, -0.08160729706287384, 0.10565343499183655, 0.09282559901475906, -0.0550227127969265, 0.15308897197246552, 0.1773328334093094, -0.12065266072750092, -0.17077212035655975, 0.08723346143960953, -0.0883740782737732, 0.2444002628326416, 0.0528319850564003, 0.026178652420639992, -0.034146495163440704, 0.11830860376358032, -0.15340939164161682, 0.06881176680326462, -0.07423874735832214, -0.08130337297916412, -0.0738038420677185, 0.16468150913715363, 0.031925834715366364, -0.017561549320816994, 0.005994628183543682, -0.043252453207969666, -0.08536122739315033, 0.15395385026931763, -0.014186224900186062, 0.212959423661232, -0.006172087974846363, -0.13668930530548096, 0.1770600825548172, 0.02187005616724491, 0.05501523241400719, -0.17075380682945251, 0.08856163173913956, -0.2061273604631424, -0.1041853278875351, -0.06724439561367035, -0.11034968495368958, -0.1328434944152832, -0.02464902214705944, 0.06468623876571655, 0.03179202973842621, 0.02305932529270649, 0.1466911882162094, -0.045454204082489014, 0.13518278300762177, 0.06521972268819809, -0.006537613458931446, -0.09601043164730072, 0.2080221176147461, -0.04045481234788895, -0.07906483113765717, 0.012359718792140484, 0.021263888105750084, -0.05691700801253319, 0.06665649265050888, -0.053229570388793945, -0.04371139034628868, 0.07469728589057922, 0.008073887787759304, 0.09552749991416931, 0.020192012190818787, 0.2014206349849701, -0.004274995531886816, 0.24740611016750336, 0.2579430937767029, -0.2123584747314453, -0.004200086463242769, -0.008643624372780323, 0.06325880438089371, 0.1358545422554016, 0.1994353085756302, -0.05231761187314987, 0.020374532788991928, -0.06434899568557739, -0.052724819630384445, 0.15474966168403625, 0.027602437883615494, -0.1662612110376358, -0.09678615629673004, -0.16942554712295532, -0.04048451781272888, 0.012190360575914383, 0.025660227984189987, -0.08928493410348892, 0.01315989624708891, 0.07771942019462585, -0.025924012064933777, -0.06347573548555374, -0.06422317028045654, 7.560068979728385e-7, -0.2155083864927292, 0.02897394448518753, -0.051994889974594116, -0.06706706434488297, -0.053453586995601654, 0.14894433319568634, -0.11528938263654709, 0.14762577414512634, -0.13765032589435577, 0.08794846385717392, 0.06468833982944489, -0.2721462547779083, -0.06550400704145432, -0.1359769105911255, 0.06234262138605118, 0.015854479745030403, -0.016627440229058266, 0.007429738994687796, -0.12372678518295288, 0.08172900974750519, 0.15687420964241028, 0.048215463757514954, -0.016706475988030434, -0.009481432847678661, 0.08511504530906677, -0.007289252243936062, -0.07965230196714401, 0.031253814697265625, -0.05287627503275871, -0.0020821690559387207, 0.04725608602166176, 0.1874878853559494, -0.11913633346557617, 0.2465956211090088, -0.1459248811006546, -0.045308131724596024, -0.1711798757314682, -0.05720018967986107, 0.032935574650764465, 0.024248449131846428, 0.05685308203101158, 0.17491060495376587, -0.016162972897291183, -0.060070835053920746, -0.03460364416241646, 0.1318514347076416, 0.023108702152967453, 0.03487307205796242, -0.020139548927545547, 0.03809721767902374, -0.06949391961097717, 0.08316953480243683, 0.1060982272028923, -0.004236286971718073, -0.06036780774593353, 0.1389879435300827, 0.10783735662698746, -0.21157561242580414, 0.05965065211057663, -0.029820526018738747, -0.0340762585401535, -0.02928749844431877, -0.06983280181884766, -0.12767337262630463, 0.09697994589805603, -0.08214061707258224, -0.05286312848329544, 1.6322386501415376e-34, -0.13922815024852753, -0.05730385705828667, 0.1775701493024826, -0.10077124834060669, 0.12209156900644302, 0.07162465900182724, 0.055139895528554916, -0.052482232451438904, 0.12915495038032532, -0.06944126635789871, -0.019529199227690697 ]
https://github.com/huggingface/datasets/issues/6246
Add new column to dataset
> I think there is a slight misunderstanding. > > ```python > new_column = ["mask"] * len(dataset["train"]) > dataset['train'] = dataset['train'].add_column("/workspace/data", new_column) > ``` > > adds a column with the string `mask` to your dataset. If you're trying to load the images `"mask_{idx}.png"` in your dataset, you could try: > > ``` > from datasets import Image > > dataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f"/workspace/data/mask_{idx}.png", with_indices=True).cast_column("mask", Image()) > ``` > > What this does is that it adds a column to your dataset name `mask` with the path to the mask, then it cast the column as an `Image` feature. > > This [link](https://huggingface.co/docs/datasets/v2.5.1/en/image_load) explains how to load images. > > Hope this helps! Thank you very much, this is really helpful... i made some changes for it to work: ``` dataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f"/content/data/mask_{idx}.png"}, with_indices=True).cast_column("mask", Image()) ``` Thanks Again @Dref360
### Describe the bug ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) [<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>() ----> 1 dataset['train']['/workspace/data'] 3 frames [/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns) 518 def _check_valid_column_key(key: str, columns: List[str]) -> None: 519 if key not in columns: --> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}") 521 522 KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']" ``` ### Steps to reproduce the bug please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing ### Expected behavior add column to the dataset ### Environment info colab pro
146
Add new column to dataset ### Describe the bug ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) [<ipython-input-9-bd197b36b6a0>](https://localhost:8080/#) in <cell line: 1>() ----> 1 dataset['train']['/workspace/data'] 3 frames [/usr/local/lib/python3.10/dist-packages/datasets/formatting/formatting.py](https://localhost:8080/#) in _check_valid_column_key(key, columns) 518 def _check_valid_column_key(key: str, columns: List[str]) -> None: 519 if key not in columns: --> 520 raise KeyError(f"Column {key} not in the dataset. Current columns in the dataset: {columns}") 521 522 KeyError: "Column train not in the dataset. Current columns in the dataset: ['image', '/workspace/data']" ``` ### Steps to reproduce the bug please find the notebook for reference: https://colab.research.google.com/drive/10lZ_zLtU4itYVmIVTvIEVbjfOtCZaAZy?usp=sharing ### Expected behavior add column to the dataset ### Environment info colab pro > I think there is a slight misunderstanding. > > ```python > new_column = ["mask"] * len(dataset["train"]) > dataset['train'] = dataset['train'].add_column("/workspace/data", new_column) > ``` > > adds a column with the string `mask` to your dataset. If you're trying to load the images `"mask_{idx}.png"` in your dataset, you could try: > > ``` > from datasets import Image > > dataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f"/workspace/data/mask_{idx}.png", with_indices=True).cast_column("mask", Image()) > ``` > > What this does is that it adds a column to your dataset name `mask` with the path to the mask, then it cast the column as an `Image` feature. > > This [link](https://huggingface.co/docs/datasets/v2.5.1/en/image_load) explains how to load images. > > Hope this helps! Thank you very much, this is really helpful... i made some changes for it to work: ``` dataset['train'] = dataset['train'].map(lambda u, idx: {'mask': f"/content/data/mask_{idx}.png"}, with_indices=True).cast_column("mask", Image()) ``` Thanks Again @Dref360
[ 0.14726783335208893, 0.10069901496171951, 0.059426747262477875, -0.08335201442241669, 0.25141480565071106, 0.11585776507854462, 0.14575009047985077, -0.005481118801981211, -0.11845265328884125, 0.10759371519088745, -0.028249749913811684, -0.06671489030122757, -0.11098049581050873, 0.13261397182941437, 0.28461354970932007, -0.07688368856906891, 0.028272463008761406, -0.03838929161429405, 0.015000054612755775, 0.1291961818933487, -0.16041387617588043, -0.07566110789775848, 0.03270481899380684, -0.1398429423570633, -0.08810371160507202, -0.01838860660791397, -0.2937343120574951, 0.03564216569066048, -0.005701709538698196, -0.12016481906175613, 0.06887287646532059, -0.10194902867078781, 0.06909702718257904, -0.0021406651940196753, 0.000005023498943046434, -0.00444498285651207, 0.13326410949230194, -0.08906447887420654, 0.06835532188415527, -0.2590806484222412, -0.04165760800242424, -0.11578771471977234, -0.06427733600139618, -0.08280420303344727, -0.019076861441135406, 0.019565142691135406, -0.06896135956048965, 0.09114473313093185, 0.045991357415914536, 0.16562604904174805, -0.026584409177303314, -0.025522347539663315, -0.03566189482808113, -0.1398056447505951, 0.052145954221487045, 0.007949084974825382, 0.016012487933039665, 0.125704824924469, -0.34919729828834534, -0.0917113721370697, -0.015744157135486603, -0.04591875895857811, 0.08247964829206467, -0.021564273163676262, -0.12535923719406128, 0.011524018831551075, -0.24385520815849304, -0.21706092357635498, -0.03376737982034683, 0.0937902182340622, -0.06473448872566223, -0.05826083943247795, 0.1056353822350502, -0.017203116789460182, 0.23079782724380493, -0.21964414417743683, 0.037323448807001114, -0.03755655884742737, 0.011979094706475735, -0.046762868762016296, 0.0826854258775711, -0.15027755498886108, -0.012414039112627506, 0.08597498387098312, -0.044725339859724045, -0.028880510479211807, -0.20341812074184418, 0.05394819751381874, -0.11579612642526627, -0.04756893590092659, 0.08122299611568451, -0.06101652979850769, -0.20996521413326263, 0.02842068299651146, -0.01741841435432434, -0.007316633127629757, 0.012195905670523643, -0.1661282628774643, 0.035358820110559464, -0.10487806051969528, -0.25480276346206665, -0.07779098302125931, 0.010007726028561592, 0.021247565746307373, 0.009062431752681732, -0.02506634220480919, -0.18176934123039246, 0.04957730695605278, 0.054175183176994324, -0.004110775887966156, -0.03780893236398697, 0.09061463922262192, -0.06884058564901352, -0.08581734448671341, 0.125990092754364, 0.12057896703481674, 0.029646065086126328, 0.20135098695755005, -0.013336580246686935, 0.13901802897453308, 0.002836798783391714, -0.10744821280241013, -0.011536683887243271, 0.21553963422775269, 0.08557672798633575, -0.1718617081642151, 0.043338876217603683, 0.05607897415757179, 0.0337795689702034, 0.023343347012996674, -0.010711884126067162, 0.08716588467359543, 0.001942089176736772, -0.05135840177536011, 0.05027014762163162, -0.13544102013111115, -0.09460475295782089, 0.039674922823905945, -0.017286447808146477, -0.23931092023849487, -0.14423000812530518, -0.07110292464494705, -0.00997521635144949, 0.025816868990659714, 0.011198194697499275, 0.01392242219299078, 0.04756980761885643, -0.05428330600261688, -0.006172889843583107, 0.09978093951940536, -0.12866373360157013, 0.03540070727467537, -0.2631051540374756, 0.09966010600328445, -0.03632019832730293, -0.06452802568674088, -0.2129380851984024, -0.15241165459156036, -0.11945803463459015, 0.027483342215418816, 0.05840766802430153, -0.026458855718374252, -0.06986787915229797, -0.13706959784030914, 0.15698082745075226, 0.27375471591949463, -0.08215690404176712, 0.043038804084062576, -0.02497812919318676, 0.12673139572143555, 0.07852773368358612, -0.08715666830539703, -0.06716768443584442, -0.012206117622554302, 0.01132954377681017, -0.05669589340686798, -0.07300549745559692, 0.1667773276567459, -0.18492768704891205, -0.06308241933584213, -0.02507893554866314, -0.049731478095054626, 0.10856328904628754, -0.02960967645049095, 0.08366438001394272, 0.15031927824020386, -0.03358872979879379, 0.00906058494001627, 0.08600611984729767, -0.2049543559551239, -0.05784592404961586, 0.14405415952205658, -0.060690250247716904, -0.022806312888860703, -0.0038531008176505566, 0.007906089536845684, 0.020757969468832016, -0.07266305387020111, -0.11307885497808456, -0.19310837984085083, -0.04624098539352417, -0.10197744518518448, 0.2986372709274292, -0.011847327463328838, -0.06771824508905411, -0.06125651299953461, -0.11575499922037125, -0.1114141196012497, 0.12560898065567017, -0.18583722412586212, 0.04143316671252251, -0.0505497120320797, -0.05675225332379341, -0.0663495734333992, -0.1341448575258255, -0.03282233700156212, -0.10635706037282944, -0.05943097174167633, -0.08596201986074448, 0.06629204750061035, 0.033954229205846786, 0.16182714700698853, 0.04630422964692116, 0.1499718874692917, 0.07547346502542496, 0.097279392182827, -0.03841216117143631, -0.06154881790280342, -0.06117160990834236, 0.16583697497844696, -0.028208160772919655, -0.11140451580286026, 0.04542123153805733, 0.10420843958854675, -0.1577882617712021, 0.022694675251841545, -0.02444806508719921, -0.13796278834342957, 0.01884397678077221, 0.19406680762767792, -0.2580184042453766, 0.03074664995074272, -0.035799697041511536, -0.00989281851798296, -0.1308562308549881, 0.11982031911611557, -0.06695720553398132, -0.04079616814851761, -0.0017419620417058468, -0.05134536325931549, 0.08167902380228043, 0.09998736530542374, 0.021114042028784752, -0.07420587539672852, -0.09440832585096359, -0.0735178291797638, 0.045630693435668945, 0.11142753064632416, 0.04171445965766907, -0.05147875100374222, 0.16866829991340637, 0.02440779097378254, -0.06566303223371506, -0.002248346572741866, 0.034428421407938004, -0.0745101347565651, 0.10641973465681076, 0.1714615374803543, 0.13811004161834717, 0.1569334864616394, 0.008416909724473953, -0.1348661333322525, -0.1631815880537033, -0.06309632211923599, 0.05901890620589256, -0.13108733296394348, -0.0782339870929718, -0.031708672642707825, 0.13403883576393127, 0.050665464252233505, 0.08221182972192764, 0.023581283167004585, 0.13047336041927338, -0.07440315186977386, 0.08067211508750916, 0.1715586632490158, -0.015966592356562614, -0.03236720338463783, -0.06094572693109512, 0.1649061143398285, 0.1180214062333107, -0.1150628924369812, 0.01369401067495346, 0.04547332599759102, 0.022898532450199127, -0.05254277586936951, 0.16260644793510437, -0.0645056813955307, -0.11686278134584427, -0.035572316497564316, -0.10633237659931183, 0.20689985156059265, 0.30759820342063904, 0.07576410472393036, 0.08648494631052017, 0.037550121545791626, 0.20735815167427063, 0.22077061235904694, -0.12908203899860382, -0.05858703702688217, -0.13850106298923492, -0.09071283787488937, -0.10655015707015991, 0.18123416602611542, 0.08599188923835754, 0.07301580905914307, -0.19573500752449036, -0.1841055154800415, 0.05201774090528488, 0.1186491847038269, -0.07679738104343414, 0.07940469682216644, -0.02743181213736534, 0.061119385063648224, 0.008622048422694206, -0.043882109224796295, -0.11181043833494186, -0.021752869710326195, 0.014008153229951859, 0.12469954043626785, -0.060128096491098404, 0.10129544883966446, 0.12318971753120422, -0.15483050048351288, 0.21306011080741882, -0.15917447209358215, -0.10831252485513687, 0.15442396700382233, 0.16643092036247253, -0.08087258040904999, -0.017421960830688477, 0.06822129338979721, -0.23747271299362183, -0.07905906438827515, -0.0023244190961122513, -0.1707485020160675, 0.05966417118906975, -0.08126822859048843, 0.16344259679317474, -0.07082965224981308, -0.01040488202124834, 0.09986409544944763, 0.07129639387130737, -0.1172252967953682, -0.11037158221006393, 0.04957874119281769, -0.13544602692127228, 0.2929088771343231, 0.06894826889038086, 0.02428249455988407, 0.18820244073867798, 0.1071796789765358, -0.0568695068359375, -0.06389188766479492, -0.14714258909225464, 0.24751123785972595, -0.0787956491112709, 0.20801524817943573, -0.019459441304206848, -0.16764512658119202, -0.03662834316492081, -0.09174264967441559, -0.018120698630809784, 0.03128312900662422, -0.10008890926837921, 0.04507289454340935, 0.10666843503713608, -0.14435191452503204, 0.1527961641550064, 0.11931176483631134, 0.044419679790735245, -0.10029803216457367, 0.000021156864022486843, 0.06044645234942436, 0.0948173850774765, -0.16434206068515778, -0.012876796536147594, 0.06114640459418297, -0.1094907894730568, 0.1246882900595665, -0.10689891874790192, 0.07080386579036713, -0.12044312804937363, 0.08385691791772842, -0.10567758977413177, 0.07961998879909515, 0.18385808169841766, 0.11042306572198868, 0.08231117576360703, 0.05157485604286194, 0.16057991981506348, 0.0361846499145031, -0.14845392107963562, -0.2218843698501587, 0.17805027961730957, 0.1462678760290146, 0.019779231399297714, -0.01321132481098175, -0.023623546585440636, -0.13554494082927704, 0.013581468723714352, 0.201555535197258, -0.00615732604637742, 0.09306293725967407, 0.3286859095096588, 0.12794771790504456, -0.21273060142993927, -0.07269763201475143, -0.06554305553436279, -0.17443589866161346, -0.2569960951805115, 0.10173314064741135, -0.03659196197986603, 0.10946930944919586, 0.11059079319238663, -0.04443242400884628, -0.07938417047262192, -0.013252902776002884, 0.04069487750530243, 0.010273377411067486, 0.043034523725509644, 0.35896357893943787, 0.06959398090839386, -0.13530154526233673, -0.02781757153570652, 0.08257743716239929, 0.2770971357822418, -0.28372833132743835, 0.133626788854599, -0.22133682668209076, -0.12422871589660645, 0.0954919308423996, -0.00022166097187437117, 0.006773011758923531, 0.04965226352214813, -0.20836474001407623, -0.1494535505771637, -0.024442655965685844, 0.03894524648785591, 0.23224878311157227, -0.06301435828208923, 0.026863232254981995, -0.200887992978096, -0.011221340857446194, -0.022912316024303436, -0.02995043247938156, 0.03983628749847412, -0.0188840813934803, 0.039002180099487305, 0.11321357637643814, -0.17367340624332428, -0.1060713455080986, -0.14263412356376648, 0.13022182881832123, 0.08609186857938766, -0.007018242031335831, 0.2179006040096283, 0.020975159481167793, 0.0340321846306324, -0.07967723906040192, -0.1079750657081604, 0.033235106617212296, -0.08939657360315323, 0.06953096389770508, -0.012250756844878197, 0.0011062149424105883, -0.010089402087032795, -0.0644044429063797, 0.2885603606700897, 0.09931948781013489, 0.04929393529891968, -0.0315556637942791, -0.0027928047347813845, -0.007447707932442427, -0.0161441620439291, 0.15857712924480438, -0.006826294586062431, -0.08672602474689484, 0.011293760500848293, -0.0882643610239029, -0.12625081837177277, -0.0017634418327361345, 0.009414413012564182, 0.08096810430288315, 0.03606832027435303, -0.08849329501390457, -0.10231418907642365, 0.06451383233070374, -0.08089514821767807, 0.2633903920650482, 0.04510726407170296, 0.027874791994690895, 0.006146694533526897, -0.030245346948504448, -0.0018771562026813626, -0.15262417495250702, 0.06445246189832687, 0.04760259389877319, 0.09182257950305939, -0.15386909246444702, 0.0948491171002388, 0.00844559632241726, -0.012357157655060291, 0.16165098547935486, 0.06676561385393143, -0.03327134624123573, -0.13899847865104675, -0.06947126239538193, -0.016336839646100998, 0.042283572256565094, -0.19130952656269073, 0.045560721307992935, -0.00021236107568256557, -0.21054138243198395, 0.0019577278289943933, -0.13133785128593445, 0.062333088368177414, -0.13259705901145935, 0.0823795273900032, 0.1535789519548416, 0.19709084928035736, 0.16942855715751648, 0.1008513793349266, -0.04640403389930725, 0.06701631098985672, 0.16710753738880157, 0.24676312506198883, -0.07268674671649933, 0.07833106070756912, 0.07642583549022675, 0.03742951527237892, -0.27886444330215454, -0.14533010125160217, 0.09691978991031647, 0.15399576723575592, -0.0301494337618351, -0.04167819768190384, -0.09812653064727783, 0.03299974650144577, -0.034855376929044724, 0.04989393427968025, 0.1002560555934906, 0.17533168196678162, -0.0510525107383728, -0.03411995247006416, -2.3219767663823117e-32, 0.010146369226276875, -0.1918034851551056, 0.007676468230783939, 0.15731559693813324, -0.05417390540242195, -0.017880819737911224, -0.017364265397191048, 0.030800819396972656, 0.10360022634267807, 0.06629832834005356, -0.03141634911298752, 0.04118676856160164, -0.04604155942797661, 0.01723705790936947, -0.062023889273405075, -0.030657067894935608, 0.01171212550252676, 0.03693666309118271, 0.11424995213747025, 0.04514935985207558, 0.01592239923775196, 0.0573640838265419, -0.00691043259575963, -0.08710978925228119, -0.04478306695818901, -0.04062194377183914, -0.08174876868724823, -0.12229868769645691, -0.08957827091217041, 0.10435096174478531, -0.004240603651851416, 0.17951378226280212, 0.18768300116062164, -0.09406843036413193, -0.0072695063427090645, -0.0001999292435357347, -0.07954007387161255, 0.0953647568821907, -0.2097284495830536, 0.033027663826942444, -0.08821248263120651, 0.09896233677864075, 0.07574209570884705, -0.049534983932971954, 0.13543735444545746, 0.15597550570964813, -0.12585626542568207, -0.181289941072464, 0.07933411002159119, -0.06274344772100449, 0.22660015523433685, 0.05005886033177376, 0.03033691830933094, -0.0400141216814518, 0.11296700686216354, -0.13532303273677826, 0.07419601827859879, -0.11984143406152725, -0.09594013541936874, -0.05171317607164383, 0.17468126118183136, 0.017441043630242348, -0.021170277148485184, 0.014922589994966984, -0.037359122186899185, -0.08059242367744446, 0.149860218167305, 0.012352412566542625, 0.2006453275680542, 0.00424419529736042, -0.15800581872463226, 0.18223775923252106, 0.030119718983769417, 0.043009690940380096, -0.2014990746974945, 0.08675267547369003, -0.21219396591186523, -0.10571194440126419, -0.06942680478096008, -0.11861841380596161, -0.14533032476902008, -0.025805851444602013, 0.05125676095485687, 0.008067198097705841, 0.023774903267621994, 0.1465437412261963, -0.025830158963799477, 0.14693154394626617, 0.060601990669965744, -0.018400542438030243, -0.10233084857463837, 0.20564918220043182, -0.0551595464348793, -0.06822234392166138, 0.03301782160997391, 0.024475080892443657, -0.06354860961437225, 0.06269269436597824, -0.06718722730875015, -0.06512686610221863, 0.08928054571151733, -0.008174694143235683, 0.07954146713018417, 0.020525094121694565, 0.2047969102859497, -0.00002758467053354252, 0.23598667979240417, 0.27005735039711, -0.21541903913021088, 0.006982181221246719, -0.012961872853338718, 0.06507992744445801, 0.13410836458206177, 0.1720181554555893, -0.0552036426961422, -0.005786489695310593, -0.03828580677509308, -0.026076745241880417, 0.16509124636650085, 0.042424287647008896, -0.1744329333305359, -0.08284281194210052, -0.17187760770320892, -0.03568601980805397, 0.014858340844511986, 0.03141600638628006, -0.09137966483831406, 0.003196639008820057, 0.09486448019742966, -0.026972493156790733, -0.05737628415226936, -0.0820700079202652, 7.53546203213773e-7, -0.20684829354286194, 0.01933390460908413, -0.04614003375172615, -0.07928889989852905, -0.056944962590932846, 0.15825673937797546, -0.09314964711666107, 0.15704242885112762, -0.11006443202495575, 0.07907065004110336, 0.0429435558617115, -0.30181804299354553, -0.06929559260606766, -0.15178938210010529, 0.0646059587597847, 0.023880286142230034, -0.028128134086728096, 0.03605136275291443, -0.10377448052167892, 0.06676766276359558, 0.16324461996555328, 0.033300016075372696, 0.0022345385514199734, 0.011699303053319454, 0.08000951260328293, -0.003427166258916259, -0.08202443271875381, 0.026838788762688637, -0.03917667642235756, 0.03842368721961975, 0.05244288593530655, 0.17332784831523895, -0.10115202516317368, 0.24756485223770142, -0.16183799505233765, -0.05354410037398338, -0.1606844663619995, -0.028303980827331543, 0.021240130066871643, 0.02951543778181076, 0.0494532585144043, 0.15998946130275726, -0.022695783525705338, -0.08122149854898453, -0.03734670579433441, 0.11526934802532196, 0.03676599636673927, 0.03211865946650505, -0.01996641606092453, 0.035620640963315964, -0.07745027542114258, 0.10054473578929901, 0.10873540490865707, -0.015005209483206272, -0.07733522355556488, 0.1634131222963333, 0.10768890380859375, -0.18367113173007965, 0.028555598109960556, -0.00852515734732151, -0.041728634387254715, -0.039081159979104996, -0.0360494926571846, -0.11413731426000595, 0.09546029567718506, -0.08393079787492752, -0.053231194615364075, 1.7585997010801256e-34, -0.14344030618667603, -0.03582589700818062, 0.17019023001194, -0.11153442412614822, 0.1154697835445404, 0.05083179846405983, 0.0855310931801796, -0.03381367400288582, 0.15054821968078613, -0.049008093774318695, -0.03329906985163689 ]
https://github.com/huggingface/datasets/issues/6242
Data alteration when loading dataset with unspecified inner sequence length
While this issue may seem specific, it led to a silent problem in my workflow that took days to diagnose. If this feature is not intended to be supported, an error should be raised when encountering this configuration to prevent such issues.
### Describe the bug When a dataset saved with a specified inner sequence length is loaded without specifying that length, the original data is altered and becomes inconsistent. ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Value, Sequence, load_dataset # Repository ID repo_id = "my_repo_id" # Define features with a specific length of 3 for each inner sequence specified_features = Features({"key": Sequence(Sequence(Value("float32"), length=3))}) # Create a dataset with the specified features data = [ [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]], ] dataset = Dataset.from_dict({"key": data}, features=specified_features) # Push the dataset to the hub dataset.push_to_hub(repo_id) # Define features without specifying the length unspecified_features = Features({"key": Sequence(Sequence(Value("float32")))}) # Load the dataset from the hub with this new feature definition dataset = load_dataset(f"qgallouedec/{repo_id}", split="train", features=unspecified_features) # The obtained data is altered print(dataset.to_dict()) # {'key': [[[1.0], [2.0]], [[3.0], [4.0]]]} ``` ### Expected behavior ```python print(dataset.to_dict()) # {'key': [[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]]]} ``` ### Environment info - `datasets` version: 2.14.4 - Platform: Linux-6.2.0-32-generic-x86_64-with-glibc2.35 - Python version: 3.9.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.3
42
Data alteration when loading dataset with unspecified inner sequence length ### Describe the bug When a dataset saved with a specified inner sequence length is loaded without specifying that length, the original data is altered and becomes inconsistent. ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Value, Sequence, load_dataset # Repository ID repo_id = "my_repo_id" # Define features with a specific length of 3 for each inner sequence specified_features = Features({"key": Sequence(Sequence(Value("float32"), length=3))}) # Create a dataset with the specified features data = [ [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]], ] dataset = Dataset.from_dict({"key": data}, features=specified_features) # Push the dataset to the hub dataset.push_to_hub(repo_id) # Define features without specifying the length unspecified_features = Features({"key": Sequence(Sequence(Value("float32")))}) # Load the dataset from the hub with this new feature definition dataset = load_dataset(f"qgallouedec/{repo_id}", split="train", features=unspecified_features) # The obtained data is altered print(dataset.to_dict()) # {'key': [[[1.0], [2.0]], [[3.0], [4.0]]]} ``` ### Expected behavior ```python print(dataset.to_dict()) # {'key': [[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]]]} ``` ### Environment info - `datasets` version: 2.14.4 - Platform: Linux-6.2.0-32-generic-x86_64-with-glibc2.35 - Python version: 3.9.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 While this issue may seem specific, it led to a silent problem in my workflow that took days to diagnose. If this feature is not intended to be supported, an error should be raised when encountering this configuration to prevent such issues.
[ 0.18974488973617554, 0.1245463564991951, -0.18884554505348206, -0.04329124093055725, 0.13514752686023712, -0.04477037861943245, 0.022553425282239914, 0.08493970334529877, -0.10627350211143494, 0.16383560001850128, 0.11580859124660492, -0.08464913070201874, 0.24762342870235443, -0.05179527774453163, 0.036125943064689636, 0.028078150004148483, 0.2071477174758911, -0.030683279037475586, -0.00839142594486475, 0.016374776139855385, -0.09157762676477432, -0.05114255100488663, 0.07253694534301758, -0.15140175819396973, -0.12495261430740356, -0.04135030508041382, -0.19024214148521423, 0.12420506775379181, -0.01386377215385437, -0.09743892401456833, 0.1018807515501976, 0.23867224156856537, -0.07462439686059952, 0.16887089610099792, 0.000004980063295079162, 0.06968045234680176, -0.01772748865187168, -0.14979083836078644, 0.032286908477544785, 0.025191690772771835, -0.07801368087530136, -0.03625701740384102, 0.09793567657470703, -0.10372285544872284, -0.1013987585902214, 0.11106572300195694, -0.14406326413154602, 0.026577835902571678, 0.03957216814160347, 0.08515619486570358, -0.024343786761164665, 0.10078134387731552, -0.06192200258374214, -0.12539821863174438, 0.1769370436668396, 0.09594669938087463, 0.078828826546669, 0.10738062113523483, -0.05305517092347145, 0.12145598977804184, -0.09965404868125916, -0.1976531594991684, -0.06543903797864914, 0.23113802075386047, -0.09111493080854416, -0.05871147662401199, -0.16348469257354736, -0.14369535446166992, -0.07762004435062408, 0.10064972937107086, -0.21965858340263367, -0.06664350628852844, 0.05573778972029686, 0.06262628734111786, 0.22041766345500946, -0.13016407191753387, 0.06836234033107758, 0.12246646732091904, 0.05101729929447174, -0.08886756747961044, -0.15048985183238983, 0.045682311058044434, -0.03467933088541031, 0.0064020175486803055, -0.2886202931404114, 0.04341425001621246, -0.10701485723257065, 0.029331406578421593, -0.32059693336486816, -0.08695929497480392, -0.14046773314476013, -0.1351119577884674, -0.28631991147994995, -0.16751523315906525, -0.028776368126273155, 0.06319671869277954, -0.06205451115965843, -0.05301829054951668, 0.03557893633842468, -0.028568625450134277, -0.2066051959991455, 0.06776964664459229, -0.10445161908864975, -0.16222961246967316, -0.00043633210589177907, 0.05729984492063522, 0.03497461602091789, 0.06988582015037537, 0.12290988117456436, 0.12113745510578156, -0.13833464682102203, 0.06330469995737076, 0.044859446585178375, 0.10468369722366333, 0.1547979712486267, -0.07345359027385712, 0.13239696621894836, 0.0856165885925293, 0.05816788226366043, 0.2521247863769531, -0.10015477985143661, 0.12049578130245209, -0.06355292350053787, 0.1619037538766861, 0.037421904504299164, 0.10591352730989456, -0.10366987437009811, 0.1207289770245552, -0.09518332779407501, 0.10305456817150116, -0.1169399693608284, -0.12306245416402817, -0.044134657829999924, 0.033263079822063446, -0.004728237167000771, 0.013238118961453438, 0.15575316548347473, -0.009602393954992294, 0.08949166536331177, -0.1970510482788086, -0.1306159496307373, -0.07818279415369034, 0.106473907828331, 0.017678791657090187, -0.02306516095995903, 0.030863678082823753, 0.025300605222582817, -0.11473704129457474, 0.018511537462472916, 0.053705308586359024, -0.2739183306694031, 0.1561737209558487, -0.23004694283008575, 0.012601693160831928, -0.1273822784423828, 0.05684376135468483, 0.05760755389928818, -0.04101362079381943, -0.07328159362077713, -0.06343914568424225, 0.18825063109397888, -0.023736437782645226, -0.027607260271906853, -0.16307677328586578, -0.01656397432088852, 0.09229178726673126, 0.08109505474567413, -0.039564348757267, 0.09052183479070663, 0.011794987134635448, 0.10986316204071045, -0.024358483031392097, 0.11009998619556427, -0.15596580505371094, 0.02244330197572708, 0.31441861391067505, -0.013494981452822685, -0.09892355650663376, -0.38057902455329895, 0.04440538212656975, 0.12528207898139954, 0.22749879956245422, 0.004056107718497515, -0.14845506846904755, 0.13485243916511536, -0.02939058654010296, -0.02398780919611454, 0.0038628436159342527, 0.0021293365862220526, 0.012778078205883503, -0.16051281988620758, 0.012700192630290985, -0.06196978688240051, -0.16510070860385895, -0.10615979135036469, -0.08043096214532852, 0.02731577679514885, 0.053172528743743896, 0.0948450043797493, -0.12551665306091309, 0.05098773539066315, -0.008870480582118034, 0.13247907161712646, 0.03747832402586937, -0.04032007232308388, -0.05165616422891617, -0.22875314950942993, 0.05029698461294174, -0.08098349720239639, -0.15339328348636627, -0.22873273491859436, 0.04861371964216232, -0.1703483909368515, 0.054214898496866226, -0.20288397371768951, 0.0016466733068227768, -0.09989074617624283, -0.05429802089929581, -0.03703996166586876, 0.17398840188980103, 0.06363850086927414, 0.14425013959407806, -0.059577856212854385, 0.07540645450353622, -0.02098582498729229, 0.20550686120986938, 0.033059798181056976, -0.048447199165821075, -0.09643567353487015, 0.131582111120224, 0.05007396265864372, -0.00945895817130804, 0.10806384682655334, 0.15206630527973175, 0.00462158489972353, 0.07110567390918732, -0.15617972612380981, -0.1533777117729187, 0.26506495475769043, 0.09526372700929642, 0.00005521372440853156, 0.017783137038350105, -0.07806713879108429, -0.06199184060096741, -0.022184856235980988, -0.04530385881662369, -0.03208247199654579, 0.06763608753681183, -0.09542936086654663, -0.10464300215244293, 0.26378998160362244, 0.13371862471103668, -0.112782321870327, -0.029405247420072556, -0.00937279686331749, 0.01575140655040741, 0.11901846528053284, 0.1297251284122467, 0.05504761263728142, 0.10761674493551254, 0.31310027837753296, -0.03310199826955795, -0.10609368979930878, -0.03379446640610695, -0.05983998626470566, -0.198543980717659, -0.06447193771600723, 0.12664726376533508, -0.016062382608652115, 0.047380782663822174, 0.06425238400697708, -0.026847325265407562, -0.10363851487636566, -0.09007957577705383, -0.12281110137701035, -0.021427687257528305, -0.10010052472352982, 0.06386468559503555, 0.03711049258708954, 0.11730003356933594, 0.0679938793182373, 0.1208929792046547, 0.11610008031129837, -0.06812682002782822, 0.07285698503255844, 0.16804389655590057, -0.0969414934515953, 0.04252539575099945, -0.24007834494113922, -0.10763074457645416, -0.1723983734846115, -0.15408942103385925, 0.08355788141489029, -0.0830797404050827, 0.0640401542186737, -0.05254298076033592, 0.13912859559059143, -0.1406528204679489, 0.20339198410511017, -0.07483002543449402, 0.037181176245212555, 0.11430902034044266, 0.09232418984174728, -0.049677617847919464, -0.06788726896047592, 0.0739690363407135, 0.0460551418364048, 0.028757315129041672, -0.19024303555488586, -0.036650702357292175, -0.018624108284711838, -0.15834130346775055, -0.03682529553771019, 0.16037358343601227, 0.0066111208871006966, 0.10649899393320084, 0.042826879769563675, -0.08690166473388672, -0.12428059428930283, 0.16078384220600128, -0.013370329514145851, 0.12487368285655975, 0.005761854350566864, -0.15334832668304443, 0.1264384239912033, -0.020185286179184914, 0.0618174709379673, -0.05504826456308365, -0.1075020357966423, 0.11272736638784409, 0.0835605338215828, 0.06352203339338303, -0.07840335369110107, -0.2891319692134857, 0.15708954632282257, -0.08839229494333267, -0.16859184205532074, 0.09743590652942657, 0.09398110955953598, -0.014682868495583534, 0.046766459941864014, 0.09013167023658752, -0.1425124853849411, 0.019838277250528336, 0.21783430874347687, -0.1346331536769867, -0.10861710458993912, -0.1598670780658722, 0.1430644392967224, 0.060711756348609924, -0.05718132108449936, 0.00842408835887909, -0.1258181631565094, 0.08822965621948242, -0.16270433366298676, 0.0461387112736702, -0.008062545210123062, 0.08903283625841141, 0.04600244387984276, 0.1348198801279068, -0.02581319957971573, -0.1541898101568222, -0.14739990234375, 0.08313291519880295, 0.03615722060203552, 0.14393462240695953, -0.10628645867109299, -0.13230188190937042, -0.003709010314196348, -0.046775322407484055, -0.05958730727434158, 0.0546303354203701, 0.006863250397145748, -0.05035979673266411, 0.07046901434659958, -0.022653749212622643, 0.215457022190094, -0.13477066159248352, 0.04323537275195122, -0.00311614410020411, -0.03810795024037361, -0.1714039295911789, -0.09009582549333572, 0.09169650077819824, 0.12561433017253876, -0.004296957515180111, -0.056935764849185944, -0.056981585919857025, -0.13285145163536072, 0.08468201756477356, 0.11427479237318039, -0.05969005450606346, -0.09889417886734009, 0.042169734835624695, 0.049042463302612305, 0.12893445789813995, 0.38672709465026855, 0.19727987051010132, -0.05741729214787483, 0.17919279634952545, 0.01152857206761837, 0.03683699667453766, -0.043947841972112656, 0.03840690478682518, 0.2469053715467453, 0.1117125004529953, -0.015913208946585655, -0.11066443473100662, -0.002716599265113473, 0.004464783240109682, -0.008121716789901257, 0.18161684274673462, 0.07945584505796432, -0.0306800976395607, 0.1400051862001419, 0.10236577689647675, -0.04535115882754326, 0.03369980305433273, 0.010731817223131657, 0.007326933089643717, -0.16191382706165314, -0.19850018620491028, 0.09251678735017776, 0.0628093034029007, -0.05687066540122032, -0.012276099994778633, -0.05807669088244438, -0.10452264547348022, 0.0770040899515152, 0.012701216153800488, 0.14269958436489105, 0.06314471364021301, 0.04261597990989685, 0.02210690826177597, 0.1587262898683548, -0.08862470090389252, 0.2551489472389221, 0.0305731613188982, -0.11675982922315598, -0.008527740836143494, -0.29053688049316406, -0.11539177596569061, -0.06942696124315262, -0.025175686925649643, 0.24516084790229797, -0.10336099565029144, -0.041749078780412674, -0.05158120021224022, 0.029789650812745094, 0.09487507492303848, -0.1313740760087967, -0.059539541602134705, 0.029586495831608772, 0.006532812025398016, 0.049282852560281754, -0.02700311690568924, -0.11996222287416458, -0.21623878180980682, -0.0043418616987764835, 0.11005354672670364, -0.11223118007183075, -0.07583418488502502, 0.14125433564186096, 0.13635936379432678, 0.061458148062229156, -0.0591428242623806, 0.06214018911123276, -0.11678307503461838, 0.11428136378526688, -0.08567545562982559, -0.15690679848194122, 0.029733330011367798, 0.014263521879911423, 0.014572431333363056, 0.007077816873788834, 0.08423512428998947, -0.01695479080080986, -0.05209623649716377, 0.0018081223824992776, -0.06061438471078873, 0.046111319214105606, 0.04999969154596329, 0.03726539388298988, -0.02831369638442993, 0.06476370245218277, 0.18455614149570465, 0.018728455528616905, 0.007157869171351194, 0.06734305620193481, 0.0419134646654129, -0.051982659846544266, 0.040112197399139404, 0.04037013649940491, 0.09248590469360352, -0.1684972196817398, -0.014101476408541203, 0.0005718432948924601, -0.11275599151849747, 0.028082801029086113, 0.03931267186999321, 0.14016267657279968, 0.03325800597667694, 0.13950559496879578, 0.04436434060335159, -0.05647186189889908, 0.026850484311580658, 0.0015537813305854797, -0.11834528297185898, 0.1319178193807602, -0.05374407768249512, -0.08063242584466934, -0.029101716354489326, -0.028823893517255783, -0.0350254662334919, -0.021356163546442986, 0.026966046541929245, -0.21232739090919495, 0.06425953656435013, -0.07274892926216125, 0.03996386379003525, 0.19387181103229523, -0.07790254056453705, 0.0010283415904268622, -0.1687416136264801, 0.21189163625240326, -0.08004245162010193, -0.07416781038045883, -0.20630179345607758, 0.15716491639614105, 0.17807750403881073, 0.09804187715053558, 0.222647562623024, 0.012924601323902607, -0.06586157530546188, -0.09068994969129562, 0.06867428869009018, 0.1959213763475418, -0.09652592986822128, -0.07736022025346756, -0.062470693141222, 0.02037143148481846, -0.13199178874492645, -0.05028355121612549, 0.010022047907114029, 0.0907609611749649, 0.05157008767127991, -0.01748935505747795, -0.047796811908483505, -0.11846597492694855, -0.0031843141186982393, 0.06983552873134613, -0.12533526122570038, -0.04391646385192871, -0.17080090939998627, -0.0023432786110788584, -2.4389850332527806e-32, 0.06671708822250366, -0.055612657219171524, -0.06156991049647331, -0.15610606968402863, 0.018623702228069305, 0.03957948088645935, -0.19225633144378662, -0.053231753408908844, 0.1068219244480133, -0.10740301012992859, -0.13636992871761322, -0.01193787157535553, 0.025084113702178, -0.10243257880210876, 0.09226633608341217, -0.02550046145915985, 0.21878935396671295, -0.07385805994272232, -0.019703112542629242, 0.15908783674240112, 0.07438365370035172, 0.1881525069475174, 0.12050379812717438, 0.26259079575538635, 0.1618165224790573, -0.03835080564022064, -0.015054137445986271, -0.20482049882411957, 0.02752397023141384, -0.11693407595157623, 0.013667799532413483, 0.03732963651418686, 0.03827356547117233, -0.09072304517030716, -0.15131959319114685, -0.22493672370910645, -0.09013970196247101, 0.00821036845445633, -0.03316584229469299, 0.14993135631084442, 0.02332071214914322, -0.054683323949575424, 0.1369713842868805, 0.019171468913555145, -0.06598629802465439, -0.0060563585720956326, 0.012448186986148357, 0.07020372897386551, -0.08866865187883377, 0.0815688818693161, 0.09681463241577148, -0.05459926649928093, 0.06736523658037186, 0.1269681304693222, 0.10843730717897415, -0.10556016117334366, 0.20888447761535645, 0.1337786167860031, -0.029839511960744858, 0.0798734724521637, 0.14551499485969543, 0.1023409441113472, -0.00639980286359787, -0.031549230217933655, -0.013318280689418316, -0.02445817179977894, 0.24865369498729706, 0.07415124028921127, 0.15978480875492096, 0.22955895960330963, 0.0027809194289147854, 0.09080874919891357, -0.049057867377996445, -0.15543709695339203, 0.09910302609205246, -0.11665469408035278, -0.06904082000255585, 0.049239277839660645, -0.2675427496433258, -0.007898963056504726, -0.1302615851163864, -0.10731272399425507, 0.16309863328933716, 0.07716858386993408, -0.1553238183259964, -0.10334871709346771, 0.036658283323049545, -0.0333712138235569, 0.002267409348860383, -0.14001330733299255, -0.05262435972690582, 0.19107207655906677, -0.041415948420763016, -0.07563687115907669, -0.14538390934467316, 0.25243109464645386, -0.255149781703949, 0.003433968871831894, -0.1393938809633255, 0.09748327732086182, 0.06598705798387527, -0.07258676737546921, 0.25213927030563354, -0.05652054399251938, 0.08520746976137161, 0.13977941870689392, 0.13708505034446716, 0.006461744662374258, -0.01715701073408127, 0.03166656196117401, 0.0601053349673748, -0.052228208631277084, 0.00622584717348218, 0.07349206507205963, 0.07351161539554596, -0.005266241729259491, -0.025129400193691254, -0.09778726100921631, 0.19523409008979797, 0.1487111896276474, 0.0029776880983263254, 0.049958836287260056, -0.1287277489900589, 0.10957415401935577, -0.13792620599269867, -0.08657044172286987, -0.10622069239616394, 0.04434197396039963, -0.010630734264850616, -0.008260841481387615, 0.05826539918780327, -0.04859068989753723, 7.38084054319188e-7, -0.2696467339992523, 0.11584010720252991, 0.08097361028194427, -0.14697015285491943, 0.0027267804834991693, 0.12067709863185883, -0.20731987059116364, 0.10584928840398788, -0.104772187769413, -0.08946344256401062, 0.06186559423804283, -0.11807192116975784, -0.12491850554943085, -0.10295271128416061, -0.025227129459381104, -0.1409662961959839, -0.0027079805731773376, 0.1379959136247635, -0.26656997203826904, 0.04967212304472923, 0.04844943434000015, 0.030855799093842506, -0.09742771834135056, -0.03426573798060417, 0.07366564869880676, 0.020812083035707474, -0.03132534399628639, 0.08991818130016327, 0.08443797379732132, -0.05191005393862724, 0.04975200816988945, -0.12107016146183014, 0.13191398978233337, 0.04912029206752777, -0.1094825267791748, 0.021265782415866852, -0.15256763994693756, -0.07292699068784714, -0.06320951133966446, -0.026162030175328255, -0.012691780924797058, 0.055340513586997986, 0.08370339125394821, 0.09614187479019165, 0.06372299045324326, 0.11885841190814972, 0.03148312866687775, 0.015461340546607971, 0.012789735570549965, 0.08186165243387222, 0.053922388702631, 0.05347819998860359, 0.11015691608190536, 0.2662339210510254, 0.0029531270265579224, 0.09965813159942627, 0.07153239101171494, -0.15495648980140686, 0.1849638968706131, -0.042644742876291275, -0.09855421632528305, -0.08474356681108475, -0.11083471029996872, 0.028211725875735283, 0.01284149568527937, -0.04388157278299332, 0.021366732195019722, 1.610337261840299e-34, -0.12031225860118866, -0.11527033150196075, 0.01818728819489479, -0.1706894487142563, -0.09086786955595016, -0.28393876552581787, 0.11624559760093689, 0.12218838185071945, -0.13357006013393402, -0.07494910806417465, -0.15122723579406738 ]
https://github.com/huggingface/datasets/issues/6242
Data alteration when loading dataset with unspecified inner sequence length
Thanks for reporting! This is a MRE: ```python import pyarrow as pa from datasets.table import cast_array_to_feature from datasets import Sequence, Value data = [ [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]], ] arr = pa.array(data, pa.list_(pa.list_(pa.float32(), 3))) cast_array_to_feature(arr, Sequence(Sequence(Value("float32")))) ``` I've opened a PR with a fix.
### Describe the bug When a dataset saved with a specified inner sequence length is loaded without specifying that length, the original data is altered and becomes inconsistent. ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Value, Sequence, load_dataset # Repository ID repo_id = "my_repo_id" # Define features with a specific length of 3 for each inner sequence specified_features = Features({"key": Sequence(Sequence(Value("float32"), length=3))}) # Create a dataset with the specified features data = [ [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]], ] dataset = Dataset.from_dict({"key": data}, features=specified_features) # Push the dataset to the hub dataset.push_to_hub(repo_id) # Define features without specifying the length unspecified_features = Features({"key": Sequence(Sequence(Value("float32")))}) # Load the dataset from the hub with this new feature definition dataset = load_dataset(f"qgallouedec/{repo_id}", split="train", features=unspecified_features) # The obtained data is altered print(dataset.to_dict()) # {'key': [[[1.0], [2.0]], [[3.0], [4.0]]]} ``` ### Expected behavior ```python print(dataset.to_dict()) # {'key': [[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]]]} ``` ### Environment info - `datasets` version: 2.14.4 - Platform: Linux-6.2.0-32-generic-x86_64-with-glibc2.35 - Python version: 3.9.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.3
52
Data alteration when loading dataset with unspecified inner sequence length ### Describe the bug When a dataset saved with a specified inner sequence length is loaded without specifying that length, the original data is altered and becomes inconsistent. ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Value, Sequence, load_dataset # Repository ID repo_id = "my_repo_id" # Define features with a specific length of 3 for each inner sequence specified_features = Features({"key": Sequence(Sequence(Value("float32"), length=3))}) # Create a dataset with the specified features data = [ [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]], ] dataset = Dataset.from_dict({"key": data}, features=specified_features) # Push the dataset to the hub dataset.push_to_hub(repo_id) # Define features without specifying the length unspecified_features = Features({"key": Sequence(Sequence(Value("float32")))}) # Load the dataset from the hub with this new feature definition dataset = load_dataset(f"qgallouedec/{repo_id}", split="train", features=unspecified_features) # The obtained data is altered print(dataset.to_dict()) # {'key': [[[1.0], [2.0]], [[3.0], [4.0]]]} ``` ### Expected behavior ```python print(dataset.to_dict()) # {'key': [[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]]]} ``` ### Environment info - `datasets` version: 2.14.4 - Platform: Linux-6.2.0-32-generic-x86_64-with-glibc2.35 - Python version: 3.9.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 Thanks for reporting! This is a MRE: ```python import pyarrow as pa from datasets.table import cast_array_to_feature from datasets import Sequence, Value data = [ [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]], ] arr = pa.array(data, pa.list_(pa.list_(pa.float32(), 3))) cast_array_to_feature(arr, Sequence(Sequence(Value("float32")))) ``` I've opened a PR with a fix.
[ 0.18974488973617554, 0.1245463564991951, -0.18884554505348206, -0.04329124093055725, 0.13514752686023712, -0.04477037861943245, 0.022553425282239914, 0.08493970334529877, -0.10627350211143494, 0.16383560001850128, 0.11580859124660492, -0.08464913070201874, 0.24762342870235443, -0.05179527774453163, 0.036125943064689636, 0.028078150004148483, 0.2071477174758911, -0.030683279037475586, -0.00839142594486475, 0.016374776139855385, -0.09157762676477432, -0.05114255100488663, 0.07253694534301758, -0.15140175819396973, -0.12495261430740356, -0.04135030508041382, -0.19024214148521423, 0.12420506775379181, -0.01386377215385437, -0.09743892401456833, 0.1018807515501976, 0.23867224156856537, -0.07462439686059952, 0.16887089610099792, 0.000004980063295079162, 0.06968045234680176, -0.01772748865187168, -0.14979083836078644, 0.032286908477544785, 0.025191690772771835, -0.07801368087530136, -0.03625701740384102, 0.09793567657470703, -0.10372285544872284, -0.1013987585902214, 0.11106572300195694, -0.14406326413154602, 0.026577835902571678, 0.03957216814160347, 0.08515619486570358, -0.024343786761164665, 0.10078134387731552, -0.06192200258374214, -0.12539821863174438, 0.1769370436668396, 0.09594669938087463, 0.078828826546669, 0.10738062113523483, -0.05305517092347145, 0.12145598977804184, -0.09965404868125916, -0.1976531594991684, -0.06543903797864914, 0.23113802075386047, -0.09111493080854416, -0.05871147662401199, -0.16348469257354736, -0.14369535446166992, -0.07762004435062408, 0.10064972937107086, -0.21965858340263367, -0.06664350628852844, 0.05573778972029686, 0.06262628734111786, 0.22041766345500946, -0.13016407191753387, 0.06836234033107758, 0.12246646732091904, 0.05101729929447174, -0.08886756747961044, -0.15048985183238983, 0.045682311058044434, -0.03467933088541031, 0.0064020175486803055, -0.2886202931404114, 0.04341425001621246, -0.10701485723257065, 0.029331406578421593, -0.32059693336486816, -0.08695929497480392, -0.14046773314476013, -0.1351119577884674, -0.28631991147994995, -0.16751523315906525, -0.028776368126273155, 0.06319671869277954, -0.06205451115965843, -0.05301829054951668, 0.03557893633842468, -0.028568625450134277, -0.2066051959991455, 0.06776964664459229, -0.10445161908864975, -0.16222961246967316, -0.00043633210589177907, 0.05729984492063522, 0.03497461602091789, 0.06988582015037537, 0.12290988117456436, 0.12113745510578156, -0.13833464682102203, 0.06330469995737076, 0.044859446585178375, 0.10468369722366333, 0.1547979712486267, -0.07345359027385712, 0.13239696621894836, 0.0856165885925293, 0.05816788226366043, 0.2521247863769531, -0.10015477985143661, 0.12049578130245209, -0.06355292350053787, 0.1619037538766861, 0.037421904504299164, 0.10591352730989456, -0.10366987437009811, 0.1207289770245552, -0.09518332779407501, 0.10305456817150116, -0.1169399693608284, -0.12306245416402817, -0.044134657829999924, 0.033263079822063446, -0.004728237167000771, 0.013238118961453438, 0.15575316548347473, -0.009602393954992294, 0.08949166536331177, -0.1970510482788086, -0.1306159496307373, -0.07818279415369034, 0.106473907828331, 0.017678791657090187, -0.02306516095995903, 0.030863678082823753, 0.025300605222582817, -0.11473704129457474, 0.018511537462472916, 0.053705308586359024, -0.2739183306694031, 0.1561737209558487, -0.23004694283008575, 0.012601693160831928, -0.1273822784423828, 0.05684376135468483, 0.05760755389928818, -0.04101362079381943, -0.07328159362077713, -0.06343914568424225, 0.18825063109397888, -0.023736437782645226, -0.027607260271906853, -0.16307677328586578, -0.01656397432088852, 0.09229178726673126, 0.08109505474567413, -0.039564348757267, 0.09052183479070663, 0.011794987134635448, 0.10986316204071045, -0.024358483031392097, 0.11009998619556427, -0.15596580505371094, 0.02244330197572708, 0.31441861391067505, -0.013494981452822685, -0.09892355650663376, -0.38057902455329895, 0.04440538212656975, 0.12528207898139954, 0.22749879956245422, 0.004056107718497515, -0.14845506846904755, 0.13485243916511536, -0.02939058654010296, -0.02398780919611454, 0.0038628436159342527, 0.0021293365862220526, 0.012778078205883503, -0.16051281988620758, 0.012700192630290985, -0.06196978688240051, -0.16510070860385895, -0.10615979135036469, -0.08043096214532852, 0.02731577679514885, 0.053172528743743896, 0.0948450043797493, -0.12551665306091309, 0.05098773539066315, -0.008870480582118034, 0.13247907161712646, 0.03747832402586937, -0.04032007232308388, -0.05165616422891617, -0.22875314950942993, 0.05029698461294174, -0.08098349720239639, -0.15339328348636627, -0.22873273491859436, 0.04861371964216232, -0.1703483909368515, 0.054214898496866226, -0.20288397371768951, 0.0016466733068227768, -0.09989074617624283, -0.05429802089929581, -0.03703996166586876, 0.17398840188980103, 0.06363850086927414, 0.14425013959407806, -0.059577856212854385, 0.07540645450353622, -0.02098582498729229, 0.20550686120986938, 0.033059798181056976, -0.048447199165821075, -0.09643567353487015, 0.131582111120224, 0.05007396265864372, -0.00945895817130804, 0.10806384682655334, 0.15206630527973175, 0.00462158489972353, 0.07110567390918732, -0.15617972612380981, -0.1533777117729187, 0.26506495475769043, 0.09526372700929642, 0.00005521372440853156, 0.017783137038350105, -0.07806713879108429, -0.06199184060096741, -0.022184856235980988, -0.04530385881662369, -0.03208247199654579, 0.06763608753681183, -0.09542936086654663, -0.10464300215244293, 0.26378998160362244, 0.13371862471103668, -0.112782321870327, -0.029405247420072556, -0.00937279686331749, 0.01575140655040741, 0.11901846528053284, 0.1297251284122467, 0.05504761263728142, 0.10761674493551254, 0.31310027837753296, -0.03310199826955795, -0.10609368979930878, -0.03379446640610695, -0.05983998626470566, -0.198543980717659, -0.06447193771600723, 0.12664726376533508, -0.016062382608652115, 0.047380782663822174, 0.06425238400697708, -0.026847325265407562, -0.10363851487636566, -0.09007957577705383, -0.12281110137701035, -0.021427687257528305, -0.10010052472352982, 0.06386468559503555, 0.03711049258708954, 0.11730003356933594, 0.0679938793182373, 0.1208929792046547, 0.11610008031129837, -0.06812682002782822, 0.07285698503255844, 0.16804389655590057, -0.0969414934515953, 0.04252539575099945, -0.24007834494113922, -0.10763074457645416, -0.1723983734846115, -0.15408942103385925, 0.08355788141489029, -0.0830797404050827, 0.0640401542186737, -0.05254298076033592, 0.13912859559059143, -0.1406528204679489, 0.20339198410511017, -0.07483002543449402, 0.037181176245212555, 0.11430902034044266, 0.09232418984174728, -0.049677617847919464, -0.06788726896047592, 0.0739690363407135, 0.0460551418364048, 0.028757315129041672, -0.19024303555488586, -0.036650702357292175, -0.018624108284711838, -0.15834130346775055, -0.03682529553771019, 0.16037358343601227, 0.0066111208871006966, 0.10649899393320084, 0.042826879769563675, -0.08690166473388672, -0.12428059428930283, 0.16078384220600128, -0.013370329514145851, 0.12487368285655975, 0.005761854350566864, -0.15334832668304443, 0.1264384239912033, -0.020185286179184914, 0.0618174709379673, -0.05504826456308365, -0.1075020357966423, 0.11272736638784409, 0.0835605338215828, 0.06352203339338303, -0.07840335369110107, -0.2891319692134857, 0.15708954632282257, -0.08839229494333267, -0.16859184205532074, 0.09743590652942657, 0.09398110955953598, -0.014682868495583534, 0.046766459941864014, 0.09013167023658752, -0.1425124853849411, 0.019838277250528336, 0.21783430874347687, -0.1346331536769867, -0.10861710458993912, -0.1598670780658722, 0.1430644392967224, 0.060711756348609924, -0.05718132108449936, 0.00842408835887909, -0.1258181631565094, 0.08822965621948242, -0.16270433366298676, 0.0461387112736702, -0.008062545210123062, 0.08903283625841141, 0.04600244387984276, 0.1348198801279068, -0.02581319957971573, -0.1541898101568222, -0.14739990234375, 0.08313291519880295, 0.03615722060203552, 0.14393462240695953, -0.10628645867109299, -0.13230188190937042, -0.003709010314196348, -0.046775322407484055, -0.05958730727434158, 0.0546303354203701, 0.006863250397145748, -0.05035979673266411, 0.07046901434659958, -0.022653749212622643, 0.215457022190094, -0.13477066159248352, 0.04323537275195122, -0.00311614410020411, -0.03810795024037361, -0.1714039295911789, -0.09009582549333572, 0.09169650077819824, 0.12561433017253876, -0.004296957515180111, -0.056935764849185944, -0.056981585919857025, -0.13285145163536072, 0.08468201756477356, 0.11427479237318039, -0.05969005450606346, -0.09889417886734009, 0.042169734835624695, 0.049042463302612305, 0.12893445789813995, 0.38672709465026855, 0.19727987051010132, -0.05741729214787483, 0.17919279634952545, 0.01152857206761837, 0.03683699667453766, -0.043947841972112656, 0.03840690478682518, 0.2469053715467453, 0.1117125004529953, -0.015913208946585655, -0.11066443473100662, -0.002716599265113473, 0.004464783240109682, -0.008121716789901257, 0.18161684274673462, 0.07945584505796432, -0.0306800976395607, 0.1400051862001419, 0.10236577689647675, -0.04535115882754326, 0.03369980305433273, 0.010731817223131657, 0.007326933089643717, -0.16191382706165314, -0.19850018620491028, 0.09251678735017776, 0.0628093034029007, -0.05687066540122032, -0.012276099994778633, -0.05807669088244438, -0.10452264547348022, 0.0770040899515152, 0.012701216153800488, 0.14269958436489105, 0.06314471364021301, 0.04261597990989685, 0.02210690826177597, 0.1587262898683548, -0.08862470090389252, 0.2551489472389221, 0.0305731613188982, -0.11675982922315598, -0.008527740836143494, -0.29053688049316406, -0.11539177596569061, -0.06942696124315262, -0.025175686925649643, 0.24516084790229797, -0.10336099565029144, -0.041749078780412674, -0.05158120021224022, 0.029789650812745094, 0.09487507492303848, -0.1313740760087967, -0.059539541602134705, 0.029586495831608772, 0.006532812025398016, 0.049282852560281754, -0.02700311690568924, -0.11996222287416458, -0.21623878180980682, -0.0043418616987764835, 0.11005354672670364, -0.11223118007183075, -0.07583418488502502, 0.14125433564186096, 0.13635936379432678, 0.061458148062229156, -0.0591428242623806, 0.06214018911123276, -0.11678307503461838, 0.11428136378526688, -0.08567545562982559, -0.15690679848194122, 0.029733330011367798, 0.014263521879911423, 0.014572431333363056, 0.007077816873788834, 0.08423512428998947, -0.01695479080080986, -0.05209623649716377, 0.0018081223824992776, -0.06061438471078873, 0.046111319214105606, 0.04999969154596329, 0.03726539388298988, -0.02831369638442993, 0.06476370245218277, 0.18455614149570465, 0.018728455528616905, 0.007157869171351194, 0.06734305620193481, 0.0419134646654129, -0.051982659846544266, 0.040112197399139404, 0.04037013649940491, 0.09248590469360352, -0.1684972196817398, -0.014101476408541203, 0.0005718432948924601, -0.11275599151849747, 0.028082801029086113, 0.03931267186999321, 0.14016267657279968, 0.03325800597667694, 0.13950559496879578, 0.04436434060335159, -0.05647186189889908, 0.026850484311580658, 0.0015537813305854797, -0.11834528297185898, 0.1319178193807602, -0.05374407768249512, -0.08063242584466934, -0.029101716354489326, -0.028823893517255783, -0.0350254662334919, -0.021356163546442986, 0.026966046541929245, -0.21232739090919495, 0.06425953656435013, -0.07274892926216125, 0.03996386379003525, 0.19387181103229523, -0.07790254056453705, 0.0010283415904268622, -0.1687416136264801, 0.21189163625240326, -0.08004245162010193, -0.07416781038045883, -0.20630179345607758, 0.15716491639614105, 0.17807750403881073, 0.09804187715053558, 0.222647562623024, 0.012924601323902607, -0.06586157530546188, -0.09068994969129562, 0.06867428869009018, 0.1959213763475418, -0.09652592986822128, -0.07736022025346756, -0.062470693141222, 0.02037143148481846, -0.13199178874492645, -0.05028355121612549, 0.010022047907114029, 0.0907609611749649, 0.05157008767127991, -0.01748935505747795, -0.047796811908483505, -0.11846597492694855, -0.0031843141186982393, 0.06983552873134613, -0.12533526122570038, -0.04391646385192871, -0.17080090939998627, -0.0023432786110788584, -2.4389850332527806e-32, 0.06671708822250366, -0.055612657219171524, -0.06156991049647331, -0.15610606968402863, 0.018623702228069305, 0.03957948088645935, -0.19225633144378662, -0.053231753408908844, 0.1068219244480133, -0.10740301012992859, -0.13636992871761322, -0.01193787157535553, 0.025084113702178, -0.10243257880210876, 0.09226633608341217, -0.02550046145915985, 0.21878935396671295, -0.07385805994272232, -0.019703112542629242, 0.15908783674240112, 0.07438365370035172, 0.1881525069475174, 0.12050379812717438, 0.26259079575538635, 0.1618165224790573, -0.03835080564022064, -0.015054137445986271, -0.20482049882411957, 0.02752397023141384, -0.11693407595157623, 0.013667799532413483, 0.03732963651418686, 0.03827356547117233, -0.09072304517030716, -0.15131959319114685, -0.22493672370910645, -0.09013970196247101, 0.00821036845445633, -0.03316584229469299, 0.14993135631084442, 0.02332071214914322, -0.054683323949575424, 0.1369713842868805, 0.019171468913555145, -0.06598629802465439, -0.0060563585720956326, 0.012448186986148357, 0.07020372897386551, -0.08866865187883377, 0.0815688818693161, 0.09681463241577148, -0.05459926649928093, 0.06736523658037186, 0.1269681304693222, 0.10843730717897415, -0.10556016117334366, 0.20888447761535645, 0.1337786167860031, -0.029839511960744858, 0.0798734724521637, 0.14551499485969543, 0.1023409441113472, -0.00639980286359787, -0.031549230217933655, -0.013318280689418316, -0.02445817179977894, 0.24865369498729706, 0.07415124028921127, 0.15978480875492096, 0.22955895960330963, 0.0027809194289147854, 0.09080874919891357, -0.049057867377996445, -0.15543709695339203, 0.09910302609205246, -0.11665469408035278, -0.06904082000255585, 0.049239277839660645, -0.2675427496433258, -0.007898963056504726, -0.1302615851163864, -0.10731272399425507, 0.16309863328933716, 0.07716858386993408, -0.1553238183259964, -0.10334871709346771, 0.036658283323049545, -0.0333712138235569, 0.002267409348860383, -0.14001330733299255, -0.05262435972690582, 0.19107207655906677, -0.041415948420763016, -0.07563687115907669, -0.14538390934467316, 0.25243109464645386, -0.255149781703949, 0.003433968871831894, -0.1393938809633255, 0.09748327732086182, 0.06598705798387527, -0.07258676737546921, 0.25213927030563354, -0.05652054399251938, 0.08520746976137161, 0.13977941870689392, 0.13708505034446716, 0.006461744662374258, -0.01715701073408127, 0.03166656196117401, 0.0601053349673748, -0.052228208631277084, 0.00622584717348218, 0.07349206507205963, 0.07351161539554596, -0.005266241729259491, -0.025129400193691254, -0.09778726100921631, 0.19523409008979797, 0.1487111896276474, 0.0029776880983263254, 0.049958836287260056, -0.1287277489900589, 0.10957415401935577, -0.13792620599269867, -0.08657044172286987, -0.10622069239616394, 0.04434197396039963, -0.010630734264850616, -0.008260841481387615, 0.05826539918780327, -0.04859068989753723, 7.38084054319188e-7, -0.2696467339992523, 0.11584010720252991, 0.08097361028194427, -0.14697015285491943, 0.0027267804834991693, 0.12067709863185883, -0.20731987059116364, 0.10584928840398788, -0.104772187769413, -0.08946344256401062, 0.06186559423804283, -0.11807192116975784, -0.12491850554943085, -0.10295271128416061, -0.025227129459381104, -0.1409662961959839, -0.0027079805731773376, 0.1379959136247635, -0.26656997203826904, 0.04967212304472923, 0.04844943434000015, 0.030855799093842506, -0.09742771834135056, -0.03426573798060417, 0.07366564869880676, 0.020812083035707474, -0.03132534399628639, 0.08991818130016327, 0.08443797379732132, -0.05191005393862724, 0.04975200816988945, -0.12107016146183014, 0.13191398978233337, 0.04912029206752777, -0.1094825267791748, 0.021265782415866852, -0.15256763994693756, -0.07292699068784714, -0.06320951133966446, -0.026162030175328255, -0.012691780924797058, 0.055340513586997986, 0.08370339125394821, 0.09614187479019165, 0.06372299045324326, 0.11885841190814972, 0.03148312866687775, 0.015461340546607971, 0.012789735570549965, 0.08186165243387222, 0.053922388702631, 0.05347819998860359, 0.11015691608190536, 0.2662339210510254, 0.0029531270265579224, 0.09965813159942627, 0.07153239101171494, -0.15495648980140686, 0.1849638968706131, -0.042644742876291275, -0.09855421632528305, -0.08474356681108475, -0.11083471029996872, 0.028211725875735283, 0.01284149568527937, -0.04388157278299332, 0.021366732195019722, 1.610337261840299e-34, -0.12031225860118866, -0.11527033150196075, 0.01818728819489479, -0.1706894487142563, -0.09086786955595016, -0.28393876552581787, 0.11624559760093689, 0.12218838185071945, -0.13357006013393402, -0.07494910806417465, -0.15122723579406738 ]
https://github.com/huggingface/datasets/issues/6240
Dataloader stuck on multiple GPUs
What type of dataset are you using in this script? `torch.utils.data.Dataset` or `datasets.Dataset`? Please share the `datasets` package version if it's the latter. Otherwise, it's better to move this issue to the `accelerate` repo.
### Describe the bug I am trying to get CLIP to fine-tuning with my code. When I tried to run it on multiple GPUs using accelerate, I encountered the following phenomenon. - Validation dataloader stuck in 2nd epoch only on multi-GPU Specifically, when the "for inputs in valid_loader:" process is finished, it does not proceed to the next step. train_loader process is completed. Also, both train and valid are working correctly in the first epoch. The accelerate command at that time is as follows. `accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...` - This will not happen when single GPU is used. `CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...` - Setting num_workers=0 in dataloader did not change the result. ### Steps to reproduce the bug 1. The codes for fine-tuning the regular CLIP were updated for accelerate. 2. Run the code with the accelerate command as `accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...` and the above problem will occur. 3. CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...` , it works fine. ### Expected behavior It Should end normally as if it was run on a single GPU. ### Environment info Since `datasets-cli env` did not work, the environment is described below. - OS: Ubuntu 22.04 with Docker - Docker: 24.0.5, build ced0996 - Python: 3.10.12 - torch==2.0.1 - accelerate==0.21.0 - transformers==4.33.1
34
Dataloader stuck on multiple GPUs ### Describe the bug I am trying to get CLIP to fine-tuning with my code. When I tried to run it on multiple GPUs using accelerate, I encountered the following phenomenon. - Validation dataloader stuck in 2nd epoch only on multi-GPU Specifically, when the "for inputs in valid_loader:" process is finished, it does not proceed to the next step. train_loader process is completed. Also, both train and valid are working correctly in the first epoch. The accelerate command at that time is as follows. `accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...` - This will not happen when single GPU is used. `CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...` - Setting num_workers=0 in dataloader did not change the result. ### Steps to reproduce the bug 1. The codes for fine-tuning the regular CLIP were updated for accelerate. 2. Run the code with the accelerate command as `accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...` and the above problem will occur. 3. CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...` , it works fine. ### Expected behavior It Should end normally as if it was run on a single GPU. ### Environment info Since `datasets-cli env` did not work, the environment is described below. - OS: Ubuntu 22.04 with Docker - Docker: 24.0.5, build ced0996 - Python: 3.10.12 - torch==2.0.1 - accelerate==0.21.0 - transformers==4.33.1 What type of dataset are you using in this script? `torch.utils.data.Dataset` or `datasets.Dataset`? Please share the `datasets` package version if it's the latter. Otherwise, it's better to move this issue to the `accelerate` repo.
[ -0.03294006735086441, 0.1960989534854889, -0.005234460812062025, -0.05597299709916115, 0.07789069414138794, -0.03020549565553665, 0.17351123690605164, 0.0503537580370903, -0.06551290303468704, 0.13390327990055084, 0.044182367622852325, -0.07199442386627197, 0.04058393836021423, -0.10705786943435669, -0.020494136959314346, 0.11363775283098221, -0.08878733962774277, -0.015290320850908756, -0.004323923494666815, -0.08681013435125351, 0.033341579139232635, 0.05338391289114952, 0.11385681480169296, -0.11282504349946976, 0.010593223385512829, 0.025012336671352386, 0.018184484913945198, -0.1694345474243164, 0.032026756554841995, 0.023472627624869347, 0.07301903516054153, 0.11713127046823502, 0.052976276725530624, 0.3171200454235077, 0.000005074787623016164, -0.01019746158272028, 0.06130672246217728, 0.07093481719493866, -0.09985416382551193, -0.1549350768327713, 0.10974059253931046, -0.26182159781455994, -0.06415516138076782, -0.054237328469753265, 0.029031168669462204, -0.07099787145853043, -0.05426579341292381, -0.04766455292701721, 0.18126410245895386, -0.036253418773412704, 0.01578798145055771, 0.025890298187732697, 0.018893921747803688, -0.3217037320137024, 0.08522646129131317, -0.044726643711328506, -0.05142540857195854, -0.007620207965373993, 0.042399369180202484, -0.18551748991012573, -0.13760504126548767, -0.11740900576114655, -0.023783663287758827, -0.005901846569031477, -0.2239159792661667, -0.10946427285671234, -0.14295382797718048, -0.23720905184745789, -0.007893776521086693, 0.16189278662204742, -0.10529911518096924, 0.04617716372013092, -0.23908011615276337, -0.006366499233990908, -0.07333079725503922, -0.1334424912929535, 0.09739000350236893, 0.24222713708877563, -0.17826387286186218, 0.17876166105270386, -0.056594908237457275, 0.0696692019701004, 0.004215267486870289, -0.0005120775895193219, -0.1435106098651886, 0.17807075381278992, -0.0668058916926384, 0.17284202575683594, 0.220590740442276, 0.01743130572140217, 0.17153064906597137, 0.11658985167741776, 0.053918350487947464, -0.13973304629325867, -0.06697490811347961, 0.12158132344484329, 0.04909977689385414, -0.24400757253170013, -0.08788885921239853, -0.0589667372405529, 0.10100129246711731, 0.09820302575826645, 0.06586591899394989, 0.06267879158258438, 0.0004736116388812661, 0.011206942610442638, 0.06951553374528885, -0.1685001403093338, 0.0578518882393837, -0.008176111616194248, 0.08388675004243851, 0.1486111730337143, -0.2354307472705841, 0.0031802025623619556, 0.10052206367254257, -0.1131305918097496, 0.22962923347949982, 0.09084964543581009, -0.09007997065782547, 0.05332013592123985, 0.0738784670829773, 0.1599467396736145, -0.15407654643058777, 0.15556015074253082, 0.1407613456249237, 0.0061941370368003845, -0.23075848817825317, 0.1729857474565506, -0.06709375232458115, -0.011420823633670807, 0.03509281948208809, 0.024559589102864265, -0.08665047585964203, -0.0956246480345726, 0.20804914832115173, -0.20282475650310516, -0.11384846270084381, -0.11927375197410583, 0.10469745844602585, 0.019677478820085526, 0.029301181435585022, -0.19448019564151764, -0.09435733407735825, 0.0020185408648103476, 0.14705295860767365, 0.23911738395690918, 0.130882129073143, -0.049154795706272125, 0.03424360975623131, -0.0891885757446289, -0.18199703097343445, 0.26330506801605225, -0.12025477737188339, 0.07130192965269089, -0.05255994200706482, 0.05098482966423035, -0.055965606123209, -0.09367406368255615, -0.12310564517974854, -0.1243867427110672, 0.028495976701378822, -0.03886285424232483, -0.014310695230960846, -0.0963517501950264, 0.125841423869133, 0.10534931719303131, -0.06390103697776794, 0.07537306845188141, -0.09827976673841476, 0.07634063810110092, 0.06519017368555069, 0.07005824148654938, -0.12164677679538727, -0.016000855714082718, -0.18356043100357056, 0.022826429456472397, -0.1757785528898239, -0.03804922103881836, -0.2522599995136261, 0.10229962319135666, 0.009399100206792355, -0.04415855184197426, -0.00047033539158292115, -0.2750224471092224, 0.16391940414905548, 0.012801771983504295, 0.061870574951171875, 0.06599347293376923, 0.007629010360687971, 0.007052224595099688, 0.1483200341463089, -0.0562850646674633, -0.06736574321985245, 0.0686480849981308, 0.15458570420742035, -0.04878539964556694, -0.05055475980043411, -0.09856510907411575, 0.17357321083545685, -0.2631787061691284, -0.018648356199264526, -0.00275247311219573, -0.010093431919813156, -0.1080365851521492, -0.06403035670518875, 0.05464522913098335, -0.3246191740036011, 0.12664295732975006, 0.1470569670200348, -0.13527992367744446, -0.27789464592933655, -0.025984806939959526, -0.055763743817806244, 0.06402318179607391, -0.14780238270759583, -0.10593011230230331, -0.08034606277942657, -0.052607305347919464, -0.17232660949230194, 0.07250915467739105, -0.12949642539024353, 0.19012302160263062, 0.00897523295134306, 0.08911996334791183, 0.04834691435098648, 0.03860246390104294, 0.06510837376117706, -0.027930766344070435, -0.016621209681034088, -0.067562997341156, -0.19355981051921844, -0.18849238753318787, 0.1534915268421173, 0.017749574035406113, 0.14809422194957733, -0.0009935202542692423, -0.0035348059609532356, -0.019619999453425407, 0.013845209032297134, 0.01965940184891224, -0.16145694255828857, -0.005928506143391132, -0.0812189057469368, -0.17409184575080872, -0.07652486115694046, 0.04090498387813568, -0.11244169622659683, 0.1595984548330307, 0.028058253228664398, -0.045285336673259735, 0.2645969092845917, 0.06696420907974243, -0.07642767578363419, 0.1989586055278778, 0.10274221748113632, 0.05931835249066353, 0.14896348118782043, 0.1026824414730072, 0.027310462668538094, 0.0022534283343702555, 0.13042376935482025, 0.06609570235013962, 0.06583447754383087, 0.015472146682441235, 0.012731322087347507, -0.062279168516397476, 0.004277730826288462, -0.10996561497449875, 0.06307278573513031, 0.02895526960492134, -0.05019957572221756, -0.16051995754241943, 0.04901218041777611, -0.11812388151884079, -0.08458452671766281, 0.07635973393917084, -0.04051109403371811, 0.02795145846903324, -0.18788407742977142, -0.12778744101524353, -0.054093848913908005, 0.12242802232503891, 0.11787356436252594, 0.05225822329521179, 0.045948442071676254, 0.12064571678638458, 0.028723817318677902, 0.019969727843999863, -0.08259615302085876, -0.03613877668976784, 0.15733636915683746, 0.05377564951777458, -0.08283396065235138, 0.14361870288848877, 0.10055025666952133, 0.1156780868768692, 0.10448688268661499, 0.12346835434436798, 0.03170867636799812, 0.07370863854885101, -0.013727952726185322, 0.06068029627203941, 0.015552719123661518, 0.0395672507584095, -0.00005592719389824197, -0.03942311927676201, 0.12153886258602142, 0.24943691492080688, -0.11196356266736984, -0.012928635813295841, 0.02764674834907055, -0.053512074053287506, 0.044700250029563904, 0.11093426495790482, 0.10378070920705795, 0.03629080578684807, -0.004121708683669567, -0.11618353426456451, -0.07792823016643524, 0.02480277046561241, 0.14896874129772186, 0.024600118398666382, -0.1892637014389038, -0.0865665003657341, 0.01132994331419468, 0.03151756525039673, -0.20107628405094147, 0.04743115231394768, -0.19920477271080017, -0.000674780341796577, -0.045404210686683655, -0.014601814560592175, -0.02006903663277626, -0.0856705754995346, 0.1183389350771904, -0.17144274711608887, 0.04606803506612778, 0.0501304529607296, 0.20561571419239044, -0.09663477540016174, -0.10774466395378113, -0.1614220142364502, -0.15738432109355927, 0.04382874444127083, 0.08068951219320297, 0.012499965727329254, 0.10535554587841034, -0.17980024218559265, -0.0861421748995781, -0.01633276231586933, 0.003651311621069908, 0.030073052272200584, -0.11956985294818878, -0.163273885846138, -0.009044579230248928, 0.062195293605327606, 0.08230582624673843, 0.19332890212535858, 0.10362477600574493, 0.13129597902297974, -0.10383646190166473, -0.03158894553780556, 0.10324736684560776, 0.026166260242462158, -0.2053772211074829, 0.10906639695167542, 0.17225265502929688, -0.16515764594078064, 0.10040979832410812, -0.11834017932415009, 0.07256961613893509, 0.00918321218341589, -0.12241146713495255, 0.0256451815366745, -0.058404941111803055, -0.11523157358169556, -0.009051076136529446, 0.004546140320599079, -0.060242995619773865, -0.0007177774677984416, 0.1300244927406311, -0.02726416289806366, -0.14771172404289246, -0.047560811042785645, 0.12973110377788544, 0.009999957866966724, 0.1301220953464508, -0.01685498096048832, -0.09702011197805405, 0.04639464616775513, -0.13450656831264496, -0.019373932853341103, 0.124391570687294, 0.033191896975040436, 0.06415154039859772, -0.0004913226584903896, 0.14277654886245728, 0.0798262357711792, 0.033175453543663025, 0.06793046742677689, -0.06462766230106354, 0.19645139575004578, 0.02710978128015995, -0.01104776095598936, -0.0012365528382360935, -0.03932688385248184, -0.0811120867729187, -0.2390807569026947, -0.08376190811395645, -0.0664345771074295, 0.13736644387245178, 0.05096321925520897, -0.05704385042190552, 0.07443184405565262, 0.07554807513952255, -0.1308506280183792, 0.053759101778268814, -0.16884870827198029, -0.10517514497041702, -0.1389421671628952, -0.13791519403457642, -0.13339249789714813, 0.05134868994355202, 0.09801263362169266, -0.07890653610229492, 0.04643655940890312, 0.03366716951131821, -0.13671119511127472, 0.17937308549880981, -0.06872586160898209, -0.011337638832628727, 0.04959089681506157, 0.07783651351928711, 0.18241067230701447, -0.01939941570162773, -0.03592224419116974, 0.1637205332517624, 0.02767840400338173, 0.07893548160791397, 0.3075563609600067, -0.10456082969903946, -0.014434470795094967, 0.10621480643749237, -0.05079691484570503, -0.05181384086608887, -0.11690822243690491, -0.08990708738565445, 0.05410100892186165, 0.0227331705391407, -0.08463800698518753, 0.0041495258919894695, -0.1635884940624237, -0.13107973337173462, -0.24852216243743896, 0.19529587030410767, 0.06984036415815353, 0.2666891813278198, -0.25874218344688416, 0.15025217831134796, 0.05917346104979515, -0.1267348825931549, -0.026265824213624, 0.03232048451900482, 0.057666052132844925, 0.03066605143249035, 0.021975025534629822, 0.13298065960407257, -0.09376830607652664, 0.053700610995292664, 0.0104198744520545, -0.29093480110168457, 0.015034718438982964, -0.09888564050197601, 0.049711667001247406, 0.13240689039230347, 0.2374088317155838, 0.10599587857723236, -0.09422291070222855, -0.016243863850831985, -0.023292072117328644, 0.05714906379580498, 0.15516939759254456, -0.24834443628787994, -0.06220470741391182, -0.08856450766324997, 0.006559209432452917, 0.11246807128190994, -0.027252737432718277, -0.0981806144118309, 0.0022228595335036516, 0.0637735053896904, -0.023737043142318726, 0.08899655193090439, -0.08350279927253723, 0.19906574487686157, -0.1060493066906929, -0.3645721971988678, 0.08959075063467026, 0.03910365328192711, -0.03986096382141113, 0.06108725070953369, -0.03880281746387482, 0.18122386932373047, -0.04425554722547531, 0.06284494698047638, -0.06777162849903107, 0.0076321507804095745, 0.073856882750988, 0.13588346540927887, -0.02407006174325943, 0.023879071697592735, 0.06983757764101028, -0.004099632613360882, -0.1495772898197174, -0.011602519080042839, 0.05364873632788658, -0.035019200295209885, 0.08078785240650177, -0.1271635740995407, 0.207555890083313, 0.010033788159489632, -0.009835687465965748, 0.055166590958833694, -0.04970282316207886, 0.13449053466320038, 0.08491753786802292, -0.04656297340989113, 0.07337993383407593, 0.2955196797847748, -0.027843741700053215, -0.10074025392532349, 0.06920035928487778, 0.28852027654647827, 0.15305350720882416, -0.1719702184200287, -0.03681202605366707, 0.09449537098407745, -0.0540405698120594, 0.005490039009600878, 0.05989997461438179, 0.016043072566390038, 0.09338461607694626, -0.11481250822544098, -0.03228047490119934, 0.02295185998082161, 0.08017029613256454, 0.048275209963321686, -0.10129676014184952, -0.07068042457103729, -0.23590940237045288, -0.08863581717014313, 0.10880549252033234, 0.04257151857018471, 0.08965680748224258, -0.008292144164443016, -2.4305917097143218e-32, 0.022279836237430573, -0.0010754124959930778, -0.0891338512301445, 0.003545585321262479, -0.16317963600158691, -0.01497828308492899, -0.14209488034248352, -0.01023082248866558, -0.009686277247965336, -0.06150931864976883, -0.09569927304983139, 0.033878013491630554, 0.05208461731672287, -0.0031174158211797476, 0.03006635792553425, 0.10089011490345001, 0.016795706003904343, -0.034129250794649124, -0.25795578956604004, 0.16119065880775452, 0.012300631031394005, 0.10305183380842209, -0.1393180936574936, 0.087427519261837, 0.10065682232379913, -0.0175651665776968, -0.027206996455788612, -0.10726755112409592, 0.02575201354920864, 0.07301683723926544, 0.00709141232073307, 0.02830967679619789, -0.04819009453058243, -0.325779527425766, -0.09621594846248627, -0.06741824746131897, -0.11749540269374847, -0.20757631957530975, -0.01736077107489109, 0.049460358917713165, -0.004534526728093624, 0.09826738387346268, 0.20956416428089142, -0.04855421185493469, -0.11755719780921936, 0.007566595450043678, 0.08500458300113678, 0.06424983590841293, -0.013301331549882889, -0.17040659487247467, -0.09018432348966599, 0.044207002967596054, 0.10966923832893372, 0.04596005380153656, 0.03737754747271538, -0.0810534879565239, 0.003335065906867385, 0.05825180932879448, -0.18737556040287018, -0.13302043080329895, 0.024416225031018257, 0.011471021920442581, 0.07860945165157318, -0.04875188320875168, 0.01452405285090208, -0.03253128379583359, 0.17921917140483856, 0.07527834922075272, 0.14794981479644775, 0.027972323819994926, 0.08308834582567215, 0.19923274219036102, -0.0915600135922432, -0.17059803009033203, -0.04228314757347107, -0.14994829893112183, 0.09873171150684357, 0.07581918686628342, 0.05179958418011665, -0.048176925629377365, 0.01302257925271988, -0.09205906838178635, 0.1059039831161499, 0.08524372428655624, -0.06911614537239075, 0.06884206086397171, 0.0002901690313592553, 0.11411551386117935, -0.13929003477096558, -0.027154428884387016, -0.02965747006237507, 0.1638740450143814, 0.03272237628698349, -0.11121315509080887, -0.0070440033450722694, -0.015865817666053772, 0.018353674560785294, 0.15125711262226105, 0.057665642350912094, 0.020124614238739014, -0.017109191045165062, -0.061744991689920425, 0.00010597053915262222, -0.07993307709693909, 0.13573145866394043, 0.012385544367134571, 0.12342486530542374, 0.013694209046661854, -0.11266236007213593, 0.020847326144576073, -0.023684168234467506, -0.04422991722822189, 0.19441713392734528, 0.18573229014873505, 0.1782824546098709, 0.05027937516570091, 0.0464772954583168, -0.06499033421278, 0.21353739500045776, 0.13006505370140076, 0.05676661431789398, -0.06869740784168243, -0.11545025557279587, -0.0955742672085762, -0.1152908205986023, 0.07589589804410934, -0.06745645403862, -0.0022119719069451094, 0.024774949997663498, -0.020578453317284584, -0.034172870218753815, -0.16711971163749695, 7.628269145243394e-7, -0.17682252824306488, 0.13841669261455536, 0.06889519095420837, -0.008471534587442875, -0.2566465735435486, -0.000033119056752184406, -0.22415083646774292, 0.052419278770685196, 0.032766394317150116, 0.061376865953207016, 0.022643299773335457, -0.05779562518000603, -0.06005057692527771, -0.04831681400537491, 0.14649003744125366, -0.12991414964199066, 0.06957165896892548, 0.18999731540679932, -0.1045202910900116, -0.026102421805262566, -0.009872136637568474, 0.19961751997470856, 0.0030116166453808546, 0.011822680942714214, 0.04663749411702156, -0.08852293342351913, -0.014147504232823849, -0.045032527297735214, 0.017617447301745415, 0.11550796031951904, 0.09649045765399933, 0.05614931508898735, -0.16996139287948608, 0.22661414742469788, 0.057683009654283524, 0.11416203528642654, -0.2937657833099365, -0.013535319827497005, 0.22049112617969513, 0.0382637120783329, -0.032594792544841766, -0.03980428725481033, 0.10875841230154037, -0.036885831505060196, 0.09448344260454178, 0.08884640038013458, -0.17361001670360565, -0.09077601134777069, 0.10460956394672394, 0.07445996254682541, 0.0801665335893631, 0.06857480108737946, 0.1883547157049179, 0.06304699182510376, 0.09412826597690582, 0.04005768895149231, -0.17341701686382294, -0.16799600422382355, 0.11143682897090912, 0.0805158019065857, -0.1526585966348648, -0.05545218288898468, 0.06850290298461914, -0.12281476706266403, 0.11277850717306137, -0.081254743039608, -0.07586386799812317, -2.817281998457148e-35, 0.00005513907308341004, -0.0031913593411445618, 0.0196597408503294, -0.1734882891178131, 0.1397397816181183, -0.23664651811122894, -0.1483277529478073, 0.0069129085168242455, -0.06836218386888504, -0.12059429287910461, -0.10303139686584473 ]
https://github.com/huggingface/datasets/issues/6240
Dataloader stuck on multiple GPUs
Very sorry, I thought I had a repo in `accelerate!` I will close this issue and repo the issue in the appropriate place.
### Describe the bug I am trying to get CLIP to fine-tuning with my code. When I tried to run it on multiple GPUs using accelerate, I encountered the following phenomenon. - Validation dataloader stuck in 2nd epoch only on multi-GPU Specifically, when the "for inputs in valid_loader:" process is finished, it does not proceed to the next step. train_loader process is completed. Also, both train and valid are working correctly in the first epoch. The accelerate command at that time is as follows. `accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...` - This will not happen when single GPU is used. `CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...` - Setting num_workers=0 in dataloader did not change the result. ### Steps to reproduce the bug 1. The codes for fine-tuning the regular CLIP were updated for accelerate. 2. Run the code with the accelerate command as `accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...` and the above problem will occur. 3. CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...` , it works fine. ### Expected behavior It Should end normally as if it was run on a single GPU. ### Environment info Since `datasets-cli env` did not work, the environment is described below. - OS: Ubuntu 22.04 with Docker - Docker: 24.0.5, build ced0996 - Python: 3.10.12 - torch==2.0.1 - accelerate==0.21.0 - transformers==4.33.1
23
Dataloader stuck on multiple GPUs ### Describe the bug I am trying to get CLIP to fine-tuning with my code. When I tried to run it on multiple GPUs using accelerate, I encountered the following phenomenon. - Validation dataloader stuck in 2nd epoch only on multi-GPU Specifically, when the "for inputs in valid_loader:" process is finished, it does not proceed to the next step. train_loader process is completed. Also, both train and valid are working correctly in the first epoch. The accelerate command at that time is as follows. `accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...` - This will not happen when single GPU is used. `CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...` - Setting num_workers=0 in dataloader did not change the result. ### Steps to reproduce the bug 1. The codes for fine-tuning the regular CLIP were updated for accelerate. 2. Run the code with the accelerate command as `accelerate launch --multi_gpu --num_processes=2 {script_name.py} {--arg1} {--arg2} ...` and the above problem will occur. 3. CUDA_VISIBLE_DEVICES="0" accelerate launch {script_name.py} --arg1 --arg2 ...` , it works fine. ### Expected behavior It Should end normally as if it was run on a single GPU. ### Environment info Since `datasets-cli env` did not work, the environment is described below. - OS: Ubuntu 22.04 with Docker - Docker: 24.0.5, build ced0996 - Python: 3.10.12 - torch==2.0.1 - accelerate==0.21.0 - transformers==4.33.1 Very sorry, I thought I had a repo in `accelerate!` I will close this issue and repo the issue in the appropriate place.
[ -0.025815432891249657, 0.21037250757217407, -0.0005312609137035906, -0.06265660375356674, 0.070228710770607, -0.03929334878921509, 0.15370695292949677, 0.07134521007537842, -0.054610852152109146, 0.12561678886413574, 0.06725777685642242, -0.0886651873588562, 0.048977307975292206, -0.0769299641251564, -0.012792018242180347, 0.12526415288448334, -0.08687780052423477, 0.00898156687617302, -0.0019710585474967957, -0.0926828533411026, 0.026896020397543907, 0.0669226199388504, 0.10969270765781403, -0.10348613560199738, 0.02309655211865902, 0.02677982673048973, 0.03895887732505798, -0.18747222423553467, 0.01095521915704012, 0.04858672618865967, 0.05371011793613434, 0.11915799975395203, 0.05297946184873581, 0.3114842176437378, 0.000005188410341361305, 0.0021159735042601824, 0.03098752349615097, 0.06607124209403992, -0.09756098687648773, -0.11441673338413239, 0.08954887092113495, -0.2687445878982544, -0.07766905426979065, -0.06017822027206421, 0.04292524233460426, -0.05013662204146385, -0.06771011650562286, -0.03620681166648865, 0.1966010332107544, -0.04051445052027702, 0.0286159235984087, 0.038564007729291916, 0.01821625791490078, -0.3103221654891968, 0.07749588787555695, -0.05934332311153412, -0.06854719668626785, -0.022885018959641457, 0.04740533232688904, -0.18975068628787994, -0.13781051337718964, -0.10743497312068939, -0.009458150714635849, 0.006966597866266966, -0.22496221959590912, -0.10788315534591675, -0.09210322052240372, -0.23653852939605713, -0.008065779693424702, 0.13532505929470062, -0.14282269775867462, 0.041584260761737823, -0.23985643684864044, -0.01709025353193283, -0.06979993730783463, -0.14193731546401978, 0.10158194601535797, 0.2639310657978058, -0.18640418350696564, 0.18392418324947357, -0.06890846788883209, 0.07558584958314896, -0.004954012110829353, 0.00428497651591897, -0.12591445446014404, 0.18729905784130096, -0.07335161417722702, 0.16568812727928162, 0.23559415340423584, 0.03186096251010895, 0.11584698408842087, 0.11860828846693039, 0.052277907729148865, -0.14839912950992584, -0.07186178117990494, 0.11297566443681717, 0.06518513709306717, -0.2561596930027008, -0.0928037241101265, -0.058571185916662216, 0.11160819977521896, 0.09425147622823715, 0.07624910026788712, 0.04659420996904373, -0.004527376499027014, 0.04623684287071228, 0.04532438889145851, -0.17987151443958282, 0.05128851905465126, 0.0011502386769279838, 0.07070648670196533, 0.13628582656383514, -0.2260148972272873, 0.024525845423340797, 0.08247639238834381, -0.11409076303243637, 0.2206699252128601, 0.08001064509153366, -0.0925280973315239, 0.05060338228940964, 0.04931120201945305, 0.16198499500751495, -0.15293319523334503, 0.1330917477607727, 0.15309925377368927, 0.01991773582994938, -0.22886113822460175, 0.17230860888957977, -0.08265740424394608, 0.0054772947914898396, 0.023185960948467255, 0.03553719073534012, -0.09488323330879211, -0.1065932959318161, 0.19482751190662384, -0.19063173234462738, -0.11093596369028091, -0.10519972443580627, 0.148141011595726, -0.019512340426445007, 0.031199418008327484, -0.19611798226833344, -0.11066966503858566, 0.009493902325630188, 0.1407061368227005, 0.23314008116722107, 0.13894082605838776, -0.10908587276935577, 0.03065464086830616, -0.0970768854022026, -0.2024565041065216, 0.24327780306339264, -0.10143087804317474, 0.06623326987028122, -0.06713017076253891, 0.04754075035452843, -0.0678926557302475, -0.0930398628115654, -0.11257769167423248, -0.11459042876958847, 0.044593505561351776, -0.031238999217748642, -0.018254714086651802, -0.10693374276161194, 0.12735174596309662, 0.07991426438093185, -0.04758933186531067, 0.04721800610423088, -0.09183727204799652, 0.06815269589424133, 0.07879258692264557, 0.08420572429895401, -0.10818712413311005, -0.02900838851928711, -0.1755022257566452, 0.030296575278043747, -0.1821097880601883, -0.04909774288535118, -0.21657101809978485, 0.1210772916674614, -0.0015557854203507304, -0.015113999135792255, -0.011149080470204353, -0.27933865785598755, 0.150361567735672, 0.023935411125421524, 0.06286334246397018, 0.0703977644443512, 0.008416268974542618, 0.02184102311730385, 0.1826009601354599, -0.06901901215314865, -0.10572828352451324, 0.04355955868959427, 0.16084372997283936, -0.04152264446020126, -0.054143019020557404, -0.08818736672401428, 0.1855294108390808, -0.2732628583908081, 0.010764860548079014, -0.008326183073222637, 0.020901866257190704, -0.12533502280712128, -0.08229362964630127, 0.07873986661434174, -0.3111869692802429, 0.1357351392507553, 0.13526175916194916, -0.11233575642108917, -0.2623094320297241, -0.019649114459753036, -0.0677144005894661, 0.06797805428504944, -0.15002456307411194, -0.1037592738866806, -0.06877483427524567, -0.07558798044919968, -0.13635802268981934, 0.08230132609605789, -0.10945290327072144, 0.18689511716365814, 0.005906629841774702, 0.06841389834880829, 0.07749850302934647, 0.04140091314911842, 0.06526041775941849, -0.021020350977778435, -0.03025725856423378, -0.06305408477783203, -0.19431035220623016, -0.17783322930335999, 0.16867691278457642, 0.0018022328149527311, 0.15902023017406464, 0.018124323338270187, -0.006891237106174231, -0.0016639161622151732, 0.01914103887975216, 0.04331883043050766, -0.17415231466293335, -0.01684396155178547, -0.07766327261924744, -0.16677391529083252, -0.0645642876625061, 0.029197735711932182, -0.10738009214401245, 0.16006183624267578, 0.05308369919657707, -0.04441649839282036, 0.2578454613685608, 0.061604805290699005, -0.07933108508586884, 0.2065718173980713, 0.0919472798705101, 0.056869130581617355, 0.1287640780210495, 0.10289458185434341, 0.03330100327730179, 0.0008042201516218483, 0.0999947115778923, 0.06439100950956345, 0.04853538051247597, 0.004139062948524952, 0.0006173111032694578, -0.061915650963783264, -0.014139722101390362, -0.0771390050649643, 0.0553494431078434, 0.021896615624427795, -0.05273792892694473, -0.16669009625911713, 0.052048325538635254, -0.10186682641506195, -0.09501052647829056, 0.11715813726186752, -0.005107999779284, 0.02104482799768448, -0.18970930576324463, -0.1428581178188324, -0.04353874921798706, 0.12369856983423233, 0.12549999356269836, 0.07218150794506073, 0.03134233132004738, 0.11900465935468674, 0.04937255382537842, 0.014820580370724201, -0.10197757184505463, -0.0681193619966507, 0.1728517711162567, 0.043149955570697784, -0.08336914330720901, 0.15886443853378296, 0.0944245308637619, 0.10935764014720917, 0.08820139616727829, 0.13098609447479248, 0.03337662294507027, 0.08651550114154816, -0.016373660415410995, 0.06363899260759354, -0.006517449393868446, 0.045703671872615814, 0.009306821972131729, -0.06115856394171715, 0.11900904029607773, 0.259493350982666, -0.10378464311361313, 0.0020869094878435135, 0.005023228470236063, -0.0569317527115345, 0.025004573166370392, 0.11128205060958862, 0.09542179107666016, 0.03579115867614746, -0.025392547249794006, -0.11621653288602829, -0.08218035846948624, 0.0422368161380291, 0.15337532758712769, 0.024795090779662132, -0.18301084637641907, -0.0823688879609108, 0.011964895762503147, 0.031383268535137177, -0.1985541433095932, 0.05195912718772888, -0.2003633677959442, 0.005434955004602671, -0.044986624270677567, 0.0201066043227911, -0.03529244661331177, -0.08495893329381943, 0.12139853835105896, -0.18202437460422516, 0.04979481175541878, 0.052909404039382935, 0.17060469090938568, -0.12076089531183243, -0.09368785470724106, -0.16278910636901855, -0.149743914604187, 0.025867704302072525, 0.06579413264989853, 0.018186597153544426, 0.08033565431833267, -0.18426820635795593, -0.12006881088018417, -0.0019556828774511814, -0.006153502967208624, 0.023195791989564896, -0.12759536504745483, -0.15801647305488586, 0.012806667014956474, 0.051198747009038925, 0.11352895945310593, 0.2127869427204132, 0.11683326214551926, 0.10846563428640366, -0.11524252593517303, -0.01933148503303528, 0.10269111394882202, 0.040410660207271576, -0.1685246378183365, 0.12705804407596588, 0.1609521210193634, -0.20587827265262604, 0.09783957153558731, -0.09422589093446732, 0.06381624191999435, 0.015315397642552853, -0.1423312872648239, 0.047434963285923004, -0.03994443267583847, -0.11678902059793472, -0.0010615731589496136, 0.032271984964609146, -0.05562353506684303, -0.0066702705807983875, 0.12500859797000885, -0.0016707944450899959, -0.14953181147575378, -0.046674445271492004, 0.11662948876619339, 0.025166073814034462, 0.13150140643119812, -0.020945550873875618, -0.11046279966831207, 0.03912379965186119, -0.1326315701007843, -0.03938562050461769, 0.12526308000087738, 0.04061408340930939, 0.03512895479798317, -0.005935393739491701, 0.13884185254573822, 0.07012038677930832, 0.010324200615286827, 0.08171691745519638, -0.09658290445804596, 0.19716955721378326, 0.04966461658477783, -0.026697954162955284, -0.0243411585688591, -0.04875264689326286, -0.0932442769408226, -0.2681400179862976, -0.08814665675163269, -0.08040186017751694, 0.1347312331199646, 0.07898160070180893, -0.03244189918041229, 0.07688668370246887, 0.0764581635594368, -0.16653425991535187, 0.0553574338555336, -0.16527047753334045, -0.11334144324064255, -0.13837303221225739, -0.13194359838962555, -0.12259429693222046, 0.05283687636256218, 0.1189434751868248, -0.07809191197156906, 0.05798579007387161, 0.06547661125659943, -0.14404602348804474, 0.1723141074180603, -0.06934154778718948, -0.016835277900099754, 0.057063329964876175, 0.07512270659208298, 0.17627255618572235, -0.030548283830285072, -0.0796775296330452, 0.13482706248760223, 0.04726500064134598, 0.07114429026842117, 0.2991477847099304, -0.11287090182304382, -0.016697365790605545, 0.11209573596715927, -0.06092827022075653, -0.04207562282681465, -0.08986610174179077, -0.09744368493556976, 0.031079808250069618, 0.021920742467045784, -0.1009618267416954, 0.00976970512419939, -0.1561068892478943, -0.10626241564750671, -0.2576715052127838, 0.20337478816509247, 0.0590902715921402, 0.2377806305885315, -0.20985540747642517, 0.1505272090435028, 0.04878336563706398, -0.11358468979597092, -0.030591722577810287, 0.039663758128881454, 0.06183807924389839, 0.058483678847551346, 0.01609422266483307, 0.11443915963172913, -0.06824060529470444, 0.06221647560596466, 0.006531918421387672, -0.3111063838005066, 0.010088068433105946, -0.09027300775051117, 0.054652780294418335, 0.09848171472549438, 0.24849779903888702, 0.08924411237239838, -0.09182458370923996, -0.02808648906648159, -0.03343678638339043, 0.059918973594903946, 0.16505423188209534, -0.25285837054252625, -0.0640900507569313, -0.06600248068571091, -0.004737734328955412, 0.11918710172176361, -0.027541223913431168, -0.08914341032505035, -0.004102069418877363, 0.06471018493175507, -0.019466880708932877, 0.09885246306657791, -0.06029694899916649, 0.1857927143573761, -0.07458757609128952, -0.3435777425765991, 0.08173205703496933, 0.03932449221611023, -0.04398677498102188, 0.05961362645030022, -0.0469222366809845, 0.2046017199754715, -0.07096783071756363, 0.07078906893730164, -0.047624096274375916, 0.015134599059820175, 0.0592472106218338, 0.13258258998394012, -0.029277708381414413, 0.026297641918063164, 0.06424674391746521, -0.0013554912293329835, -0.15085063874721527, -0.013968345709145069, 0.07333473116159439, -0.01742546260356903, 0.05389111861586571, -0.12974049150943756, 0.21760542690753937, 0.009500737302005291, 0.00854655634611845, 0.0408848412334919, -0.04790791869163513, 0.13813582062721252, 0.06563882529735565, -0.054148249328136444, 0.08158788084983826, 0.2948842942714691, -0.01418317947536707, -0.11569523811340332, 0.08177033066749573, 0.2835802435874939, 0.1743355244398117, -0.17342975735664368, -0.050977617502212524, 0.06392847746610641, -0.04507202282547951, 0.009165422059595585, 0.06204186752438545, 0.015621425583958626, 0.09361161291599274, -0.0925237387418747, -0.033260177820920944, 0.009348366409540176, 0.0908748209476471, 0.025768106803297997, -0.1106114611029625, -0.07173387706279755, -0.224850594997406, -0.09240946918725967, 0.0906524509191513, 0.02472648024559021, 0.08724638819694519, -0.001817455980926752, -2.4417400981375204e-32, 0.013224857859313488, -0.01907290145754814, -0.08871286362409592, -0.006434765178710222, -0.17650145292282104, 0.00010956438927678391, -0.13293640315532684, -0.0012718423968181014, -0.012323878705501556, -0.0638280138373375, -0.08463075011968613, 0.02583511359989643, 0.060918793082237244, 0.005696742329746485, 0.04800413176417351, 0.1507476419210434, 0.018289556726813316, -0.03203261271119118, -0.2578943073749542, 0.17058713734149933, -0.019766250625252724, 0.09301107376813889, -0.1550939828157425, 0.09838321805000305, 0.0821533128619194, -0.00783486571162939, -0.017115704715251923, -0.09814167767763138, 0.0134967640042305, 0.08337003737688065, 0.020221492275595665, 0.004851594101637602, -0.04911378026008606, -0.32174089550971985, -0.09097237884998322, -0.06869066506624222, -0.09056927263736725, -0.19993919134140015, -0.006030241493135691, 0.03833981230854988, 0.012665770016610622, 0.09727206081151962, 0.19544382393360138, -0.04939687252044678, -0.10070568323135376, -0.006837695371359587, 0.09353184700012207, 0.0740685760974884, -0.0026634016539901495, -0.126013845205307, -0.08756713569164276, 0.03285673260688782, 0.1075887680053711, 0.04331550374627113, 0.040804460644721985, -0.07737357169389725, 0.022528069093823433, 0.04171675443649292, -0.16639666259288788, -0.13637855648994446, 0.008408362045884132, 0.007758545223623514, 0.08774600923061371, -0.08841481804847717, 0.0011487123556435108, -0.04149433597922325, 0.14235369861125946, 0.06377001851797104, 0.11130937188863754, 0.02769951894879341, 0.0815512016415596, 0.1787954866886139, -0.07422014325857162, -0.17199267446994781, -0.03373220935463905, -0.1557161808013916, 0.12525837123394012, 0.0906296819448471, 0.06998512893915176, -0.026013309136033058, 0.027008607983589172, -0.09577593952417374, 0.10624722391366959, 0.08026659488677979, -0.0777246281504631, 0.06687591969966888, -0.004754010122269392, 0.10565156489610672, -0.13776737451553345, -0.018274618312716484, -0.03659675270318985, 0.1742633730173111, 0.03947758302092552, -0.1116667166352272, 0.010878034867346287, -0.04008695110678673, 0.010742117650806904, 0.15909531712532043, 0.06122229993343353, 0.016020795330405235, -0.019089350476861, -0.05522250011563301, -0.017057383432984352, -0.07635566592216492, 0.12880462408065796, 0.02441335655748844, 0.12146341055631638, 0.016074445098638535, -0.08527416735887527, 0.028320573270320892, -0.012720963917672634, -0.05237116664648056, 0.19458328187465668, 0.20877493917942047, 0.1566663682460785, 0.03918139636516571, 0.04077994078397751, -0.09743395447731018, 0.20578564703464508, 0.14289242029190063, 0.07592437416315079, -0.05726716294884682, -0.11619023233652115, -0.07646293938159943, -0.12031061947345734, 0.09090639650821686, -0.04164455831050873, 0.01965245045721531, -0.0018479743739590049, -0.01803569868206978, -0.035562846809625626, -0.1635032445192337, 7.625096145602583e-7, -0.16987547278404236, 0.13547876477241516, 0.06429161876440048, -0.03103073500096798, -0.28120264410972595, -0.0004453078145161271, -0.22387076914310455, 0.035734985023736954, 0.022138018161058426, 0.07410425692796707, 0.009386472404003143, -0.04236353188753128, -0.06858933717012405, -0.055786021053791046, 0.13434137403964996, -0.13811041414737701, 0.06064321845769882, 0.2019316405057907, -0.11211327463388443, -0.02670544944703579, -0.02006007544696331, 0.185175821185112, -0.005317977163940668, 0.008957784622907639, 0.052054956555366516, -0.07588690519332886, -0.026294473558664322, -0.026530439034104347, 0.026914842426776886, 0.12100137770175934, 0.07052124291658401, 0.058540042489767075, -0.1709628701210022, 0.21172106266021729, 0.05688413977622986, 0.10139576345682144, -0.2840391993522644, -0.01562812179327011, 0.22221656143665314, 0.01181402150541544, -0.05576399713754654, -0.0482298769056797, 0.12059962749481201, -0.0130335483700037, 0.08437086641788483, 0.07891550660133362, -0.1683434695005417, -0.13322526216506958, 0.10498831421136856, 0.07460806518793106, 0.08438055962324142, 0.05501387640833855, 0.18189574778079987, 0.044988665729761124, 0.10639254003763199, 0.04385315254330635, -0.17483238875865936, -0.14636479318141937, 0.0939425602555275, 0.08834631741046906, -0.12942934036254883, -0.04160887748003006, 0.07484462857246399, -0.14813044667243958, 0.10062354803085327, -0.08166967332363129, -0.07145677506923676, -3.4742389866462833e-35, 0.026255294680595398, -0.014179669320583344, 0.03041924349963665, -0.15350738167762756, 0.13684925436973572, -0.22409363090991974, -0.17361672222614288, -0.009609488770365715, -0.09661904722452164, -0.09650374203920364, -0.09660745412111282 ]
https://github.com/huggingface/datasets/issues/6239
Load local audio data doesn't work
I think this is the same issue as https://github.com/huggingface/datasets/issues/4776. Maybe installing `ffmpeg` can fix it: ```python add-apt-repository -y ppa:savoury1/ffmpeg4 apt-get -qq install -y ffmpeg ``` However, the best solution is to use a newer version of `datasets`. In the recent releases, we've replaced `torchaudio` with `soundfile`, which is easier to install and faster.
### Describe the bug I get a RuntimeError from the following code: ```python audio_dataset = Dataset.from_dict({"audio": ["/kaggle/input/bengaliai-speech/train_mp3s/000005f3362c.mp3"]}).cast_column("audio", Audio()) audio_dataset[0] ``` ### Traceback <details> ```python RuntimeError Traceback (most recent call last) Cell In[33], line 1 ----> 1 train_dataset[0] File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:1764, in Dataset.__getitem__(self, key) 1762 def __getitem__(self, key): # noqa: F811 1763 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools).""" -> 1764 return self._getitem( 1765 key, 1766 ) File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:1749, in Dataset._getitem(self, key, decoded, **kwargs) 1747 formatter = get_formatter(format_type, features=self.features, decoded=decoded, **format_kwargs) 1748 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) -> 1749 formatted_output = format_table( 1750 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns 1751 ) 1752 return formatted_output File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:532, in format_table(table, key, formatter, format_columns, output_all_columns) 530 python_formatter = PythonFormatter(features=None) 531 if format_columns is None: --> 532 return formatter(pa_table, query_type=query_type) 533 elif query_type == "column": 534 if key in format_columns: File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:281, in Formatter.__call__(self, pa_table, query_type) 279 def __call__(self, pa_table: pa.Table, query_type: str) -> Union[RowFormat, ColumnFormat, BatchFormat]: 280 if query_type == "row": --> 281 return self.format_row(pa_table) 282 elif query_type == "column": 283 return self.format_column(pa_table) File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:312, in PythonFormatter.format_row(self, pa_table) 310 row = self.python_arrow_extractor().extract_row(pa_table) 311 if self.decoded: --> 312 row = self.python_features_decoder.decode_row(row) 313 return row File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:221, in PythonFeaturesDecoder.decode_row(self, row) 220 def decode_row(self, row: dict) -> dict: --> 221 return self.features.decode_example(row) if self.features else row File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1386, in Features.decode_example(self, example) 1376 def decode_example(self, example: dict): 1377 """Decode example with custom feature decoding. 1378 1379 Args: (...) 1383 :obj:`dict[str, Any]` 1384 """ -> 1386 return { 1387 column_name: decode_nested_example(feature, value) 1388 if self._column_requires_decoding[column_name] 1389 else value 1390 for column_name, (feature, value) in zip_dict( 1391 {key: value for key, value in self.items() if key in example}, example 1392 ) 1393 } File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1387, in <dictcomp>(.0) 1376 def decode_example(self, example: dict): 1377 """Decode example with custom feature decoding. 1378 1379 Args: (...) 1383 :obj:`dict[str, Any]` 1384 """ 1386 return { -> 1387 column_name: decode_nested_example(feature, value) 1388 if self._column_requires_decoding[column_name] 1389 else value 1390 for column_name, (feature, value) in zip_dict( 1391 {key: value for key, value in self.items() if key in example}, example 1392 ) 1393 } File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1087, in decode_nested_example(schema, obj) 1085 # Object with special decoding: 1086 elif isinstance(schema, (Audio, Image)): -> 1087 return schema.decode_example(obj) if obj is not None else None 1088 return obj File /opt/conda/lib/python3.10/site-packages/datasets/features/audio.py:103, in Audio.decode_example(self, value) 101 raise ValueError(f"An audio sample should have one of 'path' or 'bytes' but both are None in {value}.") 102 elif path is not None and path.endswith("mp3"): --> 103 array, sampling_rate = self._decode_mp3(file if file else path) 104 elif path is not None and path.endswith("opus"): 105 if file: File /opt/conda/lib/python3.10/site-packages/datasets/features/audio.py:241, in Audio._decode_mp3(self, path_or_file) 238 except RuntimeError as err: 239 raise ImportError("To support decoding 'mp3' audio files, please install 'sox'.") from err --> 241 array, sampling_rate = torchaudio.load(path_or_file, format="mp3") 242 if self.sampling_rate and self.sampling_rate != sampling_rate: 243 if not hasattr(self, "_resampler") or self._resampler.orig_freq != sampling_rate: File /opt/conda/lib/python3.10/site-packages/torchaudio/backend/sox_io_backend.py:256, in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 254 if ret is not None: 255 return ret --> 256 return _fallback_load(filepath, frame_offset, num_frames, normalize, channels_first, format) File /opt/conda/lib/python3.10/site-packages/torchaudio/backend/sox_io_backend.py:30, in _fail_load(filepath, frame_offset, num_frames, normalize, channels_first, format) 22 def _fail_load( 23 filepath: str, 24 frame_offset: int = 0, (...) 28 format: Optional[str] = None, 29 ) -> Tuple[torch.Tensor, int]: ---> 30 raise RuntimeError("Failed to load audio from {}".format(filepath)) RuntimeError: Failed to load audio from /kaggle/input/bengaliai-speech/train_mp3s/000005f3362c.mp3 ``` </details> ### Steps to reproduce the bug 1. - Create a custom dataset using Local files of type mp3. 3. - Try to read the first audio item. ### Expected behavior Expected output ```python audio_dataset[0]["audio"] {'array': array([ 0. , 0.00024414, -0.00024414, ..., -0.00024414, 0. , 0. ], dtype=float32), 'path': 'path/to/audio_1', 'sampling_rate': 16000} ``` ### Environment info N/A
53
Load local audio data doesn't work ### Describe the bug I get a RuntimeError from the following code: ```python audio_dataset = Dataset.from_dict({"audio": ["/kaggle/input/bengaliai-speech/train_mp3s/000005f3362c.mp3"]}).cast_column("audio", Audio()) audio_dataset[0] ``` ### Traceback <details> ```python RuntimeError Traceback (most recent call last) Cell In[33], line 1 ----> 1 train_dataset[0] File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:1764, in Dataset.__getitem__(self, key) 1762 def __getitem__(self, key): # noqa: F811 1763 """Can be used to index columns (by string names) or rows (by integer index or iterable of indices or bools).""" -> 1764 return self._getitem( 1765 key, 1766 ) File /opt/conda/lib/python3.10/site-packages/datasets/arrow_dataset.py:1749, in Dataset._getitem(self, key, decoded, **kwargs) 1747 formatter = get_formatter(format_type, features=self.features, decoded=decoded, **format_kwargs) 1748 pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) -> 1749 formatted_output = format_table( 1750 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns 1751 ) 1752 return formatted_output File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:532, in format_table(table, key, formatter, format_columns, output_all_columns) 530 python_formatter = PythonFormatter(features=None) 531 if format_columns is None: --> 532 return formatter(pa_table, query_type=query_type) 533 elif query_type == "column": 534 if key in format_columns: File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:281, in Formatter.__call__(self, pa_table, query_type) 279 def __call__(self, pa_table: pa.Table, query_type: str) -> Union[RowFormat, ColumnFormat, BatchFormat]: 280 if query_type == "row": --> 281 return self.format_row(pa_table) 282 elif query_type == "column": 283 return self.format_column(pa_table) File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:312, in PythonFormatter.format_row(self, pa_table) 310 row = self.python_arrow_extractor().extract_row(pa_table) 311 if self.decoded: --> 312 row = self.python_features_decoder.decode_row(row) 313 return row File /opt/conda/lib/python3.10/site-packages/datasets/formatting/formatting.py:221, in PythonFeaturesDecoder.decode_row(self, row) 220 def decode_row(self, row: dict) -> dict: --> 221 return self.features.decode_example(row) if self.features else row File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1386, in Features.decode_example(self, example) 1376 def decode_example(self, example: dict): 1377 """Decode example with custom feature decoding. 1378 1379 Args: (...) 1383 :obj:`dict[str, Any]` 1384 """ -> 1386 return { 1387 column_name: decode_nested_example(feature, value) 1388 if self._column_requires_decoding[column_name] 1389 else value 1390 for column_name, (feature, value) in zip_dict( 1391 {key: value for key, value in self.items() if key in example}, example 1392 ) 1393 } File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1387, in <dictcomp>(.0) 1376 def decode_example(self, example: dict): 1377 """Decode example with custom feature decoding. 1378 1379 Args: (...) 1383 :obj:`dict[str, Any]` 1384 """ 1386 return { -> 1387 column_name: decode_nested_example(feature, value) 1388 if self._column_requires_decoding[column_name] 1389 else value 1390 for column_name, (feature, value) in zip_dict( 1391 {key: value for key, value in self.items() if key in example}, example 1392 ) 1393 } File /opt/conda/lib/python3.10/site-packages/datasets/features/features.py:1087, in decode_nested_example(schema, obj) 1085 # Object with special decoding: 1086 elif isinstance(schema, (Audio, Image)): -> 1087 return schema.decode_example(obj) if obj is not None else None 1088 return obj File /opt/conda/lib/python3.10/site-packages/datasets/features/audio.py:103, in Audio.decode_example(self, value) 101 raise ValueError(f"An audio sample should have one of 'path' or 'bytes' but both are None in {value}.") 102 elif path is not None and path.endswith("mp3"): --> 103 array, sampling_rate = self._decode_mp3(file if file else path) 104 elif path is not None and path.endswith("opus"): 105 if file: File /opt/conda/lib/python3.10/site-packages/datasets/features/audio.py:241, in Audio._decode_mp3(self, path_or_file) 238 except RuntimeError as err: 239 raise ImportError("To support decoding 'mp3' audio files, please install 'sox'.") from err --> 241 array, sampling_rate = torchaudio.load(path_or_file, format="mp3") 242 if self.sampling_rate and self.sampling_rate != sampling_rate: 243 if not hasattr(self, "_resampler") or self._resampler.orig_freq != sampling_rate: File /opt/conda/lib/python3.10/site-packages/torchaudio/backend/sox_io_backend.py:256, in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 254 if ret is not None: 255 return ret --> 256 return _fallback_load(filepath, frame_offset, num_frames, normalize, channels_first, format) File /opt/conda/lib/python3.10/site-packages/torchaudio/backend/sox_io_backend.py:30, in _fail_load(filepath, frame_offset, num_frames, normalize, channels_first, format) 22 def _fail_load( 23 filepath: str, 24 frame_offset: int = 0, (...) 28 format: Optional[str] = None, 29 ) -> Tuple[torch.Tensor, int]: ---> 30 raise RuntimeError("Failed to load audio from {}".format(filepath)) RuntimeError: Failed to load audio from /kaggle/input/bengaliai-speech/train_mp3s/000005f3362c.mp3 ``` </details> ### Steps to reproduce the bug 1. - Create a custom dataset using Local files of type mp3. 3. - Try to read the first audio item. ### Expected behavior Expected output ```python audio_dataset[0]["audio"] {'array': array([ 0. , 0.00024414, -0.00024414, ..., -0.00024414, 0. , 0. ], dtype=float32), 'path': 'path/to/audio_1', 'sampling_rate': 16000} ``` ### Environment info N/A I think this is the same issue as https://github.com/huggingface/datasets/issues/4776. Maybe installing `ffmpeg` can fix it: ```python add-apt-repository -y ppa:savoury1/ffmpeg4 apt-get -qq install -y ffmpeg ``` However, the best solution is to use a newer version of `datasets`. In the recent releases, we've replaced `torchaudio` with `soundfile`, which is easier to install and faster.
[ 0.05759705230593681, 0.17602968215942383, -0.08411554247140884, 0.06854526698589325, 0.29818814992904663, -0.06634408235549927, 0.10057631134986877, -0.03363822028040886, -0.10032033175230026, 0.04003417491912842, -0.21711453795433044, 0.08081258088350296, -0.039789676666259766, -0.10964370518922806, 0.14897921681404114, 0.0646456629037857, -0.0806267037987709, 0.04297204688191414, 0.10729699581861496, 0.06387504190206528, -0.15231509506702423, 0.005861439276486635, -0.031399574130773544, 0.03748341649770737, -0.04727804660797119, 0.07699436694383621, -0.09194014221429825, 0.1458858698606491, -0.017991282045841217, -0.07625556737184525, 0.1141861155629158, -0.0463019423186779, 0.010797254741191864, -0.012239819392561913, 0.000005617236183752539, -0.020183751359581947, 0.1849542111158371, 0.0526927150785923, -0.09401743113994598, -0.17897458374500275, 0.07613281905651093, -0.08437550812959671, -0.16404348611831665, 0.02571187913417816, -0.06334858387708664, -0.2533358931541443, -0.1675182580947876, -0.014280883595347404, 0.03605711832642555, 0.08929390460252762, -0.07627768069505692, 0.031520724296569824, -0.05878007784485817, -0.13987506926059723, 0.0020666460040956736, -0.02199200913310051, 0.03166773542761803, 0.12562334537506104, -0.02140044793486595, -0.04096582531929016, -0.05103429779410362, -0.11154065281152725, -0.15836133062839508, 0.061450809240341187, -0.09750983864068985, -0.022954070940613747, -0.07720647007226944, -0.12072870880365372, 0.06179961934685707, 0.35952451825141907, 0.23192349076271057, 0.15589797496795654, -0.104704350233078, -0.030041005462408066, 0.13286380469799042, -0.11526213586330414, 0.012729253619909286, 0.11904177814722061, -0.12356530129909515, 0.12131784111261368, -0.04886928200721741, -0.06501084566116333, 0.10242848098278046, 0.05923286825418472, -0.0604979582130909, -0.026700008660554886, -0.1624508500099182, -0.04707975313067436, -0.020894546061754227, -0.11966255307197571, 0.14625319838523865, 0.0751732662320137, -0.12162289023399353, -0.20822037756443024, 0.22460630536079407, 0.16785745322704315, 0.04046047851443291, -0.1499430537223816, -0.07241953909397125, -0.06295997649431229, -0.04675248637795448, 0.055054813623428345, -0.04180419445037842, 0.1787002831697464, 0.03734873607754707, -0.07983949035406113, 0.04010489210486412, 0.025118036195635796, 0.019179226830601692, -0.05320461094379425, -0.0807218924164772, 0.08113706856966019, -0.2633962035179138, -0.10021592676639557, 0.1099163144826889, -0.04695970565080643, 0.06509560346603394, 0.031944870948791504, 0.029727134853601456, 0.11200137436389923, 0.021166987717151642, 0.06204148754477501, 0.05108979716897011, 0.15142227709293365, 0.12552791833877563, 0.06477876752614975, -0.07407622039318085, 0.12326838076114655, -0.04193678870797157, 0.020668521523475647, 0.07630656659603119, -0.0552699938416481, -0.06088850647211075, 0.05692320317029953, 0.10215887427330017, -0.05243617296218872, -0.014610269106924534, -0.08005917817354202, -0.0655021071434021, -0.0864466205239296, 0.10206614434719086, -0.02523856982588768, -0.17131628096103668, 0.02037142775952816, -0.04925879091024399, -0.013806620612740517, 0.06764984875917435, 0.024720095098018646, -0.08379331231117249, -0.011578114703297615, -0.2668585777282715, 0.07062958180904388, -0.09811901301145554, 0.16154742240905762, -0.09670277684926987, 0.033492252230644226, -0.030987238511443138, -0.02465084381401539, -0.12787480652332306, -0.24903008341789246, 0.08852946013212204, -0.11362715065479279, 0.028027404099702835, -0.11882337182760239, 0.16860051453113556, -0.061221398413181305, -0.03871282562613487, -0.006451503373682499, -0.03644583746790886, -0.007883334532380104, 0.07097039371728897, -0.07257004827260971, -0.07498021423816681, -0.015334034338593483, -0.2806430459022522, 0.06219004839658737, 0.062283772975206375, -0.007806929759681225, -0.1886761635541916, -0.07881420850753784, 0.1198442131280899, -0.009296870790421963, 0.04492967948317528, -0.06934543699026108, 0.06134793534874916, 0.0429111011326313, 0.1395336091518402, 0.075576551258564, 0.13389627635478973, -0.1028645932674408, -0.017060110345482826, 0.027377242222428322, -0.07512136548757553, 0.07633496075868607, -0.05060062184929848, -0.048307865858078, -0.045256953686475754, -0.13224127888679504, -0.005753464996814728, -0.12195469439029694, -0.026387078687548637, -0.021334514021873474, 0.016241000965237617, 0.05528852716088295, 0.04431424289941788, -0.09737199544906616, 0.1475316733121872, -0.0342324823141098, 0.05279325321316719, -0.2056388258934021, -0.1412612944841385, -0.02093346416950226, -0.10274224728345871, 0.02267073281109333, -0.13622909784317017, -0.03888259083032608, -0.03294893354177475, 0.14251554012298584, -0.04770992696285248, 0.1258116364479065, -0.04460965842008591, -0.054609306156635284, 0.16375815868377686, -0.0019350782968103886, 0.06181558594107628, -0.00853747595101595, 0.030144324526190758, -0.003972794394940138, -0.009752016514539719, 0.17983877658843994, -0.013628542423248291, -0.05892016738653183, 0.07262373715639114, 0.13739697635173798, 0.07906053960323334, 0.05483449622988701, -0.1674884408712387, -0.11941973865032196, -0.006998759228736162, -0.04272441938519478, -0.0036885004956275225, 0.020020127296447754, 0.12014246731996536, -0.10257766395807266, 0.011758756823837757, 0.06315439194440842, 0.04362868517637253, 0.16408248245716095, -0.03860054165124893, 0.017013002187013626, 0.3518809974193573, 0.11372014135122299, -0.1725771427154541, 0.0566091351211071, 0.01896960288286209, -0.04524385929107666, 0.003650828031823039, 0.20121218264102936, -0.05348102003335953, -0.1603498011827469, 0.3411419093608856, -0.02343210019171238, 0.03740027919411659, -0.018412133678793907, -0.00634174095466733, -0.060106951743364334, 0.07655179500579834, -0.043093230575323105, 0.033661745488643646, 0.1368524730205536, -0.07226106524467468, -0.051038116216659546, -0.16336676478385925, -0.07224924117326736, -0.01597462221980095, -0.05565488338470459, -0.02515016309916973, -0.02475646696984768, 0.04389694705605507, 0.0024182735942304134, -0.12239644676446915, 0.18735092878341675, 0.007252444978803396, -0.13014107942581177, 0.07324224710464478, -0.036828089505434036, -0.16016294062137604, 0.01386849395930767, 0.04538998007774353, -0.14126348495483398, 0.08902794122695923, 0.06413142383098602, 0.06711988896131516, -0.11365574598312378, -0.09672548621892929, 0.09887758642435074, 0.06166824325919151, -0.009487643837928772, -0.14289028942584991, -0.09364638477563858, 0.10835877805948257, 0.11355127394199371, -0.12407615780830383, 0.14932624995708466, 0.06672069430351257, 0.0658746063709259, 0.0178521778434515, 0.10994157940149307, -0.24190424382686615, 0.11087071150541306, 0.1355099081993103, -0.02654786966741085, 0.08950632065534592, 0.031136848032474518, -0.13813424110412598, 0.03686743974685669, -0.09746389836072922, -0.21688736975193024, 0.08875083923339844, 0.12195545434951782, 0.13776721060276031, 0.17322151362895966, -0.008336148224771023, 0.012935570441186428, 0.02819303423166275, -0.022220708429813385, -0.3022128641605377, -0.11384101957082748, -0.01174660213291645, -0.025357337668538094, -0.039899058640003204, 0.18832971155643463, 0.05458507314324379, -0.05310901999473572, -0.06431698799133301, -0.09517893940210342, -0.1443827599287033, -0.0336301326751709, 0.37615305185317993, -0.0560448057949543, -0.062339264899492264, -0.09081882983446121, -0.09786428511142731, -0.03985260799527168, 0.024891545996069908, -0.012576681561768055, -0.012487031519412994, -0.035635098814964294, -0.06510645896196365, -0.07777613401412964, 0.07245326787233353, 0.031576208770275116, 0.0007990031153894961, -0.04607013985514641, -0.025465039536356926, 0.02290996164083481, 0.04424808546900749, 0.12226986140012741, -0.15965504944324493, 0.17385068535804749, 0.03407670557498932, -0.14469976723194122, 0.020063631236553192, 0.0843900591135025, -0.02782454341650009, 0.16530382633209229, 0.14149034023284912, 0.1049666479229927, -0.01704530417919159, 0.019132623448967934, -0.18160462379455566, 0.06345528364181519, -0.012819347903132439, -0.040494177490472794, 0.14163196086883545, -0.0454438142478466, -0.10455729812383652, -0.1328626424074173, 0.06107285991311073, 0.028104791417717934, -0.010371129959821701, -0.11406419426202774, -0.052364930510520935, 0.11507878452539444, 0.19590477645397186, 0.1679227650165558, 0.03835462033748627, 0.06493902951478958, -0.18868504464626312, 0.18695785105228424, 0.04456859454512596, -0.0007828352390788496, -0.13956548273563385, -0.13923223316669464, -0.10427755862474442, -0.1288273185491562, 0.31944355368614197, 0.1807185560464859, -0.0710463672876358, -0.029725249856710434, 0.1389802247285843, -0.029862914234399796, -0.00979879405349493, -0.07318770885467529, 0.06088569015264511, 0.17509528994560242, 0.19043534994125366, -0.03487756475806236, -0.03017621859908104, -0.027865542098879814, -0.04841179400682449, 0.07475195825099945, -0.05768352001905441, 0.1421944797039032, 0.12430138140916824, 0.12552225589752197, 0.050448328256607056, -0.03651489317417145, -0.2245578169822693, -0.1522192507982254, -0.11983198672533035, -0.1710835099220276, 0.15433815121650696, 0.2850208878517151, -0.012834357097744942, -0.02320386841893196, 0.10849471390247345, -0.07053758203983307, 0.1301145702600479, -0.12091580778360367, 0.11941440403461456, -0.019704466685652733, 0.1242561936378479, 0.02103651501238346, 0.015927188098430634, 0.07802363485097885, 0.3807087540626526, 0.03432132676243782, 0.015628362074494362, 0.0284518301486969, -0.07481846213340759, -0.10369663685560226, -0.1078295037150383, 0.020574945956468582, -0.027012359350919724, -0.04045003280043602, -0.16468918323516846, -0.16826537251472473, -0.06969498842954636, -0.1027267798781395, -0.04427725821733475, -0.09868063777685165, -0.21024689078330994, -0.08016574382781982, -0.043809518218040466, -0.026775922626256943, 0.07806086540222168, -0.02888604626059532, 0.12982669472694397, 0.23412512242794037, -0.15985703468322754, -0.08097435534000397, -0.1111333966255188, 0.03357016295194626, 0.08986857533454895, -0.0010332193924114108, 0.12281128019094467, -0.13108111917972565, 0.07219796627759933, 0.14614062011241913, -0.06492430716753006, 0.12949201464653015, -0.06562869995832443, -0.03298550471663475, 0.09844745695590973, -0.025411084294319153, -0.0101208770647645, 0.08728913217782974, -0.035231899470090866, -0.007790835574269295, 0.08096480369567871, 0.10370229929685593, 0.137929767370224, -0.1634306162595749, -0.02651071920990944, 0.12149972468614578, 0.12692467868328094, -0.040809378027915955, -0.05383496358990669, -0.014230659231543541, 0.19928225874900818, 0.029664481058716774, 0.08729765564203262, -0.11296263337135315, 0.07984434068202972, -0.02588074840605259, -0.03486345335841179, 0.14078259468078613, 0.05822787433862686, -0.12029195576906204, 0.12353777140378952, -0.0572090819478035, 0.04886629804968834, -0.003760914085432887, 0.10629046708345413, -0.08102377504110336, 0.02666795253753662, -0.07132937014102936, -0.0668623074889183, -0.05358428880572319, 0.14037132263183594, 0.0394425205886364, -0.06637313961982727, 0.07882507890462875, 0.12851068377494812, 0.014099856838583946, -0.037381067872047424, -0.14063502848148346, -0.08613938838243484, -0.032791510224342346, 0.13415798544883728, 0.14580629765987396, -0.006982769351452589, -0.014088193885982037, 0.002439160132780671, 0.12049330025911331, -0.05259621888399124, 0.029485564678907394, 0.2654455304145813, 0.08552780002355576, -0.02736542746424675, 0.07272995263338089, 0.08988165855407715, 0.01862771064043045, 0.031189383938908577, 0.07469934225082397, -0.017250902950763702, -0.018171953037381172, -0.07547812908887863, 0.24943877756595612, 0.06327824294567108, -0.2827826142311096, -0.14926783740520477, -0.0018471975345164537, -0.04090559110045433, 0.024236496537923813, 0.017474541440606117, -0.17881138622760773, 0.06363753974437714, -0.03485824167728424, -0.08605876564979553, 0.004325085319578648, 0.005057701375335455, -0.020185017958283424, -0.137980654835701, -2.3513497253470713e-32, -0.13109669089317322, -0.07313957810401917, -0.15066617727279663, -0.07119788974523544, -0.0837516039609909, 0.08381357043981552, -0.10271578282117844, -0.0171730387955904, -0.09344983845949173, 0.006519900634884834, 0.04412372410297394, -0.0031505597289651632, -0.004166469909250736, 0.10734983533620834, -0.14261317253112793, -0.16628378629684448, -0.07601632177829742, -0.05038785561919212, 0.006357588805258274, 0.03213616460561752, 0.10615649074316025, 0.12272439152002335, -0.062222182750701904, -0.03922119736671448, 0.012963611632585526, -0.05890360102057457, -0.016700830310583115, -0.24886955320835114, -0.047112010419368744, 0.0440509095788002, -0.0635860487818718, 0.12645503878593445, 0.0012394768418744206, -0.14187009632587433, 0.005070982035249472, -0.024155765771865845, -0.27053508162498474, 0.0258942861109972, 0.09738659113645554, 0.030360691249370575, 0.12183985114097595, 0.10644198209047318, 0.08937212079763412, -0.1404455602169037, 0.0298940259963274, 0.10696393996477127, 0.01863631047308445, 0.014772995375096798, -0.15545198321342468, -0.017209146171808243, -0.07786868512630463, 0.05996919795870781, -0.05624708905816078, 0.015452616848051548, 0.0677325427532196, -0.037806153297424316, 0.06042388826608658, 0.061397064477205276, -0.05927310883998871, -0.013560168445110321, 0.10401780158281326, -0.01801336742937565, 0.12238635867834091, -0.09553325176239014, 0.10389390587806702, -0.08667723834514618, 0.28418201208114624, -0.03098667412996292, -0.14908921718597412, -0.06899167597293854, -0.018617436289787292, 0.14630693197250366, -0.22375454008579254, -0.08044268935918808, -0.08471336960792542, -0.14590919017791748, -0.15232476592063904, -0.006790516432374716, 0.01157717127352953, -0.165809765458107, 0.06555633246898651, 0.08553976565599442, -0.266194611787796, 0.010756609961390495, -0.008349109441041946, 0.04663798213005066, -0.006817436311393976, -0.0005511179333552718, -0.19363977015018463, -0.12125254422426224, 0.1921975463628769, -0.12683430314064026, -0.19709300994873047, 0.024413378909230232, 0.053524091839790344, -0.00360588519833982, -0.03513684868812561, -0.06633587181568146, -0.10485568642616272, 0.12027449905872345, -0.014019628055393696, -0.04337874427437782, 0.19349928200244904, -0.1714581996202469, 0.12606632709503174, 0.12811946868896484, 0.019971849396824837, 0.04445864260196686, -0.10514327138662338, -0.11748813837766647, 0.04700743407011032, 0.06703126430511475, 0.24687425792217255, 0.1831633597612381, 0.1024293377995491, 0.20470330119132996, -0.16951550543308258, -0.09863206744194031, 0.12015336006879807, 0.2433473765850067, -0.1810067892074585, -0.004909965209662914, -0.13388004899024963, -0.11301873624324799, -0.020998671650886536, 0.18684856593608856, -0.17604389786720276, 0.0063636754639446735, -0.03495577350258827, 0.05918435379862785, 0.09548239409923553, -0.015925941988825798, 7.614588071191974e-7, -0.12327810376882553, 0.06324871629476547, 0.01081212516874075, 0.09934359788894653, 0.005359209608286619, 0.02105638012290001, -0.320020467042923, -0.006188079249113798, 0.037605006247758865, 0.10087830573320389, 0.17815886437892914, -0.1299009472131729, 0.038977060467004776, 0.11653729528188705, -0.13695646822452545, -0.007320783566683531, -0.021908028051257133, 0.05186508223414421, -0.06933670490980148, -0.07993502169847488, 0.05872441083192825, 0.14489123225212097, -0.1727098673582077, -0.09968172013759613, 0.0904780775308609, -0.05120081454515457, -0.055391278117895126, -0.046379853039979935, 0.12317926436662674, -0.1041504442691803, -0.07775488495826721, 0.11558087170124054, -0.04259224981069565, 0.14512209594249725, -0.04141772538423538, 0.06646350771188736, -0.15111643075942993, -0.03948096185922623, 0.20109321177005768, -0.01845547929406166, -0.013702046126127243, 0.03707178309559822, 0.06657323986291885, 0.052253756672143936, 0.039980966597795486, 0.09808003902435303, -0.05696212500333786, 0.08969365060329437, -0.1431538164615631, 0.12910254299640656, -0.003579090815037489, 0.03868919983506203, 0.09780730307102203, -0.10686527192592621, -0.03553488105535507, -0.06314118206501007, -0.06260985881090164, -0.16096621751785278, 0.22852422297000885, 0.015315350145101547, -0.049252673983573914, -0.10071960836648941, 0.18180789053440094, -0.11721443384885788, 0.19609922170639038, -0.08113490790128708, 0.12715590000152588, 4.551735966504304e-35, -0.019422335550189018, -0.059603121131658554, 0.06665612757205963, -0.19234025478363037, 0.06054693087935448, -0.001966991228982806, 0.20926591753959656, -0.1373705267906189, 0.08234372735023499, -0.19067341089248657, -0.11811485886573792 ]
https://github.com/huggingface/datasets/issues/6238
`dataset.filter` ALWAYS removes the first item from the dataset when using batched=True
`filter` treats the function's output as a (selection) mask - `True` keeps the sample, and `False` drops it. In your case, `bool(0)` evaluates to `False`, so dropping the first sample is the correct behavior.
### Describe the bug If you call batched=True when calling `filter`, the first item is _always_ filtered out, regardless of the filter condition. ### Steps to reproduce the bug Here's a minimal example: ```python def filter_batch_always_true(batch, indices): print("First index being passed into this filter function: ", indices[0]) return indices # Keep all indices data = {"value": list(range(10))} dataset = Dataset.from_dict(data) filtered_dataset = dataset.filter(filter_batch_always_true, with_indices=True, batched=True) print("Length of original dataset: ", len(dataset)) print("Length of filtered_dataset: ", len(filtered_dataset)) print("Is equal to original? ", len(filtered_dataset) == len(dataset)) print("First item of filtered dataset: ", filtered_dataset[0]) print("Last item of filtered dataset: ", filtered_dataset[-1]) ``` prints: ``` First index being passed into this filter function: 0 Length of original dataset: 10 Length of filtered_dataset: 9 Is equal to original? False First item of filtered dataset: {'value': 1} Last item of filtered dataset: {'value': 9} ``` ### Expected behavior Filter should respect the filter condition. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-13.5-arm64-arm-64bit - Python version: 3.9.18 - Huggingface_hub version: 0.17.1 - PyArrow version: 10.0.1 - Pandas version: 2.0.2
34
`dataset.filter` ALWAYS removes the first item from the dataset when using batched=True ### Describe the bug If you call batched=True when calling `filter`, the first item is _always_ filtered out, regardless of the filter condition. ### Steps to reproduce the bug Here's a minimal example: ```python def filter_batch_always_true(batch, indices): print("First index being passed into this filter function: ", indices[0]) return indices # Keep all indices data = {"value": list(range(10))} dataset = Dataset.from_dict(data) filtered_dataset = dataset.filter(filter_batch_always_true, with_indices=True, batched=True) print("Length of original dataset: ", len(dataset)) print("Length of filtered_dataset: ", len(filtered_dataset)) print("Is equal to original? ", len(filtered_dataset) == len(dataset)) print("First item of filtered dataset: ", filtered_dataset[0]) print("Last item of filtered dataset: ", filtered_dataset[-1]) ``` prints: ``` First index being passed into this filter function: 0 Length of original dataset: 10 Length of filtered_dataset: 9 Is equal to original? False First item of filtered dataset: {'value': 1} Last item of filtered dataset: {'value': 9} ``` ### Expected behavior Filter should respect the filter condition. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-13.5-arm64-arm-64bit - Python version: 3.9.18 - Huggingface_hub version: 0.17.1 - PyArrow version: 10.0.1 - Pandas version: 2.0.2 `filter` treats the function's output as a (selection) mask - `True` keeps the sample, and `False` drops it. In your case, `bool(0)` evaluates to `False`, so dropping the first sample is the correct behavior.
[ 0.1274176836013794, -0.01043546013534069, -0.12952305376529694, 0.0586199089884758, 0.029899781569838524, 0.017704052850604057, 0.05783021077513695, -0.053619202226400375, 0.06345871835947037, 0.23204979300498962, 0.08956776559352875, -0.055264804512262344, 0.002884558867663145, 0.04539744183421135, -0.047744978219270706, 0.05610901862382889, 0.07856699824333191, 0.0027052531950175762, 0.028364477679133415, -0.09318247437477112, -0.07713675498962402, 0.016518421471118927, -0.007679868955165148, 0.0712440088391304, -0.020158441737294197, -0.079811230301857, 0.008653384633362293, 0.10233721137046814, -0.036843784153461456, -0.08819618076086044, 0.06388754397630692, -0.07022147625684738, -0.04509701579809189, 0.028737766668200493, 0.000005709115157515043, 0.011611404828727245, 0.20251545310020447, -0.08940426260232925, -0.047037798911333084, -0.19284966588020325, 0.012764794752001762, 0.020265066996216774, 0.1550637036561966, -0.052857860922813416, -0.09093242138624191, 0.05343998596072197, 0.005624201148748398, -0.02737964317202568, 0.056418098509311676, -0.1043630987405777, -0.031569890677928925, -0.00782047025859356, -0.18889756500720978, -0.16682052612304688, 0.031946975737810135, 0.04567382112145424, 0.19684216380119324, 0.011868159286677837, -0.14796921610832214, -0.1082920953631401, 0.07907918095588684, -0.11375784128904343, 0.08641187101602554, 0.15475110709667206, -0.09655070304870605, 0.022854791954159737, -0.1479703187942505, -0.16157588362693787, -0.031227026134729385, 0.11794369667768478, -0.03457851707935333, -0.1144789308309555, 0.03852047398686409, -0.06853525340557098, -0.015348544344305992, 0.02641759067773819, -0.14794296026229858, 0.045596811920404434, -0.0411841943860054, 0.1266442984342575, -0.021137185394763947, 0.12506131827831268, -0.05772041529417038, 0.12483663856983185, -0.12819473445415497, 0.0941975861787796, -0.12078656256198883, 0.0866956040263176, -0.1590767353773117, -0.02502451092004776, 0.028924869373440742, -0.01305400300770998, 0.012738503515720367, -0.08076748996973038, 0.03983226791024208, 0.08258789777755737, -0.037541478872299194, 0.024645280092954636, 0.04748246446251869, 0.04343053698539734, -0.23989589512348175, -0.02822873927652836, -0.04644477367401123, 0.04632822424173355, 0.19614723324775696, -0.1009320542216301, 0.03473822772502899, 0.09924543648958206, 0.04026015102863312, 0.017889998853206635, 0.03484746068716049, 0.05570659041404724, 0.09151601046323776, 0.1754770278930664, 0.13731832802295685, 0.054167740046978, -0.05434871464967728, -0.01908344216644764, -0.07329248636960983, 0.2000201791524887, 0.08211749792098999, 0.02948850579559803, 0.016669854521751404, 0.02068825624883175, 0.03683064505457878, 0.02923915535211563, 0.004364950582385063, 0.21492154896259308, -0.149306058883667, 0.10438261926174164, -0.10987144708633423, -0.1237606331706047, 0.0646258220076561, -0.025398708879947662, 0.1348768174648285, -0.14414528012275696, 0.02565758489072323, 0.008594920858740807, -0.07136862725019455, -0.19195424020290375, 0.073153555393219, 0.017238160595297813, 0.18918395042419434, 0.1312541514635086, 0.14442434906959534, 0.09732426702976227, 0.1273031383752823, 0.002441810443997383, 0.01447936799377203, 0.10186311602592468, -0.0767814964056015, 0.12655411660671234, -0.03498479723930359, 0.08548907190561295, -0.06720235198736191, 0.09079872816801071, -0.08387546241283417, 0.06629322469234467, -0.1767313927412033, -0.0012044920586049557, 0.13308142125606537, 0.005439923610538244, -0.12607401609420776, -0.09706318378448486, 0.07516150176525116, 0.1327867954969406, -0.05018299072980881, 0.08270328491926193, -0.10007970035076141, -0.05837485194206238, 0.1388736367225647, -0.06791692972183228, 0.00738900899887085, -0.09302988648414612, -0.045043930411338806, 0.09542591124773026, -0.07449215650558472, -0.06202840059995651, -0.25879743695259094, -0.002715826965868473, 0.030449992045760155, 0.02571512572467327, 0.08179417252540588, -0.18400663137435913, 0.19886699318885803, -0.11160451173782349, -0.11143632978200912, 0.013651982881128788, -0.07925433665513992, 0.04297570511698723, -0.014889352023601532, 0.1228681355714798, 0.0795166864991188, 0.09442617744207382, -0.045634422451257706, 0.025268886238336563, -0.07391954958438873, -0.05565471202135086, -0.018583999946713448, -0.007267468608915806, -0.014290258288383484, -0.05788441747426987, 0.18790706992149353, -0.05094408988952637, 0.02598913572728634, -0.1465199589729309, -0.17295046150684357, 0.029367130249738693, 0.05606053024530411, -0.19323322176933289, -0.22766369581222534, -0.021664174273610115, 0.016834821552038193, 0.0043858736753463745, -0.14607955515384674, 0.0014747908571735024, -0.1650739461183548, -0.0009703662944957614, -0.0656217709183693, 0.17040979862213135, -0.10047546029090881, 0.16507767140865326, 0.0967080220580101, 0.16790542006492615, 0.10669541358947754, -0.0001540913654025644, -0.06481882184743881, -0.01859513856470585, -0.017251936718821526, -0.059701692312955856, 0.023934464901685715, -0.09185788035392761, 0.15143674612045288, 0.2565518319606781, 0.030804362148046494, -0.13092109560966492, -0.04264916107058525, -0.21769803762435913, 0.16180919110774994, 0.0707428827881813, -0.08652757108211517, 0.29283806681632996, -0.01538153737783432, -0.023952266201376915, -0.03057425282895565, 0.2701055109500885, -0.0008353368029929698, 0.036341164261102676, -0.10198509693145752, -0.030756738036870956, 0.16659098863601685, 0.17454780638217926, -0.13965579867362976, -0.01282942108809948, -0.07014491409063339, -0.10124366730451584, 0.10652796924114227, 0.014821823686361313, 0.05566757917404175, 0.07170729339122772, 0.246151402592659, -0.050540853291749954, -0.05527029559016228, -0.03903894126415253, 0.10828304290771484, -0.07328148931264877, 0.11290376633405685, 0.046642836183309555, -0.1030154898762703, 0.13488627970218658, 0.07080265879631042, -0.1096106469631195, -0.13329969346523285, -0.041669879108667374, -0.05167112126946449, -0.062169261276721954, -0.15213316679000854, 0.07110819965600967, 0.07677619159221649, 0.11777558922767639, -0.038167890161275864, 0.1609656661748886, -0.0032239051070064306, -0.015113935805857182, 0.13188901543617249, 0.06352918595075607, -0.02824263460934162, -0.01763857528567314, -0.05209982395172119, 0.005506887100636959, -0.06090652570128441, -0.17610140144824982, -0.010285324417054653, -0.028131980448961258, 0.05109502747654915, -0.004694818519055843, -0.09043559432029724, -0.014795922674238682, -0.0011017321376129985, -0.03711126372218132, -0.03188106045126915, 0.11535471677780151, 0.05693354085087776, -0.022945597767829895, -0.04778854548931122, 0.22780868411064148, 0.1617523729801178, 0.21900515258312225, -0.25942885875701904, -0.04526335000991821, 0.022791214287281036, 0.040748920291662216, 0.003949148114770651, 0.19764524698257446, -0.016918282955884933, -0.03933783248066902, -0.21536806225776672, -0.22645612061023712, 0.026278289034962654, 0.0627453625202179, -0.2045324146747589, 0.1600007861852646, -0.05865653231739998, -0.008373544551432133, -0.04826272279024124, 0.017393779009580612, 0.16848495602607727, -0.06756918132305145, -0.019302889704704285, -0.09205911308526993, -0.009699681773781776, 0.06805829703807831, 0.0767456442117691, -0.13024678826332092, -0.025598959997296333, 0.03259289637207985, -0.11027728021144867, -0.07031578570604324, 0.10082188993692398, 0.022747980430722237, -0.12122901529073715, 0.05733199417591095, -0.10208743065595627, -0.12700042128562927, 0.07184535264968872, -0.10349594056606293, -0.021733541041612625, 0.02511097677052021, 0.06720708310604095, 0.04998981952667236, 0.1429077833890915, 0.07598311454057693, -0.13833001255989075, -0.03394947201013565, -0.041486162692308426, -0.03510485962033272, -0.16115103662014008, 0.0057997130788862705, -0.06375683099031448, 0.18030312657356262, 0.063723124563694, 0.01971769519150257, 0.06029762327671051, 0.039251189678907394, 0.133833110332489, 0.0950203686952591, 0.05090903118252754, 0.0017212687525898218, 0.12667104601860046, -0.1420281082391739, -0.021129747852683067, -0.04771273210644722, 0.06361079961061478, -0.004729282110929489, 0.03788252919912338, 0.05232284963130951, 0.1064762994647026, -0.07900229841470718, -0.0004849170218221843, -0.03547053039073944, -0.041388943791389465, -0.1691848188638687, -0.07786460220813751, 0.1325831413269043, 0.08501548320055008, 0.03231317177414894, 0.030630020424723625, -0.0648030936717987, 0.01846795342862606, 0.20977745950222015, 0.07266544550657272, 0.025684654712677002, -0.04352188855409622, -0.061204828321933746, -0.006319119594991207, -0.05099833756685257, 0.19885772466659546, 0.09759856015443802, 0.0479261577129364, 0.12218372523784637, 0.08707080036401749, 0.14673247933387756, 0.0593472383916378, 0.17652226984500885, 0.11351221799850464, -0.01109214685857296, -0.05780789628624916, -0.004207670222967863, -0.05137823522090912, 0.032708462327718735, 0.08058646321296692, 0.008832679130136967, -0.033001597970724106, -0.029521595686674118, 0.15488718450069427, -0.040459081530570984, -0.17674051225185394, 0.02171359211206436, -0.14723174273967743, -0.13291087746620178, -0.1878708004951477, 0.02068359963595867, -0.02950967848300934, 0.09617838263511658, 0.09692757576704025, -0.025219222530722618, -0.10393072664737701, -0.04283660277724266, -0.014279919676482677, 0.045567285269498825, 0.06124039739370346, 0.10459700971841812, 0.07966841757297516, 0.06388168781995773, 0.13595911860466003, -0.05779869109392166, 0.08179211616516113, -0.12570646405220032, -0.1017620638012886, -0.11151015758514404, -0.22808606922626495, -0.026306208223104477, -0.03215254470705986, -0.14470350742340088, 0.10363931208848953, -0.041406333446502686, -0.07144065946340561, 0.08739365637302399, -0.05067319795489311, -0.06738284230232239, -0.07201968133449554, -0.14006321132183075, -0.008103555999696255, -0.01912214793264866, -0.11163298785686493, -0.06455890834331512, 0.1582862138748169, -0.12666557729244232, 0.11601660400629044, 0.014526834711432457, -0.173220694065094, -0.05415781959891319, 0.053549833595752716, 0.1658439338207245, -0.02301676757633686, 0.04841078445315361, -0.043720949441194534, 0.11787276715040207, -0.04090375080704689, 0.057533372193574905, -0.10990909487009048, 0.10526218265295029, 0.03977049142122269, 0.08044207841157913, -0.004710362292826176, 0.07564030587673187, -0.009774617850780487, 0.06330884248018265, 0.1051909327507019, -0.03870565444231033, 0.1280403882265091, 0.16475830972194672, 0.09724065661430359, 0.004480971954762936, -0.13317753374576569, 0.2753877639770508, -0.010529139079153538, -0.03789541497826576, -0.09731333702802658, 0.07702592760324478, 0.005858591292053461, 0.08796359598636627, -0.05894166976213455, 0.13138797879219055, -0.20914892852306366, 0.04866739362478256, 0.021694744005799294, 0.0024465678725391626, -0.23078888654708862, 0.16954964399337769, 0.09576546400785446, -0.027799412608146667, -0.018184809014201164, 0.10313023626804352, -0.008058260194957256, -0.1296447515487671, -0.028545672073960304, 0.06957414746284485, 0.07973157614469528, 0.040101684629917145, -0.08991435170173645, 0.15854661166667938, 0.007128129247575998, 0.07792414724826813, 0.11858204007148743, -0.18172591924667358, -0.24440975487232208, -0.025257403030991554, 0.02912759594619274, 0.03875941038131714, -0.04538615047931671, -0.03566577658057213, 0.07619447261095047, -0.18834975361824036, 0.1601000726222992, -0.023455411195755005, -0.004124179948121309, -0.17250041663646698, 0.17576315999031067, 0.1742020696401596, -0.01076221838593483, 0.10746392607688904, 0.11326563358306885, -0.1351657509803772, 0.12900684773921967, -0.009027967229485512, 0.19928087294101715, 0.06393266469240189, 0.1028384268283844, -0.09441740065813065, -0.005720977205783129, -0.12084227055311203, -0.0671311616897583, -0.09687470644712448, 0.008304609917104244, -0.0478033646941185, 0.0034207047428935766, 0.06259574741125107, -0.06447102874517441, 0.02207663282752037, -0.012046430259943008, -0.04121587052941322, 0.16964153945446014, 0.021533425897359848, -0.00795681495219469, -2.822562945858303e-32, 0.06296401470899582, 0.20023003220558167, 0.030386032536625862, -0.10510490834712982, 0.06924563646316528, 0.03919257968664169, 0.11005308479070663, -0.08132901787757874, -0.05352155491709709, -0.006379521451890469, -0.16964329779148102, 0.03566834703087807, 0.06813780963420868, -0.05330105125904083, -0.11179574579000473, -0.08991414308547974, 0.0115303173661232, -0.06328640878200531, 0.04389553889632225, 0.08263437449932098, 0.06620802730321884, 0.10153736919164658, 0.06644517928361893, 0.06091253459453583, -0.11764945089817047, 0.08597023785114288, -0.10305599868297577, -0.2841697633266449, -0.18299347162246704, -0.05106370896100998, -0.026369832456111908, 0.15249645709991455, 0.07073704898357391, -0.12099471688270569, -0.14014673233032227, -0.26042690873146057, -0.009177414700388908, -0.17298726737499237, 0.004457442555576563, -0.04539595544338226, -0.007332162000238895, 0.16349594295024872, 0.12372297793626785, -0.01666012592613697, -0.12775154411792755, 0.017108174040913582, -0.009417527355253696, -0.01127129327505827, -0.1567029356956482, -0.14241191744804382, 0.24103271961212158, 0.10429388284683228, 0.1541079580783844, -0.06632944941520691, -0.07592650502920151, -0.10824310034513474, -0.04627265781164169, 0.042196229100227356, 0.0019137259805575013, 0.11935829371213913, 0.06992124766111374, 0.03409536927938461, -0.06510431319475174, -0.024092476814985275, 0.21446415781974792, -0.08059718459844589, 0.41177016496658325, 0.028948543593287468, 0.16934673488140106, -0.035576436668634415, -0.03397069126367569, 0.014578872360289097, -0.25151142477989197, -0.0800471305847168, -0.1398756206035614, -0.07517261058092117, -0.07556097209453583, -0.10758873075246811, -0.23149167001247406, -0.02102060057222843, -0.03673349693417549, -0.05915310978889465, 0.11732053011655807, -0.03432373329997063, 0.0539884977042675, -0.0737985298037529, 0.04266268387436867, 0.1956213414669037, -0.07531628012657166, -0.04679567366838455, -0.2201455980539322, 0.06710595637559891, -0.14844991266727448, 0.015424062497913837, -0.22706305980682373, 0.025945551693439484, -0.17319315671920776, -0.05377095937728882, -0.03946507349610329, 0.04271268472075462, -0.12723888456821442, -0.044866304844617844, 0.16447390615940094, -0.07137637585401535, -0.004008385818451643, -0.00858098454773426, 0.1145804226398468, 0.06613817811012268, -0.07094789296388626, -0.052922070026397705, -0.08992432802915573, 0.08807337284088135, 0.14918231964111328, 0.11915060132741928, 0.02771766483783722, -0.0249576848000288, 0.09249254316091537, -0.038893889635801315, 0.21240466833114624, -0.03551730141043663, -0.2344873547554016, -0.06250869482755661, -0.18173831701278687, 0.06248204782605171, -0.1056898757815361, -0.012265962548553944, -0.25829726457595825, 0.08500318229198456, 0.095441073179245, -0.16900333762168884, -0.017807673662900925, -0.025147106498479843, 7.64054675528314e-7, -0.1486019641160965, -0.15982970595359802, -0.028273532167077065, 0.03432096913456917, 0.025459595024585724, 0.137460395693779, -0.08272162824869156, 0.2206198126077652, -0.11900784820318222, 0.18465295433998108, 0.19928793609142303, -0.06879711896181107, -0.08835450559854507, -0.220436230301857, 0.10260029882192612, -0.03669716417789459, -0.13390293717384338, 0.045845650136470795, 0.009913831017911434, -0.009008797816932201, -0.1208578497171402, 0.08894136548042297, 0.12090490758419037, -0.10291998088359833, 0.07385280728340149, -0.03864362835884094, 0.012555576860904694, 0.029911505058407784, 0.1265418976545334, -0.09053733199834824, -0.047061290591955185, 0.07238618284463882, 0.05610740929841995, 0.02933286875486374, -0.0329425074160099, 0.09835539013147354, -0.1586354821920395, 0.07944159209728241, -0.11143958568572998, -0.0945214107632637, 0.13792292773723602, 0.051418237388134, -0.00733637111261487, -0.11471648514270782, 0.21695244312286377, 0.07292886078357697, 0.057734936475753784, 0.061997443437576294, 0.003744155168533325, 0.10185332596302032, 0.0005445972783491015, 0.11226218193769455, -0.05237463116645813, 0.1690489798784256, -0.09013861417770386, -0.04643625393509865, -0.12909480929374695, -0.2249356359243393, 0.09916429221630096, -0.22458945214748383, -0.1312219798564911, -0.18055078387260437, -0.01581132784485817, -0.023877574130892754, -0.04561036452651024, -0.016548948362469673, 0.011581718921661377, 1.38044569389674e-34, -0.06612848490476608, -0.05949905887246132, -0.0234378594905138, -0.21875116229057312, 0.06860149651765823, -0.13905121386051178, 0.034488290548324585, 0.18142364919185638, -0.18353508412837982, 0.01975434459745884, -0.11743950098752975 ]
https://github.com/huggingface/datasets/issues/6237
Tokenization with multiple workers is too slow
[This](https://huggingface.co/docs/datasets/nlp_process#map) is the most performant way to tokenize a dataset (`batched=True, num_proc=None, return_tensors="np"`) If`tokenizer.is_fast` returns `True`, `num_proc` must be `None/1` to benefit from the fast tokenizers' parallelism (the fast tokenizers are implemented in Rust, and Rust multi-threading doesn't work well with Python multi-processing)
I am trying to tokenize a few million documents with multiple workers but the tokenization process is taking forever. Code snippet: ``` raw_datasets.map( encode_function, batched=False, num_proc=args.preprocessing_num_workers, load_from_cache_file=not args.overwrite_cache, remove_columns=[name for name in raw_datasets["train"].column_names if name not in ["input_ids", "labels", "attention_mask"]], desc="Tokenizing data", ) ``` Details: ``` transformers==4.28.0.dev0 datasets==4.28.0.dev0 preprocessing_num_workers==48 ``` tokenizer == decapoda-research/llama-7b-hf
43
Tokenization with multiple workers is too slow I am trying to tokenize a few million documents with multiple workers but the tokenization process is taking forever. Code snippet: ``` raw_datasets.map( encode_function, batched=False, num_proc=args.preprocessing_num_workers, load_from_cache_file=not args.overwrite_cache, remove_columns=[name for name in raw_datasets["train"].column_names if name not in ["input_ids", "labels", "attention_mask"]], desc="Tokenizing data", ) ``` Details: ``` transformers==4.28.0.dev0 datasets==4.28.0.dev0 preprocessing_num_workers==48 ``` tokenizer == decapoda-research/llama-7b-hf [This](https://huggingface.co/docs/datasets/nlp_process#map) is the most performant way to tokenize a dataset (`batched=True, num_proc=None, return_tensors="np"`) If`tokenizer.is_fast` returns `True`, `num_proc` must be `None/1` to benefit from the fast tokenizers' parallelism (the fast tokenizers are implemented in Rust, and Rust multi-threading doesn't work well with Python multi-processing)
[ -0.052647143602371216, 0.10093443840742111, -0.038992054760456085, -0.009152433834969997, 0.08023320138454437, -0.020242659375071526, 0.1902080774307251, 0.11209046840667725, -0.18427708745002747, 0.0913354754447937, -0.05606520548462868, 0.005046323873102665, -0.1936444640159607, 0.05464983358979225, -0.16872966289520264, 0.012705635279417038, 0.09088300168514252, 0.05758584290742874, 0.07654793560504913, -0.06757781654596329, -0.0905236005783081, -0.036738812923431396, 0.08110726624727249, -0.0568254254758358, -0.07462158799171448, -0.07699703425168991, 0.033293455839157104, -0.08924316614866257, -0.1400189995765686, -0.051362380385398865, -0.12342967838048935, 0.037415388971567154, -0.10094457119703293, 0.2827656865119934, 0.000004984221959603019, -0.14060601592063904, 0.05404873192310333, 0.06710068881511688, 0.1229967474937439, 0.10559378564357758, 0.25111714005470276, -0.1452297866344452, 0.08427398651838303, 0.07625600695610046, -0.04983564093708992, 0.0156799778342247, -0.007990813814103603, 0.07748406380414963, 0.10250058025121689, -0.029210692271590233, -0.016440128907561302, 0.02988489158451557, 0.018757136538624763, -0.021433133631944656, -0.1797107756137848, -0.17260204255580902, -0.032719094306230545, -0.19336755573749542, 0.0032349852845072746, -0.04116198420524597, -0.048214856535196304, 0.1305634081363678, 0.08351574093103409, -0.06630638241767883, 0.07214224338531494, 0.1313612163066864, -0.1517581194639206, -0.17270277440547943, 0.03098953329026699, 0.14470665156841278, -0.27116748690605164, 0.08074985444545746, -0.06375062465667725, 0.10303571075201035, -0.14456535875797272, -0.25856485962867737, -0.08489157259464264, 0.15320678055286407, -0.02206890657544136, 0.08651897311210632, -0.07613717764616013, 0.1084548681974411, 0.028486358001828194, -0.07790238410234451, -0.09742240607738495, 0.1358124166727066, 0.04802173003554344, 0.11815669387578964, 0.1150861456990242, 0.09615733474493027, 0.02506858855485916, -0.10779362916946411, -0.0158131942152977, -0.012399348430335522, -0.25533488392829895, -0.03738650679588318, -0.12411803007125854, -0.28367045521736145, 0.043365728110075, -0.1104862242937088, -0.260407030582428, 0.06849630177021027, -0.1105896532535553, 0.0729990154504776, -0.24308712780475616, -0.12135471403598785, -0.018492456525564194, -0.0526968315243721, 0.0574454739689827, -0.17774246633052826, -0.13868136703968048, -0.011469349265098572, -0.18930353224277496, 0.14314767718315125, 0.02136232517659664, -0.08888428658246994, -0.0026736988220363855, 0.05367469787597656, 0.009553154930472374, -0.008697224780917168, 0.1727258265018463, 0.028878450393676758, -0.07067278027534485, 0.05431418493390083, -0.04889530688524246, 0.11939442902803421, -0.2073255479335785, -0.015253393910825253, -0.2053343951702118, 0.07290799915790558, 0.025340337306261063, 0.011883074417710304, 0.1301143914461136, 0.06202518939971924, 0.10554066300392151, -0.062445566058158875, -0.09706341475248337, 0.08922635018825531, 0.02816210314631462, -0.08132674545049667, 0.16223396360874176, -0.16032804548740387, -0.09527670592069626, -0.05188220366835594, 0.05553283542394638, 0.12005068361759186, 0.055811747908592224, 0.04723997414112091, -0.059248343110084534, -0.11284258961677551, -0.04192055016756058, 0.08027090132236481, -0.019687334075570107, -0.01892397738993168, -0.02403733693063259, 0.05342397093772888, 0.01310684159398079, -0.12988066673278809, -0.06614187359809875, 0.1205870658159256, -0.02757580392062664, -0.10955739766359329, -0.008842824958264828, 0.0763406753540039, 0.006088463123887777, 0.051945775747299194, 0.16048967838287354, -0.006686927285045385, 0.09120524674654007, 0.22464051842689514, 0.3373027741909027, 0.22754870355129242, -0.12069182842969894, 0.10696521401405334, -0.08510561287403107, 0.23694193363189697, -0.06273800879716873, 0.06573657691478729, -0.044629842042922974, 0.02755986899137497, -0.07796770334243774, -0.13915036618709564, -0.00028078589821234345, -0.11682721972465515, 0.2985037565231323, -0.08242800086736679, 0.1931382566690445, 0.10566288232803345, -0.08563334494829178, -0.03659819811582565, 0.10980240255594254, -0.031446024775505066, -0.04802364483475685, -0.122727170586586, 0.16218064725399017, -0.07283929735422134, -0.21570368111133575, -0.09754964709281921, 0.11863738298416138, -0.23778411746025085, 0.05759229138493538, -0.06452083587646484, -0.024205567315220833, 0.13335803151130676, -0.0887376144528389, 0.060121264308691025, -0.048120468854904175, 0.0903787836432457, 0.16114920377731323, 0.015231968834996223, -0.05216483026742935, 0.047955989837646484, 0.1398126184940338, 0.0801449865102768, 0.032807450741529465, -0.044269222766160965, -0.014744075946509838, -0.0774361863732338, -0.2156650424003601, -0.051334649324417114, -0.04925008863210678, -0.015164252370595932, 0.08970631659030914, 0.16449205577373505, 0.07308642566204071, -0.0019738157279789448, 0.0414963997900486, 0.07114975899457932, 0.10185801237821579, 0.07041056454181671, -0.057029396295547485, -0.04467442259192467, 0.1156599298119545, -0.2697184085845947, 0.01002583373337984, 0.143252894282341, 0.04570019990205765, -0.0579727478325367, 0.26169565320014954, 0.0830652192234993, -0.20585834980010986, -0.03293996676802635, -0.04020204767584801, -0.10715140402317047, 0.03522941842675209, -0.014893492683768272, 0.16016095876693726, 0.17826879024505615, 0.06998226046562195, -0.07794555276632309, 0.042634058743715286, -0.10087348520755768, 0.019700976088643074, 0.18327592313289642, -0.07889456301927567, -0.22256861627101898, 0.07117476314306259, 0.10494830459356308, 0.009135475382208824, 0.13609075546264648, 0.07457419484853745, -0.047923605889081955, -0.047104332596063614, -0.0005733984289690852, -0.06589926034212112, -0.09634625911712646, -0.033190783113241196, -0.21787306666374207, -0.02069501020014286, 0.12412282824516296, 0.05716453120112419, -0.05439897999167442, 0.10778185725212097, 0.055790070444345474, -0.08611954003572464, -0.13487078249454498, -0.11116602271795273, 0.05616270750761032, -0.041944436728954315, 0.0006870718789286911, 0.00034604768734425306, -0.09651964157819748, 0.10248123854398727, 0.04617316275835037, 0.08401720225811005, -0.005418108310550451, 0.009769648313522339, -0.026286203414201736, -0.21471141278743744, -0.09047047048807144, 0.04781055822968483, -0.08184751868247986, 0.047648146748542786, 0.004836325999349356, 0.030596058815717697, 0.18038953840732574, 0.12975408136844635, -0.05149633064866066, -0.0031228014267981052, -0.0164012648165226, -0.013455822132527828, 0.17379872500896454, -0.03631553798913956, -0.0023462241515517235, 0.12352145463228226, 0.08441533893346786, 0.005367270205169916, -0.005692507140338421, -0.12608638405799866, -0.019212117418646812, -0.10117959976196289, 0.0515192411839962, 0.0405108705163002, 0.0527508482336998, -0.03365258499979973, -0.020681608468294144, -0.08737058192491531, -0.2308845967054367, 0.07386299967765808, -0.029029667377471924, 0.05213712900876999, -0.013861541636288166, -0.12916047871112823, -0.14906293153762817, -0.06216684356331825, -0.1028265580534935, -0.0402151495218277, 0.03527608886361122, -0.062352873384952545, -0.044155851006507874, 0.0953102558851242, -0.06167423352599144, -0.11238913983106613, 0.08325506001710892, 0.12097814679145813, -0.11781042069196701, -0.0171071607619524, -0.019811047241091728, 0.37385839223861694, 0.1204175129532814, -0.09206953644752502, -0.17006725072860718, -0.10089728236198425, 0.02741272747516632, -0.09376583248376846, 0.13718053698539734, 0.21454396843910217, -0.26317158341407776, -0.06018799543380737, 0.14559423923492432, -0.023575183004140854, 0.10886155068874359, -0.1160661056637764, -0.10025707632303238, -0.09324482083320618, 0.1922045350074768, -0.04876813665032387, 0.0009782558772712946, -0.18228870630264282, 0.04232756793498993, 0.02624613605439663, 0.07642834633588791, 0.2684051990509033, 0.004472094122320414, -0.2325599193572998, -0.14527322351932526, -0.026746388524770737, -0.12423085421323776, 0.015039174817502499, -0.23337294161319733, 0.012335402891039848, 0.12415919452905655, -0.04998861625790596, 0.12530772387981415, 0.024824244901537895, -0.17248700559139252, 0.13771016895771027, -0.1260078400373459, -0.09904022514820099, -0.109598807990551, 0.07275408506393433, 0.0930444747209549, -0.09486058354377747, 0.12744048237800598, 0.0911787897348404, 0.1912304311990738, -0.05833025276660919, -0.10517819970846176, -0.2025919109582901, 0.10123758018016815, -0.07334011048078537, -0.13258399069309235, 0.1067696139216423, -0.20974469184875488, -0.037238966673612595, -0.02176305279135704, 0.1351413130760193, 0.10442108660936356, 0.06946122646331787, 0.13781078159809113, 0.06046007201075554, 0.1799260377883911, 0.07624012231826782, 0.09189382940530777, -0.02766447700560093, -0.19034892320632935, -0.035072751343250275, -0.013371997512876987, 0.0359315499663353, -0.16897860169410706, 0.30131077766418457, 0.3574178218841553, -0.10868581384420395, -0.16804352402687073, 0.13417135179042816, -0.08604273200035095, -0.03461609408259392, -0.058053940534591675, 0.14859846234321594, -0.12397930771112442, -0.0367325097322464, -0.1554301530122757, -0.07837068289518356, 0.08304065465927124, 0.04284081980586052, -0.007957009598612785, -0.01451251469552517, -0.08684380352497101, 0.14100611209869385, 0.11747334897518158, -0.16222231090068817, 0.03490832448005676, 0.06565722078084946, 0.046498022973537445, -0.026538997888565063, -0.15536855161190033, -0.10448259860277176, -0.11651502549648285, 0.014318245463073254, -0.01786731742322445, 0.07593906670808792, 0.09822887927293777, 0.3279096484184265, -0.1009506806731224, 0.11464516818523407, -0.06517591327428818, 0.04164348170161247, -0.014349030330777168, 0.19897015392780304, 0.041952669620513916, -0.04476890340447426, -0.23423174023628235, -0.06577125936746597, -0.16944003105163574, 0.22820332646369934, 0.02410390041768551, 0.06284311413764954, -0.2976270318031311, 0.04399791732430458, 0.11250769346952438, -0.05555800721049309, -0.016069047152996063, -0.0405251681804657, 0.03368145972490311, -0.11711233854293823, 0.08843592554330826, 0.14354422688484192, -0.25015494227409363, 0.19653421640396118, -0.09829175472259521, -0.007305081933736801, 0.03566313162446022, 0.005127466283738613, -0.05839147791266441, 0.1545446217060089, 0.03499404340982437, 0.06587512046098709, 0.030015241354703903, 0.09360416233539581, -0.1563756912946701, 0.3256528973579407, 0.08195814490318298, -0.158235102891922, -0.01145186647772789, -0.051875028759241104, 0.016127992421388626, -0.03072138875722885, -0.07419335842132568, -0.09573081135749817, 0.07487697154283524, -0.022624416276812553, 0.026819664984941483, 0.014453374780714512, 0.0053561837412416935, 0.1321978121995926, -0.11103116720914841, 0.07974700629711151, -0.0039832801558077335, -0.06331127882003784, 0.07627331465482712, 0.05339662730693817, -0.1433589607477188, 0.03290882706642151, -0.08987288922071457, 0.02934747189283371, 0.007086197845637798, -0.20833328366279602, -0.31025275588035583, 0.061645377427339554, 0.18509900569915771, -0.23504312336444855, -0.04379444196820259, -0.003577200463041663, -0.22870853543281555, 0.04211711883544922, 0.011107326485216618, 0.07561508566141129, 0.007077134680002928, 0.1061379462480545, -0.015197601169347763, 0.07032196968793869, 0.05409058555960655, -0.13186751306056976, -0.03642626479268074, 0.18121635913848877, 0.03782976046204567, -0.09200306236743927, -0.02472849003970623, 0.16534070670604706, 0.15161696076393127, 0.006647300440818071, 0.025055306032299995, 0.18575100600719452, -0.001978202722966671, -0.1865551471710205, 0.09860682487487793, 0.03405873104929924, 0.04142524302005768, -0.02133936807513237, -0.1693013608455658, 0.16260360181331635, 0.08038626611232758, -0.049456994980573654, -0.10309947282075882, -0.09301717579364777, -0.04302426427602768, -0.06389367580413818, -0.051284629851579666, 0.06774108856916428, -0.19385045766830444, 0.10746096074581146, 0.18599197268486023, 0.19352413713932037, -0.08990062028169632, 0.007401411421597004, -2.5554524257850775e-32, 0.06105780974030495, -0.19474785029888153, -0.05886686220765114, -0.09605726599693298, -0.15467286109924316, 0.05737651512026787, -0.04346169903874397, -0.0866319015622139, 0.09495849162340164, -0.07663239538669586, -0.24414174258708954, 0.007991218939423561, 0.10895538330078125, 0.04258948564529419, 0.04003831744194031, 0.14718589186668396, 0.3047662079334259, -0.038171496242284775, -0.1544981598854065, 0.08212744444608688, 0.1661645472049713, 0.08803518116474152, -0.08929827064275742, -0.016464238986372948, -0.1027090772986412, 0.0821448564529419, -0.12734240293502808, -0.1817813664674759, 0.09794913232326508, -0.06722469627857208, -0.07188107073307037, 0.22708635032176971, -0.1069471687078476, -0.0744830071926117, -0.08128603547811508, 0.1384785771369934, -0.1503107100725174, 0.02725975029170513, 0.10811126977205276, 0.23649588227272034, 0.11574388295412064, -0.07315412908792496, 0.2280077487230301, 0.030570369213819504, -0.028140762820839882, 0.11888829618692398, 0.04071370139718056, 0.07902298122644424, -0.2339809387922287, -0.08971501141786575, -0.10992426425218582, 0.05436577647924423, 0.03581393137574196, 0.10763679444789886, 0.15203185379505157, -0.31659120321273804, 0.062251802533864975, 0.07731793075799942, -0.36800137162208557, -0.09353580325841904, 0.018017688766121864, 0.009111884981393814, 0.15066596865653992, 0.09518769383430481, 0.08285544812679291, 0.08954054117202759, 0.2563984990119934, 0.18470096588134766, 0.09418539702892303, -0.0009187426185235381, 0.11721710115671158, -0.038168612867593765, 0.0624457411468029, -0.2192075550556183, 0.10430463403463364, -0.061469461768865585, -0.22287556529045105, -0.002143038669601083, 0.09449578821659088, 0.02462037466466427, 0.11518315970897675, 0.02779487334191799, 0.22516891360282898, -0.006851145066320896, -0.08594056963920593, 0.20886839926242828, 0.08529502898454666, 0.11370613425970078, -0.10733102262020111, 0.017709504812955856, 0.1429763287305832, 0.04448850080370903, -0.0626949667930603, -0.02204817719757557, 0.016697926446795464, 0.06467977166175842, 0.019747870042920113, 0.10509908199310303, -0.0568884052336216, -0.23473988473415375, -0.015830162912607193, 0.04773581400513649, -0.10798098146915436, -0.05175133794546127, 0.19196145236492157, -0.03288323059678078, 0.1839410662651062, -0.23741771280765533, -0.22483259439468384, 0.01592101715505123, -0.01618628390133381, 0.008890720084309578, 0.1616164892911911, 0.0924232080578804, 0.1783023178577423, -0.14197921752929688, 0.09146857261657715, -0.07948296517133713, 0.09651292860507965, 0.219675675034523, 0.13276177644729614, 0.03290112689137459, 0.10046565532684326, -0.0029399017803370953, -0.05120693892240524, 0.19124777615070343, -0.07049445807933807, 0.07328315824270248, 0.04770096391439438, -0.17096680402755737, -0.040812477469444275, -0.06960379332304001, 6.846341307209514e-7, 0.019538434222340584, 0.159672811627388, -0.04366689547896385, -0.03353021293878555, -0.14704525470733643, -0.016444949433207512, -0.00415355758741498, -0.13105548918247223, -0.09371739625930786, 0.30909305810928345, -0.056764524430036545, 0.03661418333649635, -0.025699391961097717, 0.20218533277511597, -0.05562863126397133, -0.16346468031406403, -0.13854636251926422, 0.13643471896648407, -0.21315032243728638, 0.17271539568901062, -0.10596654564142227, 0.0797930583357811, 0.038169387727975845, -0.06426182389259338, 0.11255410313606262, -0.12048710137605667, -0.02390076220035553, 0.02497214823961258, 0.09636516124010086, 0.001187891117297113, 0.11149267107248306, -0.12980709969997406, 0.03516672924160957, -0.0005281958729028702, 0.027552863582968712, 0.09656336903572083, -0.038220226764678955, 0.06423674523830414, 0.05095215514302254, 0.008855064399540424, 0.04546798765659332, -0.09408163279294968, 0.026289498433470726, -0.03832452744245529, 0.05245149880647659, -0.04313049092888832, -0.055278144776821136, 0.13014434278011322, 0.04675976186990738, 0.026208866387605667, -0.02868437021970749, 0.14658430218696594, -0.016186857596039772, 0.20076659321784973, 0.0721035823225975, -0.11884555965662003, -0.09756216406822205, -0.11349643766880035, -0.11280618607997894, -0.08530186861753464, -0.19637537002563477, -0.28427958488464355, 0.03001999855041504, 0.11405479907989502, 0.12582053244113922, -0.038297586143016815, -0.060537517070770264, 1.0870216409448615e-34, 0.15243010222911835, -0.015535916201770306, 0.16371038556098938, -0.012854917906224728, -0.09676582366228104, -0.1504751592874527, -0.02020999602973461, 0.011044245213270187, -0.03498075157403946, -0.3400476574897766, -0.050767142325639725 ]
https://github.com/huggingface/datasets/issues/6236
Support buffer shuffle for to_tf_dataset
Hey! You can implement this yourself, just: 1) Create the dataset with `to_tf_dataset()` with `shuffle=False` 2) Add an `unbatch()` at the end (or use batch_size=1) 3) Add a `shuffle()` to the resulting dataset with your desired buffer size 4) Add a `batch()` at the end again to re-batch your dataset. Note that the way we construct datasets in `to_tf_dataset()`, we don't actually shuffle the entire dataset in-memory, using `tf.data.Dataset.shuffle()`! Instead, we shuffle an index array and then load from the dataset with that. This means that shuffling with `tf.data.Dataset.shuffle()` will probably be slower and use more memory than our approach - I don't think adding the option for smaller shuffle buffers will actually save you memory on this!
### Feature request I'm using to_tf_dataset to convert a large dataset to tf.data.Dataset and use Keras fit to train model. Currently, to_tf_dataset only supports full size shuffle, which can be very slow on large dataset. tf.data.Dataset support buffer shuffle by default. shuffle( buffer_size, seed=None, reshuffle_each_iteration=None, name=None ) ### Motivation I'm very frustrated to find the loading with shuffling large dataset is very slow. It seems impossible to shuffle before training Keras with big dataset. ### Your contribution NA
118
Support buffer shuffle for to_tf_dataset ### Feature request I'm using to_tf_dataset to convert a large dataset to tf.data.Dataset and use Keras fit to train model. Currently, to_tf_dataset only supports full size shuffle, which can be very slow on large dataset. tf.data.Dataset support buffer shuffle by default. shuffle( buffer_size, seed=None, reshuffle_each_iteration=None, name=None ) ### Motivation I'm very frustrated to find the loading with shuffling large dataset is very slow. It seems impossible to shuffle before training Keras with big dataset. ### Your contribution NA Hey! You can implement this yourself, just: 1) Create the dataset with `to_tf_dataset()` with `shuffle=False` 2) Add an `unbatch()` at the end (or use batch_size=1) 3) Add a `shuffle()` to the resulting dataset with your desired buffer size 4) Add a `batch()` at the end again to re-batch your dataset. Note that the way we construct datasets in `to_tf_dataset()`, we don't actually shuffle the entire dataset in-memory, using `tf.data.Dataset.shuffle()`! Instead, we shuffle an index array and then load from the dataset with that. This means that shuffling with `tf.data.Dataset.shuffle()` will probably be slower and use more memory than our approach - I don't think adding the option for smaller shuffle buffers will actually save you memory on this!
[ -0.07262934744358063, 0.09272623807191849, -0.055053796619176865, 0.0922013446688652, 0.11184917390346527, 0.00710239028558135, 0.11051411181688309, 0.06329810619354248, -0.0051032742485404015, -0.019802570343017578, -0.07993490993976593, -0.06839199364185333, -0.19759917259216309, 0.19857239723205566, 0.1013280376791954, -0.20194004476070404, -0.06664646416902542, -0.07830308377742767, 0.02137087658047676, 0.04217863082885742, -0.04895150288939476, 0.016536368057131767, 0.06805045157670975, -0.14964398741722107, 0.2307099550962448, -0.08254149556159973, -0.041636087000370026, 0.13789485394954681, -0.007207521703094244, 0.029987478628754616, -0.008312980644404888, 0.2680150270462036, -0.03754971921443939, 0.2302943766117096, 0.000006170011147332843, -0.009380514733493328, 0.16408635675907135, -0.008871225640177727, -0.06597685068845749, 0.08322130888700485, 0.06860236823558807, 0.10440240800380707, -0.124251589179039, -0.033318839967250824, -0.0991286113858223, 0.1035744771361351, 0.04400799423456192, -0.027417011559009552, -0.02072613686323166, -0.08496855199337006, 0.0036442673299461603, 0.06707386672496796, -0.06395037472248077, -0.029313895851373672, 0.31205812096595764, 0.1623401790857315, -0.055183615535497665, 0.001719115418381989, -0.11022970080375671, -0.04920879378914833, -0.06727111339569092, -0.14876483380794525, 0.0662529394030571, 0.044206179678440094, 0.2623423933982849, -0.1390208601951599, -0.270504355430603, -0.003516756696626544, -0.07446762919425964, 0.24083109200000763, -0.05142439901828766, -0.11854702979326248, -0.1141786277294159, -0.0004615068028215319, -0.12478308379650116, -0.08947348594665527, -0.008552605286240578, -0.025718823075294495, -0.076087087392807, -0.07562500983476639, -0.20493023097515106, -0.06693842262029648, 0.10119180381298065, -0.07105882465839386, -0.1949804127216339, -0.01661016419529915, 0.011535357683897018, 0.05815253406763077, -0.048103515058755875, -0.027807272970676422, 0.19771039485931396, -0.11496104300022125, -0.14338155090808868, 0.0412551611661911, -0.24846024811267853, -0.06588328629732132, -0.08986993879079819, -0.02580556832253933, 0.05871618539094925, -0.13901884853839874, 0.12540237605571747, 0.14340431988239288, -0.1061183512210846, 0.03132891282439232, 0.04971496760845184, -0.1603555828332901, -0.25807759165763855, -0.05999758094549179, -0.018942248076200485, 0.0038067749701440334, 0.01634603552520275, 0.06056855246424675, 0.01908855326473713, -0.11884119361639023, -0.05180080607533455, 0.11283085495233536, 0.015696285292506218, 0.3233013451099396, -0.035786669701337814, -0.1664859801530838, 0.1617058664560318, 0.0569828599691391, 0.005278702359646559, 0.07393188774585724, -0.04856419935822487, -0.047272536903619766, 0.09616900980472565, -0.10437978059053421, -0.08469126373529434, 0.032514963299036026, -0.05281078442931175, -0.07674740999937057, 0.07282144576311111, -0.009609773755073547, 0.050644323229789734, 0.040210410952568054, 0.015714459121227264, -0.2666095495223999, 0.06572774052619934, 0.004489101003855467, 0.11635064333677292, 0.006117737852036953, -0.06020738184452057, -0.020227380096912384, -0.08601854741573334, 0.021888941526412964, 0.09886065125465393, 0.11517271399497986, -0.1340879499912262, 0.2158939689397812, -0.1494215726852417, 0.06952864676713943, -0.003745245048776269, 0.0012706140987575054, -0.01979030855000019, 0.0019929595291614532, -0.10040010511875153, 0.01488435734063387, -0.11036325991153717, -0.09695915877819061, 0.026074357330799103, -0.08712965250015259, -0.22037114202976227, -0.11807162314653397, 0.05564591661095619, 0.1485016793012619, -0.05625064671039581, -0.03816932067275047, 0.012479198165237904, -0.12969006597995758, 0.13944891095161438, -0.04815864935517311, 0.042584192007780075, 0.011986881494522095, -0.027766605839133263, -0.09982559084892273, -0.01327653881162405, 0.06410081684589386, 0.006553486920893192, 0.017368236556649208, -0.052567578852176666, -0.06525322049856186, 0.050944339483976364, 0.00888954196125269, -0.0012790278997272253, 0.063840851187706, 0.18761539459228516, 0.21485543251037598, -0.21252590417861938, 0.12414462119340897, 0.03612752631306648, -0.04481669142842293, 0.07355985045433044, 0.16223175823688507, -0.03727305307984352, 0.09606728702783585, 0.09336943179368973, 0.0570550337433815, 0.17794454097747803, -0.12159472703933716, -0.08238282054662704, -0.019195660948753357, 0.00795809831470251, 0.137099489569664, 0.004825505893677473, -0.04402638226747513, -0.11818961054086685, 0.03370929881930351, 0.1352655589580536, 0.03736402466893196, 0.13939237594604492, 0.10255275666713715, 0.08389248698949814, -0.10732551664113998, -0.05994419381022453, -0.17289459705352783, -0.0962536558508873, 0.01301878597587347, 0.16468599438667297, 0.18105730414390564, -0.021665537729859352, -0.05698780715465546, -0.0183896254748106, -0.03981165587902069, 0.004024447873234749, -0.02811245061457157, 0.0539126917719841, -0.007883313111960888, 0.20288917422294617, 0.05846547707915306, -0.1285308599472046, -0.05409587547183037, 0.2858934998512268, 0.10535981506109238, 0.0854932963848114, -0.1234210804104805, -0.03743978217244148, -0.04301007464528084, -0.07292816042900085, 0.10326004773378372, -0.08112870156764984, -0.0805606096982956, -0.19331634044647217, 0.016213830560445786, 0.23330579698085785, 0.1955307275056839, -0.07356847077608109, -0.013992883265018463, -0.007835092023015022, -0.11205597221851349, 0.17305168509483337, 0.10226865857839584, -0.16595181822776794, 0.04213354364037514, 0.03284060209989548, -0.011595469899475574, 0.03895921632647514, -0.1899682730436325, -0.14179334044456482, -0.05783802643418312, 0.2521083354949951, 0.07988246530294418, -0.10431729257106781, -0.09529062360525131, 0.18431438505649567, 0.013693854212760925, 0.022289643064141273, -0.05969015508890152, 0.04563091695308685, 0.07902238517999649, 0.05931812897324562, 0.04439706355333328, 0.066046804189682, -0.029008621349930763, -0.03521315008401871, -0.20039165019989014, -0.04640902951359749, 0.15387332439422607, 0.04707872495055199, 0.026756174862384796, -0.16179929673671722, -0.010495733469724655, 0.1291622817516327, 0.029390661045908928, 0.1390334963798523, 0.01981975883245468, -0.23574113845825195, -0.13768114149570465, -0.042002785950899124, 0.02590257115662098, 0.06882297992706299, -0.05492425709962845, -0.016128618270158768, 0.15871880948543549, 0.024417497217655182, 0.17709097266197205, 0.05316270887851715, 0.20906609296798706, 0.10670491307973862, -0.05229257419705391, -0.2107483446598053, -0.10336163640022278, 0.18852582573890686, 0.06889698654413223, 0.142715185880661, -0.11184696108102798, 0.034529343247413635, -0.03568008914589882, -0.14883621037006378, -0.11982615292072296, -0.1297299712896347, 0.026557274162769318, 0.044596873223781586, 0.03482095152139664, 0.032758262008428574, 0.009183968417346478, -0.12450610846281052, -0.1889653354883194, 0.10182008892297745, -0.12902341783046722, -0.15308471024036407, 0.019685758277773857, 0.05249154940247536, 0.14527176320552826, -0.11061234772205353, 0.021288147196173668, -0.006353837437927723, -0.34263554215431213, -0.06499075889587402, -0.16123361885547638, 0.01491581741720438, 0.017980556935071945, 0.10768818855285645, -0.057417500764131546, -0.05130401626229286, -0.1572471559047699, -0.028431331738829613, -0.13387982547283173, 0.13533683121204376, -0.0721818134188652, 0.0009352185879833996, -0.04679018259048462, -0.10451885312795639, -0.054220739752054214, 0.15090350806713104, -0.10840896517038345, 0.18647076189517975, -0.10617151111364365, -0.09593690186738968, 0.029329078271985054, 0.022856472060084343, -0.001894874032586813, -0.12126719206571579, -0.03529608994722366, -0.050791770219802856, 0.1772633194923401, 0.009545869193971157, -0.007470468059182167, 0.012094808742403984, 0.09681160748004913, 0.05412350594997406, 0.1791456788778305, 0.18334482610225677, -0.168721541762352, -0.031002987176179886, 0.05606364458799362, 0.11725381761789322, -0.003579628886654973, -0.04291396215558052, -0.08794797956943512, 0.07797982543706894, -0.001067534787580371, -0.05553526058793068, -0.015298266895115376, 0.005738726817071438, -0.11677812039852142, -0.07347607612609863, -0.0034874719567596912, 0.22738933563232422, 0.034721288830041885, 0.017738215625286102, -0.09363297373056412, -0.04656882584095001, -0.05440851300954819, -0.021660402417182922, -0.0391082689166069, 0.07097834348678589, -0.037866562604904175, -0.1229080930352211, 0.1635991483926773, 0.027021804824471474, -0.11878722161054611, 0.09492635726928711, -0.19039364159107208, -0.14341026544570923, -0.013692200183868408, 0.19750286638736725, 0.06301192939281464, -0.03926432877779007, -0.04753877967596054, 0.1388944685459137, 0.1453978717327118, -0.032999392598867416, -0.09670260548591614, 0.048589371144771576, 0.0055861929431557655, -0.023642772808670998, -0.08541350811719894, 0.10259784013032913, -0.028632305562496185, -0.037009045481681824, 0.08929745107889175, -0.15767329931259155, 0.04232955724000931, 0.17841865122318268, -0.09429269284009933, -0.1229097917675972, -0.004412716720253229, 0.04673448204994202, -0.18078549206256866, -0.08732765167951584, -0.09675850719213486, 0.12488510459661484, 0.06995746493339539, 0.16633212566375732, -0.026815345510840416, -0.11297482252120972, 0.1669532209634781, 0.1657218039035797, -0.09627643972635269, -0.03162582963705063, 0.18612796068191528, -0.04427378624677658, 0.03387174382805824, -0.10867642611265182, -0.02393244206905365, 0.01898752711713314, 0.014936446212232113, -0.1336674988269806, 0.08183788508176804, 0.04004534333944321, 0.006639580242335796, 0.06500773131847382, 0.022438354790210724, 0.03818010911345482, -0.15353074669837952, -0.07961155474185944, -0.18706586956977844, -0.0049829985946416855, -0.08903523534536362, -0.1277756541967392, -0.16516369581222534, -0.2755614221096039, -0.18721060454845428, 0.016876498237252235, 0.07116436213254929, 0.18553224205970764, -0.16131678223609924, -0.10860857367515564, 0.10599195212125778, -0.06264843046665192, -0.024435479193925858, -0.10952410846948624, 0.07685096561908722, 0.10380983352661133, 0.2623559832572937, 0.09560660272836685, -0.08401911705732346, 0.12519246339797974, -0.07833177596330643, -0.05458070710301399, 0.003668856807053089, -0.07939942181110382, 0.02346334420144558, 0.001697748084552586, -0.1038566306233406, -0.06887596845626831, 0.021456804126501083, -0.07785733789205551, -0.0804293304681778, 0.10638702660799026, -0.1510431170463562, 0.07630794495344162, 0.006426297128200531, -0.04349494352936745, 0.18825414776802063, -0.13812467455863953, 0.07686220854520798, -0.026324328035116196, 0.07245693355798721, 0.09419029206037521, -0.09052326530218124, -0.18896782398223877, 0.06263311952352524, 0.02459489181637764, -0.11327550560235977, 0.16784635186195374, 0.0014640006702393293, -0.02901119738817215, -0.02264389581978321, 0.06264626979827881, -0.023470519110560417, 0.0685758888721466, 0.016293633729219437, -0.025195972993969917, -0.0837261751294136, 0.060176439583301544, 0.061405912041664124, 0.14720918238162994, -0.008868359960615635, -0.09865380078554153, -0.00823553279042244, -0.1014462262392044, -0.12030205130577087, -0.11008535325527191, 0.13874351978302002, -0.024232985451817513, -0.014993356540799141, 0.10151218622922897, 0.036951322108507156, -0.030447175726294518, 0.054817263036966324, -0.02945367991924286, 0.01702219434082508, 0.09115956723690033, -0.12190194427967072, 0.015214646235108376, -0.08616660535335541, 0.0055890996009111404, 0.08491681516170502, 0.19955989718437195, 0.07835359871387482, 0.09874486178159714, 0.027176549658179283, 0.018300041556358337, 0.03628888353705406, 0.10314004868268967, -0.0029797477182000875, 0.037768322974443436, -0.05900770053267479, -0.031160052865743637, -0.03740614280104637, 0.013062991201877594, -0.030724089592695236, 0.05325774848461151, -0.0593956857919693, -0.06636025756597519, 0.052695952355861664, 0.07961036264896393, -0.01029239222407341, 0.09326787292957306, 0.07181254774332047, 0.08248134702444077, -0.2523777186870575, -0.027124976739287376, -2.682336461507186e-32, -0.0301526989787817, 0.050912484526634216, -0.04423860087990761, -0.01861092820763588, -0.030274374410510063, -0.07811235636472702, 0.02026805467903614, -0.09680451452732086, 0.011799078434705734, -0.09886246174573898, -0.08266612887382507, 0.030680490657687187, 0.07902044802904129, 0.1214073970913887, -0.04321670159697533, -0.00934904906898737, 0.0011992886429652572, -0.11480692028999329, 0.2096085101366043, 0.17371302843093872, 0.18033428490161896, -0.03700272738933563, 0.05937390774488449, 0.2685207426548004, -0.12374889105558395, 0.03816261142492294, 0.1156483069062233, -0.025506814941763878, -0.0395343154668808, -0.11760807037353516, -0.05140581727027893, 0.048509906977415085, -0.020589634776115417, 0.0231001153588295, -0.047723159193992615, -0.0671769231557846, -0.15068112313747406, 0.08167876303195953, -0.04584382474422455, -0.007638751529157162, -0.009538559243083, 0.001911737839691341, -0.005210190080106258, 0.03907449170947075, 0.07647659629583359, 0.08202488720417023, -0.039423659443855286, 0.039432819932699203, -0.06031201034784317, -0.08515017479658127, -0.06165659800171852, 0.04885774105787277, -0.10333903878927231, -0.08562330156564713, -0.05113687738776207, -0.043028514832258224, 0.08347895741462708, -0.03924788907170296, -0.16303592920303345, 0.03362194821238518, 0.01778627559542656, 0.1046706885099411, -0.05405596271157265, 0.013795831240713596, 0.042051926255226135, 0.0298361387103796, 0.21527522802352905, 0.11855963617563248, 0.09371951967477798, 0.02532537840306759, 0.14026065170764923, -0.04972899705171585, -0.11825159937143326, 0.06701548397541046, 0.09992992132902145, 0.028647569939494133, -0.10528253763914108, -0.03656669333577156, -0.126784086227417, -0.03844381868839264, 0.17609073221683502, -0.05142141878604889, -0.06834252178668976, -0.013655716553330421, 0.06612975895404816, 0.017956532537937164, -0.024562358856201172, 0.03755157068371773, 0.04966224730014801, -0.07890135049819946, -0.03469102829694748, 0.048625748604536057, -0.04075442999601364, -0.042106643319129944, -0.010376577265560627, 0.11060190200805664, -0.04209469258785248, 0.03384464979171753, -0.0601220466196537, 0.01294665690511465, -0.027092279866337776, -0.16800779104232788, 0.1441720724105835, 0.1273641735315323, -0.025320246815681458, 0.035409584641456604, 0.13650722801685333, -0.017366770654916763, -0.21274594962596893, 0.01902097463607788, -0.08997631818056107, 0.1860845983028412, 0.23152154684066772, 0.1309995949268341, 0.01406615786254406, -0.009031815454363823, 0.04059240594506264, -0.013738268055021763, 0.02241704985499382, 0.03631969541311264, -0.15520116686820984, -0.17447654902935028, -0.0319347009062767, 0.08196347206830978, 0.12360447645187378, 0.17444825172424316, -0.10866931080818176, 0.08757949620485306, -0.06648679822683334, -0.13485755026340485, -0.046887848526239395, -0.07006838172674179, 7.902146421656653e-7, -0.04652673006057739, 0.08974449336528778, -0.00006948457303224131, -0.027963945642113686, 0.05946861207485199, -0.0709405392408371, 0.056433141231536865, 0.04351033270359039, 0.14284953474998474, 0.10177834331989288, 0.0933099165558815, 0.12879794836044312, -0.06181146204471588, -0.07202688604593277, -0.14773599803447723, -0.11503724008798599, -0.1629495620727539, 0.16600348055362701, -0.03208630904555321, -0.03506667539477348, -0.03037184476852417, 0.2590879499912262, 0.08226841688156128, -0.12437669187784195, 0.1596618890762329, 0.013844413682818413, -0.07768764346837997, -0.032692115753889084, 0.06635407358407974, 0.05540797486901283, 0.05086686089634895, -0.15530525147914886, 0.004653571639209986, 0.11465848982334137, -0.15352797508239746, -0.05521317571401596, -0.12421296536922455, -0.11865302920341492, -0.0665578842163086, -0.09566762298345566, -0.050447575747966766, 0.1131916269659996, 0.032260969281196594, -0.1380765736103058, 0.10509618371725082, 0.21304777264595032, -0.11476519703865051, 0.005697146058082581, -0.0760251060128212, 0.1270029991865158, 0.13751475512981415, 0.04399922490119934, 0.04990925267338753, 0.18830479681491852, 0.07016561925411224, 0.024368707090616226, 0.008482959121465683, -0.04335923492908478, -0.04178835079073906, -0.06657148152589798, -0.0992395356297493, -0.06365839391946793, -0.1574353128671646, -0.11447488516569138, 0.15238310396671295, 0.09417340159416199, 0.060414429754018784, 2.401428888731871e-34, 0.12076438963413239, 0.1392546147108078, 0.14121095836162567, -0.09247232973575592, 0.0574333630502224, 0.014420708641409874, 0.055291548371315, -0.06482122093439102, -0.1095583438873291, -0.12428725510835648, -0.1534094363451004 ]
https://github.com/huggingface/datasets/issues/6236
Support buffer shuffle for to_tf_dataset
Thanks for your reply! @Rocketknight1 "We don't actually shuffle the entire dataset in-memory, using tf.data.Dataset.shuffle()! Instead, we shuffle an index array and then load from the dataset with that." In such case, there will be random access to dataset data during shuffling. When the dataset is large, the performance can be X10 times slow. I have tried many ways with to_tf_dataset() trying to achieve comparable performance with tf.data.Dataset().shuffle(buffer_size).batch(). But the performance with to_tf_dataset() is still slow.
### Feature request I'm using to_tf_dataset to convert a large dataset to tf.data.Dataset and use Keras fit to train model. Currently, to_tf_dataset only supports full size shuffle, which can be very slow on large dataset. tf.data.Dataset support buffer shuffle by default. shuffle( buffer_size, seed=None, reshuffle_each_iteration=None, name=None ) ### Motivation I'm very frustrated to find the loading with shuffling large dataset is very slow. It seems impossible to shuffle before training Keras with big dataset. ### Your contribution NA
76
Support buffer shuffle for to_tf_dataset ### Feature request I'm using to_tf_dataset to convert a large dataset to tf.data.Dataset and use Keras fit to train model. Currently, to_tf_dataset only supports full size shuffle, which can be very slow on large dataset. tf.data.Dataset support buffer shuffle by default. shuffle( buffer_size, seed=None, reshuffle_each_iteration=None, name=None ) ### Motivation I'm very frustrated to find the loading with shuffling large dataset is very slow. It seems impossible to shuffle before training Keras with big dataset. ### Your contribution NA Thanks for your reply! @Rocketknight1 "We don't actually shuffle the entire dataset in-memory, using tf.data.Dataset.shuffle()! Instead, we shuffle an index array and then load from the dataset with that." In such case, there will be random access to dataset data during shuffling. When the dataset is large, the performance can be X10 times slow. I have tried many ways with to_tf_dataset() trying to achieve comparable performance with tf.data.Dataset().shuffle(buffer_size).batch(). But the performance with to_tf_dataset() is still slow.
[ -0.051918983459472656, 0.09060720354318619, -0.05536622181534767, 0.08500197529792786, 0.10579388588666916, 0.012350969016551971, 0.10814082622528076, 0.0771053358912468, -0.0053803338669240475, -0.027790365740656853, -0.08544714003801346, -0.056335024535655975, -0.18967066705226898, 0.17962327599525452, 0.08371718972921371, -0.2295088917016983, -0.08453749120235443, -0.06775245070457458, 0.03197334334254265, 0.031335245817899704, -0.06637804210186005, 0.010204045102000237, 0.0724387913942337, -0.15204335749149323, 0.2285919189453125, -0.08024053275585175, -0.03665643185377121, 0.09662557393312454, 0.012522115372121334, 0.01568722352385521, -0.019690105691552162, 0.22888220846652985, -0.07139665633440018, 0.22902008891105652, 0.000006215601388248615, 0.002442100318148732, 0.15778543055057526, 0.00683465413749218, -0.04402073100209236, 0.12177304923534393, 0.10898257791996002, 0.09095500409603119, -0.13929235935211182, -0.04438488557934761, -0.10218407213687897, 0.10926429182291031, 0.04388471320271492, -0.023712020367383957, 0.005346281919628382, -0.07107564061880112, -0.00015681424702052027, 0.07854759693145752, -0.051846910268068314, -0.02775256335735321, 0.31344738602638245, 0.13712050020694733, -0.07499265670776367, 0.018771739676594734, -0.09861420840024948, -0.05473078787326813, -0.05101507157087326, -0.1564624160528183, 0.07896774262189865, 0.06299986690282822, 0.23025675117969513, -0.15743137896060944, -0.2684269845485687, -0.014685207977890968, -0.06317449361085892, 0.2484930157661438, -0.055349987000226974, -0.10848286002874374, -0.11343248933553696, 0.00366659602150321, -0.1304105967283249, -0.0779561698436737, 0.021669434383511543, -0.012077342718839645, -0.10516999661922455, -0.09840407967567444, -0.1889117807149887, -0.06114593893289566, 0.11848798394203186, -0.05741644650697708, -0.21826569736003876, -0.028582092374563217, 0.013504654169082642, 0.06170827895402908, -0.08273041993379593, -0.02738274447619915, 0.18113534152507782, -0.09944764524698257, -0.15280885994434357, 0.03270380571484566, -0.25389209389686584, -0.07069501280784607, -0.08625252544879913, -0.03863710165023804, 0.05237576365470886, -0.15178434550762177, 0.1298072338104248, 0.15559302270412445, -0.07032008469104767, 0.008833814412355423, 0.023260781541466713, -0.13815155625343323, -0.269733726978302, -0.07525376975536346, -0.01297729555517435, -0.028750639408826828, 0.0007276532123796642, 0.08051201701164246, 0.014110587537288666, -0.10030529648065567, -0.052343033254146576, 0.11074737459421158, 0.0015264630783349276, 0.3238985538482666, -0.049076661467552185, -0.17724747955799103, 0.1601862907409668, 0.055208224803209305, 0.003387368516996503, 0.05344143509864807, -0.04237421229481697, -0.042145736515522, 0.10356307774782181, -0.08808603882789612, -0.09011644124984741, 0.04871086776256561, -0.020171891897916794, -0.0754348486661911, 0.10786479711532593, -0.019404297694563866, 0.022292425855994225, 0.032217830419540405, 0.018648147583007812, -0.2662944495677948, 0.05242985859513283, 0.024503188207745552, 0.11604883521795273, 0.008147119544446468, -0.05225814878940582, -0.008018986321985722, -0.10489554703235626, 0.042013078927993774, 0.10355336964130402, 0.12364312261343002, -0.11635580658912659, 0.19994337856769562, -0.15548206865787506, 0.06562437117099762, 0.03741693124175072, -0.0005942197749391198, -0.001046490971930325, 0.005002148449420929, -0.0892956480383873, -0.03902691975235939, -0.0959983691573143, -0.09948398172855377, -0.0102157574146986, -0.061629798263311386, -0.24056120216846466, -0.09974806755781174, 0.037627480924129486, 0.1438235640525818, -0.0437471829354763, -0.04120609536767006, 0.015328127890825272, -0.0748930424451828, 0.15751294791698456, -0.02199709229171276, 0.05705326795578003, 0.01836259849369526, 0.009974725544452667, -0.11078165471553802, -0.02520821988582611, 0.05408347025513649, -0.004249842371791601, 0.023921655490994453, -0.058547258377075195, -0.08346260339021683, 0.05554738640785217, 0.009281512349843979, 0.027202051132917404, 0.06758034229278564, 0.22634680569171906, 0.19240275025367737, -0.20133058726787567, 0.1412644386291504, 0.03613388165831566, -0.03756247088313103, 0.07318523526191711, 0.1611701399087906, -0.05337874963879585, 0.0805344209074974, 0.07933054864406586, 0.05695715919137001, 0.1720781773328781, -0.1395922303199768, -0.1023913323879242, -0.02365601435303688, -0.02785017341375351, 0.13666412234306335, 0.006941838189959526, -0.017123499885201454, -0.10044104605913162, 0.049812015146017075, 0.12241455167531967, 0.0434856116771698, 0.16016598045825958, 0.10230037569999695, 0.11430470645427704, -0.10226288437843323, -0.05666181445121765, -0.15613798797130585, -0.09613984823226929, 0.038191501051187515, 0.209951251745224, 0.17450961470603943, -0.011318243108689785, -0.04798721894621849, -0.04339544102549553, -0.04337433725595474, -0.012160846032202244, -0.03795105963945389, 0.05081725865602493, 0.00007772604294586927, 0.18614636361598969, 0.048898663371801376, -0.11778940260410309, -0.05846307426691055, 0.2706048786640167, 0.0853072851896286, 0.06963533163070679, -0.1205974817276001, -0.023304378613829613, -0.03170541673898697, -0.05333094671368599, 0.08091293275356293, -0.10062123835086823, -0.04128454998135567, -0.19628804922103882, 0.015680739656090736, 0.22953416407108307, 0.19166824221611023, -0.09383515268564224, -0.015173749066889286, 0.009272041730582714, -0.08496393263339996, 0.16621090471744537, 0.09847885370254517, -0.16259635984897614, 0.022282524034380913, 0.04921427741646767, 0.0011746505042538047, 0.050653908401727676, -0.20496612787246704, -0.12576794624328613, -0.031909555196762085, 0.27114811539649963, 0.10178310424089432, -0.07898511737585068, -0.10395587980747223, 0.1624855399131775, 0.025493651628494263, 0.021935036405920982, -0.06773018836975098, 0.0251675546169281, 0.08943872153759003, 0.04743848741054535, 0.04530481994152069, 0.07848791778087616, -0.012464761734008789, -0.05148928984999657, -0.19272108376026154, -0.041735708713531494, 0.12638984620571136, 0.07106546312570572, 0.012410172261297703, -0.1379222869873047, -0.001876114634796977, 0.13094663619995117, 0.047364283353090286, 0.13572128117084503, 0.001816784031689167, -0.21648593246936798, -0.1218356117606163, -0.038061145693063736, 0.042736589908599854, 0.0957244336605072, -0.04490640386939049, -0.012031447142362595, 0.14883923530578613, 0.02385561354458332, 0.17103150486946106, 0.06760112941265106, 0.18909958004951477, 0.12760524451732635, -0.0802120491862297, -0.21336890757083893, -0.09775680303573608, 0.18610404431819916, 0.06393694877624512, 0.15332524478435516, -0.11799182742834091, 0.04259207099676132, -0.07427487522363663, -0.1789644956588745, -0.13206323981285095, -0.13060924410820007, 0.028895458206534386, 0.023190774023532867, 0.050280533730983734, 0.030207473784685135, 0.0181754007935524, -0.11133988201618195, -0.17895711958408356, 0.10396645963191986, -0.1474098414182663, -0.16021959483623505, 0.03983493149280548, 0.048645466566085815, 0.14775396883487701, -0.11941730231046677, 0.02534295991063118, 0.010355579666793346, -0.3372977077960968, -0.06588230282068253, -0.14036427438259125, 0.012937751598656178, 0.0213836207985878, 0.08566880971193314, -0.06707411259412766, -0.022390564903616905, -0.1317737102508545, -0.02002941630780697, -0.1232341006398201, 0.15923815965652466, -0.061118144541978836, 0.0048458995297551155, -0.08207773417234421, -0.10707679390907288, -0.06565787643194199, 0.14532849192619324, -0.1228206530213356, 0.17880353331565857, -0.13270027935504913, -0.09843971580266953, 0.024562682956457138, -0.003209376009181142, 0.02238531783223152, -0.12552906572818756, -0.036563873291015625, -0.04725378006696701, 0.19104085862636566, -0.01242056954652071, -0.018232842907309532, 0.0030005730222910643, 0.10154253244400024, 0.03136079013347626, 0.1772119104862213, 0.17814064025878906, -0.17026957869529724, -0.05549437180161476, 0.043222978711128235, 0.09612232446670532, -0.012488939799368382, -0.05440356954932213, -0.08993174135684967, 0.06427199393510818, -0.02208949252963066, -0.04862651973962784, -0.0010094291064888239, 0.00708683580160141, -0.08957928419113159, -0.06910908967256546, 0.0026745812501758337, 0.21708746254444122, 0.035690948367118835, 0.007814131677150726, -0.08545824140310287, -0.05269418656826019, -0.05098244547843933, -0.03555561229586601, -0.05894970893859863, 0.07535583525896072, -0.04843451827764511, -0.15566466748714447, 0.14967277646064758, 0.015348381362855434, -0.11549815535545349, 0.08627054840326309, -0.17446570098400116, -0.13989578187465668, -0.006127886474132538, 0.19447459280490875, 0.0405271016061306, -0.02981826849281788, -0.05383634194731712, 0.12731124460697174, 0.1283370703458786, -0.015709765255451202, -0.0897166058421135, 0.032352786511182785, -0.009556734934449196, -0.017510078847408295, -0.06887689977884293, 0.09504463523626328, -0.038483936339616776, -0.02474188059568405, 0.09761356562376022, -0.14125275611877441, 0.04238848388195038, 0.17892806231975555, -0.08774403482675552, -0.12248549610376358, 0.03418594226241112, 0.04856640473008156, -0.16367636620998383, -0.09336616098880768, -0.08813031762838364, 0.12776976823806763, 0.052581965923309326, 0.20208662748336792, -0.03245840594172478, -0.11373332142829895, 0.1647198498249054, 0.14195330440998077, -0.0973077118396759, -0.04482214152812958, 0.17562660574913025, -0.04926150664687157, 0.01440202072262764, -0.08737029880285263, -0.02251558005809784, 0.010141376405954361, 0.02889419160783291, -0.13188643753528595, 0.07149425148963928, 0.04309912770986557, -0.02827885001897812, 0.047877486795186996, 0.03959639370441437, 0.04345112666487694, -0.15932796895503998, -0.06823182106018066, -0.18313288688659668, 0.001100667635910213, -0.08472922444343567, -0.1440272331237793, -0.16071848571300507, -0.23476414382457733, -0.19625109434127808, 0.04348604381084442, 0.09357155114412308, 0.16608570516109467, -0.12105020880699158, -0.11687634885311127, 0.13430781662464142, -0.07232499867677689, -0.024225549772381783, -0.10864943265914917, 0.08479664474725723, 0.1056239902973175, 0.2536630630493164, 0.08758874237537384, -0.06633705645799637, 0.1332191526889801, -0.09322641789913177, -0.059503477066755295, 0.003965985495597124, -0.04339868202805519, 0.017425930127501488, -0.011408437974750996, -0.1203392744064331, -0.0626072809100151, 0.029798800125718117, -0.051886189728975296, -0.07439348101615906, 0.11226197332143784, -0.16927103698253632, 0.07597219944000244, -0.025751501321792603, -0.0325036384165287, 0.20733186602592468, -0.14786797761917114, 0.06550722569227219, -0.016195859760046005, 0.0682324692606926, 0.11110352724790573, -0.05498600751161575, -0.1879158616065979, 0.05390891432762146, 0.02605312503874302, -0.11622127890586853, 0.12563137710094452, -0.010619200766086578, -0.058049943298101425, -0.029977381229400635, 0.08779722452163696, -0.025288887321949005, 0.06801161170005798, -0.008564416319131851, -0.03304535150527954, -0.07445862144231796, 0.048330556601285934, 0.06457531452178955, 0.15682260692119598, -0.0029861913062632084, -0.11088110506534576, -0.028347505256533623, -0.10775070637464523, -0.1269487589597702, -0.10357759892940521, 0.12201451510190964, 0.002525181043893099, -0.0094976294785738, 0.07806027680635452, 0.005042100790888071, -0.03516911342740059, 0.04660585895180702, -0.02533530816435814, 0.03362376242876053, 0.06835155934095383, -0.11201685667037964, 0.0009580747573636472, -0.06217486783862114, 0.018785158172249794, 0.08736171573400497, 0.19982261955738068, 0.09604721516370773, 0.09918500483036041, 0.06153012067079544, -0.007163757923990488, 0.03297189623117447, 0.10835405439138412, -0.009761550463736057, 0.030801713466644287, -0.05335386097431183, -0.029160363599658012, -0.036698803305625916, 0.0063443719409406185, -0.05258108675479889, 0.04247799143195152, -0.11576677858829498, -0.07647844403982162, 0.040863052010536194, 0.08879866451025009, -0.0008209331426769495, 0.0780557319521904, 0.07018835097551346, 0.08106472343206406, -0.26007935404777527, -0.02487795427441597, -2.660681504576338e-32, -0.027076201513409615, 0.046848196536302567, -0.03531786799430847, 0.0067282784730196, -0.03464828431606293, -0.08100046962499619, 0.022498955950140953, -0.10051145404577255, 0.016325656324625015, -0.08067307621240616, -0.09053215384483337, 0.05433723330497742, 0.06953192502260208, 0.12187226861715317, -0.055566608905792236, -0.010973422788083553, -0.01202294509857893, -0.12404851615428925, 0.19432790577411652, 0.15560559928417206, 0.18508273363113403, -0.04078235104680061, 0.05213597044348717, 0.2885257303714752, -0.14275133609771729, 0.06658782809972763, 0.10164070129394531, -0.05241256207227707, -0.05226626247167587, -0.13317252695560455, -0.03606404736638069, 0.05841205641627312, -0.028783604502677917, 0.0015202658250927925, -0.039498504251241684, -0.05966353788971901, -0.1411093771457672, 0.12708976864814758, -0.057266153395175934, 0.01226841565221548, 0.001974959159269929, -0.016684703528881073, 0.011823423206806183, 0.06124957278370857, 0.09737641364336014, 0.09472351521253586, -0.06393103301525116, 0.021505651995539665, -0.0741720199584961, -0.09892968833446503, -0.08914439380168915, 0.059224147349596024, -0.08677854388952255, -0.08694875240325928, -0.028443939983844757, -0.022992806509137154, 0.06797996908426285, -0.03576827421784401, -0.15341679751873016, 0.010891670361161232, 0.017471417784690857, 0.12003225833177567, -0.07724528759717941, 0.014423675835132599, 0.02736002579331398, 0.04089536517858505, 0.21888421475887299, 0.11773764342069626, 0.11839514970779419, 0.026074089109897614, 0.14840248227119446, -0.05252024903893471, -0.10904649645090103, 0.05693206563591957, 0.08114644140005112, 0.03943687304854393, -0.12037459015846252, -0.02580476738512516, -0.13294538855552673, -0.056588590145111084, 0.16664518415927887, -0.06776918470859528, -0.06250157207250595, -0.014723971486091614, 0.04600948095321655, 0.033397119492292404, -0.040361277759075165, 0.06770388782024384, 0.04387185350060463, -0.06681030243635178, -0.014270052313804626, 0.03385993093252182, -0.05776360630989075, -0.043402932584285736, -0.0003660644870251417, 0.1155368909239769, -0.050678420811891556, 0.057881925255060196, -0.06050717458128929, 0.03541700169444084, -0.020308971405029297, -0.16311465203762054, 0.10993826389312744, 0.13607175648212433, 0.016850875690579414, 0.02327485755085945, 0.12412811070680618, -0.02636137045919895, -0.24554471671581268, 0.017810292541980743, -0.09716351330280304, 0.16722668707370758, 0.2098819613456726, 0.10540270060300827, 0.016846274957060814, -0.027928465977311134, 0.057091664522886276, -0.02209010347723961, 0.011731671169400215, 0.05567159876227379, -0.13310027122497559, -0.19357514381408691, -0.009439405985176563, 0.06491202861070633, 0.12577427923679352, 0.18157660961151123, -0.10056638717651367, 0.0914655402302742, -0.0815213993191719, -0.13480795919895172, -0.05207078158855438, -0.0724201649427414, 7.949515179461741e-7, -0.05749202147126198, 0.10875950753688812, -0.011709367856383324, -0.017736779525876045, 0.07194381952285767, -0.055763836950063705, 0.08034564554691315, 0.04122960940003395, 0.1488225758075714, 0.11775881797075272, 0.07685622572898865, 0.10922954231500626, -0.05872655287384987, -0.07617268711328506, -0.15133538842201233, -0.09917207807302475, -0.13545334339141846, 0.16139206290245056, -0.017792334780097008, -0.009816929697990417, -0.03484538197517395, 0.2426515817642212, 0.060250766575336456, -0.13238513469696045, 0.1685996651649475, -0.0014246345963329077, -0.056175753474235535, -0.023615987971425056, 0.04834752157330513, 0.03810456395149231, 0.030388738960027695, -0.1554366797208786, 0.016823289915919304, 0.13072934746742249, -0.1637331247329712, -0.06553284078836441, -0.13551065325737, -0.12648482620716095, -0.06815383583307266, -0.11929240077733994, -0.05549313873052597, 0.09467766433954239, 0.012220022268593311, -0.13179923593997955, 0.10839582234621048, 0.2097819447517395, -0.1415756344795227, 0.022413913160562515, -0.05206911638379097, 0.14367814362049103, 0.13455350697040558, 0.060845743864774704, 0.06911998987197876, 0.17622320353984833, 0.07036187499761581, -0.0018894764361903071, 0.01661078818142414, -0.05259295180439949, -0.051427122205495834, -0.06013304740190506, -0.08971909433603287, -0.07623206824064255, -0.1549210548400879, -0.09776777029037476, 0.1690368801355362, 0.09572023153305054, 0.03327622264623642, 2.6454137615045756e-34, 0.11879254877567291, 0.1375219225883484, 0.12327709794044495, -0.08368276804685593, 0.06332795321941376, 0.010960998013615608, 0.05335993692278862, -0.06698130071163177, -0.09128940850496292, -0.1281968355178833, -0.13231435418128967 ]
https://github.com/huggingface/datasets/issues/6229
Apply inference on all images in the dataset
From what I see, `MMSegInferencer` supports NumPy arrays, so replace the line `image_path = example['image']` with `image_path = np.array(example['image'])` to fix the issue (`example["image"]` is a `PIL.Image` object).
### Describe the bug ``` --------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) Cell In[14], line 11 9 for idx, example in enumerate(dataset['train']): 10 image_path = example['image'] ---> 11 mask_image = process_image(image_path) 12 mask_image.save(f"mask_{idx}.png") Cell In[14], line 4, in process_image(image_path) 2 def process_image(image_path): 3 print("Processing image:", image_path) ----> 4 result = inferencer(image_path)['predictions'] 5 mask = np.where(result == 12, 255, 0).astype('uint8') 6 return Image.fromarray(mask) File /usr/local/lib/python3.10/dist-packages/mmseg/apis/mmseg_inferencer.py:183, in MMSegInferencer.__call__(self, inputs, return_datasamples, batch_size, show, wait_time, out_dir, img_out_dir, pred_out_dir, **kwargs) 180 pred_out_dir = '' 181 img_out_dir = '' --> 183 return super().__call__( 184 inputs=inputs, 185 return_datasamples=return_datasamples, 186 batch_size=batch_size, 187 show=show, 188 wait_time=wait_time, 189 img_out_dir=img_out_dir, 190 pred_out_dir=pred_out_dir, 191 **kwargs) File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:221, in BaseInferencer.__call__(self, inputs, return_datasamples, batch_size, **kwargs) 218 inputs = self.preprocess( 219 ori_inputs, batch_size=batch_size, **preprocess_kwargs) 220 preds = [] --> 221 for data in (track(inputs, description='Inference') 222 if self.show_progress else inputs): 223 preds.extend(self.forward(data, **forward_kwargs)) 224 visualization = self.visualize( 225 ori_inputs, preds, 226 **visualize_kwargs) # type: ignore # noqa: E501 File /usr/local/lib/python3.10/dist-packages/rich/progress.py:168, in track(sequence, description, total, auto_refresh, console, transient, get_time, refresh_per_second, style, complete_style, finished_style, pulse_style, update_period, disable, show_speed) 157 progress = Progress( 158 *columns, 159 auto_refresh=auto_refresh, (...) 164 disable=disable, 165 ) 167 with progress: --> 168 yield from progress.track( 169 sequence, total=total, description=description, update_period=update_period 170 ) File /usr/local/lib/python3.10/dist-packages/rich/progress.py:1210, in Progress.track(self, sequence, total, task_id, description, update_period) 1208 if self.live.auto_refresh: 1209 with _TrackThread(self, task_id, update_period) as track_thread: -> 1210 for value in sequence: 1211 yield value 1212 track_thread.completed += 1 File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:291, in BaseInferencer.preprocess(self, inputs, batch_size, **kwargs) 266 """Process the inputs into a model-feedable format. 267 268 Customize your preprocess by overriding this method. Preprocess should (...) 287 Any: Data processed by the ``pipeline`` and ``collate_fn``. 288 """ 289 chunked_data = self._get_chunk_data( 290 map(self.pipeline, inputs), batch_size) --> 291 yield from map(self.collate_fn, chunked_data) File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:588, in BaseInferencer._get_chunk_data(self, inputs, chunk_size) 586 chunk_data = [] 587 for _ in range(chunk_size): --> 588 processed_data = next(inputs_iter) 589 chunk_data.append(processed_data) 590 yield chunk_data File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results) 9 def __call__(self, 10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]: ---> 12 return self.transform(results) File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/wrappers.py:88, in Compose.transform(self, results) 79 """Call function to apply transforms sequentially. 80 81 Args: (...) 85 dict or None: Transformed results. 86 """ 87 for t in self.transforms: ---> 88 results = t(results) # type: ignore 89 if results is None: 90 return None File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results) 9 def __call__(self, 10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]: ---> 12 return self.transform(results) File /usr/local/lib/python3.10/dist-packages/mmseg/datasets/transforms/loading.py:496, in InferencerLoader.transform(self, single_input) 494 inputs = single_input 495 else: --> 496 raise NotImplementedError 498 if 'img' in inputs: 499 return self.from_ndarray(inputs) NotImplementedError: ```` ### Steps to reproduce the bug ``` from datasets import load_dataset dataset = load_dataset('Andyrasika/cat_kingdom') dataset from mmseg.apis import MMSegInferencer checkpoint_name = 'segformer_mit-b5_8xb2-160k_ade20k-640x640' inferencer = MMSegInferencer(model=checkpoint_name) # Define a function to apply the code to each image in the dataset def process_image(image_path): print("Processing image:", image_path) result = inferencer(image_path)['predictions'] mask = np.where(result == 12, 255, 0).astype('uint8') return Image.fromarray(mask) # Process and save masks for each image in the dataset for idx, example in enumerate(dataset['train']): image_path = example['image'] mask_image = process_image(image_path) mask_image.save(f"mask_{idx}.png") ``` ### Expected behavior create a separate column with masks in the dataset and further shows as a separate column in hub ### Environment info jupyter notebook RTX 3090
28
Apply inference on all images in the dataset ### Describe the bug ``` --------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) Cell In[14], line 11 9 for idx, example in enumerate(dataset['train']): 10 image_path = example['image'] ---> 11 mask_image = process_image(image_path) 12 mask_image.save(f"mask_{idx}.png") Cell In[14], line 4, in process_image(image_path) 2 def process_image(image_path): 3 print("Processing image:", image_path) ----> 4 result = inferencer(image_path)['predictions'] 5 mask = np.where(result == 12, 255, 0).astype('uint8') 6 return Image.fromarray(mask) File /usr/local/lib/python3.10/dist-packages/mmseg/apis/mmseg_inferencer.py:183, in MMSegInferencer.__call__(self, inputs, return_datasamples, batch_size, show, wait_time, out_dir, img_out_dir, pred_out_dir, **kwargs) 180 pred_out_dir = '' 181 img_out_dir = '' --> 183 return super().__call__( 184 inputs=inputs, 185 return_datasamples=return_datasamples, 186 batch_size=batch_size, 187 show=show, 188 wait_time=wait_time, 189 img_out_dir=img_out_dir, 190 pred_out_dir=pred_out_dir, 191 **kwargs) File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:221, in BaseInferencer.__call__(self, inputs, return_datasamples, batch_size, **kwargs) 218 inputs = self.preprocess( 219 ori_inputs, batch_size=batch_size, **preprocess_kwargs) 220 preds = [] --> 221 for data in (track(inputs, description='Inference') 222 if self.show_progress else inputs): 223 preds.extend(self.forward(data, **forward_kwargs)) 224 visualization = self.visualize( 225 ori_inputs, preds, 226 **visualize_kwargs) # type: ignore # noqa: E501 File /usr/local/lib/python3.10/dist-packages/rich/progress.py:168, in track(sequence, description, total, auto_refresh, console, transient, get_time, refresh_per_second, style, complete_style, finished_style, pulse_style, update_period, disable, show_speed) 157 progress = Progress( 158 *columns, 159 auto_refresh=auto_refresh, (...) 164 disable=disable, 165 ) 167 with progress: --> 168 yield from progress.track( 169 sequence, total=total, description=description, update_period=update_period 170 ) File /usr/local/lib/python3.10/dist-packages/rich/progress.py:1210, in Progress.track(self, sequence, total, task_id, description, update_period) 1208 if self.live.auto_refresh: 1209 with _TrackThread(self, task_id, update_period) as track_thread: -> 1210 for value in sequence: 1211 yield value 1212 track_thread.completed += 1 File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:291, in BaseInferencer.preprocess(self, inputs, batch_size, **kwargs) 266 """Process the inputs into a model-feedable format. 267 268 Customize your preprocess by overriding this method. Preprocess should (...) 287 Any: Data processed by the ``pipeline`` and ``collate_fn``. 288 """ 289 chunked_data = self._get_chunk_data( 290 map(self.pipeline, inputs), batch_size) --> 291 yield from map(self.collate_fn, chunked_data) File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:588, in BaseInferencer._get_chunk_data(self, inputs, chunk_size) 586 chunk_data = [] 587 for _ in range(chunk_size): --> 588 processed_data = next(inputs_iter) 589 chunk_data.append(processed_data) 590 yield chunk_data File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results) 9 def __call__(self, 10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]: ---> 12 return self.transform(results) File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/wrappers.py:88, in Compose.transform(self, results) 79 """Call function to apply transforms sequentially. 80 81 Args: (...) 85 dict or None: Transformed results. 86 """ 87 for t in self.transforms: ---> 88 results = t(results) # type: ignore 89 if results is None: 90 return None File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results) 9 def __call__(self, 10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]: ---> 12 return self.transform(results) File /usr/local/lib/python3.10/dist-packages/mmseg/datasets/transforms/loading.py:496, in InferencerLoader.transform(self, single_input) 494 inputs = single_input 495 else: --> 496 raise NotImplementedError 498 if 'img' in inputs: 499 return self.from_ndarray(inputs) NotImplementedError: ```` ### Steps to reproduce the bug ``` from datasets import load_dataset dataset = load_dataset('Andyrasika/cat_kingdom') dataset from mmseg.apis import MMSegInferencer checkpoint_name = 'segformer_mit-b5_8xb2-160k_ade20k-640x640' inferencer = MMSegInferencer(model=checkpoint_name) # Define a function to apply the code to each image in the dataset def process_image(image_path): print("Processing image:", image_path) result = inferencer(image_path)['predictions'] mask = np.where(result == 12, 255, 0).astype('uint8') return Image.fromarray(mask) # Process and save masks for each image in the dataset for idx, example in enumerate(dataset['train']): image_path = example['image'] mask_image = process_image(image_path) mask_image.save(f"mask_{idx}.png") ``` ### Expected behavior create a separate column with masks in the dataset and further shows as a separate column in hub ### Environment info jupyter notebook RTX 3090 From what I see, `MMSegInferencer` supports NumPy arrays, so replace the line `image_path = example['image']` with `image_path = np.array(example['image'])` to fix the issue (`example["image"]` is a `PIL.Image` object).
[ -0.008103315718472004, 0.3678678572177887, -0.12506745755672455, 0.06508176028728485, 0.06560826301574707, 0.10980083793401718, 0.195994034409523, 0.05570606142282486, -0.014444160275161266, 0.05987101420760155, -0.01784888654947281, 0.07760899513959885, -0.07777368277311325, -0.036069490015506744, 0.06704065948724747, -0.04946473613381386, 0.1049489974975586, 0.06323090195655823, -0.1218753531575203, -0.08596859872341156, -0.17328044772148132, 0.020371753722429276, -0.0945325568318367, 0.007626390550285578, -0.09232017397880554, -0.17349642515182495, -0.005310226231813431, 0.07028044015169144, 0.010602698661386967, 0.05164135619997978, 0.05205549672245979, -0.046480096876621246, 0.09789112210273743, -0.10259248316287994, 0.000005450795015349286, -0.025519227609038353, 0.24340680241584778, -0.03631100058555603, 0.18452154099941254, -0.0198891032487154, 0.025488074868917465, -0.0074579352512955666, -0.004277330357581377, -0.17784017324447632, 0.006384941283613443, 0.08918949216604233, 0.07553268224000931, 0.0012821537675336003, 0.13596075773239136, 0.04028633236885071, 0.008963402360677719, 0.033890824764966965, -0.10251220315694809, -0.15362410247325897, -0.08593807369470596, -0.08994227647781372, 0.11081719398498535, 0.04462875425815582, -0.1526944488286972, -0.1896999478340149, 0.001199577935039997, 0.2070368081331253, -0.061232756823301315, 0.07071451842784882, -0.022254236042499542, 0.006748316343873739, 0.27760469913482666, -0.24318018555641174, -0.06805586814880371, -0.029378727078437805, -0.19163817167282104, 0.0298672616481781, -0.10132189095020294, -0.024232560768723488, -0.16359302401542664, -0.07217998802661896, -0.17623548209667206, 0.1687297224998474, -0.08207742869853973, 0.04040294140577316, 0.030201662331819534, 0.04330940917134285, 0.021949773654341698, 0.014363214373588562, -0.15198034048080444, 0.1345653086900711, 0.04676758497953415, 0.13477873802185059, -0.04008548706769943, 0.07538312673568726, -0.033818695694208145, -0.12117081880569458, -0.0061696660704910755, -0.10841768234968185, -0.01409502886235714, 0.025618791580200195, 0.05516871064901352, -0.2432129979133606, 0.030415188521146774, -0.11259384453296661, -0.06672084331512451, 0.051295965909957886, 0.09531085193157196, 0.23736056685447693, 0.015640489757061005, -0.1698666661977768, -0.171927809715271, 0.09645500034093857, -0.09808981418609619, -0.020840084180235863, -0.0881914496421814, 0.019712571054697037, 0.06207342818379402, -0.001507931505329907, 0.04334375634789467, 0.019156381487846375, 0.010497471317648888, 0.0024022653233259916, -0.2175309658050537, 0.029929881915450096, 0.006858224049210548, 0.04008132964372635, -0.18727213144302368, -0.0029863000381737947, 0.016009705141186714, 0.0878409892320633, -0.02514594979584217, 0.08343719691038132, -0.035765159875154495, 0.08384168148040771, 0.012258636765182018, 0.04099573567509651, -0.03622594103217125, -0.0801861360669136, -0.05057500675320625, 0.1163887083530426, 0.0779009610414505, -0.06846380233764648, -0.05857815966010094, -0.11949324607849121, 0.05536419525742531, -0.1878158301115036, -0.0015177975874394178, -0.09087634831666946, -0.009319914504885674, -0.07496749609708786, 0.11911366134881973, 0.011376707814633846, 0.02667335234582424, -0.037250589579343796, -0.1182042732834816, 0.18468420207500458, -0.04309658333659172, -0.009764834307134151, -0.07719910889863968, 0.1440703272819519, -0.21768316626548767, -0.03369266167283058, -0.13988453149795532, -0.02066965587437153, 0.09007779508829117, -0.0038105163257569075, -0.03759033977985382, 0.01299639418721199, 0.005753000732511282, -0.039310526102781296, -0.026942284777760506, -0.004432802554219961, -0.08759839087724686, -0.07813936471939087, 0.16216494143009186, -0.09398118406534195, 0.04559756815433502, 0.04795881360769272, 0.00321569642983377, 0.011893747374415398, -0.059182196855545044, 0.14195001125335693, 0.03870222344994545, -0.17007066309452057, 0.007475193124264479, -0.027116423472762108, -0.13509227335453033, 0.02994348481297493, 0.09126134216785431, 0.1463388055562973, 0.03385466709733009, 0.12587706744670868, -0.19423668086528778, -0.14304932951927185, 0.14706510305404663, 0.12653905153274536, -0.16011716425418854, 0.06444621831178665, 0.13422495126724243, 0.08489438146352768, -0.24490752816200256, -0.09023729711771011, 0.10396123677492142, -0.12068594992160797, -0.047625456005334854, -0.09236273169517517, 0.29795098304748535, -0.017764000222086906, 0.013572010211646557, -0.02217000350356102, 0.053123775869607925, 0.09605466574430466, 0.039989933371543884, -0.15709351003170013, -0.25846660137176514, 0.038519714027643204, 0.11638052016496658, -0.08762603998184204, -0.0964074432849884, -0.037918783724308014, 0.05726274847984314, 0.07161884754896164, 0.03810204192996025, -0.06998644024133682, -0.013800738379359245, 0.012895462103188038, 0.12880468368530273, 0.07608316093683243, 0.05064719170331955, 0.051917172968387604, -0.060732994228601456, 0.03929634019732475, 0.1240093931555748, -0.023735852912068367, -0.017309069633483887, -0.19247382879257202, 0.16689740121364594, -0.004002466797828674, -0.18221548199653625, -0.062235988676548004, -0.07023634016513824, -0.37104278802871704, 0.050103191286325455, -0.12074615806341171, -0.20101121068000793, 0.10824374854564667, -0.10574302822351456, 0.07294725626707077, -0.0470716767013073, 0.14020125567913055, -0.025450492277741432, 0.006477986462414265, -0.11823231726884842, -0.04204985871911049, -0.012276668101549149, 0.09121108800172806, 0.006080972030758858, -0.0021722097881138325, -0.0336269810795784, 0.08589493483304977, 0.04096895828843117, 0.08971846848726273, -0.02958832122385502, -0.07088626176118851, -0.012290717102587223, -0.04022043198347092, 0.03751792013645172, -0.11353194713592529, 0.1397339403629303, -0.002852810313925147, -0.0015663817757740617, -0.07773390412330627, 0.03237996622920036, 0.0014285547658801079, -0.0015795599902048707, 0.11064038425683975, 0.05297679454088211, 0.03130127489566803, -0.06251210719347, 0.2092551589012146, 0.02372216247022152, -0.01737133227288723, 0.0716860294342041, 0.10546334087848663, -0.10958939045667648, -0.004287101794034243, -0.07273031026124954, -0.15314143896102905, -0.008341685868799686, 0.1658467799425125, -0.008862189017236233, -0.12254108488559723, -0.15842776000499725, -0.012039657682180405, 0.02072310447692871, 0.0711754858493805, -0.08784183859825134, -0.18116053938865662, -0.04804544150829315, -0.044984277337789536, -0.07527507096529007, 0.19230160117149353, 0.05368166044354439, 0.060846492648124695, -0.2975674569606781, 0.1396348476409912, 0.21002447605133057, 0.07692050188779831, 0.07483164966106415, 0.02692929282784462, 0.2636498510837555, 0.03502067178487778, -0.28988102078437805, 0.07643851637840271, -0.019233187660574913, -0.11419691145420074, -0.05473042279481888, 0.1230376660823822, -0.018317289650440216, 0.045415714383125305, -0.0632680356502533, -0.2317468672990799, -0.018225938081741333, 0.04635492339730263, -0.05823375657200813, -0.08118835091590881, -0.02951854281127453, 0.06738077849149704, -0.029597748070955276, -0.0396503321826458, -0.22862815856933594, 0.025815878063440323, 0.004762112163007259, 0.092868372797966, 0.175064817070961, 0.0829056054353714, 0.03005841001868248, -0.05660282447934151, -0.004495345987379551, -0.10705185681581497, 0.04245132952928543, 0.09043730795383453, 0.21242587268352509, 0.04808769002556801, 0.14754214882850647, 0.030057266354560852, -0.19131147861480713, -0.044023726135492325, 0.05276395380496979, -0.18061743676662445, -0.12185508012771606, 0.07708004117012024, 0.13803547620773315, 0.014305362477898598, 0.020946556702256203, -0.07180634886026382, -0.023213224485516548, -0.1353805512189865, -0.19509485363960266, 0.10379590839147568, -0.16189587116241455, 0.05212932080030441, -0.18938975036144257, 0.016023000702261925, 0.15073224902153015, 0.235349640250206, 0.0356619730591774, 0.15356771647930145, -0.31078240275382996, 0.06245369464159012, 0.03260575607419014, 0.08452826738357544, 0.01788637600839138, -0.006993065122514963, 0.2948189973831177, -0.09745963662862778, 0.05632661283016205, -0.11321601271629333, -0.12400053441524506, 0.11766879260540009, -0.02845950610935688, -0.031460609287023544, -0.021746914833784103, 0.09535525739192963, -0.04365132004022598, -0.11719945073127747, -0.1618417352437973, 0.19386298954486847, 0.10023973882198334, 0.11100833117961884, 0.11024341732263565, 0.17312397062778473, -0.1258925348520279, 0.3308166563510895, 0.035727981477975845, -0.050499655306339264, -0.11017537862062454, 0.09197521954774857, 0.0004428446991369128, -0.019429825246334076, 0.05808348208665848, 0.16111162304878235, -0.026460228487849236, 0.029600709676742554, 0.08925333619117737, 0.13487425446510315, -0.016016773879528046, -0.04703298211097717, -0.15677112340927124, -0.12383094429969788, 0.029029851779341698, -0.1027812510728836, -0.02461324632167816, -0.06340553611516953, 0.15042026340961456, -0.037163104861974716, -0.03845171630382538, 0.018767105415463448, 0.29820725321769714, 0.032918404787778854, -0.1469936966896057, -0.013569816946983337, 0.0669935941696167, -0.02153598517179489, -0.10206461697816849, -0.0074755409732460976, 0.1333891898393631, 0.2203104943037033, 0.04260734096169472, -0.05613377317786217, 0.09705323725938797, 0.1656169444322586, -0.07683020830154419, 0.07421921193599701, 0.18245942890644073, 0.05447976663708687, -0.0896715372800827, 0.08419834822416306, 0.03601039573550224, 0.13049115240573883, 0.21640726923942566, -0.11640172451734543, -0.04250902310013771, -0.014508712105453014, 0.009932778775691986, -0.017296897247433662, 0.21703140437602997, 0.05479148030281067, -0.13140329718589783, -0.10906471312046051, -0.21265311539173126, 0.021797383204102516, 0.16982409358024597, -0.04094268009066582, 0.0550517737865448, 0.15250825881958008, -0.0792933851480484, 0.00410505011677742, 0.1905352771282196, -0.004430664237588644, 0.09580422192811966, -0.19842450320720673, -0.014592318795621395, -0.09716859459877014, 0.26454758644104004, -0.1050158441066742, -0.0031663214322179556, 0.041771143674850464, 0.11428947746753693, 0.15916679799556732, -0.005655887071043253, 0.06414886564016342, -0.02564152516424656, 0.17550872266292572, -0.08653263747692108, 0.00808650255203247, 0.021769732236862183, 0.07227233797311783, 0.20462079346179962, 0.07174231857061386, 0.05402345582842827, -0.06978221982717514, -0.1787872314453125, -0.004363529849797487, 0.10553988069295883, -0.024798357859253883, 0.015038726851344109, 0.006612069439142942, -0.15921369194984436, 0.024603700265288353, 0.09740288555622101, -0.041536346077919006, -0.2593335509300232, 0.11390509456396103, -0.033260442316532135, 0.11996231973171234, 0.07586817443370819, -0.08727533370256424, 0.07517880946397781, -0.029723383486270905, 0.05712142959237099, -0.12798930704593658, -0.08832845091819763, 0.0653814971446991, 0.058630794286727905, 0.07308066636323929, -0.05325356498360634, 0.027765756472945213, 0.19533288478851318, -0.19345253705978394, 0.06128830462694168, 0.10817258805036545, 0.26827019453048706, 0.0656304880976677, 0.004427325911819935, -0.12207090854644775, -0.13812360167503357, -0.1011647954583168, -0.0809222012758255, 0.03579051420092583, 0.13131672143936157, -0.01762835867702961, -0.06147226318717003, 0.08505106717348099, 0.025469940155744553, 0.10697533935308456, 0.30090370774269104, -0.11168494820594788, 0.11874283850193024, 0.14037491381168365, -0.08500805497169495, -0.014101620763540268, 0.13127130270004272, 0.08034192770719528, -0.09424635022878647, 0.17733077704906464, 0.10431571304798126, 0.05325353145599365, -0.039503250271081924, -0.01373475044965744, 0.14091035723686218, -0.0048939380794763565, 0.10968487709760666, -0.07421055436134338, 0.24513038992881775, -0.3184201121330261, -0.017392462119460106, 0.22900481522083282, 0.0366402305662632, -0.012413599528372288, -0.03365306928753853, -0.130238339304924, 0.09044435620307922, -0.19759653508663177, 0.0125565305352211, 0.1836898773908615, 0.172812357544899, -0.03067593090236187, -0.026386015117168427, -2.6286633894486404e-32, -0.09193204343318939, 0.031068461015820503, -0.05119330435991287, -0.012465089559555054, -0.12160813808441162, -0.14290079474449158, -0.04272757098078728, -0.16348998248577118, 0.1527150273323059, 0.12968750298023224, -0.01820778287947178, -0.027664117515087128, 0.06776722520589828, 0.03779013454914093, -0.01944330520927906, 0.04460277035832405, 0.11944647133350372, -0.005908798426389694, 0.04709230735898018, -0.12196244299411774, -0.15182273089885712, 0.19760200381278992, 0.18450112640857697, -0.0020739177707582712, -0.1978200078010559, 0.18180064857006073, -0.14987517893314362, -0.08458985388278961, -0.05861635133624077, -0.12133777886629105, -0.07305598258972168, -0.02709854766726494, -0.05100191757082939, -0.1128757894039154, -0.13933758437633514, -0.04701750725507736, -0.1512424796819687, -0.14073698222637177, 0.07354524731636047, 0.07199882715940475, -0.14384488761425018, 0.03951241821050644, 0.1925128549337387, -0.06617322564125061, 0.1304750144481659, 0.009082614444196224, 0.16741713881492615, 0.02641751430928707, 0.10569200664758682, -0.09896188974380493, 0.09248218685388565, -0.06903362274169922, -0.10225070267915726, 0.06335736066102982, -0.10535526275634766, -0.12914589047431946, 0.06942016631364822, 0.1027023196220398, -0.17919564247131348, 0.06295497715473175, 0.09208985418081284, 0.0962286964058876, -0.05945032089948654, -0.14758987724781036, 0.08173546195030212, -0.09979686886072159, 0.16081750392913818, -0.0578712522983551, 0.041214313358068466, -0.18714077770709991, -0.13828785717487335, 0.0833803340792656, 0.0133026959374547, 0.06428148597478867, -0.16188521683216095, -0.026168756186962128, -0.12377163767814636, -0.10687744617462158, -0.12467549741268158, 0.03769727796316147, -0.10550159215927124, 0.07590828090906143, 0.046235647052526474, 0.07314144819974899, 0.0303342267870903, -0.14653415977954865, 0.0059266285970807076, 0.04896583780646324, 0.016111943870782852, -0.09316989034414291, -0.01709970086812973, 0.25487303733825684, 0.06804879754781723, -0.17560182511806488, -0.06402672082185745, -0.18419012427330017, -0.11205769330263138, 0.05138808488845825, -0.0016992754535749555, -0.07642023265361786, 0.007173655554652214, -0.07807468622922897, 0.11544931679964066, 0.09742424637079239, 0.21840830147266388, 0.04689604043960571, 0.15917634963989258, 0.016392063349485397, -0.1837988793849945, -0.10944821685552597, -0.14652808010578156, 0.06558238714933395, 0.10908211022615433, 0.07966694235801697, 0.036655232310295105, -0.09752834588289261, -0.0175461545586586, 0.019069058820605278, 0.09431671351194382, 0.1608857959508896, -0.1811675876379013, -0.11450214684009552, -0.07199268788099289, 0.026264360174536705, -0.050630178302526474, 0.10473574697971344, -0.21011020243167877, -0.03423594310879707, -0.09373831003904343, -0.11879193037748337, -0.06380034238100052, -0.02332877553999424, 6.977287512199837e-7, -0.16848225891590118, -0.1409403681755066, -0.01025459449738264, 0.15385013818740845, -0.03539422154426575, 0.18805965781211853, -0.13510306179523468, -0.05999018996953964, 0.08719606697559357, 0.15771858394145966, 0.20538091659545898, -0.11974264681339264, 0.08449988067150116, -0.07911980897188187, 0.03931589797139168, -0.05395511910319328, -0.04965861141681671, 0.07680477201938629, -0.1277875453233719, 0.15257979929447174, -0.0610528402030468, 0.10146379470825195, 0.2443382740020752, -0.012807602994143963, -0.009080315008759499, -0.10433759540319443, -0.07026346772909164, 0.06851470470428467, -0.01947813294827938, -0.07272891700267792, 0.1908453404903412, 0.08777178078889847, -0.04775139316916466, 0.05683176591992378, -0.03579040616750717, -0.11690041422843933, -0.01874246634542942, 0.08914580941200256, -0.030586661770939827, 0.01577463373541832, -0.02218109369277954, 0.09103163331747055, 0.11673523485660553, -0.18582794070243835, 0.0029468608554452658, 0.046075720340013504, 0.09463850408792496, -0.14235471189022064, -0.05219675600528717, 0.039002303034067154, -0.0011720965849235654, 0.06483513116836548, 0.052429065108299255, 0.13664186000823975, 0.15662352740764618, -0.08796893060207367, -0.2873660922050476, -0.2518211007118225, 0.22811833024024963, 0.0004820867325179279, -0.20031245052814484, -0.12410996854305267, 0.1187460869550705, -0.11823809891939163, 0.10542330145835876, -0.24609403312206268, -0.16032429039478302, 5.424474228241063e-35, -0.011107534170150757, -0.06805378943681717, 0.06966738402843475, 0.10851698368787766, 0.0022340642753988504, -0.031137628480792046, -0.08447348326444626, -0.10009842365980148, 0.03275589272379875, -0.07126010954380035, -0.13213691115379333 ]
https://github.com/huggingface/datasets/issues/6229
Apply inference on all images in the dataset
> From what I see, `MMSegInferencer` supports NumPy arrays, so replace the line `image_path = example['image']` with `image_path = np.array(example['image'])` to fix the issue (`example["image"]` is a `PIL.Image` object). Thanks @mariosasko for your reply... i tried : ``` # Define a function to apply the code to each image in the dataset def process_image(image_path): print("Processing image:", image_path) result = inferencer(image_path)['predictions'] mask = np.where(result == 12, 255, 0).astype('uint8') return Image.fromarray(mask) # Process and save masks for each image in the dataset for idx, example in enumerate(dataset['train']): image_path = np.array(example['image']) mask_image = process_image(image_path) mask_image.save(f"mask_{idx}.png") ``` and got ``` Processing image: [[[202 165 87] [203 166 88] [207 168 91] ... [243 205 122] [244 202 120] [242 200 118]] [[202 165 87] [203 166 88] [207 168 91] ... [244 206 123] [245 203 121] [243 201 119]] [[203 164 87] [204 165 88] [207 168 91] ... [245 207 126] [246 204 122] [245 203 121]] ... [[154 123 56] [155 124 57] [158 125 56] ... [ 3 3 1] [ 3 3 1] [ 3 3 1]] [[154 123 56] [154 123 56] [155 124 57] ... [ 2 2 0] [ 2 2 0] [ 2 2 0]] [[152 121 54] [152 121 54] [153 122 55] ... [ 2 2 0] [ 2 2 0] [ 2 2 0]]] Inference ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Processing image: [[[ 39 44 40] [ 39 44 40] [ 39 43 44] ... [187 185 164] [208 204 175] [203 198 166]] [[ 42 47 43] [ 40 45 41] [ 40 44 45] ... [188 186 165] [202 198 169] [201 196 164]] [[ 41 46 42] [ 39 44 40] [ 40 44 45] ... [187 184 165] [197 193 166] [201 196 166]] ... [[ 29 27 30] [ 28 26 29] [ 25 23 26] ... [ 48 33 28] [ 44 31 25] [ 39 26 20]] [[ 34 29 33] [ 32 27 31] [ 29 24 28] ... [ 30 17 11] [ 36 23 15] [ 41 28 20]] [[ 35 30 34] [ 33 28 32] [ 28 23 27] ... [ 28 15 9] [ 41 28 20] [ 46 33 25]]] Inference ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Processing image: [[[ 65 53 55] [ 65 53 55] [ 51 39 41] ... [133 127 111] [150 141 124] [133 124 107]] [[ 58 45 52] [ 61 48 55] [ 51 38 45] ... [148 141 123] [178 169 152] [144 135 118]] [[ 79 66 83] [ 73 60 77] [ 65 51 66] ... [140 131 114] [142 133 116] [147 136 118]] ... [[132 122 133] [ 95 85 94] [ 61 51 60] ... [ 39 28 42] [ 46 36 45] [ 25 16 21]] [[150 143 151] [114 107 115] [ 64 54 63] ... [ 47 35 47] [ 38 27 35] [140 129 133]] [[145 138 146] [115 108 116] [ 69 59 67] ... [ 31 19 31] [128 117 123] [196 185 189]]] Inference ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Processing image: [[[159 151 140] [171 163 152] [161 148 142] ... [198 184 171] [189 175 162] [183 169 156]] [[128 118 106] [138 128 116] [138 125 116] ... [200 186 173] [190 176 163] [187 173 160]] [[165 153 137] [170 158 142] [174 162 148] ... [200 187 171] [188 175 159] [182 169 153]] ``` However , when trying to add to: ``` from datasets import load_dataset dataset = load_dataset('Andyrasika/cat_kingdom') dataset ``` i did ``` new_column = ["mask"] * len(dataset["train"]) new_column dataset = dataset.add_column("/workspace/data", new_column) print(dataset) ``` got error: ``` --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[11], line 3 1 new_column = ["mask"] * len(dataset["train"]) 2 new_column ----> 3 dataset = dataset.add_column("/workspace/data", new_column) 5 print(dataset) AttributeError: 'DatasetDict' object has no attribute 'add_column' ```
### Describe the bug ``` --------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) Cell In[14], line 11 9 for idx, example in enumerate(dataset['train']): 10 image_path = example['image'] ---> 11 mask_image = process_image(image_path) 12 mask_image.save(f"mask_{idx}.png") Cell In[14], line 4, in process_image(image_path) 2 def process_image(image_path): 3 print("Processing image:", image_path) ----> 4 result = inferencer(image_path)['predictions'] 5 mask = np.where(result == 12, 255, 0).astype('uint8') 6 return Image.fromarray(mask) File /usr/local/lib/python3.10/dist-packages/mmseg/apis/mmseg_inferencer.py:183, in MMSegInferencer.__call__(self, inputs, return_datasamples, batch_size, show, wait_time, out_dir, img_out_dir, pred_out_dir, **kwargs) 180 pred_out_dir = '' 181 img_out_dir = '' --> 183 return super().__call__( 184 inputs=inputs, 185 return_datasamples=return_datasamples, 186 batch_size=batch_size, 187 show=show, 188 wait_time=wait_time, 189 img_out_dir=img_out_dir, 190 pred_out_dir=pred_out_dir, 191 **kwargs) File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:221, in BaseInferencer.__call__(self, inputs, return_datasamples, batch_size, **kwargs) 218 inputs = self.preprocess( 219 ori_inputs, batch_size=batch_size, **preprocess_kwargs) 220 preds = [] --> 221 for data in (track(inputs, description='Inference') 222 if self.show_progress else inputs): 223 preds.extend(self.forward(data, **forward_kwargs)) 224 visualization = self.visualize( 225 ori_inputs, preds, 226 **visualize_kwargs) # type: ignore # noqa: E501 File /usr/local/lib/python3.10/dist-packages/rich/progress.py:168, in track(sequence, description, total, auto_refresh, console, transient, get_time, refresh_per_second, style, complete_style, finished_style, pulse_style, update_period, disable, show_speed) 157 progress = Progress( 158 *columns, 159 auto_refresh=auto_refresh, (...) 164 disable=disable, 165 ) 167 with progress: --> 168 yield from progress.track( 169 sequence, total=total, description=description, update_period=update_period 170 ) File /usr/local/lib/python3.10/dist-packages/rich/progress.py:1210, in Progress.track(self, sequence, total, task_id, description, update_period) 1208 if self.live.auto_refresh: 1209 with _TrackThread(self, task_id, update_period) as track_thread: -> 1210 for value in sequence: 1211 yield value 1212 track_thread.completed += 1 File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:291, in BaseInferencer.preprocess(self, inputs, batch_size, **kwargs) 266 """Process the inputs into a model-feedable format. 267 268 Customize your preprocess by overriding this method. Preprocess should (...) 287 Any: Data processed by the ``pipeline`` and ``collate_fn``. 288 """ 289 chunked_data = self._get_chunk_data( 290 map(self.pipeline, inputs), batch_size) --> 291 yield from map(self.collate_fn, chunked_data) File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:588, in BaseInferencer._get_chunk_data(self, inputs, chunk_size) 586 chunk_data = [] 587 for _ in range(chunk_size): --> 588 processed_data = next(inputs_iter) 589 chunk_data.append(processed_data) 590 yield chunk_data File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results) 9 def __call__(self, 10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]: ---> 12 return self.transform(results) File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/wrappers.py:88, in Compose.transform(self, results) 79 """Call function to apply transforms sequentially. 80 81 Args: (...) 85 dict or None: Transformed results. 86 """ 87 for t in self.transforms: ---> 88 results = t(results) # type: ignore 89 if results is None: 90 return None File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results) 9 def __call__(self, 10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]: ---> 12 return self.transform(results) File /usr/local/lib/python3.10/dist-packages/mmseg/datasets/transforms/loading.py:496, in InferencerLoader.transform(self, single_input) 494 inputs = single_input 495 else: --> 496 raise NotImplementedError 498 if 'img' in inputs: 499 return self.from_ndarray(inputs) NotImplementedError: ```` ### Steps to reproduce the bug ``` from datasets import load_dataset dataset = load_dataset('Andyrasika/cat_kingdom') dataset from mmseg.apis import MMSegInferencer checkpoint_name = 'segformer_mit-b5_8xb2-160k_ade20k-640x640' inferencer = MMSegInferencer(model=checkpoint_name) # Define a function to apply the code to each image in the dataset def process_image(image_path): print("Processing image:", image_path) result = inferencer(image_path)['predictions'] mask = np.where(result == 12, 255, 0).astype('uint8') return Image.fromarray(mask) # Process and save masks for each image in the dataset for idx, example in enumerate(dataset['train']): image_path = example['image'] mask_image = process_image(image_path) mask_image.save(f"mask_{idx}.png") ``` ### Expected behavior create a separate column with masks in the dataset and further shows as a separate column in hub ### Environment info jupyter notebook RTX 3090
638
Apply inference on all images in the dataset ### Describe the bug ``` --------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) Cell In[14], line 11 9 for idx, example in enumerate(dataset['train']): 10 image_path = example['image'] ---> 11 mask_image = process_image(image_path) 12 mask_image.save(f"mask_{idx}.png") Cell In[14], line 4, in process_image(image_path) 2 def process_image(image_path): 3 print("Processing image:", image_path) ----> 4 result = inferencer(image_path)['predictions'] 5 mask = np.where(result == 12, 255, 0).astype('uint8') 6 return Image.fromarray(mask) File /usr/local/lib/python3.10/dist-packages/mmseg/apis/mmseg_inferencer.py:183, in MMSegInferencer.__call__(self, inputs, return_datasamples, batch_size, show, wait_time, out_dir, img_out_dir, pred_out_dir, **kwargs) 180 pred_out_dir = '' 181 img_out_dir = '' --> 183 return super().__call__( 184 inputs=inputs, 185 return_datasamples=return_datasamples, 186 batch_size=batch_size, 187 show=show, 188 wait_time=wait_time, 189 img_out_dir=img_out_dir, 190 pred_out_dir=pred_out_dir, 191 **kwargs) File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:221, in BaseInferencer.__call__(self, inputs, return_datasamples, batch_size, **kwargs) 218 inputs = self.preprocess( 219 ori_inputs, batch_size=batch_size, **preprocess_kwargs) 220 preds = [] --> 221 for data in (track(inputs, description='Inference') 222 if self.show_progress else inputs): 223 preds.extend(self.forward(data, **forward_kwargs)) 224 visualization = self.visualize( 225 ori_inputs, preds, 226 **visualize_kwargs) # type: ignore # noqa: E501 File /usr/local/lib/python3.10/dist-packages/rich/progress.py:168, in track(sequence, description, total, auto_refresh, console, transient, get_time, refresh_per_second, style, complete_style, finished_style, pulse_style, update_period, disable, show_speed) 157 progress = Progress( 158 *columns, 159 auto_refresh=auto_refresh, (...) 164 disable=disable, 165 ) 167 with progress: --> 168 yield from progress.track( 169 sequence, total=total, description=description, update_period=update_period 170 ) File /usr/local/lib/python3.10/dist-packages/rich/progress.py:1210, in Progress.track(self, sequence, total, task_id, description, update_period) 1208 if self.live.auto_refresh: 1209 with _TrackThread(self, task_id, update_period) as track_thread: -> 1210 for value in sequence: 1211 yield value 1212 track_thread.completed += 1 File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:291, in BaseInferencer.preprocess(self, inputs, batch_size, **kwargs) 266 """Process the inputs into a model-feedable format. 267 268 Customize your preprocess by overriding this method. Preprocess should (...) 287 Any: Data processed by the ``pipeline`` and ``collate_fn``. 288 """ 289 chunked_data = self._get_chunk_data( 290 map(self.pipeline, inputs), batch_size) --> 291 yield from map(self.collate_fn, chunked_data) File /usr/local/lib/python3.10/dist-packages/mmengine/infer/infer.py:588, in BaseInferencer._get_chunk_data(self, inputs, chunk_size) 586 chunk_data = [] 587 for _ in range(chunk_size): --> 588 processed_data = next(inputs_iter) 589 chunk_data.append(processed_data) 590 yield chunk_data File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results) 9 def __call__(self, 10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]: ---> 12 return self.transform(results) File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/wrappers.py:88, in Compose.transform(self, results) 79 """Call function to apply transforms sequentially. 80 81 Args: (...) 85 dict or None: Transformed results. 86 """ 87 for t in self.transforms: ---> 88 results = t(results) # type: ignore 89 if results is None: 90 return None File /usr/local/lib/python3.10/dist-packages/mmcv/transforms/base.py:12, in BaseTransform.__call__(self, results) 9 def __call__(self, 10 results: Dict) -> Optional[Union[Dict, Tuple[List, List]]]: ---> 12 return self.transform(results) File /usr/local/lib/python3.10/dist-packages/mmseg/datasets/transforms/loading.py:496, in InferencerLoader.transform(self, single_input) 494 inputs = single_input 495 else: --> 496 raise NotImplementedError 498 if 'img' in inputs: 499 return self.from_ndarray(inputs) NotImplementedError: ```` ### Steps to reproduce the bug ``` from datasets import load_dataset dataset = load_dataset('Andyrasika/cat_kingdom') dataset from mmseg.apis import MMSegInferencer checkpoint_name = 'segformer_mit-b5_8xb2-160k_ade20k-640x640' inferencer = MMSegInferencer(model=checkpoint_name) # Define a function to apply the code to each image in the dataset def process_image(image_path): print("Processing image:", image_path) result = inferencer(image_path)['predictions'] mask = np.where(result == 12, 255, 0).astype('uint8') return Image.fromarray(mask) # Process and save masks for each image in the dataset for idx, example in enumerate(dataset['train']): image_path = example['image'] mask_image = process_image(image_path) mask_image.save(f"mask_{idx}.png") ``` ### Expected behavior create a separate column with masks in the dataset and further shows as a separate column in hub ### Environment info jupyter notebook RTX 3090 > From what I see, `MMSegInferencer` supports NumPy arrays, so replace the line `image_path = example['image']` with `image_path = np.array(example['image'])` to fix the issue (`example["image"]` is a `PIL.Image` object). Thanks @mariosasko for your reply... i tried : ``` # Define a function to apply the code to each image in the dataset def process_image(image_path): print("Processing image:", image_path) result = inferencer(image_path)['predictions'] mask = np.where(result == 12, 255, 0).astype('uint8') return Image.fromarray(mask) # Process and save masks for each image in the dataset for idx, example in enumerate(dataset['train']): image_path = np.array(example['image']) mask_image = process_image(image_path) mask_image.save(f"mask_{idx}.png") ``` and got ``` Processing image: [[[202 165 87] [203 166 88] [207 168 91] ... [243 205 122] [244 202 120] [242 200 118]] [[202 165 87] [203 166 88] [207 168 91] ... [244 206 123] [245 203 121] [243 201 119]] [[203 164 87] [204 165 88] [207 168 91] ... [245 207 126] [246 204 122] [245 203 121]] ... [[154 123 56] [155 124 57] [158 125 56] ... [ 3 3 1] [ 3 3 1] [ 3 3 1]] [[154 123 56] [154 123 56] [155 124 57] ... [ 2 2 0] [ 2 2 0] [ 2 2 0]] [[152 121 54] [152 121 54] [153 122 55] ... [ 2 2 0] [ 2 2 0] [ 2 2 0]]] Inference ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Processing image: [[[ 39 44 40] [ 39 44 40] [ 39 43 44] ... [187 185 164] [208 204 175] [203 198 166]] [[ 42 47 43] [ 40 45 41] [ 40 44 45] ... [188 186 165] [202 198 169] [201 196 164]] [[ 41 46 42] [ 39 44 40] [ 40 44 45] ... [187 184 165] [197 193 166] [201 196 166]] ... [[ 29 27 30] [ 28 26 29] [ 25 23 26] ... [ 48 33 28] [ 44 31 25] [ 39 26 20]] [[ 34 29 33] [ 32 27 31] [ 29 24 28] ... [ 30 17 11] [ 36 23 15] [ 41 28 20]] [[ 35 30 34] [ 33 28 32] [ 28 23 27] ... [ 28 15 9] [ 41 28 20] [ 46 33 25]]] Inference ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Processing image: [[[ 65 53 55] [ 65 53 55] [ 51 39 41] ... [133 127 111] [150 141 124] [133 124 107]] [[ 58 45 52] [ 61 48 55] [ 51 38 45] ... [148 141 123] [178 169 152] [144 135 118]] [[ 79 66 83] [ 73 60 77] [ 65 51 66] ... [140 131 114] [142 133 116] [147 136 118]] ... [[132 122 133] [ 95 85 94] [ 61 51 60] ... [ 39 28 42] [ 46 36 45] [ 25 16 21]] [[150 143 151] [114 107 115] [ 64 54 63] ... [ 47 35 47] [ 38 27 35] [140 129 133]] [[145 138 146] [115 108 116] [ 69 59 67] ... [ 31 19 31] [128 117 123] [196 185 189]]] Inference ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Processing image: [[[159 151 140] [171 163 152] [161 148 142] ... [198 184 171] [189 175 162] [183 169 156]] [[128 118 106] [138 128 116] [138 125 116] ... [200 186 173] [190 176 163] [187 173 160]] [[165 153 137] [170 158 142] [174 162 148] ... [200 187 171] [188 175 159] [182 169 153]] ``` However , when trying to add to: ``` from datasets import load_dataset dataset = load_dataset('Andyrasika/cat_kingdom') dataset ``` i did ``` new_column = ["mask"] * len(dataset["train"]) new_column dataset = dataset.add_column("/workspace/data", new_column) print(dataset) ``` got error: ``` --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[11], line 3 1 new_column = ["mask"] * len(dataset["train"]) 2 new_column ----> 3 dataset = dataset.add_column("/workspace/data", new_column) 5 print(dataset) AttributeError: 'DatasetDict' object has no attribute 'add_column' ```
[ -0.008103315718472004, 0.3678678572177887, -0.12506745755672455, 0.06508176028728485, 0.06560826301574707, 0.10980083793401718, 0.195994034409523, 0.05570606142282486, -0.014444160275161266, 0.05987101420760155, -0.01784888654947281, 0.07760899513959885, -0.07777368277311325, -0.036069490015506744, 0.06704065948724747, -0.04946473613381386, 0.1049489974975586, 0.06323090195655823, -0.1218753531575203, -0.08596859872341156, -0.17328044772148132, 0.020371753722429276, -0.0945325568318367, 0.007626390550285578, -0.09232017397880554, -0.17349642515182495, -0.005310226231813431, 0.07028044015169144, 0.010602698661386967, 0.05164135619997978, 0.05205549672245979, -0.046480096876621246, 0.09789112210273743, -0.10259248316287994, 0.000005450795015349286, -0.025519227609038353, 0.24340680241584778, -0.03631100058555603, 0.18452154099941254, -0.0198891032487154, 0.025488074868917465, -0.0074579352512955666, -0.004277330357581377, -0.17784017324447632, 0.006384941283613443, 0.08918949216604233, 0.07553268224000931, 0.0012821537675336003, 0.13596075773239136, 0.04028633236885071, 0.008963402360677719, 0.033890824764966965, -0.10251220315694809, -0.15362410247325897, -0.08593807369470596, -0.08994227647781372, 0.11081719398498535, 0.04462875425815582, -0.1526944488286972, -0.1896999478340149, 0.001199577935039997, 0.2070368081331253, -0.061232756823301315, 0.07071451842784882, -0.022254236042499542, 0.006748316343873739, 0.27760469913482666, -0.24318018555641174, -0.06805586814880371, -0.029378727078437805, -0.19163817167282104, 0.0298672616481781, -0.10132189095020294, -0.024232560768723488, -0.16359302401542664, -0.07217998802661896, -0.17623548209667206, 0.1687297224998474, -0.08207742869853973, 0.04040294140577316, 0.030201662331819534, 0.04330940917134285, 0.021949773654341698, 0.014363214373588562, -0.15198034048080444, 0.1345653086900711, 0.04676758497953415, 0.13477873802185059, -0.04008548706769943, 0.07538312673568726, -0.033818695694208145, -0.12117081880569458, -0.0061696660704910755, -0.10841768234968185, -0.01409502886235714, 0.025618791580200195, 0.05516871064901352, -0.2432129979133606, 0.030415188521146774, -0.11259384453296661, -0.06672084331512451, 0.051295965909957886, 0.09531085193157196, 0.23736056685447693, 0.015640489757061005, -0.1698666661977768, -0.171927809715271, 0.09645500034093857, -0.09808981418609619, -0.020840084180235863, -0.0881914496421814, 0.019712571054697037, 0.06207342818379402, -0.001507931505329907, 0.04334375634789467, 0.019156381487846375, 0.010497471317648888, 0.0024022653233259916, -0.2175309658050537, 0.029929881915450096, 0.006858224049210548, 0.04008132964372635, -0.18727213144302368, -0.0029863000381737947, 0.016009705141186714, 0.0878409892320633, -0.02514594979584217, 0.08343719691038132, -0.035765159875154495, 0.08384168148040771, 0.012258636765182018, 0.04099573567509651, -0.03622594103217125, -0.0801861360669136, -0.05057500675320625, 0.1163887083530426, 0.0779009610414505, -0.06846380233764648, -0.05857815966010094, -0.11949324607849121, 0.05536419525742531, -0.1878158301115036, -0.0015177975874394178, -0.09087634831666946, -0.009319914504885674, -0.07496749609708786, 0.11911366134881973, 0.011376707814633846, 0.02667335234582424, -0.037250589579343796, -0.1182042732834816, 0.18468420207500458, -0.04309658333659172, -0.009764834307134151, -0.07719910889863968, 0.1440703272819519, -0.21768316626548767, -0.03369266167283058, -0.13988453149795532, -0.02066965587437153, 0.09007779508829117, -0.0038105163257569075, -0.03759033977985382, 0.01299639418721199, 0.005753000732511282, -0.039310526102781296, -0.026942284777760506, -0.004432802554219961, -0.08759839087724686, -0.07813936471939087, 0.16216494143009186, -0.09398118406534195, 0.04559756815433502, 0.04795881360769272, 0.00321569642983377, 0.011893747374415398, -0.059182196855545044, 0.14195001125335693, 0.03870222344994545, -0.17007066309452057, 0.007475193124264479, -0.027116423472762108, -0.13509227335453033, 0.02994348481297493, 0.09126134216785431, 0.1463388055562973, 0.03385466709733009, 0.12587706744670868, -0.19423668086528778, -0.14304932951927185, 0.14706510305404663, 0.12653905153274536, -0.16011716425418854, 0.06444621831178665, 0.13422495126724243, 0.08489438146352768, -0.24490752816200256, -0.09023729711771011, 0.10396123677492142, -0.12068594992160797, -0.047625456005334854, -0.09236273169517517, 0.29795098304748535, -0.017764000222086906, 0.013572010211646557, -0.02217000350356102, 0.053123775869607925, 0.09605466574430466, 0.039989933371543884, -0.15709351003170013, -0.25846660137176514, 0.038519714027643204, 0.11638052016496658, -0.08762603998184204, -0.0964074432849884, -0.037918783724308014, 0.05726274847984314, 0.07161884754896164, 0.03810204192996025, -0.06998644024133682, -0.013800738379359245, 0.012895462103188038, 0.12880468368530273, 0.07608316093683243, 0.05064719170331955, 0.051917172968387604, -0.060732994228601456, 0.03929634019732475, 0.1240093931555748, -0.023735852912068367, -0.017309069633483887, -0.19247382879257202, 0.16689740121364594, -0.004002466797828674, -0.18221548199653625, -0.062235988676548004, -0.07023634016513824, -0.37104278802871704, 0.050103191286325455, -0.12074615806341171, -0.20101121068000793, 0.10824374854564667, -0.10574302822351456, 0.07294725626707077, -0.0470716767013073, 0.14020125567913055, -0.025450492277741432, 0.006477986462414265, -0.11823231726884842, -0.04204985871911049, -0.012276668101549149, 0.09121108800172806, 0.006080972030758858, -0.0021722097881138325, -0.0336269810795784, 0.08589493483304977, 0.04096895828843117, 0.08971846848726273, -0.02958832122385502, -0.07088626176118851, -0.012290717102587223, -0.04022043198347092, 0.03751792013645172, -0.11353194713592529, 0.1397339403629303, -0.002852810313925147, -0.0015663817757740617, -0.07773390412330627, 0.03237996622920036, 0.0014285547658801079, -0.0015795599902048707, 0.11064038425683975, 0.05297679454088211, 0.03130127489566803, -0.06251210719347, 0.2092551589012146, 0.02372216247022152, -0.01737133227288723, 0.0716860294342041, 0.10546334087848663, -0.10958939045667648, -0.004287101794034243, -0.07273031026124954, -0.15314143896102905, -0.008341685868799686, 0.1658467799425125, -0.008862189017236233, -0.12254108488559723, -0.15842776000499725, -0.012039657682180405, 0.02072310447692871, 0.0711754858493805, -0.08784183859825134, -0.18116053938865662, -0.04804544150829315, -0.044984277337789536, -0.07527507096529007, 0.19230160117149353, 0.05368166044354439, 0.060846492648124695, -0.2975674569606781, 0.1396348476409912, 0.21002447605133057, 0.07692050188779831, 0.07483164966106415, 0.02692929282784462, 0.2636498510837555, 0.03502067178487778, -0.28988102078437805, 0.07643851637840271, -0.019233187660574913, -0.11419691145420074, -0.05473042279481888, 0.1230376660823822, -0.018317289650440216, 0.045415714383125305, -0.0632680356502533, -0.2317468672990799, -0.018225938081741333, 0.04635492339730263, -0.05823375657200813, -0.08118835091590881, -0.02951854281127453, 0.06738077849149704, -0.029597748070955276, -0.0396503321826458, -0.22862815856933594, 0.025815878063440323, 0.004762112163007259, 0.092868372797966, 0.175064817070961, 0.0829056054353714, 0.03005841001868248, -0.05660282447934151, -0.004495345987379551, -0.10705185681581497, 0.04245132952928543, 0.09043730795383453, 0.21242587268352509, 0.04808769002556801, 0.14754214882850647, 0.030057266354560852, -0.19131147861480713, -0.044023726135492325, 0.05276395380496979, -0.18061743676662445, -0.12185508012771606, 0.07708004117012024, 0.13803547620773315, 0.014305362477898598, 0.020946556702256203, -0.07180634886026382, -0.023213224485516548, -0.1353805512189865, -0.19509485363960266, 0.10379590839147568, -0.16189587116241455, 0.05212932080030441, -0.18938975036144257, 0.016023000702261925, 0.15073224902153015, 0.235349640250206, 0.0356619730591774, 0.15356771647930145, -0.31078240275382996, 0.06245369464159012, 0.03260575607419014, 0.08452826738357544, 0.01788637600839138, -0.006993065122514963, 0.2948189973831177, -0.09745963662862778, 0.05632661283016205, -0.11321601271629333, -0.12400053441524506, 0.11766879260540009, -0.02845950610935688, -0.031460609287023544, -0.021746914833784103, 0.09535525739192963, -0.04365132004022598, -0.11719945073127747, -0.1618417352437973, 0.19386298954486847, 0.10023973882198334, 0.11100833117961884, 0.11024341732263565, 0.17312397062778473, -0.1258925348520279, 0.3308166563510895, 0.035727981477975845, -0.050499655306339264, -0.11017537862062454, 0.09197521954774857, 0.0004428446991369128, -0.019429825246334076, 0.05808348208665848, 0.16111162304878235, -0.026460228487849236, 0.029600709676742554, 0.08925333619117737, 0.13487425446510315, -0.016016773879528046, -0.04703298211097717, -0.15677112340927124, -0.12383094429969788, 0.029029851779341698, -0.1027812510728836, -0.02461324632167816, -0.06340553611516953, 0.15042026340961456, -0.037163104861974716, -0.03845171630382538, 0.018767105415463448, 0.29820725321769714, 0.032918404787778854, -0.1469936966896057, -0.013569816946983337, 0.0669935941696167, -0.02153598517179489, -0.10206461697816849, -0.0074755409732460976, 0.1333891898393631, 0.2203104943037033, 0.04260734096169472, -0.05613377317786217, 0.09705323725938797, 0.1656169444322586, -0.07683020830154419, 0.07421921193599701, 0.18245942890644073, 0.05447976663708687, -0.0896715372800827, 0.08419834822416306, 0.03601039573550224, 0.13049115240573883, 0.21640726923942566, -0.11640172451734543, -0.04250902310013771, -0.014508712105453014, 0.009932778775691986, -0.017296897247433662, 0.21703140437602997, 0.05479148030281067, -0.13140329718589783, -0.10906471312046051, -0.21265311539173126, 0.021797383204102516, 0.16982409358024597, -0.04094268009066582, 0.0550517737865448, 0.15250825881958008, -0.0792933851480484, 0.00410505011677742, 0.1905352771282196, -0.004430664237588644, 0.09580422192811966, -0.19842450320720673, -0.014592318795621395, -0.09716859459877014, 0.26454758644104004, -0.1050158441066742, -0.0031663214322179556, 0.041771143674850464, 0.11428947746753693, 0.15916679799556732, -0.005655887071043253, 0.06414886564016342, -0.02564152516424656, 0.17550872266292572, -0.08653263747692108, 0.00808650255203247, 0.021769732236862183, 0.07227233797311783, 0.20462079346179962, 0.07174231857061386, 0.05402345582842827, -0.06978221982717514, -0.1787872314453125, -0.004363529849797487, 0.10553988069295883, -0.024798357859253883, 0.015038726851344109, 0.006612069439142942, -0.15921369194984436, 0.024603700265288353, 0.09740288555622101, -0.041536346077919006, -0.2593335509300232, 0.11390509456396103, -0.033260442316532135, 0.11996231973171234, 0.07586817443370819, -0.08727533370256424, 0.07517880946397781, -0.029723383486270905, 0.05712142959237099, -0.12798930704593658, -0.08832845091819763, 0.0653814971446991, 0.058630794286727905, 0.07308066636323929, -0.05325356498360634, 0.027765756472945213, 0.19533288478851318, -0.19345253705978394, 0.06128830462694168, 0.10817258805036545, 0.26827019453048706, 0.0656304880976677, 0.004427325911819935, -0.12207090854644775, -0.13812360167503357, -0.1011647954583168, -0.0809222012758255, 0.03579051420092583, 0.13131672143936157, -0.01762835867702961, -0.06147226318717003, 0.08505106717348099, 0.025469940155744553, 0.10697533935308456, 0.30090370774269104, -0.11168494820594788, 0.11874283850193024, 0.14037491381168365, -0.08500805497169495, -0.014101620763540268, 0.13127130270004272, 0.08034192770719528, -0.09424635022878647, 0.17733077704906464, 0.10431571304798126, 0.05325353145599365, -0.039503250271081924, -0.01373475044965744, 0.14091035723686218, -0.0048939380794763565, 0.10968487709760666, -0.07421055436134338, 0.24513038992881775, -0.3184201121330261, -0.017392462119460106, 0.22900481522083282, 0.0366402305662632, -0.012413599528372288, -0.03365306928753853, -0.130238339304924, 0.09044435620307922, -0.19759653508663177, 0.0125565305352211, 0.1836898773908615, 0.172812357544899, -0.03067593090236187, -0.026386015117168427, -2.6286633894486404e-32, -0.09193204343318939, 0.031068461015820503, -0.05119330435991287, -0.012465089559555054, -0.12160813808441162, -0.14290079474449158, -0.04272757098078728, -0.16348998248577118, 0.1527150273323059, 0.12968750298023224, -0.01820778287947178, -0.027664117515087128, 0.06776722520589828, 0.03779013454914093, -0.01944330520927906, 0.04460277035832405, 0.11944647133350372, -0.005908798426389694, 0.04709230735898018, -0.12196244299411774, -0.15182273089885712, 0.19760200381278992, 0.18450112640857697, -0.0020739177707582712, -0.1978200078010559, 0.18180064857006073, -0.14987517893314362, -0.08458985388278961, -0.05861635133624077, -0.12133777886629105, -0.07305598258972168, -0.02709854766726494, -0.05100191757082939, -0.1128757894039154, -0.13933758437633514, -0.04701750725507736, -0.1512424796819687, -0.14073698222637177, 0.07354524731636047, 0.07199882715940475, -0.14384488761425018, 0.03951241821050644, 0.1925128549337387, -0.06617322564125061, 0.1304750144481659, 0.009082614444196224, 0.16741713881492615, 0.02641751430928707, 0.10569200664758682, -0.09896188974380493, 0.09248218685388565, -0.06903362274169922, -0.10225070267915726, 0.06335736066102982, -0.10535526275634766, -0.12914589047431946, 0.06942016631364822, 0.1027023196220398, -0.17919564247131348, 0.06295497715473175, 0.09208985418081284, 0.0962286964058876, -0.05945032089948654, -0.14758987724781036, 0.08173546195030212, -0.09979686886072159, 0.16081750392913818, -0.0578712522983551, 0.041214313358068466, -0.18714077770709991, -0.13828785717487335, 0.0833803340792656, 0.0133026959374547, 0.06428148597478867, -0.16188521683216095, -0.026168756186962128, -0.12377163767814636, -0.10687744617462158, -0.12467549741268158, 0.03769727796316147, -0.10550159215927124, 0.07590828090906143, 0.046235647052526474, 0.07314144819974899, 0.0303342267870903, -0.14653415977954865, 0.0059266285970807076, 0.04896583780646324, 0.016111943870782852, -0.09316989034414291, -0.01709970086812973, 0.25487303733825684, 0.06804879754781723, -0.17560182511806488, -0.06402672082185745, -0.18419012427330017, -0.11205769330263138, 0.05138808488845825, -0.0016992754535749555, -0.07642023265361786, 0.007173655554652214, -0.07807468622922897, 0.11544931679964066, 0.09742424637079239, 0.21840830147266388, 0.04689604043960571, 0.15917634963989258, 0.016392063349485397, -0.1837988793849945, -0.10944821685552597, -0.14652808010578156, 0.06558238714933395, 0.10908211022615433, 0.07966694235801697, 0.036655232310295105, -0.09752834588289261, -0.0175461545586586, 0.019069058820605278, 0.09431671351194382, 0.1608857959508896, -0.1811675876379013, -0.11450214684009552, -0.07199268788099289, 0.026264360174536705, -0.050630178302526474, 0.10473574697971344, -0.21011020243167877, -0.03423594310879707, -0.09373831003904343, -0.11879193037748337, -0.06380034238100052, -0.02332877553999424, 6.977287512199837e-7, -0.16848225891590118, -0.1409403681755066, -0.01025459449738264, 0.15385013818740845, -0.03539422154426575, 0.18805965781211853, -0.13510306179523468, -0.05999018996953964, 0.08719606697559357, 0.15771858394145966, 0.20538091659545898, -0.11974264681339264, 0.08449988067150116, -0.07911980897188187, 0.03931589797139168, -0.05395511910319328, -0.04965861141681671, 0.07680477201938629, -0.1277875453233719, 0.15257979929447174, -0.0610528402030468, 0.10146379470825195, 0.2443382740020752, -0.012807602994143963, -0.009080315008759499, -0.10433759540319443, -0.07026346772909164, 0.06851470470428467, -0.01947813294827938, -0.07272891700267792, 0.1908453404903412, 0.08777178078889847, -0.04775139316916466, 0.05683176591992378, -0.03579040616750717, -0.11690041422843933, -0.01874246634542942, 0.08914580941200256, -0.030586661770939827, 0.01577463373541832, -0.02218109369277954, 0.09103163331747055, 0.11673523485660553, -0.18582794070243835, 0.0029468608554452658, 0.046075720340013504, 0.09463850408792496, -0.14235471189022064, -0.05219675600528717, 0.039002303034067154, -0.0011720965849235654, 0.06483513116836548, 0.052429065108299255, 0.13664186000823975, 0.15662352740764618, -0.08796893060207367, -0.2873660922050476, -0.2518211007118225, 0.22811833024024963, 0.0004820867325179279, -0.20031245052814484, -0.12410996854305267, 0.1187460869550705, -0.11823809891939163, 0.10542330145835876, -0.24609403312206268, -0.16032429039478302, 5.424474228241063e-35, -0.011107534170150757, -0.06805378943681717, 0.06966738402843475, 0.10851698368787766, 0.0022340642753988504, -0.031137628480792046, -0.08447348326444626, -0.10009842365980148, 0.03275589272379875, -0.07126010954380035, -0.13213691115379333 ]
https://github.com/huggingface/datasets/issues/6221
Support saving datasets with custom formatting
Not a fan of pickling this sort of stuff either. Note that users can also share the code in their dataset documentation.
Requested in https://discuss.huggingface.co/t/using-set-transform-on-a-dataset-leads-to-an-exception/53036. I am not sure if supporting this is the best idea for the following reasons: >For this to work, we would have to pickle a custom transform, which means the transform and the objects it references need to be serializable. Also, deserializing these bytes would make `load_from_disk` unsafe, so I'm not sure this is a good idea. @lhoestq WDYT?
22
Support saving datasets with custom formatting Requested in https://discuss.huggingface.co/t/using-set-transform-on-a-dataset-leads-to-an-exception/53036. I am not sure if supporting this is the best idea for the following reasons: >For this to work, we would have to pickle a custom transform, which means the transform and the objects it references need to be serializable. Also, deserializing these bytes would make `load_from_disk` unsafe, so I'm not sure this is a good idea. @lhoestq WDYT? Not a fan of pickling this sort of stuff either. Note that users can also share the code in their dataset documentation.
[ -0.12711511552333832, 0.09501117467880249, 0.033526502549648285, 0.012183398008346558, 0.12035727500915527, -0.06455406546592712, 0.08131489902734756, 0.02997404709458351, -0.09422473609447479, -0.037836477160453796, -0.08235509693622589, 0.027737382799386978, -0.06663402915000916, 0.2502545118331909, 0.13005034625530243, -0.173636332154274, -0.15740935504436493, -0.007130574434995651, -0.12025760114192963, 0.14262838661670685, 0.019799312576651573, 0.04409027844667435, 0.22938768565654755, -0.015253846533596516, 0.07935694605112076, 0.04701322317123413, -0.003927838522940874, 0.17116867005825043, 0.0024159566964954138, -0.1889255791902542, 0.039083659648895264, 0.183699369430542, 0.1486327350139618, 0.13855858147144318, 0.000005571828751271823, 0.11343051493167877, -0.16587506234645844, -0.0881645530462265, -0.03239062428474426, 0.011372633278369904, 0.0717526376247406, -0.2009182870388031, 0.03251736983656883, -0.06006753817200661, -0.054048795253038406, 0.16132836043834686, 0.036292459815740585, -0.023334743455052376, 0.12189766019582748, -0.12800373136997223, 0.011831242591142654, 0.08006930351257324, -0.01729537919163704, -0.07166929543018341, -0.11036035418510437, 0.3600272536277771, -0.019654015079140663, 0.22335533797740936, -0.1799873411655426, 0.16846346855163574, -0.024337438866496086, -0.1438947468996048, 0.009464663453400135, -0.026968939229846, -0.015578683465719223, -0.13835996389389038, -0.3284018635749817, 0.0053005521185696125, 0.037550680339336395, 0.046201128512620926, 0.09144546836614609, -0.14866894483566284, -0.09175372868776321, -0.05087171867489815, 0.09421929717063904, -0.089449442923069, -0.12265902757644653, 0.03060091845691204, -0.12675516307353973, 0.004824064671993256, -0.08038649708032608, -0.10240773111581802, -0.08917104452848434, -0.07129684835672379, -0.07212069630622864, -0.08022809028625488, -0.1752287894487381, -0.02278011478483677, -0.1076168417930603, -0.05957471579313278, -0.09248417615890503, -0.01013391837477684, 0.04291283339262009, -0.0285683311522007, -0.0024780775420367718, -0.05253056436777115, -0.2650374174118042, 0.029085075482726097, 0.13910342752933502, 0.08517736941576004, 0.13230150938034058, 0.09492005407810211, -0.1004418209195137, -0.05269663408398628, 0.027069969102740288, -0.0011651919921860099, -0.12448571622371674, -0.1660449057817459, 0.1600935310125351, 0.023897984996438026, 0.011188804171979427, 0.1461387425661087, 0.0061156731098890305, -0.007010481785982847, -0.06089982017874718, 0.2070859968662262, -0.09910758584737778, 0.3053557872772217, 0.026402948424220085, -0.06369277089834213, 0.24203644692897797, 0.06869260221719742, -0.06450850516557693, 0.06305811554193497, 0.02755054272711277, -0.020837677642703056, 0.13285616040229797, 0.032932281494140625, 0.02593480609357357, -0.04209108650684357, 0.02511032670736313, -0.002946329303085804, 0.239711195230484, 0.01566072553396225, 0.09248900413513184, -0.13648778200149536, 0.10040520131587982, -0.12777940928936005, 0.050882380455732346, -0.07362204790115356, 0.1000894159078598, 0.16522814333438873, -0.05223363637924194, -0.05518154799938202, 0.06704072654247284, 0.005176604725420475, -0.042347293347120285, -0.04530760273337364, -0.11110209673643112, 0.12918519973754883, 0.143458291888237, 0.00866176187992096, -0.34892016649246216, 0.037852589040994644, -0.07731173932552338, -0.007593986578285694, -0.20137600600719452, -0.059495605528354645, -0.179250106215477, -0.17008213698863983, 0.06207592040300369, -0.11919983476400375, -0.0740753635764122, 0.02646782621741295, 0.1006421446800232, 0.16381461918354034, -0.06386218219995499, -0.060128770768642426, 0.12104208767414093, -0.0680226981639862, -0.024311203509569168, -0.15401385724544525, 0.03456808626651764, -0.27026376128196716, 0.003915987443178892, 0.292402446269989, -0.03422876074910164, 0.10346858948469162, -0.11446619033813477, -0.11496444046497345, 0.06546209007501602, -0.027159780263900757, 0.22714665532112122, 0.019782062619924545, 0.06728539615869522, -0.09490419179201126, -0.2270643264055252, 0.13054820895195007, -0.01725955121219158, 0.04259762912988663, -0.06621269136667252, -0.027038700878620148, 0.08318008482456207, -0.044078975915908813, -0.12203196436166763, 0.047136690467596054, -0.01833045482635498, 0.026800503954291344, 0.09543821960687637, -0.062395744025707245, -0.0676640197634697, 0.06447885185480118, 0.020419899374246597, -0.07375143468379974, -0.03264233097434044, 0.037162475287914276, -0.16348788142204285, -0.08653559535741806, -0.01613515056669712, -0.06732095032930374, 0.041902825236320496, 0.022329039871692657, -0.037634335458278656, -0.12850382924079895, -0.11323779076337814, -0.03718351572751999, -0.09170685708522797, -0.07932864874601364, -0.09103374183177948, 0.16623099148273468, -0.08990731835365295, 0.1296916902065277, 0.029044169932603836, -0.0059855119325220585, -0.013487165793776512, 0.06136414036154747, 0.12557871639728546, -0.17867788672447205, 0.08212880045175552, 0.06044341251254082, -0.04352123290300369, -0.13395795226097107, 0.10608579218387604, 0.1432691067457199, -0.09743741899728775, 0.016021158546209335, 0.022271152585744858, 0.05040338262915611, -0.006672610994428396, 0.09017495065927505, -0.033223919570446014, -0.013632223941385746, -0.14589625597000122, 0.020373577252030373, -0.018937576562166214, 0.1054341197013855, -0.09477674216032028, -0.007710782345384359, -0.08656853437423706, -0.0058683352544903755, 0.25702929496765137, 0.006297316402196884, -0.03653028979897499, -0.01903456822037697, -0.11354303359985352, -0.1873811036348343, 0.11733021587133408, 0.09136219322681427, -0.09189531207084656, -0.009639485739171505, 0.23577958345413208, 0.01979151740670204, 0.02917366661131382, 0.08186523616313934, 0.09107841551303864, -0.04088272526860237, 0.12410975247621536, -0.09988179057836533, -0.07016093283891678, 0.140549436211586, 0.051395200192928314, 0.030275186523795128, 0.0648876205086708, -0.07530486583709717, 0.1453334093093872, -0.2513526380062103, 0.04198388382792473, 0.05479244515299797, 0.1542513221502304, 0.09148622304201126, -0.21699969470500946, 0.16166795790195465, 0.03801268711686134, -0.12579628825187683, 0.005191382020711899, 0.05965065583586693, -0.0621337965130806, 0.157009094953537, -0.1262494921684265, -0.033159058541059494, -0.1471329629421234, -0.11763051897287369, 0.17802172899246216, -0.005586716812103987, 0.017433399334549904, -0.1438509225845337, 0.09210001677274704, 0.11837676167488098, -0.09395551681518555, -0.04791100323200226, -0.153402179479599, 0.0652768686413765, 0.16331331431865692, -0.041160207241773605, -0.09290491044521332, -0.02784006856381893, 0.2311006486415863, 0.025808697566390038, -0.06038208678364754, -0.1898527592420578, 0.01973496563732624, -0.0613681897521019, -0.030641600489616394, 0.01970127411186695, 0.13183017075061798, 0.11600609868764877, -0.10564151406288147, -0.10745174437761307, 0.09556914120912552, 0.11163260787725449, 0.004040184430778027, -0.015734639018774033, 0.05430397018790245, 0.17485938966274261, -0.0838189572095871, 0.1840267926454544, -0.14326392114162445, -0.2624087929725647, 0.2247142791748047, -0.06761541962623596, -0.014724169857800007, 0.133067786693573, 0.18215957283973694, -0.04661717638373375, 0.01667913980782032, -0.0377468504011631, -0.051756907254457474, -0.038578100502491, 0.061584606766700745, -0.06351838260889053, -0.10498321056365967, 0.01891808770596981, 0.054334696382284164, 0.06132732704281807, 0.03014937788248062, -0.12688836455345154, 0.07717389613389969, -0.1071229800581932, 0.049114227294921875, 0.05081053823232651, -0.0010082056978717446, 0.15782925486564636, -0.1308276355266571, -0.025906192138791084, 0.046380091458559036, -0.06946444511413574, -0.21001341938972473, 0.15941831469535828, -0.16710388660430908, 0.014658060856163502, -0.07987143844366074, 0.17893986403942108, -0.03950880095362663, -0.13811896741390228, -0.11177452653646469, 0.04444744065403938, 0.09383474290370941, 0.23596350848674774, -0.1679154336452484, -0.2721898853778839, 0.0570751316845417, -0.09610697627067566, -0.042883552610874176, 0.03180549666285515, -0.06741776317358017, 0.13205945491790771, 0.08094235509634018, -0.10741716623306274, 0.24068263173103333, 0.014358852058649063, -0.036085765808820724, -0.08954746276140213, -0.012626617215573788, -0.037429552525281906, 0.20738372206687927, 0.0404963456094265, -0.1608392894268036, 0.0926532968878746, -0.02435803785920143, 0.18806569278240204, -0.027676569297909737, -0.003150197910144925, 0.02112751081585884, -0.10696322470903397, 0.02907613478600979, -0.06680193543434143, -0.051939573138952255, -0.07367304712533951, 0.043408993631601334, -0.005432667210698128, 0.15435492992401123, -0.04381779953837395, 0.020594820380210876, -0.05845906212925911, 0.11464335024356842, -0.034483328461647034, 0.06071506813168526, 0.05666956678032875, 0.1481752097606659, -0.12571731209754944, -0.2015884816646576, 0.19376234710216522, -0.11812414228916168, -0.08332103490829468, -0.02394391968846321, -0.0650857612490654, -0.12947355210781097, 0.0014550520572811365, 0.11987298727035522, -0.1325646936893463, -0.21252155303955078, 0.010438426397740841, 0.1147865355014801, -0.05836184322834015, 0.12533651292324066, -0.05641372129321098, -0.1574581116437912, 0.007026225794106722, 0.03324723616242409, -0.05652105063199997, 0.059346284717321396, 0.19662871956825256, -0.09289833903312683, 0.004046511370688677, 0.07814512401819229, -0.12316165119409561, 0.173054501414299, -0.1773228794336319, -0.047188419848680496, -0.198061004281044, -0.06398274004459381, 0.13199292123317719, 0.14624197781085968, 0.029543383046984673, -0.05811203271150589, -0.028562869876623154, -0.06717251241207123, -0.222357377409935, 0.07617919147014618, -0.04055576026439667, -0.3137574791908264, -0.012462382204830647, -0.17944765090942383, 0.25850605964660645, 0.017740190029144287, 0.05672095715999603, -0.15911871194839478, 0.19990500807762146, -0.03263482823967934, 0.10699979215860367, 0.08469323813915253, -0.05353306978940964, -0.06936611980199814, 0.18056079745292664, -0.08687356859445572, -0.048755135387182236, 0.30647358298301697, 0.04830125346779823, -0.0879831463098526, -0.016933482140302658, 0.09299691021442413, -0.03899296745657921, -0.03671925887465477, 0.031357958912849426, 0.06417602300643921, -0.1542992889881134, -0.029168153181672096, 0.010884135030210018, -0.06664395332336426, 0.006174576934427023, 0.09453680366277695, -0.005672848783433437, -0.017067980021238327, -0.12254435569047928, 0.08675046265125275, 0.041440799832344055, -0.22037763893604279, 0.05343010649085045, -0.16951999068260193, 0.20554476976394653, -0.04388158395886421, -0.12312638014554977, -0.0734558030962944, 0.056383002549409866, -0.0790301263332367, -0.00962645374238491, 0.0666668564081192, 0.19263608753681183, -0.09246555715799332, 0.01335409376770258, -0.12653778493404388, -0.02507597580552101, 0.016334138810634613, -0.057783450931310654, 0.062482044100761414, -0.027594534680247307, 0.055921003222465515, 0.14029093086719513, 0.10732238739728928, 0.17874708771705627, 0.053429339081048965, 0.014797291718423367, 0.04018902778625488, 0.027643149718642235, 0.02129000797867775, -0.1446719616651535, -0.13258500397205353, -0.04128948599100113, -0.01906099170446396, -0.0854194238781929, 0.00509941391646862, -0.08554184436798096, 0.11030063778162003, -0.08717430382966995, 0.09910830110311508, 0.1691693365573883, -0.025706147775053978, -0.1861962378025055, -0.07972458750009537, -0.06008834019303322, 0.0756099745631218, 0.10122889280319214, 0.10090038180351257, -0.052563365548849106, -0.12646472454071045, 0.011061951518058777, 0.13096757233142853, -0.06891016662120819, 0.11428829282522202, -0.05691450461745262, -0.022306926548480988, -0.26515457034111023, -0.04495660588145256, 0.012324690818786621, -0.06615720689296722, -0.05483106151223183, 0.050597067922353745, -0.13287270069122314, -0.07967253029346466, -0.015875404700636864, 0.1545233130455017, 0.06551790237426758, 0.158226877450943, -0.15052226185798645, -0.015640106052160263, -2.714933213729076e-32, 0.053592391312122345, 0.047579675912857056, -0.1585455685853958, 0.11740202456712723, 0.051850419491529465, -0.1636248081922531, -0.10749564319849014, -0.05641666799783707, 0.1294442117214203, -0.13163524866104126, 0.013734848238527775, -0.11385700851678848, 0.03698604181408882, 0.15607032179832458, -0.01937860995531082, -0.07741047441959381, -0.009465391747653484, -0.06484922766685486, 0.016367658972740173, -0.07022267580032349, 0.1876884251832962, -0.10645809024572372, 0.12835916876792908, -0.10189800709486008, -0.0221894308924675, 0.018528541550040245, -0.10158439725637436, -0.01875724457204342, 0.07251019775867462, 0.1793746054172516, -0.07299890369176865, 0.025941846892237663, 0.05047648772597313, 0.13912507891654968, 0.027503248304128647, 0.05630384385585785, -0.04902311787009239, 0.07989241182804108, -0.21132974326610565, -0.1174071729183197, -0.022837189957499504, 0.07087033987045288, -0.0747596025466919, 0.019785091280937195, 0.039110295474529266, 0.16626687347888947, -0.07581066340208054, 0.01502093207091093, 0.06677316874265671, 0.008456448093056679, 0.013968486338853836, -0.029450558125972748, 0.07202726602554321, 0.010173170827329159, 0.12401560693979263, -0.06188149377703667, 0.1364101618528366, -0.04246852546930313, -0.06313612312078476, -0.010695381090044975, 0.03766900673508644, -0.13775022327899933, -0.03802134841680527, 0.046139705926179886, 0.07713210582733154, 0.0629250556230545, 0.05931206792593002, 0.04379706457257271, 0.07407349348068237, 0.0012044456088915467, 0.12687186896800995, 0.08583272993564606, 0.06125909835100174, 0.11476337909698486, -0.16590139269828796, -0.014984706416726112, 0.020433830097317696, 0.04335890710353851, -0.07608591765165329, -0.26598289608955383, -0.07413887232542038, -0.011747949756681919, 0.17822086811065674, -0.0196553785353899, 0.04817276448011398, 0.09270225465297699, 0.05211961269378662, -0.01831776648759842, 0.04589981213212013, -0.0298539437353611, -0.10255490243434906, 0.11012145131826401, -0.051058731973171234, 0.040539178997278214, -0.12730583548545837, -0.01759639009833336, -0.13496321439743042, 0.08802828937768936, -0.0311493631452322, -0.05331746116280556, 0.0840643122792244, -0.1047743633389473, 0.16798914968967438, 0.06009962409734726, 0.08425656706094742, 0.08871230483055115, 0.24932119250297546, 0.15095755457878113, -0.28090253472328186, 0.064521923661232, 0.03162137046456337, 0.16439853608608246, 0.005424251314252615, -0.025205615907907486, 0.20520511269569397, -0.08760005235671997, 0.002922062762081623, -0.038535233587026596, 0.06476666033267975, 0.05690387263894081, -0.18592914938926697, -0.11160390824079514, 0.1144375205039978, 0.12641461193561554, 0.07425745576620102, -0.06406345963478088, -0.013922234997153282, 0.011582840234041214, 0.13426798582077026, 0.05652451887726784, 0.00856141559779644, -0.21420623362064362, 7.35027299469948e-7, -0.015670400112867355, 0.22965268790721893, 0.0811537653207779, -0.07805570214986801, 0.0047974358312785625, 0.17815497517585754, -0.1314830482006073, 0.06958281993865967, 0.1318320482969284, 0.10334554314613342, 0.061508659273386, -0.10405612736940384, 0.012338180094957352, 0.028360743075609207, 0.001079547917470336, 0.0013632344780489802, -0.09033305197954178, -0.021896563470363617, -0.09028152376413345, 0.05323832109570503, 0.1724812239408493, 0.13859227299690247, 0.06916544586420059, -0.03177832067012787, 0.057250045239925385, 0.15905994176864624, 0.15220698714256287, -0.09144339710474014, 0.12330801784992218, -0.1816292554140091, -0.044910676777362823, 0.11758285015821457, -0.010012771934270859, 0.07663178443908691, -0.13407966494560242, -0.11046987026929855, -0.020641876384615898, 0.16138261556625366, -0.11473696678876877, 0.03365986421704292, 0.10212749242782593, 0.11405757814645767, -0.028629647567868233, -0.10542720556259155, 0.04501016438007355, 0.01110082771629095, -0.17937661707401276, 0.002581255277618766, -0.008312845602631569, 0.1256476491689682, -0.04541029781103134, -0.15240329504013062, 0.0037070526741445065, 0.1858111470937729, -0.013249438256025314, 0.13458313047885895, -0.09155597537755966, 0.03037387691438198, 0.038658857345581055, 0.018579745665192604, -0.0007193185156211257, -0.05657871812582016, -0.13191458582878113, -0.05840548872947693, 0.07269260287284851, -0.07497820258140564, 0.07548771053552628, 4.329134013259841e-34, -0.08024383336305618, 0.04732001945376396, 0.01599324494600296, 0.03119109943509102, -0.08565238118171692, -0.025090912356972694, 0.2489435374736786, 0.06355345249176025, 0.08111705631017685, -0.07863546907901764, -0.062001168727874756 ]
https://github.com/huggingface/datasets/issues/6217
`Dataset.to_dict()` ignore `decode=True` with Image feature
We need to implement the `Image` type as a PyArrow extension type (to allow us to override the Python conversion) for this to work as expected. For now, it's best to use your approach indeed.
### Describe the bug `Dataset.to_dict` seems to ignore the decoding instruction passed in features. ### Steps to reproduce the bug ```python import datasets import numpy as np from PIL import Image img = np.random.randint(0, 256, (5, 5, 3), dtype=np.uint8) img = Image.fromarray(img) features = datasets.Features({"image": datasets.Image(decode=True)}) dataset = datasets.Dataset.from_dict({"image": [img]}, features=features) print({key: dataset[key] for key in dataset.column_names}) # {'image': [<PIL.PngImagePlugin.PngImageFile image mode=RGB size=5x5 at 0x7EFBC80E15B0>]} print(dataset.to_dict()) # {'image': [{'bytes': b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x05\x00\x00\x00\x05\x08\x02\x00\x00\x00\x02\r\xb1\xb2\x00\x00\x00[IDATx\x9c\x01P\x00\xaf\xff\x01\x13\x1b<7\xe7\xe0\xdc^6\xed\x04\xc7M\xd2\x9f\x00X\x1b\xb0?\x1ba\x15\xc5 o\xd0\x80\xbe\x19/\x01\xec\x95\x1f\x9f\xffj\xfa1\xa7\xc4X\xea\xbe\xa4g\x00\xc4\x15\xdeC\xc7 \xbbaqe\xc8\xb9\xa9q\xe7\x00,?M\xc0)\xdaD`}\xb1\xdci\x1e\xafC\xa9]%.@\xa6\xf0\xb3\x00\x00\x00\x00IEND\xaeB`\x82', 'path': None}]} ``` ### Expected behavior I would expect `{key: dataset[key] for key in dataset.column_names}` and `dataset.to_dict()` to be equivalent. If the previous behavior is expected, then it should be stated [in the doc](https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset.to_dict). ### Environment info - `datasets` version: 2.14.4 - Platform: Linux-6.2.0-31-generic-x86_64-with-glibc2.35 - Python version: 3.9.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 - Pillow 9.5.0 - numpy 1.25.2
35
`Dataset.to_dict()` ignore `decode=True` with Image feature ### Describe the bug `Dataset.to_dict` seems to ignore the decoding instruction passed in features. ### Steps to reproduce the bug ```python import datasets import numpy as np from PIL import Image img = np.random.randint(0, 256, (5, 5, 3), dtype=np.uint8) img = Image.fromarray(img) features = datasets.Features({"image": datasets.Image(decode=True)}) dataset = datasets.Dataset.from_dict({"image": [img]}, features=features) print({key: dataset[key] for key in dataset.column_names}) # {'image': [<PIL.PngImagePlugin.PngImageFile image mode=RGB size=5x5 at 0x7EFBC80E15B0>]} print(dataset.to_dict()) # {'image': [{'bytes': b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x05\x00\x00\x00\x05\x08\x02\x00\x00\x00\x02\r\xb1\xb2\x00\x00\x00[IDATx\x9c\x01P\x00\xaf\xff\x01\x13\x1b<7\xe7\xe0\xdc^6\xed\x04\xc7M\xd2\x9f\x00X\x1b\xb0?\x1ba\x15\xc5 o\xd0\x80\xbe\x19/\x01\xec\x95\x1f\x9f\xffj\xfa1\xa7\xc4X\xea\xbe\xa4g\x00\xc4\x15\xdeC\xc7 \xbbaqe\xc8\xb9\xa9q\xe7\x00,?M\xc0)\xdaD`}\xb1\xdci\x1e\xafC\xa9]%.@\xa6\xf0\xb3\x00\x00\x00\x00IEND\xaeB`\x82', 'path': None}]} ``` ### Expected behavior I would expect `{key: dataset[key] for key in dataset.column_names}` and `dataset.to_dict()` to be equivalent. If the previous behavior is expected, then it should be stated [in the doc](https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset.to_dict). ### Environment info - `datasets` version: 2.14.4 - Platform: Linux-6.2.0-31-generic-x86_64-with-glibc2.35 - Python version: 3.9.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 - Pillow 9.5.0 - numpy 1.25.2 We need to implement the `Image` type as a PyArrow extension type (to allow us to override the Python conversion) for this to work as expected. For now, it's best to use your approach indeed.
[ 0.006938788574188948, 0.174382284283638, -0.05370401218533516, 0.12760767340660095, 0.23835155367851257, 0.16491413116455078, 0.051743943244218826, -0.06727130711078644, -0.08581245690584183, 0.1509636789560318, 0.05625117942690849, -0.02332257479429245, 0.028944510966539383, 0.06977003067731857, -0.021832147613167763, 0.07148385047912598, 0.025176940485835075, -0.017936551943421364, -0.031949520111083984, -0.07910438627004623, -0.21061702072620392, 0.05515209957957268, 0.046101927757263184, 0.03770905360579491, 0.0003583392535801977, -0.09052419662475586, -0.023006031289696693, 0.21192558109760284, -0.12924662232398987, -0.024244366213679314, 0.007539470214396715, 0.0834527537226677, -0.027517512440681458, -0.02945924550294876, 0.000005273735041555483, 0.08399472385644913, 0.2738977372646332, -0.14339524507522583, -0.041092973202466965, -0.08005460351705551, 0.024600708857178688, -0.1491239070892334, 0.06469912827014923, -0.14022749662399292, -0.06400694698095322, -0.07652384787797928, 0.17703916132450104, 0.09702055156230927, 0.03808247670531273, 0.03446417674422264, -0.06436894834041595, 0.015206843614578247, -0.011760908178985119, -0.13353966176509857, 0.031025134027004242, 0.06976251304149628, 0.056699540466070175, -0.003654391737654805, -0.44606247544288635, 0.035093072801828384, -0.05390369892120361, -0.08266421407461166, -0.07528604567050934, 0.0864739939570427, -0.18373596668243408, 0.011708809062838554, -0.10912538319826126, -0.256447434425354, -0.020847145467996597, 0.05865266174077988, -0.005217575002461672, 0.044911906123161316, -0.11850064247846603, 0.016979537904262543, -0.031240614131093025, -0.033427633345127106, 0.046590499579906464, -0.011857707984745502, 0.05554858222603798, 0.18576782941818237, 0.02331671118736267, 0.05146680772304535, 0.025156382471323013, 0.01817028410732746, -0.2962721586227417, -0.03864257410168648, -0.1491830199956894, 0.12670226395130157, -0.10726454108953476, 0.028659280389547348, -0.061988282948732376, 0.04113943129777908, -0.06781914085149765, -0.19121840596199036, 0.09647373110055923, 0.012078041210770607, -0.008154387585818768, -0.11959557235240936, 0.11023623496294022, -0.1047046035528183, -0.13493284583091736, 0.012727302499115467, -0.1367352157831192, 0.11184518784284592, 0.008078979328274727, -0.04779147729277611, -0.09636873751878738, 0.08198174089193344, 0.08018147945404053, 0.01135630439966917, -0.08158817142248154, 0.12339380383491516, 0.044349949806928635, 0.03677725791931152, 0.15655216574668884, -0.025779247283935547, 0.17403854429721832, 0.06231389567255974, -0.10351009666919708, 0.1630934327840805, 0.09239690005779266, 0.15104524791240692, -0.07196812331676483, 0.054165955632925034, 0.07242532074451447, 0.15930168330669403, 0.07878474146127701, 0.038615256547927856, -0.02718203142285347, 0.019678886979818344, -0.03842969238758087, -0.05064960569143295, 0.032907143235206604, -0.13987994194030762, 0.054387953132390976, -0.008018061518669128, 0.016573555767536163, -0.11634170264005661, 0.1501091569662094, -0.06814606487751007, -0.012360962107777596, -0.03654903173446655, 0.25760185718536377, 0.06500835716724396, 0.039367616176605225, 0.06979499012231827, 0.14496320486068726, -0.14797843992710114, -0.018134569749236107, 0.026169514283537865, -0.22766530513763428, 0.29559725522994995, -0.24407848715782166, 0.021586919203400612, -0.11640673130750656, 0.05914447456598282, -0.0013028642861172557, 0.08545418083667755, -0.1836753934621811, -0.07600110024213791, 0.018480127677321434, -0.04344012960791588, -0.09058055281639099, -0.08711545169353485, 0.05831997096538544, 0.13192535936832428, -0.013484318740665913, -0.08512304723262787, -0.07878482341766357, -0.16190768778324127, 0.29608532786369324, -0.060904696583747864, -0.01757877692580223, -0.219938263297081, -0.06846164911985397, 0.22251196205615997, -0.08605580776929855, -0.034324198961257935, -0.2701631188392639, -0.03814035654067993, 0.06953857839107513, 0.016825731843709946, 0.11227574944496155, -0.14075560867786407, 0.16619759798049927, -0.07408493012189865, -0.05375587195158005, 0.09478451311588287, -0.04814010486006737, 0.013849453069269657, 0.04818160459399223, 0.005969926714897156, 0.2099461853504181, 0.04486250504851341, -0.011472834274172783, -0.07502639293670654, -0.04995838552713394, 0.022392423823475838, 0.003912017680704594, -0.09919726848602295, -0.019917165860533714, -0.12608200311660767, 0.012784622609615326, -0.031183019280433655, 0.07785481214523315, 0.07037767767906189, -0.16379106044769287, 0.12240235507488251, 0.05793404206633568, -0.06015969440340996, -0.2472010999917984, 0.05835217237472534, 0.056163087487220764, -0.02855517901480198, -0.1790584772825241, -0.1284753680229187, -0.0040263403207063675, -0.06687751412391663, -0.09744998812675476, 0.12340150028467178, -0.11474672704935074, 0.2072761207818985, 0.06283421069383621, 0.053894124925136566, 0.11068259924650192, 0.00785847008228302, -0.02331303060054779, 0.059152938425540924, -0.11993935704231262, 0.05902155861258507, 0.0026699600275605917, -0.10570432990789413, 0.1373027265071869, 0.12939578294754028, 0.0885142982006073, -0.07635948807001114, -0.06663201749324799, -0.27529045939445496, 0.11421924829483032, -0.08252216130495071, -0.12473589181900024, 0.15025167167186737, -0.057476431131362915, 0.04070644453167915, 0.10240283608436584, 0.08430889993906021, 0.041991230100393295, 0.14571857452392578, -0.1019834503531456, -0.013556097634136677, 0.2660524845123291, 0.10398712009191513, -0.12334883213043213, -0.14982466399669647, -0.1099618524312973, -0.1502067893743515, 0.025970574468374252, 0.09718120843172073, 0.08758362382650375, 0.010704618878662586, 0.4400355815887451, 0.026628728955984116, 0.04671459272503853, -0.0296188835054636, 0.15593641996383667, -0.05574367195367813, -0.00762202451005578, 0.05501975864171982, -0.1295662224292755, 0.05128319188952446, 0.11625850200653076, 0.033947259187698364, -0.06581137329339981, 0.07823885977268219, -0.11191048473119736, -0.0716550424695015, -0.0290059894323349, -0.020575838163495064, 0.09267228841781616, 0.0158053208142519, -0.16957302391529083, 0.08261501789093018, 0.08091893047094345, -0.1502412110567093, 0.08811188489198685, 0.18730847537517548, -0.20738932490348816, -0.11375889927148819, 0.05241987481713295, 0.19006365537643433, -0.006995330099016428, -0.0960245206952095, -0.05640759691596031, -0.20187337696552277, 0.0017462657997384667, -0.08858951926231384, -0.13358791172504425, -0.10886075347661972, -0.0029408354312181473, -0.13290902972221375, -0.07226598262786865, 0.12180338054895401, 0.10335315763950348, -0.05387398973107338, -0.02273329719901085, -0.05232417210936546, 0.12794135510921478, 0.0038613765500485897, -0.2754512131214142, -0.017620807513594627, -0.07074663788080215, 0.042439211159944534, -0.09789043664932251, 0.12061140686273575, 0.03606463223695755, -0.02098066173493862, -0.1456446647644043, -0.14270856976509094, 0.16031228005886078, 0.17763209342956543, -0.18473511934280396, 0.055404502898454666, -0.020657744258642197, 0.032722678035497665, 0.003713649930432439, 0.11231610924005508, -0.04464675858616829, -0.08045535534620285, 0.05479535087943077, 0.041181426495313644, -0.014155566692352295, 0.09768624603748322, -0.1501098871231079, -0.0683944895863533, 0.14761899411678314, -0.020235879346728325, -0.20107954740524292, 0.16952991485595703, 0.20409497618675232, 0.10817360877990723, -0.08646489679813385, 0.08684798330068588, -0.03899836540222168, -0.01490324642509222, 0.10160116106271744, -0.23077109456062317, -0.06589973717927933, -0.12249598652124405, 0.16637402772903442, 0.06864045560359955, -0.09712059050798416, 0.04242904856801033, 0.012433933094143867, -0.04572932422161102, -0.08095084875822067, 0.14576618373394012, -0.18755985796451569, 0.17768357694149017, -0.14414381980895996, 0.009620090015232563, 0.034414008259773254, 0.09942972660064697, -0.08516571670770645, -0.04186404123902321, 0.013148857280611992, 0.23633448779582977, 0.21447674930095673, 0.2920309901237488, -0.00032479589572176337, -0.10284748673439026, 0.015294963493943214, -0.011231540702283382, -0.11009928584098816, -0.11236822605133057, -0.011655041016638279, -0.10531634837388992, 0.02247188426554203, -0.14105083048343658, 0.028419483453035355, 0.06497173756361008, -0.1310320496559143, -0.3049239218235016, -0.12452046573162079, 0.025826117023825645, 0.1688113957643509, 0.09743068367242813, -0.033682793378829956, -0.06118262931704521, -0.011820145882666111, 0.22339123487472534, 0.048990193754434586, 0.09709537029266357, -0.13225501775741577, -0.07986919581890106, 0.021886877715587616, -0.08433233946561813, 0.2344607561826706, 0.05570196360349655, 0.02779439464211464, -0.022221507504582405, 0.04752099886536598, 0.19929954409599304, -0.03710528090596199, 0.03461394086480141, 0.1471642255783081, 0.009841937571763992, 0.31870394945144653, -0.11035753041505814, 0.12220675498247147, 0.05444209277629852, -0.12876616418361664, 0.07715563476085663, 0.008727991953492165, 0.07267636060714722, 0.23887790739536285, 0.04491511359810829, -0.19208946824073792, 0.0705033540725708, -0.060352545231580734, -0.3545796573162079, -0.14215385913848877, -0.15383696556091309, 0.15962371230125427, 0.11435893923044205, -0.042348820716142654, 0.03564581274986267, -0.09270614385604858, 0.042467888444662094, 0.02105817385017872, 0.0947287306189537, 0.17607948184013367, -0.20030678808689117, 0.010998341254889965, 0.023885453119874, 0.09755343943834305, -0.08287673443555832, 0.27879223227500916, -0.025256624445319176, -0.20863693952560425, -0.08891508728265762, -0.1908239722251892, 0.05351413041353226, -0.1833607256412506, -0.24064290523529053, 0.10677526891231537, -0.08676343411207199, -0.10766662657260895, -0.1437661349773407, 0.024120405316352844, 0.1023796945810318, -0.17042961716651917, -0.019012127071619034, -0.11174307018518448, -0.002320165978744626, 0.07182642072439194, 0.07733453810214996, 0.03379714861512184, -0.17656309902668, 0.03214495629072189, 0.16688019037246704, -0.03990684822201729, -0.06968282908201218, -0.08908834308385849, 0.13367964327335358, -0.05200694128870964, 0.05039578676223755, 0.21639005839824677, -0.017955398187041283, 0.04272446781396866, 0.08108285069465637, -0.20321114361286163, -0.010803231038153172, -0.032399460673332214, 0.03786732628941536, 0.014535382390022278, -0.01901129260659218, 0.015545069240033627, -0.08213303983211517, -0.12269521504640579, 0.09699007868766785, 0.05835561454296112, -0.06096601486206055, 0.11095134913921356, -0.013951833359897137, 0.03250670060515404, 0.16276675462722778, -0.024877922609448433, -0.015925046056509018, -0.15125925838947296, 0.052258510142564774, -0.009546124376356602, -0.10272016376256943, 0.024814017117023468, 0.08087234944105148, -0.04153360426425934, 0.0673452690243721, -0.029579443857073784, 0.0942930281162262, 0.060502249747514725, 0.0954286977648735, 0.08222994208335876, -0.05048825964331627, 0.11126267910003662, -0.016713591292500496, 0.08400607109069824, -0.14759701490402222, 0.007414857856929302, 0.062349192798137665, -0.03625176474452019, -0.0027042950969189405, 0.0529925711452961, 0.10208618640899658, -0.016429370269179344, 0.03576729819178581, -0.018375035375356674, -0.13199388980865479, -0.09622136503458023, 0.04491892829537392, 0.08339326083660126, -0.08673910051584244, 0.05825495347380638, -0.01480050291866064, 0.07186117023229599, -0.14125728607177734, 0.04376860335469246, 0.0623081736266613, 0.022043077275156975, -0.07291990518569946, 0.15063394606113434, 0.23609372973442078, 0.07962918281555176, 0.07187703251838684, 0.0839068666100502, -0.10878021270036697, 0.0930575579404831, -0.02141837403178215, 0.09786463528871536, -0.03239113837480545, 0.028397412970662117, 0.11402325332164764, 0.15217502415180206, -0.3141361176967621, -0.20738153159618378, 0.023140428587794304, 0.18557623028755188, -0.02628776617348194, -0.14010876417160034, -0.11261573433876038, 0.04696640744805336, -0.11030145734548569, -0.05842532962560654, 0.09933416545391083, 0.08819018304347992, 0.02765084244310856, -0.15607793629169464, -2.5340587224736995e-32, 0.06429468840360641, -0.056095000356435776, -0.05047178268432617, -0.008233091793954372, 0.07397598773241043, 0.040045756846666336, 0.005871979985386133, -0.04529980942606926, 0.009590727277100086, 0.09656500071287155, -0.04193262755870819, 0.14531727135181427, 0.08406347781419754, 0.06746038794517517, -0.03442582115530968, -0.047073397785425186, -0.0025336204562336206, -0.11841679364442825, 0.05191684514284134, 0.03671114146709442, 0.09710371494293213, -0.017910286784172058, 0.09768014401197433, -0.007873615249991417, -0.012634155340492725, 0.0484868548810482, -0.025480499491095543, -0.24325911700725555, 0.11707202345132828, 0.0035620222333818674, -0.08786465227603912, 0.05347761884331703, 0.11900005489587784, 0.0037125092931091785, -0.17980068922042847, -0.14652156829833984, -0.23897641897201538, -0.0030371055472642183, -0.04414216801524162, -0.038201335817575455, -0.019719606265425682, 0.06059974431991577, 0.15733972191810608, -0.05133944749832153, -0.084989994764328, -0.01644860953092575, -0.07579731941223145, -0.01893138699233532, -0.10061414539813995, -0.027613677084445953, 0.07706429064273834, -0.0018249433487653732, -0.02655666321516037, 0.042750485241413116, 0.08586986362934113, -0.1836068332195282, 0.09225180745124817, 0.09878502786159515, -0.08290575444698334, 0.10516034811735153, 0.20962607860565186, 0.024223504588007927, 0.03038690611720085, -0.10136670619249344, 0.03273944556713104, -0.008217396214604378, 0.47563159465789795, 0.025769010186195374, 0.1718498170375824, 0.00782360602170229, -0.004022650886327028, 0.0746583417057991, -0.13376887142658234, 0.07093053311109543, 0.05506787821650505, -0.048443228006362915, -0.14601626992225647, -0.06687036156654358, -0.2660781145095825, -0.061010364443063736, -0.010404030792415142, -0.0679740458726883, 0.06509571522474289, -0.04769107326865196, -0.020136481150984764, 0.1478501409292221, -0.00500908400863409, -0.03611993417143822, -0.10208233445882797, -0.08002562820911407, -0.14467105269432068, 0.18880502879619598, -0.03769339248538017, -0.150044247508049, -0.010770367458462715, 0.19252830743789673, -0.1559899002313614, 0.16062018275260925, -0.10493068397045135, -0.017908437177538872, 0.05219365656375885, 0.0015701676020398736, 0.1841559261083603, -0.07509451359510422, 0.1680738776922226, -0.04212469235062599, 0.009691967628896236, 0.031034735962748528, -0.0911460816860199, -0.10791312158107758, -0.1158962994813919, 0.005751441698521376, 0.08944594115018845, 0.1806255728006363, 0.23697078227996826, -0.11428329348564148, 0.03646226227283478, -0.15142464637756348, 0.08602988719940186, 0.07553006708621979, -0.04219088330864906, -0.12210751324892044, -0.04346506670117378, 0.029959244653582573, 0.00015733251348137856, 0.015484343282878399, -0.2320350855588913, -0.10691022872924805, 0.04424658417701721, 0.05097774788737297, 0.01152696181088686, 0.13140952587127686, 7.448841756740876e-7, -0.11367830634117126, 0.04758434370160103, 0.09391412138938904, 0.1485409438610077, 0.054345495998859406, 0.19600853323936462, -0.2050035297870636, 0.05404967814683914, 0.004286146257072687, -0.05063465237617493, 0.15275056660175323, -0.11064722388982773, -0.06341871619224548, -0.11403115838766098, 0.2128911316394806, -0.07285855710506439, 0.0709734857082367, 0.009226806461811066, -0.08878547698259354, -0.16464924812316895, 0.14992104470729828, 0.04518337920308113, -0.18763306736946106, -0.1888396441936493, 0.15020523965358734, 0.03573087602853775, -0.07926273345947266, -0.025846293196082115, 0.047058310359716415, -0.11594799906015396, -0.0724029466509819, -0.01011883094906807, 0.04415314272046089, 0.17229712009429932, -0.11041953414678574, -0.11318524181842804, -0.16735388338565826, 0.09605319052934647, -0.14063984155654907, -0.10404390096664429, -0.10423684865236282, 0.0010267503093928099, 0.008465653285384178, 0.06332539767026901, 0.12393190711736679, 0.14235569536685944, -0.08620233088731766, -0.03690353035926819, -0.038828395307064056, 0.1758759319782257, -0.0022929178085178137, 0.007956629619002342, 0.04134625196456909, 0.13618287444114685, 0.06422721594572067, -0.05999515578150749, -0.031233184039592743, -0.26325178146362305, 0.14937818050384521, -0.020436827093362808, -0.023624734953045845, -0.12410666048526764, -0.06001435965299606, 0.10212305188179016, 0.0744754746556282, -0.06930343806743622, 0.06905969977378845, 1.3255038455821496e-34, -0.11144091188907623, -0.03174808621406555, 0.07452169805765152, 0.05747474357485771, -0.03923661261796951, -0.09429942071437836, 0.13789016008377075, 0.09158571809530258, -0.05751172825694084, 0.020742377266287804, -0.07355804741382599 ]
https://github.com/huggingface/datasets/issues/6212
Tilde (~) is not supported for data_files
Hi @exs-avianello, is it really needed? Note you can alternatively use `pathlib.Path` among others as it follows: ```python import datasets from pathlib import Path # save a parquet file at ~/path/to/data.parquet data_files = Path.home() / "path/to/data.parquet" dataset = datasets.load_dataset("parquet", data_files=data_files) ```
### Describe the bug Attempting to `load_dataset` from a path starting with `~` (as a shorthand for the user's home directory) seems not to be fully working - at least as far as the `parquet` dataset builder is concerned. (the same file can be loaded correctly if providing its absolute path instead) I think that this is very similar to https://github.com/huggingface/datasets/issues/5757, but for `data_files` rather than `data_dir` ### Steps to reproduce the bug ```python import datasets # save a parquet file at ~/path/to/data.parquet data_files = "~/path/to/data.parquet" dataset = datasets.load_dataset("parquet", data_files=data_files) ``` ``` Downloading data files: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 12671.61it/s] Extracting data files: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 22671.91it/s] Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1949, in _prepare_split_single num_examples, num_bytes = writer.finalize() ^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/datasets/arrow_writer.py", line 598, in finalize raise SchemaInferenceError("Please pass `features` or at least one example when writing data") datasets.arrow_writer.SchemaInferenceError: Please pass `features` or at least one example when writing data The above exception was the direct cause of the following exception: Traceback (most recent call last): File ".venv/lib/python3.11/site-packages/datasets/load.py", line 2133, in load_dataset builder_instance.download_and_prepare( File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1813, in _prepare_split for job_id, done, content in self._prepare_split_single( File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1958, 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 Can use `~` shorthand in paths when loading local (parquet) datasets. ### Environment info `datasets 2.14.3`
41
Tilde (~) is not supported for data_files ### Describe the bug Attempting to `load_dataset` from a path starting with `~` (as a shorthand for the user's home directory) seems not to be fully working - at least as far as the `parquet` dataset builder is concerned. (the same file can be loaded correctly if providing its absolute path instead) I think that this is very similar to https://github.com/huggingface/datasets/issues/5757, but for `data_files` rather than `data_dir` ### Steps to reproduce the bug ```python import datasets # save a parquet file at ~/path/to/data.parquet data_files = "~/path/to/data.parquet" dataset = datasets.load_dataset("parquet", data_files=data_files) ``` ``` Downloading data files: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 12671.61it/s] Extracting data files: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 22671.91it/s] Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1949, in _prepare_split_single num_examples, num_bytes = writer.finalize() ^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/datasets/arrow_writer.py", line 598, in finalize raise SchemaInferenceError("Please pass `features` or at least one example when writing data") datasets.arrow_writer.SchemaInferenceError: Please pass `features` or at least one example when writing data The above exception was the direct cause of the following exception: Traceback (most recent call last): File ".venv/lib/python3.11/site-packages/datasets/load.py", line 2133, in load_dataset builder_instance.download_and_prepare( File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1813, in _prepare_split for job_id, done, content in self._prepare_split_single( File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1958, 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 Can use `~` shorthand in paths when loading local (parquet) datasets. ### Environment info `datasets 2.14.3` Hi @exs-avianello, is it really needed? Note you can alternatively use `pathlib.Path` among others as it follows: ```python import datasets from pathlib import Path # save a parquet file at ~/path/to/data.parquet data_files = Path.home() / "path/to/data.parquet" dataset = datasets.load_dataset("parquet", data_files=data_files) ```
[ -0.011025157757103443, 0.09693898260593414, -0.0020891365129500628, 0.0770537331700325, 0.20974020659923553, -0.04316243529319763, 0.055757224559783936, 0.11183453351259232, -0.12083771079778671, -0.06644436717033386, 0.04532736912369728, -0.15449176728725433, -0.1312909871339798, 0.06220376119017601, 0.05873793736100197, -0.08783240616321564, 0.0252255667001009, 0.04480493441224098, -0.15198858082294464, -0.06033353880047798, -0.0931495651602745, 0.03385481983423233, 0.12109668552875519, 0.14431500434875488, -0.0398721769452095, -0.07044929265975952, -0.071534164249897, 0.18507443368434906, -0.029495969414711, -0.062099624425172806, 0.035912271589040756, 0.07458406686782837, 0.13973800837993622, 0.024947330355644226, 0.000005923474873270607, 0.011486253701150417, 0.10997523367404938, -0.09500496834516525, -0.07491893321275711, -0.1486617475748062, 0.11435607075691223, -0.06484546512365341, 0.023138709366321564, -0.12611599266529083, -0.06500744819641113, -0.174406960606575, 0.2234562188386917, -0.037425700575113297, 0.043113190680742264, 0.0071070450358092785, 0.07689125835895538, -0.07953821867704391, 0.14783772826194763, -0.13255009055137634, 0.09260295331478119, 0.1291796714067459, 0.08882952481508255, 0.14507508277893066, -0.17392520606517792, 0.008256269618868828, -0.08007100969552994, -0.05116359144449234, 0.004074928350746632, 0.0469571091234684, 0.07463209331035614, 0.17488357424736023, 0.10208015143871307, -0.05672387778759003, -0.02381097711622715, 0.15361271798610687, 0.18061114847660065, 0.03523007407784462, -0.049393706023693085, 0.09463965147733688, -0.13332043588161469, -0.09888956695795059, 0.08906003832817078, 0.14865748584270477, 0.0015748812584206462, 0.1404322385787964, 0.09749804437160492, -0.004497728776186705, 0.12490778416395187, -0.04398242011666298, -0.13557027280330658, 0.034861888736486435, -0.07297152280807495, 0.12599019706249237, 0.1028193011879921, -0.17497213184833527, -0.07079305499792099, -0.06823670864105225, -0.07688407599925995, -0.2823260724544525, 0.14210066199302673, 0.0031041305046528578, -0.13267415761947632, -0.1417754739522934, -0.0537850484251976, -0.03969242796301842, -0.06262065470218658, 0.0003483702312223613, -0.04030182957649231, 0.08699484169483185, 0.13132567703723907, -0.15152660012245178, -0.09520874917507172, -0.0946892499923706, 0.10348363220691681, -0.01593024469912052, 0.13293062150478363, 0.07324329018592834, -0.0872253030538559, -0.15453185141086578, -0.03877389058470726, -0.10926054418087006, 0.15134206414222717, 0.044359538704156876, 0.031720735132694244, -0.016776280477643013, 0.05353797227144241, 0.17020414769649506, 0.1345391571521759, 0.16969992220401764, 0.25683411955833435, -0.16303493082523346, -0.17370028793811798, -0.02545584924519062, 0.027697686105966568, 0.06522779911756516, 0.038449592888355255, -0.0030722024384886026, -0.09686696529388428, 0.02420995756983757, 0.028909211978316307, 0.025386402383446693, -0.021773768588900566, -0.06503687798976898, 0.14870116114616394, -0.08797130733728409, -0.014241944998502731, 0.048194654285907745, 0.05264384299516678, -0.06947838515043259, 0.08016651123762131, 0.15569038689136505, 0.22399182617664337, -0.1130637675523758, -0.039145030081272125, -0.12159651517868042, -0.08200378715991974, 0.15479205548763275, -0.15924179553985596, 0.06422919780015945, -0.17479746043682098, 0.00684986962005496, -0.1609828770160675, -0.08542180061340332, -0.14332425594329834, -0.15578895807266235, 0.07813725620508194, -0.06282636523246765, -0.04904858395457268, -0.050195273011922836, 0.11266940832138062, 0.018072741106152534, -0.02804800309240818, 0.15458597242832184, 0.12042781710624695, -0.15917374193668365, 0.04740021377801895, -0.0158951748162508, -0.14504030346870422, -0.07886708527803421, -0.2344755083322525, 0.17428384721279144, -0.10569914430379868, 0.17972178757190704, 0.01663968339562416, -0.09302578866481781, 0.091729074716568, -0.10000701248645782, -0.006767061538994312, -0.06786354631185532, 0.004116177558898926, -0.11753660440444946, -0.01570730097591877, -0.07251628488302231, 0.19631873071193695, -0.0016591993626207113, -0.06145954877138138, 0.061848729848861694, -0.05112626403570175, -0.051083214581012726, -0.22706878185272217, -0.3009543716907501, 0.07031283527612686, -0.061651404947042465, -0.006821346003562212, -0.1049046441912651, 0.03537755459547043, 0.1255873590707779, -0.02489813230931759, 0.12637652456760406, 0.06612873077392578, 0.22185666859149933, -0.15810422599315643, 0.0173387061804533, 0.12337756156921387, -0.29555103182792664, -0.06139715015888214, 0.10332327336072922, -0.045871686190366745, -0.012966691516339779, -0.08463436365127563, -0.00646593701094389, -0.025106634944677353, 0.09442034363746643, -0.10963088274002075, -0.04280894249677658, -0.027120821177959442, 0.03464702144265175, 0.15783263742923737, -0.0027559632435441017, -0.019627001136541367, 0.029628658667206764, -0.07106778770685196, -0.005355902947485447, 0.03202098608016968, -0.011311089619994164, -0.24727877974510193, -0.13023331761360168, 0.05368029326200485, 0.10462971031665802, 0.06102176383137703, 0.1708391159772873, -0.18754072487354279, -0.17701762914657593, -0.11537926644086838, -0.13731428980827332, -0.050607845187187195, 0.16491752862930298, 0.12303594499826431, 0.07219652831554413, -0.10581430792808533, -0.04463006928563118, -0.02864418551325798, -0.04016760736703873, 0.051694661378860474, -0.08211429417133331, 0.12809978425502777, 0.04972259700298309, -0.009709284640848637, -0.06365477293729782, 0.2071477770805359, -0.12855179607868195, 0.012898880057036877, 0.16886131465435028, -0.14458829164505005, -0.11245265603065491, 0.08339346200227737, -0.09385740011930466, -0.0548076406121254, 0.0861281305551529, 0.09704753756523132, 0.07110164314508438, 0.10586805641651154, 0.0660843625664711, 0.05799192562699318, -0.0030061001889407635, 0.12397825717926025, -0.05819518491625786, -0.03347690775990486, -0.10725932568311691, 0.023906700313091278, -0.09466143697500229, 0.03577886521816254, 0.11428352445363998, 0.04381759092211723, 0.05749166011810303, -0.25724419951438904, 0.08189234882593155, 0.09331659227609634, -0.05956808850169182, -0.10324171185493469, 0.12209050357341766, -0.18590454757213593, -0.11541231721639633, -0.01221670676022768, 0.1179996132850647, 0.10508185625076294, -0.03078063204884529, -0.0004042742948513478, -0.0021284581162035465, 0.00814537052065134, 0.043993838131427765, 0.22069254517555237, 0.0009918075520545244, -0.003328760387375951, -0.04656592011451721, -0.10121523588895798, -0.083565853536129, 0.07354005426168442, 0.0149299381300807, 0.06931871175765991, 0.09626970440149307, -0.1667935997247696, 0.10824986547231674, -0.0718398168683052, -0.27462297677993774, 0.05619116872549057, 0.01830407977104187, 0.04481729865074158, 0.1935587227344513, -0.019088592380285263, -0.09794338047504425, -0.03256028890609741, -0.08750887960195541, 0.02980682998895645, 0.10965169966220856, -0.06041806936264038, 0.1019858717918396, 0.03150205686688423, 0.04131348431110382, -0.1790064126253128, 0.06254603713750839, -0.15835325419902802, -0.10747992992401123, -0.0391535609960556, -0.03309042379260063, 0.006565717048943043, -0.1252659559249878, -0.23894834518432617, 0.06473025679588318, -0.17476531863212585, -0.21739758551120758, -0.0260327085852623, -0.05134965479373932, 0.2889087498188019, -0.15062998235225677, -0.004049128852784634, -0.09120643883943558, -0.20415553450584412, 0.0007492071599699557, 0.21171985566616058, -0.03672003000974655, 0.22588688135147095, -0.21749518811702728, 0.16577278077602386, -0.15033936500549316, 0.013452887535095215, 0.02847885899245739, 0.008433996699750423, -0.10070428997278214, -0.08322561532258987, 0.015341921709477901, -0.035380613058805466, 0.16772601008415222, -0.002615210134536028, -0.042490340769290924, 0.11169366538524628, 0.14923562109470367, 0.1827445924282074, -0.1541561484336853, -0.20579616725444794, 0.230258047580719, 0.14121204614639282, -0.015616100281476974, 0.01027223002165556, 0.0010867887176573277, -0.041338056325912476, 0.07278016954660416, -0.07326073944568634, -0.057126566767692566, 0.08256613463163376, 0.04651856794953346, 0.06704592704772949, 0.019944321364164352, 0.06557658314704895, 0.02673928067088127, -0.06557518988847733, -0.12510943412780762, -0.0778212621808052, 0.05061255395412445, 0.1340710073709488, 0.15715253353118896, -0.1223301962018013, 0.1059260293841362, -0.15475842356681824, 0.2603401839733124, 0.043378423899412155, -0.015362373553216457, 0.10407277941703796, -0.1523180454969406, 0.028530385345220566, -0.10085666179656982, 0.10005931556224823, 0.1634022444486618, 0.03320114314556122, 0.05833663046360016, 0.026590190827846527, 0.15769043564796448, -0.019752413034439087, -0.01607494056224823, -0.002263758797198534, 0.0003531109541654587, 0.11490750312805176, -0.09142185002565384, 0.1748034805059433, -0.051815953105688095, -0.02857925556600094, 0.12711085379123688, 0.009116172790527344, 0.02376743033528328, 0.21627876162528992, 0.010996218770742416, -0.040358349680900574, -0.10414248704910278, 0.005519217811524868, -0.20817424356937408, 0.0500447116792202, -0.09657417237758636, 0.24561023712158203, 0.045373983681201935, 0.07427938282489777, 0.005279498174786568, 0.06268006563186646, -0.06994204223155975, 0.1142418161034584, -0.012809298932552338, 0.07781737297773361, -0.1956891566514969, 0.06035878509283066, 0.0006041162996552885, 0.007631897460669279, -0.025393445044755936, 0.16895879805088043, -0.11387145519256592, -0.16094820201396942, -0.06987407803535461, -0.1499641090631485, 0.08849181234836578, 0.12921154499053955, 0.018000056967139244, -0.009842227213084698, -0.10267207771539688, -0.0828201025724411, -0.06994406133890152, -0.040426310151815414, 0.03868550434708595, -0.12109103053808212, -0.032867785543203354, 0.025317877531051636, -0.10384125262498856, -0.07524996250867844, 0.10413720458745956, -0.024896007031202316, 0.00039776499033905566, 0.10077429562807083, 0.0812552347779274, -0.13482360541820526, -0.06603427976369858, 0.09157653152942657, 0.01492477860301733, 0.06015081703662872, -0.014801581390202045, 0.2549606263637543, -0.026651432737708092, 0.019499683752655983, 0.13407321274280548, -0.14814209938049316, 0.12230992317199707, -0.1217380091547966, 0.06321188062429428, 0.07602224498987198, -0.06496666371822357, -0.14046289026737213, -0.1655600368976593, 0.0809612050652504, 0.05854157730937004, 0.12877415120601654, -0.022515693679451942, 0.08809909969568253, -0.10214728862047195, 0.0009126968216150999, 0.14899833500385284, -0.06156017258763313, -0.09580767154693604, -0.09127157181501389, 0.07582496851682663, 0.03933262452483177, 0.08209694921970367, -0.001845605089329183, 0.014239768497645855, 0.0867147147655487, 0.00193220644723624, -0.02260642871260643, 0.286299467086792, 0.02061297930777073, 0.1297505646944046, 0.1433153748512268, -0.0020231769885867834, 0.05018328130245209, -0.1113848090171814, 0.009069846011698246, -0.049275826662778854, -0.07300424575805664, -0.13606509566307068, -0.037499696016311646, -0.34325477480888367, 0.011746307834982872, -0.028583038598299026, -0.15649931132793427, -0.01529847551137209, 0.0418211966753006, -0.009694495238363743, -0.12663665413856506, -0.014047540724277496, -0.20405982434749603, -0.15584619343280792, -0.031753189861774445, -0.032623592764139175, 0.000046787175961071625, -0.02101985737681389, -0.14063937962055206, -0.08083194494247437, -0.2729960083961487, 0.06008625030517578, -0.1276938021183014, -0.06778331845998764, 0.11717984825372696, 0.15195763111114502, 0.11860700696706772, -0.20032060146331787, 0.0034288109745830297, -0.006407795008271933, 0.178483784198761, -0.0953231230378151, 0.03192984312772751, 0.07954300940036774, 0.03419516608119011, -0.041975896805524826, -0.2517097592353821, 0.08829653263092041, 0.0682201161980629, -0.01925014518201351, -0.07489518821239471, 0.06000365689396858, -0.10771224647760391, -0.18026834726333618, 0.015935027971863747, 0.2916668653488159, -0.09059516340494156, -0.06396917998790741, -0.08946676552295685, -2.3742655469059702e-32, 0.05930362641811371, 0.13984732329845428, -0.0060587553307414055, 0.14440275728702545, -0.24675244092941284, -0.0026384175289422274, -0.10042447596788406, 0.1309070885181427, 0.021218039095401764, 0.025834381580352783, 0.00014495925279334188, 0.046842753887176514, -0.03228076174855232, 0.06850653886795044, 0.02749868854880333, -0.10243029147386551, -0.027878491207957268, 0.09047218412160873, 0.00409697787836194, 0.005522420629858971, 0.037038128823041916, 0.07667538523674011, 0.04581733047962189, -0.030147599056363106, -0.02729387953877449, 0.09792032837867737, -0.019030878320336342, -0.018942542374134064, -0.11566773056983948, -0.08010099828243256, 0.04851362109184265, 0.033973585814237595, 0.01765022613108158, -0.13816684484481812, 0.004948996473103762, -0.08036571741104126, -0.15555553138256073, -0.10111062228679657, -0.07155270874500275, -0.02862584963440895, -0.07365591824054718, 0.15929687023162842, 0.12969596683979034, 0.03427697345614433, -0.1852796971797943, 0.2518008053302765, -0.07658470422029495, 0.005491644609719515, 0.010413401760160923, -0.025081798434257507, 0.09286726266145706, 0.04060477390885353, -0.037460293620824814, 0.060944318771362305, -0.04575759917497635, -0.16969075798988342, 0.06154340133070946, -0.010966704227030277, -0.13186858594417572, -0.08133679628372192, 0.19845083355903625, -0.22065699100494385, 0.10495328903198242, -0.022678667679429054, -0.00622603390365839, 0.09598269313573837, 0.37500250339508057, -0.015420954674482346, -0.04604876786470413, 0.056887757033109665, -0.010868399403989315, 0.08185534924268723, 0.06639149785041809, -0.0582386776804924, -0.01221191231161356, 0.027891235426068306, -0.1317419707775116, 0.04590766504406929, -0.05142073705792427, -0.19729284942150116, 0.08262723684310913, -0.020282577723264694, -0.026622062548995018, -0.11812851577997208, -0.12322219461202621, 0.1858014464378357, 0.06779371201992035, -0.00835944339632988, -0.08596177399158478, -0.1309041529893875, -0.04246978089213371, 0.16235551238059998, -0.029688963666558266, -0.13872751593589783, 0.0026426545809954405, -0.0022103553637862206, -0.016036061570048332, -0.00489759910851717, 0.02392035350203514, -0.007294452283531427, 0.006213785614818335, 0.07195733487606049, 0.09902355074882507, 0.03217742219567299, 0.012219815514981747, 0.11133092641830444, 0.0407220758497715, -0.13905185461044312, -0.21316730976104736, -0.01035999320447445, 0.05800908803939819, -0.007162798661738634, 0.01290751900523901, 0.13468436896800995, 0.3560922145843506, 0.04257377237081528, -0.08013828843832016, -0.0016593276523053646, 0.22048160433769226, 0.09642553329467773, -0.1767495721578598, -0.0632876455783844, -0.11915390193462372, -0.04644292965531349, 0.2071293145418167, 0.17650505900382996, -0.08048099279403687, 0.03895193338394165, 0.08900020271539688, 0.03267388045787811, 0.07894958555698395, -0.027979692444205284, 7.443050549227337e-7, 0.0696793869137764, -0.02259719744324684, 0.09876010566949844, 0.0052085574716329575, -0.08226922154426575, 0.1350826770067215, -0.22250699996948242, 0.005320569034665823, -0.17087896168231964, 0.07713107764720917, 0.15079960227012634, -0.01706317998468876, 0.044280678033828735, -0.014815998263657093, 0.044514380395412445, -0.039621639996767044, 0.0037313858047127724, -0.0033315690234303474, -0.08316358923912048, 0.07039966434240341, 0.08410337567329407, -0.1399800181388855, -0.057619478553533554, -0.18360020220279694, -0.0033769893925637007, 0.00021762326650787145, -0.008522365242242813, 0.019851289689540863, 0.06023615971207619, 0.005878804717212915, 0.002980479272082448, -0.14440803229808807, 0.26207923889160156, -0.06668257713317871, -0.07691967487335205, -0.048573851585388184, -0.19668199121952057, -0.2538893222808838, -0.03208308666944504, 0.1219259575009346, -0.0630069226026535, -0.05813075602054596, 0.008457577787339687, 0.11656282842159271, -0.009424122050404549, 0.03829294815659523, 0.08436035364866257, 0.0730847641825676, -0.0033789649605751038, 0.22187942266464233, -0.02265205606818199, -0.045554619282484055, 0.1485348343849182, 0.027066119015216827, 0.0391119085252285, 0.031049121171236038, 0.03161776065826416, -0.0730728954076767, 0.07414186745882034, -0.035097066313028336, -0.08211144804954529, -0.1577092558145523, 0.025749560445547104, 0.1103605404496193, 0.13703495264053345, 0.09807389974594116, 0.06833628565073013, 1.5790762293593785e-34, 0.0701533704996109, 0.1624850034713745, 0.03026552125811577, -0.006210787687450647, 0.024625040590763092, -0.09002511203289032, 0.1231212168931961, -0.03799523413181305, 0.008768587373197079, -0.030351197347044945, -0.08176083862781525 ]
https://github.com/huggingface/datasets/issues/6212
Tilde (~) is not supported for data_files
Hi @alvarobartt ! This is definitely just a "nice to have" and I am personally more than happy to just use absolute paths client-side. I just wanted to flag it up in case it can help improve the package even more πŸ™Œ It might not be immediately obvious from the stack trace that the error is triggered by the `~` in the path
### Describe the bug Attempting to `load_dataset` from a path starting with `~` (as a shorthand for the user's home directory) seems not to be fully working - at least as far as the `parquet` dataset builder is concerned. (the same file can be loaded correctly if providing its absolute path instead) I think that this is very similar to https://github.com/huggingface/datasets/issues/5757, but for `data_files` rather than `data_dir` ### Steps to reproduce the bug ```python import datasets # save a parquet file at ~/path/to/data.parquet data_files = "~/path/to/data.parquet" dataset = datasets.load_dataset("parquet", data_files=data_files) ``` ``` Downloading data files: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 12671.61it/s] Extracting data files: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 22671.91it/s] Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1949, in _prepare_split_single num_examples, num_bytes = writer.finalize() ^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/datasets/arrow_writer.py", line 598, in finalize raise SchemaInferenceError("Please pass `features` or at least one example when writing data") datasets.arrow_writer.SchemaInferenceError: Please pass `features` or at least one example when writing data The above exception was the direct cause of the following exception: Traceback (most recent call last): File ".venv/lib/python3.11/site-packages/datasets/load.py", line 2133, in load_dataset builder_instance.download_and_prepare( File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1813, in _prepare_split for job_id, done, content in self._prepare_split_single( File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1958, 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 Can use `~` shorthand in paths when loading local (parquet) datasets. ### Environment info `datasets 2.14.3`
63
Tilde (~) is not supported for data_files ### Describe the bug Attempting to `load_dataset` from a path starting with `~` (as a shorthand for the user's home directory) seems not to be fully working - at least as far as the `parquet` dataset builder is concerned. (the same file can be loaded correctly if providing its absolute path instead) I think that this is very similar to https://github.com/huggingface/datasets/issues/5757, but for `data_files` rather than `data_dir` ### Steps to reproduce the bug ```python import datasets # save a parquet file at ~/path/to/data.parquet data_files = "~/path/to/data.parquet" dataset = datasets.load_dataset("parquet", data_files=data_files) ``` ``` Downloading data files: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 12671.61it/s] Extracting data files: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 22671.91it/s] Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1949, in _prepare_split_single num_examples, num_bytes = writer.finalize() ^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/datasets/arrow_writer.py", line 598, in finalize raise SchemaInferenceError("Please pass `features` or at least one example when writing data") datasets.arrow_writer.SchemaInferenceError: Please pass `features` or at least one example when writing data The above exception was the direct cause of the following exception: Traceback (most recent call last): File ".venv/lib/python3.11/site-packages/datasets/load.py", line 2133, in load_dataset builder_instance.download_and_prepare( File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1813, in _prepare_split for job_id, done, content in self._prepare_split_single( File ".venv/lib/python3.11/site-packages/datasets/builder.py", line 1958, 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 Can use `~` shorthand in paths when loading local (parquet) datasets. ### Environment info `datasets 2.14.3` Hi @alvarobartt ! This is definitely just a "nice to have" and I am personally more than happy to just use absolute paths client-side. I just wanted to flag it up in case it can help improve the package even more πŸ™Œ It might not be immediately obvious from the stack trace that the error is triggered by the `~` in the path
[ -0.011025157757103443, 0.09693898260593414, -0.0020891365129500628, 0.0770537331700325, 0.20974020659923553, -0.04316243529319763, 0.055757224559783936, 0.11183453351259232, -0.12083771079778671, -0.06644436717033386, 0.04532736912369728, -0.15449176728725433, -0.1312909871339798, 0.06220376119017601, 0.05873793736100197, -0.08783240616321564, 0.0252255667001009, 0.04480493441224098, -0.15198858082294464, -0.06033353880047798, -0.0931495651602745, 0.03385481983423233, 0.12109668552875519, 0.14431500434875488, -0.0398721769452095, -0.07044929265975952, -0.071534164249897, 0.18507443368434906, -0.029495969414711, -0.062099624425172806, 0.035912271589040756, 0.07458406686782837, 0.13973800837993622, 0.024947330355644226, 0.000005923474873270607, 0.011486253701150417, 0.10997523367404938, -0.09500496834516525, -0.07491893321275711, -0.1486617475748062, 0.11435607075691223, -0.06484546512365341, 0.023138709366321564, -0.12611599266529083, -0.06500744819641113, -0.174406960606575, 0.2234562188386917, -0.037425700575113297, 0.043113190680742264, 0.0071070450358092785, 0.07689125835895538, -0.07953821867704391, 0.14783772826194763, -0.13255009055137634, 0.09260295331478119, 0.1291796714067459, 0.08882952481508255, 0.14507508277893066, -0.17392520606517792, 0.008256269618868828, -0.08007100969552994, -0.05116359144449234, 0.004074928350746632, 0.0469571091234684, 0.07463209331035614, 0.17488357424736023, 0.10208015143871307, -0.05672387778759003, -0.02381097711622715, 0.15361271798610687, 0.18061114847660065, 0.03523007407784462, -0.049393706023693085, 0.09463965147733688, -0.13332043588161469, -0.09888956695795059, 0.08906003832817078, 0.14865748584270477, 0.0015748812584206462, 0.1404322385787964, 0.09749804437160492, -0.004497728776186705, 0.12490778416395187, -0.04398242011666298, -0.13557027280330658, 0.034861888736486435, -0.07297152280807495, 0.12599019706249237, 0.1028193011879921, -0.17497213184833527, -0.07079305499792099, -0.06823670864105225, -0.07688407599925995, -0.2823260724544525, 0.14210066199302673, 0.0031041305046528578, -0.13267415761947632, -0.1417754739522934, -0.0537850484251976, -0.03969242796301842, -0.06262065470218658, 0.0003483702312223613, -0.04030182957649231, 0.08699484169483185, 0.13132567703723907, -0.15152660012245178, -0.09520874917507172, -0.0946892499923706, 0.10348363220691681, -0.01593024469912052, 0.13293062150478363, 0.07324329018592834, -0.0872253030538559, -0.15453185141086578, -0.03877389058470726, -0.10926054418087006, 0.15134206414222717, 0.044359538704156876, 0.031720735132694244, -0.016776280477643013, 0.05353797227144241, 0.17020414769649506, 0.1345391571521759, 0.16969992220401764, 0.25683411955833435, -0.16303493082523346, -0.17370028793811798, -0.02545584924519062, 0.027697686105966568, 0.06522779911756516, 0.038449592888355255, -0.0030722024384886026, -0.09686696529388428, 0.02420995756983757, 0.028909211978316307, 0.025386402383446693, -0.021773768588900566, -0.06503687798976898, 0.14870116114616394, -0.08797130733728409, -0.014241944998502731, 0.048194654285907745, 0.05264384299516678, -0.06947838515043259, 0.08016651123762131, 0.15569038689136505, 0.22399182617664337, -0.1130637675523758, -0.039145030081272125, -0.12159651517868042, -0.08200378715991974, 0.15479205548763275, -0.15924179553985596, 0.06422919780015945, -0.17479746043682098, 0.00684986962005496, -0.1609828770160675, -0.08542180061340332, -0.14332425594329834, -0.15578895807266235, 0.07813725620508194, -0.06282636523246765, -0.04904858395457268, -0.050195273011922836, 0.11266940832138062, 0.018072741106152534, -0.02804800309240818, 0.15458597242832184, 0.12042781710624695, -0.15917374193668365, 0.04740021377801895, -0.0158951748162508, -0.14504030346870422, -0.07886708527803421, -0.2344755083322525, 0.17428384721279144, -0.10569914430379868, 0.17972178757190704, 0.01663968339562416, -0.09302578866481781, 0.091729074716568, -0.10000701248645782, -0.006767061538994312, -0.06786354631185532, 0.004116177558898926, -0.11753660440444946, -0.01570730097591877, -0.07251628488302231, 0.19631873071193695, -0.0016591993626207113, -0.06145954877138138, 0.061848729848861694, -0.05112626403570175, -0.051083214581012726, -0.22706878185272217, -0.3009543716907501, 0.07031283527612686, -0.061651404947042465, -0.006821346003562212, -0.1049046441912651, 0.03537755459547043, 0.1255873590707779, -0.02489813230931759, 0.12637652456760406, 0.06612873077392578, 0.22185666859149933, -0.15810422599315643, 0.0173387061804533, 0.12337756156921387, -0.29555103182792664, -0.06139715015888214, 0.10332327336072922, -0.045871686190366745, -0.012966691516339779, -0.08463436365127563, -0.00646593701094389, -0.025106634944677353, 0.09442034363746643, -0.10963088274002075, -0.04280894249677658, -0.027120821177959442, 0.03464702144265175, 0.15783263742923737, -0.0027559632435441017, -0.019627001136541367, 0.029628658667206764, -0.07106778770685196, -0.005355902947485447, 0.03202098608016968, -0.011311089619994164, -0.24727877974510193, -0.13023331761360168, 0.05368029326200485, 0.10462971031665802, 0.06102176383137703, 0.1708391159772873, -0.18754072487354279, -0.17701762914657593, -0.11537926644086838, -0.13731428980827332, -0.050607845187187195, 0.16491752862930298, 0.12303594499826431, 0.07219652831554413, -0.10581430792808533, -0.04463006928563118, -0.02864418551325798, -0.04016760736703873, 0.051694661378860474, -0.08211429417133331, 0.12809978425502777, 0.04972259700298309, -0.009709284640848637, -0.06365477293729782, 0.2071477770805359, -0.12855179607868195, 0.012898880057036877, 0.16886131465435028, -0.14458829164505005, -0.11245265603065491, 0.08339346200227737, -0.09385740011930466, -0.0548076406121254, 0.0861281305551529, 0.09704753756523132, 0.07110164314508438, 0.10586805641651154, 0.0660843625664711, 0.05799192562699318, -0.0030061001889407635, 0.12397825717926025, -0.05819518491625786, -0.03347690775990486, -0.10725932568311691, 0.023906700313091278, -0.09466143697500229, 0.03577886521816254, 0.11428352445363998, 0.04381759092211723, 0.05749166011810303, -0.25724419951438904, 0.08189234882593155, 0.09331659227609634, -0.05956808850169182, -0.10324171185493469, 0.12209050357341766, -0.18590454757213593, -0.11541231721639633, -0.01221670676022768, 0.1179996132850647, 0.10508185625076294, -0.03078063204884529, -0.0004042742948513478, -0.0021284581162035465, 0.00814537052065134, 0.043993838131427765, 0.22069254517555237, 0.0009918075520545244, -0.003328760387375951, -0.04656592011451721, -0.10121523588895798, -0.083565853536129, 0.07354005426168442, 0.0149299381300807, 0.06931871175765991, 0.09626970440149307, -0.1667935997247696, 0.10824986547231674, -0.0718398168683052, -0.27462297677993774, 0.05619116872549057, 0.01830407977104187, 0.04481729865074158, 0.1935587227344513, -0.019088592380285263, -0.09794338047504425, -0.03256028890609741, -0.08750887960195541, 0.02980682998895645, 0.10965169966220856, -0.06041806936264038, 0.1019858717918396, 0.03150205686688423, 0.04131348431110382, -0.1790064126253128, 0.06254603713750839, -0.15835325419902802, -0.10747992992401123, -0.0391535609960556, -0.03309042379260063, 0.006565717048943043, -0.1252659559249878, -0.23894834518432617, 0.06473025679588318, -0.17476531863212585, -0.21739758551120758, -0.0260327085852623, -0.05134965479373932, 0.2889087498188019, -0.15062998235225677, -0.004049128852784634, -0.09120643883943558, -0.20415553450584412, 0.0007492071599699557, 0.21171985566616058, -0.03672003000974655, 0.22588688135147095, -0.21749518811702728, 0.16577278077602386, -0.15033936500549316, 0.013452887535095215, 0.02847885899245739, 0.008433996699750423, -0.10070428997278214, -0.08322561532258987, 0.015341921709477901, -0.035380613058805466, 0.16772601008415222, -0.002615210134536028, -0.042490340769290924, 0.11169366538524628, 0.14923562109470367, 0.1827445924282074, -0.1541561484336853, -0.20579616725444794, 0.230258047580719, 0.14121204614639282, -0.015616100281476974, 0.01027223002165556, 0.0010867887176573277, -0.041338056325912476, 0.07278016954660416, -0.07326073944568634, -0.057126566767692566, 0.08256613463163376, 0.04651856794953346, 0.06704592704772949, 0.019944321364164352, 0.06557658314704895, 0.02673928067088127, -0.06557518988847733, -0.12510943412780762, -0.0778212621808052, 0.05061255395412445, 0.1340710073709488, 0.15715253353118896, -0.1223301962018013, 0.1059260293841362, -0.15475842356681824, 0.2603401839733124, 0.043378423899412155, -0.015362373553216457, 0.10407277941703796, -0.1523180454969406, 0.028530385345220566, -0.10085666179656982, 0.10005931556224823, 0.1634022444486618, 0.03320114314556122, 0.05833663046360016, 0.026590190827846527, 0.15769043564796448, -0.019752413034439087, -0.01607494056224823, -0.002263758797198534, 0.0003531109541654587, 0.11490750312805176, -0.09142185002565384, 0.1748034805059433, -0.051815953105688095, -0.02857925556600094, 0.12711085379123688, 0.009116172790527344, 0.02376743033528328, 0.21627876162528992, 0.010996218770742416, -0.040358349680900574, -0.10414248704910278, 0.005519217811524868, -0.20817424356937408, 0.0500447116792202, -0.09657417237758636, 0.24561023712158203, 0.045373983681201935, 0.07427938282489777, 0.005279498174786568, 0.06268006563186646, -0.06994204223155975, 0.1142418161034584, -0.012809298932552338, 0.07781737297773361, -0.1956891566514969, 0.06035878509283066, 0.0006041162996552885, 0.007631897460669279, -0.025393445044755936, 0.16895879805088043, -0.11387145519256592, -0.16094820201396942, -0.06987407803535461, -0.1499641090631485, 0.08849181234836578, 0.12921154499053955, 0.018000056967139244, -0.009842227213084698, -0.10267207771539688, -0.0828201025724411, -0.06994406133890152, -0.040426310151815414, 0.03868550434708595, -0.12109103053808212, -0.032867785543203354, 0.025317877531051636, -0.10384125262498856, -0.07524996250867844, 0.10413720458745956, -0.024896007031202316, 0.00039776499033905566, 0.10077429562807083, 0.0812552347779274, -0.13482360541820526, -0.06603427976369858, 0.09157653152942657, 0.01492477860301733, 0.06015081703662872, -0.014801581390202045, 0.2549606263637543, -0.026651432737708092, 0.019499683752655983, 0.13407321274280548, -0.14814209938049316, 0.12230992317199707, -0.1217380091547966, 0.06321188062429428, 0.07602224498987198, -0.06496666371822357, -0.14046289026737213, -0.1655600368976593, 0.0809612050652504, 0.05854157730937004, 0.12877415120601654, -0.022515693679451942, 0.08809909969568253, -0.10214728862047195, 0.0009126968216150999, 0.14899833500385284, -0.06156017258763313, -0.09580767154693604, -0.09127157181501389, 0.07582496851682663, 0.03933262452483177, 0.08209694921970367, -0.001845605089329183, 0.014239768497645855, 0.0867147147655487, 0.00193220644723624, -0.02260642871260643, 0.286299467086792, 0.02061297930777073, 0.1297505646944046, 0.1433153748512268, -0.0020231769885867834, 0.05018328130245209, -0.1113848090171814, 0.009069846011698246, -0.049275826662778854, -0.07300424575805664, -0.13606509566307068, -0.037499696016311646, -0.34325477480888367, 0.011746307834982872, -0.028583038598299026, -0.15649931132793427, -0.01529847551137209, 0.0418211966753006, -0.009694495238363743, -0.12663665413856506, -0.014047540724277496, -0.20405982434749603, -0.15584619343280792, -0.031753189861774445, -0.032623592764139175, 0.000046787175961071625, -0.02101985737681389, -0.14063937962055206, -0.08083194494247437, -0.2729960083961487, 0.06008625030517578, -0.1276938021183014, -0.06778331845998764, 0.11717984825372696, 0.15195763111114502, 0.11860700696706772, -0.20032060146331787, 0.0034288109745830297, -0.006407795008271933, 0.178483784198761, -0.0953231230378151, 0.03192984312772751, 0.07954300940036774, 0.03419516608119011, -0.041975896805524826, -0.2517097592353821, 0.08829653263092041, 0.0682201161980629, -0.01925014518201351, -0.07489518821239471, 0.06000365689396858, -0.10771224647760391, -0.18026834726333618, 0.015935027971863747, 0.2916668653488159, -0.09059516340494156, -0.06396917998790741, -0.08946676552295685, -2.3742655469059702e-32, 0.05930362641811371, 0.13984732329845428, -0.0060587553307414055, 0.14440275728702545, -0.24675244092941284, -0.0026384175289422274, -0.10042447596788406, 0.1309070885181427, 0.021218039095401764, 0.025834381580352783, 0.00014495925279334188, 0.046842753887176514, -0.03228076174855232, 0.06850653886795044, 0.02749868854880333, -0.10243029147386551, -0.027878491207957268, 0.09047218412160873, 0.00409697787836194, 0.005522420629858971, 0.037038128823041916, 0.07667538523674011, 0.04581733047962189, -0.030147599056363106, -0.02729387953877449, 0.09792032837867737, -0.019030878320336342, -0.018942542374134064, -0.11566773056983948, -0.08010099828243256, 0.04851362109184265, 0.033973585814237595, 0.01765022613108158, -0.13816684484481812, 0.004948996473103762, -0.08036571741104126, -0.15555553138256073, -0.10111062228679657, -0.07155270874500275, -0.02862584963440895, -0.07365591824054718, 0.15929687023162842, 0.12969596683979034, 0.03427697345614433, -0.1852796971797943, 0.2518008053302765, -0.07658470422029495, 0.005491644609719515, 0.010413401760160923, -0.025081798434257507, 0.09286726266145706, 0.04060477390885353, -0.037460293620824814, 0.060944318771362305, -0.04575759917497635, -0.16969075798988342, 0.06154340133070946, -0.010966704227030277, -0.13186858594417572, -0.08133679628372192, 0.19845083355903625, -0.22065699100494385, 0.10495328903198242, -0.022678667679429054, -0.00622603390365839, 0.09598269313573837, 0.37500250339508057, -0.015420954674482346, -0.04604876786470413, 0.056887757033109665, -0.010868399403989315, 0.08185534924268723, 0.06639149785041809, -0.0582386776804924, -0.01221191231161356, 0.027891235426068306, -0.1317419707775116, 0.04590766504406929, -0.05142073705792427, -0.19729284942150116, 0.08262723684310913, -0.020282577723264694, -0.026622062548995018, -0.11812851577997208, -0.12322219461202621, 0.1858014464378357, 0.06779371201992035, -0.00835944339632988, -0.08596177399158478, -0.1309041529893875, -0.04246978089213371, 0.16235551238059998, -0.029688963666558266, -0.13872751593589783, 0.0026426545809954405, -0.0022103553637862206, -0.016036061570048332, -0.00489759910851717, 0.02392035350203514, -0.007294452283531427, 0.006213785614818335, 0.07195733487606049, 0.09902355074882507, 0.03217742219567299, 0.012219815514981747, 0.11133092641830444, 0.0407220758497715, -0.13905185461044312, -0.21316730976104736, -0.01035999320447445, 0.05800908803939819, -0.007162798661738634, 0.01290751900523901, 0.13468436896800995, 0.3560922145843506, 0.04257377237081528, -0.08013828843832016, -0.0016593276523053646, 0.22048160433769226, 0.09642553329467773, -0.1767495721578598, -0.0632876455783844, -0.11915390193462372, -0.04644292965531349, 0.2071293145418167, 0.17650505900382996, -0.08048099279403687, 0.03895193338394165, 0.08900020271539688, 0.03267388045787811, 0.07894958555698395, -0.027979692444205284, 7.443050549227337e-7, 0.0696793869137764, -0.02259719744324684, 0.09876010566949844, 0.0052085574716329575, -0.08226922154426575, 0.1350826770067215, -0.22250699996948242, 0.005320569034665823, -0.17087896168231964, 0.07713107764720917, 0.15079960227012634, -0.01706317998468876, 0.044280678033828735, -0.014815998263657093, 0.044514380395412445, -0.039621639996767044, 0.0037313858047127724, -0.0033315690234303474, -0.08316358923912048, 0.07039966434240341, 0.08410337567329407, -0.1399800181388855, -0.057619478553533554, -0.18360020220279694, -0.0033769893925637007, 0.00021762326650787145, -0.008522365242242813, 0.019851289689540863, 0.06023615971207619, 0.005878804717212915, 0.002980479272082448, -0.14440803229808807, 0.26207923889160156, -0.06668257713317871, -0.07691967487335205, -0.048573851585388184, -0.19668199121952057, -0.2538893222808838, -0.03208308666944504, 0.1219259575009346, -0.0630069226026535, -0.05813075602054596, 0.008457577787339687, 0.11656282842159271, -0.009424122050404549, 0.03829294815659523, 0.08436035364866257, 0.0730847641825676, -0.0033789649605751038, 0.22187942266464233, -0.02265205606818199, -0.045554619282484055, 0.1485348343849182, 0.027066119015216827, 0.0391119085252285, 0.031049121171236038, 0.03161776065826416, -0.0730728954076767, 0.07414186745882034, -0.035097066313028336, -0.08211144804954529, -0.1577092558145523, 0.025749560445547104, 0.1103605404496193, 0.13703495264053345, 0.09807389974594116, 0.06833628565073013, 1.5790762293593785e-34, 0.0701533704996109, 0.1624850034713745, 0.03026552125811577, -0.006210787687450647, 0.024625040590763092, -0.09002511203289032, 0.1231212168931961, -0.03799523413181305, 0.008768587373197079, -0.030351197347044945, -0.08176083862781525 ]
https://github.com/huggingface/datasets/issues/6206
When calling load_dataset, raise error: pyarrow.lib.ArrowInvalid: offset overflow while concatenating arrays
I solved the problem by modifying the "self DEFAULT_WRITER_BATCH_SIZE" in "class MyDataset (datasets. GeneratorBasedBuilder) : __init__"
### Describe the bug When calling load_dataset, raise error ``` Traceback (most recent call last): File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1694, in _pre pare_split_single writer.write(example, key) File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 490, in write self.write_examples_on_file() File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 448, in write_examples_on_file self.write_batch(batch_examples=batch_examples) File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 559, in write_batch self.write_table(pa_table, writer_batch_size) File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 571, in write_table pa_table = pa_table.combine_chunks() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "pyarrow/table.pxi", line 3439, 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 The above exception was the direct cause of the following exception: Traceback (most recent call last): dataset = load_dataset( ^^^^^^^^^^^^^ File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py", line 2133, in load_da taset builder_instance.download_and_prepare( File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 954, in downl oad_and_prepare self._download_and_prepare( File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _dow nload_and_prepare super()._download_and_prepare( File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _dow nload_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _pre pare_split for job_id, done, content in self._prepare_split_single( File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1712, in _pre pare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.builder.DatasetGenerationError: An error occurred while generating the dataset Setting num_proc from 8 back to 1 for the train split to disable multiprocessing as it only contains one shard. 09/04/2023 12:02:04 - WARNING - datasets.builder - Setting num_proc from 8 back to 1 for the train split to dis able multiprocessing as it only contains one shard. ``` ### Steps to reproduce the bug Call load_dataset with the large image as feature ### Expected behavior no error ### Environment info - `datasets` version: 2.14.3 - Platform: Linux-6.2.0-31-generic-x86_64-with-glibc2.35 - Python version: 3.11.4 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3
16
When calling load_dataset, raise error: pyarrow.lib.ArrowInvalid: offset overflow while concatenating arrays ### Describe the bug When calling load_dataset, raise error ``` Traceback (most recent call last): File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1694, in _pre pare_split_single writer.write(example, key) File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 490, in write self.write_examples_on_file() File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 448, in write_examples_on_file self.write_batch(batch_examples=batch_examples) File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 559, in write_batch self.write_table(pa_table, writer_batch_size) File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/arrow_writer.py", line 571, in write_table pa_table = pa_table.combine_chunks() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "pyarrow/table.pxi", line 3439, 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 The above exception was the direct cause of the following exception: Traceback (most recent call last): dataset = load_dataset( ^^^^^^^^^^^^^ File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/load.py", line 2133, in load_da taset builder_instance.download_and_prepare( File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 954, in downl oad_and_prepare self._download_and_prepare( File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _dow nload_and_prepare super()._download_and_prepare( File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _dow nload_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _pre pare_split for job_id, done, content in self._prepare_split_single( File "/home/aihao/miniconda3/envs/torch/lib/python3.11/site-packages/datasets/builder.py", line 1712, in _pre pare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.builder.DatasetGenerationError: An error occurred while generating the dataset Setting num_proc from 8 back to 1 for the train split to disable multiprocessing as it only contains one shard. 09/04/2023 12:02:04 - WARNING - datasets.builder - Setting num_proc from 8 back to 1 for the train split to dis able multiprocessing as it only contains one shard. ``` ### Steps to reproduce the bug Call load_dataset with the large image as feature ### Expected behavior no error ### Environment info - `datasets` version: 2.14.3 - Platform: Linux-6.2.0-31-generic-x86_64-with-glibc2.35 - Python version: 3.11.4 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 I solved the problem by modifying the "self DEFAULT_WRITER_BATCH_SIZE" in "class MyDataset (datasets. GeneratorBasedBuilder) : __init__"
[ -0.006499891635030508, -0.014217731542885303, -0.05253809690475464, 0.03367478772997856, 0.26125237345695496, 0.041990894824266434, 0.11079166829586029, 0.11252875626087189, -0.1334078311920166, 0.1636783331632614, -0.18816708028316498, -0.008173612877726555, 0.0494551919400692, -0.15758012235164642, 0.02759551629424095, -0.036895427852869034, -0.09108378738164902, 0.0482352189719677, 0.02552695758640766, 0.04551343247294426, -0.08325137197971344, 0.04205003380775452, 0.008457369171082973, -0.10125872492790222, -0.009663957171142101, -0.25814032554626465, -0.11175227910280228, 0.26131218671798706, 0.010691842995584011, -0.23807890713214874, 0.1925676465034485, -0.0796344205737114, -0.050587248057127, 0.0655742958188057, 0.0000048332917685911525, 0.05985429510474205, 0.23390509188175201, -0.01716187782585621, -0.07191628217697144, -0.16263549029827118, 0.15985150635242462, -0.04603651911020279, -0.0010400613537058234, -0.003323894925415516, 0.1905054897069931, -0.3547322750091553, -0.11148184537887573, 0.1512148231267929, -0.02807287499308586, 0.08997610211372375, -0.0017383324448019266, -0.01695784367620945, 0.16820287704467773, -0.09981878101825714, 0.13176429271697998, -0.09056465327739716, 0.14438068866729736, 0.003140445100143552, -0.12564456462860107, -0.09880675375461578, -0.08697798103094101, -0.24971812963485718, -0.06755600869655609, -0.00526780541986227, -0.033049751073122025, -0.06870066374540329, -0.024946851655840874, -0.005255525466054678, -0.021175580099225044, 0.30702531337738037, 0.023479918017983437, -0.012521207332611084, -0.11923755705356598, -0.0751243531703949, 0.05465522035956383, -0.13982121646404266, -0.1369783729314804, 0.12697476148605347, -0.1589009314775467, -0.03554631024599075, 0.006728669628500938, 0.09384132921695709, -0.012868951074779034, 0.05733264982700348, -0.09150882065296173, 0.00011651347449515015, -0.08102055639028549, 0.09565573185682297, -0.04149099811911583, -0.15558849275112152, 0.30480092763900757, 0.09892172366380692, -0.1287192851305008, -0.16526436805725098, -0.04217810556292534, 0.06282273679971695, -0.05043498054146767, -0.12510740756988525, 0.07437248528003693, -0.03563115745782852, -0.03245067223906517, -0.04211796820163727, 0.08609174937009811, 0.08232827484607697, 0.05605518817901611, 0.030889375135302544, -0.113719142973423, -0.002206275472417474, -0.12664836645126343, -0.05426720157265663, 0.08881537616252899, 0.08359206467866898, -0.09796081483364105, -0.16271458566188812, 0.20770575106143951, 0.16079892218112946, 0.12181241065263748, 0.1125299483537674, 0.0017372601432725787, 0.09321897476911545, -0.009633539244532585, 0.09446931630373001, -0.05407542362809181, 0.0956537276506424, 0.14275233447551727, 0.12229035049676895, -0.07893093675374985, 0.15281444787979126, -0.04169221967458725, 0.07095694541931152, -0.08206120133399963, 0.028882451355457306, 0.07973244786262512, -0.16288745403289795, 0.11518348008394241, 0.002252831356599927, 0.06026295945048332, -0.1146160215139389, -0.0170816108584404, -0.08812335133552551, 0.08014294505119324, -0.11342412978410721, -0.0036494622472673655, 0.007757456973195076, 0.09278896450996399, -0.008725317195057869, 0.06681925803422928, 0.0951801985502243, 0.0420912504196167, 0.1512680947780609, -0.16662445664405823, -0.034651096910238266, -0.25946199893951416, 0.04414165019989014, -0.0988675132393837, 0.06492490321397781, -0.011551897041499615, -0.22669966518878937, -0.06955908238887787, -0.07335740327835083, 0.025657042860984802, 0.0560477115213871, -0.10975039005279541, -0.21005992591381073, 0.1247653216123581, 0.07093994319438934, -0.02157980389893055, 0.06538970023393631, -0.037412337958812714, 0.010789377614855766, 0.1215294823050499, 0.12063994258642197, -0.06727590411901474, -0.0037566209211945534, -0.11528889089822769, 0.06426967680454254, 0.00816847663372755, 0.11348934471607208, -0.26680371165275574, -0.020493358373641968, 0.09118682146072388, -0.10638147592544556, 0.07012939453125, -0.09801594913005829, 0.11266432702541351, -0.0359235480427742, 0.09939873218536377, 0.037192296236753464, -0.11469793319702148, -0.07231104373931885, -0.01517817098647356, 0.08288832008838654, -0.12229232490062714, -0.013616662472486496, 0.0520208403468132, -0.26997894048690796, -0.02545478381216526, -0.28065770864486694, -0.02758999913930893, -0.18216699361801147, 0.036383744329214096, 0.0029435984324663877, -0.06280884146690369, -0.06632571667432785, 0.02962666004896164, -0.0625142753124237, -0.19817031919956207, 0.05096358433365822, -0.12641596794128418, -0.2927505671977997, -0.22891296446323395, -0.002075988333672285, -0.08652065694332123, 0.035437412559986115, 0.00011634928523562849, 0.12194322049617767, -0.07422298938035965, 0.051874127238988876, -0.011030138470232487, 0.08585065603256226, 0.008096856996417046, 0.0007096516783349216, 0.051908474415540695, 0.04023122414946556, -0.12590190768241882, 0.013777809217572212, 0.035006921738386154, -0.19382593035697937, 0.11581915616989136, 0.11161172389984131, -0.1368856281042099, -0.09878323972225189, 0.16786101460456848, 0.20017777383327484, -0.028545819222927094, -0.0913257747888565, -0.1567024141550064, -0.31857800483703613, 0.08963646739721298, -0.08536197245121002, -0.06446477770805359, 0.0393664613366127, -0.1141253188252449, -0.10290608555078506, -0.020652426406741142, 0.1216188296675682, -0.14866741001605988, 0.21966210007667542, -0.0006480338051915169, -0.07560638338327408, 0.11138997972011566, 0.16655322909355164, -0.09050676226615906, 0.03364428132772446, 0.07397550344467163, -0.08323168009519577, 0.015891598537564278, 0.13219089806079865, -0.039920251816511154, 0.03956880047917366, 0.283073365688324, -0.03174837678670883, 0.011913755908608437, 0.05740528926253319, 0.0757487490773201, -0.09858668595552444, 0.14198805391788483, -0.06704229861497879, 0.1441047042608261, 0.19078010320663452, -0.1392095535993576, -0.05402560159564018, -0.024615928530693054, 0.005953134037554264, 0.0822378471493721, -0.10120216012001038, 0.03992443159222603, -0.09086256474256516, 0.1331997960805893, 0.056914057582616806, -0.10736445337533951, 0.04571704939007759, 0.057475823909044266, -0.1535676270723343, 0.060722995549440384, 0.12702307105064392, 0.013628269545733929, -0.020931802690029144, -0.10133436322212219, 0.007455791812390089, 0.09763393551111221, -0.09340307116508484, 0.0768037810921669, -0.17086409032344818, -0.10724279284477234, 0.06337956339120865, 0.09344145655632019, -0.012503396719694138, 0.0036006628070026636, -0.03841077536344528, -0.07813345640897751, 0.13118475675582886, 0.08916706591844559, 0.05773574858903885, 0.15250523388385773, 0.047508854418992996, 0.29150646924972534, 0.16990111768245697, -0.05703704431653023, -0.007930509746074677, 0.115908183157444, -0.096421018242836, -0.028474317863583565, -0.039800237864255905, 0.25166043639183044, 0.03924664482474327, 0.11710481345653534, -0.2657261788845062, 0.05494434013962746, -0.01525590568780899, -0.10543017834424973, 0.1960574835538864, -0.08308441936969757, 0.08329358696937561, -0.03350672498345375, 0.10930966585874557, -0.21652844548225403, -0.20170173048973083, 0.027254465967416763, 0.08096694946289062, 0.07354652136564255, -0.04869787022471428, 0.0220508873462677, -0.16388215124607086, -0.015971144661307335, -0.2175648808479309, -0.06801586598157883, -0.001962255919352174, 0.3353351354598999, 0.08097049593925476, -0.05843745544552803, 0.036819279193878174, -0.07767122238874435, 0.04052598774433136, 0.14983032643795013, -0.1661818027496338, 0.09165254235267639, -0.10251722484827042, 0.22516237199306488, -0.2750447988510132, 0.09482753276824951, 0.02396467700600624, 0.10574296116828918, -0.0029388018883764744, -0.0467713363468647, 0.09970736503601074, -0.15370334684848785, -0.04738836735486984, -0.03237934783101082, -0.024542052298784256, 0.09893541783094406, 0.10216407477855682, 0.13500167429447174, -0.04656223580241203, -0.1577637642621994, 0.05821993947029114, 0.07130801677703857, -0.03376936912536621, -0.17557819187641144, -0.20703007280826569, -0.13733166456222534, -0.10492017865180969, 0.11626467853784561, -0.10137628763914108, -0.10416736453771591, -0.13721436262130737, 0.056238558143377304, -0.1613941639661789, 0.16356709599494934, 0.11550299823284149, 0.08490151911973953, -0.18274785578250885, -0.07876569032669067, 0.051141880452632904, 0.06514284014701843, -0.037639252841472626, 0.004717085976153612, -0.13209998607635498, -0.3358743190765381, 0.06036587059497833, 0.12512221932411194, 0.15857307612895966, -0.09216182678937912, 0.0568874254822731, 0.011726561933755875, -0.006292011588811874, 0.17516224086284637, 0.34915003180503845, -0.02483416721224785, -0.003963071387261152, 0.1003945991396904, 0.10980372130870819, -0.030357027426362038, 0.06322713941335678, 0.06783605366945267, 0.24947836995124817, -0.16338899731636047, -0.04888271167874336, 0.050000209361314774, -0.02977028116583824, 0.11463723331689835, -0.12266799807548523, -0.06176461651921272, 0.06584138423204422, 0.14321695268154144, 0.0893726721405983, 0.03099181316792965, -0.11999363452196121, -0.11079555004835129, -0.1593099683523178, -0.21394076943397522, -0.18973633646965027, 0.07255057990550995, 0.29322317242622375, -0.03538412228226662, -0.09446609020233154, 0.025095220655202866, -0.19264426827430725, 0.08274717628955841, -0.02708396129310131, 0.12272929400205612, -0.023575522005558014, 0.09353215992450714, -0.13854995369911194, 0.08318620175123215, 0.23092594742774963, 0.3849819302558899, 0.013765142299234867, -0.09046509116888046, -0.05958046391606331, -0.11462800949811935, 0.03087124414741993, 0.03146667405962944, -0.1110515147447586, 0.041433341801166534, -0.20815476775169373, -0.1365264356136322, 0.05527535080909729, -0.052057672291994095, 0.03427779674530029, -0.13917987048625946, -0.15444160997867584, 0.013654638081789017, -0.11060210317373276, 0.07245447486639023, 0.10656733810901642, 0.17131705582141876, -0.19131293892860413, 0.02555934339761734, 0.058002520352602005, 0.035923317074775696, -0.051768284291028976, -0.10430622845888138, 0.0467102937400341, 0.07387542724609375, -0.038672249764204025, 0.09720729291439056, -0.08675570785999298, -0.06730061024427414, 0.05123823136091232, 0.018617190420627594, 0.15226063132286072, -0.06812869757413864, -0.11147759854793549, 0.10057315230369568, -0.08199785649776459, 0.021168498322367668, -0.028387663885951042, -0.06422890722751617, 0.002540979068726301, 0.13469626009464264, -0.0498170368373394, 0.05509193614125252, -0.148053839802742, -0.013670442625880241, 0.10027450323104858, -0.10412523150444031, -0.13639439642429352, -0.06615161150693893, -0.13220085203647614, -0.01155625656247139, -0.09703981131315231, 0.04370156303048134, -0.13563202321529388, 0.11505784094333649, -0.04803284630179405, 0.07952091097831726, 0.13653115928173065, -0.11415056139230728, -0.002633851720020175, -0.009077738970518112, -0.005459566134959459, -0.19682027399539948, -0.0037195603363215923, -0.06007658690214157, -0.055453360080718994, 0.0553031750023365, -0.09544510394334793, 0.04678528383374214, -0.08373653143644333, 0.043660759925842285, -0.00964511651545763, -0.09516315907239914, 0.10869873315095901, 0.11602587252855301, -0.042612869292497635, -0.09361355006694794, 0.04722354933619499, -0.07916631549596786, 0.18431101739406586, 0.08612406998872757, -0.11853760480880737, 0.11283794045448303, -0.012911267578601837, -0.03828155994415283, 0.07381440699100494, 0.025322074070572853, -0.002316572004929185, 0.16187423467636108, 0.18722867965698242, 0.12723976373672485, 0.12305327504873276, 0.22095546126365662, 0.08506380766630173, 0.002716250019147992, 0.10976294428110123, 0.15306003391742706, -0.24209924042224884, -0.026390083134174347, 0.09296686202287674, 0.09865206480026245, -0.19555503129959106, -0.012661655433475971, 0.12732119858264923, 0.2300143539905548, 0.11127448827028275, -0.00907868891954422, -0.23815248906612396, -0.1448165625333786, -0.10888081789016724, -0.08240772783756256, 0.060142528265714645, -0.01974855363368988, -0.06094378978013992, 0.06009068340063095, -2.3355616607211772e-32, -0.08154895901679993, -0.13943983614444733, -0.04247087240219116, -0.053624480962753296, -0.19582843780517578, 0.052203066647052765, -0.038854651153087616, -0.05127428472042084, -0.027782734483480453, -0.06120264157652855, -0.07833839952945709, 0.06569107621908188, 0.008372855372726917, -0.06114509701728821, -0.12203343212604523, -0.05686357244849205, -0.006503353826701641, 0.006385548505932093, 0.11972330510616302, 0.10903937369585037, 0.0030309013091027737, 0.13472585380077362, -0.012907836586236954, 0.12040392309427261, -0.027755465358495712, -0.05499648675322533, -0.030797993764281273, -0.02717757038772106, 0.17120476067066193, -0.14197424054145813, -0.06448454409837723, 0.12141687422990799, 0.037191879004240036, -0.040793705731630325, 0.05709027871489525, -0.06125355511903763, -0.18371106684207916, -0.10447774827480316, -0.023840727284550667, 0.07428506761789322, -0.06542930752038956, 0.09612471610307693, 0.1429705172777176, -0.20891021192073822, -0.005377722438424826, 0.007541919592767954, 0.05060804262757301, -0.063395656645298, -0.11389444768428802, -0.10244397819042206, 0.09927105903625488, 0.059445399791002274, -0.017019471153616905, 0.09802010655403137, -0.11974739283323288, 0.05647808313369751, 0.021449152380228043, 0.12631574273109436, -0.0476866140961647, -0.07809239625930786, 0.05078267306089401, -0.04472793638706207, 0.05633377283811569, 0.05949446186423302, 0.20153458416461945, 0.17618712782859802, 0.261567622423172, 0.11473814398050308, 0.03401092439889908, 0.04836864769458771, -0.10434741526842117, 0.06242135539650917, -0.15177366137504578, 0.04413366690278053, -0.14586475491523743, 0.0454292967915535, -0.17725129425525665, 0.11894229799509048, 0.07941002398729324, 0.10957247763872147, -0.0448579415678978, 0.07470802962779999, -0.05225580558180809, -0.008114156313240528, 0.05660764127969742, -0.0532558336853981, 0.010534022934734821, 0.07920105010271072, -0.16777105629444122, -0.0973803773522377, 0.002500117290765047, 0.11061935871839523, -0.011224287562072277, -0.10780034214258194, -0.15574152767658234, 0.24221815168857574, -0.06250564008951187, 0.0662890300154686, -0.12263812124729156, 0.10951211303472519, -0.09925657510757446, -0.030004948377609253, -0.008727841079235077, 0.09249643236398697, 0.2840387225151062, 0.17095382511615753, 0.15784700214862823, -0.04118186607956886, -0.1302710920572281, -0.13373494148254395, -0.08249291777610779, -0.05382024124264717, 0.1331057846546173, 0.08774828910827637, 0.139373779296875, 0.1585932821035385, -0.06243749335408211, 0.03838466480374336, 0.2922777831554413, 0.03182132914662361, 0.004670432768762112, -0.14113299548625946, -0.07513820379972458, -0.09684576094150543, -0.09617327898740768, 0.13339467346668243, -0.118559829890728, 0.10417930781841278, 0.043679188936948776, 0.04118266701698303, 0.005065703298896551, -0.07195187360048294, 7.138602313716547e-7, -0.2751801908016205, 0.2150089293718338, 0.1377241611480713, 0.1655023694038391, -0.11920411884784698, 0.09298297762870789, -0.10172173380851746, 0.14242321252822876, -0.19726325571537018, 0.21118997037410736, 0.17872220277786255, -0.0036047264002263546, -0.023756414651870728, -0.016664227470755577, 0.06059937924146652, -0.009127648547291756, -0.008133994415402412, 0.18112628161907196, -0.04656390845775604, 0.12288395315408707, 0.23844362795352936, -0.053536415100097656, 0.06929034739732742, -0.11494791507720947, -0.020877914503216743, -0.1141359806060791, -0.02801508456468582, -0.13688869774341583, 0.09792748093605042, -0.007347391918301582, -0.031444814056158066, 0.10366560518741608, -0.1304488331079483, 0.16129353642463684, 0.06658913940191269, -0.0017618059646338224, -0.23723973333835602, -0.20802456140518188, 0.027943581342697144, 0.12246762216091156, 0.2482002228498459, 0.010667694732546806, 0.0285145565867424, -0.14882726967334747, 0.08359375596046448, 0.12093224376440048, -0.12449292093515396, 0.10408298671245575, 0.0212172269821167, 0.12026279419660568, -0.06747368723154068, 0.028363144025206566, 0.0566253699362278, -0.01306677795946598, -0.01783604547381401, -0.060726068913936615, -0.08227802813053131, -0.15171729028224945, 0.09261994063854218, 0.10644584149122238, -0.10297905653715134, -0.09524642676115036, 0.18940255045890808, 0.06769146025180817, 0.04695305600762367, -0.14696763455867767, 0.028540926054120064, 8.171999418746229e-35, 0.03339545801281929, -0.08000940084457397, -0.025839995592832565, -0.16274335980415344, 0.11833874136209488, -0.1680978536605835, 0.14288198947906494, -0.09949711710214615, 0.1609366536140442, -0.17676778137683868, -0.15471605956554413 ]
https://github.com/huggingface/datasets/issues/6203
Support loading from a DVC remote repository
(cross-posting from the linked DVC issue) I think this should already work out of the box with the current `datasets` and `dvc.api` releases by passing the correct `storage_options` into the datasets calls. `storage_options` is essentially just the kwargs dict that gets passed to the fsspec fs constructor. The main thing to note here is that the fsspec DVCFileSystem URL should be `dvc://folder/file.json` (i.e. this should be the DVCFileSystem path that is relative to the DVC repo root). You cannot use a URL like `https://gitlab.com/user/repo/folder/file.json`. I think something like this should work for you (in a venv where both DVC and datasets are installed): ```python import datasets # load a dataset from Git/DVC repository where Git repo is located at https://gitlab.com/user/repo.git # and path to dataset (relative to git/dvc repo root) is 'folder/file.json' datasets.load_from_disk( "dvc://folder/file.json", storage_options={"url": "https://gitlab.com/user/repo.git"}, ) ``` basically the `dvc://` is what tells fsspec to create a `DVCFileSystem` and it will construct it like ```python fs = DVCFileSystem(**storage_options) ``` Then the subsequent calls use the rest of the `dvc://...` URL like ```python fs.exists("folder/file.json") ```
### Feature request Adding support for loading a file from a DVC repository, tracked remotely on a SCM. ### Motivation DVC is a popular version control system to version and manage datasets. The files are stored on a remote object storage platform, but they are tracked using Git. Integration with DVC is possible through the `DVCFileSystem`. I have a Gitlab repository where multiple files are tracked using DVC and stored in a GCP bucket. I would like to be able to load these files using `datasets` directly using an URL. My goal is to write a generic code that abstracts the storage layer, such that my users will only have to pass in an `fsspec`-compliant URL and the corresponding files will be loaded. ### Your contribution I managed to instantiate a `DVCFileSystem` pointing to a Gitlab repo from a `fsspec` chained URL in [this pull request](https://github.com/iterative/dvc/pull/9903) to DVC. ```python from fsspec.core import url_to_fs fs, _ = url_to_fs("dvc::https://gitlab.com/repository/group/my-repo") ``` From now I'm not sure how to continue, it seems that `datasets` expects the URL to be fully qualified like so: `dvc::https://gitlab.com/repository/group/my-repo/my-folder/my-file.json` but this fails because `DVCFileSystem` expects the URL to point to the root of an SCM repo. Is there a way to make this work with `datasets`?
175
Support loading from a DVC remote repository ### Feature request Adding support for loading a file from a DVC repository, tracked remotely on a SCM. ### Motivation DVC is a popular version control system to version and manage datasets. The files are stored on a remote object storage platform, but they are tracked using Git. Integration with DVC is possible through the `DVCFileSystem`. I have a Gitlab repository where multiple files are tracked using DVC and stored in a GCP bucket. I would like to be able to load these files using `datasets` directly using an URL. My goal is to write a generic code that abstracts the storage layer, such that my users will only have to pass in an `fsspec`-compliant URL and the corresponding files will be loaded. ### Your contribution I managed to instantiate a `DVCFileSystem` pointing to a Gitlab repo from a `fsspec` chained URL in [this pull request](https://github.com/iterative/dvc/pull/9903) to DVC. ```python from fsspec.core import url_to_fs fs, _ = url_to_fs("dvc::https://gitlab.com/repository/group/my-repo") ``` From now I'm not sure how to continue, it seems that `datasets` expects the URL to be fully qualified like so: `dvc::https://gitlab.com/repository/group/my-repo/my-folder/my-file.json` but this fails because `DVCFileSystem` expects the URL to point to the root of an SCM repo. Is there a way to make this work with `datasets`? (cross-posting from the linked DVC issue) I think this should already work out of the box with the current `datasets` and `dvc.api` releases by passing the correct `storage_options` into the datasets calls. `storage_options` is essentially just the kwargs dict that gets passed to the fsspec fs constructor. The main thing to note here is that the fsspec DVCFileSystem URL should be `dvc://folder/file.json` (i.e. this should be the DVCFileSystem path that is relative to the DVC repo root). You cannot use a URL like `https://gitlab.com/user/repo/folder/file.json`. I think something like this should work for you (in a venv where both DVC and datasets are installed): ```python import datasets # load a dataset from Git/DVC repository where Git repo is located at https://gitlab.com/user/repo.git # and path to dataset (relative to git/dvc repo root) is 'folder/file.json' datasets.load_from_disk( "dvc://folder/file.json", storage_options={"url": "https://gitlab.com/user/repo.git"}, ) ``` basically the `dvc://` is what tells fsspec to create a `DVCFileSystem` and it will construct it like ```python fs = DVCFileSystem(**storage_options) ``` Then the subsequent calls use the rest of the `dvc://...` URL like ```python fs.exists("folder/file.json") ```
[ -0.003352116094902158, 0.27291208505630493, -0.061477579176425934, -0.04139930382370949, 0.16056758165359497, 0.007325311191380024, 0.08889555186033249, -0.13564085960388184, 0.09673133492469788, 0.009578595869243145, 0.08560728281736374, -0.014708787202835083, -0.02168242074549198, -0.005323097109794617, 0.17585083842277527, 0.13334718346595764, -0.04914245381951332, -0.017069660127162933, 0.05681157484650612, 0.02451055869460106, -0.015927724540233612, 0.005157683044672012, 0.11473660916090012, -0.0886835902929306, 0.0641995444893837, 0.05332321301102638, -0.08657620847225189, 0.12891565263271332, 0.07873521745204926, -0.12625184655189514, 0.2371460199356079, 0.09975975006818771, 0.08839475363492966, 0.13805069029331207, 0.000006276133717619814, -0.11617233604192734, 0.04004291817545891, 0.033451471477746964, -0.1844555288553238, -0.07124797254800797, 0.03489556908607483, -0.19372865557670593, -0.05455018952488899, -0.11134312301874161, 0.016399655491113663, -0.011875911615788937, 0.06863772124052048, -0.18306230008602142, -0.036356836557388306, -0.00999869778752327, -0.07993612438440323, -0.0017673077527433634, -0.1312825083732605, -0.19638215005397797, 0.0034325269516557455, 0.2573053538799286, -0.01814066618680954, 0.36740952730178833, -0.02833351492881775, -0.029949570074677467, -0.07393461465835571, -0.03275981917977333, -0.0801115408539772, 0.15807802975177765, 0.06414677202701569, -0.03947174921631813, -0.157756969332695, -0.11324349790811539, -0.016039889305830002, 0.1397360861301422, 0.07871334254741669, -0.05679136514663696, -0.0704687237739563, -0.03895968571305275, -0.0358864963054657, 0.023825159296393394, -0.0011425032280385494, -0.22454047203063965, -0.03955633565783501, 0.10430988669395447, -0.14665210247039795, -0.08195584267377853, -0.06370905786752701, -0.02886876091361046, -0.09239869564771652, 0.011215019971132278, -0.01123073697090149, -0.039118099957704544, -0.00932852178812027, -0.0020358585752546787, 0.15869298577308655, -0.04901617020368576, -0.09489834308624268, -0.019416550174355507, 0.2714933156967163, 0.07313986867666245, 0.05706839635968208, -0.056886591017246246, 0.11850687116384506, -0.07048369944095612, 0.029716618359088898, -0.008658289909362793, -0.13352884352207184, -0.031044472008943558, 0.07023578882217407, -0.013942597433924675, -0.09634959697723389, -0.0008840343216434121, 0.10270468145608902, -0.04977242276072502, 0.03650610148906708, 0.1497969776391983, -0.08573813736438751, -0.26785728335380554, -0.05285690724849701, -0.005079842638224363, 0.024286488071084023, 0.1082623079419136, 0.08323092758655548, -0.14422965049743652, 0.11590968817472458, 0.08140568435192108, -0.03941124677658081, 0.12093961238861084, 0.051403552293777466, 0.12478574365377426, -0.00022769893985241652, -0.12362977117300034, 0.018779849633574486, -0.018562177196145058, -0.01764419488608837, -0.1541876494884491, -0.0024850231129676104, 0.11293704062700272, 0.15473802387714386, -0.05764178931713104, 0.037727244198322296, -0.21447020769119263, 0.11485694348812103, -0.00719001330435276, 0.012744384817779064, 0.07866154611110687, -0.10986628383398056, -0.05615901201963425, -0.00008175115362973884, 0.03857007995247841, 0.008265047334134579, 0.06427066028118134, -0.18393707275390625, 0.025114145129919052, -0.18872292339801788, 0.007226129528135061, -0.30496978759765625, 0.03809964284300804, -0.1769697517156601, -0.0547078438103199, -0.20479348301887512, -0.11956630647182465, -0.3388020396232605, -0.17884328961372375, 0.03934338688850403, -0.031159063801169395, 0.16154798865318298, -0.005292043089866638, 0.2548619508743286, 0.019869690760970116, -0.02645355463027954, 0.03561139106750488, 0.04350630193948746, -0.11492154747247696, 0.0039942339062690735, -0.1274469494819641, 0.026673415675759315, -0.09373943507671356, -0.14247961342334747, 0.12866631150245667, 0.11134886741638184, -0.05116918310523033, -0.08449700474739075, 0.2135506570339203, 0.07262194901704788, -0.0062972744926810265, -0.06239404156804085, -0.010288038291037083, 0.11463631689548492, 0.08332887291908264, -0.24762989580631256, 0.1845700889825821, 0.04307655990123749, 0.03454749286174774, -0.11107702553272247, -0.09573341906070709, 0.02603539265692234, 0.09779660403728485, -0.05772663280367851, -0.016558820381760597, 0.0949244424700737, -0.14665809273719788, 0.12144692987203598, -0.1452181488275528, -0.19383971393108368, 0.08461401611566544, 0.024703556671738625, 0.06893475353717804, 0.06884070485830307, 0.0074994503520429134, -0.15476737916469574, 0.160160630941391, 0.129585400223732, -0.021850870922207832, -0.03632132709026337, 0.02930542454123497, -0.09550687670707703, 0.02973395213484764, -0.19103841483592987, -0.0902019813656807, -0.13252106308937073, 0.11459999531507492, -0.0541594997048378, 0.08614617586135864, -0.1062609925866127, 0.11724469065666199, 0.1549542099237442, -0.020993592217564583, 0.2355625331401825, 0.12454216182231903, 0.08366593718528748, -0.007229683455079794, 0.04301463067531586, -0.016803883016109467, -0.07066773623228073, -0.14414691925048828, 0.0807100236415863, 0.15567046403884888, -0.0756106898188591, 0.07348164916038513, 0.02099033258855343, 0.13446596264839172, 0.0507553406059742, -0.08927147090435028, -0.01640545204281807, -0.020992234349250793, 0.16315066814422607, 0.019743308424949646, -0.08228426426649094, 0.04317080229520798, -0.0475391186773777, -0.0371694453060627, -0.012904845178127289, -0.0055445111356675625, 0.364238440990448, 0.12775377929210663, -0.1323968768119812, 0.18171094357967377, -0.010517789982259274, 0.03622254729270935, -0.006876532454043627, 0.007799799088388681, 0.001276096678338945, -0.119169682264328, 0.06612308323383331, -0.001047949306666851, 0.016274739056825638, 0.026253335177898407, 0.1398928314447403, -0.030831312760710716, 0.15950879454612732, -0.040384646505117416, 0.08918611705303192, 0.14629007875919342, -0.07889151573181152, 0.00885768886655569, -0.04725438356399536, -0.17458267509937286, 0.14183741807937622, -0.21558377146720886, -0.0028624264523386955, 0.047751285135746, -0.00395533163100481, 0.02457336336374283, -0.0790025144815445, -0.10606436431407928, 0.04861876368522644, -0.06648081541061401, 0.08140392601490021, 0.001374981366097927, -0.21743331849575043, -0.05709794536232948, 0.046570271253585815, -0.1278364658355713, -0.009129755198955536, 0.12695398926734924, 0.03630883991718292, -0.09347664564847946, 0.059736862778663635, 0.031128931790590286, -0.0837651789188385, 0.11228562146425247, -0.07124976068735123, -0.23559407889842987, -0.015461293049156666, -0.15431900322437286, -0.07749110460281372, 0.08735466748476028, 0.11742700636386871, 0.0662890374660492, -0.0015268181450664997, 0.21304099261760712, -0.09281360357999802, -0.13601812720298767, -0.04709470644593239, -0.0458870567381382, -0.0028088167309761047, -0.018593501299619675, -0.06840578466653824, -0.08686363697052002, -0.009233222343027592, -0.11962160468101501, 0.08176131546497345, 0.11762544512748718, 0.13545465469360352, 0.05527277663350105, 0.07758430391550064, -0.1266831010580063, -0.1618654429912567, 0.08706697821617126, -0.21928058564662933, -0.16057123243808746, -0.11365234851837158, -0.11212030053138733, -0.1553853154182434, 0.08485299348831177, 0.20026017725467682, -0.138912633061409, 0.031593937426805496, -0.30427786707878113, 0.024456452578306198, -0.08882985264062881, 0.15177063643932343, -0.029023468494415283, 0.03280645236372948, -0.008034887723624706, 0.0190365519374609, 0.01258364599198103, -0.040570683777332306, -0.10622573643922806, 0.026452574878931046, -0.1615179479122162, -0.12405307590961456, -0.030159205198287964, 0.04561067000031471, -0.08836569637060165, 0.013810601085424423, 0.043855879455804825, 0.02763344906270504, -0.05069197714328766, -0.0053181215189397335, 0.10073326528072357, -0.10642924904823303, 0.26159584522247314, 0.005063902586698532, -0.041339755058288574, 0.0644640326499939, -0.039711277931928635, -0.10068602859973907, 0.1925847977399826, 0.2490820437669754, 0.06172962486743927, 0.033378712832927704, -0.03287656232714653, -0.0020848698914051056, -0.16517511010169983, 0.00033031520433723927, 0.12158297747373581, 0.07574374973773956, -0.12346064299345016, -0.05489887297153473, 0.006114794872701168, 0.18486832082271576, 0.031002486124634743, 0.14303550124168396, -0.20272856950759888, 0.015132606960833073, -0.03531528264284134, 0.08255990594625473, -0.023456215858459473, 0.06038800626993179, -0.025720687583088875, 0.004730166867375374, 0.1611035019159317, 0.09876666963100433, 0.1662604957818985, 0.14032897353172302, -0.16254843771457672, 0.08322536945343018, -0.06393929570913315, -0.17335648834705353, 0.01206578966230154, 0.034107401967048645, 0.052270784974098206, 0.04284173995256424, -0.014342638663947582, 0.12716464698314667, 0.06932875514030457, 0.05394073575735092, -0.04895639419555664, 0.11106421798467636, -0.11509772390127182, 0.21865485608577728, -0.11685129255056381, -0.1320749968290329, 0.015922803431749344, -0.10446116328239441, 0.016274871304631233, 0.025533774867653847, -0.21416765451431274, 0.055355049669742584, -0.0035438190679997206, -0.027321122586727142, -0.13813653588294983, -0.06231744959950447, -0.13391730189323425, 0.1970839500427246, 0.13514049351215363, 0.07439351081848145, 0.013622371479868889, -0.008288579992949963, 0.08707834035158157, 0.17171910405158997, -0.0698159709572792, 0.08581793308258057, -0.02850162796676159, 0.01789204590022564, 0.04471781104803085, 0.12327302247285843, -0.0829600915312767, 0.2893204689025879, 0.069877989590168, -0.031154099851846695, 0.031551916152238846, -0.10689675807952881, -0.15903207659721375, 0.11859147995710373, -0.04864482209086418, -0.10251484811306, 0.03849410265684128, -0.10822559893131256, -0.10290595889091492, -0.09247379750013351, -0.16892041265964508, -0.12334953993558884, -0.12175632268190384, -0.23120523989200592, -0.08580838143825531, 0.027483616024255753, -0.12230388075113297, 0.02588820643723011, 0.0014737339224666357, -0.04386109858751297, 0.1628497838973999, -0.020106930285692215, -0.08558779209852219, 0.003947793040424585, -0.01033800095319748, -0.06560011208057404, 0.14845047891139984, 0.15170978009700775, -0.245339497923851, -0.01578591950237751, -0.008021789602935314, 0.011181160807609558, 0.07823342084884644, -0.25740742683410645, -0.04202638566493988, 0.21514461934566498, -0.014071041718125343, 0.05399005860090256, 0.09333813935518265, -0.19631356000900269, 0.036340344697237015, 0.09863127768039703, 0.16632531583309174, 0.14510145783424377, -0.09193803369998932, 0.07353206723928452, 0.20420770347118378, -0.006008246913552284, 0.024349087849259377, -0.14280959963798523, -0.003684782423079014, 0.02088957652449608, -0.2108030915260315, 0.1619250625371933, -0.01764467917382717, 0.039442647248506546, -0.01680600643157959, 0.06841782480478287, 0.06598720699548721, 0.029257455840706825, 0.03051351010799408, 0.05934213101863861, -0.12909050285816193, 0.055998288094997406, 0.09125982969999313, -0.04477296024560928, 0.0020765410736203194, 0.04223194718360901, -0.045778706669807434, -0.0328264944255352, -0.0005871439934708178, -0.01776335947215557, -0.08096183091402054, -0.1895059198141098, -0.10596882551908493, 0.10230600088834763, 0.03558366000652313, 0.050595950335264206, -0.03863413259387016, 0.0900280773639679, 0.01761009357869625, -0.050195567309856415, -0.10104738920927048, -0.23752474784851074, -0.049892306327819824, -0.07249505817890167, 0.1352097988128662, -0.05050000548362732, -0.041317977011203766, 0.108489990234375, -0.23892924189567566, -0.025157058611512184, 0.03197590261697769, 0.04660704731941223, 0.0019085052190348506, 0.030729616060853004, 0.014024513773620129, 0.039717163890600204, -0.06781464070081711, 0.013501692563295364, 0.1038220003247261, -0.147148996591568, -0.14263032376766205, 0.10443856567144394, 0.022935574874281883, -0.07132112234830856, -0.045352354645729065, 0.07709600776433945, 0.010158643126487732, 0.05879038944840431, -0.26691821217536926, 0.07172650098800659, -0.02272246591746807, 0.09504308551549911, -0.15992948412895203, -0.14981485903263092, -2.3803106735418677e-32, 0.07656322419643402, 0.06983356922864914, -0.14487040042877197, 0.00017868645954877138, 0.023978902027010918, 0.0067286379635334015, 0.05662143975496292, -0.1374632567167282, -0.1119881421327591, -0.0627722218632698, 0.10524473339319229, 0.1246824711561203, 0.08180695027112961, 0.0634913519024849, -0.21617385745048523, -0.015025985427200794, 0.013597573153674603, -0.21419847011566162, 0.04933451861143112, 0.04442879557609558, 0.007781791966408491, 0.06759892404079437, -0.10298202186822891, -0.0538819395005703, 0.08604536205530167, -0.18289059400558472, 0.06763914227485657, -0.12337540835142136, 0.2913691997528076, 0.10239682346582413, -0.07793867588043213, 0.00505232997238636, -0.09159204363822937, 0.07762283831834793, 0.011707056313753128, 0.06372560560703278, -0.1307399570941925, 0.1184176653623581, -0.03759189322590828, -0.1029968336224556, 0.14018277823925018, 0.05270273610949516, -0.08356272429227829, -0.003861195407807827, 0.08023500442504883, 0.08368461579084396, 0.08396852016448975, 0.14012378454208374, 0.051545098423957825, 0.005331550724804401, -0.03282634913921356, 0.020439159125089645, 0.01856103539466858, -0.043184615671634674, 0.042816951870918274, 0.04438195750117302, 0.15330705046653748, 0.07336575537919998, -0.014460987411439419, -0.06808824837207794, -0.12735027074813843, 0.009841473773121834, 0.10975433886051178, -0.05242737755179405, 0.08983412384986877, -0.039611637592315674, 0.26505568623542786, -0.06281117349863052, -0.02034328319132328, 0.07597221434116364, 0.18363822996616364, 0.1421409398317337, -0.10581546276807785, -0.02566066011786461, -0.17602474987506866, -0.028370842337608337, -0.12113982439041138, 0.017144910991191864, -0.1024496778845787, 0.04144330695271492, 0.026608731597661972, 0.03274715691804886, -0.1431599110364914, 0.1001756489276886, 0.046719569712877274, 0.0013272339710965753, -0.02603374421596527, -0.06407281011343002, -0.0861794576048851, -0.15776434540748596, -0.00017511294572614133, -0.15101419389247894, -0.08757676929235458, 0.062337446957826614, 0.08627355843782425, 0.11491533368825912, -0.023278648033738136, 0.07453910261392593, 0.021613309159874916, 0.23686200380325317, 0.027896491810679436, 0.06252507865428925, 0.18685194849967957, -0.1145561933517456, 0.0028675037901848555, 0.038165800273418427, -0.01708974502980709, -0.02198314294219017, -0.2533830404281616, 0.030342871323227882, 0.07936253398656845, 0.05213569104671478, -0.03029668889939785, 0.17582319676876068, 0.3370435833930969, 0.0654790848493576, -0.03210655227303505, -0.044964272528886795, 0.027620911598205566, 0.1528358906507492, -0.07766128331422806, 0.0722387507557869, 0.08128447830677032, 0.09671967476606369, -0.027964873239398003, 0.12536782026290894, -0.08576856553554535, -0.05985276401042938, -0.05785553529858589, 0.018382994458079338, 0.07712281495332718, -0.1417808085680008, 7.53763458760659e-7, -0.0392073355615139, 0.1376681923866272, 0.055207185447216034, 0.046873580664396286, 0.02293662168085575, -0.054531030356884, -0.21217909455299377, -0.01729155331850052, 0.03287241980433464, -0.06997036188840866, 0.14612355828285217, 0.0449487529695034, -0.059136271476745605, 0.07255394011735916, -0.14648227393627167, 0.008370370604097843, 0.04011896997690201, 0.022400474175810814, -0.053505249321460724, -0.015343003906309605, 0.015141590498387814, 0.12678131461143494, -0.13539448380470276, -0.07389143109321594, 0.027319058775901794, -0.07731760293245316, -0.028990473598241806, 0.10729502886533737, 0.0012711097951978445, 0.0043166810646653175, -0.10468245297670364, 0.12293622642755508, -0.07205531746149063, 0.01929643005132675, 0.028049075976014137, 0.08784051239490509, -0.22824940085411072, 0.008063510991632938, 0.08385166525840759, -0.06781063228845596, -0.033053599298000336, 0.07114121317863464, -0.07551935315132141, 0.0933607965707779, 0.06214439868927002, -0.018558647483587265, -0.07697998732328415, -0.042284123599529266, -0.014194469898939133, -0.005817495286464691, -0.0076147448271512985, 0.005173409823328257, 0.010278148576617241, 0.00678842980414629, -0.08267641067504883, -0.027225561439990997, -0.030840935185551643, -0.14706043899059296, 0.03658914193511009, -0.02422425150871277, -0.025027591735124588, -0.0026018149219453335, 0.04912595450878143, -0.09114960581064224, 0.20506088435649872, 0.22674249112606049, 0.023327859118580818, 1.1076504188580907e-34, 0.1191166490316391, 0.051214974373579025, 0.02928902395069599, 0.029078222811222076, -0.08748762309551239, -0.01577075570821762, 0.022505702450871468, -0.10391100496053696, 0.01807747408747673, -0.09164600819349289, -0.12985840439796448 ]
https://github.com/huggingface/datasets/issues/6203
Support loading from a DVC remote repository
Hi @pmrowla Thank you for your help, that's very helpful, I was indeed using `fsspec` incorrectly here. There is still an issue with `datasets`: ```python import datasets dataset = datasets.load_dataset("json", data_files="dvc://folder/file.jsonl", storage_options={"url": "https://gitlab.com/repo/folder/"}) ``` results in the following exception: ``` Traceback (most recent call last): File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/fs.py", line 217, in info ret = self.trie.info(key) ^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/git/objects.py", line 141, in info obj = self.trie[key] ~~~~~~~~~^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/pygtrie.py", line 937, in __getitem__ node, _ = self._get_node(key_or_slice) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/pygtrie.py", line 630, in _get_node raise KeyError(key) KeyError: ('dvc:', 'datasets', 'spider', 'train.jsonl') During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 2129, in load_dataset builder_instance = load_dataset_builder( ^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 1815, in load_dataset_builder dataset_module = dataset_module_factory( ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 1430, in dataset_module_factory ).get_module() ^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 958, in get_module data_files = DataFilesDict.from_patterns( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 674, in from_patterns DataFilesList.from_patterns( File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 589, in from_patterns origin_metadata = _get_origin_metadata(data_files, download_config=download_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 504, in _get_origin_metadata return thread_map( ^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator yield _result_or_cancel(fs.pop()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel return fut.result(timeout) ^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 456, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 491, in _get_single_origin_metadata info = fs.info(data_file) ^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc/fs/dvc.py", line 357, in info return self._info(key, path, ignore_subrepos=ignore_subrepos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc/fs/dvc.py", line 377, in _info fs_info = fs.info(fs_path) ^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc_objects/fs/base.py", line 501, in info return self.fs.info(path, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/fs.py", line 221, in info raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), path) FileNotFoundError: [Errno 2] No such file or directory: '/dvc:/folder/file.jsonl' ``` Somehow the URL gets turned into `/dvc:/folder/file.jsonl` inside `datasets`. Otherwise I can confirm that using `fsspec` properly with DVC works as expected.
### Feature request Adding support for loading a file from a DVC repository, tracked remotely on a SCM. ### Motivation DVC is a popular version control system to version and manage datasets. The files are stored on a remote object storage platform, but they are tracked using Git. Integration with DVC is possible through the `DVCFileSystem`. I have a Gitlab repository where multiple files are tracked using DVC and stored in a GCP bucket. I would like to be able to load these files using `datasets` directly using an URL. My goal is to write a generic code that abstracts the storage layer, such that my users will only have to pass in an `fsspec`-compliant URL and the corresponding files will be loaded. ### Your contribution I managed to instantiate a `DVCFileSystem` pointing to a Gitlab repo from a `fsspec` chained URL in [this pull request](https://github.com/iterative/dvc/pull/9903) to DVC. ```python from fsspec.core import url_to_fs fs, _ = url_to_fs("dvc::https://gitlab.com/repository/group/my-repo") ``` From now I'm not sure how to continue, it seems that `datasets` expects the URL to be fully qualified like so: `dvc::https://gitlab.com/repository/group/my-repo/my-folder/my-file.json` but this fails because `DVCFileSystem` expects the URL to point to the root of an SCM repo. Is there a way to make this work with `datasets`?
327
Support loading from a DVC remote repository ### Feature request Adding support for loading a file from a DVC repository, tracked remotely on a SCM. ### Motivation DVC is a popular version control system to version and manage datasets. The files are stored on a remote object storage platform, but they are tracked using Git. Integration with DVC is possible through the `DVCFileSystem`. I have a Gitlab repository where multiple files are tracked using DVC and stored in a GCP bucket. I would like to be able to load these files using `datasets` directly using an URL. My goal is to write a generic code that abstracts the storage layer, such that my users will only have to pass in an `fsspec`-compliant URL and the corresponding files will be loaded. ### Your contribution I managed to instantiate a `DVCFileSystem` pointing to a Gitlab repo from a `fsspec` chained URL in [this pull request](https://github.com/iterative/dvc/pull/9903) to DVC. ```python from fsspec.core import url_to_fs fs, _ = url_to_fs("dvc::https://gitlab.com/repository/group/my-repo") ``` From now I'm not sure how to continue, it seems that `datasets` expects the URL to be fully qualified like so: `dvc::https://gitlab.com/repository/group/my-repo/my-folder/my-file.json` but this fails because `DVCFileSystem` expects the URL to point to the root of an SCM repo. Is there a way to make this work with `datasets`? Hi @pmrowla Thank you for your help, that's very helpful, I was indeed using `fsspec` incorrectly here. There is still an issue with `datasets`: ```python import datasets dataset = datasets.load_dataset("json", data_files="dvc://folder/file.jsonl", storage_options={"url": "https://gitlab.com/repo/folder/"}) ``` results in the following exception: ``` Traceback (most recent call last): File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/fs.py", line 217, in info ret = self.trie.info(key) ^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/git/objects.py", line 141, in info obj = self.trie[key] ~~~~~~~~~^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/pygtrie.py", line 937, in __getitem__ node, _ = self._get_node(key_or_slice) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/pygtrie.py", line 630, in _get_node raise KeyError(key) KeyError: ('dvc:', 'datasets', 'spider', 'train.jsonl') During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 2129, in load_dataset builder_instance = load_dataset_builder( ^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 1815, in load_dataset_builder dataset_module = dataset_module_factory( ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 1430, in dataset_module_factory ).get_module() ^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/load.py", line 958, in get_module data_files = DataFilesDict.from_patterns( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 674, in from_patterns DataFilesList.from_patterns( File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 589, in from_patterns origin_metadata = _get_origin_metadata(data_files, download_config=download_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 504, in _get_origin_metadata return thread_map( ^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator yield _result_or_cancel(fs.pop()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel return fut.result(timeout) ^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 456, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/Users/bilelomrani/.pyenv/versions/3.11.4/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/datasets/data_files.py", line 491, in _get_single_origin_metadata info = fs.info(data_file) ^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc/fs/dvc.py", line 357, in info return self._info(key, path, ignore_subrepos=ignore_subrepos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc/fs/dvc.py", line 377, in _info fs_info = fs.info(fs_path) ^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/dvc_objects/fs/base.py", line 501, in info return self.fs.info(path, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/bilelomrani/Documents/ILLUIN.nosync/instructions-finetuning/.venv/lib/python3.11/site-packages/scmrepo/fs.py", line 221, in info raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), path) FileNotFoundError: [Errno 2] No such file or directory: '/dvc:/folder/file.jsonl' ``` Somehow the URL gets turned into `/dvc:/folder/file.jsonl` inside `datasets`. Otherwise I can confirm that using `fsspec` properly with DVC works as expected.
[ -0.013233584351837635, 0.26773130893707275, -0.0630030483007431, -0.02505739964544773, 0.16536691784858704, 0.012670145370066166, 0.09677723795175552, -0.14474612474441528, 0.1027778834104538, 0.017455773428082466, 0.07126359641551971, 0.000460757059045136, -0.024087177589535713, -0.009733904153108597, 0.1809351146221161, 0.10044490545988083, -0.04656357690691948, -0.035004064440727234, 0.06329801678657532, 0.03210967779159546, -0.014547382481396198, 0.009508035145699978, 0.10719657689332962, -0.09618247300386429, 0.07607335597276688, 0.04886007681488991, -0.07466493546962738, 0.1143626868724823, 0.08914043754339218, -0.12825872004032135, 0.23283059895038605, 0.10633652657270432, 0.107003353536129, 0.15537431836128235, 0.000006322746230580378, -0.1009020209312439, 0.0546608492732048, 0.04876028746366501, -0.1644033044576645, -0.0748470202088356, 0.034549176692962646, -0.19422128796577454, -0.05632193759083748, -0.08573779463768005, 0.01732579804956913, -0.015204264782369137, 0.062499627470970154, -0.17116543650627136, -0.015817828476428986, -0.015067041851580143, -0.09028337150812149, 0.002269703196361661, -0.12272212654352188, -0.19286265969276428, 0.037446387112140656, 0.2562315762042999, -0.016092941164970398, 0.3887975215911865, -0.03785557299852371, -0.037531401962041855, -0.058303043246269226, -0.045403964817523956, -0.08041750639677048, 0.17442922294139862, 0.04401792213320732, -0.04255276918411255, -0.1708340346813202, -0.11591694504022598, -0.030631810426712036, 0.14224040508270264, 0.07015082985162735, -0.057708755135536194, -0.0900069922208786, -0.041241321712732315, -0.04306212067604065, 0.018464120104908943, -0.0017507326556369662, -0.22848628461360931, -0.03784232214093208, 0.11136458814144135, -0.15891149640083313, -0.0884639322757721, -0.05957767739892006, -0.025764787569642067, -0.0874108225107193, -0.0026456185150891542, -0.02323819138109684, -0.03237477317452431, -0.030707579106092453, -0.01149729359894991, 0.16777345538139343, -0.03132956847548485, -0.09342636168003082, -0.01678786613047123, 0.24948686361312866, 0.07080750912427902, 0.019734283909201622, -0.06244555115699768, 0.12039335817098618, -0.05722327157855034, 0.019322510808706284, -0.022969359531998634, -0.15769146382808685, -0.012096855789422989, 0.0747053474187851, -0.050073206424713135, -0.1032724678516388, 0.001364894793368876, 0.12808869779109955, -0.07179738581180573, 0.042805567383766174, 0.14754870533943176, -0.07905171811580658, -0.24755795300006866, -0.0533437505364418, 0.012474237941205502, 0.02741718292236328, 0.10027740895748138, 0.09848017990589142, -0.13719578087329865, 0.10359545797109604, 0.06320838630199432, -0.043992046266794205, 0.13185760378837585, 0.03954348340630531, 0.10145453363656998, -0.0063946726731956005, -0.07828839123249054, 0.005953294225037098, -0.032992374151945114, 0.020819155499339104, -0.15096281468868256, -0.0057569388300180435, 0.11176565289497375, 0.1735287308692932, -0.05266115069389343, 0.05822359398007393, -0.21334239840507507, 0.10787840187549591, 0.024894462898373604, 0.04561423137784004, 0.08523818105459213, -0.0973314493894577, -0.05189729109406471, 0.006465074606239796, 0.03270142897963524, -0.01577465794980526, 0.0920509546995163, -0.18923985958099365, 0.03986596316099167, -0.1933886855840683, 0.043135736137628555, -0.30529847741127014, 0.0334479883313179, -0.17599469423294067, -0.06996273249387741, -0.21484214067459106, -0.12689681351184845, -0.3350101113319397, -0.17806224524974823, 0.03970673307776451, -0.028352266177535057, 0.1745082587003708, 0.000980037497356534, 0.26027387380599976, 0.018050558865070343, -0.01853277161717415, 0.04398442432284355, 0.028075790032744408, -0.11948936432600021, -0.015151388011872768, -0.10001201182603836, 0.024645710363984108, -0.06843278557062149, -0.13103029131889343, 0.12218205630779266, 0.1085376963019371, -0.05169062688946724, -0.11272025108337402, 0.2205805480480194, 0.06814801692962646, -0.005974885076284409, -0.08637384325265884, -0.0018653206061571836, 0.11356833577156067, 0.0606115460395813, -0.23310226202011108, 0.17352057993412018, 0.05820060893893242, 0.046657808125019073, -0.10867559909820557, -0.07134461402893066, 0.03127967566251755, 0.11267847567796707, -0.07816911488771439, -0.036722004413604736, 0.074793741106987, -0.1599666029214859, 0.12073766440153122, -0.12337864190340042, -0.19715140759944916, 0.09292423725128174, 0.017246006056666374, 0.05087544769048691, 0.08912788331508636, -0.004340556915849447, -0.14068220555782318, 0.14376649260520935, 0.14443397521972656, -0.010684514418244362, -0.048387814313173294, 0.03397020697593689, -0.10238004475831985, 0.03173065185546875, -0.1807316541671753, -0.07691321521997452, -0.1514630913734436, 0.11463462561368942, -0.071535624563694, 0.05229669436812401, -0.12962794303894043, 0.11926744878292084, 0.15183041989803314, -0.010460770688951015, 0.22967658936977386, 0.12735401093959808, 0.0740540474653244, 0.0017386467661708593, 0.06042613089084625, -0.024260861799120903, -0.05537926033139229, -0.14254607260227203, 0.08877075463533401, 0.15397971868515015, -0.09901642799377441, 0.09418199956417084, 0.04200872406363487, 0.1371099203824997, 0.05296410247683525, -0.1258593648672104, -0.015473579987883568, 0.00011850942246383056, 0.1623636782169342, 0.01799408718943596, -0.08616040647029877, 0.04167775437235832, -0.06579455733299255, -0.02328363060951233, -0.0007192944758571684, -0.01880543865263462, 0.3783450424671173, 0.12766115367412567, -0.16086523234844208, 0.18751157820224762, 0.004156672861427069, 0.0742187574505806, -0.029338426887989044, 0.013341501355171204, -0.021645737811923027, -0.10225332528352737, 0.09951350837945938, 0.009451149962842464, 0.007366758771240711, 0.02796933613717556, 0.13936197757720947, -0.02369854226708412, 0.16062572598457336, -0.017769411206245422, 0.07430857419967651, 0.15969844162464142, -0.07125867903232574, 0.042959634214639664, -0.09517474472522736, -0.19456839561462402, 0.13252539932727814, -0.2349320352077484, -0.017519626766443253, 0.0392494797706604, -0.008284155279397964, 0.046072788536548615, -0.08901071548461914, -0.09811883419752121, 0.035339102149009705, -0.05976126343011856, 0.065810926258564, -0.018838075920939445, -0.2146332859992981, -0.07112409174442291, 0.052724484354257584, -0.1326930820941925, 0.000027995720301987603, 0.12917199730873108, 0.037035390734672546, -0.0842403769493103, 0.05988330394029617, 0.0508774109184742, -0.06370504200458527, 0.0892421081662178, -0.06868936866521835, -0.25072649121284485, -0.020063797011971474, -0.17828387022018433, -0.032553307712078094, 0.08708612620830536, 0.11632290482521057, 0.08872655779123306, -0.00006621192733291537, 0.2029450237751007, -0.09343753755092621, -0.14433693885803223, -0.020677220076322556, -0.025641709566116333, 0.021918885409832, 0.0063001904636621475, -0.06892848759889603, -0.08353972434997559, -0.017468316480517387, -0.09385205060243607, 0.0766434520483017, 0.12405585497617722, 0.12143015116453171, 0.05421631038188934, 0.06637666374444962, -0.11465650051832199, -0.15397536754608154, 0.08714554458856583, -0.2045704424381256, -0.16709204018115997, -0.11812768876552582, -0.12450011074542999, -0.16356214880943298, 0.06616169959306717, 0.174140065908432, -0.12375354021787643, 0.03186650574207306, -0.28414514660835266, 0.008900011889636517, -0.10806304216384888, 0.18942376971244812, -0.024088209494948387, 0.042591556906700134, 0.007832092233002186, 0.0349455401301384, 0.023141000419855118, -0.03410668298602104, -0.10393888503313065, 0.053532905876636505, -0.16067750751972198, -0.12125031650066376, -0.02555604837834835, 0.07027161866426468, -0.09600196033716202, 0.013920605182647705, 0.03636270761489868, 0.01660086400806904, -0.05886314436793327, -0.01174229383468628, 0.10572846233844757, -0.11530284583568573, 0.2586054503917694, 0.013613997027277946, -0.07464207708835602, 0.06809347122907639, -0.046884533017873764, -0.11733639985322952, 0.20303654670715332, 0.23764315247535706, 0.07003242522478104, 0.041893985122442245, -0.029397187754511833, 0.014515234157443047, -0.1842404156923294, 0.029067715629935265, 0.10382717102766037, 0.0722527951002121, -0.12074433267116547, -0.056799981743097305, -0.01802990585565567, 0.14963451027870178, 0.02331770770251751, 0.12400369346141815, -0.2052278220653534, 0.010018178261816502, -0.029184134677052498, 0.07786925137042999, -0.031794242560863495, 0.03804655000567436, -0.014985771849751472, 0.010888329707086086, 0.15860742330551147, 0.06191538646817207, 0.12716726958751678, 0.12402207404375076, -0.15777890384197235, 0.11571875959634781, -0.07235810160636902, -0.14411060512065887, 0.015745285898447037, 0.02896602638065815, 0.02607819065451622, 0.034432411193847656, -0.016664089635014534, 0.10679548233747482, 0.08679304271936417, 0.05413772165775299, -0.03714284673333168, 0.11652259528636932, -0.08166705071926117, 0.18302389979362488, -0.09411589056253433, -0.10355687886476517, 0.0308800358325243, -0.09530892968177795, 0.02104204334318638, 0.05030669644474983, -0.20725223422050476, 0.05399329587817192, -0.023246118798851967, -0.028627639636397362, -0.1419491469860077, -0.0705302357673645, -0.12547294795513153, 0.2263907939195633, 0.13126133382320404, 0.07541296631097794, 0.017171286046504974, -0.014911876991391182, 0.08472621440887451, 0.16512276232242584, -0.08360663056373596, 0.08371549844741821, -0.040140096098184586, 0.02495766431093216, 0.031023576855659485, 0.1280430257320404, -0.08581918478012085, 0.29936277866363525, 0.07035244256258011, -0.040424685925245285, 0.041309040039777756, -0.12475616484880447, -0.15009915828704834, 0.13185395300388336, -0.03136589378118515, -0.08762174099683762, 0.04287895932793617, -0.11579598486423492, -0.06811308115720749, -0.11093110591173172, -0.17737998068332672, -0.111922487616539, -0.13852304220199585, -0.23345887660980225, -0.09946858137845993, 0.02472502738237381, -0.10413850098848343, 0.050586242228746414, -0.019905731081962585, -0.012038215063512325, 0.140187069773674, -0.06301618367433548, -0.08514681458473206, -0.012563034892082214, -0.01576300710439682, -0.08626885712146759, 0.1305343210697174, 0.15413229167461395, -0.2656301259994507, -0.021829549223184586, 0.015298515558242798, 0.014273148030042648, 0.0839231014251709, -0.26892349123954773, -0.03142181411385536, 0.21895121037960052, -0.021098187193274498, 0.04514874145388603, 0.08143642544746399, -0.19283536076545715, 0.05553073063492775, 0.09915631264448166, 0.17598457634449005, 0.1501976102590561, -0.09534812718629837, 0.03788159787654877, 0.2133447527885437, -0.004683161154389381, 0.024256357923150063, -0.13667899370193481, 0.003217014716938138, 0.016766197979450226, -0.21419313549995422, 0.16425420343875885, -0.0077412668615579605, 0.0187839362770319, -0.03407978639006615, 0.04258653149008751, 0.08725679665803909, -0.0018103966722264886, 0.05071355029940605, 0.04627544432878494, -0.13295316696166992, 0.06430324167013168, 0.08068623393774033, -0.05436613783240318, 0.002094001043587923, 0.07276128232479095, -0.04629341512918472, -0.0437101274728775, -0.016730666160583496, -0.010317271575331688, -0.09259451925754547, -0.19223448634147644, -0.08711789548397064, 0.12386981397867203, 0.0167570598423481, 0.059847142547369, -0.01936083287000656, 0.09423141181468964, 0.015174542553722858, -0.05245437100529671, -0.09671936929225922, -0.2319907397031784, -0.06993894279003143, -0.09916846454143524, 0.13796089589595795, -0.0492587648332119, -0.0354127436876297, 0.1095593199133873, -0.22334283590316772, -0.029722746461629868, 0.020172450691461563, 0.0526110902428627, -0.0016911564162001014, 0.045517824590206146, 0.016292257234454155, 0.07812581211328506, -0.06102275475859642, 0.01419486291706562, 0.09329685568809509, -0.1311737298965454, -0.14041352272033691, 0.08085861802101135, 0.013621391728520393, -0.05556381493806839, -0.043778128921985626, 0.04944998770952225, 0.022893032059073448, 0.05294841527938843, -0.25666362047195435, 0.05077900364995003, 0.0007995484629645944, 0.12507261335849762, -0.14430050551891327, -0.16758093237876892, -2.3933673301068324e-32, 0.0769951343536377, 0.0837678462266922, -0.13050507009029388, 0.031157229095697403, 0.03672430291771889, 0.010445928201079369, 0.055297743529081345, -0.1335231512784958, -0.12200484424829483, -0.06430432945489883, 0.09520675987005234, 0.13852937519550323, 0.0816345140337944, 0.061318349093198776, -0.21888335049152374, -0.05307953804731369, 0.005733055528253317, -0.20503506064414978, 0.052258510142564774, 0.052095405757427216, -0.013440213166177273, 0.07776758074760437, -0.09274525195360184, -0.07649078220129013, 0.07471879571676254, -0.17877760529518127, 0.03382328897714615, -0.1197456568479538, 0.293567419052124, 0.08347178250551224, -0.06919243186712265, 0.018495742231607437, -0.08593642711639404, 0.04635632038116455, -0.024510297924280167, 0.06690017133951187, -0.11344802379608154, 0.11633419245481491, -0.061802938580513, -0.07821548730134964, 0.11562636494636536, 0.06885430216789246, -0.08716373145580292, -0.018869943916797638, 0.07198888808488846, 0.11143957823514938, 0.09428464621305466, 0.1170269101858139, 0.047179121524095535, 0.016400238499045372, -0.03314175084233284, 0.024916168302297592, 0.017065715044736862, -0.05557400733232498, 0.05327236279845238, 0.05205089971423149, 0.1303459107875824, 0.087915800511837, -0.015420904383063316, -0.062028370797634125, -0.11685966700315475, -0.007620048243552446, 0.09191969782114029, -0.044338539242744446, 0.09723197668790817, -0.03817111253738403, 0.27333587408065796, -0.05652797594666481, -0.012018653564155102, 0.09480638802051544, 0.18622492253780365, 0.14361529052257538, -0.09229430556297302, -0.032414089888334274, -0.17737571895122528, -0.002534883562475443, -0.12317770719528198, 0.025138158351182938, -0.08353016525506973, 0.05245255306363106, 0.037137292325496674, 0.0456731952726841, -0.12980860471725464, 0.08709979802370071, 0.040688853710889816, -0.013746977783739567, -0.04387640208005905, -0.06545421481132507, -0.07402671873569489, -0.16299299895763397, 0.017030328512191772, -0.14925692975521088, -0.09495297819375992, 0.057639941573143005, 0.05391492694616318, 0.14368513226509094, -0.03047393448650837, 0.0567161925137043, 0.004434565547853708, 0.23522360622882843, 0.010529435239732265, 0.05242640897631645, 0.17133919894695282, -0.13656237721443176, 0.01747102104127407, 0.01933935657143593, 0.004023394547402859, -0.02931939624249935, -0.2666339576244354, 0.011225484311580658, 0.08271799981594086, 0.03824184089899063, -0.007116465829312801, 0.17228864133358002, 0.33417975902557373, 0.06928829103708267, -0.02864142879843712, -0.009667061269283295, 0.029001444578170776, 0.1471027284860611, -0.09815499931573868, 0.07846834510564804, 0.03782675042748451, 0.07758616656064987, -0.0044891973957419395, 0.10883744060993195, -0.10061678290367126, -0.05483303591609001, -0.06626448780298233, 0.006345071364194155, 0.07134003937244415, -0.14723196625709534, 7.505975645472063e-7, -0.06347869336605072, 0.14648254215717316, 0.06388261169195175, 0.06347032636404037, 0.03622414544224739, -0.05849805101752281, -0.22327499091625214, -0.013046348467469215, 0.009409510530531406, -0.05944572761654854, 0.1492094099521637, 0.045407380908727646, -0.056961871683597565, 0.08752837777137756, -0.13052813708782196, -0.00361829181201756, 0.021474294364452362, 0.02691098302602768, -0.06367139518260956, 0.006390068680047989, 0.0034367144107818604, 0.14750464260578156, -0.1282350718975067, -0.05894577130675316, 0.02037837915122509, -0.06590056419372559, -0.02852504886686802, 0.10059148818254471, -0.01284089032560587, 0.011217170394957066, -0.10629251599311829, 0.13706782460212708, -0.0675029531121254, 0.028162410482764244, 0.04860083386301994, 0.07435891032218933, -0.2453717291355133, -0.039298079907894135, 0.09508701413869858, -0.07094341516494751, -0.030476953834295273, 0.06763863563537598, -0.08795730024576187, 0.0979321226477623, 0.0725611075758934, -0.029895491898059845, -0.09250617772340775, -0.03649785742163658, 0.004865203518420458, 0.0014596832916140556, 0.011805175803601742, 0.013174186460673809, -0.01220534835010767, 0.000023369146219920367, -0.097889244556427, -0.039221759885549545, -0.048264648765325546, -0.11953209340572357, 0.04029279947280884, -0.016943806782364845, -0.04973673075437546, 0.01918906345963478, 0.04495231434702873, -0.09118238836526871, 0.1785687357187271, 0.23398517072200775, 0.03911328315734863, 9.825727689783106e-35, 0.11517840623855591, 0.034387048333883286, 0.030876124277710915, 0.024192484095692635, -0.09671321511268616, -0.017426611855626106, 0.015191109851002693, -0.09504237025976181, 0.010206162929534912, -0.0773087814450264, -0.11398257315158844 ]
https://github.com/huggingface/datasets/issues/6203
Support loading from a DVC remote repository
For the record, there was a `dvc.api.DVCFileSystem` bug which is fixed in DVC `main` and will be available in the next DVC release. To use DVC with `datasets` you just need to pass the Git/DVC repo `url` in `storage_options` as discussed above. (note that this requires having both `datasets` and `dvc` installed in your python environment) ```python >>> from datasets import load_dataset >>> load_dataset( ... "json", ... data_files="dvc://eval/metrics.json", ... storage_options={"url": "https://github.com/iterative/example-get-started.git"}, ... ) DatasetDict({ train: Dataset({ features: ['avg_prec', 'roc_auc'], num_rows: 1 }) }) ``` Any additional `DVCFileSystem` args can be passed in the same way, so to get a specific branch/tag/commit from the DVC repo you just need to specify the `rev` in `storage_options` like ``` storage_options={"url": "https://github.com/iterative/example-get-started.git", "rev": "main"} ``` I think this issue can probably be closed now.
### Feature request Adding support for loading a file from a DVC repository, tracked remotely on a SCM. ### Motivation DVC is a popular version control system to version and manage datasets. The files are stored on a remote object storage platform, but they are tracked using Git. Integration with DVC is possible through the `DVCFileSystem`. I have a Gitlab repository where multiple files are tracked using DVC and stored in a GCP bucket. I would like to be able to load these files using `datasets` directly using an URL. My goal is to write a generic code that abstracts the storage layer, such that my users will only have to pass in an `fsspec`-compliant URL and the corresponding files will be loaded. ### Your contribution I managed to instantiate a `DVCFileSystem` pointing to a Gitlab repo from a `fsspec` chained URL in [this pull request](https://github.com/iterative/dvc/pull/9903) to DVC. ```python from fsspec.core import url_to_fs fs, _ = url_to_fs("dvc::https://gitlab.com/repository/group/my-repo") ``` From now I'm not sure how to continue, it seems that `datasets` expects the URL to be fully qualified like so: `dvc::https://gitlab.com/repository/group/my-repo/my-folder/my-file.json` but this fails because `DVCFileSystem` expects the URL to point to the root of an SCM repo. Is there a way to make this work with `datasets`?
130
Support loading from a DVC remote repository ### Feature request Adding support for loading a file from a DVC repository, tracked remotely on a SCM. ### Motivation DVC is a popular version control system to version and manage datasets. The files are stored on a remote object storage platform, but they are tracked using Git. Integration with DVC is possible through the `DVCFileSystem`. I have a Gitlab repository where multiple files are tracked using DVC and stored in a GCP bucket. I would like to be able to load these files using `datasets` directly using an URL. My goal is to write a generic code that abstracts the storage layer, such that my users will only have to pass in an `fsspec`-compliant URL and the corresponding files will be loaded. ### Your contribution I managed to instantiate a `DVCFileSystem` pointing to a Gitlab repo from a `fsspec` chained URL in [this pull request](https://github.com/iterative/dvc/pull/9903) to DVC. ```python from fsspec.core import url_to_fs fs, _ = url_to_fs("dvc::https://gitlab.com/repository/group/my-repo") ``` From now I'm not sure how to continue, it seems that `datasets` expects the URL to be fully qualified like so: `dvc::https://gitlab.com/repository/group/my-repo/my-folder/my-file.json` but this fails because `DVCFileSystem` expects the URL to point to the root of an SCM repo. Is there a way to make this work with `datasets`? For the record, there was a `dvc.api.DVCFileSystem` bug which is fixed in DVC `main` and will be available in the next DVC release. To use DVC with `datasets` you just need to pass the Git/DVC repo `url` in `storage_options` as discussed above. (note that this requires having both `datasets` and `dvc` installed in your python environment) ```python >>> from datasets import load_dataset >>> load_dataset( ... "json", ... data_files="dvc://eval/metrics.json", ... storage_options={"url": "https://github.com/iterative/example-get-started.git"}, ... ) DatasetDict({ train: Dataset({ features: ['avg_prec', 'roc_auc'], num_rows: 1 }) }) ``` Any additional `DVCFileSystem` args can be passed in the same way, so to get a specific branch/tag/commit from the DVC repo you just need to specify the `rev` in `storage_options` like ``` storage_options={"url": "https://github.com/iterative/example-get-started.git", "rev": "main"} ``` I think this issue can probably be closed now.
[ -0.01315179280936718, 0.26730138063430786, -0.07292719930410385, -0.041754335165023804, 0.14398860931396484, 0.015223427675664425, 0.08281668275594711, -0.1174437627196312, 0.10011406242847443, 0.006358130369335413, 0.09567604959011078, -0.010701263323426247, -0.03683920204639435, -0.027693355455994606, 0.18246851861476898, 0.11072169244289398, -0.049605999141931534, -0.016253795474767685, 0.050347793847322464, 0.01725834794342518, -0.0023047279100865126, -0.005506427492946386, 0.10686775296926498, -0.09935023635625839, 0.07334665209054947, 0.04998062551021576, -0.0721336230635643, 0.11691325157880783, 0.08752007782459259, -0.12211496382951736, 0.2323734611272812, 0.11178716272115707, 0.10727056115865707, 0.14529505372047424, 0.000006313489848253084, -0.10547588765621185, 0.033259499818086624, 0.04932146519422531, -0.1816442459821701, -0.08952371776103973, 0.03219727426767349, -0.18133443593978882, -0.060301631689071655, -0.09526592493057251, 0.02896779589354992, -0.0007584319682791829, 0.0734594538807869, -0.17731672525405884, -0.031040694564580917, -0.022303732112050056, -0.08476729691028595, 0.006987486965954304, -0.11124838888645172, -0.21049660444259644, 0.02450638823211193, 0.27522388100624084, -0.025457853451371193, 0.4025140106678009, -0.016605744138360023, -0.018658500164747238, -0.07053148746490479, -0.030975056812167168, -0.07598073780536652, 0.1744774430990219, 0.05812160298228264, -0.041288163512945175, -0.17881359159946442, -0.11534137278795242, -0.012253385968506336, 0.1513024866580963, 0.06402141600847244, -0.05935347452759743, -0.06495285779237747, -0.02711496874690056, -0.025998463854193687, 0.02462189644575119, 0.0033224185463041067, -0.2320035994052887, -0.03566240519285202, 0.1064978614449501, -0.16731180250644684, -0.0885937437415123, -0.056765440851449966, -0.04452512413263321, -0.0781795009970665, 0.009201948530972004, -0.012997744604945183, -0.039163004606962204, -0.02244487591087818, -0.006644225679337978, 0.16801491379737854, -0.03715093061327934, -0.09096357971429825, -0.011524852365255356, 0.26324471831321716, 0.07577573508024216, 0.02712232619524002, -0.0692945346236229, 0.12048771977424622, -0.07294785231351852, 0.03279883787035942, -0.0053621577098965645, -0.17730315029621124, -0.03133603557944298, 0.052434828132390976, -0.022747745737433434, -0.10998290032148361, -0.003921604249626398, 0.12347400188446045, -0.06123478338122368, 0.041065797209739685, 0.13939769566059113, -0.08137079328298569, -0.25939908623695374, -0.05658680200576782, 0.019463874399662018, 0.015925917774438858, 0.09270958602428436, 0.09364083409309387, -0.15245772898197174, 0.12053009867668152, 0.07518012076616287, -0.037026286125183105, 0.12484252452850342, 0.04991269111633301, 0.10160502791404724, -0.007995820604264736, -0.10336284339427948, 0.020993202924728394, -0.042650725692510605, 0.005924573168158531, -0.15689438581466675, -0.0032850599382072687, 0.09879418462514877, 0.15910634398460388, -0.04768575355410576, 0.046842414885759354, -0.19662350416183472, 0.12135525047779083, 0.019039584323763847, 0.022466400638222694, 0.07107959687709808, -0.10188951343297958, -0.06264647096395493, 0.00451336894184351, 0.027585316449403763, 0.007191028445959091, 0.07604335993528366, -0.18233779072761536, 0.03997921198606491, -0.1882149577140808, 0.039571989327669144, -0.31447267532348633, 0.025586795061826706, -0.15256325900554657, -0.05407826974987984, -0.19183140993118286, -0.12630221247673035, -0.3222457766532898, -0.18371425569057465, 0.03913998603820801, -0.025673292577266693, 0.17593125998973846, 0.0045540183782577515, 0.26116329431533813, 0.024416612461209297, -0.04334034398198128, 0.04845941439270973, 0.05434434860944748, -0.11385153234004974, -0.017300713807344437, -0.11180968582630157, 0.01674644835293293, -0.09208070486783981, -0.13203071057796478, 0.11344169825315475, 0.13960137963294983, -0.055404048413038254, -0.0828717052936554, 0.21022337675094604, 0.0653323158621788, -0.013046120293438435, -0.0771322101354599, 0.004290060605853796, 0.12200719863176346, 0.07324107736349106, -0.23432841897010803, 0.16925674676895142, 0.04974563792347908, 0.04087115079164505, -0.11127442866563797, -0.09068574756383896, 0.022462546825408936, 0.10372630506753922, -0.08324216306209564, -0.04109126329421997, 0.09897706657648087, -0.1692022681236267, 0.12463436275720596, -0.1299179047346115, -0.1877625733613968, 0.07904360443353653, 0.021269183605909348, 0.05089576169848442, 0.06583869457244873, -0.0017669409280642867, -0.13466088473796844, 0.15960858762264252, 0.14486049115657806, -0.01350295078009367, -0.028816690668463707, 0.03192896768450737, -0.09937310218811035, 0.019564487040042877, -0.17844900488853455, -0.08964650332927704, -0.14473028481006622, 0.12444103509187698, -0.06079033389687538, 0.07845772057771683, -0.1196841150522232, 0.12235931307077408, 0.14630013704299927, -0.015243985690176487, 0.25525757670402527, 0.1257237195968628, 0.0819583311676979, -0.00431311409920454, 0.056877464056015015, -0.030806919559836388, -0.06342754513025284, -0.14846986532211304, 0.08769334107637405, 0.15601235628128052, -0.12133782356977463, 0.092031329870224, 0.04022873193025589, 0.12503333389759064, 0.0633944422006607, -0.11650777608156204, -0.020915135741233826, -0.025829019024968147, 0.1721000373363495, 0.029146505519747734, -0.0952349305152893, 0.03774811327457428, -0.06852424889802933, -0.05167883262038231, -0.01306411623954773, -0.008349910378456116, 0.3671049475669861, 0.12922866642475128, -0.1272726058959961, 0.18028698861598969, -0.008052551187574863, 0.05154344066977501, -0.004398516844958067, -0.0030788963194936514, -0.008701248094439507, -0.08657528460025787, 0.08750499784946442, 0.0123072424903512, 0.02269548922777176, 0.019613657146692276, 0.12662948668003082, -0.013456491753458977, 0.17087285220623016, -0.026578761637210846, 0.07489266991615295, 0.14851973950862885, -0.07865545898675919, 0.016396434977650642, -0.07508587092161179, -0.17751756310462952, 0.13571660220623016, -0.24780400097370148, -0.017070680856704712, 0.050084613263607025, -0.015058600343763828, 0.03770427033305168, -0.07615116238594055, -0.10607275366783142, 0.05038382112979889, -0.056308336555957794, 0.06810063123703003, -0.020686883479356766, -0.21823769807815552, -0.07615436613559723, 0.05203193798661232, -0.1451585441827774, 0.012806346639990807, 0.13671493530273438, 0.03438188508152962, -0.09137936681509018, 0.0637568011879921, 0.04993028566241264, -0.07963789254426956, 0.11220422387123108, -0.07037338614463806, -0.23746229708194733, -0.012785309925675392, -0.15646304190158844, -0.05087438225746155, 0.09935819357633591, 0.11181347817182541, 0.07692808657884598, -0.011461267247796059, 0.20298008620738983, -0.10485018789768219, -0.14515608549118042, -0.03948676958680153, -0.03333108499646187, 0.020729705691337585, -0.026955407112836838, -0.08084676414728165, -0.09634483605623245, -0.006592682097107172, -0.09390003234148026, 0.06880649924278259, 0.12019431591033936, 0.1325424760580063, 0.04750780761241913, 0.07487700879573822, -0.128982275724411, -0.16615736484527588, 0.08958696573972702, -0.22004595398902893, -0.1666552871465683, -0.11744729429483414, -0.13007579743862152, -0.1393176019191742, 0.06294413655996323, 0.18409772217273712, -0.13554853200912476, 0.03579092025756836, -0.2983282208442688, 0.026257144287228584, -0.09486179053783417, 0.17998363077640533, -0.0366375632584095, 0.0410894900560379, 0.010351533070206642, 0.025041094049811363, 0.02302061952650547, -0.03748304769396782, -0.08919885009527206, 0.050732508301734924, -0.1618465781211853, -0.1358502060174942, -0.02181515283882618, 0.05297927185893059, -0.09362955391407013, 0.012600425630807877, 0.044375233352184296, 0.02275855466723442, -0.05339517444372177, -0.0016167745925486088, 0.09800159931182861, -0.11766421794891357, 0.24259747564792633, 0.010614660568535328, -0.05684490501880646, 0.07518410682678223, -0.05036601424217224, -0.10287617146968842, 0.2104332447052002, 0.24396170675754547, 0.07292644679546356, 0.04891436547040939, -0.032642584294080734, -0.0012764879502356052, -0.1634310483932495, 0.017123477533459663, 0.11827914416790009, 0.06297392398118973, -0.15570271015167236, -0.05442916229367256, -0.012281647883355618, 0.18509232997894287, 0.022464795038104057, 0.14188382029533386, -0.20428599417209625, 0.00003489812297630124, -0.034899260848760605, 0.07081213593482971, -0.03470221161842346, 0.04270925000309944, -0.023534538224339485, 0.0023865671828389168, 0.1437719166278839, 0.06830459833145142, 0.1536809653043747, 0.14302028715610504, -0.14131265878677368, 0.10172698646783829, -0.05730751156806946, -0.16631124913692474, 0.00900840014219284, 0.030063876882195473, 0.02880389243364334, 0.041004832834005356, -0.03913440555334091, 0.12561000883579254, 0.07190766930580139, 0.04130566120147705, -0.040411561727523804, 0.12731492519378662, -0.08379556983709335, 0.20527426898479462, -0.09630365669727325, -0.10432854294776917, 0.021983273327350616, -0.080928273499012, 0.026247071102261543, 0.04551052674651146, -0.23741483688354492, 0.05982984974980354, -0.005478255916386843, -0.03138206526637077, -0.11927273869514465, -0.07095319777727127, -0.1246650293469429, 0.19617171585559845, 0.14025357365608215, 0.08190123736858368, 0.0013155237538740039, -0.01256805844604969, 0.07974947988986969, 0.16045884788036346, -0.08099144697189331, 0.08411498367786407, -0.02187502197921276, 0.024374738335609436, 0.04123634845018387, 0.1284075826406479, -0.09535495191812515, 0.27391955256462097, 0.06868802756071091, -0.04193701967597008, 0.05096504092216492, -0.11053809523582458, -0.16476522386074066, 0.12832945585250854, -0.03343372792005539, -0.09538444876670837, 0.052263043820858, -0.09531492739915848, -0.06866735965013504, -0.1116807609796524, -0.18442416191101074, -0.11935965716838837, -0.14430342614650726, -0.21330447494983673, -0.09846015274524689, 0.032789915800094604, -0.10866914689540863, 0.04482275992631912, -0.017369765788316727, -0.02576931193470955, 0.1292622685432434, -0.04367752745747566, -0.08208955079317093, 0.00005985202005831525, -0.018316414207220078, -0.0902966782450676, 0.09982196986675262, 0.15490728616714478, -0.25442802906036377, -0.029050881043076515, -0.007339245639741421, -0.0036379441153258085, 0.0739983394742012, -0.25833019614219666, -0.035671036690473557, 0.20365770161151886, -0.02232411317527294, 0.04258813336491585, 0.07601359486579895, -0.1733887493610382, 0.042774707078933716, 0.07869576662778854, 0.155867338180542, 0.140829935669899, -0.06871829181909561, 0.0559571199119091, 0.22720518708229065, -0.014398426748812199, 0.013180970214307308, -0.13121680915355682, 0.010921337641775608, 0.009142526425421238, -0.21817609667778015, 0.16600613296031952, -0.019818458706140518, 0.0225310567766428, -0.04793364927172661, 0.0535895861685276, 0.06504806876182556, 0.0029508008155971766, 0.04729311168193817, 0.04833369329571724, -0.13215000927448273, 0.06679350137710571, 0.08335612714290619, -0.04885721206665039, -0.0062324353493750095, 0.05930450186133385, -0.06320957094430923, -0.03123241290450096, -0.010879259556531906, -0.004771871492266655, -0.08863335847854614, -0.19306813180446625, -0.09469418227672577, 0.11243068426847458, 0.03753994405269623, 0.062155887484550476, -0.01539134606719017, 0.08771798759698868, 0.015589750371873379, -0.059207733720541, -0.09631489962339401, -0.2454788088798523, -0.07197249680757523, -0.08117878437042236, 0.133476123213768, -0.04454340413212776, -0.0394679419696331, 0.09702059626579285, -0.23087336122989655, -0.023990891873836517, 0.03316618502140045, 0.036764536052942276, 0.0022949485573917627, 0.042403072118759155, 0.007096605841070414, 0.06760621070861816, -0.07474862784147263, 0.01557095441967249, 0.08935170620679855, -0.1390247792005539, -0.1401376575231552, 0.08033771812915802, 0.009365725331008434, -0.05679783970117569, -0.04422816261649132, 0.05948967859148979, 0.011362136341631413, 0.06775519996881485, -0.2753880023956299, 0.04927853122353554, -0.022975511848926544, 0.10609174519777298, -0.1375707983970642, -0.14847134053707123, -2.383473341092755e-32, 0.07456479966640472, 0.0824095755815506, -0.14200261235237122, 0.0126505047082901, 0.04012037441134453, -0.005742750596255064, 0.07059919089078903, -0.14862552285194397, -0.11145524680614471, -0.06657009571790695, 0.10918539762496948, 0.13502247631549835, 0.07512307167053223, 0.043068189173936844, -0.20301666855812073, -0.03174709901213646, 0.0024614878930151463, -0.21921201050281525, 0.05104472488164902, 0.0575605072081089, -0.020271990448236465, 0.08016356080770493, -0.1141107976436615, -0.056401532143354416, 0.07722464948892593, -0.17927558720111847, 0.05049910768866539, -0.10236122459173203, 0.28990697860717773, 0.09869486093521118, -0.05736047029495239, -0.007759093772619963, -0.09899139404296875, 0.06446677446365356, -0.0016004771459847689, 0.07712311297655106, -0.12938089668750763, 0.11739649623632431, -0.05362320691347122, -0.09454572200775146, 0.13135558366775513, 0.0510614737868309, -0.10178957879543304, 0.0058847893960773945, 0.07209885865449905, 0.10080736875534058, 0.09486384689807892, 0.13097184896469116, 0.05707225576043129, -0.010541819967329502, -0.027219103649258614, 0.03707990050315857, 0.028039155527949333, -0.05732257664203644, 0.04994046688079834, 0.07826226204633713, 0.15030856430530548, 0.0845220610499382, -0.014819723553955555, -0.06416278332471848, -0.1251915693283081, 0.015400019474327564, 0.08953194320201874, -0.05416106432676315, 0.09396812319755554, -0.02039794623851776, 0.27301153540611267, -0.08480088412761688, -0.013742037117481232, 0.09869115799665451, 0.1940440833568573, 0.16323153674602509, -0.08735856413841248, -0.029176436364650726, -0.17517027258872986, 0.0021485101897269487, -0.12272052466869354, 0.025336753576993942, -0.08834074437618256, 0.05565554276108742, 0.025100136175751686, 0.04642972722649574, -0.12407161295413971, 0.0886947512626648, 0.06268255412578583, -0.009285056963562965, -0.044305846095085144, -0.05929797515273094, -0.07864859700202942, -0.15807411074638367, 0.025303790345788002, -0.14170734584331512, -0.08986983448266983, 0.05831340700387955, 0.07520876079797745, 0.11640648543834686, -0.03044186159968376, 0.06180020421743393, 0.02559645101428032, 0.2381851226091385, 0.02711590565741062, 0.05241117626428604, 0.17872574925422668, -0.11824105679988861, 0.010860313661396503, 0.025540530681610107, 0.00423804996535182, -0.02404078282415867, -0.2562628388404846, 0.027541160583496094, 0.08926636725664139, 0.035156168043613434, -0.013757763430476189, 0.17489531636238098, 0.31012168526649475, 0.06838632375001907, -0.02226709946990013, -0.010437856428325176, 0.026793397963047028, 0.1595139354467392, -0.10143107175827026, 0.07584024220705032, 0.06656212359666824, 0.09680763632059097, -0.013570481911301613, 0.11247521638870239, -0.08931194990873337, -0.03581538423895836, -0.0633111223578453, 0.003168020863085985, 0.07515975087881088, -0.14406262338161469, 7.532511290264665e-7, -0.05203164741396904, 0.14289326965808868, 0.049027472734451294, 0.035785239189863205, 0.03571780398488045, -0.05718135088682175, -0.20706410706043243, -0.006455210968852043, 0.029820704832673073, -0.07274683564901352, 0.14729532599449158, 0.04996028169989586, -0.04048618674278259, 0.07872261852025986, -0.1366126984357834, -0.010633938945829868, 0.042492348700761795, 0.028668686747550964, -0.05205687880516052, -0.006449820939451456, 0.005606262944638729, 0.12946027517318726, -0.1370232254266739, -0.07162117213010788, 0.031373146921396255, -0.05938209593296051, -0.026524517685174942, 0.09390042722225189, -0.01595000922679901, 0.01382435392588377, -0.09937294572591782, 0.14101667702198029, -0.0761728435754776, -0.00047164244460873306, 0.03622524067759514, 0.08692032098770142, -0.22759178280830383, -0.022655459120869637, 0.08617998659610748, -0.08696644008159637, -0.023074734956026077, 0.0692514106631279, -0.09533648192882538, 0.08771716803312302, 0.046933434903621674, -0.015879029408097267, -0.08409524708986282, -0.034632712602615356, -0.000712424807716161, -0.013427001424133778, 0.01659335009753704, 0.011274958029389381, -0.0008771501015871763, -0.008341329172253609, -0.09126973152160645, -0.038375645875930786, -0.03492293879389763, -0.13515853881835938, 0.03922027722001076, -0.012453878298401833, -0.031147871166467667, 0.0062118759378790855, 0.049047648906707764, -0.07119625061750412, 0.19239787757396698, 0.22159579396247864, 0.028999341651797295, 1.1054269667017355e-34, 0.11240699887275696, 0.058874767273664474, 0.025969453155994415, 0.036825988441705704, -0.08990663290023804, -0.021843599155545235, 0.028595156967639923, -0.0961802676320076, 0.005104220937937498, -0.09694638848304749, -0.13059964776039124 ]
https://github.com/huggingface/datasets/issues/6202
avoid downgrading jax version
https://github.com/huggingface/datasets/blob/main/setup.py#L236 Currently has the highest version at 0.3.25; Not sure if there is any reason for this, other than that was the tested version?
### Feature request Whenever I `pip install datasets[jax]` it downgrades jax to version 0.3.25. I seem to be able to install this library first then upgrade jax back to version 0.4.13. ### Motivation It would be nice to not overwrite currently installed version of jax if possible. ### Your contribution I would be willing to beta test. Or maybe write some code if I could get pointed in the right direction, I'm not super familiar with this codebase.
24
avoid downgrading jax version ### Feature request Whenever I `pip install datasets[jax]` it downgrades jax to version 0.3.25. I seem to be able to install this library first then upgrade jax back to version 0.4.13. ### Motivation It would be nice to not overwrite currently installed version of jax if possible. ### Your contribution I would be willing to beta test. Or maybe write some code if I could get pointed in the right direction, I'm not super familiar with this codebase. https://github.com/huggingface/datasets/blob/main/setup.py#L236 Currently has the highest version at 0.3.25; Not sure if there is any reason for this, other than that was the tested version?
[ -0.09076640754938126, 0.2903248071670532, -0.10501688718795776, -0.07031256705522537, 0.22733283042907715, 0.11700958013534546, -0.023557212203741074, 0.12783083319664001, -0.056137051433324814, 0.17492792010307312, -0.021641768515110016, 0.10741761326789856, 0.04077395796775818, 0.12829774618148804, -0.1431824415922165, 0.017160849645733833, -0.14523352682590485, 0.10540734976530075, -0.01445941161364317, -0.006584986578673124, -0.07171203196048737, 0.051003582775592804, 0.18852323293685913, -0.08827392756938934, 0.06362609565258026, 0.08494551479816437, 0.06464450806379318, -0.011841442435979843, -0.15429025888442993, -0.18224865198135376, 0.19947363436222076, 0.01789318583905697, 0.16537991166114807, 0.08945251256227493, 0.0000066381721808284055, 0.1042918860912323, 0.030933091416954994, 0.08116412907838821, -0.11200133711099625, -0.04529277980327606, -0.09606996923685074, -0.14803116023540497, 0.10432751476764679, -0.025614440441131592, -0.03743884339928627, 0.05364805832505226, -0.09316161274909973, -0.05540785938501358, 0.2517731487751007, -0.01792076602578163, 0.02654416672885418, 0.057840462774038315, 0.10700418055057526, -0.0733601525425911, 0.12535971403121948, 0.11909075826406479, -0.045523710548877716, 0.0974949523806572, -0.1228032112121582, 0.045442868024110794, -0.005648233462125063, 0.10284467041492462, 0.012874101288616657, 0.08160671591758728, -0.1323963701725006, -0.041454680263996124, 0.09897716343402863, 0.0596020333468914, 0.13426701724529266, 0.12086664140224457, 0.1375046670436859, -0.1986762136220932, -0.1432400941848755, 0.05068175494670868, -0.009446131065487862, -0.2612898349761963, 0.02061624825000763, -0.1200721338391304, 0.17829196155071259, -0.09395277500152588, -0.06809113919734955, 0.060144390910863876, -0.07276520878076553, -0.01950724422931671, -0.08284704387187958, 0.16368961334228516, -0.034008998423814774, 0.007903720252215862, -0.1635865420103073, -0.11925532668828964, 0.14744991064071655, -0.0035133848432451487, -0.11755052953958511, -0.04099976643919945, -0.04845808446407318, -0.01954643987119198, -0.044393640011548996, -0.04780437424778938, -0.02751990593969822, -0.03172316402196884, 0.07336103171110153, 0.03337676450610161, -0.05889451131224632, 0.008647583425045013, -0.00925607793033123, -0.12648378312587738, 0.11087016016244888, -0.04056963697075844, 0.13503272831439972, 0.18572354316711426, 0.19913560152053833, 0.11724571138620377, 0.09838392585515976, -0.06401964277029037, -0.12768931686878204, 0.1500963270664215, 0.19858001172542572, 0.08716971427202225, -0.029234055429697037, -0.040549710392951965, 0.027436338365077972, 0.13707497715950012, -0.18845006823539734, 0.012924722395837307, 0.01629609242081642, 0.07491492480039597, 0.005545604042708874, -0.026265541091561317, -0.06667416542768478, -0.05920847877860069, 0.09390480816364288, -0.04332797974348068, 0.0753246545791626, 0.043594807386398315, 0.04884753003716469, 0.08923579007387161, 0.05949217453598976, -0.03506573289632797, -0.05171196907758713, -0.04324555769562721, 0.17224088311195374, -0.03467642888426781, -0.045988619327545166, -0.06483523547649384, -0.06303919851779938, -0.05701012536883354, 0.05553561821579933, -0.07443052530288696, -0.142094224691391, -0.06807448714971542, -0.06067289039492607, 0.1469106525182724, -0.07708245515823364, 0.022833367809653282, -0.0398852601647377, 0.03841265290975571, -0.019071562215685844, -0.05076481029391289, -0.15993669629096985, -0.11135369539260864, 0.07429705560207367, -0.028602520003914833, -0.02471083402633667, 0.03004571795463562, 0.014640402048826218, 0.18269294500350952, 0.1238628700375557, 0.01288893073797226, 0.019603222608566284, -0.033960357308387756, -0.049002762883901596, -0.3445630967617035, 0.06536451727151871, -0.11535441875457764, -0.08491276949644089, -0.03301820904016495, -0.12476009130477905, -0.0914422795176506, -0.13450300693511963, -0.0918305516242981, 0.01838678866624832, 0.0007603823323734105, 0.030079850926995277, 0.07938006520271301, -0.04407237470149994, 0.026181858032941818, -0.12709730863571167, -0.003090587444603443, -0.056383900344371796, -0.04782536253333092, -0.06615284830331802, -0.06077881529927254, 0.08102866262197495, -0.013122000731527805, -0.13903497159481049, -0.08327887952327728, 0.08207742869853973, 0.11494310200214386, 0.15984134376049042, -0.08391221612691879, -0.06422828882932663, -0.004851305391639471, -0.03573058918118477, -0.10390206426382065, 0.03135582059621811, -0.16651248931884766, -0.10419114679098129, 0.10791588574647903, 0.1581144779920578, -0.07742071151733398, -0.09498781710863113, -0.02253447100520134, -0.11287543922662735, 0.029963184148073196, -0.06225891411304474, 0.0025417006108909845, -0.041866276413202286, 0.08225154876708984, 0.1041153147816658, 0.05717960372567177, 0.03506869077682495, 0.09276340156793594, 0.12892858684062958, 0.041754357516765594, -0.262956440448761, -0.07298996299505234, 0.20681163668632507, 0.027205439284443855, 0.20048952102661133, -0.062485221773386, 0.07467453181743622, -0.0440954864025116, 0.11248276382684708, 0.03076772578060627, -0.029587581753730774, 0.14863058924674988, 0.0693003460764885, -0.05439275875687599, 0.04149111732840538, 0.17857031524181366, -0.13522861897945404, 0.1659475415945053, -0.2088644653558731, 0.06483568251132965, 0.004692584741860628, 0.08065888285636902, 0.0626162514090538, 0.10963372141122818, 0.02382713183760643, -0.08258400112390518, 0.18271902203559875, 0.08725347369909286, -0.25767746567726135, -0.12354788929224014, -0.10832802206277847, 0.12127538025379181, -0.026722067967057228, 0.11438760161399841, 0.07741846889257431, -0.15381255745887756, 0.15466201305389404, 0.2553700804710388, -0.06643714755773544, -0.01584063284099102, 0.11647128313779831, 0.09082360565662384, 0.03958079218864441, 0.18689121305942535, -0.19416868686676025, 0.14105555415153503, 0.1724827140569687, 0.12588253617286682, -0.06629599630832672, -0.07407751679420471, -0.1121000424027443, -0.06684372574090958, 0.1139623150229454, 0.14139261841773987, 0.0843956470489502, -0.023596229031682014, -0.1125880554318428, 0.1565990298986435, -0.023636862635612488, -0.13208404183387756, 0.1427135318517685, -0.0023767752572894096, -0.09680092334747314, -0.07118076086044312, -0.15900008380413055, -0.11728323996067047, -0.23315611481666565, -0.06110290437936783, 0.006311097182333469, -0.017997903749346733, -0.11783064901828766, 0.03920512646436691, -0.20259998738765717, -0.20628412067890167, -0.09607456624507904, -0.08229201287031174, 0.09751641005277634, 0.12084706872701645, 0.04306640475988388, -0.07504362612962723, -0.004798844922333956, 0.005381855182349682, 0.1124020516872406, 0.025404954329133034, -0.14367994666099548, -0.3290109932422638, -0.21364624798297882, -0.0008729866240173578, 0.003513139206916094, 0.018261978402733803, 0.037185199558734894, -0.04960882291197777, -0.041549909859895706, -0.013363284058868885, -0.028668377548456192, -0.09083668887615204, -0.007284412160515785, -0.014759425073862076, 0.0059196362271904945, 0.09733511507511139, 0.0962759330868721, -0.11929626017808914, 0.06999995559453964, -0.14365728199481964, 0.004297769628465176, 0.052069246768951416, -0.056169360876083374, 0.05992968752980232, -0.06494323164224625, -0.20680192112922668, 0.1245613545179367, 0.007149118930101395, -0.016307391226291656, 0.05872338265180588, 0.09901251643896103, 0.008136030286550522, 0.1473352462053299, 0.08323788642883301, 0.006148793268948793, 0.04744454845786095, 0.027858015149831772, -0.16903528571128845, 0.003000627737492323, -0.03353666141629219, 0.078712597489357, 0.03706217184662819, -0.05946916714310646, -0.06301373243331909, 0.011521897278726101, -0.05227159336209297, -0.014648869633674622, 0.14797106385231018, -0.2157457321882248, 0.08894564211368561, 0.019702307879924774, 0.13615280389785767, -0.09229551255702972, -0.045596808195114136, 0.1177181750535965, -0.10232935100793839, -0.07110119611024857, -0.009130202233791351, 0.17917414009571075, 0.10604702681303024, -0.03201432526111603, -0.021674180403351784, -0.22433681786060333, -0.1597692370414734, -0.012665200978517532, -0.08328556269407272, 0.010046923533082008, 0.12859953939914703, -0.04701893776655197, -0.05091502517461777, 0.21618717908859253, -0.09098943322896957, 0.07977136224508286, -0.02385510504245758, 0.0037509079556912184, 0.04561374709010124, -0.010389774106442928, 0.17978142201900482, -0.027626674622297287, -0.07918962836265564, -0.16632138192653656, 0.07328887283802032, 0.060964107513427734, 0.026960233226418495, 0.11184421926736832, -0.07334090024232864, 0.04087987169623375, -0.06668856739997864, 0.10698851943016052, 0.008657378144562244, -0.021450769156217575, -0.013102106750011444, -0.0197020061314106, -0.11636154353618622, -0.06238505616784096, 0.10065309703350067, 0.13991934061050415, 0.03310287371277809, -0.11938692629337311, 0.05950910970568657, -0.0004517369670793414, -0.01273149624466896, 0.22609588503837585, 0.12288090586662292, 0.08602406084537506, -0.04602774605154991, 0.1139897033572197, 0.05967383459210396, -0.026617353782057762, 0.15141943097114563, -0.04078798368573189, -0.09186708182096481, 0.05219316482543945, -0.10021905601024628, 0.03444627672433853, -0.08354885131120682, 0.12883155047893524, -0.033284928649663925, -0.18212947249412537, -0.19363227486610413, -0.08958972990512848, -0.05884440988302231, 0.010532842017710209, 0.17012588679790497, 0.15900740027427673, -0.02684241719543934, 0.35343167185783386, 0.0011349554406479, -0.0038594871293753386, -0.24548466503620148, -0.08305612206459045, -0.2643018960952759, 0.05022212490439415, -0.06515884399414062, 0.08655232191085815, -0.09224959462881088, 0.08630254119634628, -0.15409602224826813, 0.00880626030266285, 0.01205134205520153, -0.13214372098445892, -0.04120393097400665, 0.021764937788248062, -0.0328809954226017, -0.005906612146645784, 0.02289893850684166, 0.1390887051820755, 0.002630684757605195, -0.10600880533456802, 0.03555383160710335, 0.022519448772072792, -0.0877547636628151, 0.1397891789674759, -0.06974422931671143, 0.11594854295253754, 0.11625436693429947, 0.0612938366830349, 0.21997137367725372, 0.24161691963672638, 0.016917642205953598, 0.07563046365976334, -0.09026507288217545, -0.048831067979335785, -0.060329679399728775, 0.02591978944838047, 0.0974184051156044, 0.03750446066260338, 0.1632222682237625, 0.044226981699466705, -0.0850457176566124, -0.11660894006490707, -0.08404549956321716, 0.23762935400009155, -0.12078952044248581, 0.020881155505776405, -0.17739543318748474, -0.025489168241620064, 0.026442645117640495, -0.041366368532180786, 0.009659158065915108, -0.04739106073975563, 0.17037180066108704, -0.23642092943191528, 0.08380692452192307, 0.0413237102329731, 0.027621546760201454, 0.1396220177412033, 0.07329954952001572, -0.11166679114103317, 0.007934104651212692, -0.04216774180531502, 0.047759171575307846, 0.014761018566787243, -0.036852672696113586, 0.04621880128979683, -0.15786407887935638, -0.09503352642059326, -0.060727473348379135, -0.01450409647077322, -0.06241019442677498, -0.011977309361100197, 0.05401692911982536, -0.08169535547494888, 0.1696697324514389, -0.16216298937797546, 0.06301863491535187, -0.06378629058599472, -0.03948512300848961, -0.0527411550283432, 0.06972020119428635, 0.050048764795064926, 0.030474958941340446, -0.020058169960975647, -0.07563000917434692, -0.0901302769780159, 0.040492407977581024, -0.09568557888269424, -0.1737157553434372, -0.1120331659913063, 0.019545825198292732, 0.08327515423297882, 0.19071784615516663, -0.000430366606451571, 0.16114158928394318, -0.026378998532891273, 0.019348373636603355, -0.05763727053999901, 0.03957410529255867, 0.07147978246212006, 0.06775664538145065, -0.007705632597208023, -0.02342938259243965, 0.06970331817865372, -0.20433588325977325, -0.12564612925052643, 0.04905564337968826, 0.08293591439723969, -0.07287629693746567, 0.0009800017578527331, -0.13727383315563202, 0.042677897959947586, 0.0962425097823143, 0.07883840054273605, 0.0608689971268177, -0.09815432876348495, 0.061592068523168564, 0.019042793661355972, -2.3464467384097915e-32, -0.03017713688313961, 0.14460627734661102, -0.08065561950206757, 0.07244221121072769, -0.018669065088033676, 0.06466936320066452, -0.0051190597005188465, -0.15190553665161133, -0.08519043773412704, -0.23597152531147003, -0.048890575766563416, 0.004416545853018761, 0.010117027908563614, -0.0646732822060585, -0.035019878298044205, -0.013787584379315376, 0.0904666855931282, -0.05796641483902931, -0.08377581834793091, -0.006240023300051689, 0.17961344122886658, -0.11259999126195908, 0.021260634064674377, -0.1730385720729828, -0.03411607816815376, 0.027888722717761993, -0.14152944087982178, 0.04362892732024193, -0.1252608746290207, -0.040789101272821426, 0.08426906913518906, 0.09366875886917114, 0.02726920135319233, -0.020923329517245293, -0.15904343128204346, 0.004436447285115719, -0.03455065190792084, -0.03369927033782005, -0.25392597913742065, -0.062032487243413925, 0.1693854033946991, 0.08008995652198792, -0.004842040594667196, -0.017734646797180176, 0.0873069018125534, 0.061090365052223206, 0.021922066807746887, -0.16381576657295227, -0.050727374851703644, -0.1103275790810585, -0.12521816790103912, -0.07603170722723007, 0.003794595366343856, -0.0402677021920681, 0.03954277187585831, 0.014608529396355152, 0.09280061721801758, -0.1375327706336975, -0.04515666887164116, 0.13161486387252808, 0.1785874217748642, -0.02865246869623661, -0.07331889122724533, -0.057524148374795914, 0.03876513987779617, -0.04943421110510826, 0.05864615738391876, -0.013972046785056591, 0.12719668447971344, -0.062053948640823364, 0.04312359169125557, -0.13789767026901245, 0.012513754889369011, -0.023011785000562668, -0.02489379234611988, -0.15773575007915497, -0.02211618423461914, 0.04238147661089897, 0.04861191287636757, 0.10187399387359619, -0.10307256877422333, -0.1772753894329071, 0.058377571403980255, 0.06471627205610275, -0.05919827148318291, 0.17241953313350677, -0.03197086229920387, 0.016098031774163246, -0.11014854907989502, -0.09431708604097366, -0.04339614510536194, 0.03804115206003189, -0.03770143538713455, -0.17239928245544434, -0.15723931789398193, 0.19387014210224152, -0.035318128764629364, 0.08713603019714355, -0.03911615163087845, 0.009747232310473919, 0.006668201182037592, -0.055186979472637177, 0.08851809054613113, -0.12088941782712936, 0.048675015568733215, -0.10258328914642334, 0.16291439533233643, -0.006552424281835556, -0.15882202982902527, -0.05756785720586777, -0.035237256437540054, -0.035619158297777176, 0.1055566743016243, 0.06643716245889664, 0.10235651582479477, -0.01569685898721218, 0.06237324699759483, 0.012209216132760048, 0.055103372782468796, 0.16185398399829865, -0.18949748575687408, 0.24706503748893738, 0.021360671147704124, -0.016980282962322235, 0.1439458429813385, 0.1488044559955597, -0.015569709241390228, 0.028667064383625984, 0.02717963233590126, 0.07996727526187897, 0.0005272891721688211, -0.16181236505508423, 7.670143986615585e-7, -0.2164357453584671, 0.10766196250915527, -0.04831232130527496, -0.1467306911945343, 0.03578004613518715, 0.1156582310795784, -0.0950862243771553, 0.0136762335896492, -0.02895178832113743, 0.04942294955253601, 0.1891605108976364, -0.19505873322486877, 0.025517622008919716, 0.07194863259792328, 0.0746520459651947, 0.04155842959880829, -0.026469742879271507, -0.15298974514007568, -0.045824192464351654, -0.12877920269966125, 0.18508067727088928, 0.046677231788635254, 0.00338132050819695, -0.053960394114255905, -0.024294981732964516, 0.09494532644748688, -0.034064099192619324, 0.07556243240833282, 0.11893317103385925, 0.04237643629312515, -0.026578301563858986, -0.09404449909925461, 0.07457231730222702, -0.018355311825871468, -0.1251029074192047, -0.1777178794145584, -0.18102145195007324, -0.1217309758067131, -0.07669723033905029, -0.02633688971400261, 0.08779368549585342, 0.24369561672210693, -0.11043935269117355, 0.08290256559848785, 0.126974418759346, 0.04283367469906807, -0.09336158633232117, -0.08931802958250046, 0.04304661601781845, -0.008411572314798832, -0.0066677276045084, 0.15819884836673737, -0.1540544033050537, 0.19925469160079956, 0.017496543005108833, -0.056995976716279984, -0.0030995425768196583, -0.1366218477487564, 0.08773738145828247, -0.1454075276851654, -0.0861443504691124, -0.19872939586639404, 0.06297723948955536, 0.056823261082172394, 0.15995994210243225, -0.1332225352525711, 0.09198949486017227, 2.083517359906945e-34, 0.09431376308202744, -0.0001066137119778432, 0.1150287315249443, -0.01486111432313919, -0.032396771013736725, 0.07904451340436935, 0.31035128235816956, -0.048907939344644547, 0.06445451825857162, -0.017840517684817314, -0.02334580384194851 ]
https://github.com/huggingface/datasets/issues/6199
Use load_dataset for local json files, but it not works
Hugging Face's datasets library may prioritize remote configurations. Make sure there are no conflicting configurations causing the library to prefer downloading data May be try debugging raw_datasets = load_dataset('json', data_files=data_files) print(raw_datasets)
### Describe the bug when I use load_dataset to load my local datasets,it always goes to Hugging Face to download the data instead of loading the local dataset. ### Steps to reproduce the bug `raw_datasets = load_dataset( β€˜json’, data_files=data_files)` ### Expected behavior ![image](https://github.com/huggingface/datasets/assets/50519434/add3747f-6481-4da7-b374-8f81c5a6472c) ### Environment info python version 3.8.5 datasets version 2.12 os version unbuntu 18.04
31
Use load_dataset for local json files, but it not works ### Describe the bug when I use load_dataset to load my local datasets,it always goes to Hugging Face to download the data instead of loading the local dataset. ### Steps to reproduce the bug `raw_datasets = load_dataset( β€˜json’, data_files=data_files)` ### Expected behavior ![image](https://github.com/huggingface/datasets/assets/50519434/add3747f-6481-4da7-b374-8f81c5a6472c) ### Environment info python version 3.8.5 datasets version 2.12 os version unbuntu 18.04 Hugging Face's datasets library may prioritize remote configurations. Make sure there are no conflicting configurations causing the library to prefer downloading data May be try debugging raw_datasets = load_dataset('json', data_files=data_files) print(raw_datasets)
[ 0.008477318100631237, 0.05513089895248413, -0.006237110588699579, 0.1101326271891594, 0.1575523316860199, 0.04270912706851959, 0.16630980372428894, -0.11590257287025452, 0.19695721566677094, 0.12402711063623428, -0.1147971823811531, -0.019111817702651024, -0.005602346733212471, 0.01791309379041195, 0.08687702566385269, -0.03341829776763916, -0.09374358505010605, -0.009799432009458542, 0.024666540324687958, -0.02048155479133129, -0.07693541049957275, 0.06069519370794296, 0.1026749461889267, -0.04952383041381836, 0.08686984330415726, 0.08033183217048645, 0.020052717998623848, 0.14189566671848297, 0.06425854563713074, -0.09532270580530167, 0.13681192696094513, 0.01993708126246929, 0.05557749792933464, 0.16682769358158112, 0.00000673002023177105, 0.04830123856663704, 0.09193582087755203, 0.058610353618860245, -0.09911882132291794, -0.143447145819664, 0.10215825587511063, -0.19583237171173096, 0.019849557429552078, -0.008077885955572128, -0.0665358379483223, -0.1829366236925125, -0.022226225584745407, -0.06644285470247269, 0.07198549807071686, -0.005009129177778959, -0.08837106078863144, 0.06558989733457565, -0.10541275888681412, -0.18967559933662415, 0.020681459456682205, 0.16188906133174896, -0.011816535145044327, 0.1504235714673996, -0.20425346493721008, -0.13694354891777039, -0.08215869218111038, -0.11864998191595078, -0.0344511903822422, 0.11634184420108795, -0.07325095683336258, 0.014820520766079426, -0.1958761215209961, -0.11392199248075485, 0.03155099228024483, 0.24530071020126343, -0.020861169323325157, 0.08021382242441177, -0.04114273190498352, -0.11390165984630585, -0.07875724136829376, -0.0018006025347858667, -0.02641674503684044, -0.04366077855229378, -0.13204284012317657, 0.15568673610687256, -0.3075762689113617, -0.11268989741802216, -0.036096666008234024, -0.03863004595041275, -0.1508951336145401, -0.014284608885645866, -0.11809276789426804, 0.021359404549002647, 0.017606060951948166, -0.030123163014650345, 0.09209141880273819, 0.015152455307543278, -0.06670281291007996, -0.08944027870893478, 0.13442827761173248, 0.07063082605600357, 0.017379693686962128, -0.024312280118465424, 0.02578975446522236, 0.02368270419538021, -0.054979242384433746, -0.04336419701576233, -0.14483821392059326, 0.10704468935728073, 0.09089641273021698, -0.13379549980163574, 0.12015906721353531, -0.10893028229475021, 0.01600749045610428, 0.024826964363455772, 0.00944374781101942, 0.12209264189004898, -0.05422886833548546, -0.05380777269601822, -0.03394245728850365, -0.0890185758471489, 0.04245493933558464, 0.06642409414052963, 0.05762515217065811, 0.021760210394859314, 0.11932875216007233, 0.017929047346115112, -0.024531289935112, 0.21902035176753998, -0.011136147193610668, -0.027249423786997795, -0.11392171680927277, 0.11284063011407852, -0.06579098105430603, -0.039576705545186996, 0.01828916370868683, -0.12870165705680847, 0.04778704419732094, -0.004050284158438444, 0.12395146489143372, -0.12827768921852112, 0.0394749790430069, -0.12011051177978516, 0.04618033766746521, 0.027299243956804276, 0.1067686453461647, 0.07419877499341965, 0.004629531409591436, 0.07143863290548325, 0.05156908556818962, -0.04237588122487068, -0.00871848501265049, 0.09154526889324188, -0.08967994153499603, -0.02913530170917511, -0.16857676208019257, 0.040354736149311066, -0.20601460337638855, 0.035362906754016876, -0.13991475105285645, -0.10146863758563995, -0.13579566776752472, -0.02150767482817173, -0.2846991717815399, -0.033051036298274994, 0.09338817000389099, -0.01567479968070984, -0.003110076067969203, 0.02494829334318638, 0.2620043456554413, 0.2054499387741089, -0.067054383456707, -0.0029403353109955788, -0.045109741389751434, -0.0846405178308487, -0.005513320676982403, -0.1213349848985672, -0.09478164464235306, 0.005622911732643843, -0.14312100410461426, 0.06696513295173645, -0.02447572723031044, -0.07089852541685104, -0.19567997753620148, 0.13575325906276703, 0.11340620368719101, 0.003265662584453821, -0.031658072024583817, -0.041833460330963135, -0.08453699946403503, 0.013392121531069279, -0.014172264374792576, 0.07642275094985962, 0.07233958691358566, -0.010548587888479233, -0.08783428370952606, -0.009167677722871304, -0.04080743342638016, 0.1992345154285431, -0.13372501730918884, -0.044139761477708817, 0.0602080412209034, -0.13955649733543396, 0.12205365300178528, -0.13825395703315735, -0.15287767350673676, 0.07675635069608688, -0.022599373012781143, -0.018456129357218742, 0.08260851353406906, -0.03259038180112839, -0.2338365912437439, 0.15520057082176208, 0.10152240097522736, -0.10736703127622604, -0.1433299034833908, -0.01641375757753849, -0.0834912583231926, 0.005536368582397699, -0.19715258479118347, -0.0769117996096611, -0.1404472142457962, 0.11833656579256058, -0.04326493665575981, 0.23530283570289612, -0.18836505711078644, 0.005502983462065458, 0.19456367194652557, 0.10509375482797623, -0.04007001593708992, 0.08693785220384598, 0.05654532462358475, 0.07058781385421753, -0.060106001794338226, -0.017990609630942345, -0.024909108877182007, -0.16013316810131073, 0.08561588823795319, 0.09414298087358475, -0.0812847837805748, 0.10400356352329254, 0.02121557667851448, -0.03407440334558487, -0.016887955367565155, -0.03055127151310444, -0.03497617319226265, 0.06698676943778992, -0.041325438767671585, -0.09786132723093033, -0.023305131122469902, 0.14831729233264923, -0.15064895153045654, 0.1430298089981079, -0.09155255556106567, -0.02009475789964199, 0.3275834918022156, 0.1887993961572647, -0.1480058878660202, 0.020422639325261116, 0.08136768639087677, 0.029584504663944244, 0.06077826768159866, 0.1106487289071083, -0.007863309234380722, -0.05051574483513832, 0.22904638946056366, 0.06753113120794296, -0.08345773816108704, 0.11582459509372711, 0.1023559644818306, -0.06484879553318024, 0.05793410539627075, -0.048142481595277786, 0.10242854803800583, 0.11802459508180618, -0.0212576761841774, -0.00021496706176549196, -0.14448080956935883, -0.13973967730998993, -0.050186749547719955, -0.12794166803359985, 0.06642820686101913, -0.04835715889930725, 0.04386929050087929, 0.0397377647459507, -0.15510593354701996, 0.16744151711463928, -0.03266289830207825, -0.12411512434482574, 0.12259188294410706, 0.036315687000751495, -0.09439489990472794, 0.07562938332557678, 0.07353270798921585, -0.09147954732179642, -0.009642611257731915, 0.06242862343788147, 0.04283983260393143, -0.1333707571029663, 0.028109146282076836, -0.049750376492738724, 0.15109094977378845, 0.022397469729185104, 0.02077660709619522, -0.16425281763076782, -0.07073597609996796, 0.002679439727216959, -0.006082243286073208, 0.034028295427560806, 0.12358332425355911, 0.07775922119617462, 0.05377192795276642, 0.020500844344496727, -0.24920926988124847, -0.015842147171497345, 0.08280899375677109, 0.011214195750653744, 0.11385594308376312, 0.17371180653572083, 0.045279163867235184, 0.01574673317372799, -0.12266157567501068, -0.053575512021780014, 0.12978966534137726, 0.06611786782741547, 0.033442553132772446, 0.1392659842967987, 0.028158554807305336, 0.004976725205779076, -0.033784545958042145, 0.14016036689281464, -0.10455331206321716, -0.17429600656032562, 0.0519438162446022, -0.029616141691803932, -0.17695295810699463, 0.023970596492290497, 0.06495174765586853, -0.04634459689259529, 0.03927561268210411, -0.12898528575897217, -0.061673734337091446, -0.1815064698457718, 0.211168572306633, 0.013417989015579224, -0.08156473189592361, -0.08343759924173355, 0.004297717474400997, -0.010793935507535934, 0.001659313216805458, -0.15981170535087585, 0.03809598088264465, -0.11939799785614014, 0.005634245928376913, -0.16182281076908112, 0.11535624414682388, 0.03502097725868225, -0.13261738419532776, -0.02802581898868084, 0.027249950915575027, -0.11984872817993164, 0.0055001662112772465, 0.13723209500312805, -0.09106440097093582, 0.20484702289104462, -0.03174509480595589, -0.1333734393119812, -0.023375099524855614, -0.07869396358728409, -0.07866872102022171, 0.23281842470169067, 0.11972970515489578, 0.12272479385137558, 0.023384490981698036, -0.13305629789829254, -0.014260859228670597, -0.006740046665072441, 0.04654425382614136, -0.04621882736682892, -0.028890185058116913, -0.0037204239051789045, -0.08740025013685226, -0.21170319616794586, 0.007141684181988239, 0.04187985137104988, -0.02921392396092415, -0.0848873034119606, -0.05663297697901726, 0.057598553597927094, 0.18284806609153748, 0.0016223969869315624, -0.06939281523227692, 0.08625467866659164, -0.046310290694236755, 0.20519773662090302, -0.011542747728526592, 0.00419573625549674, 0.13803865015506744, -0.1809244453907013, 0.08207271248102188, -0.10547641664743423, 0.17355874180793762, 0.07683230191469193, -0.026080282405018806, -0.001882912707515061, 0.019587242975831032, 0.11889396607875824, 0.0702003613114357, 0.0764334574341774, 0.02208392135798931, -0.013588192872703075, -0.012330707162618637, 0.005794715601950884, 0.04346061870455742, -0.05334850773215294, -0.023793121799826622, 0.19932018220424652, -0.002448796760290861, -0.02263682708144188, 0.09318830817937851, -0.0025743425358086824, -0.05666147172451019, -0.10211007297039032, -0.1070605143904686, -0.07430771738290787, -0.034390341490507126, -0.11850062012672424, 0.06371790170669556, 0.22696717083454132, 0.00018691403965931386, 0.05085473507642746, 0.016991177573800087, 0.03507671877741814, 0.11265446245670319, -0.016611356288194656, 0.07078394293785095, -0.10536643117666245, 0.09493858367204666, 0.02835468389093876, 0.13673272728919983, -0.08405501395463943, 0.35341936349868774, -0.07773692905902863, -0.10918859392404556, -0.021840231493115425, -0.1259537637233734, -0.021376848220825195, 0.06410013139247894, 0.057401251047849655, -0.004506502766162157, 0.007616607006639242, -0.12897644937038422, 0.04492124915122986, 0.0004786080389749259, -0.14753566682338715, -0.1412908136844635, 0.004979930352419615, -0.1398279368877411, -0.07583718001842499, 0.008049454540014267, -0.0037407383788377047, 0.035278305411338806, 0.009774355217814445, 0.15032994747161865, 0.10090894252061844, -0.1783737987279892, -0.07012218981981277, -0.10440779477357864, 0.09820697456598282, -0.11391134560108185, 0.09165652841329575, 0.25163617730140686, -0.1458926945924759, -0.05945729464292526, 0.13742779195308685, -0.04402676597237587, 0.09185263514518738, -0.13346505165100098, 0.0032347606029361486, 0.17576561868190765, 0.06563644111156464, -0.04394715651869774, 0.0049245464615523815, 0.03760872036218643, -0.04544716328382492, 0.23613020777702332, 0.09434115141630173, 0.06506849825382233, -0.2516632080078125, -0.06588951498270035, 0.16930074989795685, 0.013522622175514698, -0.005864922422915697, -0.18965812027454376, 0.06880764663219452, 0.13436974585056305, 0.048607971519231796, 0.016731616109609604, -0.01684020273387432, 0.027268311008810997, 0.02193279378116131, -0.10321763902902603, 0.07655084133148193, 0.07983510196208954, 0.0707114189863205, 0.021038079634308815, -0.06674835085868835, -0.0005831322050653398, 0.015129927545785904, -0.027661237865686417, -0.13981126248836517, -0.013808405958116055, 0.0018717797938734293, -0.031347185373306274, -0.03242180123925209, 0.07417283952236176, 0.0030601874459534883, -0.05441872030496597, -0.008766078390181065, 0.2019066959619522, -0.09705886244773865, -0.05535183474421501, -0.04239882528781891, 0.05226752161979675, 0.09071027487516403, 0.05363522097468376, -0.04195939749479294, -0.01873365044593811, -0.09555322676897049, -0.18055622279644012, 0.10668643563985825, -0.0869748666882515, -0.04088478907942772, 0.15666431188583374, -0.10894092917442322, 0.0001247649488504976, 0.015234285034239292, 0.10990890115499496, 0.12597396969795227, 0.03663273900747299, 0.023545654490590096, 0.2874439060688019, -0.07518146187067032, 0.010916939936578274, 0.13656795024871826, 0.0005670349928550422, -0.15705446898937225, -0.05692724138498306, 0.007486902642995119, 0.014181826263666153, 0.1324343979358673, 0.01691281795501709, -0.02584855817258358, -0.06251486390829086, -0.08032024651765823, 0.00026203124434687197, 0.19758720695972443, 0.10714248567819595, -0.03999917209148407, -0.13501232862472534, -2.6522796587038355e-32, 0.024670546874403954, 0.04903227835893631, -0.05339838191866875, -0.01700649969279766, -0.032617442309856415, 0.07009328156709671, 0.015797307714819908, -0.023434612900018692, -0.09202013909816742, -0.11190995573997498, -0.12557478249073029, 0.02482571080327034, 0.0688861757516861, 0.05993443727493286, -0.21427205204963684, -0.21481956541538239, -0.03925422579050064, -0.18212050199508667, 0.0012304381234571338, 0.041376881301403046, -0.010575611144304276, 0.060703080147504807, -0.05533096194267273, -0.095199815928936, 0.06284019351005554, -0.1230834499001503, -0.05820854380726814, -0.14713573455810547, 0.04323459789156914, -0.07535704225301743, -0.06536410003900528, 0.054166264832019806, 0.023668348789215088, -0.016439594328403473, -0.07543706148862839, -0.005037018563598394, -0.06068681925535202, -0.12570282816886902, -0.022315295413136482, 0.014376863837242126, 0.004123917780816555, 0.15834778547286987, 0.05205957964062691, -0.08568265289068222, 0.06229236721992493, 0.016176706179976463, -0.0011106710880994797, -0.04192463681101799, -0.08875811845064163, -0.011057673022150993, 0.025503847748041153, 0.02284230850636959, 0.04763893038034439, 0.05017299950122833, 0.07764272391796112, -0.04669541120529175, -0.023417072370648384, 0.11734785884618759, 0.02365393564105034, -0.12155614793300629, -0.009405696764588356, -0.092678003013134, 0.023986445739865303, -0.0692562609910965, 0.12353161722421646, 0.02588837966322899, 0.2399769425392151, 0.03153420239686966, -0.03624830022454262, -0.017643338069319725, 0.22420355677604675, 0.12857232987880707, -0.06802353262901306, 0.10102121531963348, -0.07513508200645447, -0.020365919917821884, -0.11210758984088898, -0.018472613766789436, 0.03824275732040405, -0.11315926909446716, 0.07555147260427475, -0.012009314261376858, -0.026427797973155975, 0.079169861972332, 0.022444546222686768, 0.014043617993593216, -0.06955797970294952, -0.057806797325611115, -0.13035055994987488, -0.01571235992014408, 0.02869153954088688, -0.09919872134923935, -0.12766383588314056, -0.024149663746356964, 0.010890675708651543, 0.07860983908176422, -0.05604415759444237, 0.02130306139588356, 0.012390905059874058, 0.11597631871700287, -0.08265422284603119, -0.011191751807928085, 0.14464926719665527, -0.033384770154953, 0.10233716666698456, 0.12070593237876892, 0.16257596015930176, -0.06328051537275314, -0.18904945254325867, -0.014310246333479881, -0.03987325727939606, 0.14256829023361206, 0.11461130529642105, 0.05770833045244217, 0.19164755940437317, 0.08545708656311035, -0.09157277643680573, -0.002958445344120264, 0.03415381535887718, 0.15690283477306366, -0.2754184305667877, -0.0439208447933197, -0.09711166471242905, 0.029012374579906464, 0.0341203510761261, 0.10481766611337662, -0.18734516203403473, -0.1322878748178482, 0.006483067292720079, -0.040489789098501205, 0.03641485422849655, -0.08592945337295532, 8.025320994420326e-7, -0.19755204021930695, 0.09829956293106079, 0.01880255527794361, 0.03696046397089958, 0.016063524410128593, -0.01056826300919056, -0.26763755083084106, 0.06384439021348953, 0.029012849554419518, 0.12180402874946594, 0.1078900620341301, -0.01658705249428749, -0.07724427431821823, 0.05732804909348488, -0.08616234362125397, 0.007780878804624081, -0.1132906973361969, -0.0004568946023937315, 0.013201095163822174, -0.022179311141371727, 0.006032396107912064, 0.1826324313879013, -0.03078642301261425, 0.0027693624142557383, 0.08741369098424911, -0.11282988637685776, 0.04550660774111748, -0.03498496860265732, 0.09435245394706726, -0.05336756631731987, -0.07370012253522873, 0.07439891993999481, -0.04610377550125122, 0.10560443997383118, 0.05422784760594368, -0.04482337832450867, -0.1561548113822937, -0.06816757470369339, 0.10720442235469818, -0.0019630510360002518, 0.027037883177399635, 0.0491584911942482, 0.020667115226387978, 0.001921905786730349, 0.23545925319194794, 0.014842058531939983, -0.09803828597068787, 0.05190671235322952, 0.04399693012237549, 0.09208521991968155, 0.023057695478200912, -0.03840390592813492, 0.15384310483932495, 0.1137896478176117, -0.0043966383673250675, -0.0880809873342514, 0.024769941344857216, -0.03368845209479332, 0.11034589260816574, -0.10129345208406448, -0.033944953233003616, -0.012015973217785358, 0.05176446586847305, 0.04106549173593521, -0.04276041314005852, 0.02505197934806347, 0.034259360283613205, 1.5167762915038694e-34, -0.051926709711551666, -0.006750196684151888, 0.08698240667581558, -0.20701433718204498, -0.06322109699249268, -0.0759361982345581, 0.04489057883620262, 0.018330076709389687, -0.007360614836215973, -0.1107279509305954, 0.046064119786024094 ]
https://github.com/huggingface/datasets/issues/6199
Use load_dataset for local json files, but it not works
It doesn't download them but writes them to the local HF cache. The logging could indeed be better. Does loading the dataset succeed? If it doesn't, can you share the error stack trace?
### Describe the bug when I use load_dataset to load my local datasets,it always goes to Hugging Face to download the data instead of loading the local dataset. ### Steps to reproduce the bug `raw_datasets = load_dataset( β€˜json’, data_files=data_files)` ### Expected behavior ![image](https://github.com/huggingface/datasets/assets/50519434/add3747f-6481-4da7-b374-8f81c5a6472c) ### Environment info python version 3.8.5 datasets version 2.12 os version unbuntu 18.04
33
Use load_dataset for local json files, but it not works ### Describe the bug when I use load_dataset to load my local datasets,it always goes to Hugging Face to download the data instead of loading the local dataset. ### Steps to reproduce the bug `raw_datasets = load_dataset( β€˜json’, data_files=data_files)` ### Expected behavior ![image](https://github.com/huggingface/datasets/assets/50519434/add3747f-6481-4da7-b374-8f81c5a6472c) ### Environment info python version 3.8.5 datasets version 2.12 os version unbuntu 18.04 It doesn't download them but writes them to the local HF cache. The logging could indeed be better. Does loading the dataset succeed? If it doesn't, can you share the error stack trace?
[ 0.009779805317521095, 0.05774981155991554, 0.010746733285486698, 0.1118290051817894, 0.17232975363731384, 0.04700155556201935, 0.1550225168466568, -0.08543457090854645, 0.2108127623796463, 0.13866384327411652, -0.12194360047578812, -0.04090678691864014, -0.0029815223533660173, -0.031114725396037102, 0.08168117702007294, -0.03063124045729637, -0.09312048554420471, 0.021783018484711647, 0.01591353677213192, -0.026650261133909225, -0.09843471646308899, 0.06761883944272995, 0.10808801651000977, -0.041395679116249084, 0.0802822932600975, 0.08726740628480911, 0.016328640282154083, 0.13875803351402283, 0.05259100720286369, -0.07136422395706177, 0.14900490641593933, 0.01473689079284668, 0.03738006204366684, 0.1808210015296936, 0.000006590171778952936, 0.04135826975107193, 0.10697067528963089, 0.07567748427391052, -0.14242927730083466, -0.12894943356513977, 0.12033069878816605, -0.1852656602859497, -0.007998882792890072, -0.008787570521235466, -0.06851348280906677, -0.16314202547073364, -0.06831708550453186, -0.0905405655503273, 0.07579036056995392, -0.007363059092313051, -0.09108174592256546, 0.04772866889834404, -0.11936232447624207, -0.19213449954986572, 0.06445734202861786, 0.1497204601764679, -0.0022409893572330475, 0.14644961059093475, -0.22151826322078705, -0.13965380191802979, -0.07384856790304184, -0.12031818926334381, -0.04708836227655411, 0.1280808448791504, -0.08607591688632965, 0.0015909249195829034, -0.16088108718395233, -0.11729110032320023, 0.0443883016705513, 0.25387120246887207, 0.0020206966437399387, 0.0609329491853714, -0.08007565140724182, -0.1063213124871254, -0.07932315021753311, -0.0048257140442729, -0.05084057152271271, -0.028833787888288498, -0.1725253462791443, 0.14746735990047455, -0.2661430835723877, -0.09856881946325302, -0.03459683805704117, -0.05376081168651581, -0.12232489138841629, -0.06305155903100967, -0.11591652780771255, 0.01005188561975956, 0.0016395881539210677, -0.0421673059463501, 0.14251907169818878, 0.006315132137387991, -0.08319547772407532, -0.06572654843330383, 0.14162977039813995, 0.062245924025774, 0.025322632864117622, -0.00610776711255312, 0.057272449135780334, 0.00027713115559890866, -0.05158882215619087, -0.03466447815299034, -0.1254107654094696, 0.12068557739257812, 0.08470974117517471, -0.12529799342155457, 0.0888136476278305, -0.1366957426071167, 0.007473866920918226, 0.01514060515910387, -0.01003352738916874, 0.12324721366167068, -0.07071743905544281, -0.06653758138418198, -0.026199867948889732, -0.06573950499296188, 0.03977746143937111, 0.04341323301196098, 0.052259620279073715, 0.025224357843399048, 0.1146487444639206, 0.03253242373466492, -0.024172233417630196, 0.22930040955543518, -0.013643522746860981, -0.02340724505484104, -0.1212816908955574, 0.1038282960653305, -0.06321538239717484, -0.03945591673254967, 0.02771909534931183, -0.11466164886951447, 0.0644678920507431, -0.0053521315567195415, 0.12851133942604065, -0.10446812212467194, 0.03835773095488548, -0.14538836479187012, 0.01929185912013054, 0.013030913658440113, 0.11512239277362823, 0.03186553344130516, 0.04935481399297714, 0.06720190495252609, 0.08613955974578857, -0.04037279263138771, 0.0019418896408751607, 0.08679839223623276, -0.09245191514492035, -0.02180447243154049, -0.18480080366134644, 0.011084449477493763, -0.22651511430740356, 0.03567560389637947, -0.15858380496501923, -0.09380403161048889, -0.12385446578264236, -0.03092770278453827, -0.2398323267698288, -0.034376200288534164, 0.08385256677865982, -0.046964116394519806, -0.005456133279949427, 0.042557597160339355, 0.2793852686882019, 0.21897070109844208, -0.067286416888237, -0.010095421224832535, -0.04730899631977081, -0.08405650407075882, -0.009323284961283207, -0.1049736887216568, -0.08170787990093231, -0.01773408055305481, -0.1832023561000824, 0.07677311450242996, 0.0061816321685910225, -0.07672128826379776, -0.19489529728889465, 0.15457932651042938, 0.15631823241710663, -0.009594299830496311, -0.0076618436723947525, -0.05551118776202202, -0.051205143332481384, 0.0028216936625540257, -0.009037544019520283, 0.07577931135892868, 0.07745162397623062, -0.030401840806007385, -0.10282149165868759, 0.01771923340857029, -0.03861997649073601, 0.21136842668056488, -0.13145655393600464, -0.03404560685157776, 0.05178673565387726, -0.10040967166423798, 0.1536441296339035, -0.1638289988040924, -0.11992498487234116, 0.09807149320840836, -0.030581358820199966, -0.002678642049431801, 0.09764573723077774, -0.0018700467189773917, -0.2407829910516739, 0.14627408981323242, 0.07280366867780685, -0.14656127989292145, -0.12827958166599274, 0.006245145574212074, -0.08678469806909561, 0.0020091941114515066, -0.204213485121727, -0.08368192613124847, -0.12118102610111237, 0.12644949555397034, -0.027802851051092148, 0.21195824444293976, -0.1741754412651062, 0.044668395072221756, 0.1756771355867386, 0.09232283383607864, -0.053755953907966614, 0.10596422851085663, 0.056108638644218445, 0.07775264233350754, -0.06634215265512466, 0.003758801845833659, -0.037959568202495575, -0.1590663492679596, 0.08277326822280884, 0.0874072015285492, -0.0835418626666069, 0.09685499966144562, 0.021742038428783417, -0.03817613795399666, -0.019220475107431412, -0.02189672738313675, -0.02797790616750717, 0.03227436915040016, -0.018181955441832542, -0.11396186053752899, -0.04135854169726372, 0.12599962949752808, -0.1300351321697235, 0.1728764921426773, -0.11057811975479126, -0.013829510658979416, 0.33498936891555786, 0.19329431653022766, -0.16242636740207672, 0.032672327011823654, 0.08110691606998444, 0.023656826466321945, 0.08492574840784073, 0.11747757345438004, -0.01429313700646162, -0.06568188965320587, 0.24244257807731628, 0.07415253669023514, -0.07413478195667267, 0.12053508311510086, 0.12669479846954346, -0.09183387458324432, 0.06430768221616745, -0.0507778599858284, 0.10419492423534393, 0.12335171550512314, -0.000009545280590828042, 0.001743971137329936, -0.1622350960969925, -0.13558855652809143, -0.04225161671638489, -0.12013231962919235, 0.05383501946926117, -0.034169528633356094, 0.05068984255194664, 0.039494436234235764, -0.1610366255044937, 0.16042599081993103, -0.01033973228186369, -0.1237168163061142, 0.13099387288093567, 0.05217842012643814, -0.09407607465982437, 0.06939461827278137, 0.08952049165964127, -0.07719908654689789, -0.010848639532923698, 0.043272048234939575, 0.03951377049088478, -0.155918687582016, 0.027304256334900856, -0.042571891099214554, 0.1195470318198204, 0.029269300401210785, 0.03945857286453247, -0.15896713733673096, -0.04933759197592735, -0.007732876110821962, 0.010762829333543777, 0.02098873257637024, 0.12217582017183304, 0.06449002772569656, 0.06340615451335907, 0.017608482390642166, -0.25965616106987, -0.021128078922629356, 0.09668084979057312, 0.027253953740000725, 0.11615090817213058, 0.14261946082115173, 0.02413948066532612, 0.03502443805336952, -0.12029705941677094, -0.04787108302116394, 0.1091645285487175, 0.049249518662691116, 0.014172208495438099, 0.15274544060230255, 0.007759776897728443, -0.003375264583155513, -0.025955550372600555, 0.16145291924476624, -0.1300571858882904, -0.20584098994731903, 0.020953811705112457, -0.0283203125, -0.1616305261850357, 0.03744831308722496, 0.056919507682323456, -0.029927100986242294, 0.05767107009887695, -0.17249831557273865, -0.08662926405668259, -0.2000204175710678, 0.23320072889328003, 0.0058414991945028305, -0.06957214325666428, -0.05437275022268295, -0.0171100664883852, -0.001916920649819076, 0.0017337305471301079, -0.1494503617286682, 0.04335153102874756, -0.10309691727161407, -0.023662421852350235, -0.16151079535484314, 0.09873121231794357, 0.03551865741610527, -0.11992426216602325, -0.032823532819747925, 0.0021059387363493443, -0.07840284705162048, -0.008287332020699978, 0.13229115307331085, -0.08341284841299057, 0.19524259865283966, -0.017885524779558182, -0.10535556077957153, -0.014143972657620907, -0.05013161152601242, -0.06129215285181999, 0.22382618486881256, 0.10819914191961288, 0.13307590782642365, 0.021251989528536797, -0.12460469454526901, -0.01923634670674801, -0.03560381755232811, 0.020913438871502876, -0.049231406301259995, -0.017052708193659782, -0.015193985775113106, -0.08455220609903336, -0.17213544249534607, 0.024249151349067688, 0.040396206080913544, -0.0333680585026741, -0.10677367448806763, -0.06722048670053482, 0.08813587576150894, 0.1800234466791153, -0.01028323732316494, -0.08396517485380173, 0.10310082882642746, -0.05924827605485916, 0.20154662430286407, 0.006196361500769854, 0.0186485443264246, 0.13725364208221436, -0.18054504692554474, 0.060412753373384476, -0.11355896294116974, 0.18031765520572662, 0.05864173546433449, -0.007649133913218975, -0.010679884813725948, 0.028898464515805244, 0.09052108973264694, 0.051849499344825745, 0.08745590597391129, 0.049518026411533356, -0.0072107878513634205, 0.003741627559065819, -0.0005237946170382202, 0.05231015011668205, -0.06946428120136261, -0.06305002421140671, 0.18363340198993683, 0.009455503895878792, -0.010622149333357811, 0.10688789188861847, -0.023387601599097252, -0.06755966693162918, -0.10298474878072739, -0.09593424201011658, -0.09053374081850052, -0.039504896849393845, -0.1389845907688141, 0.07165156304836273, 0.22347494959831238, 0.009149244986474514, 0.038866110146045685, 0.03460492566227913, 0.04393529146909714, 0.11123485118150711, -0.027610141783952713, 0.08293483406305313, -0.06248529255390167, 0.06372407078742981, 0.018222447484731674, 0.12143748253583908, -0.08987700939178467, 0.4108222424983978, -0.06370116025209427, -0.0825553685426712, 0.0035805406514555216, -0.17852002382278442, -0.03054235689342022, 0.035538531839847565, 0.04542822018265724, -0.046899452805519104, -0.028430568054318428, -0.12461967766284943, 0.03695807233452797, 0.00935949757695198, -0.17022383213043213, -0.1484421044588089, -0.01848764158785343, -0.16266483068466187, -0.04878498613834381, 0.007746770977973938, -0.02109818160533905, 0.037409547716379166, -0.02355942875146866, 0.14160847663879395, 0.11359032243490219, -0.14002364873886108, -0.06550835072994232, -0.12259601801633835, 0.10926162451505661, -0.08521442860364914, 0.07768981903791428, 0.23821137845516205, -0.19579613208770752, -0.042629342526197433, 0.13299740850925446, -0.03496120125055313, 0.0945260152220726, -0.1432705968618393, 0.003313616383820772, 0.17709249258041382, 0.05232730507850647, -0.020054617896676064, 0.014431551098823547, 0.031841207295656204, -0.03155176714062691, 0.21511295437812805, 0.06669168919324875, 0.053441524505615234, -0.24253739416599274, -0.026843013241887093, 0.19170846045017242, 0.039457935839891434, -0.019630055874586105, -0.18937785923480988, 0.06092110276222229, 0.1388586461544037, 0.015519234351813793, 0.046970564872026443, -0.0037589380517601967, 0.05660717189311981, -0.013241640292108059, -0.10424058139324188, 0.04655948653817177, 0.04948091134428978, 0.07353898882865906, -0.00044480845099315047, -0.050732601433992386, 0.0033419497776776552, 0.03351553902029991, -0.03762754797935486, -0.17765499651432037, 0.007864593528211117, -0.019208397716283798, -0.0362398624420166, -0.031398553401231766, 0.0947340652346611, -0.04503116011619568, -0.06304626166820526, 0.0074713509529829025, 0.1805993616580963, -0.08415768295526505, -0.0261504128575325, -0.042226437479257584, 0.06370218098163605, 0.07423553615808487, 0.07010144740343094, -0.04491189122200012, -0.013732928782701492, -0.10564102977514267, -0.18050119280815125, 0.1318952590227127, -0.09083291888237, -0.023874234408140182, 0.16036160290241241, -0.09697398543357849, 0.01914079487323761, 0.04537205025553703, 0.14018084108829498, 0.12857750058174133, 0.012482447549700737, 0.013952954672276974, 0.27837976813316345, -0.05462607368826866, 0.009416426531970501, 0.10953736305236816, -0.007527117617428303, -0.19138337671756744, -0.07795172929763794, 0.02282749116420746, 0.027535850182175636, 0.1316448152065277, -0.021295687183737755, -0.04205985739827156, -0.07233074307441711, -0.08152212202548981, -0.005638482514768839, 0.18667501211166382, 0.07291744649410248, -0.022138897329568863, -0.12548579275608063, -2.634907027693033e-32, 0.011141542345285416, 0.0271054208278656, -0.04376717284321785, -0.024013789370656013, -0.04642342031002045, 0.06804773956537247, -0.011148743331432343, -0.04503858461976051, -0.07799477875232697, -0.09487169981002808, -0.10966487973928452, 0.0064980583265423775, 0.07255028933286667, 0.08374840021133423, -0.2125585377216339, -0.21329045295715332, -0.03305749595165253, -0.16480927169322968, 0.0000924608830246143, 0.06434158980846405, 0.006104537285864353, 0.06342292577028275, -0.03361540660262108, -0.05995737388730049, 0.04858866333961487, -0.14604729413986206, -0.06355322897434235, -0.15524554252624512, 0.05676274374127388, -0.06635556370019913, -0.08684665709733963, 0.06166132539510727, 0.014004039578139782, -0.028989577665925026, -0.061018604785203934, -0.018144574016332626, -0.08792497962713242, -0.10330983996391296, -0.04248034209012985, 0.030752914026379585, -0.00939074158668518, 0.14184512197971344, 0.08960973471403122, -0.07657859474420547, 0.08201400190591812, 0.029696572571992874, -0.02508658729493618, -0.01580282300710678, -0.09207415580749512, -0.019388621672987938, -0.0001334408443653956, 0.016365040093660355, 0.036163218319416046, 0.04110393673181534, 0.09241052716970444, -0.039798345416784286, -0.007031979039311409, 0.13041749596595764, -0.01599675975739956, -0.13947544991970062, -0.0045974599197506905, -0.1182871162891388, 0.012280676513910294, -0.08584257960319519, 0.12099950760602951, 0.0071342443116009235, 0.2703670859336853, 0.053856011480093, -0.04419529438018799, 0.012724963016808033, 0.25083720684051514, 0.09154052287340164, -0.0809527337551117, 0.1040051057934761, -0.07254928350448608, -0.01349600963294506, -0.07465647161006927, -0.0362638384103775, 0.015979668125510216, -0.09455738961696625, 0.06639117002487183, -0.018730616196990013, -0.02744249626994133, 0.08013924211263657, -0.02274508774280548, 0.0432087704539299, -0.05652891844511032, -0.055704016238451004, -0.13093622028827667, -0.006819500122219324, 0.04436992108821869, -0.08213193714618683, -0.1279083788394928, -0.0421137772500515, 0.034581027925014496, 0.10103636980056763, -0.04610398784279823, 0.029146544635295868, -0.01468625944107771, 0.11599355936050415, -0.08457431197166443, -0.010761873796582222, 0.16019701957702637, -0.03493466228246689, 0.09683913737535477, 0.10406900942325592, 0.13765253126621246, -0.08226232975721359, -0.1834397315979004, -0.014786679297685623, -0.04194443300366402, 0.17134658992290497, 0.13207347691059113, 0.04889797791838646, 0.22148796916007996, 0.07992956042289734, -0.09126975387334824, 0.012559042312204838, 0.02023215778172016, 0.1719062179327011, -0.2542508840560913, -0.049985677003860474, -0.07943665981292725, 0.05031031370162964, 0.03715868666768074, 0.10653576254844666, -0.19580037891864777, -0.1384134292602539, 0.00890924409031868, -0.04698385298252106, 0.050453800708055496, -0.07628336548805237, 7.989950177034189e-7, -0.2309694141149521, 0.09559494256973267, 0.038680549710989, 0.01557003054767847, 0.017367973923683167, 0.008181964978575706, -0.2749103307723999, 0.043511420488357544, 0.03667094185948372, 0.11238028109073639, 0.1158878430724144, 0.01125158742070198, -0.059808485209941864, 0.0761752799153328, -0.04685618728399277, -0.022885093465447426, -0.11114692687988281, 0.0066774762235581875, 0.0003612693108152598, 0.011991857551038265, 0.02133149467408657, 0.18802902102470398, -0.02623920701444149, -0.0073678819462656975, 0.08627081662416458, -0.08916482329368591, 0.050116050988435745, -0.03750813752412796, 0.08249776810407639, -0.04908277094364166, -0.07962848246097565, 0.07199832051992416, -0.05354410409927368, 0.10464335232973099, 0.07121460884809494, -0.0316019207239151, -0.1589958667755127, -0.10589343309402466, 0.1331561803817749, -0.026327989995479584, 0.008598916232585907, 0.05849936977028847, 0.01674048975110054, -0.03080335445702076, 0.24782167375087738, 0.009690803475677967, -0.10094322264194489, 0.030244404450058937, 0.045008353888988495, 0.10303716361522675, 0.018761256709694862, -0.01565898209810257, 0.1556955873966217, 0.0968276634812355, -0.002240082249045372, -0.08865747600793839, 0.007274772506207228, -0.033454712480306625, 0.11175832152366638, -0.08550502359867096, -0.03689446672797203, 0.011598368175327778, 0.05649785324931145, 0.024122118949890137, -0.07061850279569626, 0.018987197428941727, 0.04055408015847206, 1.7579095573264983e-34, -0.07218963652849197, -0.004869870841503143, 0.10196376591920853, -0.20935553312301636, -0.04874054342508316, -0.07849151641130447, 0.054333895444869995, -0.0014795518945902586, 0.007468746043741703, -0.13079769909381866, 0.04154575616121292 ]
https://github.com/huggingface/datasets/issues/6197
ValueError: 'index=True' is only valid when 'orient' is 'split', 'table', 'index', or 'columns'
People using previous releases of `datasets` should pin `pandas` in their local environment: ``` python -m pip install 'pandas<2.1.0' ```
### Describe the bug Saving a dataset `.to_json()` fails with a `ValueError` since the latest `pandas` [release](https://pandas.pydata.org/docs/dev/whatsnew/v2.1.0.html) (`2.1.0`) In their latest release we have: > Improved error handling when using [DataFrame.to_json()](https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.to_json.html#pandas.DataFrame.to_json) with incompatible index and orient arguments ([GH 52143](https://github.com/pandas-dev/pandas/issues/52143)) i.e. an error is now raised for invalid combinations of `index` and `orient`. This means that unfortunately the custom logic at this line might sometimes lead to contradictions: https://github.com/huggingface/datasets/blob/029227a116c14720afca71b9b22e78eb2a1c09a6/src/datasets/io/json.py#L96 e.g. for the default case `orient=records` leads to `index=True`, which now raises a `ValueError` ### Steps to reproduce the bug ```python import datasets if __name__ == '__main__': dataset = datasets.Dataset.from_dict({"A": [1, 2, 3], "B": [4, 5, 6]}) dataset.to_json("dataset.json") ``` ```shell >>> ValueError: 'index=True' is only valid when 'orient' is 'split', 'table', 'index', or 'columns'. ``` ### Expected behavior The dataset is successfully saved as `.json` ### Environment info `python >= 3.9` `pandas >= 2.1.0`
20
ValueError: 'index=True' is only valid when 'orient' is 'split', 'table', 'index', or 'columns' ### Describe the bug Saving a dataset `.to_json()` fails with a `ValueError` since the latest `pandas` [release](https://pandas.pydata.org/docs/dev/whatsnew/v2.1.0.html) (`2.1.0`) In their latest release we have: > Improved error handling when using [DataFrame.to_json()](https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.to_json.html#pandas.DataFrame.to_json) with incompatible index and orient arguments ([GH 52143](https://github.com/pandas-dev/pandas/issues/52143)) i.e. an error is now raised for invalid combinations of `index` and `orient`. This means that unfortunately the custom logic at this line might sometimes lead to contradictions: https://github.com/huggingface/datasets/blob/029227a116c14720afca71b9b22e78eb2a1c09a6/src/datasets/io/json.py#L96 e.g. for the default case `orient=records` leads to `index=True`, which now raises a `ValueError` ### Steps to reproduce the bug ```python import datasets if __name__ == '__main__': dataset = datasets.Dataset.from_dict({"A": [1, 2, 3], "B": [4, 5, 6]}) dataset.to_json("dataset.json") ``` ```shell >>> ValueError: 'index=True' is only valid when 'orient' is 'split', 'table', 'index', or 'columns'. ``` ### Expected behavior The dataset is successfully saved as `.json` ### Environment info `python >= 3.9` `pandas >= 2.1.0` People using previous releases of `datasets` should pin `pandas` in their local environment: ``` python -m pip install 'pandas<2.1.0' ```
[ 0.025719141587615013, 0.20848645269870758, 0.025932447984814644, 0.005667013581842184, 0.1294567584991455, 0.06058957427740097, 0.1215227022767067, 0.0669785887002945, -0.06279946118593216, 0.0058651273138821125, 0.023459503427147865, -0.06725607812404633, -0.01445792056620121, 0.05243239551782608, -0.10659736394882202, 0.0027670643758028746, 0.19757308065891266, -0.09497663378715515, 0.04166172444820404, 0.12236184626817703, -0.2107526957988739, 0.02165873348712921, -0.13657163083553314, -0.04916394501924515, 0.0850362479686737, -0.1916259080171585, -0.0968872532248497, 0.08930248767137527, -0.08761417865753174, -0.13267113268375397, 0.15294338762760162, -0.04843152314424515, 0.04368766024708748, 0.08597900718450546, 0.000005384197720559314, 0.028775038197636604, 0.23701220750808716, -0.10072857141494751, 0.047067008912563324, -0.08372966945171356, 0.046549320220947266, -0.07003605365753174, 0.06966030597686768, -0.08722539246082306, 0.10230640321969986, -0.2476276308298111, -0.05842757597565651, 0.12490486353635788, 0.11329877376556396, 0.08813847601413727, -0.04390193894505501, 0.06612962484359741, 0.09643111377954483, -0.11135749518871307, 0.009823325090110302, 0.044740572571754456, 0.061562154442071915, -0.07172054052352905, -0.4337500035762787, -0.08113088458776474, -0.048831600695848465, -0.11963414400815964, -0.11848808079957962, 0.1176723763346672, -0.31429076194763184, 0.010297644883394241, -0.1318231076002121, -0.030846305191516876, -0.09817880392074585, 0.10496378690004349, -0.019687296822667122, 0.07971184700727463, -0.1413324624300003, -0.082077756524086, -0.0006189952837303281, -0.10515366494655609, 0.041515421122312546, 0.05452581122517586, -0.011271133087575436, 0.13386844098567963, 0.20765817165374756, 0.2343214750289917, 0.0662839487195015, 0.08246060460805893, -0.29443010687828064, 0.0831829383969307, -0.19912533462047577, 0.1710028201341629, 0.08799976855516434, -0.12580035626888275, 0.19612611830234528, 0.03534401208162308, -0.20910052955150604, -0.11339297890663147, -0.042697202414274216, -0.09521119296550751, 0.061015572398900986, -0.09909697622060776, -0.0006988380919210613, 0.016664797440171242, -0.07817067950963974, -0.08210216462612152, -0.10042919963598251, 0.14013727009296417, 0.17900225520133972, -0.05158773809671402, -0.09717743843793869, 0.15946350991725922, 0.025834280997514725, 0.0062832944095134735, 0.221895232796669, 0.02106338180601597, -0.023724306374788284, -0.13445650041103363, 0.07365906983613968, 0.12612658739089966, 0.18043214082717896, 0.1799100786447525, -0.09144988656044006, 0.08104542642831802, -0.16619616746902466, -0.01102625671774149, 0.01688031293451786, 0.06413520872592926, 0.004862338770180941, 0.1248825192451477, 0.17333345115184784, 0.11471709609031677, 0.06540561467409134, 0.16478793323040009, 0.037439603358507156, 0.23637054860591888, 0.12136928737163544, -0.14571601152420044, 0.12448222935199738, -0.14068269729614258, -0.022088423371315002, -0.08447667211294174, 0.14485959708690643, 0.07091629505157471, -0.028576914221048355, -0.06394220143556595, 0.15360073745250702, 0.0825614184141159, 0.17834384739398956, 0.032417766749858856, 0.19016321003437042, -0.10430961847305298, -0.07653693109750748, -0.04989955574274063, -0.16676363348960876, -0.033856041729450226, -0.08974739909172058, 0.023697523400187492, -0.08362267166376114, 0.03476666659116745, -0.01541615929454565, -0.028530359268188477, -0.2199804186820984, 0.025926681235432625, 0.1497802436351776, -0.007315770257264376, 0.064453125, -0.14242662489414215, 0.1328301578760147, 0.13991348445415497, 0.09668300300836563, 0.05397677794098854, -0.06292984634637833, -0.009591898880898952, 0.05787299945950508, 0.0355062372982502, -0.03645133599638939, -0.04215117171406746, -0.09079902619123459, 0.06852461397647858, -0.15590053796768188, -0.0657181665301323, -0.18121559917926788, -0.13631698489189148, -0.01860826276242733, -0.14257484674453735, 0.04563741758465767, -0.09628042578697205, 0.05528147146105766, -0.08970736712217331, -0.015740862116217613, 0.03153012692928314, -0.01836998574435711, -0.13214845955371857, 0.09460914134979248, 0.0015888935886323452, -0.025368520990014076, -0.0727158933877945, -0.04523065686225891, -0.12006169557571411, -0.04688529297709465, -0.18571346998214722, -0.05635447055101395, -0.18248431384563446, -0.074263796210289, -0.05455869436264038, 0.002498408081009984, -0.15069971978664398, 0.03992671146988869, -0.09591025859117508, -0.29113078117370605, 0.007412396837025881, 0.06794510781764984, -0.0829579308629036, -0.10836803168058395, 0.056984394788742065, 0.006956885568797588, 0.04985123500227928, 0.02955029159784317, -0.028368813917040825, 0.08620552718639374, -0.06463398784399033, -0.1285828799009323, 0.08986344188451767, -0.14246508479118347, -0.03640483692288399, 0.024003205820918083, -0.011601069010794163, 0.078620545566082, 0.0250064916908741, -0.054967861622571945, 0.008563715033233166, 0.07307428121566772, 0.0720900222659111, 0.0017536012455821037, -0.14521591365337372, 0.052427418529987335, 0.07974676787853241, -0.10128853470087051, -0.07773308455944061, -0.08330228179693222, -0.13855235278606415, -0.09353355318307877, 0.02616669051349163, -0.18704961240291595, 0.06780853867530823, -0.04921448230743408, 0.009154163300991058, -0.03993567079305649, 0.16039061546325684, -0.16261588037014008, 0.1424674242734909, -0.1786041557788849, -0.1203097477555275, 0.20616231858730316, 0.13063481450080872, -0.1259198635816574, -0.18571816384792328, -0.0012189666740596294, -0.1231887936592102, -0.11905720829963684, 0.07654272019863129, 0.0079889427870512, -0.01924579031765461, 0.34371548891067505, -0.01055747177451849, 0.028790459036827087, 0.039519939571619034, 0.19564808905124664, -0.0348602719604969, 0.042748939245939255, -0.00807730108499527, -0.0011101410491392016, 0.0607934296131134, 0.06087492033839226, 0.06443887948989868, -0.0905189961194992, -0.03231652453541756, 0.06279338896274567, -0.13302046060562134, -0.0008251597755588591, 0.08087769150733948, 0.09579180926084518, 0.09990142285823822, -0.2098851203918457, 0.06421458721160889, 0.04025759920477867, -0.05680384486913681, 0.005297400988638401, 0.11428417265415192, -0.12425737082958221, -0.009511204436421394, 0.06458798050880432, -0.048405721783638, 0.04081881418824196, -0.11369870603084564, -0.011010885238647461, -0.08505111932754517, -0.021550923585891724, -0.036691322922706604, 0.00585765577852726, 0.0066070277243852615, 0.042091891169548035, -0.0893494114279747, -0.03393067792057991, -0.005598724354058504, 0.05138758569955826, 0.006448172498494387, -0.05775907635688782, -0.004690732341259718, 0.25998175144195557, -0.012901904992759228, -0.0342482253909111, -0.08524341881275177, -0.006684490945190191, 0.013125901110470295, -0.010641967877745628, 0.010671406053006649, 0.04413425549864769, 0.01947762258350849, 0.027273884043097496, -0.05720338970422745, 0.11627744138240814, 0.09739908576011658, -0.04968900606036186, 0.16465216875076294, -0.09367598593235016, 0.057243578135967255, -0.013028510846197605, 0.017803456634283066, -0.14813099801540375, -0.09855431318283081, 0.055683739483356476, -0.14242926239967346, 0.00614398205652833, 0.019997786730527878, -0.08824930340051651, -0.04425278306007385, 0.17156562209129333, -0.11890849471092224, -0.1259535551071167, 0.09261693805456161, 0.22241516411304474, 0.08567717671394348, -0.023610176518559456, 0.0011878428049385548, -0.011305544525384903, -0.09733874350786209, 0.01594291254878044, -0.19689491391181946, -0.10669662058353424, -0.041656650602817535, 0.12043991684913635, 0.012650770135223866, 0.029233934357762337, 0.13268068432807922, 0.004606142640113831, -0.0805562362074852, -0.13535849750041962, -0.10684418678283691, -0.20078624784946442, 0.2055165022611618, -0.23711252212524414, -0.048996783792972565, 0.23671457171440125, 0.056345924735069275, -0.09090428799390793, -0.07533806562423706, -0.045257050544023514, 0.11182542145252228, 0.0657452940940857, 0.18701542913913727, -0.1054939478635788, -0.2566708028316498, -0.1559327244758606, 0.02422703430056572, -0.1016804650425911, -0.11706598848104477, -0.024587366729974747, -0.17174702882766724, -0.005755794234573841, -0.1608850359916687, -0.004366885870695114, 0.06897251307964325, 0.06688233464956284, -0.12781640887260437, -0.06260480731725693, 0.17686936259269714, 0.19082605838775635, 0.06388299912214279, -0.026473285630345345, 0.06662191450595856, 0.010544433258473873, 0.09723015874624252, -0.03493855148553848, -0.02584994025528431, -0.08963653445243835, -0.12040546536445618, 0.04237298294901848, -0.12280397862195969, 0.2265418916940689, 0.12763746082782745, -0.007064315490424633, 0.013179843313992023, 0.10151609778404236, 0.0725933387875557, 0.025667691603302956, 0.08409217745065689, 0.09968151152133942, -0.015155480243265629, 0.06473512947559357, -0.05948356166481972, 0.031202282756567, -0.11464209109544754, -0.027835551649332047, 0.09283007681369781, -0.09930650889873505, -0.014864757657051086, 0.3396623432636261, -0.08334898948669434, 0.03833884000778198, -0.09243107587099075, -0.004765753168612719, -0.3289192020893097, -0.18624044954776764, -0.10253877192735672, 0.1942441761493683, 0.11445906013250351, 0.008406942710280418, -0.01842205971479416, 0.0035841281060129404, -0.06873320043087006, 0.023148825392127037, -0.003587542101740837, -0.0633443221449852, -0.10355065017938614, 0.12064135819673538, 0.09450910240411758, 0.02914615534245968, 0.10407653450965881, 0.250049352645874, -0.02057785913348198, 0.03973099961876869, -0.15312200784683228, -0.21660837531089783, -0.07746271789073944, 0.11856867372989655, -0.17366737127304077, 0.01171631459146738, -0.15693992376327515, -0.09117229282855988, -0.054895903915166855, 0.012538821436464787, 0.021247882395982742, -0.1867128312587738, -0.17578184604644775, -0.04412626102566719, 0.02321532927453518, 0.06432283669710159, 0.04320313408970833, 0.07798290997743607, 0.10725323855876923, 0.06646490842103958, 0.3054848909378052, -0.10063568502664566, -0.07735279947519302, -0.006733722519129515, 0.06063103675842285, 0.14388123154640198, -0.15211331844329834, 0.28568869829177856, 0.0611022412776947, 0.07309306412935257, 0.09207219630479813, -0.054967306554317474, 0.05368511378765106, -0.06915420293807983, -0.08358816057443619, 0.05306316167116165, 0.00945011992007494, 0.08060181885957718, -0.11130763590335846, 0.030818628147244453, 0.07944069802761078, 0.1650836020708084, 0.03998321667313576, 0.013660721480846405, -0.15287920832633972, 0.01870328187942505, 0.15128512680530548, 0.020474331453442574, -0.059380531311035156, 0.011199618689715862, -0.06309334933757782, 0.002073329873383045, -0.195219948887825, 0.014294854365289211, 0.2785889208316803, 0.12704014778137207, -0.027694519609212875, -0.13979913294315338, 0.24439167976379395, -0.08994374424219131, 0.2594285011291504, -0.04164646938443184, 0.023110797628760338, 0.05473063886165619, -0.0865827277302742, 0.004552566912025213, -0.047290313988924026, -0.033408962190151215, 0.07667858153581619, 0.08661811053752899, -0.10061170160770416, -0.09619063884019852, 0.038175396621227264, -0.12430655211210251, -0.027918431907892227, 0.050496283918619156, -0.11753968149423599, -0.03632226213812828, 0.01607079617679119, -0.03633038327097893, 0.104647696018219, -0.06309222429990768, 0.004537871107459068, -0.010311504825949669, -0.07343469560146332, -0.07547776401042938, -0.03924960270524025, 0.040177203714847565, -0.04966956749558449, 0.16257250308990479, 0.11374423652887344, 0.023043882101774216, 0.13231104612350464, 0.1070275604724884, 0.0060144346207380295, 0.04192149266600609, 0.22371678054332733, 0.19834481179714203, -0.05695125833153725, 0.08986547589302063, -0.05483701080083847, -0.1194583848118782, -0.18028803169727325, -0.16667701303958893, 0.12641270458698273, 0.19535799324512482, 0.024267645552754402, -0.20015069842338562, 0.009861103259027004, 0.02267937734723091, 0.013980677351355553, -0.062581367790699, 0.17209210991859436, -0.08113144338130951, -0.06605194509029388, -0.024886595085263252, -2.5002318154136743e-32, 0.07705815881490707, 0.07581977546215057, 0.07115548849105835, 0.03000478632748127, -0.15388666093349457, 0.19682344794273376, 0.008673750795423985, -0.08886858075857162, -0.0319855697453022, 0.04014182090759277, -0.14296545088291168, 0.09003990888595581, 0.0184828769415617, -0.010062444023787975, -0.037928685545921326, -0.018936965614557266, -0.10775479674339294, -0.06143718585371971, -0.07828421890735626, 0.04148871451616287, 0.19021105766296387, 0.02160274051129818, 0.040278609842061996, -0.08769981563091278, -0.04918837919831276, 0.022097257897257805, -0.09431736916303635, -0.07433068752288818, -0.023520655930042267, -0.10834065079689026, -0.055072419345378876, 0.09643331170082092, 0.08418574929237366, -0.013345159590244293, -0.020462216809391975, -0.1450786292552948, -0.0656556785106659, -0.15231795608997345, -0.18114328384399414, 0.044723208993673325, 0.0006534943822771311, 0.24151825904846191, 0.026355115696787834, 0.04221691936254501, -0.0286281555891037, 0.11943782866001129, -0.22425052523612976, 0.027166586369276047, -0.07445341348648071, 0.008959612809121609, 0.06466948986053467, -0.05948203057050705, 0.014900943264365196, -0.023187803104519844, 0.16325169801712036, -0.07444563508033752, 0.07528446614742279, 0.09311071783304214, -0.07150314748287201, 0.04993981122970581, 0.09595079720020294, -0.15066199004650116, 0.1251290887594223, 0.04223920777440071, -0.16415315866470337, 0.1407216638326645, 0.3120611608028412, 0.21566516160964966, 0.05037748068571091, 0.08610986918210983, 0.049884214997291565, 0.056257136166095734, -0.09013974666595459, -0.02807735465466976, -0.18302218616008759, 0.0062009356915950775, -0.16869165003299713, 0.09902644157409668, -0.03649642691016197, -0.2583988904953003, 0.10055208206176758, 0.016245268285274506, -0.051513902842998505, -0.0507960319519043, -0.04043698310852051, 0.05766832083463669, 0.014430277049541473, 0.15271569788455963, -0.056130461394786835, -0.06247001886367798, -0.1426505744457245, -0.009264434687793255, -0.07325692474842072, -0.15596744418144226, 0.0002917091187555343, 0.20771047472953796, -0.16220395267009735, 0.15218102931976318, -0.06189566105604172, -0.0408591702580452, -0.02729262411594391, -0.060035571455955505, 0.11005861312150955, -0.03455714136362076, 0.24079883098602295, 0.0467083714902401, 0.06585857272148132, 0.06601161509752274, -0.1999611109495163, -0.0740213692188263, -0.04578285291790962, -0.00900586973875761, 0.13034625351428986, 0.04159630089998245, 0.027911346405744553, -0.06294293701648712, 0.025550372898578644, 0.09307752549648285, 0.19825440645217896, 0.1426793783903122, -0.05134303867816925, -0.10586275160312653, -0.1729181557893753, -0.009784799069166183, 0.14969463646411896, -0.06309910118579865, 0.013479125685989857, -0.08735693991184235, -0.06681157648563385, 0.029260385781526566, 0.0340883806347847, 0.018383434042334557, 7.642718173883623e-7, -0.14612938463687897, 0.21550410985946655, 0.002688582753762603, -0.0698678195476532, -0.07131808251142502, 0.2252233326435089, -0.13246409595012665, 0.022672345861792564, -0.02935432828962803, 0.189722940325737, 0.1997733861207962, -0.1269168108701706, -0.03467081859707832, -0.06514164060354233, 0.2661932110786438, 0.08852630108594894, -0.09099490940570831, 0.16981206834316254, -0.12861548364162445, -0.0004868461692240089, 0.1853015422821045, -0.03788810223340988, 0.022078702226281166, -0.18051090836524963, 0.11320998519659042, 0.07186578959226608, -0.09899135679006577, -0.035739362239837646, 0.11057282239198685, 0.047869324684143066, 0.025646863505244255, -0.006870931014418602, 0.13200369477272034, 0.026853451505303383, -0.026339998468756676, 0.03529706224799156, -0.2554738223552704, -0.045240603387355804, -0.027286972850561142, 0.084947869181633, 0.01976471021771431, 0.0997079610824585, -0.0003488836227916181, -0.20212194323539734, 0.06776672601699829, 0.07520823180675507, -0.09375768154859543, 0.004656355362385511, -0.17486590147018433, 0.3105762302875519, -0.06327620893716812, 0.17926430702209473, 0.005810171831399202, 0.0018220236524939537, -0.154432013630867, 0.11251422017812729, -0.03950316458940506, -0.12178505212068558, 0.1943489909172058, -0.028096793219447136, 0.059265945106744766, -0.01771838776767254, 0.023262320086359978, 0.08118361979722977, 0.030482254922389984, 0.09216479957103729, -0.09414630383253098, 5.032242528262879e-35, 0.0017475710483267903, -0.02372104488313198, -0.07091653347015381, -0.21149148046970367, -0.00923228356987238, -0.07995738089084625, 0.12831689417362213, 0.0899040624499321, 0.01857849769294262, 0.022481242194771767, -0.04487866163253784 ]
https://github.com/huggingface/datasets/issues/6195
Force to reuse cache at given path
realized that need to pass the path at `cache_file_name` like ```python tokenized_datasets = raw_datasets["train"].map( tokenize_function, batched=True, num_proc=data_args.preprocessing_num_workers, remove_columns=[text_column_name], load_from_cache_file=True, desc="Running tokenizer on dataset line_by_line", # cache_file_names= {"train": "cache-1982fea76aa54a13.arrow"} cache_file_name="/project/huggingface_cache/datasets/..../cache-1982fea76aa54a13.arrow", new_fingerprint="1982fea76aa54a13" ) ```
### Describe the bug I have run the official example of MLM like: ```bash python run_mlm.py \ --model_name_or_path roberta-base \ --dataset_name togethercomputer/RedPajama-Data-1T \ --dataset_config_name arxiv \ --per_device_train_batch_size 10 \ --preprocessing_num_workers 20 \ --validation_split_percentage 0 \ --cache_dir /project/huggingface_cache/datasets \ --line_by_line \ --do_train \ --pad_to_max_length \ --output_dir /project/huggingface_cache/test-mlm ``` it successfully runs and at my cache folder has `cache-1982fea76aa54a13_00001_of_00020.arrow`..... `cache-1982fea76aa54a13_00020_of_00020.arrow ` as tokenization cache of `map` method. And the cache works fine every time I run the command above. However, when I switched to jupyter notebook (since I do not want to load datasets every time when I changed other parameters not related to the dataloading). It is not recognizing the cache files and starts to re-run the entire tokenization process. I changed my code to ```python tokenized_datasets = raw_datasets["train"].map( tokenize_function, batched=True, num_proc=data_args.preprocessing_num_workers, remove_columns=[text_column_name], load_from_cache_file=True, desc="Running tokenizer on dataset line_by_line", # cache_file_names= {"train": "cache-1982fea76aa54a13.arrow"} cache_file_name="cache-1982fea76aa54a13.arrow", new_fingerprint="1982fea76aa54a13" ) ``` it still does not recognize the previously cached files and trying to re-run the tokenization process. ### Steps to reproduce the bug use jupyter notebook for dataset map function. ### Expected behavior the map function accepts the given cache_file_name and new_fingerprint then load the previously cached files. ### Environment info - `datasets` version: 2.14.4.dev0 - Platform: Linux-3.10.0-1160.59.1.el7.x86_64-x86_64-with-glibc2.10 - Python version: 3.8.8 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3
32
Force to reuse cache at given path ### Describe the bug I have run the official example of MLM like: ```bash python run_mlm.py \ --model_name_or_path roberta-base \ --dataset_name togethercomputer/RedPajama-Data-1T \ --dataset_config_name arxiv \ --per_device_train_batch_size 10 \ --preprocessing_num_workers 20 \ --validation_split_percentage 0 \ --cache_dir /project/huggingface_cache/datasets \ --line_by_line \ --do_train \ --pad_to_max_length \ --output_dir /project/huggingface_cache/test-mlm ``` it successfully runs and at my cache folder has `cache-1982fea76aa54a13_00001_of_00020.arrow`..... `cache-1982fea76aa54a13_00020_of_00020.arrow ` as tokenization cache of `map` method. And the cache works fine every time I run the command above. However, when I switched to jupyter notebook (since I do not want to load datasets every time when I changed other parameters not related to the dataloading). It is not recognizing the cache files and starts to re-run the entire tokenization process. I changed my code to ```python tokenized_datasets = raw_datasets["train"].map( tokenize_function, batched=True, num_proc=data_args.preprocessing_num_workers, remove_columns=[text_column_name], load_from_cache_file=True, desc="Running tokenizer on dataset line_by_line", # cache_file_names= {"train": "cache-1982fea76aa54a13.arrow"} cache_file_name="cache-1982fea76aa54a13.arrow", new_fingerprint="1982fea76aa54a13" ) ``` it still does not recognize the previously cached files and trying to re-run the tokenization process. ### Steps to reproduce the bug use jupyter notebook for dataset map function. ### Expected behavior the map function accepts the given cache_file_name and new_fingerprint then load the previously cached files. ### Environment info - `datasets` version: 2.14.4.dev0 - Platform: Linux-3.10.0-1160.59.1.el7.x86_64-x86_64-with-glibc2.10 - Python version: 3.8.8 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 realized that need to pass the path at `cache_file_name` like ```python tokenized_datasets = raw_datasets["train"].map( tokenize_function, batched=True, num_proc=data_args.preprocessing_num_workers, remove_columns=[text_column_name], load_from_cache_file=True, desc="Running tokenizer on dataset line_by_line", # cache_file_names= {"train": "cache-1982fea76aa54a13.arrow"} cache_file_name="/project/huggingface_cache/datasets/..../cache-1982fea76aa54a13.arrow", new_fingerprint="1982fea76aa54a13" ) ```
[ 0.03990762680768967, 0.22989612817764282, -0.13304880261421204, 0.08004985004663467, 0.13426871597766876, 0.08583389967679977, 0.15338174998760223, -0.03361272066831589, 0.06238596886396408, 0.07984088361263275, -0.10520343482494354, 0.17490597069263458, 0.00276375119574368, -0.09180807322263718, 0.04388551414012909, 0.05039827525615692, -0.041154999285936356, -0.007325577549636364, -0.03983808308839798, -0.02974460832774639, -0.129716694355011, 0.07834544777870178, 0.21697363257408142, -0.004565260838717222, -0.1432783305644989, 0.003192146774381399, -0.042060524225234985, 0.021797221153974533, 0.013416221365332603, -0.07863856852054596, 0.14898456633090973, -0.03582911193370819, -0.007246597670018673, 0.10089806467294693, 0.000005998076630930882, 0.10634785890579224, 0.050488974899053574, -0.06307198852300644, -0.07800626009702682, -0.04519371688365936, 0.16234637796878815, -0.021882712841033936, 0.06021280214190483, -0.03428057208657265, -0.013630776666104794, 0.03760385140776634, -0.052902888506650925, -0.07039865851402283, 0.17748019099235535, 0.045419298112392426, -0.0254196897149086, -0.034084923565387726, -0.12530212104320526, -0.013905244879424572, 0.08830451220273972, -0.0044431244023144245, -0.013844160363078117, -0.06470009684562683, -0.3303641676902771, -0.2555660307407379, -0.032725993543863297, 0.10760702192783356, 0.0468515045940876, 0.16099533438682556, 0.029313556849956512, 0.04852722957730293, -0.11013062298297882, -0.07070072740316391, 0.060052186250686646, 0.0517377071082592, -0.027699269354343414, -0.16834792494773865, -0.010726605542004108, -0.021003589034080505, -0.07369931787252426, -0.07916673272848129, 0.022763149812817574, 0.036102041602134705, 0.05955212563276291, 0.05399541184306145, 0.004192043095827103, 0.06470068544149399, 0.047013118863105774, -0.077393539249897, -0.1310916543006897, -0.006745909806340933, 0.00790330208837986, 0.15124721825122833, -0.006324351765215397, -0.1036921963095665, 0.047627873718738556, 0.04884801432490349, -0.05556332692503929, -0.02973336912691593, -0.16893251240253448, 0.09509126096963882, -0.009916070848703384, -0.17856763303279877, 0.030843064188957214, -0.05592108890414238, 0.13808445632457733, -0.06535103172063828, -0.01904704049229622, 0.09228099137544632, -0.08118827641010284, -0.009530107490718365, 0.003615720896050334, -0.03296510502696037, 0.03194435313344002, -0.03399928659200668, -0.20933884382247925, -0.14014148712158203, -0.06100694462656975, 0.0020360415801405907, 0.222570538520813, 0.0418209508061409, 0.0711478739976883, 0.2664966583251953, -0.008599738590419292, -0.006706060376018286, -0.0349867008626461, 0.10467932373285294, -0.14002138376235962, 0.18308018147945404, 0.13990254700183868, 0.06889580190181732, -0.07759113609790802, -0.041136812418699265, -0.06802254170179367, 0.007646054960787296, -0.00659349886700511, 0.01899515651166439, -0.08336757868528366, 0.09197533130645752, 0.1779889613389969, 0.1281142681837082, 0.11883074045181274, -0.08237827569246292, -0.06726811081171036, -0.1595422774553299, 0.24909351766109467, -0.11502683162689209, 0.05603613704442978, -0.053696297109127045, -0.03195356950163841, 0.04347744584083557, 0.17022576928138733, 0.06842605024576187, -0.11558231711387634, -0.025177976116538048, -0.0435749888420105, 0.07483889162540436, 0.1195446252822876, -0.04682941734790802, 0.010018317960202694, 0.04481726139783859, -0.0003486906934995204, -0.0024248382542282343, -0.01317610964179039, -0.040952883660793304, 0.05449038743972778, -0.04655587300658226, 0.024526365101337433, -0.04792802035808563, -0.011716440320014954, 0.0808129757642746, 0.1038307249546051, 0.04968104884028435, -0.024100501090288162, 0.06027591973543167, 0.0228755883872509, -0.022077100351452827, -0.12188581377267838, 0.08436208218336105, -0.23886391520500183, 0.11261855810880661, -0.011876347474753857, -0.06042202562093735, -0.022266924381256104, -0.11689583957195282, -0.040458954870700836, 0.1054171770811081, -0.11960318684577942, 0.030568456277251244, 0.12470784038305283, 0.10302915424108505, 0.033936381340026855, 0.06609173119068146, -0.040102310478687286, -0.062122512608766556, -0.053204040974378586, -0.021869059652090073, 0.08725595474243164, -0.1225072517991066, -0.042818449437618256, -0.006789114326238632, 0.023715410381555557, 0.05257191136479378, -0.06673106551170349, -0.08073033392429352, 0.025177961215376854, -0.0788496881723404, -0.036448102444410324, 0.05340689420700073, 0.0745735839009285, 0.0730782076716423, 0.010422013700008392, 0.18175764381885529, -0.09782522916793823, -0.2631646990776062, -0.035439085215330124, 0.057148437947034836, 0.07570109516382217, -0.03693319857120514, -0.15444187819957733, -0.23664222657680511, 0.00931159220635891, 0.08651416748762131, -0.10937301814556122, -0.02876144088804722, -0.05835847556591034, 0.11814793944358826, 0.07835669815540314, 0.05511859804391861, -0.06209614500403404, -0.07036151736974716, 0.09417236596345901, -0.01955367624759674, 0.06452184170484543, 0.029299253597855568, 0.02346734330058098, -0.012585639022290707, 0.10353614389896393, 0.05647080019116402, -0.06607367098331451, 0.10263769328594208, -0.13446296751499176, -0.11026566475629807, 0.0259442999958992, 0.04037607088685036, -0.20981372892856598, -0.02137272246181965, -0.0795411691069603, 0.06426796317100525, -0.07817286252975464, 0.03140219300985336, 0.15807974338531494, 0.11892684549093246, 0.09474815428256989, -0.04077117145061493, 0.1743803322315216, -0.057830799371004105, -0.19906529784202576, 0.003262736601755023, 0.00816284865140915, 0.0836978629231453, 0.08312615007162094, 0.2276289165019989, -0.07049895077943802, -0.018078656867146492, 0.1081250011920929, 0.1992032825946808, 0.10637489706277847, -0.05540451779961586, 0.062136318534612656, -0.05004483833909035, -0.08454951643943787, 0.07094746828079224, -0.06539438664913177, 0.15052931010723114, 0.10967045277357101, -0.0332561619579792, -0.12788914144039154, 0.017127005383372307, -0.02508983388543129, -0.08433257788419724, -0.014217998832464218, 0.04004219174385071, 0.09417734295129776, -0.03917553648352623, -0.1799042820930481, 0.027003182098269463, 0.1487681120634079, -0.06797894090414047, 0.1429058313369751, 0.13360050320625305, -0.13835974037647247, -0.0016211285255849361, -0.24771767854690552, -0.16346600651741028, 0.04822792112827301, -0.18502329289913177, 0.10360986739397049, 0.13903917372226715, 0.046732097864151, 0.09426019340753555, 0.05377522483468056, -0.13419640064239502, -0.016934407874941826, -0.21097488701343536, 0.030437884852290154, -0.037348661571741104, -0.0498446486890316, -0.1337866187095642, 0.0770980641245842, -0.057122692465782166, 0.15037663280963898, 0.039861492812633514, -0.10675486922264099, -0.22567351162433624, -0.061593737453222275, 0.02924068085849285, 0.2139025777578354, 0.12054898589849472, -0.08721169829368591, -0.07011108100414276, 0.05381488427519798, -0.2908293604850769, 0.1363745778799057, -0.19197209179401398, 0.10618709027767181, -0.016024408861994743, 0.03128500282764435, 0.06466404348611832, -0.024224234744906425, -0.1493990272283554, 0.08328929543495178, -0.05323805660009384, -0.07476155459880829, -0.004609455354511738, -0.02844315394759178, 0.0769592747092247, -0.08699531108140945, -0.17542974650859833, -0.0671020895242691, -0.14917661249637604, -0.046710055321455, -0.0671171322464943, 0.18256376683712006, -0.026128388941287994, 0.21333138644695282, 0.08775868266820908, -0.24118542671203613, 0.09801772981882095, 0.05751848965883255, -0.021765470504760742, -0.003850259818136692, -0.024675430729985237, 0.14140944182872772, 0.007747107185423374, 0.048862289637327194, -0.09877608716487885, 0.012732397764921188, -0.2924695611000061, -0.15145254135131836, 0.05884060636162758, -0.0654769092798233, 0.014740752056241035, -0.03181714564561844, 0.0759647786617279, -0.007393659092485905, 0.0975499078631401, 0.08431416004896164, -0.12172064930200577, -0.16952921450138092, 0.12860949337482452, 0.10819147527217865, 0.1226992979645729, -0.024361127987504005, 0.03748738765716553, -0.040836017578840256, -0.09279065579175949, -0.14323250949382782, -0.08251414448022842, -0.00967146921902895, -0.08494483679533005, -0.017427925020456314, 0.004920844454318285, 0.14272812008857727, -0.057248491793870926, 0.05422484874725342, -0.11873120814561844, -0.024406345561146736, 0.13485656678676605, 0.11141710728406906, 0.0337362140417099, 0.06726917624473572, -0.013034106232225895, -0.0642857700586319, 0.12975341081619263, 0.13335475325584412, 0.06014162302017212, 0.13607309758663177, -0.06422322243452072, -0.12043986469507217, -0.18008816242218018, 0.13093014061450958, 0.010097881779074669, -0.09975163638591766, -0.01903344877064228, 0.0007357546128332615, 0.19091640412807465, 0.08798076957464218, -0.06684201210737228, 0.03378795087337494, 0.06248898804187775, -0.07243908196687698, -0.02726314403116703, 0.16403302550315857, 0.005560080986469984, 0.10209532082080841, 0.1018136739730835, 0.14661036431789398, -0.024291016161441803, 0.005718442145735025, 0.03810526058077812, 0.055427566170692444, -0.16885259747505188, 0.027801690623164177, -0.09454631060361862, -0.09195806831121445, 0.0072063663974404335, 0.00033597383298911154, -0.03200780600309372, 0.08321978896856308, -0.0463828481733799, -0.17103710770606995, -0.14468102157115936, 0.09719589352607727, -0.011637500487267971, 0.04821836203336716, 0.05617985874414444, 0.0983184427022934, 0.04055533930659294, 0.1525743305683136, 0.028066391125321388, 0.09427134692668915, -0.23758147656917572, -0.05506807938218117, -0.08030644804239273, 0.00262070307508111, -0.08322773873806, 0.13200417160987854, -0.11889635026454926, 0.004176243208348751, -0.09027884900569916, -0.032980866730213165, -0.029313646256923676, 0.06266415864229202, -0.14198657870292664, -0.10968516021966934, -0.07245811074972153, -0.07675947993993759, -0.18853312730789185, 0.01984323002398014, -0.030291784554719925, 0.08013959974050522, -0.20323358476161957, -0.09581569582223892, 0.1779308170080185, -0.14683812856674194, -0.06906171143054962, 0.15619991719722748, 0.11294401437044144, -0.05330231785774231, 0.22505566477775574, 0.1968335509300232, -0.23748479783535004, 0.20925654470920563, 0.09919799119234085, 0.005726056173443794, 0.022406287491321564, -0.09812115877866745, -0.011874256655573845, 0.10594017803668976, 0.1875842958688736, 0.07330185920000076, -0.07082938402891159, 0.16101698577404022, -0.014919155277311802, 0.08127909153699875, -0.042319852858781815, 0.05172250419855118, -0.0911317691206932, 0.0023328042589128017, 0.11327551305294037, 0.258337140083313, 0.0028978269547224045, -0.0037114473525434732, 0.06361749023199081, -0.11893776059150696, 0.01691567897796631, 0.09041757881641388, -0.22990018129348755, 0.06747086346149445, 0.024789422750473022, -0.0070252977311611176, -0.2551945149898529, 0.0067316684871912, 0.0996517688035965, -0.026063067838549614, -0.06771273910999298, -0.03982199728488922, 0.0936393216252327, -0.04327201843261719, -0.21392551064491272, -0.010156781412661076, -0.12721508741378784, 0.10534580796957016, 0.05505027249455452, -0.08274036645889282, 0.04574881121516228, -0.11129925400018692, -0.12274014204740524, 0.11439211666584015, -0.038134291768074036, 0.04965068772435188, 0.006680050864815712, -0.036001723259687424, 0.01855497620999813, -0.08784088492393494, -0.016134634613990784, -0.0825703963637352, 0.043105535209178925, -0.013053925707936287, -0.26451385021209717, -0.08542075753211975, 0.016934074461460114, 0.023560374975204468, 0.0024903288576751947, -0.05355089157819748, 0.13846564292907715, -0.12594078481197357, -0.09504366666078568, -0.09388698637485504, 0.0013544565299525857, 0.09301204979419708, -0.01077385526150465, 0.03904178738594055, -0.05993668735027313, 0.022465629503130913, -0.15435701608657837, -0.16163991391658783, 0.08389250934123993, -0.015711849555373192, -0.09976482391357422, -0.020042207092046738, -0.058376602828502655, -0.05225164443254471, -0.16912655532360077, 0.12675046920776367, 0.32220593094825745, 0.23197948932647705, 0.04043961688876152, -0.01831989735364914, -2.505044289285941e-32, 0.017392124980688095, -0.04108124598860741, 0.02539750002324581, -0.06179957091808319, -0.11581779271364212, 0.0581168606877327, 0.0892498791217804, -0.09850671887397766, 0.0568234920501709, -0.15753859281539917, -0.07426248490810394, -0.14610227942466736, 0.03737715631723404, -0.03270459175109863, 0.01274199690669775, -0.039245232939720154, -0.00866277888417244, 0.09708011895418167, -0.18777309358119965, 0.1332109272480011, 0.21357128024101257, 0.013577560894191265, 0.050342679023742676, 0.03503665700554848, -0.07047540694475174, -0.11075299233198166, -0.047528237104415894, -0.21338024735450745, -0.20096012949943542, -0.00312231807038188, -0.014007624238729477, 0.1088825911283493, 0.005082979332655668, -0.16429376602172852, -0.1684310883283615, -0.014837507158517838, -0.14663603901863098, -0.09860437363386154, -0.0459510013461113, -0.042046524584293365, 0.03590662404894829, 0.056672319769859314, 0.06131323054432869, -0.14476360380649567, 0.0012638921616598964, 0.18458375334739685, -0.048223938792943954, 0.07052436470985413, -0.13358034193515778, -0.01142422016710043, 0.0038508379366248846, 0.05280812457203865, 0.09911675751209259, 0.13280776143074036, 0.035660624504089355, -0.11560969799757004, 0.01908780448138714, 0.13422365486621857, -0.2774844467639923, 0.0470123253762722, -0.08937094360589981, 0.02801596373319626, 0.03537813574075699, -0.024985047057271004, 0.11595799028873444, 0.12004683911800385, 0.23957814276218414, 0.06334421783685684, 0.2850867509841919, 0.02070751041173935, 0.060624632984399796, -0.18338124454021454, -0.04328061640262604, -0.12267043441534042, -0.06544863432645798, -0.08990097045898438, 0.05351254716515541, -0.18661001324653625, 0.06647011637687683, 0.12716414034366608, 0.048225779086351395, 0.012847134843468666, 0.07254154980182648, -0.0055206529796123505, -0.09825126826763153, 0.1928357034921646, -0.04370594024658203, 0.15143649280071259, -0.17178086936473846, 0.11117186397314072, 0.07110969722270966, 0.027467234060168266, 0.015011194162070751, -0.047301240265369415, -0.027405712753534317, 0.10989801585674286, 0.18182526528835297, -0.017503414303064346, 0.03052903153002262, 0.13149254024028778, 0.14772216975688934, -0.05800124257802963, 0.07615000754594803, -0.08206000924110413, 0.22068050503730774, 0.11110096424818039, 0.19013835489749908, -0.005072897765785456, -0.13484075665473938, 0.021046089008450508, -0.11630350351333618, -0.14563773572444916, 0.22486555576324463, -0.18075507879257202, 0.1207694411277771, 0.17597627639770508, -0.028248850256204605, 0.16260553896427155, 0.006695389747619629, 0.08995361626148224, -0.12386921048164368, -0.04181408882141113, 0.09848452359437943, 0.13250946998596191, -0.0024572836700826883, 0.25111106038093567, -0.023063136264681816, -0.055849071592092514, 0.08255870640277863, -0.029152266681194305, -0.04906986653804779, -0.1777876615524292, 7.420171073135862e-7, -0.13638854026794434, -0.0738401934504509, -0.010174335911870003, -0.19702063500881195, -0.029164651408791542, 0.1414356827735901, -0.15415282547473907, -0.01336151733994484, -0.15163040161132812, 0.1696232557296753, 0.06012878194451332, -0.05999847501516342, -0.019823940470814705, -0.01661028154194355, 0.07072937488555908, -0.03377658873796463, -0.09403781592845917, 0.017077429220080376, -0.09325981885194778, -0.009428773075342178, -0.16492095589637756, 0.09083415567874908, 0.1273380070924759, -0.04830688610672951, -0.0760798305273056, 0.05882677063345909, -0.12755174934864044, 0.1342162936925888, 0.028160830959677696, 0.09526703506708145, 0.02448604814708233, -0.0023844081442803144, 0.08426006883382797, -0.05354810506105423, 0.009429965168237686, -0.04846449941396713, -0.19973167777061462, -0.13331717252731323, 0.08722005039453506, -0.19291147589683533, 0.24809610843658447, 0.07464317977428436, -0.18236495554447174, -0.09331003576517105, 0.03799557313323021, -0.002298066159710288, 0.04378948360681534, -0.1634739190340042, -0.030392073094844818, -0.024791689589619637, 0.2430308610200882, 0.11607863008975983, 0.009402346797287464, 0.33761945366859436, 0.01873592659831047, 0.10850351303815842, -0.05289708822965622, -0.2179306149482727, 0.1360434591770172, -0.2217564731836319, -0.1772233247756958, -0.12258446216583252, -0.0016521982615813613, -0.02838027849793434, 0.1865941286087036, -0.14800238609313965, -0.04423905909061432, 1.3185070139242425e-34, 0.07382854074239731, 0.015903176739811897, 0.0028316171374171972, -0.06240518391132355, 0.123041070997715, -0.04003148153424263, -0.0059548658318817616, 0.0951460525393486, 0.053600143641233444, -0.18241514265537262, -0.1342022716999054 ]
https://github.com/huggingface/datasets/issues/6194
Support custom fingerprinting with `Dataset.from_generator`
The `fingerprint` parameter serves a slightly different purpose - we use it to inject a new fingerprint after transforming a `Dataset` (computed from the previous fingerprint + transform + transform args), e.g., to be able to compute the cache file for a transform. There is no concept of `fingerprint` before a `Dataset` is fully initialized, but we still need to hash the args (e.g., generator func) of the "dataset creation methods" (`from_generator`, `from_csv`, etc.) to compute the cache directory (to store the initial version and transformed dataset versions) I agree it should be easier to bypass the hashing mechanism in this instance, too. However, we should probably first address https://github.com/huggingface/datasets/issues/5080 before solving this (e.g., maybe exposing `hash` in `load_dataset`/`load_dataset_builder`.
### Feature request When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`. ### Motivation Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash. ### Your contribution If validated, I can try to submit a PR for this.
119
Support custom fingerprinting with `Dataset.from_generator` ### Feature request When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`. ### Motivation Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash. ### Your contribution If validated, I can try to submit a PR for this. The `fingerprint` parameter serves a slightly different purpose - we use it to inject a new fingerprint after transforming a `Dataset` (computed from the previous fingerprint + transform + transform args), e.g., to be able to compute the cache file for a transform. There is no concept of `fingerprint` before a `Dataset` is fully initialized, but we still need to hash the args (e.g., generator func) of the "dataset creation methods" (`from_generator`, `from_csv`, etc.) to compute the cache directory (to store the initial version and transformed dataset versions) I agree it should be easier to bypass the hashing mechanism in this instance, too. However, we should probably first address https://github.com/huggingface/datasets/issues/5080 before solving this (e.g., maybe exposing `hash` in `load_dataset`/`load_dataset_builder`.
[ -0.09917240589857101, 0.17592981457710266, -0.0680978000164032, -0.04472383111715317, 0.006823171861469746, 0.009694105014204979, 0.20038510859012604, -0.04555930569767952, -0.02734151855111122, 0.12439591437578201, 0.0015395894879475236, 0.16240283846855164, -0.1836184859275818, 0.2421378791332245, 0.12881030142307281, -0.04960359260439873, -0.02855210192501545, 0.07348878681659698, -0.16161563992500305, 0.1462922841310501, -0.03735896572470665, 0.10849284380674362, 0.1990751177072525, -0.015473360195755959, -0.0822749063372612, -0.029026102274656296, -0.08107130229473114, 0.1639704555273056, 0.06959065794944763, -0.03862646222114563, 0.01972081884741783, 0.04904394596815109, 0.015306511893868446, 0.14299426972866058, 0.0000057776860558078624, 0.16053403913974762, 0.06349087506532669, 0.017131760716438293, -0.03287145122885704, -0.05012879520654678, 0.1281483918428421, 0.03559993952512741, 0.07841770350933075, -0.08182866126298904, -0.04521803930401802, 0.06816419214010239, 0.04952901229262352, -0.031568314880132675, 0.012711437419056892, -0.11530499160289764, 0.018648074939846992, -0.013372447341680527, -0.13867688179016113, -0.11092060804367065, 0.1684025526046753, 0.19874054193496704, -0.04316597059369087, 0.002996385097503662, -0.09150335192680359, -0.06333236396312714, 0.04572077468037605, -0.012850814498960972, 0.05619298294186592, -0.054583415389060974, 0.15847592055797577, 0.042030882090330124, -0.2296484261751175, -0.07268156856298447, -0.028109770268201828, 0.16267065703868866, -0.10024835914373398, -0.2387060821056366, 0.011850884184241295, -0.05600146949291229, 0.09412442147731781, 0.006745635997503996, 0.03245119750499725, -0.14711537957191467, -0.1503061056137085, 0.06331928819417953, -0.10978953540325165, 0.053180549293756485, 0.0512579120695591, -0.1702854335308075, -0.09546343237161636, -0.052079517394304276, 0.05343998223543167, 0.02545681595802307, -0.08043431490659714, -0.0751277357339859, 0.056696951389312744, 0.0663573369383812, -0.021516254171729088, -0.051576096564531326, 0.1276063323020935, -0.08258526772260666, -0.0331534780561924, 0.005390908569097519, 0.047229547053575516, -0.054294124245643616, 0.06075246259570122, 0.058182716369628906, -0.16747713088989258, 0.03736830875277519, -0.057245053350925446, -0.15855446457862854, -0.07277742773294449, -0.04588207229971886, 0.027447670698165894, -0.07810884714126587, -0.13391350209712982, 0.06777794659137726, 0.004274855367839336, -0.17265525460243225, 0.10423695296049118, 0.1164899468421936, -0.05574830621480942, 0.21713195741176605, 0.04864652827382088, -0.15980572998523712, 0.027045104652643204, 0.14478985965251923, 0.014745015650987625, 0.15940223634243011, 0.014279748313128948, -0.057476580142974854, -0.060250043869018555, -0.16273893415927887, -0.05919180437922478, -0.012969404458999634, -0.056540101766586304, 0.05414443463087082, 0.09788035601377487, 0.1257597953081131, 0.07781390845775604, -0.11588293313980103, 0.09799561649560928, -0.18747469782829285, 0.20256584882736206, 0.032855693250894547, 0.16281287372112274, 0.09850385785102844, 0.1165933758020401, -0.04116862267255783, 0.08932293206453323, -0.03636431694030762, 0.04927779734134674, 0.03611272946000099, -0.18856021761894226, 0.06979655474424362, -0.028735460713505745, 0.0256380382925272, -0.055191997438669205, 0.049883417785167694, -0.1502043455839157, 0.0929470956325531, -0.00863566529005766, -0.13900770246982574, -0.22234180569648743, -0.11938604712486267, 0.008906246162950993, -0.10722147673368454, -0.049809299409389496, -0.08534464985132217, 0.08282440155744553, 0.05010209605097771, 0.11381615698337555, 0.058763906359672546, -0.02305370382964611, -0.21979089081287384, -0.050852298736572266, -0.18351158499717712, -0.053507473319768906, -0.1331169754266739, -0.223443865776062, 0.2509513795375824, -0.03802267462015152, 0.015685996040701866, 0.00030507793417200446, 0.025208694860339165, -0.04058198258280754, -0.0134639423340559, -0.027788521721959114, 0.02880922332406044, 0.0942084789276123, -0.09069809317588806, -0.11690958589315414, 0.12804654240608215, -0.10294266790151596, 0.031027693301439285, -0.053953867405653, -0.04884953051805496, 0.049414679408073425, 0.12746326625347137, -0.1405058056116104, 0.11209017783403397, 0.2205965667963028, -0.14116670191287994, 0.023673221468925476, -0.12105054408311844, -0.1437169909477234, -0.08688721805810928, 0.10137391090393066, -0.0024699487257748842, -0.01687060296535492, -0.025143269449472427, -0.11280507594347, 0.13582000136375427, -0.03269030153751373, -0.06203724816441536, -0.05329682677984238, -0.017435919493436813, 0.16706211864948273, -0.1082695871591568, -0.13232019543647766, 0.02244911901652813, -0.056981585919857025, 0.10109210014343262, -0.05938111990690231, 0.03236842155456543, 0.08490849286317825, -0.020934073254466057, 0.06897266209125519, 0.0034782178699970245, -0.0604037307202816, -0.049253273755311966, 0.2038784921169281, -0.0005745827220380306, 0.10501767694950104, 0.012399683706462383, 0.03698057308793068, -0.0386786088347435, 0.1471608430147171, 0.1042938083410263, 0.0013848848175257444, -0.028089774772524834, 0.08352641761302948, -0.03313415125012398, -0.0897015854716301, -0.0626482367515564, -0.19229555130004883, -0.13366559147834778, -0.12132906168699265, 0.000004689795787271578, 0.0707123875617981, 0.12622199952602386, -0.15516258776187897, 0.04776344820857048, -0.0031645421404391527, 0.024019520729780197, 0.12833037972450256, 0.03542860969901085, -0.07900360971689224, 0.1038072481751442, -0.08801696449518204, -0.07798612862825394, 0.22250404953956604, 0.011441120877861977, 0.022357044741511345, 0.04145780950784683, 0.08121377229690552, 0.07512640208005905, 0.015173937194049358, 0.04208475723862648, 0.09127505868673325, -0.03342890366911888, -0.03714783862233162, 0.11647944897413254, 0.04617864266037941, 0.1855105608701706, 0.18020068109035492, 0.05481351166963577, 0.038515813648700714, -0.06220246106386185, -0.005762716289609671, -0.23729240894317627, -0.003098046639934182, 0.08085368573665619, -0.004665044602006674, 0.02433590404689312, -0.109587661921978, -0.01828199438750744, 0.2212279587984085, -0.06061018258333206, -0.012423709966242313, 0.03756402060389519, -0.21902860701084137, 0.16603030264377594, -0.10417000949382782, -0.2245420664548874, -0.046965084969997406, -0.06357027590274811, 0.0824318379163742, 0.07127027958631516, 0.03169482201337814, -0.11355863511562347, -0.09263966232538223, -0.05851801484823227, -0.09363502264022827, -0.2500928044319153, -0.08066487312316895, -0.0037393374368548393, 0.061378370970487595, 0.020328868180513382, -0.006109388545155525, 0.12779074907302856, 0.21273934841156006, 0.07590268552303314, -0.1061956062912941, -0.2634829878807068, -0.14034603536128998, -0.06221164017915726, -0.035431019961833954, 0.16611498594284058, 0.24620789289474487, -0.10104947537183762, -0.15857625007629395, -0.11950135231018066, 0.11464423686265945, -0.033759262412786484, -0.10987715423107147, -0.03607003390789032, -0.0023890763986855745, 0.041246235370635986, -0.007897590287029743, 0.08447457104921341, -0.13478893041610718, -0.18637333810329437, 0.05234500765800476, -0.024099299684166908, 0.00688709132373333, 0.13902370631694794, 0.07404235750436783, 0.05824718996882439, 0.059852056205272675, -0.11460908502340317, -0.026004433631896973, -0.32459747791290283, 0.17870570719242096, -0.10170339792966843, 0.0767311230301857, -0.033821504563093185, -0.09262615442276001, 0.031403470784425735, 0.20947299897670746, -0.10312772542238235, -0.03764830902218819, -0.01381134893745184, 0.1261017769575119, 0.06962728500366211, -0.020759157836437225, 0.07595266401767731, -0.0008692576084285975, -0.019874131307005882, -0.03291972726583481, 0.05581647530198097, -0.1243072897195816, -0.048385586589574814, -0.13181519508361816, 0.17319244146347046, -0.03281892463564873, 0.09651342034339905, 0.25354066491127014, -0.13858412206172943, -0.17028479278087616, 0.036058224737644196, 0.077550508081913, 0.07127633690834045, -0.06853979080915451, -0.03904247656464577, -0.09360329806804657, -0.06638681143522263, -0.04531315714120865, -0.08255547285079956, -0.030737189576029778, 0.0012109802337363362, -0.0005326872924342752, -0.11757639795541763, 0.06677526235580444, -0.00470191054046154, 0.06776797771453857, -0.20389197766780853, 0.004921053536236286, -0.05356986075639725, 0.13316096365451813, -0.1136397048830986, 0.027867544442415237, -0.013755016028881073, 0.06767085939645767, 0.16779038310050964, -0.013613603077828884, -0.0013730813516303897, 0.1232420802116394, -0.07645972073078156, -0.07719676196575165, 0.06515916436910629, -0.0609942227602005, -0.07556066662073135, -0.08670277893543243, 0.03682167828083038, 0.10589948296546936, 0.14719289541244507, -0.05053522810339928, -0.06719662249088287, 0.07013064622879028, -0.2597750127315521, 0.13034403324127197, 0.2189043015241623, 0.3147333264350891, 0.0497572124004364, -0.052260931581258774, 0.10632459819316864, -0.05532267317175865, -0.09037382155656815, 0.04729922115802765, -0.0389680340886116, -0.0008626525523141026, -0.05295191705226898, 0.14696814119815826, -0.01799165830016136, -0.02594022825360298, -0.06532658636569977, -0.005693870596587658, -0.0022538236808031797, 0.18501423299312592, -0.11578556150197983, -0.2339179962873459, 0.10786475241184235, 0.09726333618164062, 0.07871328294277191, 0.06233171001076698, 0.03764738142490387, 0.1020401194691658, 0.07997071743011475, -0.018160995095968246, -0.1136411726474762, 0.2533864974975586, -0.15631356835365295, -0.23262280225753784, -0.05816563218832016, -0.010148950852453709, 0.04106655344367027, 0.20969781279563904, -0.025626087561249733, 0.015702346339821815, -0.04405774548649788, -0.1499880850315094, -0.013090318068861961, 0.07222191244363785, -0.17182424664497375, -0.180219829082489, -0.12349966913461685, -0.048424847424030304, 0.0659438893198967, 0.1455015242099762, -0.05448401719331741, 0.2469196915626526, -0.07338396459817886, -0.13506315648555756, 0.12719537317752838, 0.05307585746049881, -0.03662180155515671, -0.023600513115525246, -0.09411425143480301, -0.08199936151504517, 0.25185516476631165, 0.1814020872116089, -0.06821642816066742, -0.09763612598180771, -0.10654892772436142, -0.11161438375711441, -0.01808762177824974, -0.10767071694135666, 0.09450837224721909, 0.11973556876182556, 0.12096264958381653, -0.09861275553703308, -0.04588611051440239, -0.05252468213438988, -0.03724966570734978, 0.1310245543718338, 0.11177802085876465, 0.06575490534305573, 0.01258927397429943, 0.04343189299106598, 0.22008061408996582, -0.09662232547998428, 0.1214171051979065, -0.13112081587314606, 0.03606097027659416, -0.11656903475522995, -0.10031231492757797, 0.013297968544065952, -0.02825344353914261, 0.005799547303467989, 0.22312946617603302, -0.11916335672140121, 0.07686332613229752, -0.0326627679169178, 0.055875129997730255, -0.12032509595155716, -0.055204398930072784, 0.15641534328460693, 0.07863321155309677, 0.1523744761943817, 0.002343476517125964, -0.06443051993846893, -0.06241495907306671, 0.0714651420712471, 0.04268667846918106, 0.09512275457382202, -0.00044578523375093937, -0.23133151233196259, -0.11387287080287933, 0.01688281260430813, -0.09107682853937149, -0.08121036738157272, 0.18986165523529053, 0.0269158985465765, 0.025742003694176674, -0.04014614596962929, -0.0634419396519661, 0.031098496168851852, -0.12948521971702576, -0.06685386598110199, -0.04764174669981003, -0.06096753850579262, -0.12044335901737213, -0.15390519797801971, -0.08740096539258957, 0.22009411454200745, 0.14835138618946075, 0.04402347281575203, -0.061976950615644455, -0.14228872954845428, 0.05273834243416786, 0.09314358979463577, 0.013422454707324505, -0.05151364579796791, 0.014506299048662186, -0.04721057042479515, -0.05360998213291168, -0.14143142104148865, 0.0030742145609110594, 0.054073989391326904, -0.12219828367233276, 0.018761858344078064, -0.11651316285133362, -0.15131886303424835, -0.23390600085258484, 0.06272543966770172, 0.14203958213329315, 0.09148052334785461, -0.2390194982290268, 0.03928433358669281, -2.783929736271353e-32, -0.012461350299417973, 0.03354904055595398, -0.011536497622728348, -0.026593247428536415, 0.10596821457147598, -0.09058040380477905, 0.020660171285271645, -0.0684404969215393, 0.14994923770427704, -0.16942985355854034, -0.10038675367832184, -0.04062730073928833, 0.13479140400886536, 0.05449596047401428, -0.10247515141963959, -0.021315209567546844, 0.2177993506193161, 0.031091783195734024, -0.028756191954016685, 0.13090594112873077, 0.25772881507873535, -0.03629579767584801, 0.05757880583405495, 0.04096093028783798, -0.13789422810077667, -0.15459473431110382, -0.09468219429254532, -0.11078611761331558, -0.1125989630818367, 0.040006980299949646, 0.014231198467314243, -0.05759614706039429, -0.08062402904033661, 0.06527714431285858, 0.05073847249150276, -0.030395783483982086, -0.2873765230178833, 0.026113903149962425, -0.04658009111881256, 0.01843603141605854, 0.17495152354240417, -0.07768364250659943, -0.05395476147532463, -0.02119445987045765, 0.05199076607823372, 0.24950899183750153, -0.05704750865697861, 0.13193099200725555, 0.061070725321769714, -0.0665573701262474, 0.05411507561802864, -0.042138244956731796, 0.011005678214132786, 0.06597515940666199, 0.03891102224588394, -0.05318574979901314, 0.0018374442588537931, -0.07402587682008743, -0.12560151517391205, 0.01546779926866293, 0.21393811702728271, -0.059519004076719284, 0.0013996206689625978, 0.2674782872200012, 0.07929805666208267, -0.0065910667181015015, 0.2895677089691162, -0.18693947792053223, 0.18732570111751556, -0.037165481597185135, 0.07996431738138199, -0.02536310814321041, -0.02820192091166973, 0.2022704780101776, 0.08058547228574753, 0.04174886271357536, -0.13292960822582245, 0.13647621870040894, 0.1608196645975113, -0.10342154651880264, 0.027410103008151054, -0.055898137390613556, 0.027161726728081703, -0.03038378432393074, 0.013826406560838223, -0.05582313612103462, 0.08602646738290787, -0.02434403821825981, -0.011569605208933353, 0.04878032207489014, -0.16344480216503143, 0.26257747411727905, 0.03704320639371872, 0.020163079723715782, -0.018561532720923424, 0.09689454734325409, 0.02830534055829048, 0.03174296021461487, -0.09175281971693039, -0.08538324385881424, 0.15576720237731934, -0.17012134194374084, 0.19627070426940918, -0.07005804032087326, 0.22069570422172546, -0.06648288667201996, 0.12331939488649368, 0.009401259012520313, -0.2549285888671875, 0.04215460643172264, -0.08807821571826935, 0.05690786987543106, -0.04112068563699722, -0.01288555283099413, 0.09292830526828766, 0.042993608862161636, 0.05575006455183029, -0.07069609314203262, 0.08346175402402878, 0.09579651057720184, -0.1127936989068985, 0.03728502616286278, 0.08220450580120087, 0.14100831747055054, 0.0006765032303519547, 0.05615803226828575, 0.008955588564276695, -0.17705772817134857, 0.1733807921409607, -0.05149395391345024, -0.043096527457237244, -0.03169972077012062, 7.682270393161161e-7, -0.07524065673351288, 0.042764339596033096, 0.14890079200267792, -0.09179189056158066, -0.1052735224366188, 0.1038426011800766, 0.032531894743442535, 0.11628154665231705, 0.05449099466204643, 0.023716969415545464, -0.02265714854001999, -0.13475218415260315, -0.04059169441461563, 0.1333223134279251, -0.195888489484787, 0.09070798009634018, -0.0039120023138821125, 0.07680846750736237, -0.07671762257814407, 0.11880549788475037, -0.15273955464363098, 0.0982096716761589, 0.015624402090907097, -0.0785444974899292, 0.12199829518795013, 0.003986225929111242, -0.056621599942445755, -0.008508714847266674, -0.03883495181798935, 0.025020668283104897, -0.010129834525287151, 0.0006691216258332133, 0.027327444404363632, 0.05890975147485733, -0.10087736696004868, 0.02923758327960968, 0.002291207667440176, -0.005988551303744316, -0.014014934189617634, 0.0034750038757920265, -0.0405367836356163, -0.0389174185693264, -0.03719499334692955, -0.07316607236862183, 0.08350560814142227, 0.15818339586257935, -0.13672566413879395, 0.10070241987705231, -0.054953474551439285, 0.006892453879117966, -0.04308534041047096, 0.03572362661361694, 0.10461577028036118, 0.1570657640695572, -0.0008707768865860999, -0.05654098838567734, -0.03492174297571182, -0.04617936909198761, 0.048031024634838104, -0.1855563074350357, -0.03606310859322548, 0.0003037847054656595, -0.094547800719738, 0.027539925649762154, 0.02062472328543663, -0.04009384661912918, -0.02704310044646263, 2.5759512289205942e-34, -0.015747686848044395, 0.17744289338588715, -0.022208157926797867, -0.0498647540807724, 0.016421927139163017, -0.006566687952727079, 0.011631142348051071, 0.08990967273712158, 0.050287917256355286, -0.11530722677707672, -0.23620910942554474 ]
https://github.com/huggingface/datasets/issues/6194
Support custom fingerprinting with `Dataset.from_generator`
Adding +1 here: If the generator needs to access some external resources or state, then it's not always straightforward to make it pickle-able. So I'd like to be able to override how the default cache key derivation needs to pickle the generator (and of course, I'd accept responsibility for that part of cache consistency). Appears to be a recurrent roadbump: #6118 #5963 #5819 #5750 #4983
### Feature request When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`. ### Motivation Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash. ### Your contribution If validated, I can try to submit a PR for this.
65
Support custom fingerprinting with `Dataset.from_generator` ### Feature request When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`. ### Motivation Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash. ### Your contribution If validated, I can try to submit a PR for this. Adding +1 here: If the generator needs to access some external resources or state, then it's not always straightforward to make it pickle-able. So I'd like to be able to override how the default cache key derivation needs to pickle the generator (and of course, I'd accept responsibility for that part of cache consistency). Appears to be a recurrent roadbump: #6118 #5963 #5819 #5750 #4983
[ -0.11452098190784454, 0.21372880041599274, -0.06579605489969254, -0.016619987785816193, -0.015369163826107979, -0.010753121227025986, 0.16993561387062073, -0.020987555384635925, 0.01633787900209427, 0.10584192723035812, 0.07749754935503006, 0.204555481672287, -0.23311686515808105, 0.21469317376613617, 0.11308281123638153, -0.044667650014162064, -0.004478998947888613, 0.06054321303963661, -0.09510419517755508, 0.13187271356582642, -0.08063080906867981, 0.12317325174808502, 0.1900370717048645, -0.03224381431937218, -0.038759682327508926, -0.08189176768064499, -0.08386337757110596, 0.11656521260738373, 0.04513201117515564, -0.05582836642861366, 0.0008653325494378805, 0.020011909306049347, -0.01828959584236145, 0.07622966915369034, 0.0000057837737585941795, 0.11238772422075272, 0.055879779160022736, 0.06999573856592178, -0.04855682700872421, 0.047065913677215576, 0.029740694910287857, 0.08681309968233109, 0.0850713849067688, -0.045949164777994156, -0.0464232861995697, 0.1073744148015976, 0.015247799456119537, -0.057777877897024155, 0.0007347263745032251, -0.17384417355060577, 0.028742223978042603, 0.07362908869981766, -0.15202175080776215, -0.10957036912441254, 0.16316159069538116, 0.2055099606513977, -0.06784047931432724, 0.00991308968514204, -0.08813668042421341, -0.08316661417484283, 0.053011827170848846, 0.019860178232192993, 0.0220550037920475, -0.0018149723764508963, 0.11025772988796234, 0.044819459319114685, -0.14644663035869598, -0.01963483728468418, -0.022481342777609825, 0.15786747634410858, -0.11041241884231567, -0.18439388275146484, 0.015758469700813293, -0.07209903001785278, 0.06506969034671783, -0.02245301753282547, 0.07058663666248322, -0.17325180768966675, -0.16814249753952026, 0.0600799061357975, -0.07548489421606064, -0.02347176894545555, 0.046151529997587204, -0.15748250484466553, -0.03915727883577347, -0.003925970755517483, 0.10506872832775116, 0.013786720111966133, -0.0617518424987793, -0.05690581351518631, 0.0904155820608139, 0.015856100246310234, -0.013873660936951637, -0.026043156161904335, 0.164312481880188, -0.08997400850057602, -0.019467398524284363, 0.003051335457712412, 0.08186236023902893, -0.06201963871717453, 0.08073534071445465, 0.09737671166658401, -0.21620096266269684, 0.01883644424378872, -0.018094871193170547, -0.20009881258010864, -0.09499416500329971, 0.02212158590555191, 0.041265252977609634, -0.037472985684871674, -0.119525246322155, 0.06605086475610733, 0.028103990480303764, -0.20201505720615387, 0.10639506578445435, 0.12583212554454803, -0.08867574483156204, 0.2508096396923065, 0.0466298870742321, -0.16063998639583588, -0.005117262247949839, 0.14151912927627563, 0.05344195291399956, 0.10423251986503601, -0.044852759689092636, -0.020793447270989418, -0.05844438076019287, -0.14713232219219208, -0.07705961912870407, 0.00785273127257824, -0.10756278783082962, 0.06379686295986176, 0.05679144337773323, 0.12720422446727753, 0.0478045716881752, -0.04899933561682701, 0.07816880196332932, -0.1962110698223114, 0.1645524948835373, 0.001213541952893138, 0.14403964579105377, 0.10931715369224548, 0.14584387838840485, -0.04932592436671257, 0.05078071355819702, -0.040865328162908554, 0.03802788257598877, -0.04523337259888649, -0.16779617965221405, 0.045610979199409485, -0.02809380553662777, 0.0240129753947258, -0.12484990060329437, 0.03583727404475212, -0.18209969997406006, 0.058012548834085464, -0.0025002360343933105, -0.1897875964641571, -0.1894817352294922, -0.1209857314825058, 0.010841294191777706, -0.08519656956195831, -0.04644868150353432, -0.07109960168600082, 0.06526976078748703, 0.07085970044136047, 0.07800156623125076, 0.037992171943187714, -0.03434070572257042, -0.19346070289611816, 0.009307452477514744, -0.1945345103740692, -0.052183594554662704, -0.1394088715314865, -0.15655411779880524, 0.2608761489391327, -0.05521182715892792, 0.013347622007131577, 0.019848015159368515, 0.0555100180208683, -0.04999177157878876, -0.044047657400369644, -0.011878740042448044, -0.0038082438986748457, 0.08036578446626663, -0.02694031037390232, 0.022437309846282005, 0.15328320860862732, -0.10583600401878357, -0.00046072981785982847, -0.036616358906030655, -0.05012741684913635, 0.02741836942732334, 0.16661988198757172, -0.0900956317782402, 0.02145867422223091, 0.18212291598320007, -0.13043443858623505, 0.06384551525115967, -0.055241502821445465, -0.11647378653287888, -0.11613152921199799, 0.13920266926288605, 0.01691511832177639, -0.034593213349580765, 0.012769092805683613, -0.07339400053024292, 0.16733196377754211, -0.09277182817459106, -0.01899721845984459, -0.03837743028998375, -0.0058042630553245544, 0.18001842498779297, -0.10198124498128891, -0.13013146817684174, 0.018329955637454987, -0.02840353548526764, 0.1068233773112297, -0.030187014490365982, 0.03477014601230621, 0.07905624806880951, -0.02327430061995983, 0.05017399787902832, -0.019780224189162254, 0.010801142081618309, -0.05388792231678963, 0.13758023083209991, -0.02346326969563961, 0.070551298558712, 0.007607405073940754, 0.053996045142412186, 0.011246003210544586, 0.1570359319448471, 0.06742974370718002, 0.014757341705262661, -0.08928772807121277, 0.13144762814044952, -0.07599683105945587, -0.01812579482793808, -0.022295400500297546, -0.18417873978614807, -0.07899641245603561, -0.14624863862991333, 0.026096075773239136, 0.10472309589385986, 0.124477319419384, -0.07273408770561218, 0.003635006258264184, -0.05914159119129181, 0.0868917852640152, 0.12407191842794418, 0.040223315358161926, -0.04494315758347511, 0.07044503092765808, -0.12145418673753738, -0.11447744071483612, 0.21644696593284607, -0.04831736534833908, -0.06060508266091347, 0.059256650507450104, 0.08440270274877548, 0.08541072905063629, 0.018037203699350357, 0.007264384999871254, 0.09617020934820175, -0.05443140119314194, -0.0238620787858963, 0.09062209725379944, 0.062046196311712265, 0.15512563288211823, 0.18408189713954926, 0.03760851174592972, -0.0010235484223812819, -0.07829292863607407, -0.044538795948028564, -0.20013876259326935, -0.035237088799476624, 0.1154024600982666, -0.02436399646103382, -0.017567196860909462, -0.11156894266605377, -0.09977180510759354, 0.18918295204639435, -0.06553367525339127, 0.0012257955968379974, -0.005770374555140734, -0.24632756412029266, 0.16878682374954224, -0.13284768164157867, -0.19022510945796967, -0.05479014664888382, -0.08302708715200424, 0.07056504487991333, 0.07466762512922287, 0.0339764840900898, -0.1275903284549713, -0.2000579684972763, -0.057816702872514725, -0.07402319461107254, -0.2344016581773758, -0.07347426563501358, -0.007799227721989155, 0.054139185696840286, 0.049509935081005096, -0.004368750844150782, 0.05493857339024544, 0.2098236232995987, 0.05754929408431053, -0.15791700780391693, -0.19864480197429657, -0.14013665914535522, -0.034093406051397324, 0.012594317086040974, 0.12167751044034958, 0.26582032442092896, -0.09568686783313751, -0.1624365746974945, -0.1187208816409111, 0.09397392719984055, -0.03483818843960762, -0.09423574060201645, -0.04389360547065735, -0.026157215237617493, 0.043920908123254776, 0.0025056612212210894, 0.13682271540164948, -0.12514425814151764, -0.1700962483882904, -0.0004221884300932288, 0.014328616671264172, -0.001820512698031962, 0.18294943869113922, 0.11889848113059998, 0.0648113563656807, 0.05633871257305145, -0.10527820885181427, -0.017590895295143127, -0.2665918171405792, 0.1608477532863617, -0.0933370441198349, 0.08490535616874695, -0.06851951777935028, -0.10932039469480515, 0.03510424867272377, 0.19845430552959442, -0.05474581569433212, -0.0184304378926754, 0.04718533903360367, 0.15996700525283813, 0.06689105927944183, -0.06054631620645523, 0.043117474764585495, 0.03968247026205063, -0.02319738268852234, -0.04493185132741928, 0.15318001806735992, -0.07578335702419281, -0.07035776972770691, -0.10529223829507828, 0.17353935539722443, -0.12440232187509537, 0.09446720778942108, 0.28187865018844604, -0.17060022056102753, -0.16080448031425476, 0.12545481324195862, 0.10080340504646301, 0.04895498603582382, -0.06668881326913834, 0.058342307806015015, -0.12110475450754166, -0.060257624834775925, -0.07123775035142899, -0.10537809878587723, -0.014581101015210152, -0.041289038956165314, 0.016772812232375145, -0.05287687107920647, 0.08770376443862915, -0.021795101463794708, 0.05855909734964371, -0.1751030832529068, 0.014786257408559322, -0.10117261111736298, 0.11937127262353897, -0.15549121797084808, 0.06294750422239304, -0.04342976585030556, -0.0073836143128573895, 0.14461009204387665, -0.017756476998329163, 0.04318941757082939, 0.13200409710407257, -0.10353952646255493, -0.09490863978862762, 0.12160617858171463, -0.05881192535161972, -0.08330659568309784, -0.067223459482193, 0.04068363830447197, 0.08872273564338684, 0.14295467734336853, -0.13712309300899506, 0.0007998729706741869, 0.12412718683481216, -0.21441467106342316, 0.18412631750106812, 0.21729792654514313, 0.3182038366794586, 0.009264564141631126, -0.05118643119931221, 0.08053980767726898, -0.09690792113542557, -0.03093142993748188, 0.023720378056168556, -0.05561517924070358, 0.0009873447706922889, -0.0522344596683979, 0.1665225327014923, -0.03579637035727501, -0.028645912185311317, -0.07275249063968658, -0.000958545075263828, 0.053203124552965164, 0.20675157010555267, -0.0883791521191597, -0.1838449239730835, 0.14914046227931976, 0.048717841506004333, 0.06972057372331619, 0.05990535393357277, -0.021593008190393448, 0.06663301587104797, 0.11789187788963318, -0.10490117222070694, -0.11212772130966187, 0.23580554127693176, -0.12311995029449463, -0.16133272647857666, -0.03614398464560509, -0.062351103872060776, -0.005525440443307161, 0.12688584625720978, -0.024419588968157768, 0.04286951571702957, -0.09151799976825714, -0.11645424365997314, -0.010859032161533833, 0.07535609602928162, -0.184987410902977, -0.22973407804965973, -0.10555130988359451, -0.11022291332483292, 0.0334777869284153, 0.19361364841461182, -0.08082069456577301, 0.314073383808136, -0.07214687019586563, -0.1424112468957901, 0.12129607796669006, 0.07403425127267838, -0.025095179677009583, -0.01820036582648754, -0.056960344314575195, -0.07929832488298416, 0.2538904547691345, 0.13701365888118744, -0.019465673714876175, -0.0866297036409378, -0.145037442445755, -0.04628221318125725, -0.03365353122353554, -0.10219679772853851, 0.08322542905807495, 0.10188400000333786, 0.11494983732700348, -0.08006812632083893, -0.06045660749077797, -0.09154912084341049, -0.027775300666689873, 0.1700078547000885, 0.07144574075937271, 0.05470288172364235, 0.058744676411151886, 0.023402748629450798, 0.19960637390613556, -0.1062527447938919, 0.1217259094119072, -0.11938896775245667, 0.06081663444638252, -0.13570573925971985, -0.10156939178705215, 0.0088206697255373, -0.0004369342641439289, 0.0015867126639932394, 0.23093241453170776, -0.11035040766000748, 0.015527204610407352, -0.06548527628183365, 0.04020151123404503, -0.13377416133880615, -0.09416601061820984, 0.10489809513092041, 0.08515222370624542, 0.108438640832901, 0.0232804287225008, -0.08162998408079147, -0.07354313880205154, 0.09975109249353409, 0.08345688879489899, 0.06734519451856613, -0.051123473793268204, -0.25818538665771484, -0.1487194001674652, -0.042448386549949646, -0.09229371696710587, -0.013058693148195744, 0.18235914409160614, 0.06484557688236237, 0.029190005734562874, -0.04652523994445801, -0.04602353647351265, 0.03261210396885872, -0.13138045370578766, -0.08938336372375488, -0.10980711132287979, 0.007405283395200968, -0.10320981591939926, -0.14228171110153198, -0.04500104486942291, 0.34399285912513733, 0.1404581367969513, 0.03051520138978958, -0.054014746099710464, -0.14516833424568176, 0.01885059103369713, 0.05945401266217232, 0.0948215126991272, -0.052969545125961304, 0.040923383086919785, -0.060380805283784866, -0.08072870969772339, -0.07228925824165344, 0.019167756661772728, 0.058263130486011505, -0.13060149550437927, -0.011583966203033924, -0.14500361680984497, -0.16092422604560852, -0.2539862394332886, 0.06620723754167557, 0.10329549759626389, 0.03651714697480202, -0.20878832042217255, 0.0017944119172170758, -2.731632580350445e-32, -0.03209204226732254, 0.0017013438045978546, -0.014024675823748112, -0.00981982797384262, 0.10776465386152267, -0.14835183322429657, 0.03289520740509033, -0.12065792828798294, 0.13243386149406433, -0.15216660499572754, -0.10868565738201141, -0.058032914996147156, 0.1306608021259308, 0.10162316262722015, -0.06166085973381996, -0.0010626070434227586, 0.21336814761161804, 0.06886714696884155, -0.016361966729164124, 0.14154170453548431, 0.26457276940345764, -0.04775378480553627, 0.0804012343287468, 0.10478876531124115, -0.08674617856740952, -0.1553594022989273, -0.04966351017355919, -0.1190681904554367, -0.09754004329442978, 0.06554099917411804, -0.025298617780208588, -0.020804060623049736, -0.0978507548570633, 0.13139192759990692, 0.01994340308010578, -0.08851661533117294, -0.2577122151851654, 0.045287515968084335, -0.0561445988714695, -0.04236132651567459, 0.18729697167873383, -0.11639392375946045, -0.053859878331422806, 0.014658639207482338, 0.01825862005352974, 0.23409734666347504, -0.04245597496628761, 0.11681746691465378, 0.02111789397895336, -0.11146064102649689, 0.07094544917345047, -0.04166825860738754, -0.01762913540005684, 0.0425306037068367, 0.0034572675358504057, -0.0849703773856163, 0.04627307504415512, -0.09084275364875793, -0.12012145668268204, 0.021308837458491325, 0.2648002803325653, -0.020207665860652924, 0.010144003666937351, 0.27965331077575684, 0.02835565060377121, 0.004709812346845865, 0.2536363899707794, -0.19601692259311676, 0.19048939645290375, -0.08725087344646454, 0.07435952126979828, -0.0590861476957798, -0.0766882449388504, 0.24447447061538696, 0.10504160076379776, 0.09652550518512726, -0.17027994990348816, 0.1464201807975769, 0.12841838598251343, -0.09260427206754684, 0.09756310284137726, -0.03078966960310936, 0.02778785489499569, -0.019123844802379608, 0.015118219889700413, -0.13796189427375793, 0.06439917534589767, -0.030108259990811348, 0.0382331982254982, 0.026772214099764824, -0.10411075502634048, 0.27824366092681885, 0.03402023762464523, 0.016440991312265396, 0.02170528843998909, 0.09288277477025986, 0.0012693803291767836, 0.004953588824719191, -0.12139593809843063, -0.16520808637142181, 0.13563303649425507, -0.14495664834976196, 0.12456323951482773, -0.11810194700956345, 0.21303093433380127, -0.11650468409061432, 0.03063914366066456, -0.05630851909518242, -0.2486502081155777, 0.03197130188345909, -0.15776243805885315, 0.05857710912823677, -0.008961438201367855, -0.06625984609127045, 0.1210351437330246, 0.04716956987977028, 0.029714031144976616, -0.0003777098609134555, 0.057808198034763336, 0.1526290625333786, -0.04038812965154648, 0.00794197991490364, 0.10565193742513657, 0.13892729580402374, 0.05933365225791931, 0.06187037006020546, 0.05527416616678238, -0.12321479618549347, 0.14672887325286865, -0.04250825569033623, -0.0007038206094875932, -0.08055217564105988, 7.720677785982843e-7, -0.03011663816869259, 0.03458672761917114, 0.16621437668800354, -0.07820703834295273, -0.10893797129392624, 0.08799155801534653, 0.06992334872484207, 0.14446379244327545, 0.013589704409241676, -0.040115199983119965, -0.01734430529177189, -0.12730024755001068, -0.006805705837905407, 0.13807083666324615, -0.19856546819210052, 0.11642605066299438, 0.04331691563129425, 0.11924485862255096, -0.060018058866262436, 0.06530912965536118, -0.06003700941801071, 0.0004418058961164206, 0.02968164160847664, -0.09373193234205246, 0.1031903326511383, 0.03317968547344208, 0.02617141790688038, -0.0328192338347435, -0.11452320218086243, 0.027114005759358406, 0.017200633883476257, 0.0084617268294096, 0.015378572978079319, 0.08800569921731949, -0.10532934963703156, 0.05829625576734543, -0.004033742938190699, 0.03550604358315468, -0.010815010406076908, -0.08846180140972137, -0.10148771107196808, 0.012607558630406857, -0.026107385754585266, -0.0075215669348835945, 0.039980094879865646, 0.15893635153770447, -0.126780703663826, 0.12364742904901505, -0.06565454602241516, -0.00582486018538475, -0.02819059044122696, 0.007722441107034683, 0.09492283314466476, 0.12517274916172028, -0.020605526864528656, -0.06497997790575027, -0.04845308139920235, -0.02322821319103241, 0.012861773371696472, -0.1601773500442505, -0.06059892103075981, -0.0039468081668019295, -0.10449990630149841, 0.024438073858618736, 0.03709053620696068, -0.047387149184942245, -0.024258928373456, 2.9143340377828385e-34, 0.0031646452844142914, 0.2099376618862152, -0.05962518975138664, 0.012627911753952503, 0.003844901919364929, -0.0480361171066761, 0.022296151146292686, 0.07705851644277573, 0.08403804898262024, -0.14238938689231873, -0.21039986610412598 ]
https://github.com/huggingface/datasets/issues/6194
Support custom fingerprinting with `Dataset.from_generator`
Silly hack incoming: ```python import uuid class _DatasetGeneratorPickleHack: def __init__(self, generator, generator_id=None): self.generator = generator self.generator_id = ( generator_id if generator_id is not None else str(uuid.uuid4()) ) def __call__(self, *args, **kwargs): return self.generator(*kwargs, **kwargs) def __reduce__(self): return (_DatasetGeneratorPickleHack_raise, (self.generator_id,)) def _DatasetGeneratorPickleHack_raise(*args, **kwargs): raise AssertionError("cannot actually unpickle _DatasetGeneratorPickleHack!") ``` Now `Dataset.from_generator(_DatasetGeneratorPickleHack(gen))` works even if `gen` is unpicklable, because Dataset just pickles the shim object that avoids actually traversing `gen`. Then, one can work out how to set `generator_id` meaningfully to allow cache reuse.
### Feature request When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`. ### Motivation Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash. ### Your contribution If validated, I can try to submit a PR for this.
82
Support custom fingerprinting with `Dataset.from_generator` ### Feature request When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`. ### Motivation Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash. ### Your contribution If validated, I can try to submit a PR for this. Silly hack incoming: ```python import uuid class _DatasetGeneratorPickleHack: def __init__(self, generator, generator_id=None): self.generator = generator self.generator_id = ( generator_id if generator_id is not None else str(uuid.uuid4()) ) def __call__(self, *args, **kwargs): return self.generator(*kwargs, **kwargs) def __reduce__(self): return (_DatasetGeneratorPickleHack_raise, (self.generator_id,)) def _DatasetGeneratorPickleHack_raise(*args, **kwargs): raise AssertionError("cannot actually unpickle _DatasetGeneratorPickleHack!") ``` Now `Dataset.from_generator(_DatasetGeneratorPickleHack(gen))` works even if `gen` is unpicklable, because Dataset just pickles the shim object that avoids actually traversing `gen`. Then, one can work out how to set `generator_id` meaningfully to allow cache reuse.
[ -0.1356068253517151, 0.2809041142463684, -0.0576346293091774, -0.06349527835845947, -0.0009327449952252209, -0.04174601659178734, 0.21246874332427979, -0.04116310924291611, 0.008047141134738922, 0.1022220328450203, 0.03889083117246628, 0.1767544001340866, -0.24349819123744965, 0.20372599363327026, 0.09831502288579941, -0.01827886886894703, 0.002228969009593129, 0.038314417004585266, -0.08828377723693848, 0.07122047245502472, -0.12087106704711914, 0.08325193077325821, 0.17192445695400238, -0.042381323873996735, -0.04866533353924751, -0.06719917058944702, -0.08033142238855362, 0.16385366022586823, 0.025980481877923012, -0.07011475414037704, 0.009386319667100906, 0.04080060496926308, -0.06183053180575371, 0.11295609921216965, 0.000006022685738571454, 0.09854426234960556, 0.07957065850496292, 0.01305337157100439, -0.11721836775541306, 0.05490614101290703, 0.007021273020654917, 0.037768978625535965, 0.060579538345336914, -0.09062113612890244, -0.03218655288219452, 0.12281515449285507, -0.011615949682891369, -0.06456927210092545, -0.040180157870054245, -0.15844683349132538, 0.028656737878918648, -0.0008224038174375892, -0.06782963126897812, -0.10170869529247284, 0.12280365824699402, 0.2021796703338623, -0.08147206902503967, -0.011009571142494678, -0.0414481982588768, -0.032598163932561874, 0.07102043181657791, 0.04308382421731949, 0.021638575941324234, -0.06037897989153862, 0.10762953013181686, -0.013192623853683472, -0.2244327813386917, -0.012341728433966637, -0.013351366855204105, 0.10130017250776291, -0.08056475222110748, -0.25360170006752014, -0.011844953522086143, -0.044385794550180435, 0.09629914909601212, -0.037295982241630554, 0.03469976782798767, -0.15031304955482483, -0.12108936160802841, 0.03404391184449196, -0.06677550077438354, 0.05144713819026947, 0.0629611536860466, -0.13856171071529388, 0.003903354983776808, -0.005655950400978327, 0.12054973840713501, 0.06524581462144852, -0.08396582305431366, -0.030186600983142853, 0.17185278236865997, 0.010529999621212482, 0.007425629999488592, -0.002998031908646226, 0.08841265738010406, -0.11755791306495667, -0.04666031897068024, 0.01574961468577385, 0.04011444002389908, 0.04766816273331642, 0.07180996984243393, 0.0662890374660492, -0.1443699151277542, 0.05662212148308754, 0.024669870734214783, -0.2453930824995041, -0.08999661356210709, 0.017150262370705605, 0.0066315606236457825, -0.007632484659552574, -0.11849254369735718, 0.05335713550448418, -0.005584032740443945, -0.13288047909736633, 0.14156019687652588, 0.08956941217184067, -0.03318798914551735, 0.19025953114032745, 0.00286929402500391, -0.15566618740558624, -0.008040204644203186, 0.14573954045772552, 0.001112483674660325, 0.11166103929281235, -0.01997699961066246, -0.0298704132437706, -0.024376939982175827, -0.21928316354751587, -0.05926390364766121, -0.009396657347679138, -0.06962265074253082, 0.050895240157842636, 0.06666083633899689, 0.14632470905780792, 0.06816869974136353, -0.06264141947031021, 0.09026899933815002, -0.22847318649291992, 0.14864715933799744, -0.01788463443517685, 0.16706499457359314, 0.07813138514757156, 0.12133034318685532, -0.05803947523236275, -0.0048973108641803265, -0.0433911569416523, 0.04959524795413017, -0.042100127786397934, -0.14454419910907745, 0.021295135840773582, -0.036434341222047806, 0.011520377360284328, -0.03861851245164871, 0.06940440833568573, -0.1604064553976059, 0.07950711995363235, 0.05961982160806656, -0.12692555785179138, -0.20647694170475006, -0.14169000089168549, 0.045356955379247665, -0.09432513266801834, -0.0011670785024762154, -0.10717692971229553, 0.07274305075407028, 0.08094672858715057, 0.1541331559419632, -0.010504819452762604, -0.09937465935945511, -0.19035570323467255, -0.0001962645328603685, -0.1683468222618103, 0.00005822025559609756, -0.15560801327228546, -0.1362922042608261, 0.25114306807518005, -0.06465502828359604, -0.0304227564483881, -0.04933417961001396, 0.025436023250222206, -0.10913071036338806, -0.01411588303744793, -0.01256899069994688, 0.01529602985829115, 0.04403538256883621, -0.0690007358789444, 0.002323906170204282, 0.15354332327842712, -0.09270170331001282, -0.026783663779497147, -0.01326938346028328, -0.02898048795759678, 0.05863368883728981, 0.18950046598911285, -0.08515730500221252, 0.0547981858253479, 0.17484480142593384, -0.07034376263618469, 0.07203666120767593, -0.06847045570611954, -0.18689392507076263, -0.06663033366203308, 0.15208694338798523, 0.007072248961776495, 0.010428964160382748, -0.029048427939414978, -0.06058979779481888, 0.16713964939117432, -0.08697571605443954, -0.0650956928730011, -0.05686058849096298, -0.026162832975387573, 0.189470112323761, -0.005837162025272846, -0.11567139625549316, -0.004565522074699402, -0.011512680910527706, 0.04416294023394585, -0.010332620702683926, 0.013689202256500721, 0.0601825937628746, -0.030193323269486427, 0.018249886110424995, -0.02424175664782524, -0.02367859147489071, -0.03195822983980179, 0.15442973375320435, -0.02895226888358593, 0.08980179578065872, 0.044416993856430054, 0.06419704109430313, 0.007689376827329397, 0.1519210934638977, 0.07845964282751083, 0.03702486306428909, -0.1346784234046936, 0.10859260708093643, -0.07646220177412033, -0.05068892613053322, -0.05350585654377937, -0.17574842274188995, -0.06194444000720978, -0.09303899109363556, -0.016218913719058037, 0.08745808899402618, 0.08894752711057663, -0.1176958903670311, 0.024803314357995987, -0.017900599166750908, 0.028844168409705162, 0.0902840867638588, 0.058353740721940994, -0.07236773520708084, 0.10311456024646759, -0.15992234647274017, -0.04920748621225357, 0.2606040835380554, -0.008959002792835236, -0.03948795795440674, 0.021673765033483505, 0.0526915118098259, 0.0517001710832119, 0.02987990528345108, -0.01864505372941494, 0.038032304495573044, -0.02635650709271431, -0.011275582946836948, 0.07920049875974655, 0.032404620200395584, 0.12715619802474976, 0.13512393832206726, 0.03321217745542526, 0.03641992434859276, -0.06903085112571716, -0.06743617355823517, -0.1353171020746231, -0.0372796356678009, 0.16286247968673706, -0.006221739575266838, -0.06823612749576569, -0.11826187372207642, -0.04121727868914604, 0.16930417716503143, -0.06534121930599213, 0.013057978823781013, 0.032910097390413284, -0.23124636709690094, 0.19436383247375488, -0.08517110347747803, -0.14530685544013977, -0.0616338886320591, -0.0894281342625618, 0.0761980190873146, 0.0195765420794487, 0.049141816794872284, -0.06865201145410538, -0.14353080093860626, -0.018186837434768677, -0.09773436933755875, -0.20436067879199982, -0.07030180096626282, 0.009471132420003414, 0.09861357510089874, 0.01032544020563364, 0.0543132983148098, 0.09577544033527374, 0.3079655170440674, 0.0838584452867508, -0.14424633979797363, -0.1973571479320526, -0.12704676389694214, -0.07407664507627487, 0.018010374158620834, 0.17177265882492065, 0.25811508297920227, -0.07981817424297333, -0.1702466607093811, -0.13795872032642365, 0.10730811953544617, 0.00031418001162819564, -0.060564931482076645, -0.050961486995220184, -0.081243135035038, 0.04555211961269379, 0.053282856941223145, 0.12986105680465698, -0.13131090998649597, -0.09450832009315491, 0.04191368445754051, 0.03987368196249008, 0.014584950171411037, 0.1865508109331131, 0.13638538122177124, 0.0581916980445385, 0.08595862984657288, -0.11837704479694366, -0.0396144762635231, -0.21276120841503143, 0.08176102489233017, -0.08932783454656601, 0.0780865028500557, -0.0811452642083168, -0.11458779871463776, 0.04647493362426758, 0.19153185188770294, -0.007261702790856361, 0.031029649078845978, -0.01895529218018055, 0.17180202901363373, 0.07797890156507492, -0.023042060434818268, 0.027393432334065437, 0.056999485939741135, 0.013702514581382275, -0.034740861505270004, 0.13838529586791992, -0.1295136660337448, -0.05918731540441513, -0.13542068004608154, 0.25400832295417786, -0.0878896489739418, 0.08977105468511581, 0.32239654660224915, -0.06242993101477623, -0.20451387763023376, 0.029565060511231422, 0.08173713088035583, 0.003450969699770212, -0.07111364603042603, -0.027304189279675484, -0.031257595866918564, -0.052737798541784286, -0.039242178201675415, -0.13972948491573334, -0.06807190179824829, 0.05653969570994377, 0.04287218675017357, -0.06905421614646912, 0.09462017565965652, -0.003501542843878269, 0.08466900140047073, -0.11997362226247787, -0.008454603143036366, -0.10300671309232712, 0.11161333322525024, -0.1320643126964569, 0.03465168550610542, -0.00898267887532711, 0.0027890189085155725, 0.1383233219385147, 0.04335667937994003, 0.05901377275586128, 0.11428229510784149, -0.04638613015413284, -0.09050145745277405, 0.08228067308664322, -0.08839523047208786, 0.004946034401655197, -0.08574461191892624, 0.06707717478275299, 0.0512559674680233, 0.11574102193117142, -0.13873276114463806, 0.00270797754637897, 0.1242782399058342, -0.2617448568344116, 0.13166461884975433, 0.18935410678386688, 0.30549296736717224, 0.04479304701089859, -0.10196928679943085, 0.03937660902738571, -0.134391188621521, -0.03839421272277832, 0.07565543055534363, -0.016340885311365128, -0.014366204850375652, -0.087464340031147, 0.1264338493347168, -0.022916000336408615, -0.06913000345230103, -0.12347552180290222, -0.06082788482308388, 0.0161594245582819, 0.14139434695243835, -0.07067164778709412, -0.2191312164068222, 0.12176745384931564, 0.09906135499477386, 0.06805455684661865, 0.02829597517848015, -0.000617558544036001, 0.08116333931684494, 0.16287726163864136, -0.10014615207910538, -0.10514704138040543, 0.24085767567157745, -0.0803459882736206, -0.1848880499601364, -0.07732235640287399, -0.04248065501451492, -0.032633911818265915, 0.1621769815683365, -0.013177883811295033, 0.11697780340909958, -0.08797787129878998, -0.14786285161972046, -0.021280236542224884, -0.011196989566087723, -0.19442810118198395, -0.19111454486846924, -0.09211248904466629, -0.14115476608276367, 0.07571341097354889, 0.1892600953578949, -0.06998047232627869, 0.3157913088798523, -0.044106319546699524, -0.1347944587469101, 0.06961763650178909, 0.11364010721445084, -0.03297825902700424, -0.05461016669869423, -0.027186449617147446, -0.04201405867934227, 0.3036915361881256, 0.11191156506538391, -0.017048388719558716, -0.031152548268437386, -0.1594848930835724, -0.02316388115286827, -0.02761584334075451, -0.06410115957260132, 0.1110602468252182, 0.13429519534111023, 0.07604236155748367, -0.024041559547185898, -0.14013507962226868, -0.08655302226543427, -0.050206683576107025, 0.12732289731502533, 0.04764096438884735, 0.10690292716026306, 0.07283500581979752, 0.09497209638357162, 0.1620076298713684, -0.061596278101205826, 0.10138577967882156, -0.07765047997236252, 0.0467442125082016, -0.11971981823444366, -0.11769714206457138, 0.016428938135504723, -0.06923512369394302, -0.011043158359825611, 0.21848168969154358, -0.09522922337055206, 0.02866998501121998, -0.07181333005428314, 0.016296787187457085, -0.14056918025016785, -0.08022991567850113, 0.1482928842306137, 0.11509508639574051, 0.11179082840681076, 0.006170354783535004, -0.04991834983229637, -0.07625170052051544, 0.10384551435709, 0.09748868644237518, 0.055801473557949066, -0.08241189271211624, -0.2114211469888687, -0.17064835131168365, -0.005513944663107395, -0.0900711938738823, -0.06126735359430313, 0.1358729600906372, 0.04805798828601837, 0.026317406445741653, -0.051860544830560684, -0.0904017761349678, 0.0697464793920517, -0.07804039120674133, -0.08381746709346771, -0.1277565360069275, 0.012647377327084541, -0.10724136233329773, -0.09816574305295944, -0.0521085150539875, 0.241747185587883, 0.1658371388912201, 0.021414287388324738, -0.013510234653949738, -0.17741608619689941, 0.05924506485462189, 0.10431630164384842, 0.07540450990200043, -0.019331717863678932, 0.0006174251320771873, -0.058133628219366074, -0.02744005061686039, -0.16069096326828003, 0.0005651445244438946, 0.10041364282369614, -0.15567374229431152, 0.020047040656208992, -0.1255560964345932, -0.1210063174366951, -0.20272015035152435, 0.06943149119615555, 0.07241199165582657, 0.003465489251539111, -0.20291338860988617, 0.03336232900619507, -2.763750612497962e-32, -0.023701483383774757, -0.02817751094698906, -0.040619172155857086, -0.022386401891708374, 0.10730015486478806, -0.11318682134151459, 0.00910950731486082, -0.03887493535876274, 0.08363723754882812, -0.15276136994361877, -0.1234530434012413, -0.03752987086772919, 0.12225771695375443, 0.09170494973659515, -0.06458615511655807, -0.017197992652654648, 0.2214939296245575, 0.024887992069125175, -0.025947406888008118, 0.13515836000442505, 0.26324692368507385, -0.061087775975465775, 0.06759954243898392, 0.055600620806217194, -0.15306508541107178, -0.13111671805381775, -0.03453019633889198, -0.1548355519771576, -0.075650654733181, 0.010927408002316952, -0.026080559939146042, -0.008252560161054134, -0.09902841597795486, 0.15392236411571503, 0.018388889729976654, -0.011699898168444633, -0.23032325506210327, 0.06622535735368729, -0.0923265740275383, -0.02218790538609028, 0.13857106864452362, -0.11333107948303223, 0.018883654847741127, -0.050118643790483475, 0.00408945744857192, 0.20559947192668915, -0.07704100757837296, 0.11411512643098831, -0.007353395689278841, -0.07075253874063492, 0.036849990487098694, -0.05074866861104965, -0.040409982204437256, 0.010408440604805946, -0.00966317392885685, -0.14441366493701935, -0.03231910243630409, -0.08931287378072739, -0.16465447843074799, 0.043457213789224625, 0.23667941987514496, 0.0005334804300218821, 0.02092183381319046, 0.15071626007556915, 0.005593717563897371, 0.0057561746798455715, 0.24648277461528778, -0.20819732546806335, 0.2070881873369217, -0.13405445218086243, 0.029087262228131294, -0.049408331513404846, -0.03945695608854294, 0.16627782583236694, 0.13487476110458374, 0.010482002049684525, -0.09905107319355011, 0.13858114182949066, 0.12797871232032776, -0.11874385923147202, 0.08082881569862366, 0.01400595623999834, 0.04613253101706505, -0.006149228662252426, 0.008022746071219444, -0.15224136412143707, 0.10580232739448547, -0.05237477645277977, 0.025807183235883713, -0.02505548670887947, -0.16484500467777252, 0.2933541536331177, 0.039506372064352036, -0.02506132796406746, -0.04964497685432434, 0.09638915210962296, 0.06643323600292206, 0.00274084834381938, -0.10830774158239365, -0.16334573924541473, 0.18218430876731873, -0.12458512932062149, 0.12972494959831238, -0.06201290711760521, 0.1898517906665802, -0.11122751981019974, -0.005015098489820957, -0.016748134046792984, -0.23495061695575714, 0.026763534173369408, -0.12039627134799957, 0.024253280833363533, -0.04840870574116707, -0.12922263145446777, 0.1234121024608612, 0.011123509146273136, 0.07021166384220123, -0.12908950448036194, 0.08988068252801895, 0.07165063917636871, -0.10607603937387466, -0.0018869178602471948, 0.01620282419025898, 0.1311250925064087, 0.09360629320144653, 0.07719022780656815, 0.04120587930083275, -0.11317848414182663, 0.1255081743001938, -0.016459587961435318, 0.0016679824329912663, -0.029351918026804924, 7.94100515122409e-7, -0.02388433925807476, 0.04884687811136246, 0.11823169142007828, -0.04895080626010895, -0.05728491395711899, 0.09162797778844833, 0.10609959810972214, 0.11259803175926208, -0.021392231807112694, -0.0779457837343216, -0.05404214933514595, -0.1386929452419281, 0.01144244521856308, 0.07778250426054001, -0.1835441142320633, 0.09564699232578278, 0.09606717526912689, 0.09593106806278229, -0.07393329590559006, 0.01238461397588253, -0.09102882444858551, -0.012722734361886978, 0.021401237696409225, -0.09925077110528946, 0.1105421707034111, 0.03804129362106323, 0.019326958805322647, -0.00835728831589222, -0.02498706430196762, 0.0832614004611969, 0.02762824110686779, -0.039153844118118286, 0.042864032089710236, 0.08090733736753464, -0.07553339004516602, -0.006235851906239986, 0.0037865322083234787, 0.026462653651833534, -0.011505982838571072, -0.018866073340177536, -0.10017091035842896, -0.014287997968494892, -0.02291378751397133, -0.06031801924109459, 0.015866156667470932, 0.18872004747390747, -0.1230483278632164, 0.14181724190711975, -0.031667351722717285, -0.01640624925494194, -0.0009565558866597712, 0.06138588488101959, 0.07279913872480392, 0.17368903756141663, -0.03865273669362068, -0.03522111847996712, -0.03534459322690964, -0.009998470544815063, 0.035445891320705414, -0.16650620102882385, -0.05339821055531502, 0.04455352574586868, -0.03881372511386871, -0.0425342358648777, 0.024203309789299965, -0.014713184908032417, -0.022249232977628708, 2.3864952891128796e-34, -0.0014150459319353104, 0.16923648118972778, -0.04253852367401123, 0.07342835515737534, -0.016964061185717583, -0.04819217324256897, 0.030651748180389404, 0.0422021821141243, 0.11291074007749557, -0.06869851052761078, -0.18126079440116882 ]
https://github.com/huggingface/datasets/issues/6194
Support custom fingerprinting with `Dataset.from_generator`
I'd like some way to do this too. I find that sometimes the hash doesn't cover enough, and that the dataset is not regenerated even when underlying data has changed, and by supplying a custom fingerprint I could do a better job of controlling when my dataset is regenerated.
### Feature request When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`. ### Motivation Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash. ### Your contribution If validated, I can try to submit a PR for this.
49
Support custom fingerprinting with `Dataset.from_generator` ### Feature request When using `Dataset.from_generator`, the generator is hashed when building the fingerprint. Similar to `.map`, it would be interesting to let the user bypass this hashing by accepting a `fingerprint` argument to `.from_generator`. ### Motivation Using the `.from_generator` constructor with a non-picklable generator fails. By accepting a `fingerprint` argument to `.from_generator`, the user would have the opportunity to manually fingerprint the dataset and thus bypass the crash. ### Your contribution If validated, I can try to submit a PR for this. I'd like some way to do this too. I find that sometimes the hash doesn't cover enough, and that the dataset is not regenerated even when underlying data has changed, and by supplying a custom fingerprint I could do a better job of controlling when my dataset is regenerated.
[ -0.1599636822938919, 0.22194011509418488, -0.0831727683544159, -0.0763775184750557, -0.0053265634924173355, -0.036459267139434814, 0.17990517616271973, -0.060950033366680145, -0.048844121396541595, 0.12378229945898056, 0.10712522268295288, 0.14809678494930267, -0.25587159395217896, 0.2543667256832123, 0.10766628384590149, -0.0536886528134346, -0.0305433701723814, 0.07746022194623947, -0.09309361129999161, 0.13318242132663727, -0.06923951208591461, 0.11071603745222092, 0.14365342259407043, -0.018706459552049637, -0.032462067902088165, -0.021215664222836494, -0.06721136718988419, 0.07501718401908875, -0.0014272661646828055, -0.06320741027593613, -0.012445168569684029, 0.03339531272649765, 0.008032233454287052, 0.019914589822292328, 0.000005881373908778187, 0.14258746802806854, 0.061772026121616364, 0.024667752906680107, -0.003933009225875139, 0.040159791707992554, 0.06202283874154091, 0.08259522169828415, 0.06748571991920471, -0.027753284201025963, -0.0655394196510315, 0.04987931251525879, 0.044350530952215195, 0.022767404094338417, -0.03530194237828255, -0.18585114181041718, 0.021884148940443993, 0.07899948209524155, -0.09157469123601913, -0.13237446546554565, 0.17449511587619781, 0.2197285294532776, -0.0541292279958725, 0.01687052845954895, -0.06363721191883087, -0.0826353132724762, 0.05383361130952835, -0.018655668944120407, 0.04520701989531517, -0.028296202421188354, 0.1387682408094406, 0.026993567124009132, -0.13867227733135223, -0.030573254451155663, -0.04428369924426079, 0.1558069884777069, -0.12435939162969589, -0.19316671788692474, 0.002006144030019641, -0.08364568650722504, 0.06841505318880081, 0.02801366336643696, 0.07686983048915863, -0.19594579935073853, -0.14581039547920227, 0.06806951761245728, -0.1037352979183197, -0.028183825314044952, 0.03702904284000397, -0.12915784120559692, -0.04452446475625038, 0.014282905496656895, 0.09026661515235901, 0.012795663438737392, -0.08307866007089615, -0.06855537742376328, 0.032080598175525665, 0.03967507183551788, -0.030197013169527054, -0.05630841851234436, 0.1536761224269867, -0.10912498831748962, -0.018268795683979988, -0.0193825364112854, 0.06780825555324554, -0.04909089207649231, 0.09074551612138748, 0.08443994075059891, -0.19923758506774902, 0.016996202990412712, -0.003045483725145459, -0.23086297512054443, -0.06656301021575928, 0.03303983062505722, 0.009468200616538525, -0.05364622920751572, -0.12020339071750641, 0.05392489954829216, 0.020094191655516624, -0.20829734206199646, 0.07937315851449966, 0.1448320895433426, -0.07034806162118912, 0.25797122716903687, 0.013554360717535019, -0.2046777307987213, -0.025826849043369293, 0.13648580014705658, 0.0616828054189682, 0.11229898035526276, -0.05428916588425636, -0.08463728427886963, -0.07941709458827972, -0.13830111920833588, -0.061456650495529175, 0.022076928988099098, -0.07230056077241898, 0.06057606637477875, 0.06146444380283356, 0.14539945125579834, 0.06155006214976311, -0.0872054174542427, 0.09248456358909607, -0.16403211653232574, 0.20805448293685913, 0.03336348757147789, 0.14316393435001373, 0.12619192898273468, 0.11999431997537613, -0.06345392763614655, 0.05195106938481331, -0.0805916041135788, 0.0038203708827495575, -0.04195651784539223, -0.1807849407196045, 0.0491071455180645, -0.003488409100100398, 0.06811489164829254, -0.09474742412567139, 0.07004240900278091, -0.14664390683174133, 0.02636066824197769, 0.008283374831080437, -0.19391530752182007, -0.19816657900810242, -0.128713458776474, 0.013891773298382759, -0.10061398893594742, -0.023098822683095932, -0.09774095565080643, 0.07005146145820618, 0.023365460336208344, 0.07195918262004852, -0.015346677042543888, -0.02915981598198414, -0.208730086684227, -0.016800524666905403, -0.22721533477306366, -0.08029325306415558, -0.0903606042265892, -0.19076161086559296, 0.27384480834007263, -0.03852725028991699, 0.03466382622718811, 0.05063224956393242, 0.039944518357515335, -0.06667932868003845, -0.05178193375468254, -0.020347960293293, 0.014861037954688072, 0.1597640961408615, -0.047885581851005554, -0.026323318481445312, 0.10429561883211136, -0.11979641765356064, -0.009632264263927937, -0.03145759180188179, -0.04867791756987572, 0.022357195615768433, 0.16918309032917023, -0.10210734605789185, 0.07479919493198395, 0.2193891555070877, -0.12244632840156555, 0.06353788077831268, -0.0766872987151146, -0.1008901298046112, -0.10933446139097214, 0.16263112425804138, -0.01354267355054617, -0.04229594022035599, -0.03149666637182236, -0.017505263909697533, 0.13152143359184265, -0.0642227828502655, -0.03578953817486763, 0.0003384843876119703, -0.0034385141916573048, 0.16722093522548676, -0.10032191872596741, -0.12171166390180588, 0.0289020836353302, -0.05237359181046486, 0.11371936649084091, -0.06044711917638779, 0.006616862025111914, 0.0740068331360817, -0.07535548508167267, 0.020436633378267288, 0.013717327266931534, 0.012045753188431263, -0.034944042563438416, 0.16892001032829285, -0.013053875416517258, 0.11534242331981659, 0.006116929464042187, 0.04332277551293373, -0.005134407430887222, 0.19750681519508362, 0.045348770916461945, -0.024723146110773087, -0.06697061657905579, 0.12120886892080307, -0.0666237398982048, -0.0404583178460598, -0.0825585126876831, -0.19570060074329376, -0.10233825445175171, -0.1169985979795456, 0.0413082018494606, 0.09570818394422531, 0.13398860394954681, -0.09135612845420837, -0.04707425832748413, -0.026165589690208435, 0.08309618383646011, 0.12542758882045746, 0.011059463024139404, -0.04842101037502289, 0.0698251873254776, -0.1253208965063095, -0.10936494916677475, 0.19678111374378204, -0.05498979985713959, -0.04556604474782944, 0.08215653151273727, 0.08914090692996979, 0.0873914584517479, -0.014045068994164467, 0.02865797095000744, 0.09106482565402985, -0.002939952304586768, -0.04186101257801056, 0.10278009623289108, 0.04686426371335983, 0.1418864130973816, 0.1481724977493286, 0.04069362208247185, 0.0005043111741542816, -0.06418653577566147, -0.021860439330339432, -0.2514086365699768, -0.05339359492063522, 0.12075099349021912, -0.04458601027727127, 0.019086575135588646, -0.1269511729478836, -0.0668400228023529, 0.19343365728855133, -0.07877861708402634, -0.012675858102738857, -0.04267032817006111, -0.23110131919384003, 0.2057710886001587, -0.09966161102056503, -0.25566792488098145, -0.036939509212970734, -0.04278258979320526, 0.0865282490849495, 0.07344221323728561, 0.03214479982852936, -0.11293697357177734, -0.1922496259212494, -0.11274655908346176, -0.06753668189048767, -0.22801201045513153, -0.03956993296742439, 0.044564563781023026, 0.07247891277074814, 0.08543473482131958, -0.01886533945798874, 0.12849804759025574, 0.23778288066387177, 0.07466635853052139, -0.14436809718608856, -0.2188730388879776, -0.14984013140201569, -0.013518308289349079, -0.010071288794279099, 0.10253692418336868, 0.27829304337501526, -0.135195791721344, -0.18486671149730682, -0.09841244667768478, 0.09436756372451782, -0.020961780101060867, -0.11335109174251556, -0.04777667671442032, 0.009437649510800838, 0.0489138625562191, -0.01332691591233015, 0.11926166713237762, -0.12045499682426453, -0.16621051728725433, -0.002857618499547243, 0.06929107010364532, 0.015711035579442978, 0.15189272165298462, 0.09343790262937546, 0.05471973493695259, 0.0484304316341877, -0.11114545911550522, 0.02415481209754944, -0.28291741013526917, 0.17125436663627625, -0.11194249242544174, 0.10152245312929153, -0.025472652167081833, -0.08567232638597488, 0.007139354012906551, 0.21540459990501404, -0.05234327167272568, -0.024282414466142654, 0.04480436071753502, 0.11006688326597214, 0.09367546439170837, -0.09838918596506119, 0.05638489872217178, 0.04523459076881409, -0.013109935447573662, -0.034619249403476715, 0.11106935888528824, -0.06814126670360565, -0.06527350097894669, -0.12791354954242706, 0.13527242839336395, -0.07958374172449112, 0.060353539884090424, 0.23753622174263, -0.13187091052532196, -0.16092655062675476, 0.11193583160638809, 0.08197461813688278, 0.07223650813102722, -0.0302252396941185, 0.03948334604501724, -0.13363902270793915, -0.04675562307238579, -0.03459041193127632, -0.08587425947189331, -0.006244091782718897, -0.02180844359099865, 0.03195124864578247, -0.09361850470304489, 0.08880771696567535, -0.022205717861652374, 0.0372096411883831, -0.1191403940320015, 0.02938654273748398, -0.109898641705513, 0.12083714455366135, -0.1287771314382553, 0.0738878846168518, -0.030396390706300735, 0.02651808224618435, 0.1418249011039734, -0.03368018940091133, -0.024061547592282295, 0.14541034400463104, -0.06990434229373932, -0.08108233660459518, 0.10420460999011993, -0.012802689336240292, -0.06839703023433685, -0.07806642353534698, 0.020458554849028587, 0.07599073648452759, 0.10297583043575287, -0.10671108216047287, -0.01911066100001335, 0.12327670305967331, -0.20593726634979248, 0.19465948641300201, 0.24279634654521942, 0.29321175813674927, -0.0028569442220032215, -0.05393890291452408, 0.08682995289564133, -0.08896671235561371, -0.04537228122353554, 0.08342725038528442, -0.0674627274274826, 0.0037249107845127583, -0.0324624702334404, 0.2011423408985138, -0.039152245968580246, -0.03526582568883896, -0.047213975340127945, 0.018752725794911385, 0.08290347456932068, 0.2194807529449463, -0.11960012465715408, -0.235172837972641, 0.11160623282194138, 0.07896564900875092, 0.07072188705205917, 0.01669401116669178, -0.0024410944897681475, 0.08611047267913818, 0.09590430557727814, -0.09427069872617722, -0.05317569524049759, 0.22779761254787445, -0.13483451306819916, -0.21777871251106262, -0.07568277418613434, -0.07116039842367172, 0.04861266911029816, 0.143109992146492, -0.0164493340998888, 0.018609048798680305, -0.06849803775548935, -0.12381060421466827, -0.000015487596101593226, 0.07661032676696777, -0.1823427677154541, -0.20706786215305328, -0.1366054117679596, -0.08810780942440033, -0.0023793731816112995, 0.14778359234333038, -0.04486587271094322, 0.2660536468029022, -0.029322916641831398, -0.1457306295633316, 0.12503384053707123, 0.02096639573574066, -0.03269220143556595, -0.024562859907746315, -0.08522680401802063, -0.0938178151845932, 0.295245498418808, 0.09507843852043152, -0.00205468712374568, -0.11071585863828659, -0.12746047973632812, -0.10296601057052612, -0.034781262278556824, -0.09385396540164948, 0.0930447056889534, 0.13853178918361664, 0.08817116171121597, -0.10348480939865112, -0.04762805998325348, -0.08177056908607483, -0.004934777971357107, 0.14997313916683197, 0.11403749883174896, 0.03181217238306999, 0.05436822772026062, 0.01786969043314457, 0.17963136732578278, -0.1383468359708786, 0.14236441254615784, -0.11204802244901657, 0.07022446393966675, -0.15068933367729187, -0.09941380470991135, -0.0001507891865912825, -0.005463708192110062, -0.02756505087018013, 0.26406964659690857, -0.08693379163742065, 0.04275071248412132, -0.07523394376039505, 0.07468464225530624, -0.12492094933986664, -0.08011794090270996, 0.13067561388015747, 0.043590202927589417, 0.09319443255662918, 0.009910818189382553, -0.08080214262008667, -0.08114077895879745, 0.0876561850309372, 0.06510777771472931, 0.055530790239572525, -0.040775954723358154, -0.2600575387477875, -0.17272284626960754, -0.02911480888724327, -0.056365419179201126, -0.04082818701863289, 0.18973717093467712, 0.00834520161151886, 0.012911914847791195, -0.05051005631685257, -0.053735364228487015, 0.03640385717153549, -0.10628525167703629, -0.08591669052839279, -0.0762052983045578, 0.0130204102024436, -0.12087976187467575, -0.16801568865776062, -0.06128833442926407, 0.32099223136901855, 0.11201303452253342, -0.008285691030323505, -0.03261224925518036, -0.14958277344703674, 0.04651249945163727, 0.03205827623605728, 0.11544802784919739, -0.08063115924596786, 0.08911745995283127, -0.0382600761950016, -0.04214371368288994, -0.06523767858743668, -0.010715589858591557, 0.040741726756095886, -0.13629016280174255, -0.010841062292456627, -0.10128400474786758, -0.17458224296569824, -0.2246405929327011, 0.055698711425065994, 0.09612004458904266, 0.0934053435921669, -0.18570517003536224, 0.010995225980877876, -2.675446301369841e-32, -0.02220289595425129, 0.007395719178020954, -0.004850624594837427, 0.00926646776497364, 0.0868622288107872, -0.1489158272743225, 0.05170724168419838, -0.07869722694158554, 0.1515025496482849, -0.1150224432349205, -0.08580613136291504, -0.054465021938085556, 0.11835547536611557, 0.12438112497329712, -0.040870726108551025, -0.004622618667781353, 0.234007328748703, 0.03390325978398323, -0.0009123399504460394, 0.12439075112342834, 0.24235862493515015, -0.08662328869104385, 0.032855913043022156, 0.1322641521692276, -0.12752826511859894, -0.12096694856882095, -0.07933304458856583, -0.12004820257425308, -0.07731534540653229, 0.0910969153046608, 0.01106245256960392, 0.0015329363523051143, -0.0851634219288826, 0.15289142727851868, 0.02118816040456295, -0.010224470868706703, -0.2736157476902008, 0.027121540158987045, -0.055170729756355286, -0.04507695138454437, 0.15187440812587738, -0.1078815683722496, -0.03934831544756889, -0.00020917861547786742, 0.008077260106801987, 0.2700122892856598, -0.017556102946400642, 0.09318456053733826, -0.006096695549786091, -0.044538822025060654, 0.06399183720350266, -0.03901806101202965, -0.012266150675714016, 0.03371843323111534, 0.0016372130485251546, -0.031816866248846054, 0.020197303965687752, -0.15359020233154297, -0.10114701837301254, 0.002487331163138151, 0.27148768305778503, -0.07353434711694717, -0.010727179236710072, 0.3001830577850342, 0.045691780745983124, 0.0014316760934889317, 0.2634848952293396, -0.19331498444080353, 0.20482048392295837, -0.07367344200611115, 0.0928119421005249, -0.03873506188392639, -0.06462887674570084, 0.26451820135116577, 0.08740071207284927, 0.07641975581645966, -0.17557375133037567, 0.16333284974098206, 0.18472525477409363, -0.054446399211883545, 0.08881691843271255, -0.04231631010770798, 0.02533847466111183, -0.027954988181591034, 0.028627822175621986, -0.1425953060388565, 0.07367795705795288, -0.03417246416211128, 0.03715680539608002, 0.030515486374497414, -0.14092661440372467, 0.2539234161376953, 0.0201545599848032, 0.030271416530013084, -0.005836599972099066, 0.10978267341852188, -0.04209472984075546, -0.020968656986951828, -0.10268720984458923, -0.13298597931861877, 0.12855981290340424, -0.12258194386959076, 0.14727123081684113, -0.11029291152954102, 0.1986638307571411, -0.09773977845907211, 0.06348351389169693, -0.05037539079785347, -0.2567679286003113, 0.04272609204053879, -0.1255653351545334, 0.05851389095187187, 0.00480755465105176, -0.046926870942115784, 0.12180463969707489, 0.052630770951509476, 0.03355242684483528, -0.0314427986741066, 0.023858582600951195, 0.10318753123283386, -0.05547141656279564, 0.051358580589294434, 0.11571468412876129, 0.1482059359550476, 0.04084937646985054, 0.041798725724220276, 0.051045745611190796, -0.17590665817260742, 0.19732394814491272, -0.05396232008934021, -0.011737034656107426, -0.06260225176811218, 7.678976317038178e-7, -0.06264754384756088, -0.007560634519904852, 0.13907963037490845, -0.07355860620737076, -0.08569587767124176, 0.09953518211841583, 0.06094030663371086, 0.12454698979854584, 0.031350553035736084, -0.04671303927898407, 0.0015351219335570931, -0.1425473839044571, 0.001370851881802082, 0.14260299503803253, -0.23863567411899567, 0.12256118655204773, 0.06393379718065262, 0.15998800098896027, -0.022738363593816757, 0.08067925274372101, -0.040655966848134995, 0.0255541130900383, 0.03177325427532196, -0.09121245890855789, 0.10130901634693146, -0.0172804594039917, 0.027031918987631798, -0.046237580478191376, -0.08696945011615753, 0.015124332159757614, 0.008740865625441074, 0.025459187105298042, 0.009560617618262768, 0.09986981749534607, -0.13105161488056183, 0.06788847595453262, 0.019082283601164818, 0.02405470795929432, -0.050050221383571625, -0.044979751110076904, -0.09570258110761642, -0.027424275875091553, -0.02154948003590107, -0.012577730230987072, 0.05065577104687691, 0.1207219660282135, -0.1164839118719101, 0.13319095969200134, -0.052414245903491974, 0.015423497185111046, -0.02777070924639702, 0.013147725723683834, 0.07713505625724792, 0.07748205959796906, 0.00021067087072879076, -0.09404223412275314, -0.023487238213419914, -0.01961948163807392, 0.018964432179927826, -0.13927410542964935, -0.054938629269599915, 0.026580670848488808, -0.07562774419784546, 0.012019935995340347, 0.05374818295240402, -0.04346783086657524, -0.050893597304821014, 2.9499623072835524e-34, 0.017155271023511887, 0.21309374272823334, -0.0688939020037651, 0.037455424666404724, 0.0008431966416537762, -0.03086303174495697, -0.024278538301587105, 0.08337985724210739, 0.0753534585237503, -0.11621738225221634, -0.20323187112808228 ]
https://github.com/huggingface/datasets/issues/6193
Dataset loading script method does not work with .pyc file
Before dynamically loading `.py` scripts with `importlib.import_module`, we also parse their contents to check imports, which is tricky to implement for binary `.pyc` files (requires parsing bytecode), so I don't think this is something we want to support (unless more users request it ofc) as this use case is a bit too specific. @lhoestq What's your opinion on this?
### Describe the bug The huggingface dataset library specifically looks for β€˜.py’ file while loading the dataset using loading script approach and it does not work with β€˜.pyc’ file. While deploying in production, it becomes an issue when we are restricted to use only .pyc files. Is there any work around for this ? ### Steps to reproduce the bug 1. Create a dataset loading script to read the custom data. 2. compile the code to make sure that .pyc file is created 3. Delete the loading script and re-run the code. Usually, python should make use of complied .pyc files. However, in this case, the dataset library errors out with the message that it's unable to find the data loader loading script. ### Expected behavior The code should make use of .pyc file and run without any error. ### Environment info NA
59
Dataset loading script method does not work with .pyc file ### Describe the bug The huggingface dataset library specifically looks for β€˜.py’ file while loading the dataset using loading script approach and it does not work with β€˜.pyc’ file. While deploying in production, it becomes an issue when we are restricted to use only .pyc files. Is there any work around for this ? ### Steps to reproduce the bug 1. Create a dataset loading script to read the custom data. 2. compile the code to make sure that .pyc file is created 3. Delete the loading script and re-run the code. Usually, python should make use of complied .pyc files. However, in this case, the dataset library errors out with the message that it's unable to find the data loader loading script. ### Expected behavior The code should make use of .pyc file and run without any error. ### Environment info NA Before dynamically loading `.py` scripts with `importlib.import_module`, we also parse their contents to check imports, which is tricky to implement for binary `.pyc` files (requires parsing bytecode), so I don't think this is something we want to support (unless more users request it ofc) as this use case is a bit too specific. @lhoestq What's your opinion on this?
[ 0.09278929978609085, -0.021795108914375305, 0.055171672254800797, 0.005574165843427181, 0.20020493865013123, -0.02667287178337574, 0.11091552674770355, 0.004454068839550018, 0.19523032009601593, 0.19013328850269318, 0.020782966166734695, -0.06889993697404861, 0.008672277443110943, 0.022539034485816956, 0.047464266419410706, 0.0880463570356369, -0.14339876174926758, 0.004801074508577585, -0.046829309314489365, 0.042632561177015305, -0.09280561655759811, 0.0552300363779068, 0.16359560191631317, -0.051219649612903595, -0.020473139360547066, 0.07978104799985886, -0.01010479312390089, 0.25404152274131775, 0.11417382955551147, -0.17342787981033325, 0.16802512109279633, -0.0451122410595417, 0.05875648185610771, 0.19135631620883942, 0.000006004563601891277, 0.10760064423084259, 0.10598708689212799, 0.01100879069417715, -0.06351952999830246, -0.023145852610468864, 0.24970705807209015, -0.10789515823125839, 0.02759057655930519, -0.044610247015953064, -0.030588306486606598, -0.07389388978481293, -0.046628549695014954, -0.010146376676857471, 0.08378924429416656, 0.027915306389331818, -0.03737504780292511, 0.11578619480133057, -0.10439007729291916, -0.2191007137298584, -0.050954531878232956, 0.09400021284818649, -0.002713097259402275, 0.1088474914431572, -0.17428086698055267, -0.09479014575481415, 0.03595317527651787, -0.15770770609378815, -0.0005106020253151655, 0.031304981559515, -0.023954514414072037, 0.04479854553937912, -0.22223563492298126, -0.11074626445770264, 0.028008555993437767, 0.22365368902683258, -0.017785051837563515, 0.10472438484430313, -0.13398227095603943, -0.07075396180152893, 0.003949528560042381, 0.0710936188697815, -0.12239296734333038, -0.12535621225833893, -0.02437295950949192, 0.06965644657611847, -0.005513676442205906, -0.0621543787419796, -0.0462832935154438, -0.10643137246370316, -0.17262442409992218, 0.030617287382483482, -0.11465265601873398, -0.032034147530794144, 0.023875312879681587, -0.007075656205415726, 0.09334289282560349, 0.03605703264474869, -0.1482439488172531, -0.12292758375406265, 0.1863652616739273, 0.021729961037635803, -0.012373734265565872, 0.10967975854873657, -0.023590266704559326, -0.03450505807995796, -0.017619779333472252, -0.08748281747102737, -0.03650222346186638, 0.1439918428659439, 0.09718125313520432, -0.08119133859872818, 0.05606759339570999, -0.1253504753112793, 0.0662475973367691, 0.1110931783914566, -0.0006192357395775616, 0.1339770406484604, -0.13600647449493408, -0.07818851619958878, 0.10729148983955383, 0.025301821529865265, 0.04894097149372101, 0.08908066153526306, -0.04427698999643326, 0.1332104653120041, 0.19106850028038025, 0.1046079769730568, -0.02917814627289772, 0.1395244300365448, 0.07505066692829132, -0.07222244888544083, 0.03424256667494774, 0.1680452972650528, -0.047984905540943146, -0.11172517389059067, -0.10418063402175903, -0.005486458074301481, 0.06167072057723999, 0.04125635698437691, 0.12026365846395493, -0.10437781363725662, -0.03465421497821808, -0.17133934795856476, -0.1130295842885971, -0.12492972612380981, 0.015452670864760876, -0.051281917840242386, -0.07518648356199265, -0.020779522135853767, 0.02282491698861122, -0.023270441219210625, 0.07100808620452881, 0.033543895930051804, 0.00675157830119133, -0.04329323023557663, -0.2557801604270935, 0.11682075262069702, -0.1319887936115265, 0.10057740658521652, -0.16122160851955414, 0.04492951184511185, -0.12603041529655457, 0.036109112203121185, -0.2892146110534668, -0.1246497854590416, 0.05859628692269325, -0.0980030745267868, 0.013316608034074306, -0.030757887288928032, 0.16920557618141174, 0.17873768508434296, 0.043211933225393295, 0.062484242022037506, 0.011107783764600754, -0.06032126024365425, 0.038920190185308456, -0.20060992240905762, -0.026223095133900642, -0.035179078578948975, -0.23261383175849915, 0.15164609253406525, -0.12728670239448547, -0.06580556184053421, -0.10450863093137741, 0.048643965274095535, 0.12954407930374146, 0.08209342509508133, 0.07276347279548645, -0.14315581321716309, 0.07255230098962784, -0.0738154724240303, -0.04126590117812157, 0.044746287167072296, -0.029526052996516228, -0.04306497797369957, -0.06757655739784241, -0.04436805099248886, 0.09808658063411713, 0.09255401045084, -0.056079886853694916, -0.11435189843177795, 0.03987608104944229, -0.04697304964065552, 0.09753812849521637, -0.2284317910671234, -0.1559315174818039, 0.09575468301773071, -0.025260228663682938, 0.01751719042658806, -0.01241026446223259, -0.1066841185092926, -0.205613374710083, 0.14590154588222504, 0.06801743805408478, -0.16765691339969635, -0.1922355741262436, -0.01995754800736904, -0.11795498430728912, 0.023587828502058983, -0.13934418559074402, -0.09614415466785431, -0.12439334392547607, 0.057730548083782196, -0.033788442611694336, 0.1261659413576126, -0.10255219787359238, 0.1388196498155594, 0.08656588941812515, 0.11482471227645874, -0.10364950448274612, 0.07599496841430664, 0.07275502383708954, -0.05544818937778473, 0.09548500925302505, 0.015545547939836979, -0.16563549637794495, -0.19460149109363556, 0.09919533133506775, 0.216069296002388, 0.03384147584438324, 0.006562765687704086, 0.0806540846824646, -0.08555029332637787, 0.043622177094221115, -0.06608263403177261, -0.048557303845882416, 0.09631899744272232, -0.07734446972608566, -0.08983787149190903, -0.008266056887805462, 0.18404515087604523, -0.08426329493522644, 0.154269739985466, -0.002141913864761591, -0.007678726222366095, 0.3493556082248688, 0.20116190612316132, -0.12616024911403656, -0.018720675259828568, 0.05210840329527855, 0.01095727737993002, 0.07358171045780182, 0.10521149635314941, -0.09683913737535477, -0.18769489228725433, 0.24399976432323456, 0.010537191294133663, -0.015892663970589638, -0.01611897721886635, 0.08041706681251526, -0.045780740678310394, 0.004256654065102339, -0.10150735825300217, 0.0057756309397518635, 0.11834904551506042, -0.029479844495654106, -0.030159443616867065, -0.11064308136701584, -0.14643517136573792, 0.019774777814745903, -0.07122819870710373, 0.06935667991638184, -0.0627291202545166, -0.02247760072350502, -0.048951733857393265, -0.1662454605102539, 0.10586996376514435, 0.060659993439912796, -0.12289873510599136, 0.1308690309524536, 0.06004764139652252, -0.10650356858968735, 0.14602257311344147, -0.03480770066380501, -0.024259379133582115, -0.020053662359714508, -0.02094379812479019, -0.014541953802108765, -0.15315930545330048, -0.047645941376686096, 0.017878707498311996, 0.09552405774593353, 0.04387878254055977, -0.04887590929865837, -0.05754790082573891, 0.051202740520238876, 0.07700479030609131, 0.0707813948392868, -0.05167349427938461, 0.05621982365846634, 0.16044014692306519, 0.17562443017959595, 0.06407693773508072, -0.19905564188957214, 0.03364219889044762, 0.06091174855828285, -0.006751066539436579, 0.022759437561035156, 0.09159206598997116, -0.009376408532261848, 0.0000992374771158211, 0.04195554181933403, -0.09543062746524811, 0.1849721372127533, 0.06299334764480591, 0.07157053053379059, 0.21920563280582428, 0.044856589287519455, -0.08354521542787552, -0.07319609820842743, 0.16808494925498962, -0.21112537384033203, -0.0764053463935852, -0.10582289844751358, 0.003222278319299221, -0.15474045276641846, 0.16236771643161774, 0.01609225943684578, -0.13658630847930908, 0.009422971867024899, -0.08887847512960434, -0.10649660229682922, -0.07479839771986008, 0.2641542851924896, 0.10966576635837555, -0.10417656600475311, 0.07802655547857285, -0.028899049386382103, -0.014647774398326874, -0.01706184260547161, -0.0545261949300766, -0.0027052967343479395, -0.11620509624481201, 0.03904086723923683, 0.041258249431848526, 0.08653799444437027, 0.05433933064341545, -0.03971864655613899, 0.0022269722539931536, 0.07683918625116348, -0.08923023194074631, -0.14402729272842407, 0.06062232330441475, -0.07249405980110168, 0.2745365500450134, 0.016795028001070023, -0.03812437877058983, 0.05771604925394058, 0.022863946855068207, -0.019158726558089256, 0.1483733206987381, 0.07701364159584045, 0.11518684029579163, 0.03561272472143173, -0.1349077969789505, -0.07808658480644226, 0.020643383264541626, 0.020762331783771515, 0.008896027691662312, -0.016256732866168022, 0.09459476172924042, -0.08707644045352936, -0.18481427431106567, 0.19027358293533325, 0.04143509641289711, -0.017561133950948715, -0.13453471660614014, -0.06271082907915115, -0.06296596676111221, 0.1582203060388565, 0.0939168930053711, -0.05284810811281204, 0.10723471641540527, -0.019466394558548927, 0.2609311044216156, 0.034350473433732986, 0.15250413119792938, 0.06734991818666458, -0.17026115953922272, 0.04771524667739868, -0.16207188367843628, 0.14671941101551056, 0.11533988267183304, -0.014319216832518578, -0.06305252760648727, 0.03112124651670456, 0.10242442786693573, 0.127352774143219, 0.013919075019657612, 0.07925036549568176, -0.021508734673261642, -0.026756448671221733, -0.039532288908958435, 0.08939951658248901, -0.05933012440800667, 0.010394361801445484, 0.04700586572289467, -0.031715862452983856, -0.017134202644228935, 0.1406499743461609, 0.1237017884850502, -0.1290292590856552, -0.02029193378984928, -0.11783860623836517, -0.12480593472719193, -0.03523959219455719, -0.18313001096248627, 0.06983212381601334, 0.14970575273036957, 0.11062751710414886, 0.03169315680861473, 0.06833012402057648, -0.03698773309588432, 0.10903281718492508, 0.021367937326431274, 0.06287400424480438, 0.005015173926949501, 0.031059354543685913, 0.12350069731473923, 0.21456891298294067, -0.1289953589439392, 0.3943699896335602, -0.06792455911636353, -0.18538399040699005, -0.07576440274715424, -0.1542087346315384, 0.031235069036483765, -0.029647229239344597, -0.055793460458517075, 0.03534642606973648, -0.0065470291301608086, -0.01528823934495449, -0.03866817057132721, -0.020851777866482735, -0.06010962650179863, -0.1735900193452835, -0.09522663801908493, -0.16660098731517792, -0.1307957023382187, -0.06234242394566536, 0.04246324300765991, -0.006574525963515043, 0.08287052810192108, 0.013827151618897915, 0.08497483283281326, -0.27980151772499084, -0.06310159713029861, -0.04289998859167099, 0.0481630340218544, 0.005818015430122614, 0.12957455217838287, 0.18537263572216034, -0.08195992559194565, -0.0810692310333252, 0.018401112407445908, 0.0288226455450058, 0.08649014681577682, -0.0039135245606303215, 0.10430028289556503, 0.03314477577805519, -0.020473532378673553, 0.10310612618923187, 0.016086874529719353, -0.1195482611656189, -0.03911987692117691, 0.17954930663108826, 0.07722742855548859, 0.05620593577623367, -0.18095062673091888, -0.0304205771535635, 0.14438477158546448, -0.005671707913279533, -0.09922163188457489, -0.22643475234508514, 0.0824350118637085, 0.1273047775030136, 0.020009636878967285, 0.058611854910850525, -0.03133314847946167, -0.09902607649564743, 0.14792434871196747, -0.021751640364527702, 0.19136986136436462, 0.014048760756850243, 0.09165147691965103, 0.09985840320587158, -0.033531442284584045, 0.07126806676387787, -0.04051768034696579, 0.024804357439279556, -0.18238922953605652, -0.012135330587625504, 0.1236148327589035, -0.03621391952037811, -0.01969052292406559, 0.09984493255615234, 0.13482598960399628, -0.06186956912279129, 0.006801405921578407, 0.08552573621273041, 0.01402263529598713, -0.1332494467496872, -0.04897410050034523, -0.02466355636715889, 0.06870328634977341, -0.021201206371188164, -0.003682911628857255, 0.02777986228466034, -0.09102623164653778, -0.057280026376247406, 0.16608792543411255, -0.09143689274787903, -0.024983618408441544, 0.11117768287658691, -0.07225583493709564, 0.04305099695920944, 0.04987478256225586, 0.1785425841808319, 0.008017062209546566, -0.06797725707292557, 0.07457927614450455, 0.2503107488155365, -0.16166047751903534, 0.043728843331336975, 0.17793743312358856, 0.0038502980023622513, -0.18382033705711365, 0.009716356173157692, 0.03578009456396103, -0.031039297580718994, 0.020100923255085945, -0.02120957523584366, 0.039491668343544006, 0.03111920692026615, -0.08430635929107666, -0.046329036355018616, 0.1982710212469101, 0.03292667120695114, -0.1093641072511673, -0.055218860507011414, -2.742549690260119e-32, -0.009371004067361355, 0.08483289182186127, -0.0649099051952362, 0.06742789596319199, 0.007711983751505613, 0.06197318807244301, 0.04044145718216896, -0.03214510157704353, -0.19214092195034027, -0.10988902300596237, -0.12334389984607697, 0.06942187249660492, 0.0413733571767807, -0.004515271633863449, -0.09972478449344635, -0.06547287106513977, -0.1524672508239746, -0.11379358172416687, -0.04075570032000542, 0.0718645229935646, 0.042591046541929245, -0.02084103412926197, -0.03145759925246239, -0.1000489592552185, 0.019139710813760757, -0.03980163857340813, 0.07313370704650879, -0.18376322090625763, 0.025472473353147507, -0.009602714329957962, -0.07623469084501266, -0.01661551371216774, -0.005320261232554913, 0.028500370681285858, 0.04130423814058304, 0.030909916386008263, -0.028119564056396484, -0.05390336364507675, -0.042545825242996216, 0.0022067094687372446, 0.035854045301675797, 0.03168509155511856, 0.09034300595521927, -0.28111401200294495, -0.0015971389366313815, -0.021782588213682175, 0.07716341316699982, 0.004027708899229765, -0.01899818889796734, -0.04143046215176582, 0.02943173050880432, 0.008911778219044209, 0.13393451273441315, 0.017297809943556786, -0.02820701152086258, -0.09745752066373825, -0.012143570929765701, 0.07704149931669235, -0.043391961604356766, -0.020898990333080292, -0.004188504535704851, -0.008229213766753674, -0.10035432130098343, -0.0479716956615448, 0.1884382665157318, -0.1530919373035431, 0.2078566998243332, 0.07336003333330154, -0.013846220448613167, -0.05328115075826645, 0.07709568738937378, 0.05803496763110161, -0.03885972872376442, -0.01681874506175518, -0.08223716169595718, -0.1211961954832077, -0.10912326723337173, 0.008510418236255646, 0.07070747762918472, -0.19689048826694489, -0.030095210298895836, -0.08506493270397186, 0.04537498205900192, 0.055942777544260025, 0.03960021212697029, 0.13217681646347046, -0.0645807534456253, -0.05601825565099716, -0.19117799401283264, -0.12654945254325867, -0.0573166124522686, -0.037224750965833664, -0.05729043483734131, -0.04147137701511383, -0.07769130170345306, 0.062615767121315, -0.01844835840165615, 0.08818013966083527, -0.012305677868425846, 0.10596903413534164, -0.12088605761528015, 0.06017119809985161, 0.19085752964019775, -0.03479594737291336, 0.05855858325958252, -0.07152634859085083, 0.11623583734035492, 0.03467173129320145, -0.14934371411800385, -0.06354593485593796, -0.07009746879339218, 0.10879708081483841, 0.0817176103591919, 0.06658034026622772, 0.14081412553787231, 0.08195411413908005, -0.040623739361763, -0.20861415565013885, 0.16479434072971344, 0.0796184316277504, -0.23547323048114777, -0.03182131424546242, -0.04041023924946785, -0.059648655354976654, -0.11402526497840881, 0.2093282788991928, -0.2889203131198883, -0.09152213484048843, -0.023057883605360985, 0.05256357416510582, -0.031112181022763252, -0.05755383521318436, 7.90551666796091e-7, -0.20585063099861145, 0.05472436547279358, 0.03669873625040054, 0.07259152084589005, -0.0032885519322007895, -0.0019054556032642722, -0.2978872060775757, 0.007098767440766096, 0.050181180238723755, 0.034187376499176025, 0.21972759068012238, -0.022990407422184944, -0.01882343925535679, -0.07214175909757614, 0.0765179917216301, -0.10106032341718674, -0.042757149785757065, -0.13185618817806244, 0.049139007925987244, -0.025914376601576805, 0.017104096710681915, 0.11186181753873825, -0.0345291905105114, -0.0865606963634491, -0.015460172668099403, -0.13055084645748138, 0.03768142685294151, -0.04711923748254776, 0.2124089151620865, -0.07022534310817719, -0.07778693735599518, 0.14055849611759186, -0.12053916603326797, 0.19169044494628906, 0.006691284012049437, -0.020391520112752914, -0.10743434727191925, -0.05403527989983559, -0.00939197652041912, 0.07561850547790527, 0.08689580857753754, 0.04439966753125191, 0.017829889431595802, -0.04276629164814949, 0.2309703379869461, 0.026879919692873955, -0.11613382399082184, -0.10662258416414261, 0.003617863869294524, 0.1206839308142662, -0.01683967188000679, 0.06242717057466507, 0.11305591464042664, 0.2005138099193573, 0.03141343593597412, -0.11487735062837601, 0.0021774936467409134, -0.11608882248401642, 0.07079513370990753, 0.0014625717885792255, -0.05646885558962822, -0.053725454956293106, 0.09888759255409241, -0.026687800884246826, 0.06867438554763794, -0.06649001687765121, 0.0722241997718811, 1.878270536123604e-34, -0.07169651240110397, -0.06663962453603745, 0.06348403543233871, -0.18744415044784546, -0.03680163249373436, 0.042747512459754944, -0.011189152486622334, -0.025218941271305084, 0.06174731254577637, -0.2321254462003708, 0.031163934618234634 ]
https://github.com/huggingface/datasets/issues/6193
Dataset loading script method does not work with .pyc file
> Before dynamically loading .py scripts with importlib.import_module, we also parse their contents to check imports, which is tricky to implement for binary .pyc files (requires parsing bytecode), so I don't think this is something we want to support (unless more users request it ofc) as this use case is a bit too specific. Yes indeed. Though you can use a .py that imports a package that contains your .pyc code and that you previously installed
### Describe the bug The huggingface dataset library specifically looks for β€˜.py’ file while loading the dataset using loading script approach and it does not work with β€˜.pyc’ file. While deploying in production, it becomes an issue when we are restricted to use only .pyc files. Is there any work around for this ? ### Steps to reproduce the bug 1. Create a dataset loading script to read the custom data. 2. compile the code to make sure that .pyc file is created 3. Delete the loading script and re-run the code. Usually, python should make use of complied .pyc files. However, in this case, the dataset library errors out with the message that it's unable to find the data loader loading script. ### Expected behavior The code should make use of .pyc file and run without any error. ### Environment info NA
76
Dataset loading script method does not work with .pyc file ### Describe the bug The huggingface dataset library specifically looks for β€˜.py’ file while loading the dataset using loading script approach and it does not work with β€˜.pyc’ file. While deploying in production, it becomes an issue when we are restricted to use only .pyc files. Is there any work around for this ? ### Steps to reproduce the bug 1. Create a dataset loading script to read the custom data. 2. compile the code to make sure that .pyc file is created 3. Delete the loading script and re-run the code. Usually, python should make use of complied .pyc files. However, in this case, the dataset library errors out with the message that it's unable to find the data loader loading script. ### Expected behavior The code should make use of .pyc file and run without any error. ### Environment info NA > Before dynamically loading .py scripts with importlib.import_module, we also parse their contents to check imports, which is tricky to implement for binary .pyc files (requires parsing bytecode), so I don't think this is something we want to support (unless more users request it ofc) as this use case is a bit too specific. Yes indeed. Though you can use a .py that imports a package that contains your .pyc code and that you previously installed
[ 0.08635566383600235, -0.03190899267792702, 0.06584671884775162, 0.004906106740236282, 0.19512508809566498, -0.03099036030471325, 0.10661907494068146, -0.002478438662365079, 0.19898980855941772, 0.19340603053569794, 0.016430392861366272, -0.0653616264462471, 0.01717623509466648, 0.02253156527876854, 0.053759779781103134, 0.06690467149019241, -0.15290354192256927, 0.002263978123664856, -0.03770416975021362, 0.04297580569982529, -0.08758354187011719, 0.04005672410130501, 0.15644510090351105, -0.043996650725603104, -0.023037521168589592, 0.07452093809843063, -0.011757340282201767, 0.25175410509109497, 0.12823441624641418, -0.16071125864982605, 0.17013710737228394, -0.03143707290291786, 0.07310831546783447, 0.18798507750034332, 0.000005976290594844613, 0.10845808684825897, 0.11499378085136414, 0.012277656234800816, -0.07051443308591843, -0.029603993520140648, 0.22959589958190918, -0.11126750707626343, 0.030271466821432114, -0.049051932990550995, -0.04564475268125534, -0.062016408890485764, -0.0579083226621151, -0.010734177194535732, 0.08002956956624985, 0.022838350385427475, -0.03264125436544418, 0.09885992854833603, -0.11206706613302231, -0.22028838098049164, -0.0596734993159771, 0.09013455361127853, -0.0011987973703071475, 0.11585482209920883, -0.18355309963226318, -0.09760987758636475, 0.03441442549228668, -0.1559041440486908, -0.013567507266998291, 0.045919269323349, -0.011971797794103622, 0.04395720735192299, -0.223040372133255, -0.08809574693441391, 0.009153338149189949, 0.21809564530849457, -0.014803222380578518, 0.09817972779273987, -0.12446849793195724, -0.06879451870918274, -0.005151906982064247, 0.06297063082456589, -0.1263151317834854, -0.14437608420848846, -0.015389399603009224, 0.06552307307720184, -0.010967954993247986, -0.07286364585161209, -0.04990295320749283, -0.11632507294416428, -0.17989784479141235, 0.03844819217920303, -0.12330760806798935, -0.036549948155879974, 0.0246515441685915, 0.0030367830768227577, 0.08280664682388306, 0.030553001910448074, -0.1473243683576584, -0.11399609595537186, 0.18661616742610931, 0.030925894156098366, -0.028587374836206436, 0.10641279816627502, -0.02147378958761692, -0.024396337568759918, -0.02209024503827095, -0.09306950867176056, -0.036508966237306595, 0.13354645669460297, 0.11953321844339371, -0.08470629900693893, 0.04226338118314743, -0.1342918425798416, 0.046440646052360535, 0.11857590079307556, -0.0031235720962285995, 0.12753625214099884, -0.12859906256198883, -0.05176938697695732, 0.11179052293300629, 0.022713804617524147, 0.04712974652647972, 0.07517509162425995, -0.02897266298532486, 0.13703885674476624, 0.1967233270406723, 0.1073056012392044, -0.048580676317214966, 0.155879408121109, 0.07423516362905502, -0.08219920098781586, 0.0332537405192852, 0.15949822962284088, -0.05264053866267204, -0.12583011388778687, -0.09755736589431763, -0.014646519906818867, 0.05990944430232048, 0.04935320466756821, 0.11615311354398727, -0.1149391308426857, -0.043549373745918274, -0.18417130410671234, -0.12207968533039093, -0.11744643747806549, 0.013805490918457508, -0.03553438559174538, -0.08817483484745026, -0.004045822657644749, 0.03209256753325462, -0.0155336894094944, 0.062050193548202515, 0.044893793761730194, 0.004195444285869598, -0.0336763896048069, -0.2502065896987915, 0.1116698831319809, -0.12412706017494202, 0.11605650931596756, -0.15966205298900604, 0.03947212174534798, -0.14264599978923798, 0.03938499093055725, -0.29004284739494324, -0.10768183320760727, 0.06147348880767822, -0.09922730922698975, 0.014216219075024128, -0.019429150968790054, 0.18163421750068665, 0.18114346265792847, 0.05041840672492981, 0.0757828876376152, 0.014469863846898079, -0.06245804578065872, 0.03150516003370285, -0.20742644369602203, -0.020906785503029823, -0.024380052462220192, -0.2256259024143219, 0.14758843183517456, -0.13083653151988983, -0.05551285669207573, -0.10492229461669922, 0.041090965270996094, 0.11603809893131256, 0.08861014246940613, 0.0782608613371849, -0.1513991504907608, 0.06556058675050735, -0.07952714711427689, -0.04925443232059479, 0.021222205832600594, -0.02610294707119465, -0.04070821404457092, -0.07806301862001419, -0.04142211750149727, 0.092054583132267, 0.1033322736620903, -0.04904407635331154, -0.12717406451702118, 0.03257199376821518, -0.04168720543384552, 0.0957861915230751, -0.22713600099086761, -0.1608879566192627, 0.10510923713445663, -0.01614362746477127, 0.027901720255613327, -0.009901313111186028, -0.12490016967058182, -0.1916332244873047, 0.14974918961524963, 0.08032377064228058, -0.1816122978925705, -0.17640440165996552, -0.0183477271348238, -0.11149666458368301, 0.012368641793727875, -0.14544402062892914, -0.10604970902204514, -0.12896451354026794, 0.0664295181632042, -0.05701437219977379, 0.126368910074234, -0.11514902114868164, 0.14788679778575897, 0.0997503250837326, 0.12355250120162964, -0.11070092767477036, 0.07939287275075912, 0.0599200464785099, -0.05014133080840111, 0.10320151597261429, -0.002850197022780776, -0.16435690224170685, -0.2000192105770111, 0.10389155894517899, 0.21663688123226166, 0.03223800286650658, -0.0007110415608622134, 0.08126389235258102, -0.07651728391647339, 0.0352705754339695, -0.068569615483284, -0.05912553519010544, 0.09262100607156754, -0.08770813792943954, -0.08722589164972305, -0.004509229678660631, 0.19511380791664124, -0.08863402903079987, 0.15263599157333374, -0.016967982053756714, -0.007757564075291157, 0.33931389451026917, 0.19233420491218567, -0.11372220516204834, -0.005952976178377867, 0.05686003342270851, -0.00037138868356123567, 0.06746033579111099, 0.10196860134601593, -0.10150834918022156, -0.17652703821659088, 0.22967104613780975, 0.011620528064668179, -0.0025933110155165195, -0.02523864433169365, 0.06844830513000488, -0.04420236870646477, 0.007313344161957502, -0.08171766996383667, 0.009310426190495491, 0.11834967881441116, -0.03317556530237198, -0.023070180788636208, -0.11821892112493515, -0.15170730650424957, 0.020859038457274437, -0.0694105476140976, 0.06520543992519379, -0.07024233788251877, -0.03440850228071213, -0.0391819104552269, -0.15649062395095825, 0.12387179583311081, 0.05789913982152939, -0.11894793808460236, 0.12791091203689575, 0.04974667727947235, -0.0984448567032814, 0.14098258316516876, -0.03948086500167847, -0.032512117177248, -0.030421338975429535, -0.017337683588266373, -0.014753223396837711, -0.1502811759710312, -0.03865542262792587, 0.028151487931609154, 0.10701470822095871, 0.02837083488702774, -0.045023348182439804, -0.05668792501091957, 0.04799719527363777, 0.06860306113958359, 0.07545332610607147, -0.0517287515103817, 0.051632169634103775, 0.18624627590179443, 0.1693911999464035, 0.08067725598812103, -0.2005501687526703, 0.026639524847269058, 0.06773652136325836, 0.0035417014732956886, 0.016418689861893654, 0.09048736840486526, 0.004516099579632282, -0.009509391151368618, 0.02900245413184166, -0.10330002754926682, 0.18629911541938782, 0.05591137334704399, 0.06969887018203735, 0.2145787626504898, 0.040079422295093536, -0.07034538686275482, -0.07432455569505692, 0.16324636340141296, -0.18509817123413086, -0.06559285521507263, -0.09405186772346497, 0.011185050010681152, -0.16377770900726318, 0.16319029033184052, 0.023852115496993065, -0.12920473515987396, 0.008289585821330547, -0.0885242223739624, -0.12082953751087189, -0.07153662294149399, 0.2509181797504425, 0.11415034532546997, -0.10077304393053055, 0.08525507897138596, -0.029434755444526672, -0.01170684676617384, -0.020197512581944466, -0.06697659194469452, 0.00541055528447032, -0.1052875742316246, 0.04301541671156883, 0.03204641491174698, 0.08905968815088272, 0.05074557289481163, -0.04076362028717995, 0.008735674433410168, 0.08516598492860794, -0.09437330812215805, -0.1483135223388672, 0.05701855570077896, -0.06383577734231949, 0.27856317162513733, -0.001686504459939897, -0.046330105513334274, 0.05948987603187561, 0.012029357254505157, -0.007890038192272186, 0.1356024295091629, 0.08541359752416611, 0.11173497885465622, 0.052442386746406555, -0.14378269016742706, -0.0785050094127655, 0.02857167087495327, 0.026367003098130226, -0.003955961670726538, -0.01265780534595251, 0.09966299682855606, -0.08578898012638092, -0.17564770579338074, 0.1904665231704712, 0.043012067675590515, -0.027572017163038254, -0.13850577175617218, -0.051788900047540665, -0.05183085799217224, 0.17270608246326447, 0.08795291930437088, -0.04431196302175522, 0.11020664870738983, -0.0029681313317269087, 0.26975226402282715, 0.020536554977297783, 0.14358237385749817, 0.06426576524972916, -0.17179109156131744, 0.0586843378841877, -0.16196979582309723, 0.14217916131019592, 0.11905156075954437, -0.004290853161364794, -0.0549142099916935, 0.03930077701807022, 0.10524731874465942, 0.11130079627037048, 0.009017548523843288, 0.07903639227151871, -0.027797987684607506, -0.027737591415643692, -0.041523780673742294, 0.10049924999475479, -0.055834319442510605, -0.0007912155706435442, 0.04815156012773514, -0.02468152344226837, -0.039027344435453415, 0.14799055457115173, 0.12768492102622986, -0.13348990678787231, -0.025379955768585205, -0.12313402444124222, -0.12242091447114944, -0.01477743685245514, -0.1635938584804535, 0.05549279600381851, 0.15346689522266388, 0.1000555008649826, 0.050475962460041046, 0.07486096769571304, -0.025684718042612076, 0.11953707784414291, 0.02550712786614895, 0.07450050115585327, 0.019443167373538017, 0.03278115391731262, 0.1319815069437027, 0.21768882870674133, -0.13112877309322357, 0.39985892176628113, -0.05896226316690445, -0.1779540330171585, -0.07973240315914154, -0.15213201940059662, 0.03390632942318916, -0.028677888214588165, -0.048442542552948, 0.04256743565201759, -0.01988331973552704, -0.02618389204144478, -0.03800304979085922, -0.030810605734586716, -0.06095822528004646, -0.16850586235523224, -0.0895480290055275, -0.17006562650203705, -0.12326131761074066, -0.0759255588054657, 0.04319863021373749, -0.005077574402093887, 0.08126842230558395, 0.02107360027730465, 0.08423782885074615, -0.2679442763328552, -0.06137032061815262, -0.02320273034274578, 0.04014519229531288, 0.00384919298812747, 0.12230252474546432, 0.18688158690929413, -0.06754358857870102, -0.07784466445446014, 0.0264605600386858, 0.0194447822868824, 0.09132314473390579, -0.008564858697354794, 0.09721887111663818, 0.037448685616254807, -0.01831725426018238, 0.09399525821208954, 0.02628643438220024, -0.10034918785095215, -0.03609807416796684, 0.1811005026102066, 0.09163496643304825, 0.058963973075151443, -0.18262942135334015, -0.043135810643434525, 0.13553285598754883, -0.008909903466701508, -0.09999478608369827, -0.2412814199924469, 0.09118381887674332, 0.12843897938728333, 0.017400410026311874, 0.04252804443240166, -0.03650793433189392, -0.1098567470908165, 0.1428704857826233, -0.02709214948117733, 0.21134118735790253, 0.01314492430537939, 0.10101431608200073, 0.09799698740243912, -0.0308834258466959, 0.07953245937824249, -0.04708096385002136, 0.03421415388584137, -0.19317585229873657, -0.013949280604720116, 0.1174246072769165, -0.03879231587052345, -0.025037124752998352, 0.1127910166978836, 0.12806332111358643, -0.03553329408168793, 0.01340311486274004, 0.09555123746395111, 0.011754645965993404, -0.14141367375850677, -0.033945415169000626, -0.03157389163970947, 0.07050469517707825, -0.02500537410378456, -0.0037855098489671946, 0.020670568570494652, -0.106336310505867, -0.04854600504040718, 0.177604079246521, -0.09087863564491272, -0.032875895500183105, 0.12736470997333527, -0.07907291501760483, 0.03178173303604126, 0.04554855450987816, 0.18566922843456268, 0.013379212468862534, -0.05951690673828125, 0.07871381938457489, 0.25198954343795776, -0.15493573248386383, 0.0331001915037632, 0.17223230004310608, 0.004093673080205917, -0.17387087643146515, 0.013827778398990631, 0.04139968380331993, -0.018943917006254196, 0.019647886976599693, -0.020614631474018097, 0.0401211716234684, 0.018902309238910675, -0.08064700663089752, -0.04372810199856758, 0.20032243430614471, 0.03578833490610123, -0.10748859494924545, -0.05071019008755684, -2.752687741288786e-32, -0.009030482731759548, 0.09138214588165283, -0.0668499544262886, 0.06621630489826202, 0.015598313882946968, 0.06657242774963379, 0.04711705073714256, -0.032193638384342194, -0.19529499113559723, -0.11019603908061981, -0.11796119809150696, 0.07121304422616959, 0.03957747668027878, -0.012140664272010326, -0.11327303946018219, -0.08343113213777542, -0.15621735155582428, -0.12371494621038437, -0.032272130250930786, 0.067392997443676, 0.025106733664870262, -0.013162887655198574, -0.03084583580493927, -0.11642980575561523, 0.03105057403445244, -0.0372578427195549, 0.07829311490058899, -0.17567525804042816, 0.017895447090268135, -0.021220045164227486, -0.07973543554544449, 0.007780782878398895, 0.0015462801093235612, 0.02592630498111248, 0.040714919567108154, 0.032929617911577225, -0.03236326202750206, -0.05592207610607147, -0.04021758586168289, -0.019339313730597496, 0.030774032697081566, 0.04080761969089508, 0.08990425616502762, -0.27928799390792847, -0.015859952196478844, -0.025400549173355103, 0.08323447406291962, -0.006697359494864941, -0.019590143114328384, -0.029594339430332184, 0.04378492385149002, 0.00898993480950594, 0.13886462152004242, 0.009761630557477474, -0.02923780120909214, -0.10663298517465591, -0.014581470750272274, 0.09110578149557114, -0.03552742674946785, -0.025914164260029793, -0.010616344399750233, -0.02998596616089344, -0.10407359898090363, -0.04294045642018318, 0.20207169651985168, -0.15548954904079437, 0.21381208300590515, 0.08500305563211441, -0.0063529787585139275, -0.06469235569238663, 0.07893045991659164, 0.047894734889268875, -0.026112576946616173, -0.022268347442150116, -0.08617507666349411, -0.12617476284503937, -0.11009182780981064, -0.00031035489519126713, 0.06409729272127151, -0.2225831001996994, -0.02942821942269802, -0.07683515548706055, 0.0325227715075016, 0.06382595747709274, 0.054580677300691605, 0.13127051293849945, -0.06048322468996048, -0.0482562817633152, -0.20047907531261444, -0.1225646510720253, -0.06959652155637741, -0.0230201855301857, -0.06878301501274109, -0.035021182149648666, -0.07848163694143295, 0.05239122733473778, 0.00018780007667373866, 0.08621164411306381, -0.01086787972599268, 0.10507743060588837, -0.13611479103565216, 0.06369751691818237, 0.18980571627616882, -0.009198701940476894, 0.04009832441806793, -0.07758939266204834, 0.11899342387914658, 0.024423273280262947, -0.1399415284395218, -0.06336822360754013, -0.06457430869340897, 0.10958913713693619, 0.09067071974277496, 0.060537293553352356, 0.14034757018089294, 0.08383072912693024, -0.03738141432404518, -0.20555293560028076, 0.16634365916252136, 0.07196595519781113, -0.23509863018989563, -0.035184696316719055, -0.04485872760415077, -0.06310214847326279, -0.10395220667123795, 0.20165598392486572, -0.290351003408432, -0.09065917134284973, -0.02573949471116066, 0.04853876307606697, -0.03200371190905571, -0.060094691812992096, 7.856839943087834e-7, -0.1886332780122757, 0.05467141419649124, 0.03986559808254242, 0.07213166356086731, -0.002890896052122116, -0.01996290124952793, -0.2968285381793976, 0.02424008771777153, 0.04548207297921181, 0.037265434861183167, 0.22959178686141968, -0.01569785550236702, -0.03924773260951042, -0.08185165375471115, 0.08118914812803268, -0.09765008836984634, -0.04514171928167343, -0.13917283713817596, 0.0432632677257061, -0.034063104540109634, 0.008863572962582111, 0.10695592314004898, -0.037953827530145645, -0.07191300392150879, -0.022784758359193802, -0.1050645187497139, 0.03785475343465805, -0.03649470582604408, 0.21697628498077393, -0.08230733126401901, -0.07706765830516815, 0.144226536154747, -0.1324041336774826, 0.20566219091415405, 0.011757220141589642, -0.030417032539844513, -0.10317870229482651, -0.0585535429418087, -0.021353060379624367, 0.06937828660011292, 0.09249740839004517, 0.05641994997859001, 0.015012838877737522, -0.04710056260228157, 0.23156587779521942, 0.02733740396797657, -0.11268609017133713, -0.10744518786668777, -0.0016237690579146147, 0.1138450875878334, -0.016746776178479195, 0.07171876728534698, 0.11461000144481659, 0.21320807933807373, 0.03469054028391838, -0.10582281649112701, 0.0005551463691517711, -0.11974320560693741, 0.0759802982211113, -0.005799764767289162, -0.059671539813280106, -0.05091685429215431, 0.09281093627214432, -0.029156969860196114, 0.043141916394233704, -0.06988538056612015, 0.06760215014219284, 1.7038939847850314e-34, -0.0699266642332077, -0.0630222037434578, 0.051704276353120804, -0.196524515748024, -0.04150475189089775, 0.03565134108066559, -0.00987234991043806, -0.0281697865575552, 0.07622399926185608, -0.2321932017803192, 0.04475792124867439 ]
https://github.com/huggingface/datasets/issues/6193
Dataset loading script method does not work with .pyc file
Hi @lhoestq , Could you share some example code related to the approach that you are suggesting?
### Describe the bug The huggingface dataset library specifically looks for β€˜.py’ file while loading the dataset using loading script approach and it does not work with β€˜.pyc’ file. While deploying in production, it becomes an issue when we are restricted to use only .pyc files. Is there any work around for this ? ### Steps to reproduce the bug 1. Create a dataset loading script to read the custom data. 2. compile the code to make sure that .pyc file is created 3. Delete the loading script and re-run the code. Usually, python should make use of complied .pyc files. However, in this case, the dataset library errors out with the message that it's unable to find the data loader loading script. ### Expected behavior The code should make use of .pyc file and run without any error. ### Environment info NA
17
Dataset loading script method does not work with .pyc file ### Describe the bug The huggingface dataset library specifically looks for β€˜.py’ file while loading the dataset using loading script approach and it does not work with β€˜.pyc’ file. While deploying in production, it becomes an issue when we are restricted to use only .pyc files. Is there any work around for this ? ### Steps to reproduce the bug 1. Create a dataset loading script to read the custom data. 2. compile the code to make sure that .pyc file is created 3. Delete the loading script and re-run the code. Usually, python should make use of complied .pyc files. However, in this case, the dataset library errors out with the message that it's unable to find the data loader loading script. ### Expected behavior The code should make use of .pyc file and run without any error. ### Environment info NA Hi @lhoestq , Could you share some example code related to the approach that you are suggesting?
[ 0.09646248817443848, -0.05935851112008095, 0.07408835738897324, 0.004471318796277046, 0.1842610388994217, -0.0288662351667881, 0.13452044129371643, -0.00860390905290842, 0.20397228002548218, 0.18552431464195251, 0.00507669011130929, -0.05457383766770363, 0.030517006292939186, -0.015483938157558441, 0.029269548133015633, 0.07753188908100128, -0.15598483383655548, -0.010913139209151268, -0.07175504416227341, 0.033440735191106796, -0.08180523663759232, 0.0647876188158989, 0.15759529173374176, -0.034509796649217606, -0.03398922085762024, 0.06393297761678696, -0.02296941541135311, 0.28013554215431213, 0.11273622512817383, -0.17534710466861725, 0.17803722620010376, -0.0162498839199543, 0.07931391894817352, 0.18170052766799927, 0.000005961212991678622, 0.0785776898264885, 0.10594866424798965, 0.004623723682016134, -0.05402066186070442, -0.020081624388694763, 0.24928434193134308, -0.11565465480089188, 0.02668306604027748, -0.050091903656721115, -0.06435636430978775, -0.06338923424482346, -0.044024508446455, -0.0034987556282430887, 0.07220550626516342, 0.031432583928108215, -0.029357867315411568, 0.07633110135793686, -0.11549879610538483, -0.21521390974521637, -0.04279107227921486, 0.07152983546257019, 0.016711503267288208, 0.11065702140331268, -0.15476010739803314, -0.11266003549098969, 0.03259110450744629, -0.1558905690908432, 0.0015710925217717886, 0.022967642173171043, -0.01440548337996006, 0.027007127180695534, -0.22435668110847473, -0.11612631380558014, 0.02594754472374916, 0.2163945436477661, -0.003970311488956213, 0.08813276886940002, -0.12497372925281525, -0.0636189803481102, 0.006786812096834183, 0.07900668680667877, -0.11912193149328232, -0.12242336571216583, -0.024312445893883705, 0.07512478530406952, -0.034331679344177246, -0.06572819501161575, -0.05642877519130707, -0.0948880985379219, -0.15807023644447327, 0.043041735887527466, -0.12987424433231354, -0.030937235802412033, 0.017093820497393608, 0.011890789493918419, 0.09639458358287811, 0.022565145045518875, -0.14632660150527954, -0.10566224157810211, 0.16297122836112976, 0.012693427503108978, -0.03657105192542076, 0.10786031186580658, -0.022971346974372864, -0.014141703955829144, -0.01921253465116024, -0.11133623123168945, -0.01078992709517479, 0.14219659566879272, 0.09736903011798859, -0.0629749596118927, 0.04652410373091698, -0.14783871173858643, 0.05776629224419594, 0.129278302192688, 0.00860007293522358, 0.10929262638092041, -0.1389065384864807, -0.07551305741071701, 0.10971798747777939, 0.011810997501015663, 0.05169545114040375, 0.10310272872447968, -0.034898869693279266, 0.1453486680984497, 0.21746480464935303, 0.10924195498228073, -0.012837182730436325, 0.1808633953332901, 0.07199609279632568, -0.09671250730752945, 0.02968626841902733, 0.19044730067253113, -0.0418257936835289, -0.11275725066661835, -0.09590110927820206, 0.005180764477699995, 0.05881085246801376, 0.042411088943481445, 0.10068107396364212, -0.10972317308187485, -0.02133162133395672, -0.17405900359153748, -0.13394252955913544, -0.13063152134418488, 0.02311510406434536, -0.03392094746232033, -0.10932260751724243, -0.03424083814024925, 0.03441571816802025, -0.018415460363030434, 0.06416592746973038, 0.03378607705235481, 0.03765294700860977, -0.041787199676036835, -0.2342119812965393, 0.11025480926036835, -0.15135632455348969, 0.09788907319307327, -0.1429925113916397, 0.060082703828811646, -0.13479115068912506, 0.043195854872465134, -0.2728250324726105, -0.1147417202591896, 0.0777217447757721, -0.09268000721931458, 0.027065152302384377, -0.04024017974734306, 0.1768537014722824, 0.16576099395751953, 0.06146242842078209, 0.07910504937171936, 0.01579759269952774, -0.05871227756142616, 0.02960474230349064, -0.21362464129924774, -0.016329152509570122, -0.006069230381399393, -0.21728678047657013, 0.1460874080657959, -0.13872265815734863, -0.07584872841835022, -0.12643983960151672, 0.04503408074378967, 0.12283823639154434, 0.06312831491231918, 0.062815360724926, -0.1301688551902771, 0.07289014011621475, -0.06001046299934387, -0.051808085292577744, 0.01941508799791336, -0.04009097442030907, -0.055642422288656235, -0.0735563114285469, -0.04600740596652031, 0.09075605124235153, 0.09291677922010422, -0.0688336193561554, -0.10020449757575989, 0.02872975915670395, -0.06009889021515846, 0.10272938758134842, -0.22960346937179565, -0.16186335682868958, 0.09150487929582596, -0.019057622179389, 0.02442905493080616, -0.02180640958249569, -0.09148826450109482, -0.19766506552696228, 0.15055730938911438, 0.0638742670416832, -0.20161402225494385, -0.16856244206428528, -0.012823511846363544, -0.1242930069565773, 0.002789972582831979, -0.13691440224647522, -0.09341984242200851, -0.14027990400791168, 0.054692383855581284, -0.025988111272454262, 0.1168733537197113, -0.10409451276063919, 0.11165475100278854, 0.09858700633049011, 0.11202558130025864, -0.11474054306745529, 0.08277570456266403, 0.07811518758535385, -0.05482201278209686, 0.1162927895784378, 0.020078372210264206, -0.17109492421150208, -0.20917348563671112, 0.09565874189138412, 0.22826355695724487, 0.0365416444838047, -0.008632520213723183, 0.07466104626655579, -0.09861575812101364, 0.006302341353148222, -0.07279567420482635, -0.032237276434898376, 0.10804536193609238, -0.07146286964416504, -0.06879047304391861, -0.025564471259713173, 0.19308757781982422, -0.09789309650659561, 0.1355355679988861, 0.012032188475131989, -0.011798636056482792, 0.3513341248035431, 0.1775442212820053, -0.13130907714366913, -0.008700854144990444, 0.04060148075222969, 0.020011665299534798, 0.09398893266916275, 0.08400134742259979, -0.12466072291135788, -0.17391903698444366, 0.23573952913284302, -0.002525114454329014, 0.0025360574945807457, 0.000042675888835219666, 0.07121340185403824, -0.05052149295806885, -0.014778497628867626, -0.11448779702186584, 0.006552124861627817, 0.11255469173192978, -0.05546564236283302, -0.031844791024923325, -0.12357436120510101, -0.16208401322364807, 0.024164294824004173, -0.0567280650138855, 0.07573579996824265, -0.09148840606212616, -0.030313383787870407, -0.05001300200819969, -0.14076392352581024, 0.09074690192937851, 0.04615643993020058, -0.12241978198289871, 0.1465885490179062, 0.06709977984428406, -0.07700732350349426, 0.15349845588207245, -0.020173020660877228, -0.02573067881166935, -0.02743145264685154, -0.03954090550541878, -0.006758717354387045, -0.12680819630622864, -0.03909435495734215, 0.034829381853342056, 0.1160832867026329, 0.04900342598557472, -0.016026537865400314, -0.017692165449261665, 0.0323951356112957, 0.07870769500732422, 0.059728845953941345, -0.0590486079454422, 0.029086513444781303, 0.14419536292552948, 0.18139274418354034, 0.056740351021289825, -0.2037510871887207, 0.02773391455411911, 0.09359043091535568, -0.01265781745314598, 0.02901998721063137, 0.10508330166339874, 0.004007103852927685, -0.02494816668331623, 0.04067071154713631, -0.09084701538085938, 0.19194743037223816, 0.05097685381770134, 0.0944046750664711, 0.21802927553653717, 0.04318028315901756, -0.077402263879776, -0.06726620346307755, 0.15385925769805908, -0.1983296126127243, -0.0606677271425724, -0.10640794038772583, -0.00201494712382555, -0.16613301634788513, 0.13438072800636292, 0.015330295078456402, -0.11946756392717361, 0.010728081688284874, -0.09049168229103088, -0.10536883026361465, -0.09951585531234741, 0.2554225027561188, 0.1014135330915451, -0.09427283704280853, 0.09553956240415573, -0.0365084744989872, -0.0006359211984090507, -0.02140103280544281, -0.06734420359134674, 0.016400884836912155, -0.08348703384399414, 0.056648850440979004, 0.009576170705258846, 0.08811608701944351, 0.06684751808643341, -0.05059576779603958, 0.004368594381958246, 0.0722271203994751, -0.11036045849323273, -0.15071529150009155, 0.044250279664993286, -0.06403890997171402, 0.2594161629676819, 0.03998694568872452, -0.04360472783446312, 0.06784103065729141, 0.027750220149755478, -0.023701701313257217, 0.14480774104595184, 0.08073849231004715, 0.10931695997714996, 0.04240036383271217, -0.1476784348487854, -0.06479200720787048, 0.05205880478024483, 0.038676925003528595, 0.027834143489599228, -0.02111235074698925, 0.09894005209207535, -0.08653872460126877, -0.18339523673057556, 0.19508269429206848, 0.05876331031322479, -0.052768684923648834, -0.13236486911773682, -0.04776328057050705, -0.045984216034412384, 0.17941443622112274, 0.09919305890798569, -0.054650042206048965, 0.1156594306230545, 0.012436136603355408, 0.2713773548603058, 0.01806715689599514, 0.1171337440609932, 0.05352432653307915, -0.20978733897209167, 0.05621841922402382, -0.17894583940505981, 0.1373230665922165, 0.1325143426656723, -0.01792401261627674, -0.06745809316635132, 0.030828673392534256, 0.11018183082342148, 0.11213712394237518, 0.00595484534278512, 0.07022935897111893, -0.00962111633270979, -0.024522915482521057, -0.032731667160987854, 0.08526404201984406, -0.04332289472222328, -0.0041653066873550415, 0.07980313897132874, 0.005052756052464247, -0.04189511761069298, 0.14276112616062164, 0.10333151370286942, -0.12561233341693878, -0.02742925100028515, -0.09655074030160904, -0.1284743845462799, -0.03196686878800392, -0.16348643600940704, 0.026484111323952675, 0.14213207364082336, 0.09671996533870697, 0.06313858181238174, 0.08419381082057953, -0.03923322632908821, 0.11132138967514038, 0.02803047001361847, 0.05985496565699577, 0.0037941427435725927, 0.04807369038462639, 0.12318193912506104, 0.23446398973464966, -0.12761270999908447, 0.38012394309043884, -0.06646135449409485, -0.16589854657649994, -0.06568706780672073, -0.1265076994895935, 0.043234389275312424, -0.05096546560525894, -0.04962378740310669, 0.03193545341491699, -0.013061543926596642, -0.015178927220404148, -0.05325302854180336, -0.009838069789111614, -0.04995110630989075, -0.15672342479228973, -0.1044827327132225, -0.1610114425420761, -0.13471557199954987, -0.07520238310098648, 0.04001222178339958, -0.02125363238155842, 0.07759852707386017, 0.03358963876962662, 0.0979161486029625, -0.289340078830719, -0.058314722031354904, -0.0317453034222126, 0.05450091511011124, 0.034368835389614105, 0.12204116582870483, 0.1907750964164734, -0.0635296031832695, -0.07444901019334793, 0.01339640561491251, 0.010806933976709843, 0.08043420314788818, 0.006079290993511677, 0.09308428317308426, 0.06494332104921341, -0.03114740364253521, 0.10275144129991531, 0.01028520055115223, -0.12148967385292053, -0.03833836689591408, 0.18421180546283722, 0.0877034068107605, 0.07108979672193527, -0.18040864169597626, -0.04293547570705414, 0.14589455723762512, -0.0052569773979485035, -0.09534803032875061, -0.2062223255634308, 0.07896535098552704, 0.12994475662708282, 0.019418038427829742, 0.05532793700695038, -0.0486808717250824, -0.09191570430994034, 0.14145508408546448, -0.015619807876646519, 0.19930855929851532, 0.017973879352211952, 0.07084471732378006, 0.1111714094877243, -0.02335324138402939, 0.056005384773015976, -0.03546837717294693, 0.0188252255320549, -0.1906425505876541, -0.0024165771901607513, 0.1369236707687378, -0.041912779211997986, -0.015071537345647812, 0.1246785894036293, 0.1446978896856308, -0.06221265345811844, 0.01220308430492878, 0.0741356834769249, 0.0035347614903002977, -0.15106059610843658, -0.05699232220649719, -0.04947315901517868, 0.06645552814006805, -0.016850663349032402, -0.007673484273254871, 0.029997389763593674, -0.07521817833185196, -0.06960932910442352, 0.1651502549648285, -0.11137568950653076, -0.030528074130415916, 0.1386103630065918, -0.0887007936835289, 0.04281888157129288, 0.03641680255532265, 0.1879540979862213, 0.018173815682530403, -0.07165588438510895, 0.05093793943524361, 0.289669394493103, -0.1559019386768341, 0.029480157420039177, 0.1487700641155243, 0.020783239975571632, -0.17616797983646393, 0.016837965697050095, 0.05472717434167862, -0.03321932256221771, 0.03458523750305176, 0.002749707782641053, 0.04295092821121216, 0.0015637485776096582, -0.07619846612215042, -0.03977744281291962, 0.1891857087612152, 0.03924126178026199, -0.10481585562229156, -0.044214215129613876, -2.707610765544216e-32, -0.02919165976345539, 0.08730348944664001, -0.062109287828207016, 0.073651023209095, 0.011186689138412476, 0.07740738242864609, 0.06922315061092377, -0.018077068030834198, -0.2092256247997284, -0.11176186054944992, -0.13505369424819946, 0.06403890997171402, 0.04619387164711952, -0.011096016503870487, -0.11373621225357056, -0.0679253414273262, -0.15199822187423706, -0.12796176970005035, -0.03892010822892189, 0.05399167910218239, 0.04695172607898712, -0.018981551751494408, -0.03176480904221535, -0.12369494885206223, 0.03061504103243351, -0.05359328165650368, 0.05966199189424515, -0.1853768527507782, 0.027715569362044334, -0.015141146257519722, -0.07601054012775421, -0.01007758267223835, -0.018748324364423752, 0.026049301028251648, 0.04800150543451309, 0.0489046536386013, -0.03307252377271652, -0.05036872997879982, -0.04586299508810043, 0.016797808930277824, 0.028378300368785858, 0.05347954109311104, 0.05097377672791481, -0.2718205153942108, -0.024379123002290726, -0.021334519609808922, 0.09095659106969833, -0.009695768356323242, -0.007287084124982357, -0.04360022768378258, 0.04998481646180153, 0.01357259601354599, 0.1236172541975975, -0.011341105215251446, -0.04025987535715103, -0.1152656227350235, -0.029822759330272675, 0.10580547899007797, -0.05010031908750534, -0.029082655906677246, -0.025462321937084198, -0.021948283538222313, -0.0898301973938942, -0.03898872435092926, 0.19445738196372986, -0.15555255115032196, 0.1965041607618332, 0.09502957761287689, 0.001030928222462535, -0.07290826737880707, 0.06040612608194351, 0.052410226315259933, -0.03820153698325157, -0.007202629465609789, -0.11326099187135696, -0.1404895931482315, -0.10984008014202118, -0.006650527007877827, 0.07253431528806686, -0.24255816638469696, -0.008092524483799934, -0.10177823156118393, 0.033904485404491425, 0.06336735188961029, 0.0389673076570034, 0.12616600096225739, -0.07624753564596176, -0.04898729547858238, -0.192212775349617, -0.12290246784687042, -0.06292051076889038, -0.016850950196385384, -0.07814937829971313, -0.024615682661533356, -0.0722280815243721, 0.07422859221696854, 0.010591423138976097, 0.07721412181854248, 0.013279261067509651, 0.10912667959928513, -0.14092837274074554, 0.08893565088510513, 0.20444810390472412, -0.02707059681415558, 0.06743781268596649, -0.06341486424207687, 0.1134195327758789, 0.008267708122730255, -0.15039125084877014, -0.05999554693698883, -0.03808866813778877, 0.11608083546161652, 0.08502206206321716, 0.033116817474365234, 0.12736549973487854, 0.08869229257106781, -0.03466386720538139, -0.18740469217300415, 0.1671663075685501, 0.07101531326770782, -0.2384798228740692, -0.052795711904764175, -0.07557471841573715, -0.06079920753836632, -0.10700134187936783, 0.21167662739753723, -0.2921246886253357, -0.10858918726444244, -0.0180430319160223, 0.04992000758647919, -0.02989758923649788, -0.07168034464120865, 7.881772603468562e-7, -0.1967620700597763, 0.06683527678251266, 0.046822238713502884, 0.06489317864179611, 0.004658258520066738, -0.01959020085632801, -0.27681422233581543, 0.028744302690029144, 0.04936961829662323, 0.03577407822012901, 0.21602559089660645, -0.02636364847421646, -0.05657301843166351, -0.09323866665363312, 0.08789326995611191, -0.09205590933561325, -0.05463387444615364, -0.1472158133983612, 0.05615071952342987, -0.03033287450671196, 0.0002616355486679822, 0.11112753301858902, -0.009294065646827221, -0.07080580294132233, -0.043974388390779495, -0.09118928015232086, 0.03660091012716293, -0.06965487450361252, 0.2189946174621582, -0.07456415891647339, -0.09104198217391968, 0.11767875403165817, -0.11167072504758835, 0.20394441485404968, 0.02102763205766678, -0.0219537653028965, -0.08978200703859329, -0.06600376218557358, -0.027784502133727074, 0.08864280581474304, 0.0956113338470459, 0.05167177692055702, 0.007761355955153704, -0.07196594774723053, 0.2269485592842102, 0.02466197870671749, -0.09763797372579575, -0.10032054036855698, -0.009610740467905998, 0.10490241646766663, -0.014980505220592022, 0.061744410544633865, 0.12372267246246338, 0.20585305988788605, 0.03630053997039795, -0.0879155620932579, 0.005214075092226267, -0.11200933158397675, 0.0758940577507019, -0.031070804223418236, -0.04428447410464287, -0.06525623798370361, 0.09878575056791306, -0.0306608397513628, 0.06304039061069489, -0.055967897176742554, 0.04629809781908989, 1.947611845852657e-34, -0.06091964244842529, -0.058736834675073624, 0.039395660161972046, -0.1990063488483429, -0.0438060499727726, 0.04773740470409393, 0.0504162423312664, -0.023845676332712173, 0.06621689349412918, -0.2368798553943634, 0.03835092857480049 ]
https://github.com/huggingface/datasets/issues/6188
[Feature Request] Check the length of batch before writing so that empty batch is allowed
I think this error means you filter all examples within an (input) batch by deleting its columns. In that case, to avoid the error, you can set the column value to an empty list (`input_batch["col"] = []`) instead.
### Use Case I use `dataset.map(process_fn, batched=True)` to process the dataset, with data **augmentations or filtering**. However, when all examples within a batch is filtered out, i.e. **an empty batch is returned**, the following error will be thrown: ``` ValueError: Schema and number of arrays unequal ``` This is because the empty batch does not comply with the schema of other batches. I think an empty batch should be allowed to facilitate coding (one does not need to assign an empty list manually for all keys.) A simple fix is to check the length of `batch` before writing: ``` if len(batch): writer.write_batch(batch) ``` instead of https://github.com/huggingface/datasets/blob/74d60213dcbd7c99484c62ce1d3dfd90a1df0770/src/datasets/arrow_dataset.py#L3493
38
[Feature Request] Check the length of batch before writing so that empty batch is allowed ### Use Case I use `dataset.map(process_fn, batched=True)` to process the dataset, with data **augmentations or filtering**. However, when all examples within a batch is filtered out, i.e. **an empty batch is returned**, the following error will be thrown: ``` ValueError: Schema and number of arrays unequal ``` This is because the empty batch does not comply with the schema of other batches. I think an empty batch should be allowed to facilitate coding (one does not need to assign an empty list manually for all keys.) A simple fix is to check the length of `batch` before writing: ``` if len(batch): writer.write_batch(batch) ``` instead of https://github.com/huggingface/datasets/blob/74d60213dcbd7c99484c62ce1d3dfd90a1df0770/src/datasets/arrow_dataset.py#L3493 I think this error means you filter all examples within an (input) batch by deleting its columns. In that case, to avoid the error, you can set the column value to an empty list (`input_batch["col"] = []`) instead.
[ -0.07217362523078918, 0.11693818867206573, 0.0038595441728830338, -0.05074900761246681, 0.22473828494548798, -0.042841993272304535, 0.15670226514339447, 0.08165215700864792, 0.05691296234726906, 0.22900515794754028, 0.13028036057949066, -0.06266945600509644, -0.1680527627468109, 0.12020069360733032, 0.13639326393604279, -0.02366737835109234, -0.0024280594661831856, -0.005112572107464075, -0.013387439772486687, 0.043009404093027115, -0.18018431961536407, 0.0016545789549127221, 0.05908365547657013, -0.07803168892860413, 0.057435739785432816, -0.17734210193157196, -0.13463228940963745, 0.08851070702075958, -0.05235239863395691, -0.15821902453899384, 0.04117434471845627, 0.14141157269477844, -0.015833523124456406, 0.1048683449625969, 0.000005044655154051725, 0.06343179196119308, 0.21502335369586945, -0.06754138320684433, -0.05751274526119232, -0.134969562292099, -0.004889675881713629, -0.14489354193210602, 0.12630346417427063, 0.06359543651342392, 0.012711677700281143, -0.003364571835845709, 0.08195069432258606, 0.056277401745319366, 0.02719045802950859, -0.014596126042306423, -0.01823347993195057, -0.0017266717040911317, 0.007239828817546368, -0.13217100501060486, 0.22755166888237, 0.17687663435935974, 0.13836099207401276, -0.114896260201931, -0.06015091389417648, -0.04076647013425827, -0.04396282136440277, 0.08068303018808365, 0.05152865871787071, -0.10343693941831589, 0.0841284841299057, -0.03687765449285507, -0.16137506067752838, -0.154343843460083, 0.028150279074907303, 0.10229089856147766, 0.10000873357057571, -0.046566788107156754, -0.0911741629242897, -0.07146334648132324, 0.10322275757789612, -0.2145862579345703, -0.08261272311210632, 0.025941111147403717, -0.022019343450665474, 0.024513859301805496, -0.03874611854553223, 0.064861960709095, -0.02222267910838127, -0.039525002241134644, -0.030127214267849922, 0.16169250011444092, -0.008199883624911308, -0.0037464085035026073, -0.021428177133202553, -0.021550802513957024, 0.200802743434906, -0.003295732894912362, -0.2061765491962433, 0.08350294828414917, -0.045041341334581375, -0.09992632269859314, -0.1595616340637207, -0.15098242461681366, 0.1670117974281311, -0.036008965224027634, 0.05013977736234665, 0.11465135216712952, 0.010181009769439697, 0.05407628044486046, 0.09818326681852341, -0.09689988195896149, 0.024036318063735962, 0.017770811915397644, 0.06490875780582428, 0.0031895579304546118, 0.21814601123332977, 0.09392789751291275, -0.04270711913704872, -0.09820347279310226, 0.14399105310440063, 0.07861427962779999, 0.04992196336388588, 0.17557860910892487, -0.08942510932683945, 0.13764238357543945, 0.058917563408613205, -0.019055021926760674, -0.09981252998113632, 0.15451152622699738, 0.07139452546834946, 0.004833404906094074, 0.03965325653553009, 0.03870048373937607, -0.036786217242479324, -0.0186720322817564, -0.11294735968112946, 0.11270558089017868, 0.08233059197664261, -0.17654500901699066, 0.11461684107780457, 0.15302518010139465, 0.10546399652957916, -0.012811009772121906, -0.024022020399570465, -0.14151863753795624, 0.027662986889481544, -0.06707750260829926, 0.16517096757888794, -0.014125894755125046, -0.051215317100286484, -0.08238238096237183, 0.03616254776716232, 0.057780735194683075, -0.15600436925888062, 0.23461316525936127, -0.045679476112127304, 0.01941455714404583, -0.2747330665588379, 0.11517583578824997, -0.07526679337024689, 0.07622445374727249, -0.1762639582157135, -0.0651697963476181, -0.29625943303108215, -0.012816060334444046, 0.17819809913635254, -0.07612951844930649, 0.03602718189358711, -0.19545291364192963, 0.05592075362801552, 0.19749224185943604, -0.09992751479148865, 0.0696442648768425, -0.08911169320344925, -0.05344507470726967, -0.05882938578724861, -0.024260621517896652, -0.01994737610220909, -0.17834173142910004, -0.05490316078066826, 0.18783988058567047, -0.017002888023853302, 0.02674098126590252, 0.0627427026629448, -0.018008887767791748, -0.0016378184081986547, 0.1451404094696045, 0.004642870277166367, 0.022864604368805885, 0.1923292875289917, 0.07260774821043015, -0.039628513157367706, -0.02561073563992977, -0.13533499836921692, -0.04494596645236015, -0.07908862829208374, 0.0474909283220768, 0.0036615487188100815, -0.12238913774490356, -0.0437537357211113, -0.1339234560728073, -0.042946841567754745, -0.25565531849861145, -0.01674543134868145, -0.11335069686174393, 0.05533086508512497, -0.005166779737919569, 0.16194336116313934, 0.01966879516839981, -0.037165310233831406, -0.14168664813041687, -0.32923948764801025, -0.10380668193101883, 0.02848537638783455, -0.10331157594919205, -0.052687179297208786, -0.0026759165339171886, 0.13774621486663818, -0.004515238106250763, -0.0875127837061882, -0.003837070195004344, 0.019308017566800117, -0.2595241069793701, 0.021840941160917282, 0.07778632640838623, 0.05093313008546829, 0.06831808388233185, -0.06952594220638275, 0.07739081978797913, 0.07623681426048279, -0.08540012687444687, 0.02997179515659809, 0.029459042474627495, 0.09493324905633926, 0.06333569437265396, -0.0018665341194719076, -0.07477109134197235, 0.15322159230709076, 0.11288657784461975, -0.10054877400398254, -0.09339098632335663, -0.07572006434202194, -0.06027640402317047, 0.003563568228855729, 0.06670669466257095, -0.15365014970302582, 0.041713666170835495, -0.10179650038480759, 0.018303627148270607, -0.17734238505363464, 0.1101737841963768, -0.0132905263453722, 0.08402327448129654, 0.031096920371055603, -0.1093834862112999, 0.08965598046779633, 0.2783413529396057, -0.1353386789560318, 0.01835532672703266, -0.05306118726730347, -0.09816447645425797, -0.018916916102170944, 0.04109878093004227, -0.026416638866066933, -0.13837583363056183, 0.20996204018592834, -0.07543139904737473, -0.12216538190841675, 0.14894498884677887, 0.2089104801416397, -0.13078932464122772, 0.1360589563846588, 0.033625081181526184, 0.016408506780862808, 0.28258082270622253, 0.041390325874090195, -0.14114724099636078, 0.009622870944440365, -0.023261724039912224, 0.07894396036863327, -0.19136258959770203, -0.03550579026341438, 0.12500299513339996, 0.028301892802119255, 0.20033171772956848, -0.04440319165587425, -0.07617195695638657, 0.11124659329652786, -0.1137867197394371, 0.13319464027881622, 0.02090516872704029, 0.040040530264377594, -0.09234095364809036, -0.012156916782259941, 0.1293233335018158, -0.014299646019935608, -0.12322242558002472, 0.12362077087163925, -0.0161660797894001, -0.003731534583494067, -0.048786211758852005, -0.21970540285110474, -0.0399349145591259, -0.04707374796271324, -0.13389582931995392, 0.03558899089694023, 0.06703659147024155, 0.22775286436080933, 0.06158449873328209, 0.06916914880275726, 0.03333740681409836, 0.2631787657737732, 0.19726605713367462, -0.18482890725135803, -0.1538567990064621, -0.09468073397874832, -0.055249083787202835, -0.20074611902236938, -0.014383139088749886, 0.22673679888248444, 0.11645717918872833, -0.043986283242702484, -0.1811872273683548, 0.13785222172737122, -0.09855419397354126, -0.06021953746676445, 0.03898265212774277, 0.11249767243862152, -0.024644147604703903, -0.04608168080449104, 0.16102054715156555, 0.016592934727668762, -0.19911079108715057, 0.01968689076602459, -0.14811904728412628, -0.06668411940336227, 0.09835849702358246, 0.05989895388484001, -0.07119034975767136, 0.01235876139253378, -0.2209804207086563, 0.03140423819422722, 0.052232518792152405, 0.039962541311979294, 0.1353960484266281, -0.08661197870969772, 0.09978954493999481, -0.13954080641269684, -0.028470223769545555, 0.18408150970935822, -0.046828754246234894, 0.12916652858257294, -0.12493538856506348, 0.05464682728052139, 0.004462308716028929, 0.014696122147142887, 0.18626251816749573, 0.046299129724502563, -0.07904310524463654, -0.07213867455720901, -0.14685802161693573, -0.23097379505634308, 0.04348956048488617, -0.22293786704540253, 0.03804853558540344, 0.08040255308151245, 0.11001791059970856, 0.04239991679787636, -0.034267276525497437, -0.037587981671094894, 0.009853779338300228, 0.057029951363801956, 0.16476589441299438, -0.05009068548679352, -0.14454954862594604, -0.02868189848959446, -0.2313242107629776, 0.014399049803614616, 0.05238746106624603, -0.1912233829498291, 0.015841564163565636, 0.09070970863103867, -0.05054040625691414, 0.1689484715461731, -0.016457267105579376, 0.11409508436918259, -0.30903080105781555, -0.060106683522462845, -0.0015729115111753345, 0.03984500467777252, -0.02493366412818432, -0.07128749042749405, -0.1909123659133911, -0.19197902083396912, 0.2290656566619873, -0.03492521494626999, -0.09745226800441742, -0.09404002875089645, -0.022899098694324493, 0.027406584471464157, -0.020738324150443077, 0.06366322189569473, -0.017820602282881737, -0.020823998376727104, -0.04762214794754982, 0.13369911909103394, 0.12366329878568649, -0.14618206024169922, -0.10394936054944992, 0.06938423961400986, 0.16174288094043732, -0.18160492181777954, 0.010210406966507435, 0.05169127136468887, -0.018882958218455315, -0.00844226498156786, 0.09536971896886826, -0.05434788763523102, 0.012683084234595299, 0.1667373925447464, -0.008138853125274181, -0.1105373427271843, 0.03314996883273125, 0.13542477786540985, -0.1072842925786972, -0.13437537848949432, 0.06463690102100372, 0.17147554457187653, 0.05942968651652336, -0.08380205929279327, -0.15454816818237305, -0.09672294557094574, 0.07716675847768784, 0.1823749840259552, 0.07474100589752197, 0.018238656222820282, 0.17705431580543518, 0.0621335543692112, -0.1609855741262436, 0.019333379343152046, 0.18427962064743042, 0.06757744401693344, -0.17430347204208374, -0.1248587816953659, -0.10268055647611618, -0.2371659278869629, 0.1590665727853775, 0.20908188819885254, -0.036280903965234756, 0.15198910236358643, -0.05269090458750725, -0.10611961036920547, -0.0437246710062027, -0.1167459785938263, 0.0333234965801239, -0.010762016288936138, -0.21630753576755524, -0.028748231008648872, -0.11240866035223007, 0.1322459578514099, 0.056771282106637955, 0.11810222268104553, -0.12308768182992935, -0.100504569709301, 0.20490700006484985, -0.014966776594519615, -0.04969382286071777, -0.024487854912877083, 0.054966580122709274, 0.04039151966571808, 0.08894404023885727, 0.15227851271629333, 0.045755766332149506, 0.07153701037168503, 0.11729330569505692, -0.07387735694646835, 0.10367376357316971, 0.005262386053800583, 0.10905633866786957, 0.06206953525543213, -0.0486128106713295, -0.047532420605421066, -0.009939315728843212, 0.11406539380550385, -0.06411835551261902, 0.17388662695884705, -0.19455058872699738, 0.01564343087375164, -0.015207990072667599, -0.040731362998485565, 0.19428715109825134, -0.1770368218421936, -0.07452422380447388, -0.12493649870157242, 0.139637753367424, -0.2679290771484375, -0.15075013041496277, 0.023888906463980675, -0.07843363285064697, -0.026878608390688896, -0.0383780300617218, 0.11922051012516022, 0.12089549750089645, -0.18409855663776398, -0.0028970972634851933, 0.08499898761510849, 0.14391988515853882, -0.042041514068841934, 0.18582181632518768, -0.019986633211374283, -0.1349276453256607, 0.13911773264408112, -0.09987498074769974, 0.12890033423900604, 0.07132989913225174, -0.0437874011695385, -0.003895408008247614, 0.08481714129447937, -0.042855050414800644, -0.03687984123826027, 0.030438698828220367, -0.22263844311237335, -0.04584460332989693, -0.082748182117939, -0.0066161793656647205, -0.03059392236173153, -0.07408961653709412, 0.07757188379764557, -0.05393499135971069, 0.03017258644104004, -0.19078747928142548, 0.07219424843788147, -0.13230974972248077, -0.006803326308727264, 0.192335844039917, -0.08500654250383377, 0.16419821977615356, -0.02249126322567463, 0.012287557125091553, -0.10414906591176987, 0.1046251729130745, 0.15095031261444092, -0.03198389708995819, 0.14949561655521393, 0.01880398578941822, 0.03465227037668228, -0.2550969421863556, -0.0891253799200058, 0.072611503303051, 0.10894399136304855, -0.022418998181819916, -0.03952145576477051, -0.1103912964463234, -0.016853509470820427, 0.07380033284425735, 0.08174112439155579, 0.014286460354924202, 0.14501939713954926, -0.18703363835811615, -0.1169581413269043, -2.56008093479144e-32, 0.015636397525668144, -0.1659766286611557, 0.07013839483261108, -0.051401879638433456, -0.10537900775671005, -0.017051519826054573, -0.1601065695285797, -0.1262878179550171, 0.0054808007553219795, -0.028469311073422432, -0.13662876188755035, 0.0824151337146759, 0.07397471368312836, 0.08882986009120941, -0.024553202092647552, -0.008090176619589329, 0.09877742826938629, 0.08466126024723053, 0.06557159870862961, 0.033679936081171036, 0.2420978844165802, -0.07772783935070038, -0.018482115119695663, 0.08640867471694946, 0.12826970219612122, -0.010589218698441982, -0.15339937806129456, -0.01707826927304268, -0.08807472139596939, -0.16853205859661102, -0.07310785353183746, 0.14081934094429016, 0.08270052075386047, 0.03879206255078316, -0.06595832854509354, -0.09701446443796158, 0.05197655037045479, -0.05637164041399956, -0.15412816405296326, -0.11218550056219101, -0.008039589039981365, -0.04685700312256813, -0.0005945935263298452, -0.04939856752753258, -0.042954180389642715, 0.03140375018119812, 0.013214370235800743, 0.0062225558795034885, 0.07252280414104462, -0.027640031650662422, 0.19333787262439728, 0.13020099699497223, 0.0052450792863965034, 0.06397531926631927, -0.056566618382930756, 0.03227246180176735, 0.24104563891887665, -0.0234081968665123, -0.12722563743591309, 0.08511032909154892, 0.20177492499351501, 0.03424223139882088, -0.003372505074366927, -0.016441859304904938, 0.03374693915247917, 0.05363650992512703, 0.07745281606912613, -0.04182547330856323, 0.2504167854785919, 0.16605056822299957, -0.021519988775253296, -0.07359497994184494, -0.04061209782958031, 0.05594928562641144, -0.09229623526334763, 0.03949325159192085, 0.02634512260556221, 0.056766994297504425, -0.19516444206237793, 0.0025971250142902136, -0.1815847009420395, 0.04144570231437683, 0.03254995122551918, -0.2146703600883484, 0.0813434049487114, -0.10040142387151718, -0.001532071502879262, 0.13452202081680298, -0.0057158758863806725, 0.0009259051294066012, -0.2188245952129364, 0.19134467840194702, 0.1078876182436943, -0.05002649873495102, -0.017427915707230568, 0.1435416042804718, -0.13548468053340912, 0.03695934638381004, -0.02837337739765644, -0.0749262347817421, 0.09101764857769012, -0.08705973625183105, 0.15589603781700134, 0.09160409867763519, 0.15716706216335297, 0.0981389656662941, 0.20639844238758087, 0.2041415423154831, -0.07332240045070648, -0.04932962357997894, -0.13816790282726288, 0.10348202288150787, 0.12708045542240143, 0.04139503836631775, -0.018128685653209686, -0.02000182494521141, 0.15256565809249878, 0.12491848319768906, 0.1044396460056305, 0.052902787923812866, -0.12536169588565826, -0.06692182272672653, 0.09630370885133743, -0.04969102144241333, -0.011639656499028206, 0.01708146557211876, 0.04458524286746979, -0.14896585047245026, 0.2732679843902588, -0.05344278737902641, -0.04809080809354782, -0.12044017761945724, 7.333379130614048e-7, -0.06593067198991776, -0.042945001274347305, 0.18038177490234375, 0.0007796194986440241, -0.15717704594135284, 0.3084462881088257, 0.06586604565382004, -0.00365029857493937, -0.31862500309944153, 0.13863612711429596, 0.12153632193803787, -0.0811692476272583, -0.028314044699072838, -0.12746180593967438, 0.010767503641545773, 0.06873278319835663, -0.2864641547203064, 0.10472088307142258, -0.07843015342950821, 0.0008487204322591424, -0.05443425476551056, -0.019483158364892006, 0.17184193432331085, -0.1856176108121872, 0.05866739898920059, 0.056025996804237366, -0.19529516994953156, 0.10251171141862869, 0.17022310197353363, 0.046331241726875305, -0.02025417797267437, -0.08257076889276505, 0.13112492859363556, 0.012794515118002892, -0.08478885143995285, -0.1465972661972046, -0.1682029664516449, 0.10743004828691483, 0.04105668142437935, 0.05862794816493988, 0.20177996158599854, 0.1053922027349472, -0.054854825139045715, -0.12055463343858719, 0.08707579970359802, 0.0834474042057991, -0.10807833820581436, -0.01961931400001049, 0.017891481518745422, 0.05358392745256424, -0.06374571472406387, 0.13133449852466583, -0.022471943870186806, 0.07008033990859985, -0.050496041774749756, -0.03768841177225113, -0.04660781845450401, -0.05048753693699837, -0.024908585473895073, -0.22442348301410675, -0.1027207225561142, -0.02652246691286564, -0.042740046977996826, -0.004716763272881508, -0.041307657957077026, -0.20094642043113708, 0.010850414633750916, 1.748996807629995e-34, 0.021624542772769928, 0.04426556080579758, 0.059494197368621826, -0.24439632892608643, 0.053577959537506104, -0.06019479036331177, 0.04779990762472153, 0.05671236291527748, -0.06933704763650894, -0.03539330139756203, -0.2787180542945862 ]
https://github.com/huggingface/datasets/issues/6187
Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory
Hi! You can load this dataset with: ```python data_files = { "train": "/content/PUBHEALTH/train.tsv", "validation": "/content/PUBHEALTH/dev.tsv", "test": "/content/PUBHEALTH/test.tsv", } tsv_datasets_reloaded = load_dataset("csv", data_files=data_files, sep="\t") ``` To support your `load_dataset` call, defining aliases for the packaged builders, as suggested in https://github.com/huggingface/datasets/issues/5625, must be implemented. We can consider adding this feature if more people request it. (Also answered on the Discord [here](https://discord.com/channels/879548962464493619/1145956791134470224/1146071491260186744))
### Describe the bug ``` --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) [<ipython-input-48-6a7b3e847019>](https://localhost:8080/#) in <cell line: 7>() 5 } 6 ----> 7 csv_datasets_reloaded = load_dataset("tsv", data_files=data_files) 8 csv_datasets_reloaded 2 frames [/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs) 1489 raise e1 from None 1490 if isinstance(e1, FileNotFoundError): -> 1491 raise FileNotFoundError( 1492 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. " 1493 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}" FileNotFoundError: Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory. Couldn't find 'tsv' on the Hugging Face Hub either: FileNotFoundError: Dataset 'tsv' doesn't exist on the Hub ``` ### Steps to reproduce the bug ``` data_files = { "train": "/content/PUBHEALTH/train.tsv", "validation": "/content/PUBHEALTH/dev.tsv", "test": "/content/PUBHEALTH/test.tsv", } tsv_datasets_reloaded = load_dataset("tsv", data_files=data_files) tsv_datasets_reloaded ``` ``` --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) <ipython-input-48-6a7b3e847019> in <cell line: 7>() 5 } 6 ----> 7 csv_datasets_reloaded = load_dataset("tsv", data_files=data_files) 8 csv_datasets_reloaded 2 frames /usr/local/lib/python3.10/dist-packages/datasets/load.py in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs) 1489 raise e1 from None 1490 if isinstance(e1, FileNotFoundError): -> 1491 raise FileNotFoundError( 1492 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. " 1493 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}" FileNotFoundError: Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory. Couldn't find 'tsv' on the Hugging Face Hub either: FileNotFoundError: Dataset 'tsv' doesn't exist on the Hub ``` ### Expected behavior load the data, push to hub ### Environment info jupyter notebook RTX 3090
59
Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory ### Describe the bug ``` --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) [<ipython-input-48-6a7b3e847019>](https://localhost:8080/#) in <cell line: 7>() 5 } 6 ----> 7 csv_datasets_reloaded = load_dataset("tsv", data_files=data_files) 8 csv_datasets_reloaded 2 frames [/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs) 1489 raise e1 from None 1490 if isinstance(e1, FileNotFoundError): -> 1491 raise FileNotFoundError( 1492 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. " 1493 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}" FileNotFoundError: Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory. Couldn't find 'tsv' on the Hugging Face Hub either: FileNotFoundError: Dataset 'tsv' doesn't exist on the Hub ``` ### Steps to reproduce the bug ``` data_files = { "train": "/content/PUBHEALTH/train.tsv", "validation": "/content/PUBHEALTH/dev.tsv", "test": "/content/PUBHEALTH/test.tsv", } tsv_datasets_reloaded = load_dataset("tsv", data_files=data_files) tsv_datasets_reloaded ``` ``` --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) <ipython-input-48-6a7b3e847019> in <cell line: 7>() 5 } 6 ----> 7 csv_datasets_reloaded = load_dataset("tsv", data_files=data_files) 8 csv_datasets_reloaded 2 frames /usr/local/lib/python3.10/dist-packages/datasets/load.py in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs) 1489 raise e1 from None 1490 if isinstance(e1, FileNotFoundError): -> 1491 raise FileNotFoundError( 1492 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. " 1493 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}" FileNotFoundError: Couldn't find a dataset script at /content/tsv/tsv.py or any data file in the same directory. Couldn't find 'tsv' on the Hugging Face Hub either: FileNotFoundError: Dataset 'tsv' doesn't exist on the Hub ``` ### Expected behavior load the data, push to hub ### Environment info jupyter notebook RTX 3090 Hi! You can load this dataset with: ```python data_files = { "train": "/content/PUBHEALTH/train.tsv", "validation": "/content/PUBHEALTH/dev.tsv", "test": "/content/PUBHEALTH/test.tsv", } tsv_datasets_reloaded = load_dataset("csv", data_files=data_files, sep="\t") ``` To support your `load_dataset` call, defining aliases for the packaged builders, as suggested in https://github.com/huggingface/datasets/issues/5625, must be implemented. We can consider adding this feature if more people request it. (Also answered on the Discord [here](https://discord.com/channels/879548962464493619/1145956791134470224/1146071491260186744))
[ 0.17273013293743134, -0.04136160388588905, -0.10267382860183716, -0.09851270169019699, 0.27253809571266174, 0.14139899611473083, 0.1211649477481842, 0.1326318085193634, 0.08502988517284393, 0.1532544642686844, -0.029091419652104378, 0.03400434926152229, -0.08465892821550369, -0.01129680871963501, 0.08872514963150024, -0.03114631213247776, -0.13480766117572784, -0.0750543624162674, -0.0010684942826628685, 0.02277730405330658, -0.018618552014231682, 0.09806656092405319, 0.1355515420436859, -0.08351576328277588, -0.16752281785011292, -0.04540413245558739, -0.07247049361467361, 0.1453385055065155, -0.014079352840781212, -0.0663759633898735, 0.14389196038246155, 0.004612758755683899, 0.15515680611133575, 0.31312692165374756, 0.000005264403171167942, 0.01119775976985693, 0.1710813343524933, -0.003301872406154871, 0.04622126743197441, -0.17105481028556824, -0.00401316350325942, 0.002405974082648754, 0.02046447992324829, -0.05467681959271431, 0.02877051942050457, -0.11452072858810425, -0.0023740921169519424, 0.0989326611161232, 0.011559885926544666, 0.18194542825222015, 0.06536515802145004, 0.1102185770869255, -0.06431300938129425, -0.17451819777488708, 0.1807125061750412, -0.06020653620362282, 0.035835787653923035, 0.09248394519090652, -0.22426745295524597, -0.11051055788993835, 0.004886390175670385, 0.012651714496314526, 0.008346565999090672, -0.02020176872611046, -0.07064191997051239, 0.05413519963622093, -0.1545354723930359, -0.10012609511613846, -0.12786920368671417, 0.3143767714500427, 0.10856842994689941, 0.10294583439826965, -0.13947317004203796, -0.05027700215578079, -0.01393792126327753, -0.04729225113987923, -0.0312027744948864, 0.0037658654619008303, -0.05578699707984924, 0.1716766357421875, -0.03933338448405266, 0.024556919932365417, 0.009110231883823872, 0.06025242060422897, -0.013079375959932804, -0.17779533565044403, -0.2561344802379608, 0.028628777712583542, -0.029643846675753593, -0.12439267337322235, 0.16946420073509216, -0.07297054678201675, 0.031108861789107323, -0.11902045458555222, 0.13110242784023285, -0.04315413534641266, 0.07641389966011047, -0.07290975004434586, -0.04773471876978874, 0.07231917977333069, -0.10241173952817917, -0.27644217014312744, -0.08213930577039719, 0.25648245215415955, 0.03053620085120201, 0.06578110158443451, -0.11385782808065414, 0.017809974029660225, 0.08641290664672852, 0.0873362123966217, -0.008106560446321964, 0.046178705990314484, -0.22810520231723785, -0.19886860251426697, 0.10372345894575119, 0.0851786658167839, 0.1633203625679016, 0.07318823784589767, -0.07738194614648819, 0.10875047743320465, -0.020114952698349953, 0.1470491588115692, -0.05738844722509384, 0.161849245429039, 0.06187354028224945, -0.0038937521167099476, 0.05836298316717148, 0.1369597613811493, -0.04612200707197189, 0.050992339849472046, -0.06993144750595093, 0.1948852688074112, -0.060002826154232025, -0.09894348680973053, 0.2045101821422577, -0.07388702034950256, -0.025414301082491875, -0.27224814891815186, -0.016761844977736473, 0.01299365982413292, -0.05466368421912193, -0.1998630315065384, -0.19965043663978577, -0.024930085986852646, 0.09930326789617538, 0.00822626892477274, 0.129608154296875, -0.09117936342954636, 0.05250944942235947, -0.016680531203746796, -0.2607031464576721, 0.011065772734582424, -0.1200181394815445, 0.06816508620977402, -0.09364572912454605, 0.0593150295317173, -0.08108745515346527, -0.11554331332445145, -0.14359606802463531, -0.08587267249822617, 0.011031834408640862, -0.056427694857120514, 0.10407337546348572, -0.06257300823926926, 0.15818926692008972, 0.19536615908145905, 0.021006247028708458, 0.04235592857003212, -0.0043997191824018955, 0.052320607006549835, 0.032804425805807114, 0.00044925996917299926, -0.045626137405633926, 0.1660308688879013, -0.18663164973258972, 0.12388752400875092, -0.14649327099323273, -0.018032439053058624, -0.12125524878501892, -0.04954926297068596, 0.09776249527931213, -0.00865553505718708, 0.07905855029821396, -0.11246060580015182, 0.002229483565315604, -0.028368333354592323, -0.06950870901346207, -0.07749174535274506, -0.04275588318705559, -0.1315249651670456, 0.06561676412820816, 0.03233727812767029, 0.08459927886724472, -0.06560996174812317, 0.1678430587053299, -0.2353038787841797, 0.021802764385938644, -0.10508674383163452, -0.015019296668469906, -0.23485936224460602, 0.05341208726167679, -0.04930546134710312, 0.012293010018765926, 0.006492126267403364, 0.033357180655002594, -0.019821390509605408, -0.08983740210533142, 0.15775606036186218, -0.0016531385481357574, -0.1896442174911499, -0.22798116505146027, 0.00521430280059576, -0.11660748720169067, -0.06421685218811035, 0.06182676553726196, 0.025803029537200928, -0.060267504304647446, 0.0168597474694252, -0.0668947622179985, 0.09586195647716522, -0.03827108442783356, 0.18879292905330658, 0.010274906642735004, 0.004726169165223837, -0.11850859224796295, 0.1814870685338974, 0.02442508190870285, -0.019958196207880974, 0.15426184237003326, 0.13800469040870667, -0.2855474352836609, -0.09511163830757141, 0.11252445727586746, 0.13360604643821716, -0.007446927484124899, 0.03386780247092247, 0.05671466141939163, -0.17909254133701324, -0.08640909940004349, 0.005039520561695099, -0.17803873121738434, 0.07841779291629791, -0.04025065526366234, 0.010514595545828342, -0.055408135056495667, -0.04764696955680847, -0.18180063366889954, 0.06106076017022133, -0.0975707620382309, -0.03847134858369827, 0.2776002287864685, -0.01097367238253355, -0.12476803362369537, 0.10628734529018402, 0.14935146272182465, 0.0728917196393013, -0.038452159613370895, 0.0960400253534317, -0.10069546103477478, -0.02397502399981022, 0.23061761260032654, 0.03564225882291794, -0.0392647422850132, 0.044582683593034744, 0.18156974017620087, -0.08376192301511765, 0.05200903117656708, -0.06716285645961761, -0.07097936421632767, 0.0727400928735733, -0.10839313268661499, -0.043084729462862015, -0.10642228275537491, -0.09158860146999359, -0.03800540417432785, -0.05526984483003616, 0.11388781666755676, 0.11941418796777725, -0.0331161729991436, 0.08233871310949326, -0.20389845967292786, -0.03987632319331169, 0.05223127081990242, -0.04110964015126228, -0.015223280526697636, 0.07692398130893707, -0.1458394080400467, -0.005652156192809343, 0.024026591330766678, 0.024948913604021072, 0.07020331174135208, 0.1042548194527626, 0.10644572973251343, -0.02141570672392845, -0.2079039067029953, 0.036271654069423676, 0.09294102340936661, -0.20575475692749023, 0.057482704520225525, 0.1112343817949295, -0.14029793441295624, 0.012490753084421158, 0.08757973462343216, -0.08595850318670273, 0.0894889160990715, 0.03605154529213905, 0.10512948036193848, 0.11021340638399124, -0.025551697239279747, -0.0576840378344059, 0.12397883832454681, -0.12104011327028275, -0.052347928285598755, 0.20262521505355835, 0.14660291373729706, 0.0062571931630373, 0.01805237866938114, -0.14256305992603302, 0.11021466553211212, 0.03340442106127739, -0.04876076802611351, 0.08924352377653122, 0.007960413582623005, 0.02888474427163601, -0.09479827433824539, 0.021277233958244324, -0.38418060541152954, -0.08476800471544266, -0.0851006954908371, -0.05723665654659271, -0.10161761939525604, 0.023531820625066757, -0.12487313896417618, -0.06418216228485107, 0.04272088408470154, -0.13553732633590698, 0.007344708312302828, -0.013524603098630905, 0.30346429347991943, 0.08396222442388535, -0.07272705435752869, 0.033940285444259644, -0.09709987789392471, -0.0987553596496582, 0.030931878834962845, -0.10051760822534561, -0.04360155388712883, -0.04612087085843086, -0.029894327744841576, -0.20296978950500488, 0.15582528710365295, 0.11608302593231201, 0.04097636044025421, -0.16292105615139008, -0.0005130876088514924, 0.2022247165441513, -0.17831014096736908, 0.050810594111680984, 0.004387096501886845, 0.0669892355799675, 0.16756334900856018, 0.09580038487911224, 0.09546619653701782, 0.02960001491010189, -0.14043927192687988, 0.2619287073612213, 0.043506525456905365, 0.18081887066364288, -0.09824750572443008, -0.059701722115278244, 0.02696661464869976, -0.027403241023421288, 0.021648485213518143, -0.017530672252178192, -0.011947317980229855, 0.20608432590961456, -0.1557571291923523, -0.01788286864757538, 0.11778084188699722, 0.00864032469689846, -0.02247312292456627, -0.12815114855766296, -0.02511202171444893, 0.11564632505178452, 0.07572585344314575, -0.08020702004432678, -0.04653197526931763, 0.08155157417058945, 0.11885201930999756, 0.16905876994132996, 0.18399275839328766, 0.005195036064833403, -0.03537992015480995, -0.07796088606119156, 0.06516606360673904, -0.16674773395061493, 0.1437939554452896, 0.11480508744716644, 0.002928069094195962, -0.0845554769039154, 0.023857710883021355, 0.18920490145683289, 0.07242023199796677, 0.0873449370265007, 0.04381028190255165, -0.07179518789052963, 0.006926863919943571, -0.08049523830413818, 0.0015123975463211536, -0.12053563445806503, -0.10526164621114731, 0.07722869515419006, 0.18473713099956512, -0.02443677932024002, 0.11420217901468277, 0.04634209722280502, 0.0040143318474292755, -0.15618711709976196, -0.03206754848361015, -0.2247386872768402, -0.14510557055473328, -0.13895849883556366, 0.12162051349878311, 0.1336652934551239, -0.04225018993020058, -0.07121910154819489, 0.11769865453243256, -0.07622051239013672, 0.11289709061384201, -0.09156593680381775, 0.03265976905822754, -0.07213129103183746, 0.06726782023906708, 0.14740312099456787, 0.09932269901037216, -0.026466460898518562, 0.3714771866798401, -0.15710562467575073, -0.1586410105228424, 0.08399248123168945, -0.19583503901958466, 0.02365768328309059, 0.21394473314285278, -0.11913461238145828, -0.0027259341441094875, -0.24464038014411926, -0.01942344196140766, 0.013500679284334183, 0.09306838363409042, 0.0244609322398901, -0.07694225758314133, -0.0072899628430604935, -0.08653131127357483, -0.2674655616283417, 0.004064354579895735, 0.1066802591085434, 0.1564311385154724, -0.07757371664047241, -0.03069091960787773, 0.06611368805170059, -0.16476397216320038, -0.0673513263463974, -0.0446527898311615, 0.08066947758197784, 0.24834829568862915, 0.09306703507900238, 0.1583598256111145, -0.18602007627487183, 0.08837926387786865, 0.13494440913200378, -0.08040639013051987, 0.04023182764649391, -0.11621971428394318, 0.07513817399740219, 0.08634202182292938, -0.05437006056308746, 0.11978905647993088, -0.10797708481550217, 0.06942542642354965, -0.027305150404572487, 0.1545562744140625, 0.021249020472168922, 0.06050800904631615, -0.05758785828948021, -0.04010298475623131, 0.04722004383802414, 0.09434078633785248, -0.10000965744256973, -0.0758928507566452, -0.1628485769033432, 0.0965643972158432, -0.014078548178076744, -0.01630157232284546, 0.011940301395952702, 0.16572648286819458, -0.06139013171195984, -0.05966229364275932, 0.1531457155942917, 0.08414699882268906, 0.03805813565850258, 0.11560148000717163, -0.03183303400874138, 0.05300741642713547, 0.030100297182798386, -0.05247028172016144, -0.23557992279529572, 0.07560088485479355, 0.0535685159265995, -0.03924858942627907, -0.2530251145362854, -0.028844444081187248, 0.00807963591068983, -0.08146874606609344, -0.04655681177973747, -0.05508030951023102, -0.03919385373592377, 0.003993010148406029, -0.02999972179532051, -0.10640274733304977, 0.063433937728405, -0.0038216933608055115, 0.03107992373406887, -0.01913471892476082, -0.013577114790678024, -0.014618082903325558, 0.07820809632539749, -0.14221125841140747, 0.13415038585662842, 0.1804792433977127, 0.012028644792735577, 0.018892191350460052, 0.2642376124858856, 0.1242116242647171, -0.12708128988742828, -0.07428887486457825, 0.17750929296016693, 0.21721681952476501, -0.2362956553697586, 0.11154425889253616, -0.033385008573532104, 0.055454738438129425, -0.07238784432411194, 0.05537055432796478, 0.12393749505281448, 0.06619173288345337, 0.14736370742321014, 0.02435637265443802, -0.009728839620947838, -0.088435597717762, -0.062415655702352524, -0.03529839962720871, 0.16825471818447113, 0.07285802811384201, -0.028629180043935776, -0.05855285003781319, -2.550457456414846e-32, -0.023885849863290787, 0.012135589495301247, -0.04233099892735481, 0.010353654623031616, -0.32110291719436646, 0.11209917813539505, -0.11165434867143631, 0.07580017298460007, -0.08424042910337448, -0.0907653272151947, -0.035355210304260254, 0.0239968691021204, -0.06585734337568283, -0.005421055946499109, 0.09444161504507065, 0.06807629019021988, -0.11807476729154587, -0.06300357729196548, -0.0015378377865999937, 0.029120078310370445, 0.05601618438959122, 0.08310580998659134, 0.16518521308898926, -0.05288374051451683, -0.14463768899440765, 0.08517871797084808, -0.15457475185394287, -0.011381879448890686, 0.11673261970281601, -0.059790708124637604, -0.028093963861465454, 0.07882025837898254, 0.13658490777015686, -0.14132288098335266, -0.016381949186325073, 0.08421588689088821, -0.07345796376466751, -0.175332173705101, -0.12321052700281143, 0.044721633195877075, -0.11175067722797394, 0.09718628972768784, 0.03967710956931114, -0.23977668583393097, 0.12381705641746521, 0.08719702064990997, 0.03274504467844963, -0.009713397361338139, 0.1353636085987091, -0.03559587150812149, 0.15405665338039398, 0.051355309784412384, -0.11123587191104889, 0.12626241147518158, 0.11409896612167358, -0.044269151985645294, -0.09460130333900452, 0.14320063591003418, -0.03246856480836868, 0.012228820472955704, -0.006528039462864399, -0.03845887631177902, -0.014821350574493408, -0.2053331732749939, 0.0975099503993988, 0.0405343696475029, 0.35005801916122437, -0.07528528571128845, 0.010696761310100555, -0.08280544728040695, 0.06469043344259262, 0.029625743627548218, -0.08479291945695877, -0.006205875426530838, -0.335219144821167, -0.020612334832549095, -0.29078209400177, 0.014042329974472523, 0.030359826982021332, -0.0900038406252861, 0.08029629290103912, -0.015017323195934296, -0.011353347450494766, 0.049360111355781555, -0.001354548498056829, 0.042882271111011505, -0.021438995376229286, -0.052391987293958664, -0.2259722501039505, 0.016357144340872765, 0.0526365302503109, 0.010165965184569359, -0.009592989459633827, -0.06162858009338379, -0.032972417771816254, 0.10500780493021011, -0.007500419858843088, 0.05217834562063217, 0.0488777831196785, -0.040832579135894775, -0.0737026184797287, -0.0063407463021576405, 0.03522384911775589, 0.13569167256355286, 0.1807684451341629, -0.06729114055633545, 0.06977047771215439, 0.01859215274453163, -0.13514520227909088, 0.007759298197925091, 0.05719814822077751, -0.00019519796478562057, 0.15500639379024506, 0.0879134014248848, 0.16555534303188324, -0.020721683278679848, -0.1017654687166214, -0.1468569040298462, 0.16335166990756989, 0.008662503212690353, -0.13776758313179016, -0.04627109318971634, -0.21164530515670776, 0.06629501283168793, 0.012684286572039127, 0.039279066026210785, -0.19734176993370056, -0.13230489194393158, 0.08516427129507065, 0.06786363571882248, -0.027657287195324898, -0.05851226672530174, 7.304772111638158e-7, -0.32179489731788635, 0.10603202134370804, 0.16273187100887299, -0.11185307055711746, -0.17389492690563202, 0.06226909160614014, -0.25507667660713196, 0.02520543523132801, -0.015132788568735123, 0.11590711027383804, 0.21497799456119537, -0.06923621147871017, -0.10290573537349701, -0.04230376332998276, 0.1716475635766983, -0.07091024518013, -0.11121653020381927, 0.07711388170719147, 0.05003436654806137, 0.07125255465507507, -0.054362718015909195, 0.10889597237110138, 0.20693734288215637, -0.03364576771855354, 0.02352840267121792, 0.012039095163345337, -0.10269598662853241, -0.041369013488292694, 0.11195547878742218, -0.0022486704401671886, -0.02033410407602787, 0.0024960662703961134, -0.15809623897075653, 0.14568911492824554, 0.002351360861212015, -0.05185837671160698, -0.15311689674854279, -0.19405852258205414, 0.028905114158988, 0.09943152964115143, -0.027974430471658707, 0.18058006465435028, -0.10152366757392883, -0.09737305343151093, 0.11499244719743729, 0.06824865192174911, -0.07658331841230392, 0.006335479207336903, -0.1263759285211563, 0.02706313692033291, 0.026012344285845757, 0.18850210309028625, 0.13422700762748718, 0.15021494030952454, -0.1006067618727684, 0.09976302832365036, -0.018511062487959862, -0.11878048628568649, 0.26031994819641113, 0.04823969304561615, -0.08234647661447525, -0.0430685319006443, -0.009275856427848339, -0.03150517866015434, 0.06700128316879272, 0.028243785724043846, -0.1226557195186615, 9.161180210850587e-35, 0.02738293819129467, -0.01905224844813347, 0.09269051998853683, -0.21264658868312836, -0.12393846362829208, 0.03382687270641327, 0.15830162167549133, -0.09680209308862686, 0.12441509962081909, -0.15517035126686096, -0.03924629092216492 ]
https://github.com/huggingface/datasets/issues/6186
Feature request: add code example of multi-GPU processing
That'd be a great idea! @mariosasko or @lhoestq, would it be possible to fix the code snippet or do you have another suggested way for doing this?
### Feature request Would be great to add a code example of how to do multi-GPU processing with πŸ€— Datasets in the documentation. cc @stevhliu Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box. Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel. Here's how I tried to do that: ``` from datasets import load_dataset from transformers import AutoModelForSeq2SeqLM, AutoTokenizer from multiprocess import set_start_method import torch import os dataset = load_dataset("mlfoundations/datacomp_small") tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M") model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M") # put model on each available GPU # also, should I do it like this or use nn.DataParallel? model.to("cuda:0") model.to("cuda:1") set_start_method("spawn") def translate_captions(batch, rank): os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count()) texts = batch["text"] inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device) translated_tokens = model.generate( **inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30 ) translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True) batch["translated_text"] = translated_texts return batch updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256) ``` I've personally tried running this script on a machine with 2 A100 GPUs. ## Error 1 Running the code snippet above from the terminal (python script.py) resulted in the following error: ``` Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main prepare(preparation_data) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare _fixup_main_from_path(data['init_main_from_path']) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path main_content = runpy.run_path(main_path, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path return _run_module_code(code, init_globals, run_name, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code _run_code(code, mod_globals, init_globals, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module> set_start_method("spawn") File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method raise RuntimeError('context has already been set') RuntimeError: context has already been set ``` ## Error 2 Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error: ``` File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp> k: dataset.map( File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool: File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__ self._repopulate_pool() File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool return self._repopulate_pool_static(self._ctx, self.Process, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static w.start() File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start self._popen = self._Popen(self) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen return Popen(process_obj) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch prep_data = spawn.get_preparation_data(process_obj._name) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data _check_not_importing_main() File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main raise RuntimeError(''' RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase. This probably means that you are not using fork to start your child processes and you have forgotten to use the proper idiom in the main module: if __name__ == '__main__': freeze_support() ... The "freeze_support()" line can be omitted if the program is not going to be frozen to produce an executable. ``` So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`): ``` Mon Aug 28 12:19:24 2023 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 | | N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 | | N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default | | | | Disabled | ``` Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch? ### Motivation Would be great to clarify how to do multi-GPU data processing. ### Your contribution If my code snippet can be fixed, I can contribute it to the docs :)
27
Feature request: add code example of multi-GPU processing ### Feature request Would be great to add a code example of how to do multi-GPU processing with πŸ€— Datasets in the documentation. cc @stevhliu Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box. Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel. Here's how I tried to do that: ``` from datasets import load_dataset from transformers import AutoModelForSeq2SeqLM, AutoTokenizer from multiprocess import set_start_method import torch import os dataset = load_dataset("mlfoundations/datacomp_small") tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M") model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M") # put model on each available GPU # also, should I do it like this or use nn.DataParallel? model.to("cuda:0") model.to("cuda:1") set_start_method("spawn") def translate_captions(batch, rank): os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count()) texts = batch["text"] inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device) translated_tokens = model.generate( **inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30 ) translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True) batch["translated_text"] = translated_texts return batch updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256) ``` I've personally tried running this script on a machine with 2 A100 GPUs. ## Error 1 Running the code snippet above from the terminal (python script.py) resulted in the following error: ``` Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main prepare(preparation_data) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare _fixup_main_from_path(data['init_main_from_path']) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path main_content = runpy.run_path(main_path, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path return _run_module_code(code, init_globals, run_name, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code _run_code(code, mod_globals, init_globals, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module> set_start_method("spawn") File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method raise RuntimeError('context has already been set') RuntimeError: context has already been set ``` ## Error 2 Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error: ``` File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp> k: dataset.map( File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool: File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__ self._repopulate_pool() File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool return self._repopulate_pool_static(self._ctx, self.Process, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static w.start() File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start self._popen = self._Popen(self) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen return Popen(process_obj) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch prep_data = spawn.get_preparation_data(process_obj._name) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data _check_not_importing_main() File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main raise RuntimeError(''' RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase. This probably means that you are not using fork to start your child processes and you have forgotten to use the proper idiom in the main module: if __name__ == '__main__': freeze_support() ... The "freeze_support()" line can be omitted if the program is not going to be frozen to produce an executable. ``` So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`): ``` Mon Aug 28 12:19:24 2023 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 | | N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 | | N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default | | | | Disabled | ``` Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch? ### Motivation Would be great to clarify how to do multi-GPU data processing. ### Your contribution If my code snippet can be fixed, I can contribute it to the docs :) That'd be a great idea! @mariosasko or @lhoestq, would it be possible to fix the code snippet or do you have another suggested way for doing this?
[ -0.056872863322496414, 0.15776322782039642, -0.05299297720193863, -0.0184006430208683, 0.04106145724654198, -0.012003333307802677, 0.361417680978775, -0.0336010605096817, -0.014910059981048107, 0.06040935218334198, -0.01882953755557537, 0.02176234871149063, -0.027905890718102455, 0.20349101722240448, 0.2041284292936325, -0.2704412341117859, -0.044995151460170746, -0.09901783615350723, 0.011203967034816742, -0.0305906031280756, -0.10625158995389938, 0.08497694134712219, 0.20798157155513763, -0.09709308296442032, -0.02819555625319481, -0.10742074996232986, -0.09506735950708389, 0.03528304025530815, 0.0977717936038971, -0.1734786033630371, -0.14028507471084595, 0.14000073075294495, 0.14112085103988647, 0.14626844227313995, 0.000005455185146274744, -0.08953976631164551, -0.0340871587395668, 0.04095841571688652, 0.028341472148895264, 0.06283081322908401, 0.17584547400474548, -0.13099008798599243, 0.023226944729685783, -0.059617072343826294, -0.07636930048465729, 0.0439000278711319, -0.005030700471252203, 0.07785642147064209, 0.17701292037963867, 0.04304637759923935, 0.05599536374211311, 0.0639282688498497, -0.14965438842773438, -0.14121055603027344, 0.0020373619627207518, -0.0228516086935997, -0.08164789527654648, 0.008424834348261356, 0.032226819545030594, -0.04050236940383911, -0.003978777676820755, 0.12007743865251541, 0.07717512547969818, -0.16980820894241333, 0.11330322921276093, 0.02581970952451229, -0.16590963304042816, -0.20276698470115662, -0.05747687444090843, 0.07002423703670502, -0.17520959675312042, -0.11868765950202942, -0.14395634829998016, -0.011260446161031723, 0.018856585025787354, -0.21678651869297028, -0.2115214616060257, 0.017629120498895645, -0.002937804441899061, 0.0569700226187706, 0.061297401785850525, -0.03808873891830444, 0.01850440539419651, -0.15922243893146515, -0.08412707597017288, 0.15928323566913605, 0.004648121539503336, 0.04295165464282036, -0.04681180417537689, -0.06089667230844498, 0.11467143893241882, -0.022335264831781387, 0.09698782116174698, -0.006510536186397076, -0.1969354748725891, -0.02170656807720661, -0.047027017921209335, -0.22160978615283966, 0.0955718383193016, -0.04714670404791832, 0.1772203892469406, 0.047599270939826965, -0.013074702583253384, 0.13179628551006317, -0.21116748452186584, -0.02315848506987095, -0.05742059275507927, -0.003573270747438073, -0.0029808857943862677, -0.01089669018983841, 0.07861722260713577, 0.007673320826143026, -0.10735131800174713, -0.15351158380508423, 0.056392569094896317, 0.005748783238232136, 0.04461207613348961, 0.23759090900421143, -0.10200633853673935, -0.06198934465646744, 0.17019164562225342, 0.13979847729206085, -0.16376931965351105, 0.14155888557434082, 0.10260914266109467, -0.03541247174143791, 0.010276935063302517, -0.06977339833974838, 0.011995228938758373, -0.13385945558547974, -0.08655909448862076, 0.12883880734443665, 0.026413196697831154, 0.04429375380277634, 0.12601763010025024, -0.004487955942749977, 0.10965763032436371, -0.1712961345911026, 0.19803404808044434, 0.056314777582883835, -0.01273362711071968, 0.11885890364646912, 0.015417485497891903, -0.10801716148853302, 0.03038668818771839, -0.025881515815854073, 0.25626131892204285, 0.21033793687820435, -0.13429687917232513, 0.1334526538848877, 0.09629766643047333, 0.17826098203659058, -0.21624542772769928, 0.08300752192735672, 0.048290595412254333, -0.025540396571159363, 0.030393056571483612, 0.1389463096857071, -0.20911334455013275, -0.0687309131026268, 0.1693067103624344, -0.05856524035334587, -0.08940418809652328, -0.056577879935503006, 0.14811475574970245, 0.17058800160884857, 0.02022939920425415, -0.03936001658439636, 0.014417191967368126, 0.09617159515619278, -0.013869711197912693, -0.045943137258291245, -0.11423931270837784, 0.019656294956803322, -0.09127749502658844, 0.2531740367412567, -0.09337249398231506, 0.08236028999090195, 0.08617903292179108, -0.035072583705186844, -0.039494846016168594, -0.18069127202033997, -0.01988116465508938, 0.0774199515581131, 0.24032452702522278, 0.10876781493425369, 0.08915874361991882, 0.35259363055229187, -0.0313553623855114, 0.014709961600601673, -0.04266946017742157, -0.043719056993722916, 0.031011292710900307, -0.041407205164432526, -0.035041388124227524, 0.10803905129432678, 0.03149496391415596, -0.14087459444999695, -0.002882118336856365, -0.2067466825246811, -0.08392755687236786, -0.10731469094753265, 0.08898036181926727, -0.04668476805090904, 0.06998002529144287, -0.014264266937971115, 0.009854065254330635, -0.04335100203752518, 0.022195514291524887, 0.05894218385219574, 0.15684926509857178, 0.004541380796581507, 0.05216925963759422, -0.05614238977432251, -0.12167827785015106, -0.18404020369052887, -0.027604782953858376, -0.07637996226549149, 0.004256372340023518, -0.05488550662994385, -0.020970575511455536, 0.06547277420759201, -0.05161425471305847, 0.07784034311771393, 0.06099051237106323, 0.08102251589298248, 0.039263784885406494, -0.015045850537717342, 0.07856613397598267, 0.1181374043226242, -0.011005456559360027, 0.021134130656719208, 0.11704976111650467, 0.08109007030725479, -0.13909912109375, -0.02086871676146984, -0.07986236363649368, -0.02439453825354576, 0.10450737178325653, -0.004384078551083803, -0.11188090592622757, -0.07539526373147964, -0.2325696349143982, -0.009538358077406883, -0.09404619038105011, 0.06803251057863235, 0.03964737430214882, 0.01401803083717823, -0.029539532959461212, 0.0043249777518212795, 0.1402491331100464, 0.20990288257598877, -0.09379240870475769, 0.07122010737657547, 0.010175048373639584, 0.06447429955005646, 0.09062328189611435, -0.0688013955950737, -0.09244253486394882, -0.07407542318105698, 0.1756761521100998, -0.03190509229898453, 0.014352994039654732, 0.044792551547288895, 0.144058495759964, 0.04440189525485039, 0.23482121527194977, -0.27899566292762756, -0.008577664382755756, 0.030110372230410576, -0.025214362889528275, 0.08161564916372299, 0.029503028839826584, -0.07239498198032379, -0.05466606095433235, -0.015334483236074448, 0.018410533666610718, 0.0192243829369545, 0.08043002337217331, 0.13574180006980896, -0.11802711337804794, -0.1064528375864029, 0.07032780349254608, -0.07405348867177963, 0.1207813173532486, 0.18330757319927216, -0.008707285858690739, -0.0971716120839119, -0.14624252915382385, -0.04725751280784607, 0.048005688935518265, -0.02877611480653286, 0.15212003886699677, -0.05371473729610443, 0.1124286949634552, 0.1307828277349472, -0.00023374233569484204, 0.2541534900665283, -0.05045919865369797, -0.015673233196139336, -0.06885872036218643, 0.009929857216775417, 0.09764762967824936, 0.05638932064175606, -0.08851113170385361, -0.13742128014564514, 0.12770862877368927, 0.1318054497241974, -0.06928203999996185, -0.1096101775765419, -0.054770149290561676, -0.06919695436954498, 0.017843997105956078, -0.10024267435073853, 0.10758433490991592, 0.0007913311128504574, -0.08804339170455933, -0.2006804198026657, 0.049835335463285446, 0.027223823592066765, 0.16573834419250488, -0.23478929698467255, 0.13707709312438965, -0.07640169560909271, -0.09780341386795044, -0.03997756168246269, -0.22425957024097443, -0.180988609790802, 0.1992999166250229, -0.15602169930934906, 0.015087086707353592, -0.11863420903682709, 0.03722544386982918, 0.1715419441461563, 0.09054891765117645, -0.03376966714859009, 0.11965174973011017, -0.039639607071876526, 0.058838553726673126, -0.10835134238004684, -0.07624293118715286, -0.0685519278049469, -0.08088630437850952, 0.20713846385478973, -0.059904053807258606, 0.008266863413155079, -0.008841486647725105, 0.005048439372330904, -0.0208280049264431, 0.01427103579044342, 0.1618843674659729, 0.09415286034345627, -0.03284221142530441, -0.09841902554035187, 0.01160601619631052, -0.12989027798175812, -0.12699735164642334, 0.09449412673711777, -0.34396421909332275, -0.10000479966402054, 0.09444458037614822, 0.19671717286109924, 0.1599005162715912, -0.024838021025061607, -0.2696225643157959, -0.01964336447417736, 0.1788027137517929, 0.04950286075472832, 0.10306153446435928, -0.16164910793304443, 0.08272142708301544, -0.05264851078391075, 0.015515855513513088, 0.0942482128739357, -0.059298258274793625, -0.07219944149255753, 0.08222631365060806, -0.10998599976301193, 0.11927326768636703, 0.07608558982610703, 0.09057004004716873, -0.1392965018749237, -0.008127580396831036, -0.07093265652656555, 0.09053927659988403, -0.024070361629128456, 0.0946221724152565, -0.026388179510831833, -0.04233706369996071, 0.16656537353992462, 0.011769698932766914, 0.03662276640534401, -0.0403834693133831, -0.16677787899971008, -0.04073452204465866, -0.048967596143484116, -0.06854145973920822, -0.10820851475000381, 0.02639506384730339, -0.028326258063316345, -0.08394939452409744, 0.10475171357393265, -0.006469163578003645, -0.18203429877758026, -0.052747633308172226, -0.17260709404945374, 0.024688847362995148, 0.0859822928905487, 0.10647350549697876, -0.06871522963047028, 0.08592737466096878, 0.07860108464956284, 0.09633146226406097, 0.006580663379281759, 0.16745993494987488, -0.12837883830070496, -0.049885284155607224, -0.12099268287420273, 0.16595923900604248, -0.037419576197862625, -0.19153042137622833, -0.0674113929271698, 0.20714803040027618, 0.04642963409423828, -0.004193809349089861, -0.025084668770432472, -0.06972061842679977, 0.1368200182914734, 0.025269951671361923, 0.0634157732129097, 0.013653844594955444, 0.12882159650325775, -0.08593370765447617, -0.034369535744190216, -0.033700473606586456, -0.10252007097005844, -0.058577217161655426, -0.12043603509664536, -0.19744393229484558, 0.06914838403463364, 0.06569694727659225, 0.17347899079322815, 0.3295368552207947, -0.03343149647116661, 0.11228712648153305, -0.02028346061706543, -0.17787525057792664, 0.008331285789608955, 0.08211134374141693, -0.0435321219265461, -0.11903783679008484, -0.14822427928447723, -0.23521289229393005, -0.032456375658512115, 0.07642325758934021, 0.03115205653011799, 0.20264442265033722, -0.10046941041946411, -0.14461708068847656, 0.0629110336303711, -0.00738138472661376, -0.04454883933067322, 0.0478421188890934, 0.008480053395032883, -0.10068240761756897, 0.06412342190742493, 0.2558058202266693, -0.16189788281917572, -0.03867911174893379, -0.004874774254858494, -0.07389029860496521, 0.08259333670139313, 0.025246966630220413, 0.10135412961244583, 0.1547611504793167, -0.245953768491745, 0.04133524373173714, 0.11455793678760529, -0.20457370579242706, 0.032091327011585236, 0.1684889942407608, 0.2035151720046997, -0.10629192739725113, -0.0959353819489479, -0.13311466574668884, 0.1547553688287735, -0.025273004546761513, -0.09576082974672318, -0.07287516444921494, 0.11637366563081741, -0.018384015187621117, -0.2598379850387573, 0.08267375081777573, -0.12129847705364227, 0.1665760725736618, -0.05313269421458244, -0.02205103635787964, 0.14597606658935547, -0.06908248364925385, -0.011731277219951153, -0.09191364049911499, -0.039048101752996445, -0.013992268592119217, -0.025787636637687683, -0.0034220218658447266, -0.10279327630996704, 0.006136853713542223, 0.055135298520326614, 0.07693158090114594, -0.06330712139606476, 0.15813113749027252, 0.10201961547136307, -0.019573871046304703, -0.29029008746147156, -0.049690503627061844, -0.08775606751441956, 0.001593599678017199, 0.06822212785482407, 0.1412273794412613, 0.02058456651866436, -0.10506974160671234, 0.020320504903793335, 0.13197855651378632, -0.18113651871681213, -0.06710115075111389, 0.008647920563817024, 0.011255147866904736, -0.12210793048143387, 0.0059521496295928955, 0.009677711874246597, -0.1246771365404129, -0.1541144698858261, 0.13622739911079407, 0.015622684732079506, -0.06324856728315353, -0.04606762155890465, 0.10944441705942154, -0.07700156420469284, -0.07812956720590591, -0.05725327506661415, 0.07537722587585449, -0.11175331473350525, -0.10773606598377228, 0.059749748557806015, -0.25476765632629395, -0.07216008007526398, -0.03996054455637932, -0.021983636543154716, -0.0444965660572052, -0.13704368472099304, 0.10718837380409241, 0.2856862246990204, 0.25925660133361816, -0.09957315772771835, 0.04644911736249924, -2.59419289923154e-32, -0.0570504255592823, -0.03486130014061928, 0.044683221727609634, -0.019965752959251404, 0.01928459294140339, -0.105024054646492, 0.06915406137704849, -0.2414340227842331, -0.015405026264488697, 0.07349036633968353, 0.0074774413369596004, -0.028087366372346878, 0.11987030506134033, 0.054319899529218674, -0.03027181327342987, 0.09110075980424881, 0.09380815178155899, 0.05427951738238335, -0.05835796147584915, 0.2615942060947418, 0.10626135766506195, 0.037878941744565964, 0.14990146458148956, 0.1044260710477829, -0.0004313176323194057, -0.0032663189340382814, -0.08399250358343124, -0.06988105922937393, -0.048817120492458344, 0.028080035001039505, -0.06877589225769043, 0.035629887133836746, -0.05345798283815384, -0.018425554037094116, -0.013930048793554306, 0.12562651932239532, -0.1086454764008522, -0.18239520490169525, -0.053714245557785034, 0.04156368598341942, -0.10451647639274597, -0.023294923827052116, -0.12023135274648666, 0.017009129747748375, 0.23447071015834808, 0.05905379354953766, -0.0022047217935323715, 0.1743016541004181, -0.02483512833714485, 0.03837496414780617, -0.12701010704040527, 0.1731482297182083, 0.048820625990629196, 0.24276994168758392, 0.13706231117248535, 0.10307493805885315, 0.1683202087879181, -0.06653730571269989, -0.24658650159835815, -0.014189379289746284, -0.0022156662307679653, 0.05941610410809517, 0.17765817046165466, -0.04787471145391464, 0.02901855856180191, 0.05471138283610344, 0.011140687391161919, 0.010235506109893322, 0.27698206901550293, 0.12094274908304214, -0.05743921548128128, 0.046310827136039734, 0.04850052669644356, -0.026568204164505005, -0.3543570041656494, -0.015420226380228996, -0.014784609898924828, -0.1360403448343277, -0.022625340148806572, -0.05903914198279381, 0.08128619194030762, 0.037727173417806625, 0.03075411729514599, -0.08008444309234619, 0.08681172877550125, 0.015170983970165253, 0.07249709963798523, 0.051415640860795975, -0.015916857868433, 0.055402737110853195, -0.17168672382831573, 0.14820601046085358, -0.020690172910690308, -0.04038599506020546, 0.046442531049251556, 0.005545356776565313, 0.06500466912984848, 0.11797281354665756, 0.02869262732565403, -0.12491139769554138, 0.2158789038658142, -0.19208069145679474, 0.008477240800857544, 0.053781040012836456, 0.24812979996204376, -0.012961672618985176, 0.13509167730808258, 0.1371060162782669, -0.38438764214515686, 0.04915614798665047, -0.08731774985790253, -0.0541401207447052, 0.03912445902824402, 0.06281918287277222, 0.027589064091444016, 0.03973814472556114, 0.0017565812449902296, -0.012861557304859161, 0.08661358058452606, 0.031451016664505005, -0.19973386824131012, 0.019146285951137543, -0.09129436314105988, 0.005508163012564182, -0.03969251736998558, 0.007181684486567974, -0.18070106208324432, 0.032658711075782776, 0.24238504469394684, -0.05099554732441902, -0.2521759867668152, 0.06690791249275208, 7.160124368965626e-7, -0.005307329352945089, 0.1423846334218979, 0.09329520910978317, 0.07418696582317352, -0.11923060566186905, 0.1456466168165207, -0.027244798839092255, -0.04303554445505142, 0.08760888129472733, 0.022113705053925514, -0.04910784587264061, -0.09710612893104553, -0.04205179214477539, -0.054541490972042084, -0.142107754945755, -0.11924251914024353, -0.09563847631216049, 0.057941269129514694, -0.20938748121261597, 0.0040280781686306, 0.022709546610713005, 0.24431760609149933, 0.20661808550357819, 0.00013440682960208505, 0.05682792887091637, -0.05923373997211456, -0.12195078283548355, -0.06118331849575043, 0.04537303000688553, 0.08371566236019135, 0.10526056587696075, 0.009920476004481316, -0.13553255796432495, 0.1239432618021965, -0.14266371726989746, -0.05005563050508499, -0.0989389419555664, 0.03718603774905205, -0.02871861681342125, 0.05546145513653755, -0.01765788532793522, -0.16960620880126953, -0.1133217066526413, -0.42299866676330566, -0.012384048663079739, 0.0811469778418541, -0.06082708388566971, -0.11938244849443436, 0.01640637032687664, 0.12824009358882904, 0.17057400941848755, -0.049290742725133896, 0.22706960141658783, 0.1741127073764801, 0.04166426137089729, 0.0939381867647171, -0.1818682998418808, 0.014609410427510738, -0.006684877444058657, -0.08669731020927429, -0.14068107306957245, -0.06390988826751709, -0.08011448383331299, -0.09482136368751526, 0.09505938738584518, -0.14282673597335815, 0.017365535721182823, 1.8995644326177574e-34, 0.08857906609773636, 0.02148650586605072, 0.13627618551254272, 0.039135854691267014, 0.09634567052125931, -0.13019123673439026, -0.05946020781993866, -0.008481987752020359, -0.056200284510850906, -0.0867108404636383, -0.23431919515132904 ]
https://github.com/huggingface/datasets/issues/6186
Feature request: add code example of multi-GPU processing
Indeed `if __name__ == "__main__"` is important in this case. Not sure about the imbalanced GPU usage though, but maybe you can try using the `torch.cuda.device` context manager ? > also, should I do it like this or use nn.DataParallel? In this case you wouldn't need a multiprocessed map no ? Since nn.DataParallel would take care of parallelism
### Feature request Would be great to add a code example of how to do multi-GPU processing with πŸ€— Datasets in the documentation. cc @stevhliu Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box. Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel. Here's how I tried to do that: ``` from datasets import load_dataset from transformers import AutoModelForSeq2SeqLM, AutoTokenizer from multiprocess import set_start_method import torch import os dataset = load_dataset("mlfoundations/datacomp_small") tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M") model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M") # put model on each available GPU # also, should I do it like this or use nn.DataParallel? model.to("cuda:0") model.to("cuda:1") set_start_method("spawn") def translate_captions(batch, rank): os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count()) texts = batch["text"] inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device) translated_tokens = model.generate( **inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30 ) translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True) batch["translated_text"] = translated_texts return batch updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256) ``` I've personally tried running this script on a machine with 2 A100 GPUs. ## Error 1 Running the code snippet above from the terminal (python script.py) resulted in the following error: ``` Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main prepare(preparation_data) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare _fixup_main_from_path(data['init_main_from_path']) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path main_content = runpy.run_path(main_path, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path return _run_module_code(code, init_globals, run_name, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code _run_code(code, mod_globals, init_globals, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module> set_start_method("spawn") File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method raise RuntimeError('context has already been set') RuntimeError: context has already been set ``` ## Error 2 Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error: ``` File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp> k: dataset.map( File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool: File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__ self._repopulate_pool() File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool return self._repopulate_pool_static(self._ctx, self.Process, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static w.start() File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start self._popen = self._Popen(self) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen return Popen(process_obj) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch prep_data = spawn.get_preparation_data(process_obj._name) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data _check_not_importing_main() File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main raise RuntimeError(''' RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase. This probably means that you are not using fork to start your child processes and you have forgotten to use the proper idiom in the main module: if __name__ == '__main__': freeze_support() ... The "freeze_support()" line can be omitted if the program is not going to be frozen to produce an executable. ``` So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`): ``` Mon Aug 28 12:19:24 2023 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 | | N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 | | N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default | | | | Disabled | ``` Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch? ### Motivation Would be great to clarify how to do multi-GPU data processing. ### Your contribution If my code snippet can be fixed, I can contribute it to the docs :)
58
Feature request: add code example of multi-GPU processing ### Feature request Would be great to add a code example of how to do multi-GPU processing with πŸ€— Datasets in the documentation. cc @stevhliu Currently the docs has a small [section](https://huggingface.co/docs/datasets/v2.3.2/en/process#map) on this saying "your big GPU call goes here", however it didn't work for me out-of-the-box. Let's say you have a PyTorch model that can do translation, and you have multiple GPUs. In that case, you'd like to duplicate the model on each GPU, each processing (translating) a chunk of the data in parallel. Here's how I tried to do that: ``` from datasets import load_dataset from transformers import AutoModelForSeq2SeqLM, AutoTokenizer from multiprocess import set_start_method import torch import os dataset = load_dataset("mlfoundations/datacomp_small") tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M") model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M") # put model on each available GPU # also, should I do it like this or use nn.DataParallel? model.to("cuda:0") model.to("cuda:1") set_start_method("spawn") def translate_captions(batch, rank): os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count()) texts = batch["text"] inputs = tokenizer(texts, padding=True, truncation=True, return_tensors="pt").to(model.device) translated_tokens = model.generate( **inputs, forced_bos_token_id=tokenizer.lang_code_to_id["eng_Latn"], max_length=30 ) translated_texts = tokenizer.batch_decode(translated_tokens, skip_special_tokens=True) batch["translated_text"] = translated_texts return batch updated_dataset = dataset.map(translate_captions, with_rank=True, num_proc=2, batched=True, batch_size=256) ``` I've personally tried running this script on a machine with 2 A100 GPUs. ## Error 1 Running the code snippet above from the terminal (python script.py) resulted in the following error: ``` Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 125, in _main prepare(preparation_data) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 236, in prepare _fixup_main_from_path(data['init_main_from_path']) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 287, in _fixup_main_from_path main_content = runpy.run_path(main_path, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 289, in run_path return _run_module_code(code, init_globals, run_name, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 96, in _run_module_code _run_code(code, mod_globals, init_globals, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/home/niels/python_projects/datacomp/datasets_multi_gpu.py", line 16, in <module> set_start_method("spawn") File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 247, in set_start_method raise RuntimeError('context has already been set') RuntimeError: context has already been set ``` ## Error 2 Then, based on [this Stackoverflow answer](https://stackoverflow.com/a/71616344/7762882), I put the `set_start_method("spawn")` section in a try: catch block. This resulted in the following error: ``` File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/dataset_dict.py", line 817, in <dictcomp> k: dataset.map( File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2926, in map with Pool(nb_of_missing_shards, initargs=initargs, initializer=initializer) as pool: File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 215, in __init__ self._repopulate_pool() File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 306, in _repopulate_pool return self._repopulate_pool_static(self._ctx, self.Process, File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/pool.py", line 329, in _repopulate_pool_static w.start() File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/process.py", line 121, in start self._popen = self._Popen(self) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/context.py", line 288, in _Popen return Popen(process_obj) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/popen_spawn_posix.py", line 42, in _launch prep_data = spawn.get_preparation_data(process_obj._name) File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 154, in get_preparation_data _check_not_importing_main() File "/home/niels/anaconda3/envs/datacomp/lib/python3.10/site-packages/multiprocess/spawn.py", line 134, in _check_not_importing_main raise RuntimeError(''' RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase. This probably means that you are not using fork to start your child processes and you have forgotten to use the proper idiom in the main module: if __name__ == '__main__': freeze_support() ... The "freeze_support()" line can be omitted if the program is not going to be frozen to produce an executable. ``` So then I put the last line under a `if __name__ == '__main__':` block. Then the code snippet seemed to work, but it seemed that it's only leveraging a single GPU (based on monitoring `nvidia-smi`): ``` Mon Aug 28 12:19:24 2023 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 NVIDIA A100-SXM... On | 00000000:01:00.0 Off | 0 | | N/A 55C P0 76W / 275W | 8747MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 1 NVIDIA A100-SXM... On | 00000000:47:00.0 Off | 0 | | N/A 67C P0 274W / 275W | 59835MiB / 81920MiB | 100% Default | | | | Disabled | ``` Both GPUs should have equal GPU usage, but I've always noticed that the last GPU has way more usage than the other ones. This made me think that `os.environ["CUDA_VISIBLE_DEVICES"] = str(rank % torch.cuda.device_count())` might not work inside a Python script, especially if done after importing PyTorch? ### Motivation Would be great to clarify how to do multi-GPU data processing. ### Your contribution If my code snippet can be fixed, I can contribute it to the docs :) Indeed `if __name__ == "__main__"` is important in this case. Not sure about the imbalanced GPU usage though, but maybe you can try using the `torch.cuda.device` context manager ? > also, should I do it like this or use nn.DataParallel? In this case you wouldn't need a multiprocessed map no ? Since nn.DataParallel would take care of parallelism
[ -0.056872863322496414, 0.15776322782039642, -0.05299297720193863, -0.0184006430208683, 0.04106145724654198, -0.012003333307802677, 0.361417680978775, -0.0336010605096817, -0.014910059981048107, 0.06040935218334198, -0.01882953755557537, 0.02176234871149063, -0.027905890718102455, 0.20349101722240448, 0.2041284292936325, -0.2704412341117859, -0.044995151460170746, -0.09901783615350723, 0.011203967034816742, -0.0305906031280756, -0.10625158995389938, 0.08497694134712219, 0.20798157155513763, -0.09709308296442032, -0.02819555625319481, -0.10742074996232986, -0.09506735950708389, 0.03528304025530815, 0.0977717936038971, -0.1734786033630371, -0.14028507471084595, 0.14000073075294495, 0.14112085103988647, 0.14626844227313995, 0.000005455185146274744, -0.08953976631164551, -0.0340871587395668, 0.04095841571688652, 0.028341472148895264, 0.06283081322908401, 0.17584547400474548, -0.13099008798599243, 0.023226944729685783, -0.059617072343826294, -0.07636930048465729, 0.0439000278711319, -0.005030700471252203, 0.07785642147064209, 0.17701292037963867, 0.04304637759923935, 0.05599536374211311, 0.0639282688498497, -0.14965438842773438, -0.14121055603027344, 0.0020373619627207518, -0.0228516086935997, -0.08164789527654648, 0.008424834348261356, 0.032226819545030594, -0.04050236940383911, -0.003978777676820755, 0.12007743865251541, 0.07717512547969818, -0.16980820894241333, 0.11330322921276093, 0.02581970952451229, -0.16590963304042816, -0.20276698470115662, -0.05747687444090843, 0.07002423703670502, -0.17520959675312042, -0.11868765950202942, -0.14395634829998016, -0.011260446161031723, 0.018856585025787354, -0.21678651869297028, -0.2115214616060257, 0.017629120498895645, -0.002937804441899061, 0.0569700226187706, 0.061297401785850525, -0.03808873891830444, 0.01850440539419651, -0.15922243893146515, -0.08412707597017288, 0.15928323566913605, 0.004648121539503336, 0.04295165464282036, -0.04681180417537689, -0.06089667230844498, 0.11467143893241882, -0.022335264831781387, 0.09698782116174698, -0.006510536186397076, -0.1969354748725891, -0.02170656807720661, -0.047027017921209335, -0.22160978615283966, 0.0955718383193016, -0.04714670404791832, 0.1772203892469406, 0.047599270939826965, -0.013074702583253384, 0.13179628551006317, -0.21116748452186584, -0.02315848506987095, -0.05742059275507927, -0.003573270747438073, -0.0029808857943862677, -0.01089669018983841, 0.07861722260713577, 0.007673320826143026, -0.10735131800174713, -0.15351158380508423, 0.056392569094896317, 0.005748783238232136, 0.04461207613348961, 0.23759090900421143, -0.10200633853673935, -0.06198934465646744, 0.17019164562225342, 0.13979847729206085, -0.16376931965351105, 0.14155888557434082, 0.10260914266109467, -0.03541247174143791, 0.010276935063302517, -0.06977339833974838, 0.011995228938758373, -0.13385945558547974, -0.08655909448862076, 0.12883880734443665, 0.026413196697831154, 0.04429375380277634, 0.12601763010025024, -0.004487955942749977, 0.10965763032436371, -0.1712961345911026, 0.19803404808044434, 0.056314777582883835, -0.01273362711071968, 0.11885890364646912, 0.015417485497891903, -0.10801716148853302, 0.03038668818771839, -0.025881515815854073, 0.25626131892204285, 0.21033793687820435, -0.13429687917232513, 0.1334526538848877, 0.09629766643047333, 0.17826098203659058, -0.21624542772769928, 0.08300752192735672, 0.048290595412254333, -0.025540396571159363, 0.030393056571483612, 0.1389463096857071, -0.20911334455013275, -0.0687309131026268, 0.1693067103624344, -0.05856524035334587, -0.08940418809652328, -0.056577879935503006, 0.14811475574970245, 0.17058800160884857, 0.02022939920425415, -0.03936001658439636, 0.014417191967368126, 0.09617159515619278, -0.013869711197912693, -0.045943137258291245, -0.11423931270837784, 0.019656294956803322, -0.09127749502658844, 0.2531740367412567, -0.09337249398231506, 0.08236028999090195, 0.08617903292179108, -0.035072583705186844, -0.039494846016168594, -0.18069127202033997, -0.01988116465508938, 0.0774199515581131, 0.24032452702522278, 0.10876781493425369, 0.08915874361991882, 0.35259363055229187, -0.0313553623855114, 0.014709961600601673, -0.04266946017742157, -0.043719056993722916, 0.031011292710900307, -0.041407205164432526, -0.035041388124227524, 0.10803905129432678, 0.03149496391415596, -0.14087459444999695, -0.002882118336856365, -0.2067466825246811, -0.08392755687236786, -0.10731469094753265, 0.08898036181926727, -0.04668476805090904, 0.06998002529144287, -0.014264266937971115, 0.009854065254330635, -0.04335100203752518, 0.022195514291524887, 0.05894218385219574, 0.15684926509857178, 0.004541380796581507, 0.05216925963759422, -0.05614238977432251, -0.12167827785015106, -0.18404020369052887, -0.027604782953858376, -0.07637996226549149, 0.004256372340023518, -0.05488550662994385, -0.020970575511455536, 0.06547277420759201, -0.05161425471305847, 0.07784034311771393, 0.06099051237106323, 0.08102251589298248, 0.039263784885406494, -0.015045850537717342, 0.07856613397598267, 0.1181374043226242, -0.011005456559360027, 0.021134130656719208, 0.11704976111650467, 0.08109007030725479, -0.13909912109375, -0.02086871676146984, -0.07986236363649368, -0.02439453825354576, 0.10450737178325653, -0.004384078551083803, -0.11188090592622757, -0.07539526373147964, -0.2325696349143982, -0.009538358077406883, -0.09404619038105011, 0.06803251057863235, 0.03964737430214882, 0.01401803083717823, -0.029539532959461212, 0.0043249777518212795, 0.1402491331100464, 0.20990288257598877, -0.09379240870475769, 0.07122010737657547, 0.010175048373639584, 0.06447429955005646, 0.09062328189611435, -0.0688013955950737, -0.09244253486394882, -0.07407542318105698, 0.1756761521100998, -0.03190509229898453, 0.014352994039654732, 0.044792551547288895, 0.144058495759964, 0.04440189525485039, 0.23482121527194977, -0.27899566292762756, -0.008577664382755756, 0.030110372230410576, -0.025214362889528275, 0.08161564916372299, 0.029503028839826584, -0.07239498198032379, -0.05466606095433235, -0.015334483236074448, 0.018410533666610718, 0.0192243829369545, 0.08043002337217331, 0.13574180006980896, -0.11802711337804794, -0.1064528375864029, 0.07032780349254608, -0.07405348867177963, 0.1207813173532486, 0.18330757319927216, -0.008707285858690739, -0.0971716120839119, -0.14624252915382385, -0.04725751280784607, 0.048005688935518265, -0.02877611480653286, 0.15212003886699677, -0.05371473729610443, 0.1124286949634552, 0.1307828277349472, -0.00023374233569484204, 0.2541534900665283, -0.05045919865369797, -0.015673233196139336, -0.06885872036218643, 0.009929857216775417, 0.09764762967824936, 0.05638932064175606, -0.08851113170385361, -0.13742128014564514, 0.12770862877368927, 0.1318054497241974, -0.06928203999996185, -0.1096101775765419, -0.054770149290561676, -0.06919695436954498, 0.017843997105956078, -0.10024267435073853, 0.10758433490991592, 0.0007913311128504574, -0.08804339170455933, -0.2006804198026657, 0.049835335463285446, 0.027223823592066765, 0.16573834419250488, -0.23478929698467255, 0.13707709312438965, -0.07640169560909271, -0.09780341386795044, -0.03997756168246269, -0.22425957024097443, -0.180988609790802, 0.1992999166250229, -0.15602169930934906, 0.015087086707353592, -0.11863420903682709, 0.03722544386982918, 0.1715419441461563, 0.09054891765117645, -0.03376966714859009, 0.11965174973011017, -0.039639607071876526, 0.058838553726673126, -0.10835134238004684, -0.07624293118715286, -0.0685519278049469, -0.08088630437850952, 0.20713846385478973, -0.059904053807258606, 0.008266863413155079, -0.008841486647725105, 0.005048439372330904, -0.0208280049264431, 0.01427103579044342, 0.1618843674659729, 0.09415286034345627, -0.03284221142530441, -0.09841902554035187, 0.01160601619631052, -0.12989027798175812, -0.12699735164642334, 0.09449412673711777, -0.34396421909332275, -0.10000479966402054, 0.09444458037614822, 0.19671717286109924, 0.1599005162715912, -0.024838021025061607, -0.2696225643157959, -0.01964336447417736, 0.1788027137517929, 0.04950286075472832, 0.10306153446435928, -0.16164910793304443, 0.08272142708301544, -0.05264851078391075, 0.015515855513513088, 0.0942482128739357, -0.059298258274793625, -0.07219944149255753, 0.08222631365060806, -0.10998599976301193, 0.11927326768636703, 0.07608558982610703, 0.09057004004716873, -0.1392965018749237, -0.008127580396831036, -0.07093265652656555, 0.09053927659988403, -0.024070361629128456, 0.0946221724152565, -0.026388179510831833, -0.04233706369996071, 0.16656537353992462, 0.011769698932766914, 0.03662276640534401, -0.0403834693133831, -0.16677787899971008, -0.04073452204465866, -0.048967596143484116, -0.06854145973920822, -0.10820851475000381, 0.02639506384730339, -0.028326258063316345, -0.08394939452409744, 0.10475171357393265, -0.006469163578003645, -0.18203429877758026, -0.052747633308172226, -0.17260709404945374, 0.024688847362995148, 0.0859822928905487, 0.10647350549697876, -0.06871522963047028, 0.08592737466096878, 0.07860108464956284, 0.09633146226406097, 0.006580663379281759, 0.16745993494987488, -0.12837883830070496, -0.049885284155607224, -0.12099268287420273, 0.16595923900604248, -0.037419576197862625, -0.19153042137622833, -0.0674113929271698, 0.20714803040027618, 0.04642963409423828, -0.004193809349089861, -0.025084668770432472, -0.06972061842679977, 0.1368200182914734, 0.025269951671361923, 0.0634157732129097, 0.013653844594955444, 0.12882159650325775, -0.08593370765447617, -0.034369535744190216, -0.033700473606586456, -0.10252007097005844, -0.058577217161655426, -0.12043603509664536, -0.19744393229484558, 0.06914838403463364, 0.06569694727659225, 0.17347899079322815, 0.3295368552207947, -0.03343149647116661, 0.11228712648153305, -0.02028346061706543, -0.17787525057792664, 0.008331285789608955, 0.08211134374141693, -0.0435321219265461, -0.11903783679008484, -0.14822427928447723, -0.23521289229393005, -0.032456375658512115, 0.07642325758934021, 0.03115205653011799, 0.20264442265033722, -0.10046941041946411, -0.14461708068847656, 0.0629110336303711, -0.00738138472661376, -0.04454883933067322, 0.0478421188890934, 0.008480053395032883, -0.10068240761756897, 0.06412342190742493, 0.2558058202266693, -0.16189788281917572, -0.03867911174893379, -0.004874774254858494, -0.07389029860496521, 0.08259333670139313, 0.025246966630220413, 0.10135412961244583, 0.1547611504793167, -0.245953768491745, 0.04133524373173714, 0.11455793678760529, -0.20457370579242706, 0.032091327011585236, 0.1684889942407608, 0.2035151720046997, -0.10629192739725113, -0.0959353819489479, -0.13311466574668884, 0.1547553688287735, -0.025273004546761513, -0.09576082974672318, -0.07287516444921494, 0.11637366563081741, -0.018384015187621117, -0.2598379850387573, 0.08267375081777573, -0.12129847705364227, 0.1665760725736618, -0.05313269421458244, -0.02205103635787964, 0.14597606658935547, -0.06908248364925385, -0.011731277219951153, -0.09191364049911499, -0.039048101752996445, -0.013992268592119217, -0.025787636637687683, -0.0034220218658447266, -0.10279327630996704, 0.006136853713542223, 0.055135298520326614, 0.07693158090114594, -0.06330712139606476, 0.15813113749027252, 0.10201961547136307, -0.019573871046304703, -0.29029008746147156, -0.049690503627061844, -0.08775606751441956, 0.001593599678017199, 0.06822212785482407, 0.1412273794412613, 0.02058456651866436, -0.10506974160671234, 0.020320504903793335, 0.13197855651378632, -0.18113651871681213, -0.06710115075111389, 0.008647920563817024, 0.011255147866904736, -0.12210793048143387, 0.0059521496295928955, 0.009677711874246597, -0.1246771365404129, -0.1541144698858261, 0.13622739911079407, 0.015622684732079506, -0.06324856728315353, -0.04606762155890465, 0.10944441705942154, -0.07700156420469284, -0.07812956720590591, -0.05725327506661415, 0.07537722587585449, -0.11175331473350525, -0.10773606598377228, 0.059749748557806015, -0.25476765632629395, -0.07216008007526398, -0.03996054455637932, -0.021983636543154716, -0.0444965660572052, -0.13704368472099304, 0.10718837380409241, 0.2856862246990204, 0.25925660133361816, -0.09957315772771835, 0.04644911736249924, -2.59419289923154e-32, -0.0570504255592823, -0.03486130014061928, 0.044683221727609634, -0.019965752959251404, 0.01928459294140339, -0.105024054646492, 0.06915406137704849, -0.2414340227842331, -0.015405026264488697, 0.07349036633968353, 0.0074774413369596004, -0.028087366372346878, 0.11987030506134033, 0.054319899529218674, -0.03027181327342987, 0.09110075980424881, 0.09380815178155899, 0.05427951738238335, -0.05835796147584915, 0.2615942060947418, 0.10626135766506195, 0.037878941744565964, 0.14990146458148956, 0.1044260710477829, -0.0004313176323194057, -0.0032663189340382814, -0.08399250358343124, -0.06988105922937393, -0.048817120492458344, 0.028080035001039505, -0.06877589225769043, 0.035629887133836746, -0.05345798283815384, -0.018425554037094116, -0.013930048793554306, 0.12562651932239532, -0.1086454764008522, -0.18239520490169525, -0.053714245557785034, 0.04156368598341942, -0.10451647639274597, -0.023294923827052116, -0.12023135274648666, 0.017009129747748375, 0.23447071015834808, 0.05905379354953766, -0.0022047217935323715, 0.1743016541004181, -0.02483512833714485, 0.03837496414780617, -0.12701010704040527, 0.1731482297182083, 0.048820625990629196, 0.24276994168758392, 0.13706231117248535, 0.10307493805885315, 0.1683202087879181, -0.06653730571269989, -0.24658650159835815, -0.014189379289746284, -0.0022156662307679653, 0.05941610410809517, 0.17765817046165466, -0.04787471145391464, 0.02901855856180191, 0.05471138283610344, 0.011140687391161919, 0.010235506109893322, 0.27698206901550293, 0.12094274908304214, -0.05743921548128128, 0.046310827136039734, 0.04850052669644356, -0.026568204164505005, -0.3543570041656494, -0.015420226380228996, -0.014784609898924828, -0.1360403448343277, -0.022625340148806572, -0.05903914198279381, 0.08128619194030762, 0.037727173417806625, 0.03075411729514599, -0.08008444309234619, 0.08681172877550125, 0.015170983970165253, 0.07249709963798523, 0.051415640860795975, -0.015916857868433, 0.055402737110853195, -0.17168672382831573, 0.14820601046085358, -0.020690172910690308, -0.04038599506020546, 0.046442531049251556, 0.005545356776565313, 0.06500466912984848, 0.11797281354665756, 0.02869262732565403, -0.12491139769554138, 0.2158789038658142, -0.19208069145679474, 0.008477240800857544, 0.053781040012836456, 0.24812979996204376, -0.012961672618985176, 0.13509167730808258, 0.1371060162782669, -0.38438764214515686, 0.04915614798665047, -0.08731774985790253, -0.0541401207447052, 0.03912445902824402, 0.06281918287277222, 0.027589064091444016, 0.03973814472556114, 0.0017565812449902296, -0.012861557304859161, 0.08661358058452606, 0.031451016664505005, -0.19973386824131012, 0.019146285951137543, -0.09129436314105988, 0.005508163012564182, -0.03969251736998558, 0.007181684486567974, -0.18070106208324432, 0.032658711075782776, 0.24238504469394684, -0.05099554732441902, -0.2521759867668152, 0.06690791249275208, 7.160124368965626e-7, -0.005307329352945089, 0.1423846334218979, 0.09329520910978317, 0.07418696582317352, -0.11923060566186905, 0.1456466168165207, -0.027244798839092255, -0.04303554445505142, 0.08760888129472733, 0.022113705053925514, -0.04910784587264061, -0.09710612893104553, -0.04205179214477539, -0.054541490972042084, -0.142107754945755, -0.11924251914024353, -0.09563847631216049, 0.057941269129514694, -0.20938748121261597, 0.0040280781686306, 0.022709546610713005, 0.24431760609149933, 0.20661808550357819, 0.00013440682960208505, 0.05682792887091637, -0.05923373997211456, -0.12195078283548355, -0.06118331849575043, 0.04537303000688553, 0.08371566236019135, 0.10526056587696075, 0.009920476004481316, -0.13553255796432495, 0.1239432618021965, -0.14266371726989746, -0.05005563050508499, -0.0989389419555664, 0.03718603774905205, -0.02871861681342125, 0.05546145513653755, -0.01765788532793522, -0.16960620880126953, -0.1133217066526413, -0.42299866676330566, -0.012384048663079739, 0.0811469778418541, -0.06082708388566971, -0.11938244849443436, 0.01640637032687664, 0.12824009358882904, 0.17057400941848755, -0.049290742725133896, 0.22706960141658783, 0.1741127073764801, 0.04166426137089729, 0.0939381867647171, -0.1818682998418808, 0.014609410427510738, -0.006684877444058657, -0.08669731020927429, -0.14068107306957245, -0.06390988826751709, -0.08011448383331299, -0.09482136368751526, 0.09505938738584518, -0.14282673597335815, 0.017365535721182823, 1.8995644326177574e-34, 0.08857906609773636, 0.02148650586605072, 0.13627618551254272, 0.039135854691267014, 0.09634567052125931, -0.13019123673439026, -0.05946020781993866, -0.008481987752020359, -0.056200284510850906, -0.0867108404636383, -0.23431919515132904 ]
https://github.com/huggingface/datasets/issues/6185
Error in saving the PIL image into *.arrow files using datasets.arrow_writer
You can cast the `input_image` column to the `Image` type to fix the issue: ```python ds.cast_column("input_image", datasets.Image()) ```
### Describe the bug I am using the ArrowWriter from datasets.arrow_writer to save a json-style file as arrow files. Within the dictionary, it contains a feature called "image" which is a list of PIL.Image objects. I am saving the json using the following script: ``` def save_to_arrow(path,temp): with ArrowWriter(path=path,writer_batch_size=20) as writer: writer.write_batch(temp) writer.finalize() ``` However, when I attempt to restore the dataset and use the ```Dataset.from_file(path)``` function to load the arrow file, there seems to be an issue with the PIL.Image object in the dataset. The list of PIL.Images appears as follows rather than a normal PIL.Image object: ![1693051705440](https://github.com/huggingface/datasets/assets/14247682/03b204c2-d0fa-4d19-beff-6f4d7b83c848) ### Steps to reproduce the bug 1. Storing the data json into arrow files: ``` def save_to_arrow(path,temp): with ArrowWriter(path=path,writer_batch_size=20) as writer: writer.write_batch(temp) writer.finalize() save_to_arrow( path, json_file ) ``` 2. try to load the arrow file into the Dataset object using the ```Dataset.from_file(path)``` ### Expected behavior Except to saving the contained "image" feature as a list PIL.Image objects as the arrow file. And I can restore the dataset from the file. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-5.4.0-150-generic-x86_64-with-glibc2.17 - Python version: 3.8.17 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 1.4.4
18
Error in saving the PIL image into *.arrow files using datasets.arrow_writer ### Describe the bug I am using the ArrowWriter from datasets.arrow_writer to save a json-style file as arrow files. Within the dictionary, it contains a feature called "image" which is a list of PIL.Image objects. I am saving the json using the following script: ``` def save_to_arrow(path,temp): with ArrowWriter(path=path,writer_batch_size=20) as writer: writer.write_batch(temp) writer.finalize() ``` However, when I attempt to restore the dataset and use the ```Dataset.from_file(path)``` function to load the arrow file, there seems to be an issue with the PIL.Image object in the dataset. The list of PIL.Images appears as follows rather than a normal PIL.Image object: ![1693051705440](https://github.com/huggingface/datasets/assets/14247682/03b204c2-d0fa-4d19-beff-6f4d7b83c848) ### Steps to reproduce the bug 1. Storing the data json into arrow files: ``` def save_to_arrow(path,temp): with ArrowWriter(path=path,writer_batch_size=20) as writer: writer.write_batch(temp) writer.finalize() save_to_arrow( path, json_file ) ``` 2. try to load the arrow file into the Dataset object using the ```Dataset.from_file(path)``` ### Expected behavior Except to saving the contained "image" feature as a list PIL.Image objects as the arrow file. And I can restore the dataset from the file. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-5.4.0-150-generic-x86_64-with-glibc2.17 - Python version: 3.8.17 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 1.4.4 You can cast the `input_image` column to the `Image` type to fix the issue: ```python ds.cast_column("input_image", datasets.Image()) ```
[ 0.034878842532634735, 0.03783104941248894, -0.040233295410871506, -0.022932911291718483, 0.14038220047950745, 0.010314122773706913, 0.17982855439186096, 0.032556235790252686, -0.10381855070590973, 0.012250297702848911, 0.021700048819184303, 0.005841587670147419, 0.0956873893737793, -0.06318464875221252, 0.016871418803930283, -0.17187777161598206, -0.06944499909877777, -0.04436161741614342, 0.026374487206339836, -0.0005699844914488494, -0.13132044672966003, 0.08137694001197815, 0.18568676710128784, 0.0027805815916508436, -0.09157118946313858, -0.20676785707473755, -0.08412037789821625, 0.14218643307685852, -0.1740673929452896, -0.16323943436145782, 0.07170502841472626, 0.031866077333688736, 0.0524633452296257, 0.14028052985668182, 0.0000053549283620668575, -0.02423112466931343, 0.14132530987262726, -0.00476711755618453, 0.06818161904811859, -0.19534240663051605, 0.06912403553724289, 0.035280607640743256, 0.032463669776916504, -0.05682261660695076, 0.10808872431516647, -0.17524513602256775, -0.049757421016693115, 0.11702349781990051, 0.03242359310388565, 0.02513529732823372, 0.01912526600062847, 0.0713820531964302, 0.16722041368484497, -0.05624552071094513, 0.15342968702316284, 0.04018144682049751, 0.10689260810613632, 0.04398903250694275, -0.26926520466804504, 0.011522427201271057, 0.03258199989795685, -0.020053813233971596, -0.052838969975709915, -0.047689102590084076, -0.1609131246805191, -0.016772516071796417, -0.05530618503689766, -0.1321329027414322, -0.00041569676250219345, 0.09069765359163284, -0.009023159742355347, -0.017195774242281914, -0.18662817776203156, -0.0040109227411448956, -0.002396922092884779, -0.11892250180244446, -0.001368813100270927, 0.24582748115062714, -0.13601379096508026, -0.06704993546009064, 0.03821057826280594, -0.006245471071451902, 0.027067290619015694, -0.011648323386907578, -0.05229191854596138, -0.14885474741458893, -0.15424002707004547, 0.028021441772580147, -0.015907399356365204, -0.16542719304561615, 0.09106112271547318, 0.1068192720413208, -0.02448708936572075, -0.23805513978004456, 0.14329460263252258, 0.008555954322218895, -0.05130153149366379, -0.12684142589569092, 0.007215922698378563, 0.01484184991568327, 0.05792149901390076, -0.3132403790950775, 0.010865189135074615, 0.08181220293045044, 0.09103552997112274, 0.09679029136896133, -0.015628332272171974, 0.06830580532550812, 0.0507577620446682, 0.07524801045656204, -0.12175402045249939, 0.0932149887084961, -0.012515038251876831, -0.007258678786456585, 0.13613061606884003, 0.028581181541085243, 0.20233961939811707, 0.19250023365020752, -0.0671137273311615, 0.07903330028057098, -0.008653244003653526, 0.013367311097681522, -0.010082777589559555, 0.09187401086091995, 0.15830041468143463, 0.07978551089763641, 0.1384793519973755, 0.16982445120811462, 0.024961216375231743, 0.11990242451429367, 0.06873477250337601, 0.18367744982242584, 0.1008867546916008, -0.1538383513689041, 0.05612646043300629, -0.07426785677671432, 0.05590910464525223, -0.2720448076725006, 0.07071653008460999, -0.01702425256371498, 0.06537962704896927, -0.08860965818166733, -0.007626199163496494, -0.023283500224351883, 0.11941317468881607, 0.014382917433977127, 0.02645849622786045, -0.10846593976020813, 0.0025670593604445457, 0.0875319167971611, -0.14599040150642395, 0.12271948903799057, -0.21453842520713806, -0.11772637814283371, -0.0018185855587944388, 0.04097194969654083, -0.16826286911964417, -0.2652316391468048, -0.15179866552352905, -0.13225573301315308, 0.12646497786045074, 0.03266800940036774, -0.0399714857339859, -0.24590647220611572, 0.04311380907893181, -0.063238725066185, 0.04709412902593613, -0.0020116381347179413, -0.0852484181523323, -0.015313194133341312, 0.21918585896492004, 0.07959634065628052, 0.07944415509700775, -0.03469083085656166, 0.0422174371778965, 0.16199833154678345, -0.07922033220529556, 0.06219571456313133, -0.22739678621292114, -0.08745390921831131, -0.01513742096722126, -0.08708248287439346, 0.0021495132241398096, -0.1614733785390854, 0.03214547410607338, 0.013315056450664997, -0.15082485973834991, -0.04327152296900749, -0.020481374114751816, -0.0290752612054348, -0.08773992955684662, 0.0312440674751997, -0.028152475133538246, -0.2894478738307953, -0.028773952275514603, -0.10865127295255661, -0.1744212955236435, -0.19621823728084564, -0.08757073432207108, -0.11123353242874146, 0.049991343170404434, -0.0017827923875302076, -0.04663509503006935, -0.047555193305015564, -0.061555683612823486, 0.15072686970233917, -0.2574146091938019, -0.04159467667341232, -0.20453083515167236, -0.07047277688980103, -0.2367020547389984, 0.1204647645354271, -0.017511161044239998, 0.19358956813812256, -0.05920591577887535, -0.07205726951360703, -0.031100958585739136, 0.043226610869169235, -0.11601808667182922, 0.11359026283025742, -0.03877350687980652, 0.018312597647309303, 0.05333855375647545, 0.003403358394280076, -0.1459151655435562, 0.07798406481742859, 0.00021957734134048223, -0.12129004299640656, 0.0299434382468462, 0.028218789026141167, -0.2030181884765625, -0.04445226117968559, 0.06693225353956223, 0.03352736309170723, -0.019190311431884766, -0.06444897502660751, -0.07251204550266266, -0.2124255746603012, -0.003934852778911591, -0.1748395711183548, -0.1273823082447052, 0.07249914109706879, -0.004138538148254156, -0.0021287319250404835, 0.06849506497383118, 0.10184357315301895, -0.19359861314296722, 0.10943202674388885, -0.02065104804933071, 0.011049499735236168, 0.18129055202007294, -0.026033062487840652, -0.16624046862125397, -0.07135623693466187, -0.06940199434757233, -0.08215024322271347, -0.001275189802981913, 0.0012997613521292806, -0.1051776185631752, -0.07751307636499405, 0.27911317348480225, 0.03510699048638344, -0.02763967216014862, 0.09825320541858673, 0.22419282793998718, -0.04399634897708893, 0.07193426042795181, 0.008976556360721588, -0.06279928237199783, 0.11962632834911346, -0.14668424427509308, -0.06022155284881592, -0.044352952390909195, -0.013538532890379429, 0.11221190541982651, -0.028980141505599022, 0.10378839075565338, 0.05577079579234123, 0.0834328681230545, 0.11468759924173355, -0.25729891657829285, 0.11364109814167023, 0.06878392398357391, -0.15179947018623352, 0.04995100200176239, 0.15297532081604004, -0.11512559652328491, -0.06704933941364288, 0.008709658868610859, 0.10230707377195358, -0.06992918998003006, 0.01658681407570839, 0.12237843126058578, -0.0260529275983572, -0.07154403626918793, -0.15145432949066162, 0.025222329422831535, -0.10304652154445648, 0.04709992557764053, -0.11317513883113861, -0.19178998470306396, -0.01735621690750122, 0.11821504682302475, -0.09221401065587997, -0.01906771771609783, 0.062298309057950974, 0.2428571879863739, 0.15622523427009583, 0.07872845977544785, -0.22526128590106964, 0.03631320968270302, -0.09663739055395126, 0.03097308985888958, 0.12318677455186844, 0.09323284029960632, 0.05425525829195976, -0.09517283737659454, -0.1143910214304924, 0.1299012303352356, -0.028824657201766968, -0.08001203835010529, 0.11455143243074417, -0.07081209123134613, 0.018237054347991943, 0.05745730549097061, 0.1662467122077942, -0.18012796342372894, -0.17732733488082886, 0.16685453057289124, 0.10361479222774506, 0.05260683223605156, 0.07287850975990295, 0.08901242911815643, -0.14155413210391998, 0.01742009073495865, -0.04745176434516907, 0.039510034024715424, 0.04948752000927925, 0.1496211290359497, -0.03439125791192055, -0.04152054712176323, -0.010395057499408722, -0.06307394802570343, 0.09779905527830124, 0.27316758036613464, -0.1307690292596817, -0.03231632336974144, -0.02344527654349804, 0.06001628190279007, -0.14620940387248993, 0.03957376256585121, 0.04239095002412796, 0.04208710789680481, -0.17855408787727356, -0.15407665073871613, -0.08506909012794495, -0.08553875237703323, -0.06747541576623917, 0.00011349962733220309, -0.05788016691803932, 0.26696979999542236, 0.07235115766525269, 0.1327238827943802, -0.008123326115310192, -0.034432943910360336, 0.20846480131149292, -0.005242843180894852, 0.00797446258366108, -0.34680309891700745, -0.1615745723247528, -0.036027692258358, -0.0785055011510849, -0.06349853426218033, -0.06328120827674866, -0.09522587805986404, 0.004597284831106663, -0.06790072470903397, -0.016909046098589897, 0.05923094600439072, -0.03753890097141266, 0.04034845530986786, -0.030857646837830544, -0.021177032962441444, 0.12803053855895996, 0.1867794245481491, -0.014427939429879189, -0.08411184698343277, 0.05944686010479927, -0.14104557037353516, 0.13079433143138885, 0.11394435167312622, -0.04590907320380211, -0.13616427779197693, -0.16225270926952362, -0.016708578914403915, -0.0669708102941513, 0.2300635278224945, 0.18936079740524292, 0.06335308402776718, 0.005994249135255814, 0.08767878264188766, 0.11686138808727264, 0.05174803361296654, 0.09869781136512756, 0.15153656899929047, -0.00732964463531971, -0.10087589174509048, -0.07613737136125565, 0.1163155734539032, -0.018992451950907707, -0.06360388547182083, 0.14861883223056793, -0.04846649989485741, 0.006737590301781893, 0.060172658413648605, -0.05891744792461395, 0.027499334886670113, 0.044344812631607056, -0.10199930518865585, -0.2496638298034668, -0.27586355805397034, -0.06843248009681702, 0.14471566677093506, 0.2055174857378006, -0.08296757936477661, -0.07553732395172119, 0.09749941527843475, -0.08357976377010345, 0.09370187669992447, -0.15579012036323547, 0.16170261800289154, -0.0958748310804367, 0.09101434797048569, -0.024008341133594513, 0.03107467107474804, 0.0201653353869915, 0.3072942793369293, -0.12267440557479858, -0.08409558236598969, -0.07143937051296234, -0.15629911422729492, -0.15377968549728394, 0.0897686555981636, -0.2801735997200012, 0.006815691012889147, -0.06700771301984787, -0.033116940408945084, -0.03122873790562153, 0.10239380598068237, 0.09040074050426483, -0.18925026059150696, -0.04878779128193855, -0.10042955726385117, -0.20544025301933289, 0.18345388770103455, 0.025626717135310173, 0.21906985342502594, 0.00022024218924343586, 0.04932527244091034, 0.27794596552848816, 0.2590235471725464, -0.0598217248916626, -0.10810472816228867, 0.14087826013565063, 0.26593437790870667, -0.09009645134210587, 0.29764607548713684, 0.07545018941164017, -0.038833312690258026, 0.08038239181041718, -0.016833558678627014, 0.047079749405384064, -0.04083414375782013, 0.03109501302242279, 0.1133250743150711, -0.16445109248161316, -0.003449134761467576, -0.06437709927558899, -0.2150050699710846, 0.002428653882816434, 0.11788845807313919, -0.07388415187597275, 0.0335969403386116, -0.062023334205150604, 0.04954887554049492, 0.08924363553524017, -0.06428883224725723, -0.032695092260837555, -0.08514449745416641, -0.1442427784204483, -0.08220601081848145, -0.03930218145251274, 0.06328321248292923, -0.16717635095119476, 0.20278300344944, -0.026646452024579048, 0.043036557734012604, -0.000510820304043591, 0.04911614954471588, 0.06218884885311127, -0.1124112606048584, 0.0364614762365818, -0.12567181885242462, 0.018213506788015366, -0.06202132627367973, -0.07422960549592972, 0.006200744304805994, 0.11088384687900543, -0.0607415996491909, 0.024871086701750755, -0.14773407578468323, -0.07131708413362503, -0.13273926079273224, 0.025141296908259392, 0.023836860433220863, 0.030016515403985977, -0.07437668740749359, 0.016697080805897713, 0.07364340126514435, -0.0967346578836441, 0.1008857861161232, -0.13724160194396973, 0.12210874259471893, 0.013647377490997314, -0.047542307525873184, -0.023588404059410095, -0.09599563479423523, -0.014726407825946808, 0.014601943083107471, 0.11891377717256546, 0.03714562579989433, 0.195037841796875, 0.15399855375289917, -0.07330980151891708, -0.0668567568063736, 0.029027018696069717, 0.17032070457935333, -0.1077677458524704, 0.23976804316043854, -0.08449355512857437, -0.12528647482395172, -0.23452413082122803, -0.03185903653502464, 0.06544239819049835, 0.27679556608200073, 0.19520346820354462, 0.02381410263478756, -0.16995178163051605, 0.008066828362643719, -0.03898483142256737, -0.03542596474289894, 0.08970942348241806, 0.05680297687649727, 0.07081843912601471, 0.008554327301681042, -2.2580483877336047e-32, -0.050763096660375595, 0.016763195395469666, -0.009415396489202976, 0.05017692595720291, -0.1903986781835556, 0.18366461992263794, -0.0171593576669693, 0.07669635117053986, -0.01012411154806614, -0.023194117471575737, 0.04402637109160423, -0.059601251035928726, -0.00923166610300541, 0.08787024021148682, -0.08692500740289688, 0.03858466073870659, -0.05952761322259903, 0.007497241720557213, 0.06586731225252151, 0.08358088880777359, 0.22131860256195068, 0.07166002690792084, 0.034829068928956985, 0.0544968917965889, 0.0384945310652256, 0.05117611959576607, -0.046313539147377014, -0.08982095867395401, 0.19881577789783478, -0.11542588472366333, -0.04215311259031296, 0.08052845299243927, -0.02882063388824463, 0.06274404376745224, -0.17796429991722107, -0.20298901200294495, -0.04827205464243889, -0.10241370648145676, -0.068895623087883, -0.03809686750173569, -0.0829191580414772, 0.22111760079860687, 0.19317899644374847, -0.06799009442329407, 0.1349770873785019, -0.08718470484018326, 0.06903058290481567, 0.10369181632995605, -0.00990159623324871, -0.08432633429765701, -0.0067848931066691875, -0.061267051845788956, -0.046557776629924774, 0.14695526659488678, 0.018152320757508278, -0.1804637908935547, 0.09943890571594238, -0.011054220609366894, -0.12537500262260437, -0.04775386303663254, 0.01002420298755169, -0.10385365039110184, 0.10015714168548584, -0.0074529144912958145, 0.027486251667141914, 0.056324370205402374, 0.22764797508716583, 0.13524547219276428, 0.13739421963691711, 0.03417778015136719, -0.017977915704250336, 0.15137512981891632, -0.09834465384483337, 0.0999317541718483, -0.12223614752292633, 0.11177489161491394, -0.04705508053302765, 0.0017490654718130827, 0.06376613676548004, -0.011184596456587315, 0.037216491997241974, 0.009253652766346931, 0.19853535294532776, -0.03213270753622055, -0.09468530118465424, 0.01983545906841755, -0.01699201390147209, -0.00612263148650527, 0.011240633204579353, -0.11425496637821198, 0.055273596197366714, 0.053494617342948914, 0.0030225857626646757, -0.054918669164180756, -0.20407889783382416, 0.15579509735107422, -0.11372804641723633, 0.07137734442949295, -0.13191074132919312, 0.007344401907175779, 0.009811983443796635, -0.0033107148483395576, -0.07065566629171371, 0.2250196784734726, 0.14239542186260223, 0.18627487123012543, 0.10709989815950394, 0.09956079721450806, -0.13800452649593353, -0.018683036789298058, -0.04067523032426834, 0.04103409871459007, 0.015586011111736298, 0.034047599881887436, 0.21296477317810059, -0.10589751601219177, -0.06999724358320236, -0.11397545784711838, 0.16629621386528015, 0.10947191715240479, 0.09822867065668106, -0.10457909852266312, -0.19610103964805603, -0.008111790753901005, 0.1568850874900818, -0.09987800568342209, -0.12957647442817688, 0.013050931505858898, 0.12290853261947632, -0.06770388036966324, 0.07428540289402008, -0.26072975993156433, 7.404966595458973e-7, -0.1498163789510727, 0.2580634653568268, 0.17929553985595703, 0.027585525065660477, -0.019367584958672523, 0.16660994291305542, -0.2080981731414795, 0.12244268506765366, -0.07426691055297852, 0.3255550265312195, 0.12575261294841766, 0.018774518743157387, -0.11723490804433823, 0.03959735482931137, 0.18476594984531403, -0.002183594973757863, -0.09881942719221115, 0.1897331029176712, -0.10425565391778946, 0.18766529858112335, 0.18277333676815033, -0.08088913559913635, 0.20495444536209106, -0.13302254676818848, 0.02464313432574272, -0.017528172582387924, -0.007497637066990137, -0.044719062745571136, 0.03252018243074417, -0.10459813475608826, -0.04924313351511955, 0.08230837434530258, 0.1211182028055191, -0.004884049762040377, -0.03420655056834221, -0.09569747000932693, -0.18596403300762177, -0.06605888158082962, -0.02785751409828663, 0.0757950022816658, 0.14214500784873962, 0.1454952210187912, 0.025242969393730164, -0.10981141030788422, 0.030962122604250908, -0.0911012813448906, -0.2091783881187439, 0.018472831696271896, -0.1580033153295517, 0.16375716030597687, -0.007482739165425301, 0.06627752631902695, 0.0014211080269888043, 0.12729719281196594, -0.12334562093019485, -0.017337338998913765, -0.025783590972423553, -0.06958775967359543, 0.014135035686194897, 0.018839893862605095, 0.06897193938493729, 0.0521281473338604, -0.1428564041852951, 0.06781554967164993, 0.09993641823530197, -0.06540042161941528, -0.03825600445270538, 2.742727933774612e-34, 0.010286161676049232, 0.06513914465904236, -0.06158725544810295, -0.19999893009662628, -0.06598186492919922, -0.10392004251480103, 0.3596954047679901, 0.20530760288238525, 0.11347448080778122, 0.02865857258439064, -0.027648337185382843 ]
https://github.com/huggingface/datasets/issues/6184
Map cache does not detect function changes in another module
This issue is a duplicate of https://github.com/huggingface/datasets/issues/3297. This is a limitation of `dill`, a package we use for caching (non-`__main__` module objects are serialized by reference). You can find more info about it here: https://github.com/uqfoundation/dill/issues/424. In your case, moving ``` data = datasets.load_dataset('json', data_files=['/tmp/test.json'], split='train') data = data.map(transform) ``` to `test.py` and setting `transform.__module__ = None` at the end of `dataset.py` should fix the issue.
```python # dataset.py import os import datasets if not os.path.exists('/tmp/test.json'): with open('/tmp/test.json', 'w') as file: file.write('[{"text": "hello"}]') def transform(example): text = example['text'] # text += ' world' return {'text': text} data = datasets.load_dataset('json', data_files=['/tmp/test.json'], split='train') data = data.map(transform) ``` ```python # test.py import dataset print(next(iter(dataset.data))) ``` Initialize cache ``` python3 test.py # {'text': 'hello'} ``` Edit dataset.py and uncomment the commented line, run again ``` python3 test.py # {'text': 'hello'} # expected: {'text': 'hello world'} ``` Clear cache and run again ``` rm -rf ~/.cache/huggingface/datasets/* python3 test.py # {'text': 'hello world'} ``` If instead the two files are combined, then changes to the function are detected correctly. But it's expected when working on any realistic codebase that things will be modularized into separate files.
65
Map cache does not detect function changes in another module ```python # dataset.py import os import datasets if not os.path.exists('/tmp/test.json'): with open('/tmp/test.json', 'w') as file: file.write('[{"text": "hello"}]') def transform(example): text = example['text'] # text += ' world' return {'text': text} data = datasets.load_dataset('json', data_files=['/tmp/test.json'], split='train') data = data.map(transform) ``` ```python # test.py import dataset print(next(iter(dataset.data))) ``` Initialize cache ``` python3 test.py # {'text': 'hello'} ``` Edit dataset.py and uncomment the commented line, run again ``` python3 test.py # {'text': 'hello'} # expected: {'text': 'hello world'} ``` Clear cache and run again ``` rm -rf ~/.cache/huggingface/datasets/* python3 test.py # {'text': 'hello world'} ``` If instead the two files are combined, then changes to the function are detected correctly. But it's expected when working on any realistic codebase that things will be modularized into separate files. This issue is a duplicate of https://github.com/huggingface/datasets/issues/3297. This is a limitation of `dill`, a package we use for caching (non-`__main__` module objects are serialized by reference). You can find more info about it here: https://github.com/uqfoundation/dill/issues/424. In your case, moving ``` data = datasets.load_dataset('json', data_files=['/tmp/test.json'], split='train') data = data.map(transform) ``` to `test.py` and setting `transform.__module__ = None` at the end of `dataset.py` should fix the issue.
[ 0.18492276966571808, 0.1837650090456009, -0.11144690960645676, 0.05561302229762077, 0.13571275770664215, -0.034355971962213516, 0.0943218246102333, 0.026518050581216812, 0.015273556113243103, 0.01758648082613945, -0.18848656117916107, -0.06904762983322144, 0.11760203540325165, -0.1701902598142624, 0.09330899268388748, 0.05912359058856964, 0.11736151576042175, -0.09549176692962646, -0.15419651567935944, 0.08410574495792389, -0.10174228996038437, -0.028770649805665016, 0.19993330538272858, -0.058474697172641754, 0.07158708572387695, 0.09208986163139343, -0.10341572761535645, -0.004724821541458368, 0.11640854179859161, 0.0628170445561409, -0.04337858781218529, 0.09934435039758682, -0.07970985025167465, 0.24345174431800842, 0.000005116918146086391, 0.045196205377578735, 0.1294523924589157, -0.04843444004654884, -0.09027361869812012, 0.03059958480298519, 0.13750147819519043, -0.027593327686190605, 0.05938613414764404, -0.06314978748559952, -0.11008061468601227, -0.02560756914317608, -0.033765509724617004, -0.16431143879890442, 0.21646203100681305, -0.04296349734067917, -0.044127583503723145, 0.035309094935655594, -0.02951539307832718, -0.04932868853211403, 0.1732897013425827, 0.09863681346178055, 0.03524694964289665, 0.027571290731430054, -0.2937806248664856, -0.04930834472179413, -0.06768918037414551, 0.02717703767120838, -0.0654616504907608, 0.10886166244745255, -0.05531720072031021, -0.0752374455332756, -0.07724117487668991, 0.016860811039805412, -0.012786372564733028, -0.004138610325753689, -0.02261366695165634, -0.09875109791755676, -0.1252262443304062, 0.08914519101381302, -0.14575070142745972, -0.02912040427327156, 0.02043161168694496, -0.16087229549884796, 0.09060699492692947, -0.0181201733648777, -0.056411080062389374, -0.009894043207168579, 0.08787950128316879, -0.010975648649036884, -0.3712344169616699, 0.01807289570569992, -0.06402873247861862, 0.09804607182741165, -0.15762871503829956, -0.15903058648109436, 0.15896348655223846, -0.03583024814724922, -0.029206562787294388, -0.05622825399041176, 0.017492108047008514, -0.018081912770867348, -0.13714051246643066, -0.11490105092525482, -0.08618856221437454, -0.11995994299650192, -0.019886475056409836, -0.15337443351745605, -0.07222889363765717, 0.08376987278461456, -0.0020884014666080475, -0.047007013112306595, -0.1388295292854309, -0.04310198128223419, 0.02411440573632717, 0.022125625982880592, -0.14758442342281342, 0.007825491949915886, 0.08598882704973221, -0.06762199848890305, 0.25056496262550354, 0.05424432456493378, 0.035592012107372284, 0.2533148527145386, 0.10302852839231491, 0.11862635612487793, -0.07391169667243958, -0.08925744891166687, -0.14244171977043152, 0.2422064244747162, 0.04286893084645271, -0.0024009179323911667, 0.06029074639081955, -0.07302876561880112, -0.03326496109366417, -0.008042641915380955, -0.00430170726031065, -0.12030699104070663, 0.12593527138233185, 0.1989600658416748, 0.2755171060562134, 0.06532624363899231, 0.03700504079461098, -0.12739692628383636, -0.14513567090034485, 0.01571141555905342, 0.11642950028181076, -0.07298250496387482, 0.16377389430999756, -0.03963220864534378, -0.07196427881717682, 0.07096107304096222, 0.10480180382728577, 0.048717863857746124, -0.04213106259703636, 0.00406618369743228, -0.28115883469581604, 0.27889755368232727, 0.018683917820453644, 0.09221138060092926, -0.14542420208454132, 0.04789405316114426, 0.19548048079013824, 0.01400323398411274, -0.11115474998950958, -0.2179277092218399, 0.1268523633480072, -0.099325992166996, 0.021702909842133522, -0.04143112525343895, 0.04289880022406578, 0.2725020945072174, 0.10781397670507431, 0.07445507496595383, 0.011396478861570358, -0.056091006845235825, -0.04354098439216614, 0.09138315916061401, -0.019055994227528572, -0.06551875174045563, -0.15442349016666412, 0.13235965371131897, -0.02273930422961712, -0.03392598032951355, -0.19898639619350433, -0.04191213846206665, -0.013108015060424805, 0.13673894107341766, 0.03153105080127716, -0.22941745817661285, -0.023326940834522247, -0.08615107089281082, 0.12395680695772171, -0.048530999571084976, -0.0424434170126915, 0.03794276714324951, -0.16714541614055634, 0.05469747632741928, 0.17458254098892212, -0.09400796890258789, -0.12609870731830597, 0.009692481718957424, -0.043655745685100555, 0.0009365898440591991, -0.02751859836280346, -0.07316025346517563, 0.005052864085882902, 0.08939400315284729, -0.020133670419454575, 0.14963704347610474, 0.1665179282426834, 0.06419891119003296, -0.18798398971557617, 0.12021312117576599, -0.09647966921329498, -0.13361985981464386, -0.12117946147918701, 0.010314038023352623, 0.06878380477428436, 0.07721614092588425, 0.05443677678704262, -0.15858596563339233, -0.11381516605615616, -0.01804603822529316, 0.002709933090955019, 0.060506947338581085, -0.012261396273970604, 0.12153428792953491, 0.09848840534687042, 0.08195924758911133, -0.10720139741897583, 0.0549701452255249, -0.09251688420772552, -0.07272274047136307, -0.044495824724435806, 0.02276846580207348, -0.04726628586649895, -0.039088744670152664, 0.00031565583776682615, 0.14837531745433807, 0.009721571579575539, 0.07902402430772781, -0.10401123017072678, -0.1902654618024826, 0.08782173693180084, 0.034771669656038284, -0.054601725190877914, 0.032354023307561874, 0.03664976730942726, -0.0007619505631737411, 0.05199005454778671, 0.04683439061045647, -0.0012686591362580657, 0.25637736916542053, -0.0004838703607674688, -0.15177664160728455, 0.11057166010141373, 0.1682678610086441, -0.21558167040348053, -0.051668476313352585, -0.07575217634439468, -0.14033475518226624, 0.29358363151550293, 0.25760161876678467, 0.22644789516925812, -0.09250689297914505, 0.3066377341747284, 0.08200164139270782, -0.01148135308176279, -0.15787579119205475, 0.10446715354919434, -0.09621340036392212, 0.07525642216205597, 0.014301877468824387, 0.019085627049207687, 0.1348281353712082, 0.28762349486351013, 0.05539364740252495, -0.14219693839550018, 0.0035378062166273594, -0.057932328432798386, -0.16720989346504211, 0.022334666922688484, 0.008962908759713173, 0.047949522733688354, 0.08753114938735962, -0.1148257851600647, 0.11624017357826233, -0.07019396126270294, -0.09264681488275528, 0.1297590285539627, 0.18864181637763977, -0.1189202070236206, 0.006662551313638687, -0.0720948651432991, -0.01018056832253933, -0.06757758557796478, -0.007902491837739944, 0.07152000069618225, -0.09132395684719086, 0.06215933710336685, 0.04844652861356735, 0.17315995693206787, -0.22591175138950348, -0.06635002046823502, -0.323363721370697, -0.07327011227607727, -0.11179254204034805, 0.0558934323489666, -0.2574995756149292, 0.07829209417104721, -0.05760348215699196, 0.06804602593183517, 0.1669413447380066, -0.11144813895225525, -0.06513857841491699, 0.01955023594200611, -0.0507543720304966, 0.11071435362100601, -0.023711975663900375, -0.05377357825636864, -0.05428130552172661, 0.051968637853860855, -0.2617988884449005, 0.15659654140472412, -0.08007912337779999, 0.0044086468406021595, -0.03481940180063248, 0.022395506501197815, -0.15613953769207, -0.06232856586575508, -0.19187217950820923, 0.017642933875322342, -0.12384340167045593, 0.1427169144153595, -0.16086015105247498, -0.15955664217472076, 0.14327767491340637, -0.07827088236808777, -0.1546287089586258, -0.038386981934309006, -0.027657825499773026, -0.14630986750125885, -0.0688159167766571, 0.14667993783950806, 0.09000077843666077, -0.028237970545887947, 0.07238171994686127, -0.12842707335948944, 0.04471568763256073, 0.08161851763725281, -0.0960075706243515, 0.12330269068479538, -0.08054622262716293, 0.18784329295158386, 0.09896926581859589, 0.05246582627296448, 0.19660869240760803, 0.01461083721369505, -0.16857486963272095, -0.08978540450334549, -0.1439199447631836, -0.2959299087524414, 0.10647162050008774, -0.0951666608452797, 0.04158404469490051, 0.03614968806505203, -0.02848912589251995, 0.07568667829036713, -0.03164730966091156, -0.09552900493144989, 0.1611553430557251, 0.155558243393898, 0.1547844558954239, 0.07127773016691208, -0.2071349322795868, 0.07409634441137314, 0.09819605201482773, -0.11451616138219833, -0.17786628007888794, -0.04194530472159386, -0.07489782571792603, -0.04390553757548332, -0.07506248354911804, -0.14403484761714935, -0.007609638851135969, 0.024103406816720963, -0.2775435149669647, -0.02824758179485798, 0.22615939378738403, 0.07400944083929062, -0.08913884311914444, 0.09611926972866058, 0.06288406997919083, -0.08192159235477448, 0.08692960441112518, 0.02794438973069191, 0.05331101641058922, 0.044488418847322464, -0.051774244755506516, 0.11347469687461853, 0.06885308772325516, 0.07843480259180069, 0.03894281014800072, -0.05581459775567055, -0.1362384706735611, -0.10033276677131653, 0.15001854300498962, 0.00954497791826725, 0.03286265954375267, 0.03583855554461479, -0.09274942427873611, 0.09209665656089783, 0.0291509460657835, 0.1768486350774765, -0.01300385594367981, 0.027370184659957886, 0.13325446844100952, 0.06210885941982269, -0.11973973363637924, 0.14794518053531647, 0.09341409057378769, -0.008733834140002728, -0.18246501684188843, -0.06730648130178452, -0.062676802277565, -0.13327769935131073, -0.20883533358573914, -0.06370057910680771, 0.017908332869410515, 0.014922293834388256, 0.03310981020331383, 0.08607128262519836, -0.08731038123369217, 0.031534042209386826, 0.06121398136019707, 0.056991107761859894, 0.09737100452184677, 0.11337130516767502, 0.09882834553718567, 0.21211378276348114, -0.17078718543052673, 0.19064629077911377, -0.1855713129043579, -0.08154293894767761, -0.14630186557769775, 0.05561155453324318, -0.025739094242453575, 0.059258054941892624, 0.033364780247211456, 0.03820956498384476, -0.13338620960712433, -0.0724441409111023, 0.01594170369207859, -0.07616958767175674, -0.006869357079267502, -0.10218629986047745, -0.021142790094017982, -0.17818503081798553, -0.08698756247758865, 0.10356862097978592, 0.050451453775167465, 0.1715288758277893, -0.2781868577003479, 0.0034377560950815678, 0.2473532110452652, -0.11558537185192108, -0.01833232305943966, 0.07411719113588333, 0.1364632248878479, -0.04394590109586716, 0.0255099106580019, 0.24717570841312408, -0.28230106830596924, 0.17373953759670258, 0.1988028883934021, -0.04170913249254227, 0.11511831730604172, -0.13861529529094696, 0.06760801374912262, 0.0816197320818901, 0.11650955677032471, -0.09838718175888062, 0.08875291049480438, 0.15001752972602844, -0.11191468685865402, 0.11780665814876556, 0.02836017869412899, 0.12514108419418335, -0.12948745489120483, -0.018933577463030815, 0.16229493916034698, 0.2737470865249634, 0.022717265412211418, -0.019611861556768417, -0.08028309792280197, 0.05440220236778259, 0.031134244054555893, 0.1263907104730606, 0.04682796448469162, 0.07542749494314194, 0.1100316271185875, -0.05592036992311478, 0.10063312947750092, -0.031919214874506, 0.11096245050430298, 0.06562625616788864, 0.07209743559360504, -0.013180126436054707, -0.02394270896911621, 0.006667502224445343, -0.2935529947280884, 0.039162881672382355, -0.007010400295257568, 0.01113447267562151, -0.19834890961647034, 0.030904894694685936, 0.06385897099971771, -0.25557029247283936, -0.01652384176850319, 0.07426531612873077, -0.07083223015069962, -0.10719841718673706, 0.07904817163944244, 0.07419177889823914, -0.07288352400064468, 0.03281038999557495, 0.006276964675635099, 0.0026227307971566916, -0.1663316786289215, 0.17053045332431793, -0.19183477759361267, -0.09890764206647873, -0.05156375840306282, 0.20127825438976288, -0.06075112894177437, -0.01271498017013073, 0.1554194688796997, -0.0467628613114357, -0.028171414509415627, -0.008403771556913853, 0.07040072977542877, 0.16611170768737793, -0.12679722905158997, -0.0010890630073845387, -0.013281328603625298, -0.026189953088760376, -0.13184785842895508, -0.1819135993719101, 0.049831390380859375, 0.10828665643930435, -0.15873520076274872, 0.018518000841140747, -0.014021067880094051, 0.1157609149813652, -0.03373440355062485, 0.060637250542640686, 0.35023120045661926, 0.17352110147476196, -0.041862715035676956, 0.06470736861228943, -2.3981454207693373e-32, -0.0413457453250885, 0.051181647926568985, -0.0548517070710659, -0.07049484550952911, -0.19726042449474335, 0.13333497941493988, -0.015305189415812492, -0.004676498007029295, -0.10637837648391724, -0.24935750663280487, -0.12812159955501556, 0.063765749335289, -0.013559237122535706, -0.12973231077194214, -0.04049409180879593, -0.20790308713912964, 0.04237787052989006, 0.11791744828224182, -0.07078148424625397, 0.054544344544410706, 0.08406293392181396, 0.20166835188865662, 0.1792147010564804, -0.13657476007938385, -0.017231812700629234, 0.08461307734251022, -0.02351401560008526, -0.31210654973983765, -0.23109149932861328, -0.06392234563827515, -0.014282213523983955, 0.09671483188867569, -0.05848908796906471, -0.09186580032110214, -0.24794159829616547, -0.06467331945896149, -0.1810769885778427, -0.029137924313545227, -0.053891364485025406, 0.010760944336652756, -0.011775683611631393, 0.10101891309022903, 0.17972415685653687, -0.04925159737467766, -0.00857353676110506, 0.14966779947280884, -0.11357597261667252, 0.016491804271936417, -0.05003204941749573, 0.108834408223629, -0.030064111575484276, 0.05796398967504501, 0.07666947692632675, 0.07399605959653854, 0.18591496348381042, 0.010366682894527912, 0.03757448494434357, -0.003147247014567256, -0.18232043087482452, 0.0553063303232193, 0.17963431775569916, -0.007569099776446819, 0.04478931054472923, 0.04070143401622772, 0.1029338464140892, 0.06351949274539948, 0.19062326848506927, 0.18704776465892792, 0.2806904911994934, -0.13728012144565582, 0.10545764863491058, 0.11086252331733704, -0.0036836375948041677, -0.0499449223279953, -0.1726256161928177, -0.005394246894866228, 0.12986157834529877, -0.1356348693370819, -0.07286573201417923, -0.057415809482336044, -0.06780841201543808, 0.10534899681806564, 0.008798792026937008, -0.01643935590982437, -0.07253129035234451, 0.1911298781633377, 0.05090658739209175, 0.10174210369586945, -0.16290661692619324, -0.03177438676357269, 0.011197429150342941, 0.20332351326942444, -0.01897118240594864, -0.016480090096592903, -0.020313426852226257, 0.04929879680275917, -0.10916163772344589, 0.13798359036445618, 0.004922513384371996, 0.10068786889314651, 0.08329146355390549, -0.14624683558940887, 0.06766792386770248, -0.06499546766281128, 0.05647328495979309, 0.09651583433151245, 0.06259758025407791, 0.06035719811916351, -0.09319401532411575, -0.06474299728870392, 0.11850620806217194, -0.024865690618753433, 0.0447511300444603, -0.06992501765489578, 0.10556921362876892, 0.039378974586725235, -0.012297644279897213, -0.04321391507983208, 0.15667705237865448, 0.11889377981424332, -0.08535361289978027, -0.06780610233545303, -0.1094544380903244, 0.04693395644426346, -0.10526733100414276, -0.000962539401371032, -0.2583824694156647, -0.22159415483474731, 0.09324415773153305, -0.11367128044366837, 0.006651202216744423, -0.10272740572690964, 7.213742492240272e-7, -0.05530960112810135, 0.14266641438007355, 0.09256591647863388, -0.12245331704616547, -0.09520530700683594, 0.057225827127695084, -0.28280702233314514, 0.11598514765501022, -0.0226229690015316, 0.27863872051239014, 0.02940511889755726, -0.06366576999425888, 0.039937928318977356, -0.07183919847011566, 0.10773032158613205, -0.18441838026046753, -0.10371715575456619, 0.060957640409469604, -0.06324966251850128, -0.09232351183891296, -0.05170237645506859, 0.032994307577610016, 0.1042904183268547, -0.02108076587319374, -0.019654782488942146, -0.00141598517075181, -0.004176670219749212, -0.13240239024162292, 0.0689314678311348, 0.0034889273811131716, 0.030642986297607422, 0.07331100106239319, 0.13944758474826813, -0.026000192388892174, -0.02490687184035778, -0.1179804801940918, -0.1860286295413971, -0.12094026803970337, 0.16150565445423126, 0.000792965991422534, 0.16456137597560883, -0.003357884706929326, -0.06425408273935318, -0.1350346803665161, 0.14001798629760742, 0.050968755036592484, -0.060517799109220505, -0.1396685689687729, 0.003947672434151173, 0.05691682919859886, 0.01921716518700123, 0.15008099377155304, 0.08059174567461014, 0.2491050362586975, 0.009067712351679802, 0.11747968941926956, 0.003993638325482607, 0.006717320065945387, 0.10133136063814163, -0.13550838828086853, -0.1653020679950714, -0.09833498299121857, -0.09988683462142944, -0.09112829715013504, 0.02421746589243412, -0.1457306444644928, 0.009472985751926899, 1.146181149214878e-34, -0.09002341330051422, 0.08446359634399414, 0.034406088292598724, -0.0999252125620842, 0.03136380761861801, -0.09621693938970566, 0.19051668047904968, 0.06850448250770569, 0.04279746860265732, -0.11031977832317352, -0.09769503772258759 ]
https://github.com/huggingface/datasets/issues/6184
Map cache does not detect function changes in another module
I understand this may be a limitation of an upstream tool, but for a user for datasets this is very annoying, as when you have dozens of different datasets with different preprocessing functions you can't really move them all into the same file. It may be worth seeing if there is a way to specialize the dependency (eg. subclass it) and enforce behaviors that makes sense for your product. I was able to work around this for now by setting `__module__ = None`. If such workarounds are required for now it may be better to document it somewhere than a single obscure issue from a long time ago. As this is a duplicate issue I'm closing it. I have another issue with the cache https://github.com/huggingface/datasets/issues/6179 can you take a look?
```python # dataset.py import os import datasets if not os.path.exists('/tmp/test.json'): with open('/tmp/test.json', 'w') as file: file.write('[{"text": "hello"}]') def transform(example): text = example['text'] # text += ' world' return {'text': text} data = datasets.load_dataset('json', data_files=['/tmp/test.json'], split='train') data = data.map(transform) ``` ```python # test.py import dataset print(next(iter(dataset.data))) ``` Initialize cache ``` python3 test.py # {'text': 'hello'} ``` Edit dataset.py and uncomment the commented line, run again ``` python3 test.py # {'text': 'hello'} # expected: {'text': 'hello world'} ``` Clear cache and run again ``` rm -rf ~/.cache/huggingface/datasets/* python3 test.py # {'text': 'hello world'} ``` If instead the two files are combined, then changes to the function are detected correctly. But it's expected when working on any realistic codebase that things will be modularized into separate files.
130
Map cache does not detect function changes in another module ```python # dataset.py import os import datasets if not os.path.exists('/tmp/test.json'): with open('/tmp/test.json', 'w') as file: file.write('[{"text": "hello"}]') def transform(example): text = example['text'] # text += ' world' return {'text': text} data = datasets.load_dataset('json', data_files=['/tmp/test.json'], split='train') data = data.map(transform) ``` ```python # test.py import dataset print(next(iter(dataset.data))) ``` Initialize cache ``` python3 test.py # {'text': 'hello'} ``` Edit dataset.py and uncomment the commented line, run again ``` python3 test.py # {'text': 'hello'} # expected: {'text': 'hello world'} ``` Clear cache and run again ``` rm -rf ~/.cache/huggingface/datasets/* python3 test.py # {'text': 'hello world'} ``` If instead the two files are combined, then changes to the function are detected correctly. But it's expected when working on any realistic codebase that things will be modularized into separate files. I understand this may be a limitation of an upstream tool, but for a user for datasets this is very annoying, as when you have dozens of different datasets with different preprocessing functions you can't really move them all into the same file. It may be worth seeing if there is a way to specialize the dependency (eg. subclass it) and enforce behaviors that makes sense for your product. I was able to work around this for now by setting `__module__ = None`. If such workarounds are required for now it may be better to document it somewhere than a single obscure issue from a long time ago. As this is a duplicate issue I'm closing it. I have another issue with the cache https://github.com/huggingface/datasets/issues/6179 can you take a look?
[ 0.16170786321163177, 0.1901947259902954, -0.11044684052467346, 0.05420282855629921, 0.15539945662021637, -0.05225347355008125, 0.050146009773015976, 0.08551491051912308, 0.05358443781733513, 0.017293628305196762, -0.15894776582717896, -0.07699822634458542, 0.07446496933698654, -0.11239501088857651, 0.10703777521848679, 0.0713886097073555, 0.0799701139330864, -0.08749151229858398, -0.19698742032051086, 0.11398003995418549, -0.10760628432035446, 0.010109205730259418, 0.21609877049922943, -0.0206736009567976, 0.0491190180182457, 0.06906471401453018, -0.04737072065472603, -0.033851806074380875, 0.12695574760437012, 0.10596147179603577, -0.002211892046034336, 0.06478962302207947, -0.06893512606620789, 0.28871163725852966, 0.000005252502432995243, 0.024883830919861794, 0.161898672580719, -0.044606633484363556, -0.09257693588733673, 0.067097969353199, 0.08881694823503494, -0.07597677409648895, 0.09796441346406937, -0.028868189081549644, -0.12645387649536133, -0.03241352364420891, -0.04635832458734512, -0.18358482420444489, 0.19371984899044037, -0.02953285723924637, -0.030025850981473923, 0.05887129157781601, -0.04268742352724075, -0.04785849526524544, 0.1538534164428711, 0.10734774172306061, -0.012299994006752968, -0.0029092233162373304, -0.26958492398262024, -0.04877116531133652, -0.04951838403940201, 0.015129177831113338, -0.05990387499332428, 0.11479930579662323, -0.03926564380526543, -0.06319573521614075, -0.07392864674329758, 0.04099502041935921, -0.007420310750603676, 0.013734383508563042, -0.008451862260699272, -0.0806848406791687, -0.131454735994339, 0.027478551492094994, -0.16005375981330872, -0.0281019676476717, 0.02136838808655739, -0.1370602697134018, 0.08104083687067032, -0.05656728520989418, -0.04790450260043144, 0.018832392990589142, 0.0523567721247673, 0.006577512249350548, -0.33969154953956604, 0.03954910859465599, -0.06886382400989532, 0.09793858975172043, -0.1387842297554016, -0.17226465046405792, 0.1274983435869217, -0.07591559737920761, -0.029469139873981476, -0.04019230604171753, -0.008210836909711361, -0.014391475357115269, -0.15231315791606903, -0.06460504978895187, -0.09186811000108719, -0.14642208814620972, -0.04859969764947891, -0.1026352196931839, -0.059083398431539536, 0.06720831990242004, 0.04767502844333649, -0.045688431710004807, -0.13752266764640808, -0.0697970762848854, 0.021311305463314056, 0.04379596188664436, -0.15102358162403107, 0.02821415662765503, 0.09672629833221436, -0.06882625818252563, 0.24704359471797943, 0.037376996129751205, 0.012662235647439957, 0.23634010553359985, 0.08885317295789719, 0.10894554853439331, -0.05101180449128151, -0.06982223689556122, -0.1637461632490158, 0.1828543245792389, 0.03380813077092171, 0.02446887642145157, 0.08700717985630035, -0.07153720408678055, -0.0792846828699112, -0.004584888927638531, -0.033958107233047485, -0.10943368822336197, 0.1211998462677002, 0.2186475396156311, 0.27359384298324585, 0.09659500420093536, 0.02894972264766693, -0.1638534963130951, -0.12948323786258698, -0.013746249489486217, 0.12816764414310455, -0.05526519566774368, 0.10552360862493515, -0.03961101546883583, -0.08814600110054016, 0.10590055584907532, 0.14609621465206146, 0.08709796518087387, -0.05678904801607132, -0.041555337607860565, -0.25282761454582214, 0.26827046275138855, 0.07397183775901794, 0.0973295271396637, -0.16198819875717163, 0.06291705369949341, 0.16926470398902893, 0.027189115062355995, -0.0812310129404068, -0.20972323417663574, 0.11908525228500366, -0.11242794990539551, -0.006395894568413496, 0.00020253875118214637, 0.0058582741767168045, 0.23074527084827423, 0.14288432896137238, 0.06467314064502716, 0.05125803127884865, -0.05845062807202339, -0.036434829235076904, 0.02477683499455452, 0.0026212704833596945, -0.04999720677733421, -0.20892879366874695, 0.10244469344615936, -0.05060301721096039, -0.06043566018342972, -0.1756957471370697, -0.034074876457452774, -0.017420001327991486, 0.14194634556770325, 0.062199946492910385, -0.2315623164176941, -0.023691721260547638, -0.10783316195011139, 0.08166597783565521, -0.014117088168859482, -0.05068231001496315, 0.01573222316801548, -0.15257519483566284, 0.006299898959696293, 0.10192102193832397, -0.0684155598282814, -0.11047809571027756, -0.012220079079270363, -0.04482525587081909, -0.00637014489620924, -0.005088315345346928, -0.1024763435125351, 0.010179956443607807, 0.12186174094676971, -0.006278037093579769, 0.17713211476802826, 0.1751949042081833, 0.04614555463194847, -0.14412428438663483, 0.13199929893016815, -0.020220445469021797, -0.15129517018795013, -0.11382146179676056, -0.005660444498062134, 0.08759843558073044, 0.013544047251343727, 0.04055136814713478, -0.15823891758918762, -0.12718309462070465, -0.050431158393621445, 0.014365345239639282, 0.03523075953125954, -0.012545443139970303, 0.17098627984523773, 0.1065378487110138, 0.08401843905448914, -0.12725716829299927, 0.04185787960886955, -0.06157693639397621, -0.0572262667119503, -0.021588025614619255, 0.06270959228277206, -0.06407389789819717, -0.030366133898496628, -0.02317764051258564, 0.11312728375196457, -0.009841058403253555, 0.053310927003622055, -0.04149531573057175, -0.1603599190711975, 0.04914655163884163, 0.038811326026916504, -0.08613906055688858, 0.003879551077261567, -0.008094013668596745, 0.014156952500343323, 0.010958078317344189, 0.02714061364531517, 0.053276725113391876, 0.2820500135421753, -0.00595474848523736, -0.13403469324111938, 0.1127605065703392, 0.15337204933166504, -0.2224348485469818, -0.07051834464073181, -0.06246766075491905, -0.18276619911193848, 0.303559273481369, 0.21594396233558655, 0.2320728451013565, -0.0333869494497776, 0.3253714442253113, 0.11533624678850174, 0.0007487614057026803, -0.1706196516752243, 0.10134804248809814, -0.06855133920907974, 0.08013130724430084, 0.021925782784819603, 0.028968989849090576, 0.14480867981910706, 0.31118565797805786, 0.025575906038284302, -0.12134834378957748, 0.004997381009161472, -0.03320467472076416, -0.15445241332054138, 0.03049704059958458, -0.016477717086672783, 0.008699573576450348, 0.0556345097720623, -0.16882504522800446, 0.1292843520641327, -0.018075179308652878, -0.10622792690992355, 0.11837774515151978, 0.20586837828159332, -0.13517124950885773, 0.031097887083888054, -0.06948821246623993, 0.01919880509376526, -0.06137501820921898, -0.03674726560711861, 0.04813770204782486, -0.03380078449845314, 0.040194667875766754, 0.025706889107823372, 0.14512187242507935, -0.26898083090782166, -0.09393732994794846, -0.340968519449234, -0.07042711228132248, -0.07656678557395935, 0.02991420216858387, -0.29210060834884644, 0.03998211398720741, -0.05626044422388077, 0.12631835043430328, 0.192308709025383, -0.1285007745027542, -0.07837899029254913, -0.011889546178281307, -0.020254578441381454, 0.09882541000843048, 0.011016913689672947, -0.06624799966812134, -0.07749443501234055, 0.04398486390709877, -0.24147558212280273, 0.1933782398700714, -0.09724121540784836, 0.01552620716392994, -0.03279896825551987, 0.0401434563100338, -0.14886559545993805, -0.08013476431369781, -0.19364170730113983, 0.03256084397435188, -0.13731668889522552, 0.1172683835029602, -0.1598237305879593, -0.16757173836231232, 0.16292603313922882, -0.07562509924173355, -0.16491460800170898, -0.041733723133802414, -0.04640546441078186, -0.13634231686592102, -0.0841575339436531, 0.15852053463459015, 0.09361066669225693, -0.004414988216012716, 0.09732333570718765, -0.131731316447258, 0.07164134830236435, 0.06673198193311691, -0.04965730756521225, 0.09255917370319366, -0.11051562428474426, 0.18065185844898224, 0.1418970227241516, 0.06932447850704193, 0.20469985902309418, 0.013577618636190891, -0.16723251342773438, -0.09414641559123993, -0.08878631144762039, -0.3031367361545563, 0.07247120887041092, -0.07874716073274612, 0.07101863622665405, 0.01806539110839367, 0.022993233054876328, 0.11673340201377869, -0.04644104838371277, -0.06421704590320587, 0.14595426619052887, 0.1498400717973709, 0.13357041776180267, 0.11464773863554001, -0.2030927985906601, 0.03651841729879379, 0.06854086369276047, -0.1090012937784195, -0.17376001179218292, 0.0394241139292717, -0.02832178585231304, -0.049601469188928604, -0.015741297975182533, -0.15079662203788757, 0.003497455036267638, 0.027594290673732758, -0.26855865120887756, -0.03042592853307724, 0.20371803641319275, 0.07733555883169174, -0.08290611952543259, 0.1330581158399582, 0.05732931196689606, -0.09650744497776031, 0.0776381716132164, 0.06957826018333435, 0.09978602826595306, 0.03746781870722771, -0.055918771773576736, 0.12653808295726776, 0.05699644982814789, 0.08048115670681, -0.012872040271759033, -0.06669396907091141, -0.14310041069984436, -0.07886293530464172, 0.08905895054340363, -0.06762699782848358, 0.025635231286287308, 0.05960829555988312, -0.15818579494953156, 0.11063123494386673, -0.008809749037027359, 0.14642345905303955, -0.028928907588124275, 0.01581820659339428, 0.07915335893630981, 0.04878045246005058, -0.1389971226453781, 0.15309154987335205, 0.04648516699671745, -0.019536355510354042, -0.1491701602935791, -0.052404820919036865, -0.08008323609828949, -0.09519163519144058, -0.18214820325374603, -0.043296702206134796, -0.024382518604397774, 0.036634307354688644, 0.06741945445537567, 0.041934795677661896, -0.07406365871429443, 0.01097668893635273, 0.030659576877951622, 0.05543481186032295, 0.10120254755020142, 0.1437852531671524, 0.11889184266328812, 0.18147481977939606, -0.17817144095897675, 0.16032782196998596, -0.15907227993011475, -0.10384310036897659, -0.14835014939308167, 0.04642898589372635, 0.00015593686839565635, 0.06666334718465805, 0.000038591311749769375, -0.01958206109702587, -0.13885006308555603, -0.032049473375082016, 0.0038162691053003073, -0.07123225182294846, -0.014512550085783005, -0.06952843815088272, -0.01681690663099289, -0.16213944554328918, -0.07800734788179398, 0.08919862657785416, 0.04868811368942261, 0.18769174814224243, -0.23974114656448364, -0.013635051436722279, 0.20978698134422302, -0.11843449622392654, -0.010674146935343742, 0.08416865766048431, 0.11383774131536484, -0.0817904993891716, 0.07794111967086792, 0.2850154638290405, -0.2639542520046234, 0.17785541713237762, 0.18712830543518066, -0.059811245650053024, 0.08800312131643295, -0.1547877937555313, 0.10150858759880066, 0.10917222499847412, 0.10134577006101608, -0.031188344582915306, 0.10803397744894028, 0.15709146857261658, -0.09333346784114838, 0.07634292542934418, 0.05139070376753807, 0.08577057719230652, -0.11382094025611877, -0.052256856113672256, 0.1628594696521759, 0.2739498019218445, 0.04900122433900833, -0.05007074400782585, -0.04507218673825264, 0.05553946644067764, 0.042624346911907196, 0.1427202820777893, 0.0281535591930151, -0.017726542428135872, 0.13724462687969208, -0.08555375784635544, 0.09857827425003052, -0.06280411779880524, 0.14122042059898376, 0.07559425383806229, 0.047096025198698044, 0.007582882419228554, -0.015850678086280823, 0.008221560157835484, -0.31602418422698975, 0.01190306805074215, 0.031651511788368225, 0.00040146175888366997, -0.1823514699935913, 0.01144317165017128, 0.07232793420553207, -0.24465861916542053, -0.039102982729673386, 0.028279241174459457, -0.061614081263542175, -0.1442759484052658, 0.0676252618432045, 0.06888163089752197, -0.07299089431762695, 0.01574796251952648, 0.03556322678923607, -0.023822197690606117, -0.14882421493530273, 0.1839679479598999, -0.15585781633853912, -0.07810459285974503, -0.0470978207886219, 0.2051280438899994, -0.04007931053638458, 0.003657575463876128, 0.16535909473896027, -0.0703791156411171, -0.03610323742032051, -0.0009095912100747228, 0.014013501815497875, 0.14838142693042755, -0.09999564290046692, -0.04906385764479637, -0.00803065299987793, -0.07599418610334396, -0.10624175518751144, -0.1926281750202179, 0.03035280667245388, 0.057233747094869614, -0.1625003069639206, 0.009279176592826843, -0.0060005709528923035, 0.11466995626688004, -0.021524276584386826, 0.10068269819021225, 0.31864291429519653, 0.11404088884592056, -0.038959190249443054, 0.05720219016075134, -2.4539010280071585e-32, -0.033657342195510864, 0.033973462879657745, -0.0761563777923584, -0.016233911737799644, -0.1466875523328781, 0.1600446254014969, 0.015478109940886497, -0.053392987698316574, -0.07497765123844147, -0.2957073450088501, -0.1045343279838562, 0.05392482504248619, -0.008374246768653393, -0.09886929392814636, -0.031881507486104965, -0.19820952415466309, 0.054148852825164795, 0.09500133246183395, -0.062150172889232635, 0.08498916029930115, 0.0700153335928917, 0.18430422246456146, 0.17496787011623383, -0.15247993171215057, 0.024635063484311104, 0.05216960608959198, -0.0402253083884716, -0.3387494683265686, -0.24393346905708313, 0.0007790210656821728, -0.017485104501247406, 0.12880875170230865, -0.031599439680576324, -0.08587019145488739, -0.22938603162765503, -0.038899920880794525, -0.10402434319257736, -0.04069209843873978, -0.1004091277718544, 0.012160167098045349, -0.03255487233400345, 0.06979787349700928, 0.16057324409484863, -0.08798269182443619, 0.02458050101995468, 0.15242299437522888, -0.10165578871965408, 0.039974234998226166, -0.022766729816794395, 0.0780593678355217, -0.046106863766908646, 0.04549127072095871, 0.09937911480665207, 0.061326514929533005, 0.1813666820526123, 0.06982383877038956, 0.0677720457315445, 0.011894290335476398, -0.19788943231105804, 0.07600171864032745, 0.19867770373821259, 0.013484010472893715, 0.010462626814842224, 0.09564753621816635, 0.08196970820426941, -0.0014367831172421575, 0.21396800875663757, 0.16716600954532623, 0.2791292071342468, -0.11079300940036774, 0.11763361841440201, 0.08922930806875229, -0.0039182305335998535, -0.07057610154151917, -0.1654895395040512, 0.013668037950992584, 0.0827348604798317, -0.15913890302181244, -0.06328240782022476, -0.06915836781263351, -0.07972414791584015, 0.06449173390865326, 0.0011177066480740905, -0.014564272947609425, -0.0873776227235794, 0.11431672424077988, 0.03338830545544624, 0.12493888288736343, -0.15959298610687256, -0.0025220755487680435, 0.06589854508638382, 0.22817735373973846, -0.04580123350024223, -0.028422795236110687, -0.05603579804301262, 0.03829430788755417, -0.08715113252401352, 0.16185243427753448, -0.0035791208501905203, 0.12205222994089127, 0.06915897130966187, -0.1502757966518402, 0.1016637310385704, -0.05743813514709473, 0.04572701454162598, 0.06938914954662323, 0.06285566836595535, 0.0802827924489975, -0.11496435105800629, -0.05437701195478439, 0.07697080820798874, -0.0172265712171793, 0.07494856417179108, -0.038299646228551865, 0.09866953641176224, 0.04095866158604622, -0.02115420065820217, -0.017567595466971397, 0.12144678086042404, 0.128885418176651, -0.11747792363166809, -0.09849555045366287, -0.10179991275072098, 0.06262173503637314, -0.10549969971179962, 0.01773652620613575, -0.22487106919288635, -0.19180898368358612, 0.0858079046010971, -0.09653940796852112, -0.002001189161092043, -0.12575753033161163, 7.330399398597365e-7, -0.06783147901296616, 0.1378648430109024, 0.036414921283721924, -0.17590808868408203, -0.0904659628868103, 0.05532927066087723, -0.2783803641796112, 0.11326436698436737, -0.0444875992834568, 0.24301013350486755, 0.06062035635113716, -0.09029650688171387, 0.06355386972427368, -0.07795602083206177, 0.10252645611763, -0.14780527353286743, -0.05321475863456726, 0.040113579481840134, -0.10153118520975113, -0.11046382039785385, -0.021567190065979958, 0.0849146768450737, 0.13403497636318207, -0.06173105165362358, -0.030372506007552147, 0.03968123346567154, 0.03214560076594353, -0.115675188601017, 0.081968754529953, -0.00101420225109905, 0.022069860249757767, 0.09017616510391235, 0.13437284529209137, 0.019495734944939613, -0.013344794511795044, -0.10119176656007767, -0.19298036396503448, -0.09851731359958649, 0.17620886862277985, 0.013287645764648914, 0.14156652987003326, 0.06791742146015167, -0.05128491297364235, -0.102993443608284, 0.16413840651512146, 0.023187577724456787, -0.05273831635713577, -0.11691610515117645, -0.002104972256347537, 0.054195478558540344, 0.02399035543203354, 0.15487629175186157, 0.08328572660684586, 0.2504062056541443, 0.013887948356568813, 0.09296106547117233, -0.02700953558087349, -0.058072421699762344, 0.09804297238588333, -0.12378107011318207, -0.17336589097976685, -0.1273963898420334, -0.07794420421123505, -0.06745637953281403, 0.017757825553417206, -0.10748201608657837, -0.04146786779165268, 1.598968716182161e-34, -0.08744045346975327, 0.06267455220222473, 0.04037012904882431, -0.13149569928646088, 0.011730177327990532, -0.07583105564117432, 0.20205718278884888, 0.07456903159618378, 0.03416529297828674, -0.16852009296417236, -0.07868151366710663 ]
https://github.com/huggingface/datasets/issues/6183
Load dataset with non-existent file
This was fixed in https://github.com/huggingface/datasets/pull/6155, which will be included in the next release (or you can install `datasets` from source to use it immediately).
### Describe the bug When load a dataset from datasets and pass a wrong path to json with the data, error message does not contain something abount "wrong path" or "file do not exist" - ```SchemaInferenceError: Please pass `features` or at least one example when writing data``` ### Steps to reproduce the bug ```python from datasets import load_dataset load_dataset('json', data_files='/home/alexey/unreal_file.json') ``` ### Expected behavior Raise os FileNotFound error or custom error with informative message ### Environment info ``` # packages in environment at /home/alexey/.conda/envs/alex_LoRA: # # Name Version Build Channel _libgcc_mutex 0.1 main _openmp_mutex 5.1 1_gnu accelerate 0.21.0 pypi_0 pypi aiohttp 3.8.5 pypi_0 pypi aiosignal 1.3.1 pypi_0 pypi antlr4-python3-runtime 4.9.3 pypi_0 pypi appdirs 1.4.4 pypi_0 pypi asttokens 2.0.5 pyhd3eb1b0_0 async-timeout 4.0.3 pypi_0 pypi attrs 23.1.0 pypi_0 pypi backcall 0.2.0 pyhd3eb1b0_0 bitsandbytes 0.41.1 pypi_0 pypi bzip2 1.0.8 h7b6447c_0 ca-certificates 2023.05.30 h06a4308_0 certifi 2023.7.22 pypi_0 pypi charset-normalizer 3.2.0 pypi_0 pypi click 8.1.6 pypi_0 pypi cmake 3.27.2 pypi_0 pypi comm 0.1.2 py310h06a4308_0 contourpy 1.1.0 pypi_0 pypi cycler 0.11.0 pypi_0 pypi datasets 2.14.4 pypi_0 pypi debugpy 1.6.7 py310h6a678d5_0 decorator 5.1.1 pyhd3eb1b0_0 dill 0.3.7 pypi_0 pypi docker-pycreds 0.4.0 pypi_0 pypi executing 0.8.3 pyhd3eb1b0_0 filelock 3.12.2 pypi_0 pypi fire 0.5.0 pypi_0 pypi fonttools 4.42.0 pypi_0 pypi frozenlist 1.4.0 pypi_0 pypi fsspec 2023.6.0 pypi_0 pypi gitdb 4.0.10 pypi_0 pypi gitpython 3.1.32 pypi_0 pypi huggingface-hub 0.16.4 pypi_0 pypi idna 3.4 pypi_0 pypi ipykernel 6.25.0 py310h2f386ee_0 ipython 8.12.2 py310h06a4308_0 ipython-genutils 0.2.0 pypi_0 pypi ipywidgets 8.0.4 py310h06a4308_0 jedi 0.18.1 py310h06a4308_1 jinja2 3.1.2 pypi_0 pypi jsonschema 4.19.0 pypi_0 pypi jsonschema-specifications 2023.7.1 pypi_0 pypi jupyter_client 8.1.0 py310h06a4308_0 jupyter_core 5.3.0 py310h06a4308_0 jupyterlab_widgets 3.0.5 py310h06a4308_0 kiwisolver 1.4.4 pypi_0 pypi ld_impl_linux-64 2.38 h1181459_1 libffi 3.3 he6710b0_2 libgcc-ng 11.2.0 h1234567_1 libgomp 11.2.0 h1234567_1 libsodium 1.0.18 h7b6447c_0 libstdcxx-ng 11.2.0 h1234567_1 libuuid 1.41.5 h5eee18b_0 lightning-utilities 0.9.0 pypi_0 pypi lit 16.0.6 pypi_0 pypi markupsafe 2.1.3 pypi_0 pypi matplotlib 3.7.2 pypi_0 pypi matplotlib-inline 0.1.6 py310h06a4308_0 mpmath 1.3.0 pypi_0 pypi multidict 6.0.4 pypi_0 pypi multiprocess 0.70.15 pypi_0 pypi nbformat 4.2.0 pypi_0 pypi ncurses 6.4 h6a678d5_0 nest-asyncio 1.5.6 py310h06a4308_0 networkx 3.1 pypi_0 pypi numpy 1.25.2 pypi_0 pypi nvidia-cublas-cu11 11.10.3.66 pypi_0 pypi nvidia-cuda-cupti-cu11 11.7.101 pypi_0 pypi nvidia-cuda-nvrtc-cu11 11.7.99 pypi_0 pypi nvidia-cuda-runtime-cu11 11.7.99 pypi_0 pypi nvidia-cudnn-cu11 8.5.0.96 pypi_0 pypi nvidia-cufft-cu11 10.9.0.58 pypi_0 pypi nvidia-curand-cu11 10.2.10.91 pypi_0 pypi nvidia-cusolver-cu11 11.4.0.1 pypi_0 pypi nvidia-cusparse-cu11 11.7.4.91 pypi_0 pypi nvidia-nccl-cu11 2.14.3 pypi_0 pypi nvidia-nvtx-cu11 11.7.91 pypi_0 pypi omegaconf 2.3.0 pypi_0 pypi openssl 1.1.1v h7f8727e_0 packaging 23.0 py310h06a4308_0 pandas 2.0.3 pypi_0 pypi parso 0.8.3 pyhd3eb1b0_0 pathtools 0.1.2 pypi_0 pypi peft 0.4.0 pypi_0 pypi pexpect 4.8.0 pyhd3eb1b0_3 pickleshare 0.7.5 pyhd3eb1b0_1003 pillow 10.0.0 pypi_0 pypi pip 23.2.1 py310h06a4308_0 platformdirs 2.5.2 py310h06a4308_0 plotly 5.16.1 pypi_0 pypi prompt-toolkit 3.0.36 py310h06a4308_0 protobuf 4.24.0 pypi_0 pypi psutil 5.9.0 py310h5eee18b_0 ptyprocess 0.7.0 pyhd3eb1b0_2 pure_eval 0.2.2 pyhd3eb1b0_0 pyarrow 12.0.1 pypi_0 pypi pygments 2.15.1 py310h06a4308_1 pyparsing 3.0.9 pypi_0 pypi python 3.10.0 h12debd9_5 python-dateutil 2.8.2 pyhd3eb1b0_0 pytorch-lightning 2.0.6 pypi_0 pypi pytz 2023.3 pypi_0 pypi pyyaml 6.0.1 pypi_0 pypi pyzmq 25.1.0 py310h6a678d5_0 readline 8.2 h5eee18b_0 referencing 0.30.2 pypi_0 pypi regex 2023.8.8 pypi_0 pypi requests 2.31.0 pypi_0 pypi rpds-py 0.9.2 pypi_0 pypi safetensors 0.3.2 pypi_0 pypi scipy 1.11.1 pypi_0 pypi sentencepiece 0.1.99 pypi_0 pypi sentry-sdk 1.29.2 pypi_0 pypi setproctitle 1.3.2 pypi_0 pypi setuptools 68.0.0 py310h06a4308_0 six 1.16.0 pyhd3eb1b0_1 smmap 5.0.0 pypi_0 pypi sqlite 3.41.2 h5eee18b_0 stack_data 0.2.0 pyhd3eb1b0_0 sympy 1.12 pypi_0 pypi tenacity 8.2.3 pypi_0 pypi termcolor 2.3.0 pypi_0 pypi tk 8.6.12 h1ccaba5_0 tokenizers 0.13.3 pypi_0 pypi torch 2.0.1 pypi_0 pypi torchmetrics 1.0.3 pypi_0 pypi tornado 6.3.2 py310h5eee18b_0 tqdm 4.66.1 pypi_0 pypi traitlets 5.7.1 py310h06a4308_0 transformers 4.31.0 pypi_0 pypi triton 2.0.0 pypi_0 pypi typing-extensions 4.7.1 pypi_0 pypi tzdata 2023.3 pypi_0 pypi urllib3 2.0.4 pypi_0 pypi wandb 0.15.8 pypi_0 pypi wcwidth 0.2.5 pyhd3eb1b0_0 wheel 0.38.4 py310h06a4308_0 widgetsnbextension 4.0.5 py310h06a4308_0 xxhash 3.3.0 pypi_0 pypi xz 5.4.2 h5eee18b_0 yarl 1.9.2 pypi_0 pypi zeromq 4.3.4 h2531618_0 zlib 1.2.13 h5eee18b_0 active environment : None user config file : /home/alexey/.condarc populated config files : conda version : 23.1.0 conda-build version : 3.22.0 python version : 3.9.13.final.0 virtual packages : __archspec=1=x86_64 __cuda=12.0=0 __glibc=2.35=0 __linux=5.19.0=0 __unix=0=0 base environment : /opt/anaconda/anaconda3 (read only) conda av data dir : /opt/anaconda/anaconda3/etc/conda conda av metadata url : None channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /opt/anaconda/anaconda3/pkgs /home/alexey/.conda/pkgs envs directories : /home/alexey/.conda/envs /opt/anaconda/anaconda3/envs platform : linux-64 user-agent : conda/23.1.0 requests/2.31.0 CPython/3.9.13 Linux/5.19.0-46-generic ubuntu/22.04.2 glibc/2.35 UID:GID : 1009:1009 netrc file : /home/alexey/.netrc offline mode : False ```
24
Load dataset with non-existent file ### Describe the bug When load a dataset from datasets and pass a wrong path to json with the data, error message does not contain something abount "wrong path" or "file do not exist" - ```SchemaInferenceError: Please pass `features` or at least one example when writing data``` ### Steps to reproduce the bug ```python from datasets import load_dataset load_dataset('json', data_files='/home/alexey/unreal_file.json') ``` ### Expected behavior Raise os FileNotFound error or custom error with informative message ### Environment info ``` # packages in environment at /home/alexey/.conda/envs/alex_LoRA: # # Name Version Build Channel _libgcc_mutex 0.1 main _openmp_mutex 5.1 1_gnu accelerate 0.21.0 pypi_0 pypi aiohttp 3.8.5 pypi_0 pypi aiosignal 1.3.1 pypi_0 pypi antlr4-python3-runtime 4.9.3 pypi_0 pypi appdirs 1.4.4 pypi_0 pypi asttokens 2.0.5 pyhd3eb1b0_0 async-timeout 4.0.3 pypi_0 pypi attrs 23.1.0 pypi_0 pypi backcall 0.2.0 pyhd3eb1b0_0 bitsandbytes 0.41.1 pypi_0 pypi bzip2 1.0.8 h7b6447c_0 ca-certificates 2023.05.30 h06a4308_0 certifi 2023.7.22 pypi_0 pypi charset-normalizer 3.2.0 pypi_0 pypi click 8.1.6 pypi_0 pypi cmake 3.27.2 pypi_0 pypi comm 0.1.2 py310h06a4308_0 contourpy 1.1.0 pypi_0 pypi cycler 0.11.0 pypi_0 pypi datasets 2.14.4 pypi_0 pypi debugpy 1.6.7 py310h6a678d5_0 decorator 5.1.1 pyhd3eb1b0_0 dill 0.3.7 pypi_0 pypi docker-pycreds 0.4.0 pypi_0 pypi executing 0.8.3 pyhd3eb1b0_0 filelock 3.12.2 pypi_0 pypi fire 0.5.0 pypi_0 pypi fonttools 4.42.0 pypi_0 pypi frozenlist 1.4.0 pypi_0 pypi fsspec 2023.6.0 pypi_0 pypi gitdb 4.0.10 pypi_0 pypi gitpython 3.1.32 pypi_0 pypi huggingface-hub 0.16.4 pypi_0 pypi idna 3.4 pypi_0 pypi ipykernel 6.25.0 py310h2f386ee_0 ipython 8.12.2 py310h06a4308_0 ipython-genutils 0.2.0 pypi_0 pypi ipywidgets 8.0.4 py310h06a4308_0 jedi 0.18.1 py310h06a4308_1 jinja2 3.1.2 pypi_0 pypi jsonschema 4.19.0 pypi_0 pypi jsonschema-specifications 2023.7.1 pypi_0 pypi jupyter_client 8.1.0 py310h06a4308_0 jupyter_core 5.3.0 py310h06a4308_0 jupyterlab_widgets 3.0.5 py310h06a4308_0 kiwisolver 1.4.4 pypi_0 pypi ld_impl_linux-64 2.38 h1181459_1 libffi 3.3 he6710b0_2 libgcc-ng 11.2.0 h1234567_1 libgomp 11.2.0 h1234567_1 libsodium 1.0.18 h7b6447c_0 libstdcxx-ng 11.2.0 h1234567_1 libuuid 1.41.5 h5eee18b_0 lightning-utilities 0.9.0 pypi_0 pypi lit 16.0.6 pypi_0 pypi markupsafe 2.1.3 pypi_0 pypi matplotlib 3.7.2 pypi_0 pypi matplotlib-inline 0.1.6 py310h06a4308_0 mpmath 1.3.0 pypi_0 pypi multidict 6.0.4 pypi_0 pypi multiprocess 0.70.15 pypi_0 pypi nbformat 4.2.0 pypi_0 pypi ncurses 6.4 h6a678d5_0 nest-asyncio 1.5.6 py310h06a4308_0 networkx 3.1 pypi_0 pypi numpy 1.25.2 pypi_0 pypi nvidia-cublas-cu11 11.10.3.66 pypi_0 pypi nvidia-cuda-cupti-cu11 11.7.101 pypi_0 pypi nvidia-cuda-nvrtc-cu11 11.7.99 pypi_0 pypi nvidia-cuda-runtime-cu11 11.7.99 pypi_0 pypi nvidia-cudnn-cu11 8.5.0.96 pypi_0 pypi nvidia-cufft-cu11 10.9.0.58 pypi_0 pypi nvidia-curand-cu11 10.2.10.91 pypi_0 pypi nvidia-cusolver-cu11 11.4.0.1 pypi_0 pypi nvidia-cusparse-cu11 11.7.4.91 pypi_0 pypi nvidia-nccl-cu11 2.14.3 pypi_0 pypi nvidia-nvtx-cu11 11.7.91 pypi_0 pypi omegaconf 2.3.0 pypi_0 pypi openssl 1.1.1v h7f8727e_0 packaging 23.0 py310h06a4308_0 pandas 2.0.3 pypi_0 pypi parso 0.8.3 pyhd3eb1b0_0 pathtools 0.1.2 pypi_0 pypi peft 0.4.0 pypi_0 pypi pexpect 4.8.0 pyhd3eb1b0_3 pickleshare 0.7.5 pyhd3eb1b0_1003 pillow 10.0.0 pypi_0 pypi pip 23.2.1 py310h06a4308_0 platformdirs 2.5.2 py310h06a4308_0 plotly 5.16.1 pypi_0 pypi prompt-toolkit 3.0.36 py310h06a4308_0 protobuf 4.24.0 pypi_0 pypi psutil 5.9.0 py310h5eee18b_0 ptyprocess 0.7.0 pyhd3eb1b0_2 pure_eval 0.2.2 pyhd3eb1b0_0 pyarrow 12.0.1 pypi_0 pypi pygments 2.15.1 py310h06a4308_1 pyparsing 3.0.9 pypi_0 pypi python 3.10.0 h12debd9_5 python-dateutil 2.8.2 pyhd3eb1b0_0 pytorch-lightning 2.0.6 pypi_0 pypi pytz 2023.3 pypi_0 pypi pyyaml 6.0.1 pypi_0 pypi pyzmq 25.1.0 py310h6a678d5_0 readline 8.2 h5eee18b_0 referencing 0.30.2 pypi_0 pypi regex 2023.8.8 pypi_0 pypi requests 2.31.0 pypi_0 pypi rpds-py 0.9.2 pypi_0 pypi safetensors 0.3.2 pypi_0 pypi scipy 1.11.1 pypi_0 pypi sentencepiece 0.1.99 pypi_0 pypi sentry-sdk 1.29.2 pypi_0 pypi setproctitle 1.3.2 pypi_0 pypi setuptools 68.0.0 py310h06a4308_0 six 1.16.0 pyhd3eb1b0_1 smmap 5.0.0 pypi_0 pypi sqlite 3.41.2 h5eee18b_0 stack_data 0.2.0 pyhd3eb1b0_0 sympy 1.12 pypi_0 pypi tenacity 8.2.3 pypi_0 pypi termcolor 2.3.0 pypi_0 pypi tk 8.6.12 h1ccaba5_0 tokenizers 0.13.3 pypi_0 pypi torch 2.0.1 pypi_0 pypi torchmetrics 1.0.3 pypi_0 pypi tornado 6.3.2 py310h5eee18b_0 tqdm 4.66.1 pypi_0 pypi traitlets 5.7.1 py310h06a4308_0 transformers 4.31.0 pypi_0 pypi triton 2.0.0 pypi_0 pypi typing-extensions 4.7.1 pypi_0 pypi tzdata 2023.3 pypi_0 pypi urllib3 2.0.4 pypi_0 pypi wandb 0.15.8 pypi_0 pypi wcwidth 0.2.5 pyhd3eb1b0_0 wheel 0.38.4 py310h06a4308_0 widgetsnbextension 4.0.5 py310h06a4308_0 xxhash 3.3.0 pypi_0 pypi xz 5.4.2 h5eee18b_0 yarl 1.9.2 pypi_0 pypi zeromq 4.3.4 h2531618_0 zlib 1.2.13 h5eee18b_0 active environment : None user config file : /home/alexey/.condarc populated config files : conda version : 23.1.0 conda-build version : 3.22.0 python version : 3.9.13.final.0 virtual packages : __archspec=1=x86_64 __cuda=12.0=0 __glibc=2.35=0 __linux=5.19.0=0 __unix=0=0 base environment : /opt/anaconda/anaconda3 (read only) conda av data dir : /opt/anaconda/anaconda3/etc/conda conda av metadata url : None channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache : /opt/anaconda/anaconda3/pkgs /home/alexey/.conda/pkgs envs directories : /home/alexey/.conda/envs /opt/anaconda/anaconda3/envs platform : linux-64 user-agent : conda/23.1.0 requests/2.31.0 CPython/3.9.13 Linux/5.19.0-46-generic ubuntu/22.04.2 glibc/2.35 UID:GID : 1009:1009 netrc file : /home/alexey/.netrc offline mode : False ``` This was fixed in https://github.com/huggingface/datasets/pull/6155, which will be included in the next release (or you can install `datasets` from source to use it immediately).
[ 0.08426662534475327, 0.1280890703201294, -0.019782381132245064, 0.057471875101327896, 0.303114652633667, 0.04349599778652191, 0.11329827457666397, -0.09337198734283447, 0.043552886694669724, 0.10302563011646271, -0.027993587777018547, -0.06159035488963127, 0.014954889193177223, -0.06574893742799759, 0.05056120082736015, 0.09007344394922256, -0.05137106776237488, 0.05947386845946312, 0.13193351030349731, 0.010022871196269989, -0.12831154465675354, -0.0006342940032482147, 0.11251941323280334, -0.049867402762174606, -0.05292842909693718, 0.020123684778809547, -0.029973549768328667, 0.31436991691589355, 0.05722010135650635, -0.15849950909614563, 0.10632269084453583, -0.12689973413944244, -0.021355094388127327, 0.1513618528842926, 0.000005755497113568708, -0.03409500792622566, 0.13344134390354156, -0.023301711305975914, -0.053774721920490265, -0.22082938253879547, 0.04615836217999458, -0.13536329567432404, -0.10948638617992401, -0.015201875939965248, 0.03528572618961334, -0.18756859004497528, -0.03312506899237633, -0.025053121149539948, -0.06684217602014542, 0.09522455930709839, -0.10590982437133789, 0.04186149686574936, -0.11483259499073029, -0.13372452557086945, 0.05676678568124771, 0.08796895295381546, 0.04350646957755089, 0.044537466019392014, -0.3289123773574829, -0.12251763045787811, 0.011810909025371075, -0.1330411732196808, -0.135395348072052, 0.049169063568115234, -0.04564184695482254, -0.021230554208159447, -0.10640557110309601, -0.05452989786863327, 0.035281483083963394, 0.29863646626472473, -0.028258169069886208, 0.10110536962747574, -0.13640306890010834, -0.1282978504896164, 0.020853683352470398, -0.059801697731018066, 0.027887830510735512, 0.12515892088413239, -0.07256019115447998, 0.09191152453422546, -0.021203532814979553, -0.04866185039281845, -0.07881580293178558, -0.017901895567774773, -0.10606420785188675, 0.008080133236944675, -0.16440385580062866, -0.005718444939702749, -0.026618577539920807, -0.023910336196422577, 0.006743011064827442, 0.0023934761993587017, -0.1441074013710022, -0.19368420541286469, 0.1523331105709076, 0.08061599731445312, -0.08115529268980026, -0.07734432071447372, 0.028185304254293442, -0.13681377470493317, -0.013584102503955364, -0.14861492812633514, -0.08917385339736938, 0.09821853041648865, 0.16773535311222076, -0.028118303045630455, 0.12404860556125641, 0.007044807076454163, -0.022015953436493874, 0.014190386980772018, 0.05411773920059204, 0.11386710405349731, -0.2616790533065796, -0.16352945566177368, -0.027448594570159912, 0.01677197962999344, 0.12228219211101532, 0.039938684552907944, -0.0034376168623566628, 0.12463181465864182, -0.060922108590602875, 0.08704191446304321, -0.16503913700580597, 0.2033393234014511, 0.08189060539007187, -0.02568984031677246, 0.03450268134474754, 0.08391612023115158, -0.08802355080842972, 0.0071397265419363976, 0.06378643959760666, 0.014004604890942574, -0.049477286636829376, 0.10917516052722931, 0.16328908503055573, 0.011089199222624302, 0.10448331385850906, -0.1753464639186859, -0.16685988008975983, -0.06136864796280861, 0.21340014040470123, -0.06718362122774124, -0.16900503635406494, 0.0106496661901474, 0.037594493478536606, -0.02180514857172966, -0.03841887414455414, -0.02238423563539982, -0.1168442815542221, 0.06020909175276756, -0.32755547761917114, 0.04292484000325203, -0.23582956194877625, 0.17384639382362366, -0.13286519050598145, -0.05416567996144295, -0.20554094016551971, -0.07338093221187592, -0.24427559971809387, -0.10471924394369125, 0.005130570847541094, 0.01132694911211729, 0.13843652606010437, -0.103423573076725, 0.07374051958322525, 0.11047938466072083, 0.056941140443086624, 0.01871500536799431, -0.013895666226744652, 0.07750411331653595, -0.04505898803472519, -0.11379417032003403, -0.01454805489629507, 0.04018177092075348, -0.23678754270076752, 0.0862797275185585, -0.07345055788755417, -0.00242266315035522, -0.05012541264295578, 0.13585621118545532, 0.11220250278711319, 0.0505371056497097, -0.026779696345329285, -0.0034701700787991285, 0.0033931888174265623, -0.005663811229169369, -0.09701506048440933, -0.07105693966150284, 0.07955782115459442, -0.16042737662792206, -0.0019132968736812472, -0.008393717929720879, 0.012472587637603283, 0.028406130149960518, -0.07764387875795364, -0.11587152630090714, -0.09594911336898804, -0.1049516424536705, 0.08908681571483612, -0.11072657257318497, -0.1460227072238922, 0.14530472457408905, 0.13024330139160156, 0.05425203591585159, 0.030907675623893738, 0.004434640519320965, -0.07361935824155807, 0.15271788835525513, 0.06474214047193527, -0.209633007645607, -0.1523817926645279, -0.024292612448334694, -0.14114338159561157, 0.04642155393958092, -0.08735305815935135, 0.002950266469269991, -0.11168816685676575, 0.11273784935474396, -0.15835337340831757, 0.0703006386756897, 0.007066074758768082, 0.10853345692157745, 0.07349581271409988, -0.05971039831638336, 0.013329071924090385, 0.12461555749177933, 0.027843471616506577, 0.03614034876227379, -0.02252284623682499, 0.12798210978507996, -0.006696843542158604, -0.07124123722314835, 0.14378350973129272, 0.190946564078331, -0.08293981850147247, 0.02333773486316204, -0.004675386473536491, -0.028555434197187424, -0.0005107206525281072, -0.1733388751745224, -0.04902444779872894, 0.09679602831602097, 0.07810250669717789, -0.1357136070728302, -0.031028427183628082, 0.1361558586359024, -0.023430807515978813, 0.19743935763835907, -0.05421346798539162, 0.006265353411436081, 0.36108341813087463, 0.17735570669174194, -0.17782540619373322, 0.1369604766368866, 0.094981849193573, 0.13059429824352264, 0.012279591523110867, 0.16919508576393127, -0.13624337315559387, -0.20516984164714813, 0.18706007301807404, -0.07659115642309189, 0.0009515292476862669, -0.019600674510002136, 0.11982452124357224, -0.015078111551702023, 0.007594204507768154, 0.02663099206984043, 0.012351460754871368, 0.18268196284770966, -0.10521457344293594, -0.0020775070879608393, -0.19928117096424103, -0.09675950556993484, 0.044913336634635925, -0.10230954736471176, 0.012585712596774101, -0.031716447323560715, -0.034367360174655914, 0.007628067396581173, -0.15395668148994446, 0.06588714569807053, 0.0660872608423233, -0.11808626353740692, 0.13425450026988983, 0.07189393788576126, -0.04986169561743736, 0.021696820855140686, -0.06469884514808655, 0.04567273333668709, -0.015079298056662083, 0.09104125201702118, 0.06716606020927429, -0.10469338297843933, -0.01604992151260376, 0.11247460544109344, 0.1046794131398201, -0.09514003247022629, -0.10394483059644699, -0.07707040011882782, 0.0664711520075798, 0.07711677253246307, 0.0528976134955883, 0.04543992504477501, 0.08383378386497498, 0.0890883356332779, 0.16433267295360565, 0.06220146268606186, -0.2098754495382309, -0.03421953320503235, 0.0294030774384737, -0.037497036159038544, 0.06952306628227234, 0.13827849924564362, -0.045706573873758316, -0.0058801486156880856, 0.07171422243118286, -0.24153117835521698, 0.15871407091617584, 0.1875065714120865, 0.022578852251172066, 0.2616403102874756, -0.06893592327833176, -0.07786157727241516, 0.05455059930682182, -0.028552530333399773, -0.12100774794816971, 0.004702843725681305, -0.10324810445308685, 0.016066627576947212, -0.09709324687719345, 0.15710848569869995, 0.013475884683430195, -0.06756985187530518, -0.05312075838446617, -0.16283707320690155, -0.038654398173093796, -0.10510734468698502, 0.28391528129577637, 0.022530611604452133, 0.015623115003108978, 0.15415042638778687, -0.052156124264001846, -0.0731523334980011, -0.047898031771183014, -0.14108137786388397, 0.027392784133553505, -0.03646496310830116, -0.024327365681529045, -0.2154320925474167, -0.08908066153526306, 0.025209419429302216, 0.05464766174554825, -0.05146420747041702, -0.03248496353626251, -0.0060278382152318954, -0.02442069910466671, 0.20344214141368866, 0.011624971404671669, 0.16542133688926697, -0.03712398558855057, -0.10272013396024704, 0.021447893232107162, 0.03968160226941109, -0.06025948375463486, 0.14357700943946838, 0.13408702611923218, 0.17959417402744293, 0.08777797967195511, -0.02682485431432724, -0.021825594827532768, -0.01740313321352005, -0.009546129032969475, -0.03795994818210602, 0.01838059350848198, 0.05889904499053955, -0.027453182265162468, -0.17225462198257446, 0.0546233206987381, 0.0013360168086364865, 0.00590914161875844, -0.16048817336559296, -0.049921195954084396, 0.12406811863183975, 0.07451219111680984, -0.03411296382546425, 0.05799245461821556, 0.03298409283161163, 0.0022493067663162947, 0.2595132887363434, 0.08905457705259323, 0.17878170311450958, -0.003940837923437357, -0.024590859189629555, -0.040244150906801224, -0.1136380061507225, 0.25114360451698303, 0.08837275207042694, 0.056134916841983795, -0.07732240110635757, 0.0741359144449234, 0.0735883042216301, 0.054841406643390656, 0.07745861262083054, 0.1176074892282486, 0.23469769954681396, 0.030426133424043655, -0.09744053333997726, 0.05441989749670029, -0.059190575033426285, -0.038244422525167465, 0.12798938155174255, 0.003354727989062667, 0.0599195770919323, 0.11017007380723953, 0.15463006496429443, -0.040774326771497726, -0.1540181040763855, -0.13138025999069214, -0.21424539387226105, -0.13666315376758575, -0.17494195699691772, 0.1721256971359253, 0.10360631346702576, -0.04043445363640785, -0.0007644494762644172, 0.015240831300616264, 0.015932409092783928, 0.09329243749380112, -0.039040662348270416, 0.09100694209337234, -0.013140172697603703, 0.12434923648834229, -0.030697381123900414, 0.13207505643367767, 0.051687657833099365, 0.40928322076797485, 0.02757379226386547, -0.05688132718205452, -0.06949470192193985, -0.25656458735466003, -0.06927961856126785, 0.013751217164099216, -0.0008689393871463835, 0.018749266862869263, -0.017720837146043777, -0.223266139626503, -0.01667812280356884, -0.03407103568315506, -0.11907672882080078, -0.09982389956712723, -0.025235334411263466, -0.11290338635444641, -0.10866225510835648, -0.07432924956083298, -0.04072196036577225, 0.022340955212712288, -0.10151161253452301, 0.008769805543124676, 0.17746081948280334, -0.14172755181789398, -0.07069610804319382, 0.02663479372859001, 0.05904298275709152, 0.07872366905212402, 0.1529073417186737, 0.19912825524806976, -0.17553392052650452, 0.028124352917075157, 0.14379945397377014, -0.06728935986757278, 0.11029160767793655, -0.10227113962173462, 0.06109527498483658, 0.22086462378501892, 0.11032815277576447, 0.06636819988489151, 0.026638967916369438, -0.05583852156996727, 0.11982011795043945, 0.15404081344604492, 0.07504324615001678, 0.2576436698436737, -0.13367784023284912, -0.06675946712493896, 0.1558799296617508, 0.07830320298671722, -0.0581793449819088, -0.1896689385175705, -0.022511422634124756, 0.17401647567749023, 0.06938256323337555, 0.16776074469089508, -0.18292079865932465, -0.08650743216276169, -0.034533869475126266, -0.07110995799303055, 0.11376911401748657, 0.09130311757326126, 0.09355025738477707, 0.03197299689054489, -0.05263032019138336, 0.027960292994976044, -0.04309422895312309, 0.008600586093962193, -0.07172176241874695, 0.04321978613734245, -0.04732372239232063, -0.11511706560850143, -0.07408188283443451, 0.03787018731236458, -0.10701912641525269, -0.07608954608440399, 0.028187129646539688, 0.12095209956169128, 0.10564057528972626, -0.03274790570139885, -0.10121254622936249, -0.022747425362467766, 0.06409813463687897, 0.09650947153568268, -0.02056461200118065, 0.10289540886878967, -0.04493904486298561, -0.0749606266617775, 0.0989956259727478, -0.11105030030012131, 0.04781489074230194, 0.1901257485151291, 0.008507083170115948, 0.05041209235787392, 0.03333471342921257, 0.061035480350255966, 0.021357284858822823, -0.041178956627845764, 0.09754078090190887, 0.07554971426725388, -0.14332686364650726, -0.03854919970035553, 0.1795419454574585, -0.0007333430112339556, -0.2021995335817337, 0.005082148592919111, 0.20400525629520416, 0.09943832457065582, 0.14226484298706055, -0.09918655455112457, -0.030178748071193695, -0.02279629372060299, -0.09007661044597626, 0.005877173971384764, 0.16584540903568268, 0.03645286709070206, -0.053484149277210236, -0.167256161570549, -2.480636912332642e-32, 0.010784926824271679, -0.09136302769184113, -0.07048697024583817, 0.00972768198698759, 0.009563833475112915, 0.02474520355463028, -0.013795152306556702, -0.03069394640624523, -0.17127865552902222, -0.04336872696876526, -0.0631103366613388, -0.059191737323999405, 0.027080243453383446, 0.03871295973658562, -0.15828506648540497, -0.08280734717845917, -0.16318459808826447, -0.031866367906332016, 0.043580424040555954, -0.025368278846144676, 0.09436312317848206, 0.11230771243572235, 0.04531460255384445, -0.10974838584661484, -0.013195933774113655, -0.2624058127403259, 0.05486701428890228, -0.18933647871017456, -0.0017650201916694641, -0.07467719167470932, -0.1127014011144638, 0.010190089233219624, 0.046797171235084534, -0.050409622490406036, -0.05021332949399948, -0.07624305039644241, -0.12483521550893784, -0.034118905663490295, 0.052941516041755676, 0.05309533327817917, 0.049256619065999985, 0.08784740418195724, 0.06275607645511627, -0.2815423011779785, 0.08923561871051788, 0.12703078985214233, 0.11971927434206009, 0.011288536712527275, -0.12916146218776703, -0.03638392686843872, -0.046684831380844116, -0.028547734022140503, 0.0760011151432991, -0.000548359879758209, -0.04059523716568947, 0.04386750981211662, -0.024260329082608223, 0.08046918362379074, -0.06405175477266312, -0.05479190871119499, 0.02881508693099022, -0.14067746698856354, 0.060606613755226135, -0.25277891755104065, 0.15531520545482635, -0.019215049222111702, 0.20425699651241302, 0.11354514211416245, 0.022618327289819717, 0.0013322074664756656, 0.09842425584793091, 0.05359689146280289, -0.24307970702648163, -0.05096008628606796, -0.04971574246883392, -0.06815647333860397, -0.21550533175468445, -0.006001209374517202, -0.11452487856149673, -0.1111951544880867, 0.045442335307598114, -0.025254568085074425, -0.1367461383342743, 0.039906393736600876, 0.04239758849143982, 0.040026333183050156, -0.0725194662809372, -0.05219504237174988, -0.18579746782779694, -0.10679878294467926, 0.04139721021056175, -0.16177938878536224, -0.13710880279541016, -0.0947830006480217, 0.02468547411262989, 0.09194064140319824, 0.08700443804264069, -0.03830936923623085, -0.13043084740638733, 0.06636465340852737, 0.024965180084109306, -0.021427111700177193, 0.17047831416130066, -0.06653696298599243, 0.09743869304656982, 0.09146701544523239, 0.14840112626552582, 0.06949624419212341, -0.04640387371182442, -0.035192690789699554, -0.09326253831386566, -0.012561709620058537, 0.11399559676647186, 0.07657146453857422, 0.12616877257823944, 0.1548764407634735, -0.15810714662075043, -0.1243920773267746, 0.10249730944633484, 0.12222930043935776, -0.1972547471523285, 0.048795945942401886, -0.0773572325706482, -0.03679623827338219, -0.11597412079572678, 0.20129136741161346, -0.08011768758296967, -0.20011097192764282, 0.00476206885650754, 0.05106022581458092, 0.06876448541879654, -0.0019719323609024286, 7.504987138418073e-7, -0.27981385588645935, 0.011706055141985416, -0.0031772174406796694, 0.09259691834449768, -0.09654632210731506, 0.038606759160757065, -0.29177722334861755, 0.00596680399030447, -0.05317629873752594, 0.020253773778676987, 0.3043137192726135, -0.0749969482421875, -0.08686348050832748, -0.04487146809697151, -0.07166358083486557, 0.13863413035869598, -0.04798951745033264, 0.006305670365691185, 0.023216327652335167, -0.09042493253946304, 0.06569802016019821, 0.18783888220787048, -0.05380196124315262, -0.08885262906551361, -0.013676227070391178, 0.01974787935614586, -0.0697682723402977, 0.013433684594929218, 0.07192379236221313, -0.038538858294487, -0.04563008248806, 0.08615341037511826, -0.08384700864553452, 0.1267250031232834, 0.01848795637488365, -0.08548430353403091, -0.11584661900997162, -0.06226341426372528, 0.14878159761428833, -0.04382362961769104, 0.14419938623905182, 0.09833341836929321, -0.026177046820521355, 0.1322307586669922, 0.04097157344222069, -0.01868375949561596, -0.10297037661075592, -0.08367002010345459, -0.11650694161653519, 0.2571423053741455, -0.041703078895807266, 0.13024495542049408, 0.17775797843933105, 0.0034474439453333616, -0.011700022034347057, -0.12419518083333969, 0.03533555194735527, -0.040286168456077576, 0.1977444291114807, 0.07141302525997162, -0.06980016827583313, -0.0015296872006729245, 0.1527332067489624, -0.12897351384162903, 0.15604309737682343, 0.029611099511384964, 0.044239237904548645, 7.918100100602677e-35, 0.072791688144207, -0.05524555221199989, 0.0847235843539238, -0.20868749916553497, -0.13012854754924774, -0.015064353123307228, 0.0734771341085434, -0.06158833205699921, 0.015188239514827728, -0.10110156238079071, 0.018341444432735443 ]
https://github.com/huggingface/datasets/issues/6182
Loading Meteor metric in HF evaluate module crashes due to datasets import issue
Our minimal Python version requirement is 3.8, so we dropped `importlib_metadata`. Feel free to open a PR in the `evaluate` repo to replace the problematic import with ```python if PY_VERSION < version.parse("3.8"): import importlib_metadata else: import importlib.metadata as importlib_metadata ```
### Describe the bug When using python3.9 and ```evaluate``` module loading Meteor metric crashes at a non-existent import from ```datasets.config``` in ```datasets v2.14``` ### Steps to reproduce the bug ``` from evaluate import load meteor = load("meteor") ``` produces the following error: ``` from datasets.config import importlib_metadata, version ImportError: cannot import name 'importlib_metadata' from 'datasets.config' (<path_to_project>/venv/lib/python3.9/site-packages/datasets/config.py) ``` ### Expected behavior ```datasets``` of v2.10 has the following workaround in ```config.py```: ``` if PY_VERSION < version.parse("3.8"): import importlib_metadata else: import importlib.metadata as importlib_metadata ``` However, it's absent in v2.14 which might be the cause of the issue. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-13.5-arm64-arm-64bit - Python version: 3.9.6 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 - Evaluate version: 0.4.0
40
Loading Meteor metric in HF evaluate module crashes due to datasets import issue ### Describe the bug When using python3.9 and ```evaluate``` module loading Meteor metric crashes at a non-existent import from ```datasets.config``` in ```datasets v2.14``` ### Steps to reproduce the bug ``` from evaluate import load meteor = load("meteor") ``` produces the following error: ``` from datasets.config import importlib_metadata, version ImportError: cannot import name 'importlib_metadata' from 'datasets.config' (<path_to_project>/venv/lib/python3.9/site-packages/datasets/config.py) ``` ### Expected behavior ```datasets``` of v2.10 has the following workaround in ```config.py```: ``` if PY_VERSION < version.parse("3.8"): import importlib_metadata else: import importlib.metadata as importlib_metadata ``` However, it's absent in v2.14 which might be the cause of the issue. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-13.5-arm64-arm-64bit - Python version: 3.9.6 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 - Evaluate version: 0.4.0 Our minimal Python version requirement is 3.8, so we dropped `importlib_metadata`. Feel free to open a PR in the `evaluate` repo to replace the problematic import with ```python if PY_VERSION < version.parse("3.8"): import importlib_metadata else: import importlib.metadata as importlib_metadata ```
[ -0.10004568845033646, 0.2683805823326111, -0.045661188662052155, -0.029668476432561874, 0.2267894446849823, -0.02300560474395752, -0.004466937854886055, 0.1137363538146019, -0.06478044390678406, -0.019427604973316193, -0.04059514403343201, 0.005322905723005533, -0.12442881613969803, -0.11583450436592102, 0.04326393082737923, 0.01563039980828762, -0.156322181224823, 0.0388275645673275, -0.026161668822169304, 0.06130305305123329, -0.07842238247394562, 0.02015899308025837, 0.07960119098424911, -0.031400639563798904, 0.0895293578505516, 0.09627953916788101, 0.025803331285715103, 0.008580236695706844, 0.16311097145080566, -0.22565637528896332, 0.07452371716499329, 0.09872589260339737, 0.019949493929743767, 0.20868021249771118, 0.000006065734851290472, -0.18453656136989594, -0.011722998693585396, 0.17118969559669495, -0.055135536938905716, -0.23315411806106567, 0.19591107964515686, -0.04877903312444687, 0.001543271355330944, -0.06837178021669388, 0.025841236114501953, -0.1904151290655136, -0.1719803363084793, -0.020121902227401733, 0.10494042187929153, 0.005806844215840101, 0.017150675877928734, 0.06812123209238052, -0.048591289669275284, -0.2162618190050125, 0.1173209697008133, -0.000374025636119768, 0.04047549143433571, 0.17459802329540253, -0.1599908024072647, -0.14585693180561066, -0.0621890053153038, -0.08786693215370178, -0.03046429716050625, 0.08222810924053192, -0.033881619572639465, -0.021475927904248238, -0.11214316636323929, 0.0577792264521122, 0.018453678116202354, 0.2026066780090332, 0.1702699214220047, 0.11923722922801971, -0.09106620401144028, 0.058727238327264786, -0.06998138129711151, -0.15226095914840698, -0.01133805699646473, -0.0254670437425375, -0.02368808351457119, 0.06626350432634354, -0.04553639516234398, -0.06468284130096436, -0.04537646844983101, -0.011353532783687115, -0.07840798795223236, 0.19932304322719574, -0.09082969278097153, 0.031696729362010956, 0.12182854115962982, -0.13601794838905334, 0.14494799077510834, 0.07996036112308502, -0.05711817368865013, -0.22313904762268066, 0.3144589066505432, 0.025786833837628365, 0.037533704191446304, -0.10055116564035416, -0.039529602974653244, -0.08135370165109634, -0.1003686934709549, -0.0027887634932994843, 0.02300170250236988, 0.08747270703315735, 0.11507164686918259, -0.06544356048107147, 0.16149838268756866, -0.016207559034228325, 0.054507527500391006, 0.013732235878705978, -0.008524037897586823, 0.11323864012956619, -0.09318584203720093, -0.14821988344192505, 0.18384557962417603, 0.06017466261982918, 0.07503041625022888, 0.04112064838409424, -0.1611546128988266, 0.1320919394493103, 0.049778617918491364, -0.024750586599111557, -0.04879162460565567, 0.02476436272263527, -0.02653687633574009, -0.012371569871902466, -0.05401189252734184, 0.08676284551620483, 0.04347771406173706, 0.0036845430731773376, 0.011745297349989414, 0.03365957364439964, -0.09407886862754822, 0.040054138749837875, 0.10667431354522705, -0.06504038721323013, 0.12764480710029602, -0.1642448902130127, -0.008836470544338226, 0.0038882005028426647, 0.05368562415242195, -0.05614788457751274, -0.16544359922409058, -0.05328930914402008, 0.10094690322875977, 0.09700167924165726, 0.1397821009159088, -0.15802277624607086, -0.0740995928645134, -0.09534557908773422, -0.2685975730419159, 0.0662195011973381, -0.166206955909729, -0.008974160067737103, -0.205532506108284, -0.024351816624403, -0.08092109113931656, -0.05482349544763565, -0.28775691986083984, -0.03166521340608597, -0.08146963268518448, -0.02649528905749321, 0.03330855071544647, -0.033686306327581406, 0.21019944548606873, 0.27519065141677856, -0.09574627131223679, 0.04123114049434662, -0.15766684710979462, 0.03201720863580704, -0.09590383619070053, -0.14661771059036255, -0.12037968635559082, 0.03363161161541939, -0.3000859320163727, -0.085429348051548, 0.15849162638187408, -0.1126326471567154, -0.07744769752025604, 0.06713303923606873, 0.14135108888149261, -0.030791321769356728, -0.1110769733786583, -0.21564948558807373, 0.09854971617460251, 0.08905602991580963, -0.0016007848316803575, 0.017855379730463028, 0.023504676297307014, -0.22756770253181458, 0.025974992662668228, 0.09726676344871521, -0.09812507033348083, 0.19713285565376282, 0.18130117654800415, -0.11026863753795624, 0.04160516709089279, 0.04032646492123604, 0.15962539613246918, -0.1359931230545044, -0.057762082666158676, 0.1500430703163147, 0.027527017518877983, 0.09519681334495544, 0.10824137181043625, -0.0990326777100563, 0.010239102877676487, 0.10307732224464417, 0.09103134274482727, -0.12779925763607025, -0.12919580936431885, 0.11975296586751938, -0.19904126226902008, 0.12283259630203247, -0.1223016232252121, -0.1311197280883789, 0.00978985894471407, 0.12615150213241577, -0.08246558159589767, 0.11543893814086914, 0.023183992132544518, 0.1691083014011383, 0.04765509068965912, 0.08079683780670166, 0.18031048774719238, 0.023685453459620476, -0.06587456911802292, -0.018770843744277954, -0.0747840404510498, 0.04483814537525177, -0.10420984029769897, -0.04143669828772545, 0.09917493164539337, 0.12347599864006042, 0.013958203606307507, 0.04554678499698639, 0.1612023264169693, -0.09398069977760315, 0.1171974167227745, -0.010501416400074959, -0.08840256184339523, -0.0785844624042511, 0.023058472201228142, -0.0040682051330804825, -0.0730089396238327, 0.08955483883619308, 0.054859016090631485, 0.07361249625682831, 0.03624662756919861, -0.09579009562730789, 0.17065517604351044, 0.0911293774843216, -0.18615476787090302, -0.05623297020792961, 0.09052297472953796, -0.10623865574598312, -0.009497792460024357, -0.04786389321088791, 0.07345890998840332, -0.15097305178642273, 0.1743600219488144, 0.057070210576057434, 0.11034215986728668, -0.047510094940662384, 0.06686627119779587, -0.06358008831739426, -0.07111082971096039, -0.0671166405081749, 0.1462220549583435, 0.07934283465147018, 0.05596749112010002, -0.03400436043739319, -0.12976804375648499, -0.04568109288811684, 0.09308965504169464, -0.10310139507055283, -0.07485231757164001, -0.004787004552781582, 0.02084818296134472, 0.04619411751627922, -0.22061863541603088, 0.06659356504678726, 0.14868047833442688, -0.07624562084674835, 0.03397052735090256, 0.10913961380720139, -0.18652012944221497, 0.22459734976291656, -0.0037274190690368414, -0.07230687886476517, -0.029085133224725723, 0.021355535835027695, -0.029719876125454903, -0.014696529135107994, 0.040498897433280945, -0.062292881309986115, 0.14119480550289154, -0.028287723660469055, -0.0798071101307869, 0.019459430128335953, 0.11967641115188599, -0.09874731302261353, 0.011370841413736343, 0.059168729931116104, 0.02586892433464527, 0.1836869865655899, 0.17477311193943024, 0.051748037338256836, -0.20211340487003326, -0.06009255722165108, -0.18197035789489746, 0.020403414964675903, 0.058977846056222916, 0.20110902190208435, -0.08095745742321014, -0.10301366448402405, 0.08336653560400009, 0.08861571550369263, 0.11904505640268326, 0.15817369520664215, 0.15199168026447296, 0.11986840516328812, -0.09330956637859344, -0.20159535109996796, 0.0010188529267907143, 0.0997818186879158, -0.20181156694889069, -0.19688944518566132, -0.20749476552009583, -0.021199045702815056, -0.1262972503900528, -0.01740001142024994, 0.08845239877700806, -0.15469957888126373, -0.12396766990423203, -0.10966949909925461, -0.15070118010044098, -0.06530483812093735, 0.3598756194114685, -0.15744681656360626, -0.028522025793790817, 0.1080639511346817, 0.011931524612009525, 0.01906699873507023, 0.030845463275909424, -0.10466481745243073, -0.007529840804636478, -0.07627380639314651, -0.0738324522972107, -0.00955292023718357, 0.03287699446082115, -0.007020843680948019, -0.01167861558496952, -0.01186368241906166, -0.03461195155978203, 0.04348033294081688, 0.033482734113931656, -0.02485717087984085, 0.02052004635334015, 0.06041589006781578, 0.07605623453855515, 0.08462819457054138, 0.1326330304145813, 0.1392827183008194, -0.10996866226196289, 0.10429563373327255, 0.07701926678419113, 0.057309601455926895, 0.06805714964866638, -0.020628640428185463, -0.22635863721370697, -0.012020338326692581, 0.09780522435903549, 0.004755580797791481, -0.043099649250507355, 0.033590108156204224, -0.16630496084690094, -0.236650288105011, 0.10767953842878342, -0.009516256861388683, 0.07362177222967148, -0.12968921661376953, -0.05938826501369476, 0.09165848046541214, 0.07390250265598297, 0.09879240393638611, 0.05905604735016823, 0.10906462371349335, 0.030950600281357765, -0.021633820608258247, 0.037087343633174896, 0.2706470191478729, 0.16143487393856049, -0.10600687563419342, -0.059050556272268295, -0.1286461055278778, 0.2001628875732422, -0.05795559287071228, 0.1623721867799759, 0.024666203185915947, 0.053382452577352524, 0.09126479178667068, -0.004435926675796509, 0.1360258162021637, 0.18169160187244415, -0.10087176412343979, -0.13861717283725739, -0.015315879136323929, -0.08195646852254868, -0.07464459538459778, -0.0541415810585022, 0.1799928992986679, -0.060590486973524094, -0.05732817202806473, 0.04717714712023735, 0.045902810990810394, -0.026160411536693573, -0.084965281188488, -0.2748648226261139, -0.05880904197692871, -0.013430770486593246, -0.14726139605045319, 0.07705692201852798, 0.12079326808452606, 0.13246329128742218, 0.0005240606842562556, 0.06927267462015152, -0.06688513606786728, 0.096516914665699, -0.03710094466805458, -0.024770893156528473, -0.05469101667404175, 0.16502776741981506, -0.07608196884393692, -0.10546725243330002, 0.05614263564348221, 0.2689918279647827, -0.003882151562720537, -0.1642673909664154, 0.05624714866280556, -0.14447399973869324, 0.021247290074825287, 0.08561179786920547, -0.09823901951313019, -0.13603468239307404, -0.14054347574710846, -0.020728660747408867, -0.0411003939807415, -0.015404277481138706, -0.18151478469371796, 0.018804697319865227, -0.05858360975980759, -0.03632543608546257, -0.14065305888652802, 0.1037948802113533, -0.01807451620697975, 0.17517799139022827, -0.08240196108818054, 0.09473517537117004, 0.06796418875455856, -0.07427928596735, -0.10111283510923386, -0.057238705456256866, -0.014340884983539581, 0.13161227107048035, 0.027597609907388687, 0.18650121986865997, -0.1695455014705658, -0.11857535690069199, 0.06334978342056274, -0.06607087701559067, 0.09580762684345245, -0.12037230283021927, 0.12036477774381638, 0.04191610589623451, 0.10939695686101913, 0.10443072766065598, -0.056556928902864456, -0.11772830039262772, -0.03155761957168579, 0.16613498330116272, 0.132524773478508, 0.11235874891281128, -0.15053318440914154, 0.07979154586791992, 0.0020156267564743757, 0.04309096187353134, -0.20858129858970642, -0.13995832204818726, -0.09677715599536896, 0.18454889953136444, 0.017368685454130173, 0.20318740606307983, 0.13426163792610168, 0.15302400290966034, -0.014411771669983864, -0.10070013999938965, 0.14211000502109528, -0.06925716251134872, 0.14875614643096924, -0.0053803143091499805, -0.13371247053146362, 0.0012218216434121132, -0.2647077739238739, 0.059717025607824326, -0.12275190651416779, 0.10494504123926163, -0.08708889037370682, -0.013966026715934277, -0.15798726677894592, 0.013506283983588219, 0.03748015686869621, -0.03587263822555542, 0.04126526787877083, 0.03431454300880432, 0.04059973359107971, -0.04122012481093407, 0.05064072832465172, 0.06906264275312424, 0.06062724068760872, -0.04277310520410538, -0.047760263085365295, -0.10085371136665344, -0.0170928705483675, 0.18080544471740723, 0.09411191195249557, -0.016620978713035583, 0.08541954308748245, 0.13117615878582, -0.07766067981719971, 0.1683126986026764, 0.07574035972356796, 0.17256879806518555, -0.12827351689338684, -0.07390516996383667, 0.030428672209382057, -0.009208789095282555, -0.09362512081861496, 0.026144718751311302, 0.08297281712293625, -0.0854535773396492, -0.07844538241624832, -0.09876079857349396, 0.08222351223230362, -0.02967941015958786, 0.03828015550971031, -0.020616352558135986, -0.036564018577337265, 0.05299738794565201, -0.26051709055900574, -0.1605447232723236, 0.08864031732082367, -0.08259652554988861, -0.07250332832336426, 0.016473369672894478, -2.2706668787793004e-32, -0.06886876374483109, 0.03742152824997902, -0.05984944477677345, 0.09324882924556732, -0.30271825194358826, -0.002910698764026165, 0.01717778667807579, -0.11344833672046661, -0.018954189494252205, -0.1928492784500122, 0.04302331060171127, 0.0046835970133543015, 0.0447978712618351, -0.05019418150186539, -0.10454953461885452, 0.061472468078136444, -0.14573977887630463, 0.007013764698058367, -0.09345493465662003, 0.12027191370725632, 0.11256483197212219, 0.0486590713262558, -0.0037148133851587772, 0.10449960082769394, -0.11588694155216217, -0.03150263801217079, -0.09372566640377045, -0.11303682625293732, 0.03152783587574959, 0.004321646876633167, -0.03391901031136513, 0.09702640771865845, 0.015176158398389816, -0.14981906116008759, 0.005081339739263058, -0.09814713150262833, -0.08452282845973969, -0.07241739332675934, -0.002392501337453723, -0.02359616942703724, -0.030829261988401413, 0.16508671641349792, 0.019786637276411057, -0.16992305219173431, 0.07133888453245163, 0.04077741503715515, 0.051203127950429916, -0.01617923378944397, -0.07734058797359467, -0.12877309322357178, 0.063601553440094, 0.06781687587499619, -0.061256080865859985, 0.0014398180646821856, 0.11457458138465881, -0.013123047538101673, 0.029109008610248566, 0.21506619453430176, -0.0074350167997181416, -0.047898851335048676, -0.04309920221567154, -0.04273754730820656, -0.017031550407409668, 0.15567803382873535, 0.17333421111106873, -0.046044956892728806, 0.2926560640335083, -0.01430713851004839, -0.03721357136964798, 0.011590913869440556, 0.2924793064594269, 0.09876488149166107, -0.08311795443296432, -0.031143276020884514, -0.19029104709625244, -0.026883728802204132, -0.11219559609889984, 0.07615599036216736, -0.004783187061548233, 0.09219176322221756, 0.043064117431640625, 0.07155980914831161, -0.07012344896793365, -0.0017024124972522259, -0.10360120236873627, 0.010337677784264088, -0.05555608496069908, -0.01821453496813774, -0.213224396109581, -0.07587666809558868, -0.1332828402519226, 0.12185853719711304, -0.12683355808258057, -0.046546176075935364, 0.047479256987571716, 0.14602689445018768, -0.15287013351917267, 0.08282265067100525, -0.11418440192937851, 0.10603579133749008, 0.008569538593292236, 0.016767263412475586, -0.02540285512804985, -0.005305931903421879, 0.08320440351963043, -0.05479026213288307, 0.08535513281822205, -0.11992529779672623, -0.13980302214622498, -0.12536825239658356, -0.09421000629663467, 0.042898599058389664, 0.13779564201831818, 0.1265507936477661, 0.055410947650671005, 0.11980321258306503, -0.08437848091125488, -0.06583239883184433, 0.07515396177768707, 0.19930768013000488, -0.13716058433055878, 0.07974500954151154, 0.03834347054362297, 0.07284989953041077, 0.035961952060461044, 0.037384577095508575, -0.18160304427146912, -0.12600815296173096, 0.09446786344051361, 0.18616358935832977, 0.04046354815363884, -0.08520126342773438, 7.574529377052386e-7, -0.18813948333263397, -0.06642219424247742, -0.0750206932425499, -0.12532365322113037, -0.04007762297987938, 0.09088939428329468, -0.2992483079433441, 0.0006780787953175604, 0.0511348731815815, 0.1454378217458725, 0.16756802797317505, 0.03751954808831215, 0.1221827045083046, 0.11646169424057007, 0.11410024762153625, 0.05520337074995041, -0.11180856078863144, -0.03651793673634529, -0.10001823306083679, 0.018870413303375244, 0.01234118640422821, 0.11655142158269882, -0.011102722026407719, -0.0378020703792572, -0.050676487386226654, -0.13854336738586426, 0.12092872709035873, -0.09799126535654068, -0.01066349633038044, 0.11266977339982986, -0.0426815003156662, 0.19279827177524567, -0.10572133958339691, 0.13163861632347107, 0.07108897715806961, -0.05431695282459259, -0.10644868016242981, -0.004659397527575493, 0.30944713950157166, 0.06658346951007843, 0.08772555738687515, 0.03586588427424431, 0.12923872470855713, -0.07208454608917236, 0.0841362476348877, 0.10889928042888641, -0.08109898120164871, -0.03965689241886139, 0.035639017820358276, 0.11861331760883331, 0.08123629540205002, 0.09311597049236298, -0.014751589857041836, 0.01812940649688244, -0.0002301142958458513, -0.08729259669780731, -0.04459943249821663, 0.0019177552312612534, 0.11257902532815933, 0.1943398267030716, -0.09513279795646667, -0.2191418558359146, 0.04721423611044884, -0.08162648230791092, -0.05477278679609299, -0.1502705067396164, 0.04567990079522133, 1.1301760589444632e-34, 0.03888614848256111, -0.01816466823220253, 0.053308840841054916, -0.2560502290725708, -0.00706505635753274, 0.056235674768686295, 0.02396729774773121, -0.10668817907571793, 0.07803429663181305, -0.20674367249011993, 0.03926582634449005 ]
https://github.com/huggingface/datasets/issues/6182
Loading Meteor metric in HF evaluate module crashes due to datasets import issue
Any idea when you guys will release the next version which deals with this problem? I'm still having the same issue with py 3.10 when I install the lib with pip. I'm assuming that it has not yet been updated since the merge was 3 days ago.
### Describe the bug When using python3.9 and ```evaluate``` module loading Meteor metric crashes at a non-existent import from ```datasets.config``` in ```datasets v2.14``` ### Steps to reproduce the bug ``` from evaluate import load meteor = load("meteor") ``` produces the following error: ``` from datasets.config import importlib_metadata, version ImportError: cannot import name 'importlib_metadata' from 'datasets.config' (<path_to_project>/venv/lib/python3.9/site-packages/datasets/config.py) ``` ### Expected behavior ```datasets``` of v2.10 has the following workaround in ```config.py```: ``` if PY_VERSION < version.parse("3.8"): import importlib_metadata else: import importlib.metadata as importlib_metadata ``` However, it's absent in v2.14 which might be the cause of the issue. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-13.5-arm64-arm-64bit - Python version: 3.9.6 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 - Evaluate version: 0.4.0
47
Loading Meteor metric in HF evaluate module crashes due to datasets import issue ### Describe the bug When using python3.9 and ```evaluate``` module loading Meteor metric crashes at a non-existent import from ```datasets.config``` in ```datasets v2.14``` ### Steps to reproduce the bug ``` from evaluate import load meteor = load("meteor") ``` produces the following error: ``` from datasets.config import importlib_metadata, version ImportError: cannot import name 'importlib_metadata' from 'datasets.config' (<path_to_project>/venv/lib/python3.9/site-packages/datasets/config.py) ``` ### Expected behavior ```datasets``` of v2.10 has the following workaround in ```config.py```: ``` if PY_VERSION < version.parse("3.8"): import importlib_metadata else: import importlib.metadata as importlib_metadata ``` However, it's absent in v2.14 which might be the cause of the issue. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-13.5-arm64-arm-64bit - Python version: 3.9.6 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 - Evaluate version: 0.4.0 Any idea when you guys will release the next version which deals with this problem? I'm still having the same issue with py 3.10 when I install the lib with pip. I'm assuming that it has not yet been updated since the merge was 3 days ago.
[ -0.1014971062541008, 0.22867415845394135, -0.033960822969675064, -0.04357697069644928, 0.204610675573349, -0.0374472513794899, -0.011308349668979645, 0.1051337793469429, -0.0638449564576149, 0.0020737405866384506, -0.02513648010790348, -0.0055289543233811855, -0.13873039186000824, -0.14913952350616455, 0.0310885701328516, -0.012159032747149467, -0.16066448390483856, 0.06690627336502075, -0.06496050208806992, 0.07459279149770737, -0.07512997835874557, 0.03731067478656769, 0.08832947909832001, -0.024726852774620056, 0.1008724570274353, 0.08130335807800293, 0.020362980663776398, 0.004565343260765076, 0.15654924511909485, -0.2354225069284439, 0.10159323364496231, 0.09247336536645889, 0.002254541963338852, 0.21712270379066467, 0.000006056338406779105, -0.19297246634960175, 0.032936401665210724, 0.2140863537788391, -0.07101714611053467, -0.2229185700416565, 0.14934104681015015, -0.08681569248437881, 0.00019487770623527467, -0.06885852664709091, 0.009369943290948868, -0.19963212311267853, -0.149530827999115, 0.017812615260481834, 0.09628050029277802, -0.018219735473394394, 0.004680590704083443, 0.06567051261663437, -0.0312824510037899, -0.22885695099830627, 0.11239038407802582, 0.01980881206691265, 0.038141410797834396, 0.18609873950481415, -0.16245388984680176, -0.15005441009998322, -0.048441335558891296, -0.0934327244758606, -0.024367917329072952, 0.09756335616111755, -0.045971911400556564, -0.013629313558340073, -0.1261550933122635, 0.04812287166714668, 0.018226394429802895, 0.21234561502933502, 0.1576467901468277, 0.13257062435150146, -0.10460726171731949, 0.056866176426410675, -0.09030479192733765, -0.1073758453130722, -0.010346719063818455, -0.0533716194331646, -0.05141890048980713, 0.056043192744255066, -0.07308376580476761, -0.09320775419473648, -0.041882582008838654, 0.0076354872435331345, -0.06857918202877045, 0.188995823264122, -0.10001181066036224, 0.027343180030584335, 0.09907355159521103, -0.1331108659505844, 0.18273109197616577, 0.0842108353972435, -0.061291344463825226, -0.18921400606632233, 0.3099066913127899, 0.0024241202045232058, 0.00544081861153245, -0.09173048287630081, -0.04298867657780647, -0.10259725898504257, -0.09711971133947372, -0.0055163525976240635, 0.032439906150102615, 0.0965401828289032, 0.13705386221408844, -0.08136529475450516, 0.12935471534729004, -0.013617134653031826, 0.06115572154521942, 0.01572815701365471, -0.015265279449522495, 0.13041627407073975, -0.0905037522315979, -0.1492544561624527, 0.17549926042556763, 0.04765390232205391, 0.08926523476839066, 0.06162773072719574, -0.17868417501449585, 0.11095907539129257, 0.0965847447514534, -0.019789664074778557, -0.023534437641501427, 0.03426876291632652, -0.014409290626645088, -0.030031003057956696, -0.06348104774951935, 0.06060408055782318, 0.017541570588946342, 0.008229730650782585, 0.019077111035585403, -0.0183987095952034, -0.080424465239048, 0.046712178736925125, 0.12316449731588364, -0.0414765328168869, 0.11671224981546402, -0.16980677843093872, -0.027044227346777916, 0.025881556794047356, 0.05673202499747276, -0.06206986680626869, -0.1822739690542221, -0.040245454758405685, 0.1090274453163147, 0.08690158277750015, 0.11719878762960434, -0.09898750483989716, -0.0654556006193161, -0.07542279362678528, -0.2908487617969513, 0.09706617146730423, -0.1764153689146042, 0.021447371691465378, -0.2015112042427063, -0.04021917283535004, -0.09214647114276886, -0.04713832959532738, -0.30696672201156616, -0.03189573064446449, -0.08333758264780045, -0.03858489915728569, 0.028222696855664253, -0.0458342619240284, 0.21128813922405243, 0.28185299038887024, -0.07817580550909042, 0.04425341263413429, -0.17481179535388947, 0.01917565055191517, -0.11383301019668579, -0.13833799958229065, -0.12393833696842194, 0.027552353218197823, -0.31408441066741943, -0.07652589678764343, 0.15588949620723724, -0.11417688429355621, -0.11618194729089737, 0.06762515008449554, 0.1470857411623001, -0.061181314289569855, -0.10173803567886353, -0.1813226342201233, 0.10670297592878342, 0.08496058732271194, 0.016363130882382393, 0.03513992950320244, 0.008046472445130348, -0.21014520525932312, -0.004814194981008768, 0.09578178822994232, -0.06463371217250824, 0.2320633828639984, 0.15253114700317383, -0.12074742466211319, 0.03890400379896164, 0.023840269073843956, 0.1532406210899353, -0.12099656462669373, -0.05961623042821884, 0.13996320962905884, 0.05841931328177452, 0.10593236982822418, 0.11192161589860916, -0.10695198178291321, 0.020718446001410484, 0.10439791530370712, 0.09270305186510086, -0.17609013617038727, -0.1199972927570343, 0.11561424285173416, -0.16923098266124725, 0.1153544932603836, -0.1292869597673416, -0.12173623591661453, -0.005289766471832991, 0.11848332732915878, -0.08291026949882507, 0.11940471082925797, 0.016900325194001198, 0.18262746930122375, 0.04536186903715134, 0.09994534403085709, 0.13776558637619019, 0.03696213662624359, -0.07943924516439438, 0.0016717055113986135, -0.07497313618659973, 0.022678963840007782, -0.12136484682559967, -0.045096006244421005, 0.09854273498058319, 0.12830497324466705, -0.005207542795687914, 0.026340266689658165, 0.1969957947731018, -0.1103227287530899, 0.14734210073947906, -0.023328425362706184, -0.07863493263721466, -0.06387785822153091, -0.009493998251855373, -0.02638132870197296, -0.08241202682256699, 0.10489451885223389, 0.037045981734991074, 0.04526134952902794, 0.042749952524900436, -0.08500154316425323, 0.1661352813243866, 0.10550636053085327, -0.19437143206596375, -0.059408579021692276, 0.10752592980861664, -0.11129871010780334, 0.026723751798272133, -0.04019714891910553, 0.09562758356332779, -0.16068540513515472, 0.21765324473381042, 0.06637906283140182, 0.09588505327701569, -0.009352082386612892, 0.09139253199100494, -0.046753156930208206, -0.08250611275434494, -0.07365666329860687, 0.14584968984127045, 0.0829596221446991, 0.047396574169397354, -0.05318956449627876, -0.12245360016822815, -0.04357024282217026, 0.08132094889879227, -0.09561500698328018, -0.0881604328751564, 0.0053422595374286175, 0.020395833998918533, 0.04684366658329964, -0.20323504507541656, 0.07241105288267136, 0.13406577706336975, -0.09308605641126633, 0.058844443410634995, 0.09518846124410629, -0.1841411143541336, 0.2014268934726715, -0.006914110854268074, -0.09303832054138184, -0.031233685091137886, 0.028793809935450554, -0.010064832866191864, -0.024396616965532303, 0.0483890138566494, -0.06761320680379868, 0.15060393512248993, 0.00011933118366869166, -0.07429962605237961, 0.05726642161607742, 0.10040020942687988, -0.08406547456979752, 0.018399545922875404, 0.07968579232692719, 0.006804809905588627, 0.15816113352775574, 0.1674777865409851, 0.05745857581496239, -0.17289939522743225, -0.055587753653526306, -0.1914677917957306, -0.00595412403345108, 0.043829891830682755, 0.214768186211586, -0.039077162742614746, -0.09982507675886154, 0.0748731940984726, 0.08835719525814056, 0.0945831835269928, 0.12700536847114563, 0.13581861555576324, 0.12189573049545288, -0.08604741096496582, -0.18959546089172363, 0.012715484946966171, 0.10857843607664108, -0.20741534233093262, -0.19105486571788788, -0.1924569457769394, -0.04837509244680405, -0.11777736991643906, -0.01833225227892399, 0.0927654579281807, -0.1830010861158371, -0.11436262726783752, -0.0954514816403389, -0.14260104298591614, -0.07711456716060638, 0.33365675806999207, -0.152448832988739, -0.03732297942042351, 0.11642611026763916, 0.02619311772286892, 0.019648568704724312, 0.03397494554519653, -0.10989098250865936, -0.002781683811917901, -0.08020389080047607, -0.07873225957155228, -0.025646604597568512, 0.00643515819683671, -0.014505053870379925, -0.021097196266055107, 0.0032409990672022104, -0.03835845738649368, 0.043509867042303085, 0.02572169154882431, -0.02816721796989441, 0.00962757132947445, 0.07719730585813522, 0.03877173364162445, 0.046645503491163254, 0.14781713485717773, 0.14550550282001495, -0.09619913250207901, 0.09187625348567963, 0.11733513325452805, 0.05133442208170891, 0.0694490447640419, -0.037271648645401, -0.2591842710971832, 0.011450976133346558, 0.12217333167791367, 0.016323741525411606, -0.003696277504786849, 0.05052679032087326, -0.16359707713127136, -0.26007187366485596, 0.12076275795698166, 0.017851416021585464, 0.05754302442073822, -0.11946498602628708, -0.07662360370159149, 0.0730578601360321, 0.04892060533165932, 0.0640341266989708, 0.04818524420261383, 0.11330832540988922, 0.025523683056235313, -0.014333643019199371, 0.02295437455177307, 0.30925557017326355, 0.1589052379131317, -0.08751706779003143, -0.06809872388839722, -0.120803602039814, 0.2119535207748413, -0.07560506463050842, 0.1716902107000351, 0.021909546107053757, 0.0898103266954422, 0.09288284927606583, -0.030914658680558205, 0.15257088840007782, 0.16662093997001648, -0.07729271054267883, -0.11485613137483597, 0.031010819599032402, -0.08759662508964539, -0.10903269797563553, -0.02208058163523674, 0.1914025992155075, -0.05206136405467987, -0.0735059604048729, 0.07723426073789597, 0.06204014644026756, -0.047056496143341064, -0.0648336261510849, -0.2769519090652466, -0.031798042356967926, -0.008974944241344929, -0.144270122051239, 0.0545605793595314, 0.0816446840763092, 0.13268007338047028, -0.004248667508363724, 0.05432669445872307, -0.07411699742078781, 0.10011016577482224, -0.048188045620918274, -0.005726895295083523, -0.07821176201105118, 0.16475971043109894, -0.0536092109978199, -0.09049473702907562, 0.0728173777461052, 0.2682512104511261, -0.01681952364742756, -0.14424815773963928, 0.04775508865714073, -0.13426674902439117, -0.00507191801443696, 0.07151170819997787, -0.07575130462646484, -0.13408276438713074, -0.13427381217479706, -0.025157859548926353, -0.06488121300935745, -0.03743955120444298, -0.15835067629814148, 0.019754664972424507, -0.07957744598388672, -0.0121328579261899, -0.12311667948961258, 0.11020787060260773, 0.012482219375669956, 0.19788715243339539, -0.12425839155912399, 0.07215532660484314, 0.057333044707775116, -0.07367656379938126, -0.0886787623167038, -0.05120118334889412, -0.007370238658040762, 0.14458653330802917, 0.015719007700681686, 0.17649124562740326, -0.16936247050762177, -0.134900763630867, 0.05731050297617912, -0.06806104630231857, 0.10210858285427094, -0.09410763531923294, 0.09935541450977325, 0.03570571169257164, 0.09927841275930405, 0.08607865869998932, -0.031610190868377686, -0.08044880628585815, -0.029424676671624184, 0.16542893648147583, 0.13707397878170013, 0.11461763828992844, -0.14625389873981476, 0.04929838702082634, -0.023528553545475006, 0.009896117262542248, -0.1845383644104004, -0.1493961364030838, -0.11295276880264282, 0.1940724402666092, 0.028296517208218575, 0.19045132398605347, 0.16764944791793823, 0.15658541023731232, -0.022419771179556847, -0.13834251463413239, 0.12115537375211716, -0.11054877936840057, 0.14563827216625214, 0.013106467202305794, -0.14316512644290924, 0.003987565170973539, -0.2368108630180359, 0.07326238602399826, -0.1447574347257614, 0.10201428085565567, -0.08972040563821793, -0.018775463104248047, -0.12560702860355377, -0.005345608107745647, 0.05504166707396507, -0.048400502651929855, 0.02549794875085354, 0.058723218739032745, 0.03637983277440071, -0.04276830330491066, 0.03317387402057648, 0.058582499623298645, 0.0628485456109047, -0.04575032368302345, -0.054823849350214005, -0.06241895258426666, -0.020559752359986305, 0.18742351233959198, 0.1104370728135109, -0.009541524574160576, 0.06649977713823318, 0.12799321115016937, -0.06815258413553238, 0.1706962287425995, 0.06784100830554962, 0.1609993577003479, -0.13269609212875366, -0.037406422197818756, 0.0361376516520977, 0.007595316041260958, -0.09313737601041794, 0.005302500445395708, 0.07078662514686584, -0.07660795748233795, -0.054410241544246674, -0.08941678702831268, 0.093688003718853, -0.06948089599609375, 0.040568627417087555, -0.017912020906805992, -0.0324944406747818, 0.055080633610486984, -0.24378947913646698, -0.15734104812145233, 0.09839759767055511, -0.08600368350744247, -0.046652767807245255, 0.016835574060678482, -2.2979941837000415e-32, -0.08093313872814178, 0.04805728793144226, -0.08450837433338165, 0.10550206899642944, -0.3015686869621277, -0.0032630080822855234, 0.036552123725414276, -0.11354594677686691, -0.03415047004818916, -0.18600130081176758, 0.047951485961675644, 0.024663913995027542, 0.043136581778526306, -0.057394739240407944, -0.11284086853265762, 0.02160118706524372, -0.1512196809053421, -0.008945908397436142, -0.06961891055107117, 0.09219327569007874, 0.08427334576845169, 0.04489128664135933, -0.005554657429456711, 0.09447652846574783, -0.09630727022886276, -0.04078526049852371, -0.07859122008085251, -0.12323801964521408, 0.02236686274409294, -0.02158854901790619, -0.012913946062326431, 0.07741682976484299, 0.00020533837960101664, -0.13289637863636017, 0.024447325617074966, -0.10551697760820389, -0.09858404844999313, -0.05616445094347, -0.01599377952516079, -0.02643364481627941, -0.06330456584692001, 0.19969649612903595, 0.01955467462539673, -0.14667198061943054, 0.046765852719545364, 0.024683579802513123, 0.0563943013548851, -0.04262489452958107, -0.1226431131362915, -0.14902499318122864, 0.0748734250664711, 0.059239812195301056, -0.08568534255027771, 0.006099608261138201, 0.0973268374800682, 0.006046859081834555, 0.020489495247602463, 0.21074113249778748, -0.027840347960591316, -0.05050131306052208, -0.014208261854946613, -0.0558815598487854, -0.029132716357707977, 0.15958580374717712, 0.22884652018547058, -0.029924137517809868, 0.3110752999782562, -0.019067861139774323, -0.01448620855808258, 0.025234190747141838, 0.29159578680992126, 0.11269061267375946, -0.10508323460817337, -0.019175535067915916, -0.20108549296855927, -0.04667031764984131, -0.10479812324047089, 0.07962241768836975, 0.029894370585680008, 0.05795365944504738, 0.04234994947910309, 0.030291272327303886, -0.0864202007651329, -0.00986778736114502, -0.08561348915100098, 0.012508224695920944, -0.047287099063396454, 0.007200564723461866, -0.20113171637058258, -0.05265124514698982, -0.09680895507335663, 0.13680526614189148, -0.1576118767261505, -0.04683959484100342, 0.03853389248251915, 0.1730244755744934, -0.16596120595932007, 0.09040520340204239, -0.10114084184169769, 0.10423039644956589, -0.007341920398175716, 0.01224288810044527, -0.02071955054998398, -0.011948853731155396, 0.06958520412445068, -0.07808422297239304, 0.09134647250175476, -0.14139778912067413, -0.167350172996521, -0.1504184454679489, -0.06138061359524727, 0.07178886234760284, 0.13404732942581177, 0.11757330596446991, 0.07520729303359985, 0.13552415370941162, -0.07074954360723495, -0.05611342564225197, 0.10512832552194595, 0.18006956577301025, -0.14912955462932587, 0.058745842427015305, 0.0410199835896492, 0.05702224001288414, 0.03302527964115143, 0.04153615981340408, -0.1876096874475479, -0.14362701773643494, 0.11785157769918442, 0.18257592618465424, 0.03145112842321396, -0.08381501585245132, 7.54960410631611e-7, -0.19156457483768463, -0.05322201922535896, -0.0982905700802803, -0.10934688150882721, -0.040863990783691406, 0.06880684942007065, -0.2718554735183716, 0.014108287170529366, 0.06354676932096481, 0.15318278968334198, 0.19962762296199799, 0.009412181563675404, 0.11133518815040588, 0.09876753389835358, 0.10023439675569534, 0.06184842437505722, -0.11353478580713272, -0.02010946348309517, -0.07692598551511765, 0.018542611971497536, 0.03732728585600853, 0.11565563827753067, -0.0010013192659243941, -0.025431927293539047, -0.04679756611585617, -0.1444883495569229, 0.16661816835403442, -0.11106979846954346, -0.02488057315349579, 0.10552951693534851, -0.04722750186920166, 0.2026526927947998, -0.10876403003931046, 0.1316610872745514, 0.06725744903087616, -0.04425723850727081, -0.09184564650058746, -0.055212825536727905, 0.3017158806324005, 0.05587809160351753, 0.08270090073347092, 0.03263436257839203, 0.11670001596212387, -0.05488666146993637, 0.10501702129840851, 0.12715421617031097, -0.10902504622936249, -0.032322343438863754, 0.03683016076683998, 0.09971267729997635, 0.10245160013437271, 0.09646894037723541, 0.005034558940678835, 0.020109331235289574, 0.01939665712416172, -0.0887448713183403, -0.04958142712712288, -0.01694445312023163, 0.11232789605855942, 0.1767943799495697, -0.07479245960712433, -0.2112061232328415, 0.060583289712667465, -0.09175810217857361, -0.02615496516227722, -0.13917605578899384, 0.04529043287038803, 1.0075302130029467e-34, 0.03705286607146263, -0.013058176264166832, 0.039610132575035095, -0.24388983845710754, -0.0006772405467927456, 0.0629110261797905, 0.08050587028265, -0.15148378908634186, 0.08033324033021927, -0.21384817361831665, 0.06074564903974533 ]
https://github.com/huggingface/datasets/issues/6182
Loading Meteor metric in HF evaluate module crashes due to datasets import issue
Yes, this requires a new `evaluate` release (cc @lvwerra for this). In the meantime, you can get the fixed version by installing `evaluate` from `main`: `pip install git+https://github.com/huggingface/evaluate.git`
### Describe the bug When using python3.9 and ```evaluate``` module loading Meteor metric crashes at a non-existent import from ```datasets.config``` in ```datasets v2.14``` ### Steps to reproduce the bug ``` from evaluate import load meteor = load("meteor") ``` produces the following error: ``` from datasets.config import importlib_metadata, version ImportError: cannot import name 'importlib_metadata' from 'datasets.config' (<path_to_project>/venv/lib/python3.9/site-packages/datasets/config.py) ``` ### Expected behavior ```datasets``` of v2.10 has the following workaround in ```config.py```: ``` if PY_VERSION < version.parse("3.8"): import importlib_metadata else: import importlib.metadata as importlib_metadata ``` However, it's absent in v2.14 which might be the cause of the issue. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-13.5-arm64-arm-64bit - Python version: 3.9.6 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 - Evaluate version: 0.4.0
28
Loading Meteor metric in HF evaluate module crashes due to datasets import issue ### Describe the bug When using python3.9 and ```evaluate``` module loading Meteor metric crashes at a non-existent import from ```datasets.config``` in ```datasets v2.14``` ### Steps to reproduce the bug ``` from evaluate import load meteor = load("meteor") ``` produces the following error: ``` from datasets.config import importlib_metadata, version ImportError: cannot import name 'importlib_metadata' from 'datasets.config' (<path_to_project>/venv/lib/python3.9/site-packages/datasets/config.py) ``` ### Expected behavior ```datasets``` of v2.10 has the following workaround in ```config.py```: ``` if PY_VERSION < version.parse("3.8"): import importlib_metadata else: import importlib.metadata as importlib_metadata ``` However, it's absent in v2.14 which might be the cause of the issue. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-13.5-arm64-arm-64bit - Python version: 3.9.6 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 - Evaluate version: 0.4.0 Yes, this requires a new `evaluate` release (cc @lvwerra for this). In the meantime, you can get the fixed version by installing `evaluate` from `main`: `pip install git+https://github.com/huggingface/evaluate.git`
[ -0.12132315337657928, 0.2592417001724243, -0.06906872987747192, -0.019512489438056946, 0.22573117911815643, -0.02007112465798855, -0.0200983677059412, 0.14193545281887054, -0.03650559112429619, 0.007741863839328289, -0.08475861698389053, -0.0060644433833658695, -0.11624910682439804, -0.06927364319562912, 0.05354277044534683, 0.006562935654073954, -0.16879796981811523, 0.060092609375715256, -0.06846079975366592, 0.06378546357154846, -0.06239263713359833, 0.03195955604314804, 0.07154849916696548, -0.0024186265654861927, 0.10526448488235474, 0.04883388802409172, 0.007916709408164024, -0.0005894696223549545, 0.1740257740020752, -0.21416154503822327, 0.06846126914024353, 0.11182324588298798, 0.006447693798691034, 0.1673419326543808, 0.000006030643817211967, -0.18117022514343262, 0.005552522372454405, 0.1705544888973236, -0.05488043650984764, -0.25850367546081543, 0.24141564965248108, -0.04190327599644661, -0.0008180572767741978, -0.08596047013998032, 0.008837949484586716, -0.19446462392807007, -0.1635744422674179, 0.00634420569986105, 0.09092175960540771, 0.00778508884832263, 0.016259819269180298, 0.06757938861846924, -0.05090605840086937, -0.23156312108039856, 0.0993235632777214, 0.0049488842487335205, 0.03476027026772499, 0.1301681399345398, -0.17103096842765808, -0.16750352084636688, -0.06381172686815262, -0.09949947148561478, -0.001447875052690506, 0.08273177593946457, -0.037536121904850006, -0.013244676403701305, -0.09796532988548279, 0.05893705040216446, 0.00664903549477458, 0.2198982983827591, 0.1503676325082779, 0.12263680249452591, -0.09274135529994965, 0.060250021517276764, -0.049327269196510315, -0.1224604994058609, -0.018486443907022476, -0.017808837816119194, -0.03356679156422615, 0.07441587001085281, -0.06744372844696045, -0.08344042301177979, -0.048094067722558975, 0.02008015662431717, -0.03027067892253399, 0.17678381502628326, -0.10901911556720734, 0.03403778374195099, 0.11410252004861832, -0.11120405048131943, 0.15099455416202545, 0.06470876932144165, -0.05612596124410629, -0.1953132599592209, 0.26467588543891907, 0.033206116408109665, 0.039361488074064255, -0.08972182869911194, -0.036083322018384933, -0.11279211938381195, -0.0982329323887825, -0.00431947922334075, 0.05318260192871094, 0.07520946860313416, 0.13231146335601807, -0.04705493897199631, 0.1692938357591629, -0.054200172424316406, 0.0717969536781311, 0.04760439693927765, -0.040964141488075256, 0.12273550778627396, -0.09841521084308624, -0.13487960398197174, 0.16449017822742462, 0.056615035980939865, 0.07232864201068878, 0.06435420364141464, -0.1720510870218277, 0.13791263103485107, 0.0662674754858017, -0.02332885004580021, -0.01206293050199747, 0.04714943468570709, -0.021789338439702988, -0.06612379848957062, -0.0705551877617836, 0.09919798374176025, 0.03235318884253502, 0.002257032785564661, 0.019712381064891815, 0.02678169496357441, -0.09905242174863815, 0.021206211298704147, 0.1104133203625679, -0.07674942165613174, 0.12451016902923584, -0.15714289247989655, 0.0027951286174356937, -0.0010163849219679832, 0.03872249647974968, -0.05857374519109726, -0.2461140900850296, -0.06331369280815125, 0.11269218474626541, 0.09569218754768372, 0.13195574283599854, -0.16080740094184875, -0.061256349086761475, -0.08366013318300247, -0.279179185628891, 0.04297506436705589, -0.11514448374509811, -0.013311290182173252, -0.1937829554080963, -0.015316490083932877, -0.07849390059709549, -0.034704554826021194, -0.304097056388855, 0.005932807922363281, -0.0912407636642456, -0.019688555970788002, 0.008096328005194664, -0.008903155103325844, 0.24189798533916473, 0.27410343289375305, -0.08803173154592514, 0.05802934989333153, -0.21261365711688995, 0.0172151830047369, -0.1037788912653923, -0.13455402851104736, -0.12573087215423584, 0.050765883177518845, -0.29726871848106384, -0.1145276129245758, 0.16762426495552063, -0.06688573211431503, -0.08964597433805466, 0.059190187603235245, 0.12822774052619934, -0.038021694868803024, -0.12213586270809174, -0.20577989518642426, 0.07550682872533798, 0.07810921221971512, -0.03098325803875923, -0.039104871451854706, 0.03174460306763649, -0.22210834920406342, 0.050275158137083054, 0.09593026340007782, -0.08238393813371658, 0.2240953892469406, 0.15045124292373657, -0.11139584332704544, 0.055628880858421326, 0.012794875539839268, 0.1373923122882843, -0.14322087168693542, -0.04113229364156723, 0.12363837659358978, 0.04098968580365181, 0.08083170652389526, 0.1327981799840927, -0.1015537679195404, -0.008018734864890575, 0.1148391142487526, 0.053683072328567505, -0.16675402224063873, -0.13849705457687378, 0.10911134630441666, -0.20765338838100433, 0.1160275861620903, -0.11890926957130432, -0.12628890573978424, -0.017695549875497818, 0.10078063607215881, -0.05695824697613716, 0.1589636653661728, 0.021156925708055496, 0.16224458813667297, 0.0519859716296196, 0.07825610786676407, 0.19074369966983795, -0.010606645606458187, -0.08012358099222183, -0.008707381784915924, -0.04311974346637726, 0.025620538741350174, -0.10835573822259903, -0.027878377586603165, 0.09963398426771164, 0.13921859860420227, -0.031407445669174194, 0.034190062433481216, 0.18054822087287903, -0.0954098105430603, 0.11569158732891083, 0.007195822428911924, -0.08739783614873886, -0.07291755080223083, 0.0219515822827816, 0.0005660735187120736, -0.04334116727113724, 0.09513195604085922, -0.014307678677141666, 0.04492691159248352, 0.020257027819752693, -0.10735059529542923, 0.17241722345352173, 0.08681647479534149, -0.16276217997074127, -0.060100141912698746, 0.10692311823368073, -0.13019773364067078, 0.027735020965337753, -0.0562983863055706, 0.07915444672107697, -0.13755755126476288, 0.16259156167507172, 0.06436337530612946, 0.09969019889831543, -0.05288036912679672, 0.083436518907547, -0.05253126099705696, -0.07725190371274948, -0.08904038369655609, 0.15504403412342072, 0.09680593013763428, 0.06062991917133331, -0.057071249932050705, -0.1255468726158142, -0.04268873855471611, 0.09697240591049194, -0.10605118423700333, -0.09392881393432617, 0.012335577979683876, 0.011171025224030018, 0.02482398971915245, -0.21485088765621185, 0.11813076585531235, 0.1345507800579071, -0.0825154185295105, 0.0373065359890461, 0.08429491519927979, -0.18449637293815613, 0.22612330317497253, 0.010122666135430336, -0.0698777586221695, -0.008208416402339935, 0.022478867322206497, -0.0021623410284519196, -0.03805937245488167, 0.03978466987609863, -0.057516902685165405, 0.1689847856760025, 0.007571390829980373, -0.07177620381116867, 0.030637642368674278, 0.09081792831420898, -0.1109965518116951, 0.005394969135522842, 0.07771320641040802, 0.0194645244628191, 0.16128762066364288, 0.15839293599128723, 0.050282325595617294, -0.19756585359573364, -0.05138356611132622, -0.18182185292243958, -0.007884427905082703, 0.04145042598247528, 0.24063695967197418, -0.06941141188144684, -0.11662662774324417, 0.06668203324079514, 0.07706195116043091, 0.11228953301906586, 0.1284334659576416, 0.14808455109596252, 0.11754138767719269, -0.1118815541267395, -0.18878939747810364, -0.005518503487110138, 0.11263581365346909, -0.1879807710647583, -0.19217662513256073, -0.1660308688879013, -0.058198120445013046, -0.1415088027715683, -0.07625769078731537, 0.08246058970689774, -0.14539001882076263, -0.1440466195344925, -0.10155020654201508, -0.1687750518321991, -0.05918468162417412, 0.34903469681739807, -0.16855205595493317, -0.03612758219242096, 0.1025424525141716, 0.038099657744169235, 0.0118188401684165, 0.033847782760858536, -0.11234637349843979, -0.00780743220821023, -0.06445679068565369, -0.03925147280097008, -0.02733781561255455, 0.04802051931619644, -0.021758677437901497, -0.02608606591820717, -0.005520022939890623, -0.04269185662269592, 0.011987459845840931, 0.0582929365336895, -0.013049445115029812, 0.028760576620697975, 0.06092747673392296, 0.09267627447843552, 0.10065429657697678, 0.14722351729869843, 0.15983127057552338, -0.08469375222921371, 0.12134165316820145, 0.06085836514830589, 0.05958414822816849, 0.06115133687853813, -0.027071785181760788, -0.2097240388393402, -0.0009181192144751549, 0.11071589589118958, 0.013108223676681519, -0.034791503101587296, 0.035914354026317596, -0.16627980768680573, -0.23351138830184937, 0.1058693379163742, -0.022753464058041573, 0.07124099135398865, -0.09108293801546097, -0.05377533659338951, 0.12047670781612396, 0.05977872014045715, 0.08033349364995956, 0.041143566370010376, 0.1415824145078659, 0.03505909442901611, -0.03833538666367531, 0.028040612116456032, 0.2558056116104126, 0.14444325864315033, -0.10830153524875641, -0.04670824110507965, -0.1159314513206482, 0.16469119489192963, -0.05474073812365532, 0.18524163961410522, 0.039171088486909866, 0.06886064261198044, 0.13120406866073608, 0.013611032627522945, 0.12175499647855759, 0.16503159701824188, -0.12032084912061691, -0.1377793252468109, 0.006439364980906248, -0.0805516317486763, -0.06126503273844719, -0.06320741027593613, 0.1552019566297531, -0.054581400007009506, -0.10521897673606873, 0.03687160834670067, 0.03952378034591675, -0.03410022333264351, -0.09359622001647949, -0.250983327627182, -0.05040258914232254, 0.004353158641606569, -0.11875954270362854, 0.07677808403968811, 0.10990039259195328, 0.15519624948501587, 0.00930485874414444, 0.057814743369817734, -0.052847251296043396, 0.0750589668750763, -0.04446101933717728, -0.03758711740374565, -0.045015253126621246, 0.17296740412712097, -0.0675790011882782, -0.12953117489814758, 0.027675677090883255, 0.26171720027923584, -0.0361550897359848, -0.15280458331108093, 0.05136272311210632, -0.15508879721164703, 0.010356161743402481, 0.1145491972565651, -0.07789772003889084, -0.19145415723323822, -0.14519721269607544, -0.03022949770092964, -0.032634276896715164, -0.008292934857308865, -0.1616656631231308, 0.04755021631717682, -0.046401407569646835, 0.0008615544647909701, -0.1425733119249344, 0.08457629382610321, -0.015060852281749249, 0.20752397179603577, -0.06311505287885666, 0.13803771138191223, 0.05258535221219063, -0.07353971153497696, -0.1066969558596611, -0.08473832905292511, -0.019263949245214462, 0.109958715736866, 0.008022353984415531, 0.15536090731620789, -0.16854257881641388, -0.11026798188686371, 0.06526598334312439, -0.07414934039115906, 0.09684325754642487, -0.10315339267253876, 0.08722060918807983, 0.043235521763563156, 0.17021773755550385, 0.13767769932746887, -0.0525161437690258, -0.08983630686998367, -0.03665737062692642, 0.17591336369514465, 0.1211835965514183, 0.11139531433582306, -0.1341036558151245, 0.08014562726020813, 0.007248902227729559, 0.06790479272603989, -0.1942957639694214, -0.14417339861392975, -0.08654125034809113, 0.19376029074192047, 0.03051876649260521, 0.18314608931541443, 0.14037121832370758, 0.15694256126880646, -0.027336589992046356, -0.09889153391122818, 0.16766810417175293, -0.034013859927654266, 0.1427035629749298, 0.003022548044100404, -0.11667124927043915, 0.010515622794628143, -0.30159249901771545, 0.07543958723545074, -0.15969988703727722, 0.13627766072750092, -0.08570926636457443, -0.009924907237291336, -0.16131292283535004, -0.002455164212733507, 0.04850899428129196, -0.014866791665554047, 0.035691723227500916, 0.038695212453603745, 0.02706247754395008, -0.06342907249927521, 0.04609328508377075, 0.05630437657237053, 0.09175967425107956, -0.04491729289293289, -0.06547123938798904, -0.095026895403862, -0.018715068697929382, 0.17350764572620392, 0.08437083661556244, -0.022405540570616722, 0.07611863315105438, 0.12065068632364273, -0.10460846871137619, 0.1624988317489624, 0.06020131707191467, 0.17038817703723907, -0.13565698266029358, -0.06848401576280594, 0.017712391912937164, 0.006328604184091091, -0.10744791477918625, 0.025632642209529877, 0.08080580830574036, -0.09185312688350677, -0.10555395483970642, -0.0824638232588768, 0.0873667374253273, -0.023224741220474243, 0.0535900741815567, 0.01209626067429781, -0.049140579998493195, 0.0436369813978672, -0.2515840530395508, -0.19150307774543762, 0.12846869230270386, -0.10725594311952591, -0.07572150975465775, 0.016724899411201477, -2.2757281166435596e-32, -0.054604727774858475, 0.06399545818567276, -0.068669892847538, 0.08018999546766281, -0.3242233693599701, 0.044736430048942566, 0.02623562328517437, -0.08939673751592636, -0.004308236297219992, -0.19596661627292633, 0.018436362966895103, 0.0034529592376202345, 0.053365811705589294, -0.07148955762386322, -0.1023687794804573, 0.029817311093211174, -0.1632818728685379, 0.000570319767575711, -0.09981841593980789, 0.13732917606830597, 0.09106091409921646, 0.043350622057914734, -0.006076824385672808, 0.09710264950990677, -0.11400040984153748, -0.021081114187836647, -0.1072068139910698, -0.09344985336065292, 0.010739906691014767, 0.0011948160827159882, -0.04506500065326691, 0.08971672505140305, 0.005646601784974337, -0.16740790009498596, 0.017994187772274017, -0.07408569753170013, -0.09780822694301605, -0.08009174466133118, 0.02066437527537346, -0.029953597113490105, -0.05054793134331703, 0.199148491024971, -0.02643745392560959, -0.1391056776046753, 0.040709104388952255, 0.032771769911050797, 0.03045603446662426, -0.04055354744195938, -0.039100803434848785, -0.13361316919326782, 0.0844915434718132, 0.07641030848026276, -0.05102677270770073, -0.01680597849190235, 0.12257354706525803, 0.0020808179397135973, 0.010768038220703602, 0.21200501918792725, -0.018546106293797493, -0.07364243268966675, -0.044197872281074524, -0.04894114285707474, -0.010127569548785686, 0.14217370748519897, 0.20063067972660065, -0.03046451322734356, 0.2886921465396881, -0.03624920919537544, -0.07562724500894547, 0.005917636211961508, 0.3133135437965393, 0.10739760845899582, -0.08208633214235306, -0.03056078962981701, -0.2084076851606369, -0.028069598600268364, -0.11408251523971558, 0.08804649859666824, 0.02734304964542389, 0.08336228877305984, 0.03907616436481476, 0.03645795211195946, -0.05380639806389809, 0.007938921451568604, -0.11385731399059296, 0.007776496931910515, -0.059702374041080475, -0.029772717505693436, -0.21764260530471802, -0.06053045392036438, -0.13049550354480743, 0.12112851440906525, -0.11047668755054474, -0.052758220583200455, 0.04764827713370323, 0.12990742921829224, -0.1286243349313736, 0.1089872419834137, -0.07363366335630417, 0.1112285703420639, 0.02451694943010807, 0.019753186032176018, -0.005397305358201265, 0.014122197404503822, 0.06406400352716446, -0.08357017487287521, 0.0780378058552742, -0.11060277372598648, -0.13315777480602264, -0.12697762250900269, -0.09151717275381088, 0.0699998065829277, 0.13748592138290405, 0.155477374792099, 0.04033704847097397, 0.09855087101459503, -0.07198119163513184, -0.07539648562669754, 0.07903720438480377, 0.18221159279346466, -0.16275663673877716, 0.07567108422517776, 0.002261372981593013, 0.09105459600687027, 0.03904583677649498, 0.006270050071179867, -0.17092925310134888, -0.1504831463098526, 0.049649182707071304, 0.1458759754896164, 0.04279603809118271, -0.08914794772863388, 7.515541824432148e-7, -0.1764088273048401, -0.06892730295658112, -0.082465760409832, -0.11182890832424164, -0.0004305417533032596, 0.08505368232727051, -0.288299024105072, 0.012130862101912498, 0.042209070175886154, 0.1738850623369217, 0.1608324497938156, 0.031549956649541855, 0.1114984005689621, 0.09520761668682098, 0.12585146725177765, 0.045068226754665375, -0.14688187837600708, -0.02560509368777275, -0.06655793637037277, 0.049020543694496155, 0.005471944343298674, 0.1381559669971466, 0.027297845110297203, -0.04759678617119789, -0.05032773315906525, -0.13165652751922607, 0.11254647374153137, -0.07278551161289215, 0.007562427315860987, 0.11396985501050949, -0.07781615853309631, 0.1709694266319275, -0.10707608610391617, 0.12357091903686523, 0.0748768076300621, -0.04700781777501106, -0.09541475772857666, 0.005424036178737879, 0.30299559235572815, 0.06255363672971725, 0.08579839020967484, -0.00390746770426631, 0.14213688671588898, -0.10576530545949936, 0.11302420496940613, 0.13860751688480377, -0.07320138067007065, -0.05574052780866623, 0.030617205426096916, 0.1139690950512886, 0.052003320306539536, 0.09490637481212616, 0.0034977910108864307, 0.03957914933562279, 0.016291005536913872, -0.08692798018455505, -0.02117481268942356, 0.02351333573460579, 0.09772507846355438, 0.21784014999866486, -0.08208450675010681, -0.20496051013469696, 0.045432377606630325, -0.06494726240634918, -0.05233977362513542, -0.13826414942741394, 0.04156065359711647, 8.766808743811922e-35, 0.04608256742358208, 0.005125739146023989, 0.041704606264829636, -0.24365124106407166, -0.017453953623771667, 0.06302076578140259, 0.02383069321513176, -0.08962879329919815, 0.0817367285490036, -0.1778210550546646, 0.03688258305191994 ]
https://github.com/huggingface/datasets/issues/6179
Map cache with tokenizer
https://github.com/huggingface/datasets/issues/5147 may be a solution, by passing in the tokenizer in a fn_kwargs and ignoring it in the fingerprint calculations
Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session. Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with... setup ``` from transformers import AutoTokenizer AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok") ``` this prints different value each time ``` from transformers import AutoTokenizer from datasets.utils.py_utils import dumps # Huggingface datasets print(hash(dumps(AutoTokenizer.from_pretrained("tok")))) ```
20
Map cache with tokenizer Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session. Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with... setup ``` from transformers import AutoTokenizer AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok") ``` this prints different value each time ``` from transformers import AutoTokenizer from datasets.utils.py_utils import dumps # Huggingface datasets print(hash(dumps(AutoTokenizer.from_pretrained("tok")))) ``` https://github.com/huggingface/datasets/issues/5147 may be a solution, by passing in the tokenizer in a fn_kwargs and ignoring it in the fingerprint calculations
[ 0.014283818192780018, -0.017384720966219902, 0.02192535251379013, 0.03758431226015091, 0.11037885397672653, 0.0033627410884946585, 0.039226941764354706, -0.05748768523335457, -0.11405971646308899, 0.000015798255844856612, -0.17537179589271545, 0.03937802091240883, 0.0451178140938282, 0.03444964438676834, 0.05187803879380226, 0.002933091251179576, 0.12553265690803528, -0.02261209301650524, -0.15695175528526306, -0.036962419748306274, -0.028074966743588448, -0.00573068717494607, 0.15146195888519287, 0.1306588351726532, -0.11737921833992004, 0.04013243690133095, -0.09418781846761703, -0.03295017406344414, 0.12919981777668, -0.050819214433431625, -0.01244592946022749, -0.07277301698923111, -0.18502554297447205, 0.009120679460465908, 0.000005628132385027129, 0.05946224555373192, 0.03868748992681503, 0.06755255162715912, 0.024761511012911797, 0.04934697598218918, 0.11198439449071884, 0.07816269993782043, 0.05478379875421524, -0.06094680726528168, -0.16373024880886078, 0.07444137334823608, 0.03806350752711296, -0.018505239859223366, 0.12900784611701965, -0.10399775952100754, 0.01667402870953083, 0.036521993577480316, 0.05031265690922737, 0.09646813571453094, 0.02912219986319542, -0.014636291190981865, -0.002645183354616165, -0.21901355683803558, -0.20223990082740784, -0.12517766654491425, -0.009418371133506298, 0.05086635425686836, 0.01280876062810421, 0.004134247079491615, 0.17689672112464905, 0.1474132090806961, -0.18755976855754852, 0.06465209275484085, 0.028423454612493515, -0.010818272829055786, -0.07332588732242584, -0.0636940449476242, 0.018653487786650658, 0.11097516864538193, -0.112190380692482, 0.0018443866865709424, 0.0422661192715168, -0.07142334431409836, 0.05635099485516548, -0.04400058835744858, -0.06555208563804626, 0.03347541019320488, 0.014559507369995117, -0.027306826785206795, -0.2805825471878052, -0.0073424349538981915, 0.044939763844013214, 0.15669295191764832, -0.09500247240066528, -0.16713525354862213, -0.02991577610373497, -0.0725279226899147, -0.05976611748337746, 0.09344401210546494, -0.17328697443008423, -0.01909235492348671, -0.014064661227166653, -0.0686582550406456, -0.05500011146068573, -0.16701383888721466, 0.08918341249227524, 0.02992863953113556, -0.17515496909618378, 0.0125502934679389, -0.1874561905860901, -0.0010124142281711102, 0.029987100511789322, 0.09795055538415909, 0.028949236497282982, -0.07953161746263504, -0.2840842008590698, -0.08503548055887222, -0.11615762859582901, 0.07821661233901978, 0.35404905676841736, -0.041911616921424866, -0.03493767976760864, 0.11126407235860825, 0.11345989257097244, 0.09983009845018387, -0.019296148791909218, 0.1112174317240715, 0.006379387807101011, 0.1678590476512909, -0.08492295444011688, -0.02739802747964859, -0.05058494210243225, -0.22086316347122192, -0.08672593533992767, 0.02480926550924778, -0.11255686730146408, -0.07902923226356506, 0.07454047352075577, 0.08694152534008026, 0.10484007000923157, -0.038004010915756226, 0.04329332709312439, -0.04494638368487358, 0.014490455389022827, -0.03924897685647011, 0.15683574974536896, -0.13708093762397766, 0.04573066160082817, -0.006149609107524157, 0.04467468336224556, 0.1025218814611435, 0.06700831651687622, 0.1764557659626007, -0.036605220288038254, 0.0008208357030525804, -0.08409637957811356, 0.06328731775283813, 0.19224810600280762, -0.04661373794078827, 0.014023360796272755, -0.11521542817354202, 0.04671618342399597, -0.0077033513225615025, -0.05318690836429596, -0.009303325787186623, 0.050083763897418976, -0.08263037353754044, -0.07998432964086533, -0.05299088731408119, -0.010412104427814484, 0.03080715239048004, 0.16275884211063385, 0.1078277975320816, 0.06751105189323425, -0.023900574073195457, -0.003876776434481144, 0.013647228479385376, -0.07603177428245544, 0.009518642909824848, -0.1806303858757019, 0.31196343898773193, -0.14702370762825012, -0.07034283131361008, -0.06971915811300278, -0.1471196562051773, 0.02976730652153492, -0.006809590384364128, -0.11006878316402435, -0.06800507009029388, 0.16245214641094208, -0.07330717146396637, 0.14453907310962677, 0.012169969268143177, -0.12807215750217438, -0.03681455925107002, -0.03434905782341957, -0.059388667345047, 0.018825015053153038, -0.11877792328596115, 0.03372893109917641, 0.017745252698659897, 0.009508662857115269, 0.2124168574810028, -0.11678819358348846, -0.11226283013820648, 0.16614128649234772, -0.02353825978934765, 0.02395511604845524, 0.1106342077255249, 0.0485493503510952, 0.07484285533428192, -0.13510003685951233, 0.1705426424741745, -0.07594259083271027, -0.16595585644245148, -0.10312198847532272, 0.031738780438899994, 0.2108018547296524, 0.056147489696741104, -0.13603127002716064, -0.0415274016559124, -0.08994873613119125, -0.012814288027584553, -0.04408238083124161, 0.07585256546735764, 0.07754512131214142, -0.022315319627523422, 0.19485343992710114, 0.020148977637290955, -0.1436759978532791, 0.037911053746938705, 0.09215657413005829, 0.06002282723784447, 0.00926998071372509, 0.008168100379407406, -0.042189594358205795, 0.0930059477686882, 0.05251049995422363, -0.05677454173564911, -0.0582202784717083, 0.1365475058555603, -0.0564589723944664, -0.08922281861305237, 0.21987390518188477, 0.0397951677441597, -0.09834504127502441, -0.0187369491904974, -0.042585134506225586, -0.07811935991048813, 0.0751609280705452, 0.05920367315411568, 0.23138785362243652, 0.12631948292255402, 0.06639927625656128, -0.0451703704893589, 0.06345446407794952, 0.038814641535282135, -0.07740884274244308, -0.11693162471055984, -0.05466001480817795, -0.2286531925201416, 0.2430446594953537, 0.24308885633945465, 0.09210588037967682, 0.12007385492324829, 0.1591605842113495, 0.04441099613904953, -0.06878568977117538, -0.02214716747403145, -0.012125365436077118, -0.18791088461875916, -0.05528758466243744, -0.06848935037851334, -0.04984353110194206, 0.1382582187652588, 0.23521928489208221, -0.014098206534981728, -0.04682804271578789, 0.02227526530623436, -0.04531560093164444, -0.13827738165855408, -0.06438293308019638, -0.027521105483174324, 0.09388985484838486, -0.013610053807497025, -0.013159394264221191, 0.09636799246072769, 0.10801790654659271, 0.0018685543909668922, 0.04267391934990883, 0.0622919537127018, -0.12615948915481567, 0.07862430065870285, -0.12352651357650757, -0.1750919669866562, -0.17163638770580292, -0.08470281213521957, 0.07697424292564392, -0.05752890184521675, 0.10418536514043808, -0.04326209798455238, 0.09583909064531326, -0.10902031511068344, 0.03719282150268555, -0.19331341981887817, -0.1264440268278122, -0.1617160588502884, -0.15537971258163452, -0.19894437491893768, -0.04860615357756615, 0.01417730376124382, 0.14922621846199036, 0.03901293873786926, -0.07045894861221313, -0.1558317095041275, -0.15894129872322083, -0.05327100679278374, -0.02583646960556507, -0.031878210604190826, -0.04785501956939697, -0.07857310771942139, -0.0590226985514164, -0.2943049967288971, 0.21483242511749268, -0.06971699744462967, 0.11608270555734634, 0.0336555652320385, -0.01603854075074196, -0.08011680096387863, 0.12414850294589996, -0.007898906245827675, 0.20955054461956024, -0.038441456854343414, 0.05123420059680939, -0.1277582198381424, 0.0407671220600605, 0.04598556458950043, -0.10194020718336105, -0.010070336051285267, -0.1700562834739685, -0.034850478172302246, -0.09955791383981705, -0.12483959645032883, 0.24260078370571136, -0.057736363261938095, 0.10552635043859482, -0.078193299472332, -0.1680517941713333, 0.029235737398266792, 0.1421974003314972, -0.05668419227004051, 0.036319978535175323, -0.14604443311691284, 0.030030768364667892, 0.0017202796880155802, -0.05786534398794174, 0.031465139240026474, -0.08223284780979156, -0.13402412831783295, -0.0738488957285881, 0.06266939640045166, -0.060538310557603836, -0.0016973785823211074, -0.03694646432995796, 0.00779934274032712, 0.054084792733192444, 0.2226044237613678, 0.2681948244571686, -0.0038292419631034136, -0.10492218285799026, 0.007611564360558987, 0.13875313103199005, -0.0054378206841647625, -0.019272183999419212, -0.1789281964302063, -0.010155826807022095, 0.0873386338353157, -0.12032410502433777, -0.016292830929160118, 0.05635737255215645, 0.04981690272688866, 0.002336096251383424, -0.2080378234386444, -0.08980504423379898, -0.12322501093149185, 0.021137138828635216, -0.20287413895130157, 0.03778627887368202, 0.12107082456350327, 0.29424163699150085, 0.00039614702109247446, -0.06065357103943825, 0.024280641227960587, -0.0966721624135971, 0.0872565284371376, 0.05243098735809326, -0.07305986434221268, 0.1274792104959488, -0.20228634774684906, -0.061631325632333755, -0.012803946621716022, 0.1702040582895279, -0.06644107401371002, 0.06194227933883667, 0.07426021248102188, 0.1250203400850296, 0.1593952476978302, 0.05036059767007828, 0.21393930912017822, 0.036395180970430374, -0.2002381831407547, 0.0756087377667427, 0.09355433285236359, 0.2502582371234894, -0.07857128232717514, 0.13520367443561554, 0.24620646238327026, 0.08743789047002792, -0.1108517050743103, -0.045795243233442307, -0.009989903308451176, 0.0013251833152025938, -0.06525164097547531, 0.06177651882171631, 0.03716813400387764, -0.031116051599383354, -0.13514110445976257, -0.13525429368019104, -0.012219490483403206, 0.16481813788414001, 0.0027546894270926714, -0.011146623641252518, -0.1705702841281891, 0.017428433522582054, 0.06627107411623001, 0.10641010850667953, 0.022410539910197258, 0.12890593707561493, 0.14793527126312256, -0.013381206430494785, -0.06467825919389725, 0.07285162061452866, -0.23219166696071625, -0.22880694270133972, -0.11659329384565353, 0.045803941786289215, -0.05354355648159981, 0.10822542756795883, -0.10032736510038376, 0.049129072576761246, -0.02470334991812706, -0.0026669723447412252, 0.019530298188328743, 0.17653721570968628, -0.04959958419203758, 0.021255193278193474, -0.04160267487168312, 0.028491515666246414, -0.0876169204711914, 0.14875005185604095, 0.005771697964519262, 0.24656115472316742, -0.11334725469350815, -0.13623511791229248, 0.3109629154205322, 0.18120141327381134, -0.03647013008594513, 0.13776461780071259, 0.07984504848718643, -0.03544635325670242, 0.2486722469329834, 0.20604592561721802, -0.027326278388500214, 0.10141851007938385, -0.009171335026621819, -0.008078389801084995, 0.06206689029932022, -0.041412949562072754, -0.011026431806385517, 0.028943819925189018, 0.11646366864442825, 0.03188068047165871, 0.10287575423717499, 0.1094190925359726, -0.04719354957342148, 0.1755191534757614, 0.19660256803035736, 0.002246368443593383, -0.03519870713353157, 0.04427163302898407, 0.12480587512254715, 0.10980670899152756, 0.015535606071352959, 0.053907785564661026, 0.0020555639639496803, -0.10680282860994339, 0.008370201103389263, 0.05199158936738968, -0.07941403985023499, 0.027821168303489685, 0.19254782795906067, 0.08353084325790405, -0.022613786160945892, -0.02339678816497326, 0.1348215937614441, 0.07453268021345139, -0.10606943070888519, 0.00913350097835064, -0.021485239267349243, 0.11871369928121567, -0.12186618149280548, -0.13851147890090942, -0.13857325911521912, 0.13965842127799988, 0.0059810178354382515, -0.040339525789022446, 0.02685360610485077, -0.2150682657957077, -0.1255033016204834, -0.029963774606585503, -0.22590771317481995, -0.14364491403102875, 0.0947934240102768, -0.09478674083948135, -0.06535206735134125, 0.04635069891810417, 0.05183010548353195, -0.018367769196629524, -0.03314691781997681, 0.0522739514708519, -0.06915605068206787, -0.05292559415102005, 0.07556799799203873, 0.11260524392127991, -0.015418225899338722, 0.013174823485314846, 0.12852707505226135, 0.14528843760490417, -0.10413806885480881, -0.18496567010879517, 0.04451804980635643, 0.12021461129188538, 0.007062220014631748, -0.0031598324421793222, -0.14749597012996674, 0.09081143140792847, -0.15213991701602936, -0.05183380842208862, -0.08210791647434235, -0.01597015932202339, -0.0423022098839283, 0.05898914486169815, -0.09162473678588867, 0.010195758193731308, -0.13983604311943054, 0.09779917448759079, 0.4097330570220947, 0.20058560371398926, -0.10584957152605057, 0.06812150031328201, -2.733807538773054e-32, -0.029969071969389915, -0.08050237596035004, -0.05345366522669792, -0.0865158960223198, -0.23133915662765503, 0.06076982244849205, -0.017892392352223396, 0.037767473608255386, 0.07161983102560043, -0.173093780875206, -0.1645229458808899, 0.02699294313788414, 0.11777874827384949, -0.01872081123292446, -0.08229197561740875, -0.11810588836669922, 0.12111552059650421, 0.02388414926826954, -0.10425496101379395, 0.10612110793590546, 0.31751373410224915, 0.1084510013461113, 0.020061975345015526, -0.04680943861603737, -0.06704939156770706, 0.07946184277534485, -0.005355033092200756, -0.20468482375144958, -0.07921803742647171, -0.0636691227555275, -0.026060618460178375, 0.03504589572548866, -0.19207584857940674, -0.017364386469125748, -0.07644207775592804, -0.03776179626584053, -0.22116859257221222, -0.049971625208854675, -0.020825136452913284, 0.045431558042764664, 0.15327295660972595, 0.03300861269235611, -0.02286112867295742, -0.052722543478012085, -0.10082101076841354, 0.22771112620830536, -0.01664503663778305, 0.07011687010526657, -0.08986975252628326, -0.0643111988902092, 0.034270137548446655, -0.041223518550395966, -0.028484664857387543, -0.041580215096473694, 0.027396878227591515, -0.09019861370325089, 0.06727255135774612, 0.04554598778486252, -0.2777225375175476, 0.03753652051091194, 0.0803733840584755, -0.04032886400818825, 0.10626347362995148, 0.17471809685230255, 0.16272631287574768, 0.056536465883255005, 0.216378316283226, 0.026089437305927277, 0.07070153951644897, -0.13684578239917755, 0.11878693848848343, -0.016392439603805542, -0.03832798823714256, -0.24858996272087097, 0.03947955742478371, -0.08360781520605087, 0.007980920374393463, -0.02934250794351101, -0.024769118055701256, 0.12715451419353485, -0.004882188513875008, 0.009845229797065258, 0.048508353531360626, -0.023061618208885193, -0.17627473175525665, 0.19692613184452057, 0.10829969495534897, 0.06618797034025192, -0.09262175112962723, -0.03320169821381569, 0.005987386219203472, 0.1329660564661026, -0.08557656407356262, -0.016193367540836334, -0.07793957740068436, -0.03343461453914642, 0.07104509323835373, 0.07818399369716644, -0.12060878425836563, 0.09516720473766327, 0.07874840497970581, -0.1278257519006729, 0.04197492077946663, -0.0636114701628685, 0.0880521833896637, 0.027645744383335114, 0.13531939685344696, 0.050639789551496506, -0.1557023972272873, -0.04703313112258911, -0.009375540539622307, 0.03139972314238548, 0.149773508310318, 0.020298290997743607, 0.12816016376018524, 0.041183385998010635, 0.03167450428009033, -0.07389172911643982, -0.004046749789267778, 0.15291748940944672, 0.10983484983444214, 0.008617312647402287, 0.09330154955387115, 0.1412208080291748, -0.016254287213087082, 0.06773640960454941, -0.18526069819927216, -0.1550520956516266, 0.010524188168346882, -0.14653868973255157, 0.04261929541826248, -0.06792545318603516, 7.299130970750412e-7, 0.007432487793266773, 0.13805696368217468, 0.08572230488061905, -0.288588285446167, -0.11009896546602249, 0.04256649315357208, -0.10497437417507172, 0.13075067102909088, -0.08055519312620163, 0.26035061478614807, -0.12807059288024902, -0.04435984790325165, -0.005221003200858831, 0.04370122775435448, 0.01701611839234829, -0.1185908243060112, -0.1264977604150772, 0.007287943735718727, -0.09541194885969162, 0.14327700436115265, -0.20533734560012817, 0.008914892561733723, 0.08892861753702164, 0.009352821856737137, 0.09290667623281479, -0.0649266242980957, -0.030399074777960777, 0.034279972314834595, 0.017741847783327103, 0.019432393833994865, 0.04221036285161972, 0.015740981325507164, 0.19588689506053925, -0.002304015215486288, -0.06319867074489594, -0.0049299695529043674, -0.018616607412695885, -0.20351776480674744, 0.054449670016765594, -0.17393361032009125, 0.006578267551958561, 0.01950983516871929, 0.012386291287839413, -0.2268202006816864, 0.055023372173309326, -0.12180839478969574, -0.09595386683940887, -0.068483866751194, -0.10405751317739487, 0.019583893939852715, 0.03924629092216492, 0.02434089593589306, -0.0038046890404075384, 0.38296812772750854, 0.09439034759998322, 0.012216763570904732, 0.10830176621675491, -0.22302986681461334, 0.011749478057026863, -0.27739325165748596, -0.12290746718645096, -0.1445690542459488, -0.024469221010804176, 0.10637509822845459, -0.009518451057374477, -0.19208136200904846, -0.07041016966104507, 1.4675881666123175e-34, 0.058402664959430695, -0.004662484396249056, -0.06719030439853668, -0.03112904354929924, 0.0867193192243576, -0.057537004351615906, 0.10984700173139572, 0.10720933228731155, 0.12071475386619568, -0.20264028012752533, -0.14931520819664001 ]
https://github.com/huggingface/datasets/issues/6179
Map cache with tokenizer
I have a similar issue. I was using a Jupyter Notebook and every time I call the map function it performs tokenization from scratch again although the cache files of last run still exists. I ran with 20 processes and now in the cache folder there are two groups of cached results of tokenized dataset: ``` .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:46 2023 cache-1982fea76aa54a13_00001_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 13:02:08 2023 cache-1982fea76aa54a13_00004_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:40 2023 cache-1982fea76aa54a13_00005_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:50:59 2023 cache-1982fea76aa54a13_00006_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:37 2023 cache-1982fea76aa54a13_00007_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:31 2023 cache-1982fea76aa54a13_00008_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:59:47 2023 cache-1982fea76aa54a13_00010_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:59:44 2023 cache-1982fea76aa54a13_00011_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:55:24 2023 cache-1982fea76aa54a13_00012_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:56:21 2023 cache-1982fea76aa54a13_00013_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:24 2023 cache-1982fea76aa54a13_00014_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 13:00:48 2023 cache-1982fea76aa54a13_00015_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:56 2023 cache-1982fea76aa54a13_00017_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:54 2023 cache-1982fea76aa54a13_00018_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:27 2023 cache-1982fea76aa54a13_00019_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:15:40 2023 cache-454431f643cdc5e8_00000_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:46 2023 cache-454431f643cdc5e8_00001_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:53 2023 cache-454431f643cdc5e8_00002_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:13:10 2023 cache-454431f643cdc5e8_00003_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:13:04 2023 cache-454431f643cdc5e8_00004_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:42 2023 cache-454431f643cdc5e8_00005_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:01:29 2023 cache-454431f643cdc5e8_00006_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:41 2023 cache-454431f643cdc5e8_00007_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:04 2023 cache-454431f643cdc5e8_00008_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:41 2023 cache-454431f643cdc5e8_00009_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:06 2023 cache-454431f643cdc5e8_00010_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:17:16 2023 cache-454431f643cdc5e8_00011_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:15:13 2023 cache-454431f643cdc5e8_00012_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:16:01 2023 cache-454431f643cdc5e8_00013_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:35 2023 cache-454431f643cdc5e8_00014_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:20 2023 cache-454431f643cdc5e8_00015_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:48 2023 cache-454431f643cdc5e8_00016_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 18:59:32 2023 cache-454431f643cdc5e8_00017_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:58 2023 cache-454431f643cdc5e8_00018_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:15:25 2023 cache-454431f643cdc5e8_00019_of_00020.arrow ``` can we specify the cache file for map so that it won't redo everything again?
Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session. Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with... setup ``` from transformers import AutoTokenizer AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok") ``` this prints different value each time ``` from transformers import AutoTokenizer from datasets.utils.py_utils import dumps # Huggingface datasets print(hash(dumps(AutoTokenizer.from_pretrained("tok")))) ```
457
Map cache with tokenizer Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session. Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with... setup ``` from transformers import AutoTokenizer AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok") ``` this prints different value each time ``` from transformers import AutoTokenizer from datasets.utils.py_utils import dumps # Huggingface datasets print(hash(dumps(AutoTokenizer.from_pretrained("tok")))) ``` I have a similar issue. I was using a Jupyter Notebook and every time I call the map function it performs tokenization from scratch again although the cache files of last run still exists. I ran with 20 processes and now in the cache folder there are two groups of cached results of tokenized dataset: ``` .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:46 2023 cache-1982fea76aa54a13_00001_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 13:02:08 2023 cache-1982fea76aa54a13_00004_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:40 2023 cache-1982fea76aa54a13_00005_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:50:59 2023 cache-1982fea76aa54a13_00006_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:37 2023 cache-1982fea76aa54a13_00007_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:31 2023 cache-1982fea76aa54a13_00008_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:59:47 2023 cache-1982fea76aa54a13_00010_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:59:44 2023 cache-1982fea76aa54a13_00011_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:55:24 2023 cache-1982fea76aa54a13_00012_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Sat Aug 26 12:56:21 2023 cache-1982fea76aa54a13_00013_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:24 2023 cache-1982fea76aa54a13_00014_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 13:00:48 2023 cache-1982fea76aa54a13_00015_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:56 2023 cache-1982fea76aa54a13_00017_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:56:54 2023 cache-1982fea76aa54a13_00018_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Sat Aug 26 12:57:27 2023 cache-1982fea76aa54a13_00019_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:15:40 2023 cache-454431f643cdc5e8_00000_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:46 2023 cache-454431f643cdc5e8_00001_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:53 2023 cache-454431f643cdc5e8_00002_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:13:10 2023 cache-454431f643cdc5e8_00003_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:13:04 2023 cache-454431f643cdc5e8_00004_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:42 2023 cache-454431f643cdc5e8_00005_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:01:29 2023 cache-454431f643cdc5e8_00006_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:41 2023 cache-454431f643cdc5e8_00007_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:04 2023 cache-454431f643cdc5e8_00008_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:41 2023 cache-454431f643cdc5e8_00009_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:06 2023 cache-454431f643cdc5e8_00010_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:17:16 2023 cache-454431f643cdc5e8_00011_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:15:13 2023 cache-454431f643cdc5e8_00012_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 241 MB Wed Aug 23 19:16:01 2023 cache-454431f643cdc5e8_00013_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:35 2023 cache-454431f643cdc5e8_00014_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:16:20 2023 cache-454431f643cdc5e8_00015_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:14:48 2023 cache-454431f643cdc5e8_00016_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 18:59:32 2023 cache-454431f643cdc5e8_00017_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:17:58 2023 cache-454431f643cdc5e8_00018_of_00020.arrow .rw-r--r-- fad3ew bii_dsc_community 240 MB Wed Aug 23 19:15:25 2023 cache-454431f643cdc5e8_00019_of_00020.arrow ``` can we specify the cache file for map so that it won't redo everything again?
[ 0.043856263160705566, 0.06057603284716606, -0.0008125085732899606, 0.019982172176241875, 0.19471430778503418, 0.05260895937681198, 0.11171317845582962, -0.015018048696219921, -0.11014310270547867, 0.05542462319135666, -0.17542468011379242, 0.11160998791456223, 0.007393009029328823, -0.04654345661401749, 0.042716134339571, 0.03978722169995308, 0.12998788058757782, 0.014023778960108757, -0.11491885036230087, -0.06158740818500519, -0.09697335958480835, 0.011571099050343037, 0.17123836278915405, 0.15292425453662872, -0.10810139775276184, 0.050413209944963455, -0.09855756163597107, -0.05011630803346634, 0.07422254979610443, -0.05139148235321045, -0.02949989028275013, 0.005964427255094051, -0.21680070459842682, 0.07080546766519547, 0.000005479260380525375, 0.053145818412303925, 0.04905589669942856, 0.033925704658031464, 0.022804439067840576, 0.0401574969291687, 0.14140979945659637, 0.038848087191581726, 0.014693771488964558, -0.09214218705892563, -0.1484510898590088, -0.002364777959883213, -0.02444217912852764, -0.10218492150306702, 0.20415261387825012, -0.11090885102748871, -0.01895812340080738, 0.040448520332574844, 0.004444002639502287, 0.07675997912883759, 0.09794995933771133, -0.09644068032503128, -0.041613608598709106, -0.17521309852600098, -0.2671595513820648, -0.09507209062576294, -0.044295646250247955, 0.027611296623945236, -0.04076249524950981, 0.030607566237449646, 0.1333690881729126, 0.08337191492319107, -0.1863248497247696, -0.012954208068549633, 0.07883273810148239, -0.03052929975092411, -0.030834387987852097, -0.0859551727771759, 0.0053732856176793575, 0.17451615631580353, -0.10136167705059052, -0.07105958461761475, 0.0169320497661829, 0.015646496787667274, 0.06557027995586395, 0.020932849496603012, -0.0036507989279925823, 0.09037913382053375, 0.017068132758140564, -0.11242800951004028, -0.3350992500782013, -0.032804038375616074, 0.015381557866930962, 0.22327616810798645, -0.09762612730264664, -0.16027630865573883, 0.02598496899008751, -0.08467302471399307, -0.11858528107404709, 0.08327123522758484, -0.2578589618206024, -0.004762331955134869, -0.08882013708353043, -0.0720621645450592, -0.06863667070865631, -0.09613728523254395, 0.05063232034444809, 0.011155866086483002, -0.140175461769104, 0.08822640031576157, -0.15268264710903168, -0.018677089363336563, 0.038157302886247635, 0.06348995864391327, 0.0032785560470074415, -0.06502832472324371, -0.268561989068985, -0.06925053149461746, -0.08926597237586975, 0.06253476440906525, 0.33994778990745544, -0.07489359378814697, 0.007947965525090694, 0.17473158240318298, 0.08727476000785828, 0.08414401113986969, 0.008798817172646523, 0.07426763325929642, -0.06879331916570663, 0.18576812744140625, 0.022028811275959015, -0.050177592784166336, -0.04872098192572594, -0.18597973883152008, -0.04221353307366371, 0.024680381640791893, -0.09704720973968506, -0.06809942424297333, 0.06670278310775757, 0.12092527002096176, 0.12220434099435806, 0.03670402616262436, 0.028832780197262764, -0.06974804401397705, -0.015792766585946083, -0.0345926359295845, 0.19979488849639893, -0.10006464272737503, 0.010836035944521427, -0.03755256533622742, 0.04009697958827019, 0.13768108189105988, 0.1184404194355011, 0.16358813643455505, -0.0041380757465958595, -0.0077744643203914165, -0.14622005820274353, 0.11076710373163223, 0.1841433048248291, -0.007691765204071999, 0.004691849462687969, -0.07841025292873383, 0.06291820108890533, 0.007551954593509436, -0.053222205489873886, -0.029631616547703743, 0.08719758689403534, -0.07190100848674774, -0.009186644107103348, -0.062174394726753235, -0.02523176744580269, 0.02936592698097229, 0.13947348296642303, 0.05485772714018822, 0.015213247388601303, -0.03406631574034691, -0.005989099387079477, 0.03723565861582756, -0.10530556738376617, 0.023938369005918503, -0.19929878413677216, 0.32938358187675476, -0.0965147390961647, 0.0024521811865270138, -0.10559988021850586, -0.19309106469154358, 0.046837110072374344, -0.0001668636832619086, -0.10261373966932297, -0.08309314399957657, 0.14807552099227905, -0.025188179686665535, 0.1990240067243576, 0.0196505319327116, -0.11014257371425629, -0.08896967768669128, -0.048799749463796616, -0.018562698736786842, 0.017092835158109665, -0.2010246366262436, 0.07447005808353424, 0.037748221307992935, -0.06977217644453049, 0.18928872048854828, -0.09569058567285538, -0.14208835363388062, 0.13719329237937927, -0.0019109409768134356, -0.009413310326635838, 0.07640083879232407, 0.11293864995241165, 0.04145742952823639, -0.06411387026309967, 0.14999809861183167, -0.0962098017334938, -0.18069128692150116, -0.0956668108701706, 0.06900955736637115, 0.14518600702285767, 0.11351685225963593, -0.13697853684425354, -0.09459985792636871, -0.03712497651576996, 0.029713772237300873, -0.11369213461875916, 0.05965518206357956, 0.03601973503828049, 0.03376275300979614, 0.18285085260868073, 0.10819883644580841, -0.13289114832878113, 0.0687749907374382, 0.05119840055704117, -0.024407636374235153, -0.04933229833841324, -0.00660793436691165, -0.11052422225475311, 0.07549214363098145, 0.05235588923096657, -0.0749964714050293, 0.004661946091800928, 0.1470123827457428, -0.10523717105388641, -0.10102531313896179, 0.20804032683372498, 0.03802083805203438, -0.11875787377357483, -0.0005388883291743696, -0.11141680181026459, -0.11456690728664398, 0.07934940606355667, 0.08825094252824783, 0.2358475625514984, 0.14530843496322632, 0.04719146713614464, -0.05768275260925293, 0.1270495057106018, 0.04447143152356148, -0.11642783880233765, -0.06663300842046738, -0.08844565600156784, -0.15004709362983704, 0.18458007276058197, 0.2546839118003845, 0.14533397555351257, 0.0011457327054813504, 0.16808132827281952, 0.016169723123311996, -0.08599577099084854, -0.08562878519296646, 0.028623174875974655, -0.12503160536289215, 0.0036746817640960217, -0.04782938212156296, -0.050964854657649994, 0.13202416896820068, 0.17748107016086578, 0.03969119116663933, -0.06036480888724327, 0.03295613452792168, -0.026659786701202393, -0.11094856262207031, -0.029496951028704643, 0.020872199907898903, 0.07148851454257965, -0.01320665329694748, -0.03959324583411217, 0.09102269262075424, 0.08249953389167786, -0.028882348909974098, 0.02556302212178707, 0.1136808693408966, -0.09814069420099258, 0.0012189163826406002, -0.1608114242553711, -0.08679675310850143, -0.0895054042339325, -0.123078353703022, 0.05180986598134041, -0.09374801814556122, 0.1042400375008583, 0.020228341221809387, 0.11231262236833572, -0.03391210362315178, 0.10120327025651932, -0.11263870447874069, -0.126058429479599, -0.13177508115768433, -0.13444115221500397, -0.2224399745464325, -0.035299353301525116, -0.07326631247997284, 0.10303599387407303, 0.050978075712919235, -0.1082342267036438, -0.16626465320587158, -0.13785913586616516, -0.019027212634682655, 0.026266781613230705, -0.034749746322631836, -0.09311480075120926, -0.05989465489983559, -0.07188846915960312, -0.3078535497188568, 0.20674307644367218, -0.051771074533462524, 0.13790364563465118, 0.01252809353172779, -0.0021617054007947445, -0.06566266715526581, 0.08115335553884506, -0.02897583320736885, 0.14848004281520844, -0.08704856038093567, 0.05916524678468704, -0.13128280639648438, 0.02678697183728218, 0.011556100100278854, -0.1567716747522354, -0.09852012991905212, -0.10763240605592728, -0.09818770736455917, -0.10839243978261948, -0.09923860430717468, 0.21849219501018524, -0.02598959393799305, 0.09966784715652466, -0.016801217570900917, -0.20888803899288177, 0.023086214438080788, 0.1475452035665512, 0.010823789983987808, 0.1473408043384552, -0.0823434591293335, 0.009136941283941269, 0.06641333550214767, -0.051763731986284256, 0.05367133021354675, -0.06359414011240005, -0.1767510175704956, -0.11113569140434265, 0.053298234939575195, -0.07558214664459229, -0.04319291189312935, -0.009227205999195576, 0.03552241623401642, 0.07700574398040771, 0.20614388585090637, 0.15365104377269745, -0.026785792782902718, -0.1194416955113411, 0.019566884264349937, 0.12256989628076553, -0.03316766768693924, 0.0430167056620121, -0.2381187081336975, -0.008864772506058216, 0.18230149149894714, -0.1716853380203247, -0.017531972378492355, 0.027341024950146675, -0.053276196122169495, 0.06675225496292114, -0.15840831398963928, -0.09686452895402908, -0.06637337058782578, 0.022035738453269005, -0.24019090831279755, 0.0391840785741806, 0.14001701772212982, 0.2351204752922058, 0.047453440725803375, -0.04330030828714371, 0.019692575559020042, -0.12704472243785858, 0.06425071507692337, 0.05181560292840004, -0.10891707986593246, 0.1972641944885254, -0.13385704159736633, -0.08365349471569061, -0.060932036489248276, 0.1626233011484146, -0.05198637396097183, 0.0527433417737484, 0.07302477210760117, 0.06004609912633896, 0.15854041278362274, 0.09090940654277802, 0.13034850358963013, 0.06858666241168976, -0.09413905441761017, 0.05448543652892113, 0.018012484535574913, 0.20351414382457733, -0.017012404277920723, 0.1399490088224411, 0.2593972086906433, 0.09403610974550247, -0.08380455523729324, 0.0401909239590168, -0.033952031284570694, -0.034063663333654404, -0.06626254320144653, 0.0067924256436526775, -0.025165289640426636, -0.06514719128608704, -0.16887061297893524, -0.16418474912643433, 0.034770142287015915, 0.11105652898550034, -0.002624394604936242, 0.04347650334239006, -0.14971843361854553, 0.07613624632358551, 0.0751095861196518, 0.10757973045110703, 0.053403470665216446, 0.09788110107183456, 0.12620235979557037, 0.06448990106582642, -0.1324445605278015, 0.06830321252346039, -0.16215473413467407, -0.23887482285499573, -0.07338657230138779, 0.10503728687763214, -0.04188204184174538, 0.07556048780679703, -0.18186575174331665, -0.013049466535449028, -0.12343121320009232, -0.025032157078385353, 0.07459051162004471, 0.16145136952400208, 0.023400528356432915, -0.041453052312135696, -0.06908074766397476, -0.06962376087903976, -0.12591566145420074, 0.13095921277999878, -0.022419322282075882, 0.25027021765708923, -0.14491403102874756, -0.11086021363735199, 0.35342055559158325, 0.1376916915178299, -0.031614601612091064, 0.1788381040096283, 0.1185036450624466, -0.020557116717100143, 0.2924197316169739, 0.27602145075798035, -0.11935252696275711, 0.14108538627624512, 0.029318418353796005, 0.034761860966682434, 0.03128667548298836, -0.06284307688474655, 0.011387865990400314, 0.12372581660747528, 0.11235234141349792, 0.07516317814588547, 0.03434266895055771, 0.15204405784606934, -0.04052361845970154, 0.12926356494426727, 0.15531083941459656, 0.018793156370520592, -0.02576262131333351, 0.09721313416957855, 0.016402866691350937, 0.09701648354530334, -0.016199350357055664, 0.006955218967050314, -0.0020179215352982283, -0.06648527830839157, -0.04423271492123604, 0.0809316486120224, -0.12629181146621704, 0.0603623241186142, 0.095489501953125, 0.12910836935043335, -0.14180530607700348, 0.0009172429563477635, 0.1238190233707428, 0.057025399059057236, -0.06847494840621948, 0.0433492474257946, -0.04565407708287239, 0.09460243582725525, -0.1494668424129486, -0.14253725111484528, -0.15362009406089783, 0.11989965289831161, -0.03793765977025032, -0.010830240324139595, 0.04662974923849106, -0.2407565712928772, -0.12679465115070343, 0.03378754481673241, -0.11438354849815369, -0.09938588738441467, 0.06609297543764114, -0.017959877848625183, -0.05718553811311722, 0.02660479210317135, 0.08399411290884018, -0.0736372321844101, -0.04006974399089813, 0.09488855302333832, -0.1343240588903427, -0.07827167958021164, 0.09869810938835144, 0.12634117901325226, 0.03729966655373573, -0.02064601331949234, 0.08692143857479095, 0.07640782743692398, -0.09434330463409424, -0.14147084951400757, 0.1024513691663742, 0.15557004511356354, -0.03560595586895943, -0.010986370034515858, -0.20507487654685974, 0.07377921044826508, -0.14723409712314606, -0.09300997853279114, 0.0059120431542396545, -0.04145684093236923, -0.06572785973548889, -0.0014450373128056526, -0.07045262306928635, 0.10275329649448395, -0.20274905860424042, 0.10726417601108551, 0.42510679364204407, 0.1865888237953186, -0.04089229553937912, 0.05635377764701843, -2.705230095610213e-32, -0.0674823597073555, -0.07104421406984329, -0.06543407589197159, -0.05801304057240486, -0.19592420756816864, 0.026670999825000763, -0.01091561745852232, 0.044910978525877, 0.07381495833396912, -0.1755475550889969, -0.1508989930152893, 0.0651833787560463, 0.10729509592056274, -0.06458249688148499, -0.033080216497182846, -0.07114355266094208, 0.07914681732654572, 0.048868607729673386, -0.1164693832397461, 0.13853922486305237, 0.2747499644756317, 0.09842817485332489, 0.09478060901165009, 0.01720317453145981, -0.08115450292825699, 0.019649047404527664, -0.0142079321667552, -0.2705698609352112, -0.025827061384916306, -0.01679171808063984, 0.0048479423858225346, 0.04865148663520813, -0.2285761535167694, -0.09500034898519516, -0.1244952455163002, -0.06916724890470505, -0.20728810131549835, -0.08588674664497375, -0.04934319853782654, 0.0449473038315773, 0.04988163337111473, 0.05540145933628082, 0.008202536031603813, -0.04688754677772522, -0.045921698212623596, 0.13563905656337738, -0.014025505632162094, 0.1248662918806076, -0.15662401914596558, -0.03445260971784592, -0.00919186882674694, -0.06265785545110703, -0.04539968818426132, 0.02564590610563755, 0.08826081454753876, -0.10650084912776947, 0.07253647595643997, 0.13834623992443085, -0.30185744166374207, 0.090042844414711, 0.023923328146338463, -0.10090173035860062, 0.1341785043478012, 0.12781518697738647, 0.15056957304477692, 0.07828028500080109, 0.2006574273109436, 0.10833320766687393, 0.09592703729867935, -0.050201233476400375, -0.002567006042227149, 0.013640985824167728, -0.057437729090452194, -0.21448558568954468, -0.03780035302042961, -0.10343245416879654, 0.04166361317038536, -0.10061876475811005, -0.05420123413205147, 0.1530490666627884, -0.007147872820496559, -0.0049512856639921665, 0.09684200584888458, 0.004914308898150921, -0.1793266236782074, 0.14786463975906372, 0.09275344759225845, 0.09070542454719543, -0.1314837485551834, -0.0443224236369133, 0.03933444619178772, 0.14844676852226257, -0.07715722173452377, -0.0788889229297638, -0.03683264181017876, 0.007911705411970615, 0.05740010365843773, 0.014483167789876461, -0.09949992597103119, 0.08816160261631012, 0.14037245512008667, -0.13552714884281158, 0.04335955157876015, -0.051457393914461136, 0.06879518926143646, 0.06911412626504898, 0.12536245584487915, -0.06868255883455276, -0.1480366736650467, -0.0060273995622992516, 0.05358077213168144, -0.014602288603782654, 0.178533673286438, -0.059889569878578186, 0.17381854355335236, 0.022329207509756088, 0.013077788054943085, -0.039808474481105804, 0.07500343024730682, 0.21895800530910492, 0.09465164691209793, -0.04825893044471741, 0.07261404395103455, 0.0915265902876854, 0.0014578071422874928, 0.08783049881458282, -0.1860644668340683, -0.17047978937625885, 0.06943197548389435, -0.09953602403402328, -0.016464838758111, -0.0899309515953064, 7.20773982720857e-7, -0.02340548112988472, 0.156837597489357, 0.0602116696536541, -0.27530744671821594, -0.13570642471313477, 0.033837366849184036, -0.12436576187610626, 0.06840281933546066, -0.05796979367733002, 0.30372947454452515, -0.05831132456660271, -0.018601810559630394, 0.019850296899676323, 0.03874030336737633, 0.08308334648609161, -0.14713232219219208, -0.14370396733283997, 0.06536270678043365, -0.15461325645446777, 0.11469924449920654, -0.08651942014694214, 0.03949568793177605, 0.026301030069589615, 0.0410301648080349, 0.022184500470757484, -0.032341159880161285, -0.04079807177186012, 0.015493376180529594, -0.0027412462513893843, 0.07672864198684692, 0.013959761708974838, -0.04923124238848686, 0.1722709685564041, -0.09226059913635254, -0.013775906525552273, 0.007510876748710871, -0.08153592050075531, -0.2544530928134918, 0.05842827633023262, -0.17563758790493011, 0.030790014192461967, 0.028410853818058968, 0.028945978730916977, -0.20925454795360565, 0.044145166873931885, -0.14417865872383118, -0.07811329513788223, -0.12629492580890656, -0.15928058326244354, 0.003859402146190405, 0.10573392361402512, 0.08465983718633652, 0.0526430569589138, 0.37801727652549744, 0.11330612003803253, 0.0966465175151825, 0.07684267312288284, -0.22348885238170624, 0.047669168561697006, -0.26718568801879883, -0.1491808295249939, -0.12087150663137436, 0.03323874622583389, 0.04850463569164276, 0.02899550460278988, -0.0780821293592453, -0.07006815075874329, 8.956902481140454e-35, 0.06396717578172684, -0.007842850871384144, 0.012540832161903381, -0.046600889414548874, 0.09944110363721848, -0.061555005609989166, 0.07488322257995605, 0.11169348657131195, 0.1245465874671936, -0.24940098822116852, -0.14403124153614044 ]
https://github.com/huggingface/datasets/issues/6179
Map cache with tokenizer
@Luosuu [map](https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset.map) has cache_file_name parameter In my case, I do want the cache to detect when the map function changes, so I can't pass a constant cache file name.
Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session. Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with... setup ``` from transformers import AutoTokenizer AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok") ``` this prints different value each time ``` from transformers import AutoTokenizer from datasets.utils.py_utils import dumps # Huggingface datasets print(hash(dumps(AutoTokenizer.from_pretrained("tok")))) ```
29
Map cache with tokenizer Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session. Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with... setup ``` from transformers import AutoTokenizer AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok") ``` this prints different value each time ``` from transformers import AutoTokenizer from datasets.utils.py_utils import dumps # Huggingface datasets print(hash(dumps(AutoTokenizer.from_pretrained("tok")))) ``` @Luosuu [map](https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset.map) has cache_file_name parameter In my case, I do want the cache to detect when the map function changes, so I can't pass a constant cache file name.
[ 0.08354277163743973, -0.026293251663446426, 0.034326426684856415, 0.046187374740839005, 0.22228434681892395, 0.06676868349313736, 0.07302482426166534, 0.010663309134542942, -0.041411418467760086, 0.03440198302268982, -0.1722438782453537, 0.06846242398023605, -0.030592413619160652, -0.0805724635720253, 0.06716275960206985, -0.0031078895553946495, 0.1557762622833252, -0.0039870766922831535, -0.11336378008127213, -0.05741835758090019, -0.01747819036245346, -0.001414808793924749, 0.2565103769302368, 0.18613669276237488, -0.06770642846822739, 0.07721827924251556, -0.09215183556079865, -0.04284629970788956, 0.08520523458719254, -0.05386510118842125, -0.01905938796699047, 0.03666595742106438, -0.1297892928123474, 0.06998582184314728, 0.000005431737008620985, 0.04170558974146843, -0.01272853184491396, 0.03762458637356758, 0.0008036081562750041, -0.01850096695125103, 0.10392280668020248, 0.07196502387523651, 0.04482448473572731, -0.08262499421834946, -0.17243018746376038, 0.021115271374583244, 0.06177300587296486, -0.0972823053598404, 0.18317416310310364, -0.11864236742258072, 0.00659395195543766, -0.019461236894130707, -0.020337151363492012, 0.060230802744627, 0.06802110373973846, -0.04582075774669647, -0.010835972614586353, -0.19625219702720642, -0.2626376748085022, -0.11581312865018845, -0.07530461251735687, 0.07308093458414078, -0.012607316486537457, 0.011165380477905273, 0.1912716031074524, 0.10504715144634247, -0.23563335835933685, 0.05919702723622322, 0.03130803629755974, 0.01840042695403099, -0.051756054162979126, -0.0904068648815155, -0.012722394429147243, 0.18071629106998444, -0.09501492232084274, -0.031099632382392883, 0.033059656620025635, -0.0861397534608841, 0.052130747586488724, 0.007714978884905577, 0.00220419536344707, 0.05801005661487579, -0.00727968942373991, -0.0560917891561985, -0.2238059937953949, -0.06577397882938385, 0.04439571127295494, 0.19047588109970093, -0.06994029134511948, -0.17178794741630554, -0.00137462024576962, -0.07601363956928253, -0.04661216214299202, 0.11176828294992447, -0.1987529993057251, 0.006453522946685553, -0.07116185873746872, -0.00611652759835124, -0.07544634491205215, -0.15511955320835114, 0.02866079844534397, -0.01644066348671913, -0.13122348487377167, 0.05930225923657417, -0.1789691299200058, -0.03536805510520935, 0.07575976103544235, 0.02954774908721447, 0.025750553235411644, -0.08770205080509186, -0.25558140873908997, -0.09098217636346817, -0.1222422868013382, 0.049871496856212616, 0.31124329566955566, -0.09569860249757767, -0.008895172737538815, 0.12946832180023193, 0.10766865313053131, 0.03775372728705406, 0.007033994421362877, 0.07323940098285675, -0.07813055068254471, 0.1645301729440689, 0.012203359045088291, -0.07063248753547668, -0.06421574205160141, -0.24184250831604004, -0.05412491783499718, -0.009970181621611118, -0.12362098693847656, -0.028446242213249207, 0.06156887859106064, 0.15623992681503296, 0.11074754595756531, 0.02658243477344513, 0.034052830189466476, -0.09486506134271622, -0.0030277303885668516, -0.014469650574028492, 0.18450520932674408, -0.07003931701183319, 0.04044942557811737, -0.05513135716319084, 0.04831947386264801, 0.12200544029474258, 0.12669159471988678, 0.15629242360591888, -0.016603948548436165, -0.002137063769623637, -0.10589826852083206, 0.06506838649511337, 0.16229434311389923, -0.054684288799762726, 0.037701502442359924, -0.08565006405115128, 0.09114047139883041, 0.053694892674684525, -0.040826886892318726, -0.020142020657658577, 0.08134760707616806, -0.022055665031075478, -0.061458636075258255, -0.06346597522497177, 0.014416185207664967, 0.049955159425735474, 0.16071337461471558, 0.03581735119223595, 0.09992070496082306, -0.04592152312397957, -0.06642022728919983, 0.007284229155629873, -0.10766758769750595, -0.02217814140021801, -0.255195677280426, 0.3122084438800812, -0.07782068848609924, -0.04236708953976631, -0.06272754818201065, -0.15295612812042236, 0.032519713044166565, -0.03371515870094299, 0.02392605133354664, -0.10175040364265442, 0.14078238606452942, -0.06882346421480179, 0.1923021376132965, 0.04127005860209465, -0.12349437177181244, -0.07796422392129898, -0.027212942019104958, -0.0126695791259408, 0.0008047698065638542, -0.15745273232460022, 0.03902111202478409, 0.002535235835239291, -0.07030337303876877, 0.22648034989833832, -0.09414265304803848, -0.1296336054801941, 0.16423861682415009, -0.005980152171105146, -0.021458791568875313, 0.06001242250204086, 0.12470783293247223, 0.07684116065502167, -0.13585799932479858, 0.14698755741119385, -0.06111060082912445, -0.1848246455192566, -0.09723131358623505, 0.039236873388290405, 0.20560909807682037, 0.05263891816139221, -0.11102281510829926, -0.08527228981256485, -0.018887629732489586, -0.013712108135223389, -0.04290832579135895, 0.05762910097837448, 0.018542304635047913, 0.05108262971043587, 0.19665518403053284, 0.03218044713139534, -0.08571755886077881, -0.0040801456198096275, 0.0575324147939682, -0.011768347583711147, -0.027217937633395195, -0.010997680015861988, -0.07514255493879318, 0.08988428860902786, 0.024073051288723946, -0.03618823364377022, -0.02716870978474617, 0.1652265191078186, -0.05591748654842377, -0.10469773411750793, 0.21266962587833405, 0.04606016352772713, -0.11612367630004883, -0.06373074650764465, -0.12056385725736618, -0.07983395457267761, 0.029611775651574135, 0.06628537178039551, 0.2432296723127365, 0.10719185322523117, 0.050809595733881, -0.08469513803720474, 0.11185743659734726, 0.008743633516132832, -0.14395570755004883, -0.10393267124891281, -0.015177326276898384, -0.17822138965129852, 0.2862534523010254, 0.2145920842885971, 0.09209789335727692, -0.07271061092615128, 0.19982752203941345, 0.04439002275466919, -0.07498621195554733, -0.05899932235479355, 0.02137296088039875, -0.16997118294239044, -0.023655598983168602, -0.05157122388482094, -0.015030723996460438, 0.1367906630039215, 0.18122899532318115, 0.02392030693590641, -0.0414392463862896, -0.009836156852543354, -0.055051203817129135, -0.16900944709777832, -0.04071284085512161, 0.022339511662721634, 0.015458283945918083, -0.02023744396865368, -0.09147285670042038, 0.042557284235954285, 0.1434401571750641, -0.061167310923337936, 0.06352058053016663, 0.10648580640554428, -0.10397794842720032, 0.006930410396307707, -0.18803885579109192, -0.04797525331377983, -0.1369839906692505, -0.04019518569111824, 0.04727235063910484, -0.08632486313581467, 0.10251045227050781, -0.03481393679976463, 0.09377901256084442, -0.10245691239833832, 0.08165467530488968, -0.1812186986207962, -0.08486232161521912, -0.1782321035861969, -0.1320415586233139, -0.25909167528152466, -0.0649794489145279, -0.08589842915534973, 0.14687421917915344, 0.03480232134461403, -0.0524500273168087, -0.1679358333349228, -0.12907463312149048, -0.02435484528541565, -0.023998169228434563, -0.05517938733100891, -0.10481017827987671, -0.10255814343690872, -0.03874513506889343, -0.23056919872760773, 0.2711009383201599, -0.08547054976224899, 0.16043131053447723, -0.04227926954627037, 0.03945183753967285, -0.09775356948375702, 0.10756074637174606, -0.019051041454076767, 0.21119830012321472, -0.09267952293157578, 0.04493589326739311, -0.17694643139839172, 0.04473067447543144, 0.0034977637697011232, -0.1424679160118103, -0.021791566163301468, -0.15840984880924225, -0.046771012246608734, -0.11291994899511337, -0.17543412744998932, 0.1981174647808075, -0.06680866330862045, 0.09530782699584961, -0.003864051541313529, -0.18103192746639252, 0.05708824470639229, 0.10471107065677643, -0.003977625630795956, 0.10881815105676651, -0.04519905894994736, -0.0052111148834228516, 0.07735778391361237, -0.07210034132003784, 0.024897972121834755, -0.07389649003744125, -0.1360710859298706, -0.09510672837495804, 0.01902337372303009, -0.08890651911497116, 0.012014221400022507, -0.014952301979064941, 0.05078473314642906, 0.08038599044084549, 0.23435285687446594, 0.1634134203195572, -0.04336289316415787, -0.11393773555755615, 0.045570313930511475, 0.17634683847427368, 0.0005190210067667067, 0.08527623116970062, -0.22021032869815826, -0.014989648945629597, 0.1166074126958847, -0.14826740324497223, -0.06326331943273544, 0.05393318831920624, 0.021871473640203476, -0.01883433572947979, -0.16233140230178833, -0.04211261123418808, -0.09711670875549316, 0.025591008365154266, -0.24357879161834717, 0.0196157805621624, 0.14106528460979462, 0.24565722048282623, 0.03638480231165886, -0.03539387509226799, 0.06993427127599716, -0.08908824622631073, 0.1034136563539505, 0.0862056314945221, -0.041130561381578445, 0.20264320075511932, -0.18873174488544464, -0.08937743306159973, -0.02925795502960682, 0.15901699662208557, -0.09620197117328644, 0.09705790877342224, 0.06471685320138931, 0.11123856157064438, 0.1588219702243805, 0.052195705473423004, 0.1282109022140503, -0.0013349748915061355, -0.09887773543596268, 0.05511082336306572, 0.04379399120807648, 0.28596779704093933, 0.02359929494559765, 0.06367496401071548, 0.28665241599082947, 0.0689193531870842, -0.14471250772476196, -0.036148443818092346, -0.08418896794319153, 0.003926468547433615, -0.09686925262212753, 0.05828496441245079, 0.06526729464530945, -0.006786226760596037, -0.15871398150920868, -0.1963394731283188, -0.0015658756019547582, 0.20557819306850433, 0.03888637199997902, 0.035897962749004364, -0.1616896688938141, 0.04685879126191139, 0.07071726769208908, 0.14791500568389893, 0.03413648158311844, 0.08222128450870514, 0.16005730628967285, 0.009861794300377369, -0.10741391032934189, 0.05265507847070694, -0.23708269000053406, -0.26254743337631226, -0.08487387001514435, 0.11376867443323135, -0.02687237039208412, 0.031056072562932968, -0.1158665269613266, 0.0007992336759343743, -0.058622416108846664, 0.013280324637889862, 0.015980105847120285, 0.19205930829048157, -0.02135246992111206, -0.060471612960100174, -0.07373157888650894, -0.09116820245981216, -0.07911625504493713, 0.127420112490654, 0.022136341780424118, 0.2890375256538391, -0.12049898505210876, -0.1470012366771698, 0.3074760437011719, 0.1388590782880783, -0.03561065346002579, 0.16278403997421265, 0.08526670187711716, -0.05413458123803139, 0.2682998478412628, 0.24898992478847504, -0.0991988405585289, 0.10474925488233566, 0.06594287604093552, 0.031199252232909203, 0.048773426562547684, -0.04613492637872696, 0.013995764777064323, 0.06203630939126015, 0.08891110867261887, 0.05423705279827118, 0.06934236735105515, 0.19809292256832123, -0.0429852195084095, 0.18152713775634766, 0.1408548653125763, 0.01274225115776062, -0.07429209351539612, 0.06958871334791183, 0.047693852335214615, 0.09980957955121994, -0.04027286544442177, -0.00039908220060169697, 0.07873153686523438, -0.09321773052215576, -0.057282935827970505, 0.07850278913974762, -0.11048071086406708, -0.0054975636303424835, 0.08329443633556366, 0.10264718532562256, -0.07000671327114105, -0.0008296500309370458, 0.06199541687965393, 0.08486200869083405, -0.06310445070266724, 0.023091617971658707, -0.04853266477584839, 0.09280780702829361, -0.18097363412380219, -0.14934378862380981, -0.13183312118053436, 0.127592071890831, 0.0069967517629265785, -0.03361665830016136, 0.05260080471634865, -0.17857275903224945, -0.1317385584115982, -0.014836781658232212, -0.15756091475486755, -0.11369641125202179, 0.0704459622502327, -0.036267977207899094, -0.011437713168561459, 0.005221231374889612, 0.12222899496555328, -0.03710145875811577, -0.06499765068292618, 0.04386315494775772, -0.08478356897830963, -0.07986927777528763, 0.06829782575368881, 0.1345379799604416, -0.017848500981926918, -0.014920764602720737, 0.1231725886464119, 0.07638245820999146, -0.11188685148954391, -0.17787376046180725, 0.05486980453133583, 0.10178947448730469, 0.0031265404541045427, 0.012792837806046009, -0.20232579112052917, 0.07166468352079391, -0.1415967047214508, -0.09598510712385178, -0.04706211015582085, -0.027358582243323326, -0.010430993512272835, 0.04242497682571411, -0.07036348432302475, 0.09443168342113495, -0.15774422883987427, 0.11639601737260818, 0.4202560782432556, 0.18074233829975128, -0.029731281101703644, 0.024420546367764473, -2.6590740160515883e-32, -0.025541741400957108, -0.05417143553495407, -0.041044682264328, -0.038179609924554825, -0.17726081609725952, 0.06688056141138077, -0.025318186730146408, 0.021222896873950958, 0.12307793647050858, -0.19802263379096985, -0.17110998928546906, 0.03548197075724602, 0.11079888790845871, -0.05545278638601303, -0.0936855673789978, -0.1332370787858963, 0.06853298097848892, 0.03863343596458435, -0.09809762239456177, 0.10477066040039062, 0.31861773133277893, 0.08830012381076813, 0.09730622917413712, 0.018817594274878502, -0.041500527411699295, 0.04008690267801285, 0.01333913579583168, -0.25219589471817017, -0.02549993246793747, -0.03662591800093651, -0.04864897206425667, 0.05288282036781311, -0.21632260084152222, -0.06269416213035583, -0.07958413660526276, -0.004680967889726162, -0.18402597308158875, -0.09001481533050537, -0.04031330347061157, 0.026069942861795425, 0.12057271599769592, 0.037698958069086075, -0.008396017365157604, -0.06781065464019775, -0.06211626157164574, 0.18851900100708008, -0.0234160665422678, 0.07290970534086227, -0.07370898872613907, -0.012712611816823483, 0.01009303703904152, -0.032440636307001114, -0.06162751838564873, -0.002126792212948203, 0.0879025086760521, -0.035051483660936356, 0.09401167184114456, 0.09491302818059921, -0.26141002774238586, 0.09977013617753983, 0.05767219513654709, -0.07074302434921265, 0.22004730999469757, 0.16680285334587097, 0.17342369258403778, 0.050813354551792145, 0.24280336499214172, 0.05860404297709465, 0.02761528640985489, -0.049944378435611725, 0.053859446197748184, -0.04882584884762764, 0.016291562467813492, -0.20523998141288757, 0.005584840662777424, -0.08266027271747589, 0.03428588807582855, -0.10015880316495895, 0.024827005341649055, 0.12937651574611664, -0.019794214516878128, 0.022223278880119324, 0.04749544709920883, -0.03495356813073158, -0.22237996757030487, 0.183027446269989, 0.08616573363542557, 0.08801218122243881, -0.11180997639894485, -0.0322934091091156, 0.01340214628726244, 0.1631852388381958, -0.06726173311471939, -0.028586704283952713, -0.0378502756357193, -0.024637997150421143, 0.0940568670630455, 0.011341635137796402, -0.0878388062119484, 0.10532345622777939, 0.15125681459903717, -0.18685099482536316, 0.1092710942029953, -0.08355733752250671, 0.02204214595258236, 0.03042140044271946, 0.10137491673231125, -0.0670553669333458, -0.11903251707553864, -0.02349906414747238, 0.020394332706928253, -0.005391132086515427, 0.21857236325740814, -0.008691311813890934, 0.15577177703380585, 0.03669745475053787, 0.019599158316850662, -0.03268107399344444, 0.06701333820819855, 0.203805610537529, 0.011305144056677818, -0.053224578499794006, 0.0645679384469986, 0.1273321807384491, -0.004442567005753517, 0.06347032636404037, -0.18920812010765076, -0.16956768929958344, 0.06715980172157288, -0.12941092252731323, 0.011342196725308895, -0.0848255604505539, 7.125597107915382e-7, 0.010407834313809872, 0.1448937952518463, 0.027674861252307892, -0.2790747582912445, -0.18414101004600525, -0.01614242233335972, -0.12064234167337418, 0.0627875104546547, -0.04516970366239548, 0.2434917837381363, -0.1326688528060913, -0.033083636313676834, 0.004475576337426901, 0.013760366477072239, 0.06169098615646362, -0.17965978384017944, -0.1841958463191986, 0.022438064217567444, -0.13134722411632538, 0.06997201591730118, -0.16208766400814056, 0.08263000100851059, 0.10260752588510513, 0.05697068199515343, 0.03526689484715462, 0.008491236716508865, -0.029282310977578163, -0.021539337933063507, 0.014114457182586193, 0.04257747903466225, 0.03050484135746956, -0.006335369776934385, 0.18496938049793243, -0.08033287525177002, -0.0246971994638443, -0.008539920672774315, -0.07111697643995285, -0.16814425587654114, 0.05070478096604347, -0.14001373946666718, 0.04139367863535881, 0.03160983696579933, -0.03662332519888878, -0.17908883094787598, 0.060998447239398956, -0.10954412817955017, -0.08617331087589264, -0.07173587381839752, -0.11842681467533112, -0.0007397555746138096, 0.07365090399980545, 0.04587339982390404, 0.020223161205649376, 0.42196956276893616, 0.09044953435659409, 0.10147864371538162, 0.1075286939740181, -0.19756296277046204, 0.014111954718828201, -0.3059185743331909, -0.1573631316423416, -0.1410551518201828, 0.005843347404152155, 0.020419368520379066, -0.06414106488227844, -0.13284140825271606, -0.03565237671136856, 1.018883146626738e-34, 0.04032361879944801, 0.00926712341606617, -0.026313956826925278, -0.05415763705968857, 0.09189155697822571, -0.07626375555992126, 0.1450534462928772, 0.12538792192935944, 0.15211327373981476, -0.19583214819431305, -0.15893590450286865 ]
https://github.com/huggingface/datasets/issues/6179
Map cache with tokenizer
Implementing a proper hashing function for the (fast) tokenizers is currently impossible for the reasons mentioned in the referenced issues. So the only alternative to the `cache_file_name` (or `new_fingerprint`) parameter is a custom serializer (e.g., that deserializes the tokenizer from a local save path) defined using `copyreg` or a class that wraps the tokenizer object and has `__reduce__`(`__setstate__`/`__getstate__`)
Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session. Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with... setup ``` from transformers import AutoTokenizer AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok") ``` this prints different value each time ``` from transformers import AutoTokenizer from datasets.utils.py_utils import dumps # Huggingface datasets print(hash(dumps(AutoTokenizer.from_pretrained("tok")))) ```
58
Map cache with tokenizer Similar issue to https://github.com/huggingface/datasets/issues/5985, but across different sessions rather than two calls in the same session. Unlike that issue, explicitly calling tokenizer(my_args) before the map() doesn't help, because the tokenizer was created with a different hash to begin with... setup ``` from transformers import AutoTokenizer AutoTokenizer.from_pretrained('bert-base-uncased').save_pretrained("tok") ``` this prints different value each time ``` from transformers import AutoTokenizer from datasets.utils.py_utils import dumps # Huggingface datasets print(hash(dumps(AutoTokenizer.from_pretrained("tok")))) ``` Implementing a proper hashing function for the (fast) tokenizers is currently impossible for the reasons mentioned in the referenced issues. So the only alternative to the `cache_file_name` (or `new_fingerprint`) parameter is a custom serializer (e.g., that deserializes the tokenizer from a local save path) defined using `copyreg` or a class that wraps the tokenizer object and has `__reduce__`(`__setstate__`/`__getstate__`)
[ -0.004127472639083862, 0.03699443116784096, 0.02970500849187374, 0.011882521212100983, 0.14602722227573395, 0.0545862652361393, 0.07947643846273422, 0.022032300010323524, -0.09715717285871506, 0.004419989883899689, -0.16836416721343994, 0.04825088381767273, -0.01751435548067093, 0.024127187207341194, 0.0586836002767086, -0.03787250444293022, 0.1454644650220871, -0.009638344869017601, -0.11280187964439392, -0.047016799449920654, -0.0360693633556366, -0.01509904582053423, 0.2278878539800644, 0.12541431188583374, -0.07491850107908249, 0.07609205693006516, -0.10388944298028946, -0.009504029527306557, 0.08421465009450912, -0.05552736669778824, -0.03275514766573906, 0.005333984736353159, -0.1413537710905075, 0.02159966342151165, 0.000005512744337465847, 0.0519489049911499, 0.037316471338272095, 0.061223581433296204, 0.008533048443496227, 0.01049541775137186, 0.12275490164756775, 0.055109743028879166, 0.041069090366363525, -0.08054912090301514, -0.15060655772686005, 0.03621939942240715, 0.05793134868144989, -0.043857641518116, 0.13938777148723602, -0.144083172082901, 0.0031440150924026966, 0.009646283462643623, -0.01573312282562256, 0.07121298462152481, 0.04147293046116829, -0.011625070124864578, 0.007474510930478573, -0.16475221514701843, -0.22185081243515015, -0.09125567227602005, -0.05575525388121605, 0.04141789302229881, 0.02152121812105179, -0.005852175410836935, 0.21245943009853363, 0.1123061403632164, -0.18463167548179626, 0.0751161053776741, 0.025420719757676125, 0.0030894263181835413, -0.07185770571231842, -0.11291475594043732, -0.02961486205458641, 0.13361817598342896, -0.12334097921848297, -0.03186369687318802, 0.05722258985042572, -0.1112285628914833, 0.0609743632376194, -0.029624858871102333, -0.0465528704226017, 0.028765033930540085, 0.047216203063726425, -0.059198614209890366, -0.24523136019706726, -0.10416798293590546, 0.06282280385494232, 0.14415855705738068, -0.08116324990987778, -0.14148472249507904, 0.00392321590334177, -0.07600649446249008, -0.04297100007534027, 0.07257124036550522, -0.1836230307817459, -0.0183742493391037, -0.045338843017816544, -0.05487518757581711, -0.06313065439462662, -0.11102237552404404, 0.07279478013515472, 0.0173642635345459, -0.148041769862175, 0.04437015578150749, -0.1719113439321518, -0.048976123332977295, 0.0014422577805817127, 0.028886307030916214, 0.031490083783864975, -0.059348948299884796, -0.2984933853149414, -0.09884258359670639, -0.12507644295692444, 0.06492383778095245, 0.3515728712081909, -0.0351717509329319, -0.03749014437198639, 0.10055729746818542, 0.12459204345941544, 0.04713067412376404, -0.023090997710824013, 0.10280511528253555, -0.017045065760612488, 0.18886898458003998, -0.07206936180591583, -0.01627642661333084, -0.05092401057481766, -0.25374728441238403, -0.06880113482475281, 0.020207472145557404, -0.10851921886205673, -0.07147682458162308, 0.09435710310935974, 0.10233892500400543, 0.13791914284229279, -0.05068868771195412, 0.03170790523290634, -0.08063609153032303, 0.03708675876259804, -0.029293889179825783, 0.20074345171451569, -0.09649650007486343, 0.03333502262830734, -0.037490133196115494, 0.06748702377080917, 0.08773519098758698, 0.07496508955955505, 0.15604424476623535, -0.045473068952560425, 0.018011868000030518, -0.07851509749889374, 0.054568156599998474, 0.19437527656555176, -0.05507199093699455, 0.007090367376804352, -0.0837702602148056, 0.06838001310825348, -0.03132127970457077, -0.060244183987379074, -0.021165577694773674, 0.031622499227523804, -0.09682629257440567, -0.061119191348552704, -0.057095929980278015, 0.03294605761766434, 0.0562044233083725, 0.15830357372760773, 0.06835027784109116, 0.06531798839569092, -0.04830123856663704, -0.05526505410671234, 0.025794560089707375, -0.09150803834199905, 0.000036617064324673265, -0.2158927172422409, 0.3357284665107727, -0.14158979058265686, -0.05072619765996933, -0.06311704218387604, -0.1486116498708725, 0.02281610108911991, -0.01346912607550621, -0.04662163183093071, -0.035355668514966965, 0.15757587552070618, -0.09505848586559296, 0.14022091031074524, 0.033571191132068634, -0.11931155622005463, -0.03690440207719803, -0.030930425971746445, -0.05159931629896164, 0.01478224154561758, -0.08952472358942032, 0.0202341228723526, 0.01815115101635456, -0.021042173728346825, 0.22375406324863434, -0.12088914215564728, -0.1312360167503357, 0.12659955024719238, -0.02756018377840519, 0.00044702860759571195, 0.08919166028499603, 0.0939096063375473, 0.07565142214298248, -0.16941264271736145, 0.15517881512641907, -0.07942471653223038, -0.17962612211704254, -0.11296188831329346, 0.045468542724847794, 0.21634043753147125, 0.057216938585042953, -0.1473751962184906, -0.01738128997385502, -0.07987166941165924, -0.022191787138581276, -0.04507209360599518, 0.054777614772319794, 0.0707135796546936, 0.025738077238202095, 0.1874934732913971, 0.032294854521751404, -0.09895934909582138, 0.010778785683214664, 0.08888288587331772, 0.03842362016439438, 0.030690686777234077, -0.01621333695948124, -0.053867407143116, 0.06690678745508194, 0.06334748864173889, -0.07594342529773712, -0.06012270599603653, 0.114499531686306, -0.057562991976737976, -0.0701933279633522, 0.19840170443058014, 0.061268411576747894, -0.07860395312309265, -0.042077984660863876, -0.07123292237520218, -0.10691427439451218, 0.03575621172785759, 0.08718636631965637, 0.2065298706293106, 0.12822750210762024, 0.03430941328406334, -0.06971140205860138, 0.09714707732200623, 0.03981032222509384, -0.08939677476882935, -0.10488276183605194, -0.04126228392124176, -0.21923568844795227, 0.2594048082828522, 0.22352004051208496, 0.08404017239809036, 0.03928583860397339, 0.15823759138584137, 0.011288770474493504, -0.08903166651725769, -0.04447784274816513, 0.011850448325276375, -0.16723929345607758, -0.0664934441447258, -0.0281667560338974, -0.03922806307673454, 0.1506935954093933, 0.22920221090316772, 0.02686629630625248, -0.018594134598970413, 0.026029832661151886, -0.06714438647031784, -0.15859535336494446, -0.08119779825210571, 0.017473936080932617, 0.08190172165632248, -0.02489667944610119, -0.04982572793960571, 0.04728367552161217, 0.1303754299879074, -0.032238081097602844, 0.045990604907274246, 0.07391612231731415, -0.13279607892036438, 0.02971409074962139, -0.11733058840036392, -0.09757857024669647, -0.1607484221458435, -0.07254236936569214, 0.0774800255894661, -0.08612483739852905, 0.10249146074056625, -0.03109317272901535, 0.08407356590032578, -0.07340681552886963, 0.017950400710105896, -0.16728496551513672, -0.10503187775611877, -0.1605185866355896, -0.13262422382831573, -0.21719218790531158, -0.022517146542668343, -0.007607670500874519, 0.12018507719039917, 0.008660176768898964, -0.0664806067943573, -0.1580234318971634, -0.15227104723453522, -0.054465845227241516, -0.04169285297393799, -0.05828086659312248, -0.06360408663749695, -0.08586875349283218, -0.0807914212346077, -0.30692267417907715, 0.24578966200351715, -0.055376648902893066, 0.10266288369894028, 0.008259600028395653, 0.012960609048604965, -0.10032088309526443, 0.12657447159290314, -0.00033575858105905354, 0.17796434462070465, -0.06270783394575119, 0.08281826972961426, -0.13815276324748993, 0.05699336156249046, 0.0418335422873497, -0.10005687177181244, -0.020553750917315483, -0.17882058024406433, -0.037396714091300964, -0.12727713584899902, -0.1980697214603424, 0.2704118490219116, -0.03910953551530838, 0.08735662698745728, -0.08307044953107834, -0.14615283906459808, 0.034411702305078506, 0.1464555859565735, -0.03839854896068573, 0.06122876703739166, -0.116315558552742, 0.015111996792256832, 0.030795011669397354, -0.07113917917013168, 0.014180045574903488, -0.08119004219770432, -0.13757728040218353, -0.05148070678114891, 0.052760422229766846, -0.09371142089366913, -0.008219752460718155, -0.04570160061120987, 0.018659397959709167, 0.07589642703533173, 0.26073122024536133, 0.24710069596767426, -0.016138749197125435, -0.12597058713436127, 0.03461352735757828, 0.1705963909626007, 0.008967517875134945, 0.023692956194281578, -0.20871269702911377, -0.007212708238512278, 0.0726209282875061, -0.1310577541589737, -0.05025855451822281, 0.028935372829437256, 0.035511650145053864, 0.007108320947736502, -0.17788110673427582, -0.06409735232591629, -0.10496308654546738, 0.05553446337580681, -0.21643422544002533, 0.027227826416492462, 0.13495053350925446, 0.2833108901977539, -0.004417105577886105, -0.06201423332095146, 0.0844082236289978, -0.07587811350822449, 0.08278004825115204, 0.0610070675611496, -0.10510929673910141, 0.15215177834033966, -0.189472034573555, -0.10930370539426804, 0.0003299633681308478, 0.1423833668231964, -0.05708012357354164, 0.06758660823106766, 0.06544364243745804, 0.11025940626859665, 0.18426480889320374, 0.05942774564027786, 0.19610951840877533, 0.040044281631708145, -0.19303467869758606, 0.10746028274297714, 0.08822542428970337, 0.3111632764339447, -0.05244868993759155, 0.08549508452415466, 0.2610691785812378, 0.061085931956768036, -0.13143165409564972, -0.016238979995250702, -0.05081595107913017, -0.01760629005730152, -0.10347381234169006, 0.08129527419805527, 0.054660338908433914, -0.03375428915023804, -0.1673232465982437, -0.1492622047662735, 0.008717832155525684, 0.18288452923297882, 0.01657298393547535, -0.010363880544900894, -0.15448132157325745, 0.05099869892001152, 0.07014395296573639, 0.11598315834999084, 0.051917463541030884, 0.13807633519172668, 0.14317186176776886, 0.013085609301924706, -0.09865904599428177, 0.0699608102440834, -0.21023572981357574, -0.227102130651474, -0.1196897104382515, 0.07758809626102448, -0.04442640393972397, 0.13704688847064972, -0.0815194621682167, 0.05474259704351425, -0.03102056309580803, -0.022000422701239586, 0.0002598419669084251, 0.1997758150100708, -0.05639093741774559, -0.030674418434500694, -0.030608423054218292, -0.034423112869262695, -0.07410402595996857, 0.1902574598789215, -0.0008896131184883416, 0.214172825217247, -0.11173965036869049, -0.12910336256027222, 0.3242599666118622, 0.1904742270708084, -0.036914609372615814, 0.10158959776163101, 0.09035339206457138, -0.06403820216655731, 0.28228455781936646, 0.212993785738945, -0.08515989780426025, 0.10419502854347229, -0.01486647967249155, -0.04085851460695267, 0.06990677118301392, -0.0459400899708271, -0.004178287461400032, 0.05761917680501938, 0.1053878515958786, 0.04225523769855499, 0.10120262950658798, 0.12671446800231934, -0.04158000275492668, 0.20353925228118896, 0.12720806896686554, 0.018167907372117043, -0.05299977958202362, 0.06677860766649246, 0.11615805327892303, 0.09559287875890732, 0.005274923983961344, 0.00573698291555047, 0.036460742354393005, -0.09127164632081985, -0.04512748867273331, 0.05925463140010834, -0.07669740915298462, 0.041310865432024, 0.12423142045736313, 0.10280735790729523, -0.016290396451950073, -0.04583946242928505, 0.11474216729402542, 0.061950039118528366, -0.0655236765742302, 0.010088060982525349, -0.049612924456596375, 0.1200113520026207, -0.1444934606552124, -0.1773911714553833, -0.12860089540481567, 0.1591569185256958, 0.01648588292300701, -0.04069123789668083, 0.02197372168302536, -0.21071715652942657, -0.12712028622627258, -0.022298946976661682, -0.18446743488311768, -0.13285230100154877, 0.06108947843313217, -0.07181862741708755, -0.045075319707393646, 0.014723229221999645, 0.08208736032247543, 0.012729162350296974, -0.06550624221563339, 0.050558555871248245, -0.08847673237323761, -0.04852801188826561, 0.07479330897331238, 0.12376972287893295, -0.04095127806067467, -0.008391416631639004, 0.11841826140880585, 0.15956754982471466, -0.07942609488964081, -0.1752576380968094, 0.08212444931268692, 0.12860888242721558, 0.01931321807205677, 0.024831101298332214, -0.19051222503185272, 0.06259491294622421, -0.17102371156215668, -0.08340559899806976, -0.05742067098617554, -0.03607972338795662, -0.05851653963327408, 0.03838462382555008, -0.08654282987117767, 0.07502474635839462, -0.11859872937202454, 0.11489945650100708, 0.4035937190055847, 0.15131787955760956, -0.10190983861684799, 0.0697692409157753, -2.7293053954094044e-32, -0.03883305937051773, -0.09425351768732071, -0.05677412450313568, -0.09576273709535599, -0.2243463695049286, 0.051490869373083115, -0.03231256455183029, 0.0112296212464571, 0.0773504301905632, -0.16748499870300293, -0.1778986155986786, 0.041322484612464905, 0.12043754011392593, -0.009118866175413132, -0.11000373214483261, -0.12180202454328537, 0.11893187463283539, 0.03528587147593498, -0.10083892941474915, 0.1128847524523735, 0.33208656311035156, 0.09713555872440338, 0.043663524091243744, -0.016499094665050507, -0.12119917571544647, 0.07689418643712997, 0.01774078607559204, -0.21238745748996735, -0.04552418366074562, -0.04909947142004967, -0.05004562437534332, 0.029318630695343018, -0.20688194036483765, -0.02661595307290554, -0.06940366327762604, 0.0038506407290697098, -0.24214769899845123, -0.03103555366396904, -0.031902845948934555, 0.035371001809835434, 0.1611354798078537, 0.06390418112277985, -0.015495743602514267, -0.0278615765273571, -0.06417952477931976, 0.2480669468641281, -0.04905231297016144, 0.10364201664924622, -0.1078369989991188, -0.04075878858566284, 0.014432976022362709, -0.05878151208162308, -0.07403745502233505, -0.0033473889343440533, 0.08475933223962784, -0.0957190990447998, 0.08216388523578644, 0.07974201440811157, -0.2634868025779724, 0.041634004563093185, 0.055231720209121704, -0.02656734362244606, 0.13838039338588715, 0.1650853306055069, 0.17147564888000488, 0.05030564218759537, 0.2504705488681793, 0.03980276733636856, 0.06898169219493866, -0.09477344900369644, 0.12926337122917175, -0.03451542556285858, -0.010925292037427425, -0.2111387997865677, 0.0323224738240242, -0.09444975107908249, 0.020040610805153847, -0.0756770446896553, 0.011711220256984234, 0.12866434454917908, -0.006206303369253874, 0.019200047478079796, 0.0585043802857399, -0.011112669482827187, -0.19527609646320343, 0.1815534234046936, 0.11177153140306473, 0.08495083451271057, -0.08529487252235413, -0.015553824603557587, -0.04325670003890991, 0.15288032591342926, -0.06009721755981445, -0.021283449605107307, -0.06372655928134918, -0.017437895759940147, 0.08421660214662552, 0.07574187219142914, -0.09585963934659958, 0.060970526188611984, 0.12555748224258423, -0.1549900770187378, 0.06009664013981819, -0.029510999098420143, 0.0770065039396286, 0.016346285119652748, 0.10688640922307968, -0.006717520300298929, -0.19126085937023163, -0.043280865997076035, -0.007466686889529228, 0.021440720185637474, 0.1320411115884781, -0.03571382537484169, 0.14691783487796783, 0.05635584145784378, 0.05330535024404526, -0.06450100988149643, 0.008815580978989601, 0.1461062729358673, 0.07972802966833115, -0.03243977949023247, 0.1282190978527069, 0.1492532193660736, 0.01690613105893135, 0.0664672702550888, -0.17477303743362427, -0.186073899269104, 0.08794336020946503, -0.13310030102729797, 0.022044219076633453, -0.04699569568037987, 7.233273322526657e-7, 0.019873587414622307, 0.15504109859466553, 0.08263982832431793, -0.30862677097320557, -0.15451453626155853, 0.05846519395709038, -0.07223138213157654, 0.08569637686014175, -0.04484696313738823, 0.25040555000305176, -0.09582195430994034, -0.0044783009216189384, 0.003745448309928179, 0.07099244743585587, 0.01076661515980959, -0.11051200330257416, -0.14594894647598267, 0.020328696817159653, -0.10963748395442963, 0.12605561316013336, -0.16159053146839142, 0.03192402422428131, 0.040267910808324814, 0.0066298493184149265, 0.08599722385406494, -0.012302174232900143, -0.028084972873330116, 0.013865141198039055, 0.03085409663617611, 0.022284097969532013, 0.007754839491099119, 0.019396711140871048, 0.16542518138885498, -0.06327037513256073, -0.05907446891069412, -0.03034333512187004, -0.06158605217933655, -0.16479042172431946, 0.03712019696831703, -0.19258487224578857, -0.011731416918337345, 0.06538840383291245, -0.017447251826524734, -0.16548040509223938, 0.05484524741768837, -0.09871924668550491, -0.14058934152126312, -0.08526956290006638, -0.1366215944290161, 0.018213413655757904, 0.014176438562572002, 0.05381464958190918, 0.03185214847326279, 0.4086398780345917, 0.08495055884122849, 0.0403759740293026, 0.08311033248901367, -0.2068963646888733, -0.0009713998879306018, -0.26160264015197754, -0.10699857026338577, -0.11732900887727737, -0.035259414464235306, 0.06952034682035446, -0.02610236406326294, -0.1488410383462906, -0.06323296576738358, 1.6134837755274122e-34, 0.060284972190856934, -0.01690354384481907, 0.0017676601419225335, -0.0002507946628611535, 0.05958404392004013, -0.06399831175804138, 0.10065187513828278, 0.10988885909318924, 0.13808844983577728, -0.19364041090011597, -0.16402235627174377 ]
https://github.com/huggingface/datasets/issues/6178
'import datasets' throws "invalid syntax error"
This seems to be related to your environment and not the `datasets` code (e.g., this could happen when exposing the Python 3.9 site packages to a lower Python version (interpreter))
### Describe the bug Hi, I have been trying to import the datasets library but I keep gtting this error. `Traceback (most recent call last): File /opt/local/jupyterhub/lib64/python3.9/site-packages/IPython/core/interactiveshell.py:3508 in run_code exec(code_obj, self.user_global_ns, self.user_ns) Cell In[2], line 1 import datasets File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/__init__.py:22 from .arrow_dataset import Dataset File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/arrow_dataset.py:67 from .arrow_writer import ArrowWriter, OptimizedTypedSequence File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/arrow_writer.py:27 from .features import Features, Image, Value File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/features/__init__.py:17 from .audio import Audio File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/features/audio.py:11 from ..download.streaming_download_manager import xopen, xsplitext File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/download/__init__.py:10 from .streaming_download_manager import StreamingDownloadManager File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/download/streaming_download_manager.py:18 from aiohttp.client_exceptions import ClientError File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/__init__.py:7 from .connector import * # noqa File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/connector.py:12 from .client import ClientRequest File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/client.py:144 yield from asyncio.async(resp.release(), loop=loop) ^ SyntaxError: invalid syntax` I have simply used these commands: `import datasets` and `from datasets import load_dataset` ### Environment info The library has been installed a virtual machine on JupyterHub. Although I have used this library multiple times (on the same VM) before, to train/test an ASR or other ML models, I had never encountered this error.
30
'import datasets' throws "invalid syntax error" ### Describe the bug Hi, I have been trying to import the datasets library but I keep gtting this error. `Traceback (most recent call last): File /opt/local/jupyterhub/lib64/python3.9/site-packages/IPython/core/interactiveshell.py:3508 in run_code exec(code_obj, self.user_global_ns, self.user_ns) Cell In[2], line 1 import datasets File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/__init__.py:22 from .arrow_dataset import Dataset File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/arrow_dataset.py:67 from .arrow_writer import ArrowWriter, OptimizedTypedSequence File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/arrow_writer.py:27 from .features import Features, Image, Value File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/features/__init__.py:17 from .audio import Audio File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/features/audio.py:11 from ..download.streaming_download_manager import xopen, xsplitext File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/download/__init__.py:10 from .streaming_download_manager import StreamingDownloadManager File /opt/local/jupyterhub/lib64/python3.9/site-packages/datasets/download/streaming_download_manager.py:18 from aiohttp.client_exceptions import ClientError File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/__init__.py:7 from .connector import * # noqa File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/connector.py:12 from .client import ClientRequest File /opt/local/jupyterhub/lib64/python3.9/site-packages/aiohttp/client.py:144 yield from asyncio.async(resp.release(), loop=loop) ^ SyntaxError: invalid syntax` I have simply used these commands: `import datasets` and `from datasets import load_dataset` ### Environment info The library has been installed a virtual machine on JupyterHub. Although I have used this library multiple times (on the same VM) before, to train/test an ASR or other ML models, I had never encountered this error. This seems to be related to your environment and not the `datasets` code (e.g., this could happen when exposing the Python 3.9 site packages to a lower Python version (interpreter))
[ 0.09973940253257751, 0.0724477544426918, -0.0996350347995758, -0.16792315244674683, 0.27158740162849426, 0.024706397205591202, 0.1667175441980362, 0.0970863327383995, 0.03457057848572731, 0.15759781002998352, -0.1039264127612114, -0.02767501026391983, -0.008333318866789341, 0.0519552007317543, 0.021650264039635658, -0.06038963794708252, 0.02342158742249012, -0.08203011006116867, 0.09730397909879684, 0.060084570199251175, -0.10922858864068985, 0.09044336527585983, 0.07320742309093475, -0.0131562240421772, 0.12338031828403473, -0.1375877410173416, 0.042004358023405075, 0.18522334098815918, -0.07120693475008011, -0.1432322859764099, 0.19221295416355133, -0.03442556411027908, 0.19825708866119385, 0.2528305649757385, 0.000005322177912603365, 0.01927070878446102, 0.1530573070049286, 0.05033637955784798, -0.034742604941129684, -0.14605383574962616, 0.030111519619822502, -0.027674255892634392, -0.07544725388288498, -0.03196023032069206, 0.17175787687301636, -0.1234453096985817, -0.12647327780723572, -0.012040370143949986, 0.09422635287046432, 0.18949900567531586, 0.03536762669682503, 0.0011468747397884727, 0.08684050291776657, -0.17951951920986176, 0.11093304306268692, 0.05223820358514786, 0.15096083283424377, 0.1313980221748352, -0.17913682758808136, -0.11520689725875854, 0.041727665811777115, -0.047427065670490265, -0.07292763888835907, 0.0011109499027952552, -0.09308727830648422, 0.01606830768287182, -0.06319887936115265, -0.09574154019355774, -0.1493443250656128, 0.30232560634613037, 0.19029249250888824, 0.11368231475353241, -0.11716403812170029, 0.027439860627055168, -0.054762985557317734, -0.10016407817602158, -0.14861227571964264, 0.039286818355321884, -0.18485207855701447, 0.09697593748569489, 0.04247773811221123, -0.07729579508304596, -0.004553731996566057, 0.03499811515212059, -0.008788998238742352, 0.012238684110343456, -0.12281642109155655, 0.01550632156431675, -0.04051331803202629, -0.18900719285011292, 0.18337273597717285, 0.02861790731549263, -0.08286240696907043, -0.24483200907707214, 0.11389981210231781, -0.04291066154837608, -0.05065162107348442, -0.08012443780899048, -0.01852191984653473, 0.02418118715286255, -0.08334234356880188, -0.2579348087310791, 0.024795139208436012, 0.31480416655540466, 0.19718791544437408, -0.026735829189419746, 0.11503369361162186, 0.018339307978749275, 0.04332166910171509, 0.13552390038967133, 0.14198903739452362, 0.02620701678097248, -0.09769516438245773, -0.20456305146217346, -0.0008568322518840432, 0.15980324149131775, 0.16332228481769562, -0.008449651300907135, -0.10582195967435837, 0.0593622662127018, -0.0012431602226570249, -0.04849930480122566, -0.0011025979183614254, 0.00869388785213232, 0.061437323689460754, -0.0818529799580574, 0.05053092539310455, 0.24449707567691803, -0.05660613253712654, -0.04620534926652908, -0.03579536825418472, 0.18260399997234344, 0.04045353829860687, -0.1333358734846115, 0.10902120172977448, 0.005740239284932613, -0.028690671548247337, -0.16590513288974762, -0.038692131638526917, 0.05943489447236061, 0.10103180259466171, -0.10529031604528427, -0.10382868349552155, 0.03246471285820007, 0.12944310903549194, -0.01630536839365959, 0.13052357733249664, -0.05881619080901146, -0.03939133882522583, 0.08833668380975723, -0.27000555396080017, 0.09651755541563034, -0.1659289449453354, 0.15883003175258636, -0.057540878653526306, -0.013606853783130646, -0.09572507441043854, -0.09755375236272812, -0.18037255108356476, -0.18964344263076782, -0.029156656935811043, 0.009538638405501842, 0.11276005208492279, -0.08278725296258926, 0.029813965782523155, 0.21575939655303955, -0.07026941329240799, 0.04827888309955597, -0.17413316667079926, -0.02986077591776848, 0.15914717316627502, 0.06905335187911987, -0.05503740534186363, 0.07154061645269394, 0.02230769954621792, 0.06728878617286682, 0.009408648125827312, 0.029826844111084938, -0.1819797158241272, -0.13424013555049896, 0.13150224089622498, -0.16268928349018097, 0.04908303916454315, -0.1565128117799759, 0.11010190099477768, 0.03351380303502083, -0.07146415114402771, 0.07451483607292175, -0.012115002609789371, -0.16574573516845703, -0.01011728122830391, 0.20744812488555908, 0.045846085995435715, 0.07120061665773392, 0.10124475508928299, -0.23689529299736023, 0.001239623874425888, -0.06694258004426956, -0.015430992469191551, -0.04685288295149803, 0.016427641734480858, -0.052866797894239426, 0.024147484451532364, -0.030882546678185463, 0.040527988225221634, 0.00046231879969127476, 0.0566941574215889, -0.041091885417699814, 0.03824055567383766, -0.03835783153772354, 0.004630678799003363, 0.09194499999284744, -0.13546207547187805, -0.06927881389856339, 0.02929411455988884, 0.0376683808863163, -0.03213845565915108, 0.1989792138338089, -0.11693297326564789, -0.01279700268059969, -0.0015305295819416642, 0.14737531542778015, 0.0902581587433815, 0.04850366339087486, -0.08917397260665894, 0.06727544963359833, -0.09755044430494308, -0.028347650542855263, 0.059318818151950836, 0.11003834754228592, -0.0703490599989891, -0.042139507830142975, -0.1130589097738266, 0.19731751084327698, 0.05136416479945183, -0.034740839153528214, 0.03260144218802452, -0.1463717520236969, -0.010615050792694092, 0.0013549489667639136, -0.17212176322937012, 0.12172831594944, 0.009801779873669147, 0.002075411146506667, -0.0006140271434560418, 0.1301719844341278, -0.0943986251950264, 0.08537121117115021, -0.023713603615760803, 0.0832238495349884, 0.25952911376953125, 0.06589667499065399, -0.1961156129837036, -0.003392399987205863, 0.0730711817741394, -0.02423832193017006, -0.23053660988807678, -0.11952134966850281, 0.0075661540031433105, -0.1880434900522232, 0.1715930849313736, -0.011121575720608234, 0.06713523715734482, 0.07319594919681549, 0.14673180878162384, -0.0745834931731224, 0.2000124305486679, 0.012955795042216778, 0.1102038025856018, 0.051410477608442307, -0.16417475044727325, 0.026537125930190086, -0.07866884768009186, -0.15285035967826843, 0.19581852853298187, 0.002951421309262514, 0.04910046607255936, -0.1225336566567421, -0.011474196799099445, -0.010273770429193974, -0.2741330564022064, 0.019307369366288185, -0.02080151066184044, -0.11512978374958038, -0.03107663430273533, 0.13225340843200684, -0.08943206071853638, -0.1884468048810959, 0.006231928244233131, 0.1289534568786621, 0.06590215861797333, -0.001639283960685134, -0.029074912890791893, -0.17601993680000305, -0.20476020872592926, 0.01641019806265831, 0.09096292406320572, -0.1357155442237854, -0.1047644093632698, 0.0106932632625103, 0.0487629659473896, -0.13052356243133545, 0.18221858143806458, 0.05492580682039261, 0.13738791644573212, 0.08213518559932709, 0.2717510163784027, 0.2573363482952118, 0.055609021335840225, -0.1877589374780655, 0.15560589730739594, -0.04732386767864227, 0.026899810880422592, 0.14366191625595093, 0.07057405263185501, -0.056864380836486816, -0.06349997967481613, -0.07065185159444809, 0.02236652374267578, 0.07843726873397827, -0.06849377602338791, 0.13645748794078827, -0.08471190929412842, 0.0993780717253685, -0.09929084032773972, 0.12199338525533676, -0.3269854187965393, -0.22491906583309174, -0.1400015503168106, 0.043102897703647614, -0.10578711330890656, 0.09967473149299622, -0.07380829006433487, -0.05259452760219574, 0.14875595271587372, -0.09848187118768692, -0.1868560016155243, -0.0435488186776638, 0.2694532573223114, 0.0021606129594147205, -0.043092962354421616, -0.05650397390127182, -0.026672497391700745, 0.050287578254938126, -0.04959312826395035, -0.06345546245574951, -0.020773788914084435, -0.12306942045688629, -0.029914766550064087, -0.047355081886053085, 0.09739495068788528, 0.051385413855314255, 0.03430470824241638, -0.09509532153606415, -0.020700925961136818, 0.07265576720237732, -0.19499647617340088, 0.08001429587602615, -0.1472695916891098, 0.09155798703432083, 0.2054865062236786, -0.052179668098688126, 0.007160316687077284, 0.05573761835694313, -0.06943251937627792, 0.24977871775627136, 0.17376814782619476, 0.08970583975315094, -0.18076303601264954, -0.16510319709777832, 0.024599621072411537, -0.12019311636686325, 0.0834314152598381, -0.039189450442790985, -0.05040794238448143, 0.0905710980296135, -0.132903590798378, -0.12275488674640656, 0.15497225522994995, 0.01067151129245758, -0.0009597113239578903, -0.09939716011285782, -0.0702417865395546, 0.1728997826576233, 0.10645366460084915, 0.0062147402204573154, -0.06614245474338531, 0.015361090190708637, 0.06535737216472626, 0.15353816747665405, 0.22982533276081085, -0.00535501167178154, 0.017118047922849655, -0.10852784663438797, 0.10578472167253494, -0.1971835345029831, 0.23364481329917908, 0.22840499877929688, -0.051804885268211365, -0.04608945548534393, 0.03796699643135071, 0.023979343473911285, -0.054076917469501495, 0.03755361959338188, 0.22281964123249054, 0.12645679712295532, -0.002887520706281066, -0.1040353998541832, -0.13717041909694672, -0.08623332530260086, 0.06103240326046944, -0.08404713124036789, -0.0627683699131012, 0.15677139163017273, 0.14919689297676086, 0.061911504715681076, 0.02551231160759926, -0.10863979160785675, -0.16006982326507568, -0.25676074624061584, -0.22717179358005524, -0.20166759192943573, 0.14832746982574463, 0.15727569162845612, 0.050980500876903534, -0.06884901225566864, 0.02507651224732399, -0.043182432651519775, 0.14154228568077087, -0.05497122183442116, 0.19338081777095795, -0.18136979639530182, 0.00264913821592927, -0.0637727901339531, -0.03473511338233948, 0.015722470358014107, 0.3984552025794983, -0.14463600516319275, -0.16712269186973572, -0.08956960588693619, -0.21821384131908417, -0.01305943913757801, -0.0027662499342113733, -0.04069876670837402, 0.034942876547575, -0.22347252070903778, 0.0045023635029792786, 0.03099987469613552, -0.0736880674958229, 0.02392158843576908, -0.02165890298783779, -0.14249995350837708, -0.06048525124788284, -0.1552974432706833, 0.06712386012077332, -0.04476698487997055, 0.16036908328533173, 0.0003697528736665845, 0.008963980711996555, -0.0046737235970795155, -0.101991668343544, -0.05635308846831322, -0.09345617890357971, 0.013348830863833427, 0.10569574683904648, -0.0741802528500557, 0.20125658810138702, -0.15010015666484833, -0.1431507170200348, 0.15009157359600067, 0.11185869574546814, 0.11359621584415436, -0.11010365933179855, 0.02509142830967903, 0.05250446870923042, -0.24417157471179962, 0.05038493126630783, -0.21046505868434906, 0.017268814146518707, 0.07656501233577728, 0.14183630049228668, 0.053994614630937576, 0.2058573216199875, -0.03406408429145813, -0.025994107127189636, -0.009660911746323109, -0.03420291095972061, -0.10750023275613785, -0.10954611748456955, -0.012594807893037796, 0.09224099665880203, -0.06343235820531845, 0.06125105172395706, -0.04918185994029045, 0.17321445047855377, -0.020388146862387657, 0.004827794153243303, 0.21347977221012115, -0.08328475058078766, 0.06403946876525879, -0.04170658811926842, -0.03368658199906349, -0.027526095509529114, 0.02104734256863594, -0.048239998519420624, -0.205439954996109, 0.11847810447216034, 0.1347561925649643, -0.14191065728664398, -0.17270739376544952, 0.02968425489962101, -0.034598104655742645, -0.1657450944185257, -0.06488368660211563, 0.06452888250350952, 0.06059646978974342, 0.014121893793344498, -0.07957746833562851, -0.06138411536812782, 0.022152002900838852, -0.029779506847262383, -0.11245264858007431, -0.06520349532365799, -0.0450349897146225, 0.01149813923984766, 0.07326896488666534, 0.14081348478794098, 0.06999409943819046, 0.0543426088988781, 0.14376257359981537, 0.15952573716640472, 0.22690361738204956, 0.0813622996211052, -0.11861057579517365, 0.030055992305278778, 0.12275151163339615, 0.14999163150787354, -0.15720941126346588, 0.09945165365934372, 0.010565496049821377, 0.05043863505125046, -0.09599027037620544, 0.0047761606983840466, 0.06902187317609787, 0.21558690071105957, 0.1274874359369278, -0.052837904542684555, -0.024997128173708916, -0.0687355026602745, -0.06282846629619598, -0.1687643826007843, 0.14436256885528564, 0.03728362172842026, 0.020357847213745117, -0.015758268535137177, -2.375977507491149e-32, 0.02090141363441944, 0.1166837140917778, -0.09467211365699768, 0.13624486327171326, -0.2774299383163452, -0.044102512300014496, -0.021322663873434067, -0.05691744387149811, -0.066594697535038, -0.09241596609354019, -0.04214579984545708, -0.010425655171275139, 0.0006829394260421395, 0.02905776910483837, -0.060884345322847366, 0.06322618573904037, -0.05097823590040207, 0.014167076908051968, 0.07000917196273804, -0.08424083888530731, 0.08798103034496307, 0.03819757327437401, 0.12645746767520905, 0.028123607859015465, -0.13514524698257446, 0.07245608419179916, -0.056379009038209915, -0.05499344691634178, 0.1155146136879921, -0.02315550111234188, 0.01061658002436161, 0.11100812256336212, 0.007513002026826143, -0.05558433011174202, -0.05871334299445152, 0.019059455022215843, -0.07519526779651642, -0.12217864394187927, -0.12495941668748856, 0.14597159624099731, -0.04127626493573189, 0.1301916539669037, 0.11918101459741592, -0.22707271575927734, 0.12182348221540451, 0.08112095296382904, 0.031757038086652756, -0.16820448637008667, -0.033660583198070526, -0.15810458362102509, 0.1898321509361267, 0.07501563429832458, -0.10935593396425247, 0.11052677780389786, 0.13727572560310364, -0.05095592141151428, -0.07540373504161835, 0.026372922584414482, -0.129726842045784, 0.148732528090477, 0.09290224313735962, -0.09935939311981201, 0.025841493159532547, 0.01856246031820774, 0.1061984971165657, 0.08932361751794815, 0.20878267288208008, -0.1464211642742157, 0.03800569847226143, 0.0770471841096878, -0.15984538197517395, 0.09873764216899872, -0.08458385616540909, 0.007571169640868902, -0.24152514338493347, -0.01317371055483818, -0.2623005211353302, 0.038063522428274155, -0.021036120131611824, -0.03270640969276428, -0.033110957592725754, 0.12386345118284225, -0.12668168544769287, 0.005797701887786388, 0.04634407162666321, -0.00040297824307344854, -0.03597765415906906, -0.03470129147171974, -0.14447078108787537, -0.10140888392925262, -0.007317965850234032, -0.0034916955046355724, -0.10833878815174103, 0.002376061398535967, -0.17588640749454498, 0.11088177561759949, -0.047040533274412155, 0.028985416516661644, -0.1494191288948059, -0.08062125742435455, -0.020626258105039597, -0.004095876589417458, 0.05016160383820534, 0.03616886958479881, 0.23042969405651093, 0.047334760427474976, 0.08359654247760773, 0.027995510026812553, -0.20650620758533478, -0.10982473194599152, 0.06646315008401871, -0.07629118114709854, 0.15022045373916626, 0.06781800091266632, 0.17638646066188812, 0.017044009640812874, -0.0624542310833931, -0.08829854428768158, 0.18322257697582245, -0.011631370522081852, -0.18812191486358643, 0.06774156540632248, -0.2235529124736786, -0.05976059287786484, 0.012306135147809982, 0.02319342829287052, -0.1687336415052414, -0.012281334027647972, -0.0034314182121306658, 0.09730847179889679, 0.023044640198349953, -0.030204782262444496, 7.056850677145121e-7, -0.3037286400794983, 0.08164472877979279, -0.13960115611553192, 0.11449788510799408, -0.12718269228935242, 0.0739993005990982, -0.23968034982681274, 0.03766375035047531, 0.052389562129974365, 0.12914101779460907, 0.24692989885807037, -0.07372378557920456, 0.026552753522992134, -0.009523874148726463, 0.1184275671839714, -0.01314560417085886, -0.060422707349061966, 0.031241241842508316, -0.07809124141931534, -0.18568386137485504, 0.2333269566297531, 0.03893741965293884, 0.27597811818122864, -0.064220130443573, 0.05565972253680229, -0.13494840264320374, -0.05670630559325218, -0.18111279606819153, 0.04828615114092827, -0.020507778972387314, 0.03015262261033058, -0.01021894346922636, -0.0811292827129364, 0.23764969408512115, 0.08457709103822708, -0.1859837919473648, -0.02658798359334469, -0.09715405851602554, 0.11176079511642456, 0.09237933903932571, 0.09903708845376968, 0.251338928937912, -0.07480223476886749, -0.08651179075241089, 0.15428337454795837, 0.14421574771404266, -0.028858015313744545, -0.00047137198271229863, -0.11326909065246582, 0.11648763716220856, 0.17217157781124115, 0.08510768413543701, -0.02513667196035385, -0.018640615046024323, -0.07917636632919312, 0.1339198648929596, -0.06653016060590744, -0.01696573756635189, 0.08125758171081543, 0.0652126669883728, -0.18167917430400848, -0.046402763575315475, -0.03476477414369583, 0.010329638607800007, -0.01982569694519043, -0.02944057807326317, 0.030704453587532043, 5.014475803587414e-35, 0.031044211238622665, -0.14171046018600464, 0.17149175703525543, -0.12122296541929245, -0.10696607083082199, 0.08877255767583847, 0.07375939935445786, -0.14023913443088531, 0.11057686805725098, -0.11957304179668427, -0.026455804705619812 ]
https://github.com/huggingface/datasets/issues/6280
Couldn't cast array of type fixed_size_list to Sequence(Value(float64))
Thanks for the quick response @mariosasko! I just installed your branch via `poetry add 'git+https://github.com/huggingface/datasets#fix-array_values'` and I can confirm it works on the example provided. Follow up question for you, should `None`s be supported in these types of features as they are in others? For example, the following script: ``` from datasets import Features, Value, Sequence, ClassLabel, Dataset dataset_features = Features({ 'text': Value('string'), 'embedding': Sequence(Value('double'), length=2), 'categories': Sequence(ClassLabel(names=sorted([ 'one', 'two', 'three' ]))), }) dataset = Dataset.from_dict( { 'text': ['A'] * 10000, "embedding": [None] * 10000, # THIS LINE CHANGED 'categories': [[0]] * 10000, }, features=dataset_features ) def test_mapper(r): r['text'] = list(map(lambda t: t + ' b', r['text'])) return r dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2) ``` fails with ``` Traceback (most recent call last): File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1354, in _write_generator_to_queue for i, result in enumerate(func(**kwargs)): File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3493, in _map_single writer.write_batch(batch) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_writer.py", line 549, in write_batch array = cast_array_to_feature(col_values, col_type) if col_type is not None else col_values File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 1831, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 1831, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 2160, in cast_array_to_feature raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") TypeError: Couldn't cast array of type fixed_size_list<item: double>[2] to Sequence(feature=Value(dtype='float64', id=None), length=2, id=None) ``` Ideally we can have empty embedding columns as well!
### Describe the bug I have a dataset with an embedding column, when I try to map that dataset I get the following exception: ``` Traceback (most recent call last): File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map for rank, done, content in iflatmap_unordered( File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get raise self._value TypeError: Couldn't cast array of type fixed_size_list<item: float>[2] to Sequence(feature=Value(dtype='float32', id=None), length=2, id=None) ``` ### Steps to reproduce the bug Here's a simple repro script: ``` from datasets import Features, Value, Sequence, ClassLabel, Dataset dataset_features = Features({ 'text': Value('string'), 'embedding': Sequence(Value('double'), length=2), 'categories': Sequence(ClassLabel(names=sorted([ 'one', 'two', 'three' ]))), }) dataset = Dataset.from_dict( { 'text': ['A'] * 10000, 'embedding': [[0.0, 0.1]] * 10000, 'categories': [[0]] * 10000, }, features=dataset_features ) def test_mapper(r): r['text'] = list(map(lambda t: t + ' b', r['text'])) return r dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2) ``` Removing the embedding column fixes the issue! ### Expected behavior The mapping completes successfully. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-14.0-arm64-arm-64bit - Python version: 3.10.12 - Huggingface_hub version: 0.17.1 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
234
Couldn't cast array of type fixed_size_list to Sequence(Value(float64)) ### Describe the bug I have a dataset with an embedding column, when I try to map that dataset I get the following exception: ``` Traceback (most recent call last): File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map for rank, done, content in iflatmap_unordered( File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get raise self._value TypeError: Couldn't cast array of type fixed_size_list<item: float>[2] to Sequence(feature=Value(dtype='float32', id=None), length=2, id=None) ``` ### Steps to reproduce the bug Here's a simple repro script: ``` from datasets import Features, Value, Sequence, ClassLabel, Dataset dataset_features = Features({ 'text': Value('string'), 'embedding': Sequence(Value('double'), length=2), 'categories': Sequence(ClassLabel(names=sorted([ 'one', 'two', 'three' ]))), }) dataset = Dataset.from_dict( { 'text': ['A'] * 10000, 'embedding': [[0.0, 0.1]] * 10000, 'categories': [[0]] * 10000, }, features=dataset_features ) def test_mapper(r): r['text'] = list(map(lambda t: t + ' b', r['text'])) return r dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2) ``` Removing the embedding column fixes the issue! ### Expected behavior The mapping completes successfully. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-14.0-arm64-arm-64bit - Python version: 3.10.12 - Huggingface_hub version: 0.17.1 - PyArrow version: 13.0.0 - Pandas version: 2.0.3 Thanks for the quick response @mariosasko! I just installed your branch via `poetry add 'git+https://github.com/huggingface/datasets#fix-array_values'` and I can confirm it works on the example provided. Follow up question for you, should `None`s be supported in these types of features as they are in others? For example, the following script: ``` from datasets import Features, Value, Sequence, ClassLabel, Dataset dataset_features = Features({ 'text': Value('string'), 'embedding': Sequence(Value('double'), length=2), 'categories': Sequence(ClassLabel(names=sorted([ 'one', 'two', 'three' ]))), }) dataset = Dataset.from_dict( { 'text': ['A'] * 10000, "embedding": [None] * 10000, # THIS LINE CHANGED 'categories': [[0]] * 10000, }, features=dataset_features ) def test_mapper(r): r['text'] = list(map(lambda t: t + ' b', r['text'])) return r dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2) ``` fails with ``` Traceback (most recent call last): File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1354, in _write_generator_to_queue for i, result in enumerate(func(**kwargs)): File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3493, in _map_single writer.write_batch(batch) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_writer.py", line 549, in write_batch array = cast_array_to_feature(col_values, col_type) if col_type is not None else col_values File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 1831, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 1831, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py", line 2160, in cast_array_to_feature raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") TypeError: Couldn't cast array of type fixed_size_list<item: double>[2] to Sequence(feature=Value(dtype='float64', id=None), length=2, id=None) ``` Ideally we can have empty embedding columns as well!
[ 0.013585752807557583, -0.05202486738562584, -0.06949372589588165, -0.06194750964641571, 0.28900039196014404, 0.14561179280281067, 0.07460504025220871, 0.1989031583070755, -0.04872482270002365, -0.012759526260197163, 0.05155529826879501, -0.02075866237282753, 0.040338948369026184, -0.14798246324062347, -0.0015915909316390753, -0.06804890930652618, -0.022133711725473404, -0.14679394662380219, -0.07504342496395111, 0.006526406388729811, -0.22574707865715027, 0.022449765354394913, 0.09382826834917068, 0.013893123716115952, 0.06940803676843643, -0.19170384109020233, -0.06347329914569855, -0.01618434116244316, -0.06446842104196548, -0.12131110578775406, 0.08910967409610748, 0.012872559949755669, 0.09278897196054459, -0.1232227236032486, 0.0000050636976993700955, 0.0742587074637413, 0.13222050666809082, -0.11418358981609344, 0.10557256639003754, -0.052325379103422165, 0.07986646890640259, -0.061908185482025146, -0.03463030233979225, 0.024146929383277893, -0.09213889390230179, -0.10153389722108841, -0.20197202265262604, -0.04027089476585388, -0.04706144705414772, 0.06621939688920975, -0.004364021588116884, -0.10272663086652756, 0.13937881588935852, -0.14724990725517273, -0.12479860335588455, -0.057685405015945435, 0.10409322381019592, 0.016843905672430992, -0.10154350847005844, 0.13579517602920532, 0.010061201639473438, -0.0584094412624836, -0.11121700704097748, 0.03960985690355301, -0.13205403089523315, -0.0385197177529335, -0.0521516278386116, -0.052759524434804916, -0.024156536906957626, 0.1352076381444931, -0.1509324610233307, 0.09647519886493683, -0.11151092499494553, -0.05352269858121872, 0.09410391002893448, -0.14010228216648102, 0.0322679802775383, 0.14278987050056458, 0.008948532864451408, 0.02155180275440216, 0.04476616904139519, 0.06900037080049515, 0.05083676055073738, 0.08788250386714935, -0.1654738485813141, -0.08542709052562714, -0.1542038917541504, 0.20757605135440826, -0.03972911089658737, -0.17367735505104065, -0.10653814673423767, -0.0234190933406353, -0.036900632083415985, -0.018705526366829872, 0.10539429634809494, -0.020695816725492477, -0.0012242244556546211, -0.17273768782615662, 0.04513971135020256, -0.12797993421554565, -0.019709497690200806, -0.10736385732889175, 0.209915429353714, 0.04585777595639229, -0.055571991950273514, 0.0813790038228035, -0.15927031636238098, 0.13676655292510986, -0.013334467075765133, 0.10434794425964355, 0.005962960422039032, 0.03626951202750206, -0.08391251415014267, 0.0780668705701828, 0.1658056676387787, -0.0019187921425327659, 0.07284671068191528, 0.04106488078832626, -0.0789908692240715, 0.19620725512504578, -0.0652683898806572, 0.15764479339122772, 0.004112526308745146, 0.08460689336061478, 0.15584811568260193, 0.10879635810852051, 0.020880665630102158, 0.0618625171482563, 0.02920839563012123, 0.15748655796051025, -0.003925085533410311, 0.13417746126651764, 0.04554401710629463, -0.10361284017562866, 0.15617366135120392, 0.12364725023508072, 0.09536699205636978, -0.25651460886001587, 0.06648959219455719, -0.06755460798740387, -0.00891659501940012, -0.08973617106676102, 0.13416972756385803, -0.015022230334579945, 0.06591586023569107, -0.03566352650523186, 0.15224309265613556, 0.04647184908390045, -0.033757396042346954, 0.00538484426215291, -0.24937862157821655, 0.02409343235194683, -0.10142402350902557, -0.130084827542305, -0.11541673541069031, 0.14203669130802155, 0.17270682752132416, -0.24722100794315338, 0.040702205151319504, -0.11710770428180695, 0.027866173535585403, -0.028231246396899223, -0.003294516820460558, -0.14385771751403809, 0.05303465574979782, -0.08228393644094467, -0.07033072412014008, 0.05015141889452934, -0.11080898344516754, 0.11981679499149323, 0.2133321762084961, -0.03986986726522446, 0.03732330724596977, -0.09031011164188385, -0.0684608593583107, 0.10252071917057037, -0.18118123710155487, 0.11176784336566925, -0.250299870967865, -0.12134797871112823, -0.013811996206641197, -0.08201614767313004, 0.05709204077720642, -0.06173640862107277, 0.14816324412822723, 0.013264309614896774, 0.0991177037358284, 0.04579859972000122, -0.1829136162996292, -0.07392111420631409, 0.014518012292683125, -0.03943343460559845, 0.01102636568248272, -0.3326292335987091, -0.0496755950152874, 0.002354091266170144, -0.07584147155284882, 0.06746423244476318, -0.17769403755664825, -0.05502161756157875, 0.05817254260182381, -0.10932358354330063, 0.045936763286590576, -0.0034895804710686207, -0.032185088843107224, -0.1320340931415558, -0.09489505738019943, -0.11424681544303894, -0.03376607969403267, -0.08681230992078781, -0.24789667129516602, 0.13707932829856873, -0.11603197455406189, 0.07838307321071625, -0.07525942474603653, -0.01904238387942314, -0.008820750750601292, 0.009845097549259663, -0.06607762724161148, 0.16373179852962494, 0.017554285004734993, -0.07421332597732544, -0.05816390737891197, -0.07850331813097, -0.00871785543859005, -0.02401539869606495, -0.04612629860639572, -0.10821419209241867, -0.010830947197973728, 0.18308387696743011, -0.025595134124159813, -0.08019783347845078, 0.10527312755584717, 0.09700211882591248, -0.15516072511672974, -0.22850072383880615, -0.13251538574695587, -0.2066715806722641, -0.0025149143766611814, -0.0890476256608963, -0.1355251967906952, 0.17924338579177856, -0.10151797533035278, 0.10244423151016235, 0.0037893475964665413, 0.16723699867725372, -0.09585026651620865, 0.2409006506204605, 0.029741762205958366, 0.06816835701465607, 0.2815958261489868, 0.008496192283928394, -0.1874472200870514, -0.11431574821472168, 0.01129769068211317, -0.03679797053337097, -0.09750717133283615, 0.022684454917907715, 0.010895558632910252, -0.06307704746723175, 0.3730987012386322, 0.024512043222784996, 0.03475877642631531, -0.047114331275224686, 0.19518998265266418, -0.08720859885215759, -0.018216654658317566, -0.10049264132976532, 0.12740860879421234, 0.02092379704117775, 0.043367113918066025, -0.09079952538013458, -0.05820189416408539, 0.0018392240162938833, -0.02536400966346264, -0.1996711790561676, 0.026333056390285492, -0.06667393445968628, 0.08203426748514175, 0.300263375043869, -0.16416625678539276, 0.07856594771146774, 0.040038395673036575, -0.12356060743331909, -0.014423443004488945, 0.18233275413513184, -0.14084850251674652, 0.13200686872005463, -0.08977976441383362, 0.21853184700012207, 0.0013251391937956214, -0.011411482468247414, 0.0052984291687607765, -0.11066599190235138, -0.048738520592451096, -0.0939275473356247, -0.009447244927287102, -0.10711449384689331, 0.3155675530433655, 0.05901113152503967, 0.009413013234734535, 0.06785786151885986, -0.024900972843170166, -0.05150403454899788, 0.006774130277335644, -0.0210877638310194, 0.17430691421031952, 0.3206404447555542, -0.15387548506259918, -0.042624980211257935, -0.19779805839061737, -0.02500566653907299, -0.04735405370593071, 0.07161039113998413, 0.202052041888237, 0.054767243564128876, 0.02963404171168804, -0.00257251039147377, 0.13297304511070251, -0.1734389364719391, 0.03107129968702793, 0.1430893838405609, -0.10513701289892197, -0.006390358787029982, -0.02427765727043152, 0.100069060921669, -0.15843722224235535, -0.15007008612155914, -0.08580846339464188, 0.006252392195165157, 0.09826884418725967, -0.08239208906888962, -0.03861449658870697, -0.10440212488174438, 0.15966512262821198, -0.248751699924469, -0.1657373458147049, 0.20864716172218323, 0.1434715837240219, -0.07477358728647232, -0.05053858086466789, -0.06470464169979095, -0.060350451618433, -0.004848413169384003, 0.14723162353038788, -0.10239139944314957, -0.05007167160511017, -0.09738686680793762, -0.08340068906545639, -0.10103066265583038, -0.00771483825519681, 0.054607879370450974, 0.0931360051035881, -0.11263209581375122, -0.22935909032821655, 0.24028810858726501, -0.07680881023406982, 0.11110832542181015, -0.13060776889324188, 0.03456344082951546, 0.2055056095123291, 0.20076973736286163, 0.07907336205244064, 0.11408371478319168, -0.06507772207260132, 0.15931305289268494, 0.09318996220827103, -0.13198283314704895, -0.20423738658428192, -0.04160631448030472, -0.02306925505399704, 0.06242264434695244, -0.030421502888202667, -0.03258620575070381, -0.02764701098203659, -0.06882240623235703, 0.06904783099889755, -0.015804676339030266, 0.28144142031669617, 0.07721396535634995, 0.015922270715236664, -0.10854727029800415, -0.1306837797164917, 0.12074221670627594, 0.0008781602373346686, -0.05213493853807449, -0.1398162990808487, -0.20571918785572052, -0.27124732732772827, -0.013476983644068241, 0.22956082224845886, 0.04209240898489952, -0.10695454478263855, -0.0734432190656662, -0.01670452393591404, 0.11234937608242035, 0.27759599685668945, 0.07131903618574142, -0.006758164148777723, 0.09272251278162003, 0.2037762850522995, -0.014572514221072197, -0.03865839168429375, 0.027020955458283424, 0.12182337045669556, 0.18409377336502075, 0.04608443006873131, -0.06924420595169067, 0.05287827551364899, 0.0755927637219429, 0.019797848537564278, 0.08007954061031342, 0.036519356071949005, 0.034310679882764816, 0.06431441754102707, -0.08323830366134644, 0.05802907049655914, 0.10124585777521133, 0.03265659883618355, -0.31885525584220886, -0.15096576511859894, -0.21424764394760132, 0.14913254976272583, 0.22564788162708282, -0.16241511702537537, -0.09685371071100235, -0.019308701157569885, -0.12646320462226868, 0.1197507381439209, -0.016353923827409744, 0.1228809580206871, 0.022056318819522858, 0.057185884565114975, -0.05195920541882515, 0.12644749879837036, -0.09742384403944016, 0.20922282338142395, 0.07375091314315796, 0.11930260062217712, 0.03394424170255661, -0.25265729427337646, -0.0523124597966671, 0.0016443409258499742, -0.15649360418319702, 0.024314148351550102, -0.16789433360099792, -0.03018336556851864, 0.012846805155277252, -0.03326164186000824, 0.032513152807950974, 0.020930688828229904, -0.06283775717020035, 0.002086242660880089, -0.13263021409511566, 0.09614324569702148, 0.03496864065527916, 0.05015790835022926, -0.1784306764602661, -0.06785709410905838, 0.08683551102876663, 0.29089266061782837, -0.036879394203424454, -0.10506709665060043, 0.07270243763923645, 0.28345245122909546, 0.25333717465400696, 0.24313248693943024, 0.06324503570795059, 0.07813695073127747, 0.1754007339477539, 0.0796438530087471, 0.006151179783046246, 0.042622894048690796, 0.12930716574192047, -0.0068291546776890755, -0.11931895464658737, 0.09031517803668976, 0.043094318360090256, -0.07755589485168457, -0.0226368959993124, -0.050691910088062286, -0.0967194214463234, -0.011893779039382935, -0.2426801323890686, 0.15684373676776886, 0.21135413646697998, 0.004650142975151539, 0.021259529516100883, -0.06647387146949768, -0.08788648992776871, -0.13914470374584198, -0.048602987080812454, -0.0740170106291771, -0.05618366599082947, 0.16296441853046417, -0.08354699611663818, 0.1691226065158844, 0.11577538400888443, -0.013032888993620872, -0.023474043235182762, -0.006003233138471842, -0.013605731539428234, -0.037559874355793, -0.030791763216257095, -0.1055222898721695, -0.01915828324854374, -0.002404426923021674, 0.051812827587127686, 0.13816282153129578, 0.0331878587603569, 0.012709514237940311, 0.20868192613124847, -0.0424860343337059, -0.05622416362166405, -0.020788168534636497, 0.04631819203495979, -0.14805756509304047, -0.03282516822218895, 0.03797397390007973, 0.12946298718452454, 0.1148097813129425, -0.013119950890541077, 0.0970068871974945, -0.08870074898004532, -0.04647926241159439, 0.11717614531517029, 0.017078842967748642, -0.01244821585714817, 0.22094516456127167, 0.2324276715517044, 0.03921188786625862, 0.1932229846715927, 0.16887561976909637, -0.05236072838306427, -0.05913478136062622, 0.06829480081796646, 0.02983175404369831, -0.09075985848903656, -0.01941438764333725, -0.14626234769821167, -0.04115721955895424, -0.22882623970508575, -0.04853039234876633, 0.05643691122531891, 0.23822414875030518, 0.07093682140111923, -0.09792106598615646, -0.14457695186138153, -0.023363718762993813, -0.06416554003953934, -0.0918494239449501, 0.007894870825111866, -0.046961575746536255, -0.25762221217155457, 0.03627734258770943, -2.4007193125872566e-32, -0.07094909250736237, -0.07955271005630493, -0.058007579296827316, -0.1053110659122467, -0.1662980616092682, 0.07497261464595795, 0.05808854475617409, 0.19284145534038544, 0.1107151210308075, -0.1327497363090515, -0.05324173346161842, 0.02450604923069477, -0.03386475145816803, -0.01721423678100109, -0.05850826948881149, -0.08994186669588089, -0.005950881168246269, 0.1095002144575119, -0.010479318909347057, -0.027447285130620003, -0.01654815673828125, 0.11729296296834946, -0.011254790239036083, 0.13472570478916168, -0.05767672881484032, 0.19597956538200378, 0.02613718807697296, -0.13954134285449982, 0.23910051584243774, -0.1287463903427124, -0.025451231747865677, 0.19336359202861786, 0.09067317098379135, -0.07711870223283768, 0.011450449004769325, -0.14230728149414062, -0.10930440574884415, -0.04062537103891373, -0.04073599725961685, 0.0809590294957161, 0.06273037195205688, 0.11096978932619095, 0.05389799177646637, -0.06895729154348373, 0.0397140309214592, -0.021634189411997795, 0.07818353176116943, 0.011255878955125809, -0.004522286355495453, -0.0010953436139971018, 0.015161620453000069, -0.14049749076366425, -0.03942957520484924, 0.22666434943675995, 0.0603625550866127, -0.010208864696323872, 0.10301405191421509, 0.2475380152463913, -0.20238745212554932, -0.04970480874180794, 0.11538606137037277, 0.14982475340366364, 0.1261717677116394, -0.098228320479393, -0.08937861025333405, 0.1965179592370987, 0.2298455685377121, -0.05814787745475769, -0.034359391778707504, 0.011984565295279026, -0.07480107992887497, 0.07969264686107635, -0.028820516541600227, -0.07760217040777206, -0.09523501992225647, 0.09409867972135544, -0.12477351725101471, 0.13721932470798492, -0.040804412215948105, -0.1748008280992508, 0.03964336961507797, 0.11058732122182846, 0.1696723848581314, -0.08268588781356812, -0.08219882845878601, 0.008169778622686863, -0.026339983567595482, -0.06979503482580185, -0.021484173834323883, -0.12692907452583313, 0.03256740793585777, 0.05825541168451309, -0.09832290560007095, -0.041647836565971375, -0.2548733055591583, 0.1370851695537567, -0.12833940982818604, 0.08415605127811432, -0.10017876327037811, 0.03646218404173851, -0.021807486191391945, -0.12256946414709091, 0.10091797262430191, -0.01973746344447136, 0.1820097714662552, 0.21759042143821716, 0.09016453474760056, 0.03525480255484581, -0.12449365854263306, -0.09845691174268723, -0.025624478235840797, -0.08617030084133148, 0.04469200596213341, 0.21433255076408386, 0.07432551681995392, -0.08215317875146866, 0.05836240574717522, -0.04005599021911621, 0.09717436134815216, 0.14345599710941315, 0.013817078433930874, -0.07194402813911438, -0.08531744033098221, -0.04386487230658531, 0.026262301951646805, -0.062160514295101166, -0.1968606859445572, 0.0979476198554039, 0.036621760576963425, -0.07704698294401169, 0.08254260569810867, -0.07363002747297287, 7.10938536485628e-7, -0.23125658929347992, 0.1230422854423523, -0.06543732434511185, -0.12409456074237823, -0.09702235460281372, 0.22192691266536713, -0.052092742174863815, 0.1823071837425232, -0.1000484898686409, 0.11253289878368378, 0.1647999882698059, -0.11875209212303162, -0.015019133687019348, -0.11911115795373917, 0.11324430257081985, -0.3345286548137665, -0.005868317559361458, 0.06262670457363129, -0.09213106334209442, -0.028460543602705002, 0.10352188348770142, 0.05887733772397041, 0.12423228472471237, -0.13131268322467804, 0.12865355610847473, -0.010091805830597878, -0.016166701912879944, -0.08487941324710846, 0.13565191626548767, -0.1879865676164627, -0.038570232689380646, -0.037129878997802734, -0.004561416804790497, 0.10984078049659729, -0.07369465380907059, -0.08875145018100739, -0.08380930870771408, -0.05415328964591026, 0.02658204175531864, 0.1514691561460495, -0.08915887027978897, 0.10439637303352356, 0.018480248749256134, 0.006057584658265114, 0.03878025710582733, -0.0573851577937603, -0.21638673543930054, 0.08175092935562134, -0.10579240322113037, 0.09800554066896439, -0.08085891604423523, 0.17564435303211212, 0.08769088238477707, 0.1961580216884613, 0.07419566065073013, 0.005560871679335833, 0.10022410750389099, -0.2958805561065674, 0.2467060685157776, -0.12420423328876495, -0.06397567689418793, 0.006265094969421625, -0.14322814345359802, -0.0028623121324926615, 0.016581689938902855, -0.20840109884738922, -0.12250542640686035, 1.6159409490214895e-34, -0.008224019780755043, 0.08334635198116302, 0.04748212546110153, -0.07177905738353729, -0.033707816153764725, -0.0024732565507292747, 0.18808713555335999, 0.0005893586785532534, 0.1229463517665863, -0.13205347955226898, -0.071082703769207 ]
https://github.com/huggingface/datasets/issues/6280
Couldn't cast array of type fixed_size_list to Sequence(Value(float64))
This part of PyArrow is buggy and inconsistent regarding features implemented across the types, so the only option is to operate on the Arrow buffer level to fix issues such as the above one.
### Describe the bug I have a dataset with an embedding column, when I try to map that dataset I get the following exception: ``` Traceback (most recent call last): File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map for rank, done, content in iflatmap_unordered( File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get raise self._value TypeError: Couldn't cast array of type fixed_size_list<item: float>[2] to Sequence(feature=Value(dtype='float32', id=None), length=2, id=None) ``` ### Steps to reproduce the bug Here's a simple repro script: ``` from datasets import Features, Value, Sequence, ClassLabel, Dataset dataset_features = Features({ 'text': Value('string'), 'embedding': Sequence(Value('double'), length=2), 'categories': Sequence(ClassLabel(names=sorted([ 'one', 'two', 'three' ]))), }) dataset = Dataset.from_dict( { 'text': ['A'] * 10000, 'embedding': [[0.0, 0.1]] * 10000, 'categories': [[0]] * 10000, }, features=dataset_features ) def test_mapper(r): r['text'] = list(map(lambda t: t + ' b', r['text'])) return r dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2) ``` Removing the embedding column fixes the issue! ### Expected behavior The mapping completes successfully. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-14.0-arm64-arm-64bit - Python version: 3.10.12 - Huggingface_hub version: 0.17.1 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
34
Couldn't cast array of type fixed_size_list to Sequence(Value(float64)) ### Describe the bug I have a dataset with an embedding column, when I try to map that dataset I get the following exception: ``` Traceback (most recent call last): File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map for rank, done, content in iflatmap_unordered( File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get raise self._value TypeError: Couldn't cast array of type fixed_size_list<item: float>[2] to Sequence(feature=Value(dtype='float32', id=None), length=2, id=None) ``` ### Steps to reproduce the bug Here's a simple repro script: ``` from datasets import Features, Value, Sequence, ClassLabel, Dataset dataset_features = Features({ 'text': Value('string'), 'embedding': Sequence(Value('double'), length=2), 'categories': Sequence(ClassLabel(names=sorted([ 'one', 'two', 'three' ]))), }) dataset = Dataset.from_dict( { 'text': ['A'] * 10000, 'embedding': [[0.0, 0.1]] * 10000, 'categories': [[0]] * 10000, }, features=dataset_features ) def test_mapper(r): r['text'] = list(map(lambda t: t + ' b', r['text'])) return r dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2) ``` Removing the embedding column fixes the issue! ### Expected behavior The mapping completes successfully. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-14.0-arm64-arm-64bit - Python version: 3.10.12 - Huggingface_hub version: 0.17.1 - PyArrow version: 13.0.0 - Pandas version: 2.0.3 This part of PyArrow is buggy and inconsistent regarding features implemented across the types, so the only option is to operate on the Arrow buffer level to fix issues such as the above one.
[ 0.013585752807557583, -0.05202486738562584, -0.06949372589588165, -0.06194750964641571, 0.28900039196014404, 0.14561179280281067, 0.07460504025220871, 0.1989031583070755, -0.04872482270002365, -0.012759526260197163, 0.05155529826879501, -0.02075866237282753, 0.040338948369026184, -0.14798246324062347, -0.0015915909316390753, -0.06804890930652618, -0.022133711725473404, -0.14679394662380219, -0.07504342496395111, 0.006526406388729811, -0.22574707865715027, 0.022449765354394913, 0.09382826834917068, 0.013893123716115952, 0.06940803676843643, -0.19170384109020233, -0.06347329914569855, -0.01618434116244316, -0.06446842104196548, -0.12131110578775406, 0.08910967409610748, 0.012872559949755669, 0.09278897196054459, -0.1232227236032486, 0.0000050636976993700955, 0.0742587074637413, 0.13222050666809082, -0.11418358981609344, 0.10557256639003754, -0.052325379103422165, 0.07986646890640259, -0.061908185482025146, -0.03463030233979225, 0.024146929383277893, -0.09213889390230179, -0.10153389722108841, -0.20197202265262604, -0.04027089476585388, -0.04706144705414772, 0.06621939688920975, -0.004364021588116884, -0.10272663086652756, 0.13937881588935852, -0.14724990725517273, -0.12479860335588455, -0.057685405015945435, 0.10409322381019592, 0.016843905672430992, -0.10154350847005844, 0.13579517602920532, 0.010061201639473438, -0.0584094412624836, -0.11121700704097748, 0.03960985690355301, -0.13205403089523315, -0.0385197177529335, -0.0521516278386116, -0.052759524434804916, -0.024156536906957626, 0.1352076381444931, -0.1509324610233307, 0.09647519886493683, -0.11151092499494553, -0.05352269858121872, 0.09410391002893448, -0.14010228216648102, 0.0322679802775383, 0.14278987050056458, 0.008948532864451408, 0.02155180275440216, 0.04476616904139519, 0.06900037080049515, 0.05083676055073738, 0.08788250386714935, -0.1654738485813141, -0.08542709052562714, -0.1542038917541504, 0.20757605135440826, -0.03972911089658737, -0.17367735505104065, -0.10653814673423767, -0.0234190933406353, -0.036900632083415985, -0.018705526366829872, 0.10539429634809494, -0.020695816725492477, -0.0012242244556546211, -0.17273768782615662, 0.04513971135020256, -0.12797993421554565, -0.019709497690200806, -0.10736385732889175, 0.209915429353714, 0.04585777595639229, -0.055571991950273514, 0.0813790038228035, -0.15927031636238098, 0.13676655292510986, -0.013334467075765133, 0.10434794425964355, 0.005962960422039032, 0.03626951202750206, -0.08391251415014267, 0.0780668705701828, 0.1658056676387787, -0.0019187921425327659, 0.07284671068191528, 0.04106488078832626, -0.0789908692240715, 0.19620725512504578, -0.0652683898806572, 0.15764479339122772, 0.004112526308745146, 0.08460689336061478, 0.15584811568260193, 0.10879635810852051, 0.020880665630102158, 0.0618625171482563, 0.02920839563012123, 0.15748655796051025, -0.003925085533410311, 0.13417746126651764, 0.04554401710629463, -0.10361284017562866, 0.15617366135120392, 0.12364725023508072, 0.09536699205636978, -0.25651460886001587, 0.06648959219455719, -0.06755460798740387, -0.00891659501940012, -0.08973617106676102, 0.13416972756385803, -0.015022230334579945, 0.06591586023569107, -0.03566352650523186, 0.15224309265613556, 0.04647184908390045, -0.033757396042346954, 0.00538484426215291, -0.24937862157821655, 0.02409343235194683, -0.10142402350902557, -0.130084827542305, -0.11541673541069031, 0.14203669130802155, 0.17270682752132416, -0.24722100794315338, 0.040702205151319504, -0.11710770428180695, 0.027866173535585403, -0.028231246396899223, -0.003294516820460558, -0.14385771751403809, 0.05303465574979782, -0.08228393644094467, -0.07033072412014008, 0.05015141889452934, -0.11080898344516754, 0.11981679499149323, 0.2133321762084961, -0.03986986726522446, 0.03732330724596977, -0.09031011164188385, -0.0684608593583107, 0.10252071917057037, -0.18118123710155487, 0.11176784336566925, -0.250299870967865, -0.12134797871112823, -0.013811996206641197, -0.08201614767313004, 0.05709204077720642, -0.06173640862107277, 0.14816324412822723, 0.013264309614896774, 0.0991177037358284, 0.04579859972000122, -0.1829136162996292, -0.07392111420631409, 0.014518012292683125, -0.03943343460559845, 0.01102636568248272, -0.3326292335987091, -0.0496755950152874, 0.002354091266170144, -0.07584147155284882, 0.06746423244476318, -0.17769403755664825, -0.05502161756157875, 0.05817254260182381, -0.10932358354330063, 0.045936763286590576, -0.0034895804710686207, -0.032185088843107224, -0.1320340931415558, -0.09489505738019943, -0.11424681544303894, -0.03376607969403267, -0.08681230992078781, -0.24789667129516602, 0.13707932829856873, -0.11603197455406189, 0.07838307321071625, -0.07525942474603653, -0.01904238387942314, -0.008820750750601292, 0.009845097549259663, -0.06607762724161148, 0.16373179852962494, 0.017554285004734993, -0.07421332597732544, -0.05816390737891197, -0.07850331813097, -0.00871785543859005, -0.02401539869606495, -0.04612629860639572, -0.10821419209241867, -0.010830947197973728, 0.18308387696743011, -0.025595134124159813, -0.08019783347845078, 0.10527312755584717, 0.09700211882591248, -0.15516072511672974, -0.22850072383880615, -0.13251538574695587, -0.2066715806722641, -0.0025149143766611814, -0.0890476256608963, -0.1355251967906952, 0.17924338579177856, -0.10151797533035278, 0.10244423151016235, 0.0037893475964665413, 0.16723699867725372, -0.09585026651620865, 0.2409006506204605, 0.029741762205958366, 0.06816835701465607, 0.2815958261489868, 0.008496192283928394, -0.1874472200870514, -0.11431574821472168, 0.01129769068211317, -0.03679797053337097, -0.09750717133283615, 0.022684454917907715, 0.010895558632910252, -0.06307704746723175, 0.3730987012386322, 0.024512043222784996, 0.03475877642631531, -0.047114331275224686, 0.19518998265266418, -0.08720859885215759, -0.018216654658317566, -0.10049264132976532, 0.12740860879421234, 0.02092379704117775, 0.043367113918066025, -0.09079952538013458, -0.05820189416408539, 0.0018392240162938833, -0.02536400966346264, -0.1996711790561676, 0.026333056390285492, -0.06667393445968628, 0.08203426748514175, 0.300263375043869, -0.16416625678539276, 0.07856594771146774, 0.040038395673036575, -0.12356060743331909, -0.014423443004488945, 0.18233275413513184, -0.14084850251674652, 0.13200686872005463, -0.08977976441383362, 0.21853184700012207, 0.0013251391937956214, -0.011411482468247414, 0.0052984291687607765, -0.11066599190235138, -0.048738520592451096, -0.0939275473356247, -0.009447244927287102, -0.10711449384689331, 0.3155675530433655, 0.05901113152503967, 0.009413013234734535, 0.06785786151885986, -0.024900972843170166, -0.05150403454899788, 0.006774130277335644, -0.0210877638310194, 0.17430691421031952, 0.3206404447555542, -0.15387548506259918, -0.042624980211257935, -0.19779805839061737, -0.02500566653907299, -0.04735405370593071, 0.07161039113998413, 0.202052041888237, 0.054767243564128876, 0.02963404171168804, -0.00257251039147377, 0.13297304511070251, -0.1734389364719391, 0.03107129968702793, 0.1430893838405609, -0.10513701289892197, -0.006390358787029982, -0.02427765727043152, 0.100069060921669, -0.15843722224235535, -0.15007008612155914, -0.08580846339464188, 0.006252392195165157, 0.09826884418725967, -0.08239208906888962, -0.03861449658870697, -0.10440212488174438, 0.15966512262821198, -0.248751699924469, -0.1657373458147049, 0.20864716172218323, 0.1434715837240219, -0.07477358728647232, -0.05053858086466789, -0.06470464169979095, -0.060350451618433, -0.004848413169384003, 0.14723162353038788, -0.10239139944314957, -0.05007167160511017, -0.09738686680793762, -0.08340068906545639, -0.10103066265583038, -0.00771483825519681, 0.054607879370450974, 0.0931360051035881, -0.11263209581375122, -0.22935909032821655, 0.24028810858726501, -0.07680881023406982, 0.11110832542181015, -0.13060776889324188, 0.03456344082951546, 0.2055056095123291, 0.20076973736286163, 0.07907336205244064, 0.11408371478319168, -0.06507772207260132, 0.15931305289268494, 0.09318996220827103, -0.13198283314704895, -0.20423738658428192, -0.04160631448030472, -0.02306925505399704, 0.06242264434695244, -0.030421502888202667, -0.03258620575070381, -0.02764701098203659, -0.06882240623235703, 0.06904783099889755, -0.015804676339030266, 0.28144142031669617, 0.07721396535634995, 0.015922270715236664, -0.10854727029800415, -0.1306837797164917, 0.12074221670627594, 0.0008781602373346686, -0.05213493853807449, -0.1398162990808487, -0.20571918785572052, -0.27124732732772827, -0.013476983644068241, 0.22956082224845886, 0.04209240898489952, -0.10695454478263855, -0.0734432190656662, -0.01670452393591404, 0.11234937608242035, 0.27759599685668945, 0.07131903618574142, -0.006758164148777723, 0.09272251278162003, 0.2037762850522995, -0.014572514221072197, -0.03865839168429375, 0.027020955458283424, 0.12182337045669556, 0.18409377336502075, 0.04608443006873131, -0.06924420595169067, 0.05287827551364899, 0.0755927637219429, 0.019797848537564278, 0.08007954061031342, 0.036519356071949005, 0.034310679882764816, 0.06431441754102707, -0.08323830366134644, 0.05802907049655914, 0.10124585777521133, 0.03265659883618355, -0.31885525584220886, -0.15096576511859894, -0.21424764394760132, 0.14913254976272583, 0.22564788162708282, -0.16241511702537537, -0.09685371071100235, -0.019308701157569885, -0.12646320462226868, 0.1197507381439209, -0.016353923827409744, 0.1228809580206871, 0.022056318819522858, 0.057185884565114975, -0.05195920541882515, 0.12644749879837036, -0.09742384403944016, 0.20922282338142395, 0.07375091314315796, 0.11930260062217712, 0.03394424170255661, -0.25265729427337646, -0.0523124597966671, 0.0016443409258499742, -0.15649360418319702, 0.024314148351550102, -0.16789433360099792, -0.03018336556851864, 0.012846805155277252, -0.03326164186000824, 0.032513152807950974, 0.020930688828229904, -0.06283775717020035, 0.002086242660880089, -0.13263021409511566, 0.09614324569702148, 0.03496864065527916, 0.05015790835022926, -0.1784306764602661, -0.06785709410905838, 0.08683551102876663, 0.29089266061782837, -0.036879394203424454, -0.10506709665060043, 0.07270243763923645, 0.28345245122909546, 0.25333717465400696, 0.24313248693943024, 0.06324503570795059, 0.07813695073127747, 0.1754007339477539, 0.0796438530087471, 0.006151179783046246, 0.042622894048690796, 0.12930716574192047, -0.0068291546776890755, -0.11931895464658737, 0.09031517803668976, 0.043094318360090256, -0.07755589485168457, -0.0226368959993124, -0.050691910088062286, -0.0967194214463234, -0.011893779039382935, -0.2426801323890686, 0.15684373676776886, 0.21135413646697998, 0.004650142975151539, 0.021259529516100883, -0.06647387146949768, -0.08788648992776871, -0.13914470374584198, -0.048602987080812454, -0.0740170106291771, -0.05618366599082947, 0.16296441853046417, -0.08354699611663818, 0.1691226065158844, 0.11577538400888443, -0.013032888993620872, -0.023474043235182762, -0.006003233138471842, -0.013605731539428234, -0.037559874355793, -0.030791763216257095, -0.1055222898721695, -0.01915828324854374, -0.002404426923021674, 0.051812827587127686, 0.13816282153129578, 0.0331878587603569, 0.012709514237940311, 0.20868192613124847, -0.0424860343337059, -0.05622416362166405, -0.020788168534636497, 0.04631819203495979, -0.14805756509304047, -0.03282516822218895, 0.03797397390007973, 0.12946298718452454, 0.1148097813129425, -0.013119950890541077, 0.0970068871974945, -0.08870074898004532, -0.04647926241159439, 0.11717614531517029, 0.017078842967748642, -0.01244821585714817, 0.22094516456127167, 0.2324276715517044, 0.03921188786625862, 0.1932229846715927, 0.16887561976909637, -0.05236072838306427, -0.05913478136062622, 0.06829480081796646, 0.02983175404369831, -0.09075985848903656, -0.01941438764333725, -0.14626234769821167, -0.04115721955895424, -0.22882623970508575, -0.04853039234876633, 0.05643691122531891, 0.23822414875030518, 0.07093682140111923, -0.09792106598615646, -0.14457695186138153, -0.023363718762993813, -0.06416554003953934, -0.0918494239449501, 0.007894870825111866, -0.046961575746536255, -0.25762221217155457, 0.03627734258770943, -2.4007193125872566e-32, -0.07094909250736237, -0.07955271005630493, -0.058007579296827316, -0.1053110659122467, -0.1662980616092682, 0.07497261464595795, 0.05808854475617409, 0.19284145534038544, 0.1107151210308075, -0.1327497363090515, -0.05324173346161842, 0.02450604923069477, -0.03386475145816803, -0.01721423678100109, -0.05850826948881149, -0.08994186669588089, -0.005950881168246269, 0.1095002144575119, -0.010479318909347057, -0.027447285130620003, -0.01654815673828125, 0.11729296296834946, -0.011254790239036083, 0.13472570478916168, -0.05767672881484032, 0.19597956538200378, 0.02613718807697296, -0.13954134285449982, 0.23910051584243774, -0.1287463903427124, -0.025451231747865677, 0.19336359202861786, 0.09067317098379135, -0.07711870223283768, 0.011450449004769325, -0.14230728149414062, -0.10930440574884415, -0.04062537103891373, -0.04073599725961685, 0.0809590294957161, 0.06273037195205688, 0.11096978932619095, 0.05389799177646637, -0.06895729154348373, 0.0397140309214592, -0.021634189411997795, 0.07818353176116943, 0.011255878955125809, -0.004522286355495453, -0.0010953436139971018, 0.015161620453000069, -0.14049749076366425, -0.03942957520484924, 0.22666434943675995, 0.0603625550866127, -0.010208864696323872, 0.10301405191421509, 0.2475380152463913, -0.20238745212554932, -0.04970480874180794, 0.11538606137037277, 0.14982475340366364, 0.1261717677116394, -0.098228320479393, -0.08937861025333405, 0.1965179592370987, 0.2298455685377121, -0.05814787745475769, -0.034359391778707504, 0.011984565295279026, -0.07480107992887497, 0.07969264686107635, -0.028820516541600227, -0.07760217040777206, -0.09523501992225647, 0.09409867972135544, -0.12477351725101471, 0.13721932470798492, -0.040804412215948105, -0.1748008280992508, 0.03964336961507797, 0.11058732122182846, 0.1696723848581314, -0.08268588781356812, -0.08219882845878601, 0.008169778622686863, -0.026339983567595482, -0.06979503482580185, -0.021484173834323883, -0.12692907452583313, 0.03256740793585777, 0.05825541168451309, -0.09832290560007095, -0.041647836565971375, -0.2548733055591583, 0.1370851695537567, -0.12833940982818604, 0.08415605127811432, -0.10017876327037811, 0.03646218404173851, -0.021807486191391945, -0.12256946414709091, 0.10091797262430191, -0.01973746344447136, 0.1820097714662552, 0.21759042143821716, 0.09016453474760056, 0.03525480255484581, -0.12449365854263306, -0.09845691174268723, -0.025624478235840797, -0.08617030084133148, 0.04469200596213341, 0.21433255076408386, 0.07432551681995392, -0.08215317875146866, 0.05836240574717522, -0.04005599021911621, 0.09717436134815216, 0.14345599710941315, 0.013817078433930874, -0.07194402813911438, -0.08531744033098221, -0.04386487230658531, 0.026262301951646805, -0.062160514295101166, -0.1968606859445572, 0.0979476198554039, 0.036621760576963425, -0.07704698294401169, 0.08254260569810867, -0.07363002747297287, 7.10938536485628e-7, -0.23125658929347992, 0.1230422854423523, -0.06543732434511185, -0.12409456074237823, -0.09702235460281372, 0.22192691266536713, -0.052092742174863815, 0.1823071837425232, -0.1000484898686409, 0.11253289878368378, 0.1647999882698059, -0.11875209212303162, -0.015019133687019348, -0.11911115795373917, 0.11324430257081985, -0.3345286548137665, -0.005868317559361458, 0.06262670457363129, -0.09213106334209442, -0.028460543602705002, 0.10352188348770142, 0.05887733772397041, 0.12423228472471237, -0.13131268322467804, 0.12865355610847473, -0.010091805830597878, -0.016166701912879944, -0.08487941324710846, 0.13565191626548767, -0.1879865676164627, -0.038570232689380646, -0.037129878997802734, -0.004561416804790497, 0.10984078049659729, -0.07369465380907059, -0.08875145018100739, -0.08380930870771408, -0.05415328964591026, 0.02658204175531864, 0.1514691561460495, -0.08915887027978897, 0.10439637303352356, 0.018480248749256134, 0.006057584658265114, 0.03878025710582733, -0.0573851577937603, -0.21638673543930054, 0.08175092935562134, -0.10579240322113037, 0.09800554066896439, -0.08085891604423523, 0.17564435303211212, 0.08769088238477707, 0.1961580216884613, 0.07419566065073013, 0.005560871679335833, 0.10022410750389099, -0.2958805561065674, 0.2467060685157776, -0.12420423328876495, -0.06397567689418793, 0.006265094969421625, -0.14322814345359802, -0.0028623121324926615, 0.016581689938902855, -0.20840109884738922, -0.12250542640686035, 1.6159409490214895e-34, -0.008224019780755043, 0.08334635198116302, 0.04748212546110153, -0.07177905738353729, -0.033707816153764725, -0.0024732565507292747, 0.18808713555335999, 0.0005893586785532534, 0.1229463517665863, -0.13205347955226898, -0.071082703769207 ]
https://github.com/huggingface/datasets/issues/6279
Batched IterableDataset
This is exactly what I was looking for. It would also be very useful for me :-)
### Feature request Hi, could you add an implementation of a batched `IterableDataset`. It already support an option to do batch iteration via `.iter(batch_size=...)` but this cannot be used in combination with a torch `DataLoader` since it just returns an iterator. ### Motivation The current implementation loads each element of a batch individually which can be very slow in cases of a big batch_size. I did some experiments [here](https://discuss.huggingface.co/t/slow-dataloader-with-big-batch-size/57224) and using a batched iteration would speed up data loading significantly. ### Your contribution N/A
17
Batched IterableDataset ### Feature request Hi, could you add an implementation of a batched `IterableDataset`. It already support an option to do batch iteration via `.iter(batch_size=...)` but this cannot be used in combination with a torch `DataLoader` since it just returns an iterator. ### Motivation The current implementation loads each element of a batch individually which can be very slow in cases of a big batch_size. I did some experiments [here](https://discuss.huggingface.co/t/slow-dataloader-with-big-batch-size/57224) and using a batched iteration would speed up data loading significantly. ### Your contribution N/A This is exactly what I was looking for. It would also be very useful for me :-)
[ -0.1476454734802246, 0.1132344976067543, -0.04827847704291344, -0.09739042073488235, -0.00937233678996563, 0.08001690357923508, 0.25656020641326904, 0.03638194873929024, 0.03297102451324463, 0.15329469740390778, -0.09521880745887756, -0.010468210093677044, -0.2030562460422516, -0.00994382705539465, 0.06039976701140404, -0.1819259226322174, -0.11659184098243713, -0.04933224990963936, -0.1311912089586258, -0.08047764748334885, 0.0029932144097983837, 0.1310422122478485, 0.056919220834970474, -0.13295218348503113, 0.15603014826774597, -0.022710151970386505, -0.14653287827968597, -0.060249630361795425, -0.051232628524303436, -0.16252823173999786, 0.059709582477808, 0.1524553745985031, 0.05317060649394989, 0.09462256729602814, 0.000005452321147458861, 0.11471102386713028, 0.00851023942232132, 0.03842981159687042, -0.1232207715511322, 0.16705884039402008, 0.272674024105072, 0.0034246945288032293, 0.008039864711463451, 0.04236466437578201, 0.007781829684972763, -0.04172399640083313, 0.06777244061231613, -0.09761952608823776, 0.07136533409357071, -0.14639726281166077, 0.03782068192958832, 0.16832642257213593, -0.1894499957561493, -0.16129110753536224, 0.10550492256879807, 0.17817145586013794, -0.02948714978992939, 0.1649235337972641, 0.07121347635984421, 0.07091329246759415, -0.0958680585026741, -0.01320498064160347, -0.007605308201164007, -0.11691770702600479, 0.002915207762271166, -0.14604292809963226, -0.13740754127502441, -0.05736057087779045, -0.0980367660522461, 0.04880199581384659, 0.0357334204018116, -0.26077911257743835, -0.17350582778453827, 0.05241892859339714, -0.14166507124900818, -0.21495410799980164, -0.16653969883918762, 0.04112062603235245, -0.10562531650066376, 0.052634622901678085, -0.057942889630794525, 0.007631157990545034, 0.024470554664731026, -0.07648417353630066, -0.045070111751556396, 0.06520511955022812, 0.04530617594718933, -0.05444493517279625, -0.008792123757302761, -0.03057068958878517, 0.21055592596530914, -0.13635125756263733, -0.05528054013848305, 0.06070428714156151, -0.11111678183078766, -0.06667573750019073, 0.019324742257595062, -0.2122986614704132, 0.17093400657176971, 0.015296326018869877, 0.16889046132564545, 0.06902401149272919, 0.056037772446870804, -0.05974775180220604, 0.1127931997179985, -0.16689012944698334, -0.08067047595977783, -0.18459264934062958, -0.03677025064826012, -0.029454154893755913, 0.0232095830142498, 0.019648391753435135, -0.02100936882197857, -0.07908065617084503, 0.07946295291185379, 0.08562566339969635, -0.00602145679295063, 0.27434125542640686, -0.09435224533081055, -0.22760160267353058, 0.12320411205291748, -0.11303550750017166, 0.11978932470083237, 0.05853196978569031, 0.09779778867959976, -0.022013073787093163, -0.11120259761810303, -0.012437601573765278, 0.017313780263066292, -0.0684623047709465, -0.09596046805381775, -0.058344680815935135, 0.09942816197872162, 0.004037604201585054, 0.28321778774261475, -0.021806534379720688, -0.017212551087141037, -0.22141550481319427, 0.033796221017837524, 0.058458369225263596, 0.12537631392478943, -0.014181852340698242, 0.051032308489084244, -0.15525178611278534, -0.016002507880330086, -0.05324425548315048, 0.02161775901913643, 0.18307285010814667, -0.12151283025741577, 0.11323506385087967, 0.0770038366317749, 0.20732027292251587, -0.08349166810512543, 0.09366708993911743, -0.12691374123096466, 0.07348913699388504, -0.017009615898132324, -0.07176554948091507, -0.2716573178768158, -0.09156437963247299, 0.13223274052143097, -0.0989256426692009, -0.03122345730662346, -0.02679280750453472, 0.0510716587305069, 0.23184341192245483, -0.08353286236524582, -0.03315132111310959, 0.043368492275476456, -0.1048780158162117, 0.06905141472816467, -0.0385708324611187, -0.10782109200954437, -0.009441089816391468, -0.18455934524536133, 0.15331842005252838, -0.062105096876621246, 0.11316964030265808, -0.11287159472703934, 0.12617816030979156, 0.14545322954654694, -0.005873711779713631, 0.17592452466487885, -0.04557435214519501, 0.16557610034942627, -0.19199034571647644, 0.10278692841529846, 0.10302112251520157, -0.23678630590438843, 0.09440977871417999, 0.11081498116254807, 0.05276257172226906, 0.17019665241241455, 0.10911974310874939, 0.0032576441299170256, 0.12307901680469513, -0.04276583716273308, -0.2496950477361679, 0.23714451491832733, -0.12236388027667999, -0.19257867336273193, -0.01077477727085352, 0.022629279643297195, -0.03983885794878006, 0.01808982528746128, -0.1630937159061432, -0.21362023055553436, 0.1803092658519745, 0.18941695988178253, -0.2665354311466217, 0.02225758694112301, 0.02001713216304779, 0.016745299100875854, -0.022166656330227852, -0.173811674118042, -0.0001248993503395468, -0.05424640327692032, 0.14823026955127716, 0.03702918812632561, -0.05526474863290787, -0.10861553251743317, 0.034238748252391815, 0.0049250125885009766, -0.06468821316957474, -0.0044160811230540276, 0.014152011834084988, 0.15779033303260803, -0.1225990280508995, 0.20067468285560608, -0.056925371289253235, -0.09614496678113937, -0.0757916197180748, 0.1525430530309677, 0.09153227508068085, -0.09752905368804932, 0.014987342059612274, 0.1541339010000229, -0.014343718998134136, 0.06474931538105011, 0.0906120240688324, -0.1727718561887741, -0.08892796188592911, -0.13559463620185852, -0.003325946629047394, -0.01654522307217121, 0.16193744540214539, -0.13251425325870514, 0.030589083209633827, 0.045323003083467484, -0.10342217236757278, 0.15319402515888214, 0.14742131531238556, -0.18882475793361664, 0.14137522876262665, -0.10816135257482529, -0.011891370639204979, 0.12673845887184143, -0.09805355966091156, -0.013496801257133484, 0.009395644068717957, 0.08503689616918564, 0.006419006735086441, -0.08083941787481308, 0.006010513752698898, 0.07973769307136536, 0.07134859263896942, 0.1768331378698349, -0.16507765650749207, 0.05016489699482918, 0.06962382048368454, 0.11288299411535263, 0.04423892870545387, 0.24554306268692017, -0.014706562273204327, -0.01182620320469141, -0.1433100402355194, -0.08360474556684494, 0.12755531072616577, 0.07500803470611572, -0.11601030826568604, -0.19275252521038055, -0.2020263522863388, 0.039706964045763016, -0.14185166358947754, 0.07742410898208618, -0.0942210704088211, 0.03745152801275253, -0.08757694065570831, -0.11756215244531631, -0.060720354318618774, 0.035518527030944824, 0.010200117714703083, -0.06245474889874458, 0.012016328051686287, 0.05167226120829582, -0.027436723932623863, -0.024070195853710175, 0.054807331413030624, 0.09864581376314163, -0.020312616601586342, -0.1311977207660675, 0.050387606024742126, 0.14496919512748718, 0.08534898608922958, 0.13216139376163483, -0.10404518991708755, 0.10669487714767456, 0.09281407296657562, -0.004789491184055805, -0.2300403118133545, 0.001080919522792101, 0.035008516162633896, 0.05110432952642441, -0.19919827580451965, 0.15798556804656982, -0.02283768728375435, -0.11383229494094849, -0.17539501190185547, 0.015243793837726116, -0.04401996359229088, 0.07356633991003036, -0.09776938706636429, -0.06027800962328911, -0.043845608830451965, -0.02185163088142872, 0.02003606967628002, -0.1383281648159027, -0.11454084515571594, 0.03297973796725273, -0.03227540850639343, -0.005977958906441927, 0.0591990128159523, 0.05553966760635376, 0.12485089898109436, 0.2066204994916916, -0.2107975035905838, -0.02491643652319908, -0.1022104024887085, 0.18998458981513977, -0.029267804697155952, 0.024229004979133606, -0.017021384090185165, -0.04395107552409172, -0.03681626543402672, 0.15259400010108948, -0.079279825091362, 0.10207445174455643, -0.03423253819346428, -0.03710528463125229, -0.09754765778779984, 0.041486285626888275, 0.04901847243309021, -0.021025363355875015, -0.06163192167878151, 0.04198227450251579, -0.05563205108046532, -0.16591928899288177, -0.009881050325930119, -0.24769356846809387, 0.16415613889694214, 0.003665153170004487, 0.1504743993282318, 0.21348732709884644, -0.1433037668466568, -0.11891862004995346, 0.09982487559318542, 0.2294231504201889, -0.03576577827334404, 0.10084079951047897, -0.2971752882003784, 0.04293779656291008, -0.08797764033079147, -0.03161495551466942, -0.005583600606769323, -0.09179733693599701, -0.12686528265476227, 0.031530264765024185, -0.02683088928461075, 0.17721876502037048, 0.00166680000256747, 0.17039485275745392, -0.2018781304359436, -0.012705570086836815, -0.05287667363882065, 0.06697546690702438, -0.05130978301167488, 0.014232729561626911, 0.0258872602134943, -0.2056877464056015, 0.2320759892463684, -0.044757261872291565, -0.031846221536397934, 0.0585954412817955, -0.2093454748392105, -0.12908458709716797, 0.06762028485536575, 0.12140849977731705, 0.09438066929578781, -0.0582592748105526, 0.04501425474882126, 0.08332378417253494, 0.2873448431491852, -0.018456637859344482, 0.1802741289138794, -0.04758847504854202, -0.031354233622550964, 0.04806460812687874, 0.0042089009657502174, 0.021141376346349716, 0.13285794854164124, 0.09685324877500534, 0.07647954672574997, -0.10012006014585495, -0.11794491857290268, 0.07876455783843994, -0.0951036885380745, -0.17204052209854126, -0.07031557708978653, 0.19979605078697205, -0.05243481695652008, -0.009548809379339218, -0.020597830414772034, 0.07519719749689102, 0.08481045812368393, 0.21447861194610596, 0.009874324314296246, -0.2308717668056488, 0.16581548750400543, 0.08742493391036987, 0.02827804535627365, -0.046746205538511276, 0.18758846819400787, 0.07637634128332138, 0.06070595979690552, 0.130270853638649, -0.012308014556765556, 0.05302552133798599, -0.044348832219839096, -0.07757661491632462, 0.03852935507893562, -0.07947151362895966, 0.0015205380041152239, 0.2792298197746277, -0.08698403090238571, -0.00020400056382641196, -0.16649514436721802, -0.15579579770565033, -0.09464206546545029, -0.10278836637735367, 0.06151646748185158, -0.21423551440238953, -0.2433701902627945, -0.19622941315174103, -0.07627056539058685, 0.1603308618068695, 0.04796050861477852, 0.17109039425849915, -0.1998770833015442, -0.12341852486133575, 0.01443744357675314, 0.010933568701148033, -0.03450895845890045, 0.01827245019376278, -0.016286436468362808, -0.09759622812271118, 0.2743179500102997, 0.04471360519528389, -0.11040201038122177, 0.014859626069664955, 0.010752690955996513, -0.07613959908485413, 0.06299085170030594, 0.015884721651673317, 0.03341181203722954, 0.23759816586971283, 0.005324951838701963, -0.08483696728944778, -0.031420186161994934, -0.05199543759226799, -0.024724269285798073, 0.2559240162372589, -0.1803802102804184, -0.07966507971286774, -0.04523216187953949, 0.016422905027866364, 0.1509554237127304, -0.10212975740432739, 0.08409541845321655, -0.20838510990142822, 0.21131904423236847, -0.013812045566737652, -0.21630032360553741, -0.11780012398958206, 0.03859347850084305, -0.011769931763410568, -0.025922907516360283, -0.07787303626537323, 0.0751863345503807, -0.14980463683605194, 0.17697158455848694, -0.045937567949295044, -0.005552538670599461, 0.15308444201946259, 0.0425264872610569, 0.027090858668088913, -0.23275291919708252, 0.04335533827543259, -0.015089922584593296, 0.08083167672157288, 0.10329370945692062, 0.022707922384142876, 0.021683698520064354, -0.037611812353134155, -0.02576798014342785, 0.06095894053578377, 0.18860679864883423, -0.1817271113395691, -0.012167571112513542, 0.0652308389544487, -0.025021083652973175, -0.039963047951459885, 0.02582009695470333, 0.08951796591281891, -0.09493768960237503, 0.013001768849790096, -0.021933769807219505, 0.14490483701229095, -0.040671456605196, -0.060193758457899094, 0.2019115835428238, -0.07669875025749207, 0.08571944385766983, 0.12710359692573547, 0.07707839459180832, -0.06948293000459671, 0.003424503840506077, 0.0912441685795784, -0.07453257590532303, 0.12424744665622711, -0.09520623832941055, 0.20353010296821594, -0.09709656983613968, 0.1387719213962555, -0.031161777675151825, -0.025070572271943092, -0.14877630770206451, -0.11090616136789322, 0.02350742183625698, -0.0620855949819088, 0.11031992733478546, 0.1316251903772354, 0.053100328892469406, -0.11194118112325668, -0.16638660430908203, 0.0023001073859632015, -2.6035604137132427e-32, 0.03471638262271881, 0.15323108434677124, 0.028846047818660736, 0.1792832911014557, 0.09290286898612976, -0.04206419363617897, -0.04027871415019035, -0.02655450627207756, 0.10882561653852463, 0.028453750535845757, -0.15020476281642914, 0.12824076414108276, 0.10578658431768417, -0.027054451406002045, -0.04524388536810875, 0.03128510341048241, 0.15847529470920563, 0.0709264725446701, -0.04047444462776184, 0.1817137598991394, 0.13313956558704376, -0.08740811049938202, 0.05179808288812637, 0.2164783477783203, -0.11323000490665436, 0.09733469784259796, -0.13205182552337646, 0.06620588153600693, -0.16390886902809143, -0.011962328106164932, -0.050778381526470184, 0.09481443464756012, -0.06500418484210968, -0.036876000463962555, -0.05918394774198532, 0.13910873234272003, -0.21004359424114227, -0.04836501553654671, -0.1083940640091896, 0.02190238982439041, 0.07697713375091553, 0.05868172273039818, 0.09280720353126526, -0.03767958655953407, 0.028069086372852325, 0.13655754923820496, -0.07129069417715073, 0.06729438155889511, -0.004155831877142191, -0.12835639715194702, 0.13633044064044952, 0.08896110951900482, -0.023593446239829063, 0.1277216374874115, 0.11397672444581985, 0.054773662239313126, 0.10750948637723923, 0.04363696649670601, -0.1644670069217682, -0.008577135391533375, 0.10286599397659302, 0.0189207810908556, -0.03808924928307533, 0.0004156766808591783, 0.24645639955997467, -0.06601428985595703, 0.18353575468063354, 0.09897950291633606, 0.18323984742164612, 0.1406688541173935, -0.12611030042171478, 0.016695933416485786, -0.06437211483716965, -0.042121317237615585, -0.24786517024040222, 0.11335959285497665, -0.05558071285486221, 0.041895896196365356, -0.0726224035024643, -0.01875312253832817, 0.022204048931598663, -0.031054699793457985, 0.09969482570886612, -0.0082233976572752, 0.007548058405518532, 0.04994610697031021, 0.0155066242441535, 0.14023250341415405, -0.007353540509939194, -0.025064140558242798, -0.08199092745780945, 0.1631254404783249, -0.059977058321237564, 0.022593814879655838, -0.11315025389194489, 0.20600676536560059, -0.08831130713224411, 0.03237179294228554, 0.023217247799038887, -0.12163055688142776, -0.02455049194395542, -0.04234502464532852, -0.04815690219402313, 0.07642056047916412, 0.047670766711235046, -0.025388354435563087, 0.09966003149747849, 0.10631333291530609, -0.3361113369464874, -0.006966473534703255, -0.10431943833827972, 0.05854976177215576, 0.026314139366149902, -0.008510979823768139, 0.1699938327074051, -0.006119470577687025, 0.12699536979198456, 0.047906141728162766, 0.11888333410024643, -0.06003987044095993, -0.13305561244487762, -0.12406723946332932, -0.036723874509334564, -0.011819644831120968, -0.04004712775349617, -0.004951339680701494, -0.04246961697936058, -0.20458777248859406, 0.1003226488828659, -0.24217341840267181, -0.058247849345207214, 0.06756331026554108, 7.202684741969279e-7, -0.11988082528114319, 0.03422139957547188, 0.1169641837477684, 0.08002238720655441, 0.016314120963215828, 0.04231131449341774, 0.10438331216573715, -0.05812797322869301, 0.08779529482126236, 0.18646442890167236, 0.12118522077798843, -0.06157444417476654, -0.024921108037233353, -0.034939952194690704, 0.02178444154560566, 0.03469913825392723, -0.1451507955789566, 0.21978183090686798, -0.03145155310630798, -0.1133875623345375, 0.09948471188545227, 0.1590396761894226, 0.0901372879743576, -0.12353792786598206, 0.013565422035753727, -0.009977849200367928, 0.040303751826286316, -0.03409241512417793, -0.033191148191690445, 0.0331977978348732, -0.01748768985271454, -0.04529174417257309, -0.09824797511100769, 0.016634879633784294, -0.05203252285718918, -0.048868607729673386, -0.09696794301271439, 0.06046213582158089, 0.04219774901866913, 0.07654870301485062, 0.12120582908391953, -0.09865222871303558, -0.08546295762062073, 0.022370481863617897, 0.17604492604732513, 0.1325557827949524, -0.08035995066165924, 0.1544588953256607, -0.19641050696372986, -0.03219643235206604, -0.06751126050949097, 0.11043072491884232, -0.007542972918599844, 0.2722356915473938, 0.009698184207081795, -0.009793099015951157, -0.17165738344192505, -0.05436893180012703, -0.042832691222429276, -0.20115984976291656, -0.09342999756336212, 0.11210592836141586, -0.10006190836429596, 0.005228265188634396, -0.07686179876327515, -0.016710316762328148, 0.04429987445473671, 2.398879994536006e-34, 0.05916658788919449, 0.04666569083929062, 0.08619215339422226, -0.05410261079668999, 0.02573755756020546, -0.07530021667480469, 0.021083205938339233, 0.06852314621210098, -0.1301189810037613, -0.18447840213775635, -0.20752578973770142 ]
https://github.com/huggingface/datasets/issues/6277
FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either.
`evaluate.load("paws-x", "es")` throws the error because there is no such metric in the `evaluate` lib. So, this is unrelated to our lib.
### Describe the bug I'm encountering a "FileNotFoundError" while attempting to use the "paws-x" dataset to retrain the DistilRoBERTa-base model. The error message is as follows: FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either. ### Steps to reproduce the bug https://colab.research.google.com/drive/11xUUFxloClpmqLvDy_Xxfmo3oUzjY5nx#scrollTo=kUn74FigzhHm ### Expected behavior The the trained model ### Environment info colab, "paws-x" dataset , DistilRoBERTa-base model
22
FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either. ### Describe the bug I'm encountering a "FileNotFoundError" while attempting to use the "paws-x" dataset to retrain the DistilRoBERTa-base model. The error message is as follows: FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either. ### Steps to reproduce the bug https://colab.research.google.com/drive/11xUUFxloClpmqLvDy_Xxfmo3oUzjY5nx#scrollTo=kUn74FigzhHm ### Expected behavior The the trained model ### Environment info colab, "paws-x" dataset , DistilRoBERTa-base model `evaluate.load("paws-x", "es")` throws the error because there is no such metric in the `evaluate` lib. So, this is unrelated to our lib.
[ 0.17501899600028992, 0.010684090666472912, -0.12697921693325043, -0.18182404339313507, 0.15205924212932587, 0.16004475951194763, 0.08504734933376312, 0.13752824068069458, 0.13427942991256714, 0.014860298484563828, -0.009862205013632774, 0.011818666942417622, -0.02322211116552353, 0.14375802874565125, 0.12569376826286316, 0.08859501034021378, 0.022197742015123367, 0.17294146120548248, -0.06228486821055412, 0.02074585109949112, 0.029146244749426842, 0.07651956379413605, -0.011682441458106041, -0.04108559712767601, -0.1305108666419983, -0.08943594247102737, -0.08367805182933807, 0.12959115207195282, -0.04707350209355354, -0.07857150584459305, 0.20733888447284698, 0.027346665039658546, 0.13816198706626892, 0.23305653035640717, 0.000006492572993010981, -0.008955312892794609, 0.09211072325706482, 0.11033056676387787, 0.07829546183347702, -0.223318949341774, 0.2521871328353882, 0.007783246226608753, 0.002466686302796006, 0.006334918551146984, 0.08126572519540787, -0.05550014227628708, 0.02758176252245903, 0.20333567261695862, -0.03961892053484917, 0.16127710044384003, 0.08394957333803177, 0.10674455016851425, 0.038384418934583664, -0.15996307134628296, 0.059332601726055145, -0.04514188691973686, -0.10494111478328705, 0.04265283793210983, -0.033900629729032516, -0.17336875200271606, 0.052288759499788284, 0.08094575256109238, 0.04525051265954971, -0.14739049971103668, -0.023644588887691498, 0.03805459290742874, 0.13086098432540894, -0.17210906744003296, -0.05617180094122887, 0.12622115015983582, -0.009905615821480751, 0.06857222318649292, -0.09105928987264633, -0.013721090741455555, -0.021108146756887436, -0.12149156630039215, 0.11871553212404251, 0.05715196952223778, 0.018090425059199333, 0.0039972178637981415, 0.038660649210214615, -0.16875573992729187, 0.026483705267310143, 0.13819065690040588, 0.015815377235412598, 0.11016492545604706, -0.14319846034049988, -0.12005266547203064, 0.047316085547208786, -0.041495196521282196, 0.26319509744644165, 0.10236825793981552, -0.023191647604107857, -0.17521041631698608, 0.11465375125408173, 0.015235219150781631, 0.1504562944173813, 0.06907980889081955, 0.014238692820072174, 0.045384764671325684, 0.06641833484172821, -0.1414669305086136, -0.09142791479825974, 0.1387728899717331, -0.009480577893555164, 0.21243062615394592, -0.08599089086055756, 0.007537612225860357, 0.054699961096048355, 0.13338060677051544, -0.05495474860072136, 0.06085731461644173, -0.1587151139974594, -0.11466371268033981, -0.01856395974755287, -0.05171803757548332, 0.06360176205635071, 0.039054516702890396, -0.05561380088329315, 0.0130986999720335, 0.03158622980117798, 0.1591212898492813, -0.08063486218452454, 0.1321904957294464, -0.01634076237678528, 0.08040548115968704, 0.06696611642837524, 0.10775011032819748, 0.006841836031526327, 0.05313364416360855, -0.09558374434709549, 0.22464732825756073, -0.16503827273845673, -0.13784419000148773, -0.017263337969779968, -0.04489533230662346, 0.03645288199186325, -0.23990347981452942, 0.1840336173772812, 0.011970131658017635, -0.15267744660377502, -0.1145244836807251, -0.2758561074733734, -0.04508434236049652, 0.13198958337306976, 0.030601777136325836, 0.09756025671958923, -0.12226405739784241, 0.003650429891422391, -0.03891144320368767, -0.10580340027809143, 0.07418694347143173, -0.20403510332107544, 0.02540973387658596, -0.09141027927398682, -0.00205794139765203, -0.1913570910692215, -0.07509292662143707, -0.16851173341274261, -0.08630572259426117, 0.045519471168518066, -0.14144150912761688, 0.01145605742931366, -0.0005716491723433137, 0.006432669702917337, 0.042154666036367416, 0.11159435659646988, 0.0024592396803200245, -0.0009261809755116701, -0.006062161643058062, 0.06016477569937706, 0.015408024191856384, -0.03744371235370636, 0.03128254413604736, -0.1842489391565323, 0.12595972418785095, 0.01794932223856449, -0.07072094827890396, -0.11022838950157166, 0.010869371704757214, 0.030172524973750114, 0.002601100131869316, 0.033438049256801605, -0.1337970644235611, 0.028081707656383514, 0.01826978474855423, -0.13496403396129608, -0.01668146252632141, 0.050957974046468735, -0.06673206388950348, -0.02085668034851551, -0.03697659447789192, 0.019283559173345566, -0.01069832593202591, 0.19525116682052612, -0.12078957259654999, 0.14437764883041382, -0.037030644714832306, 0.06686606258153915, -0.25234174728393555, 0.18290618062019348, -0.11025087535381317, -0.005295848473906517, 0.007874378003180027, 0.07368237525224686, 0.014274941757321358, 0.12874366343021393, 0.17696736752986908, -0.0567791685461998, -0.13659541308879852, -0.10727760940790176, -0.03473652899265289, -0.028183992952108383, 0.038423147052526474, -0.01807459630072117, -0.03264102339744568, 0.017304953187704086, -0.05561736971139908, 0.02292073331773281, 0.09717345237731934, 0.017237035557627678, 0.20649243891239166, 0.12317279726266861, 0.081444151699543, -0.08114700764417648, 0.069488026201725, -0.034847941249608994, -0.07535009831190109, 0.1498379111289978, 0.1474689543247223, -0.2162867933511734, 0.003444596193730831, 0.08059362322092056, -0.05562305822968483, 0.00747892027720809, -0.040777191519737244, 0.050559066236019135, -0.14208361506462097, 0.04067349433898926, 0.017590928822755814, -0.21517314016819, -0.0031612792517989874, -0.028892509639263153, 0.09873440116643906, 0.15796932578086853, -0.13055898249149323, -0.1925123929977417, -0.15001356601715088, -0.0066885934211313725, -0.026463499292731285, 0.17612861096858978, -0.10197155922651291, -0.11572455614805222, 0.1221870630979538, 0.1905021220445633, 0.017185483127832413, 0.12567533552646637, -0.026255717501044273, 0.020121265202760696, -0.17553359270095825, 0.21598011255264282, -0.01283276081085205, 0.002633169759064913, -0.040077876299619675, 0.041221678256988525, -0.034921277314424515, -0.13268440961837769, 0.004503236617892981, 0.1563832014799118, 0.09898104518651962, 0.0080560352653265, -0.004945208318531513, -0.10134429484605789, -0.025948775932192802, -0.056050557643175125, 0.0003291431348770857, -0.03070363961160183, 0.05525153502821922, 0.13170018792152405, -0.01643986627459526, -0.16333618760108948, 0.03784230351448059, 0.05262118577957153, -0.029198922216892242, -0.00981819536536932, -0.052716247737407684, -0.07396254688501358, -0.020462045446038246, 0.04535346478223801, 0.04231852665543556, -0.04865086451172829, 0.03777142986655235, 0.030365025624632835, 0.0561567097902298, -0.045834045857191086, -0.02496403083205223, 0.004826958291232586, -0.16687804460525513, 0.023132940754294395, -0.06367900222539902, -0.06524067372083664, 0.010251144878566265, -0.0788651555776596, -0.021327845752239227, -0.10047692805528641, 0.06531167775392532, 0.056259602308273315, -0.0067858765833079815, 0.052135713398456573, -0.1720116138458252, -0.03004392236471176, -0.20801356434822083, 0.027718279510736465, 0.11030293256044388, 0.018293965607881546, -0.2742811143398285, -0.022376958280801773, -0.10869351774454117, 0.07305554300546646, -0.11488400399684906, 0.011637589894235134, -0.1745961308479309, 0.014603360556066036, -0.0031492013949900866, -0.12421271204948425, 0.06635241955518723, -0.2707293927669525, -0.16335077583789825, 0.0196271650493145, -0.09564704447984695, -0.05719127133488655, -0.12788327038288116, -0.054039642214775085, -0.18165983259677887, -0.07901377230882645, -0.108664870262146, -0.044651616364717484, -0.1233547031879425, 0.2373315542936325, -0.06298276782035828, -0.08800879120826721, -0.003288127016276121, -0.13242600858211517, -0.039504725486040115, -0.056205395609140396, 0.020475542172789574, -0.21639186143875122, -0.018211225047707558, -0.14633913338184357, -0.2027209997177124, 0.16393235325813293, 0.13813184201717377, -0.016100361943244934, -0.11209763586521149, 0.07630272954702377, 0.008257437497377396, -0.09887814521789551, 0.05584731698036194, 0.17308293282985687, -0.07166466861963272, 0.12549804151058197, 0.16540665924549103, 0.00921852421015501, -0.09457121789455414, -0.07960116863250732, 0.1822805553674698, 0.07723693549633026, 0.10666680335998535, 0.0040413313545286655, -0.01778041012585163, 0.01227184385061264, 0.014346337877213955, 0.10494057089090347, 0.1084747165441513, 0.03770594298839569, 0.21480326354503632, -0.18786107003688812, -0.0857047513127327, 0.0875459760427475, 0.029051583260297775, -0.0075015355832874775, -0.06605109572410583, -0.028094885870814323, 0.11678572744131088, 0.0460207462310791, 0.04938294366002083, 0.051697250455617905, 0.20866110920906067, 0.15479837357997894, 0.09619707614183426, 0.0019812912214547396, 0.003798697842285037, -0.09046287834644318, -0.09495800733566284, -0.013376319780945778, -0.11266212910413742, -0.017245544120669365, 0.08886530995368958, -0.013312849216163158, 0.04856432229280472, -0.0013686282327398658, 0.22662511467933655, 0.14605356752872467, -0.08064643293619156, -0.06834590435028076, -0.08909613639116287, -0.04797358438372612, -0.1052546352148056, 0.13229842483997345, -0.1705387979745865, -0.09393581002950668, 0.018772786483168602, 0.11722734570503235, -0.036875076591968536, 0.05626853555440903, -0.09789474308490753, 0.060497019439935684, -0.10791901499032974, -0.1795111894607544, -0.16249269247055054, -0.02337110973894596, -0.10230232775211334, 0.002524877665564418, 0.13434840738773346, 0.011079281568527222, -0.09368044137954712, -0.009940319694578648, -0.13625767827033997, 0.1722177267074585, -0.025991234928369522, 0.03115718811750412, -0.08634187281131744, 0.1577405482530594, 0.05068671330809593, 0.061930954456329346, -0.041186679154634476, 0.14928990602493286, -0.2267669141292572, -0.10947751998901367, -0.00883894506841898, -0.09650534391403198, 0.07206188887357712, 0.005221776198595762, -0.12887641787528992, -0.18652808666229248, -0.05849988013505936, -0.0426502451300621, -0.06196421757340431, 0.20810464024543762, 0.09954635798931122, -0.02252202481031418, -0.08268260210752487, 0.01993499882519245, -0.24023130536079407, 0.06696449965238571, 0.08969061821699142, 0.22706498205661774, 0.031533826142549515, -0.04889782890677452, 0.04679054021835327, -0.07146789878606796, -0.06869183480739594, -0.1344829797744751, -0.11344055086374283, 0.2129778116941452, -0.05868251621723175, 0.18957637250423431, -0.0868135467171669, 0.10396196693181992, 0.08424362540245056, -0.1285097301006317, 0.024309879168868065, -0.04941144213080406, 0.21758002042770386, 0.13688500225543976, -0.0009468336938880384, 0.041750580072402954, -0.02336977981030941, -0.25316715240478516, -0.11465658247470856, 0.12322144210338593, 0.03823958709836006, 0.05069660767912865, -0.05345667526125908, -0.08569610863924026, 0.16848717629909515, 0.051100365817546844, -0.03970169275999069, -0.12207222729921341, -0.1323951780796051, 0.025683367624878883, 0.08010655641555786, 0.06511696428060532, -0.01705845817923546, 0.12897786498069763, 0.11989687383174896, -0.1033744290471077, 0.07149549573659897, 0.033397141844034195, 0.07389207929372787, 0.11086906492710114, 0.051654696464538574, 0.15576213598251343, -0.031942758709192276, -0.10258112847805023, -0.10530461370944977, 0.17981253564357758, 0.036235399544239044, -0.0625036209821701, -0.17586852610111237, 0.0380011647939682, 0.025431042537093163, 0.04035161808133125, -0.12766428291797638, -0.0021111564710736275, 0.06721576303243637, -0.04555688798427582, 0.012820622883737087, -0.0867803618311882, 0.09754110127687454, -0.05600148066878319, -0.037131547927856445, 0.031017731875181198, 0.012411678209900856, 0.0225596334785223, -0.12175621092319489, -0.14925628900527954, 0.012167852371931076, 0.15980781614780426, 0.02261354587972164, -0.03666474297642708, 0.24897605180740356, 0.0048164245672523975, -0.13852444291114807, -0.01779613085091114, -0.08897772431373596, -0.02527623064815998, -0.07427314668893814, 0.03755063936114311, 0.03839914873242378, -0.0864400789141655, -0.19276943802833557, -0.02068420499563217, 0.06780214607715607, -0.047267187386751175, 0.15098153054714203, -0.003422695444896817, -0.03846035152673721, -0.007891708053648472, -0.12450899928808212, -0.05690932273864746, 0.06748582422733307, -0.006102546118199825, -0.004861581604927778, -0.08231841772794724, -2.4638668691134298e-32, 0.06256762892007828, -0.06415043771266937, -0.042241476476192474, -0.04838796705007553, -0.3124939501285553, 0.14662717282772064, -0.08818919211626053, 0.09194204211235046, 0.030575204640626907, -0.1509033441543579, -0.021365169435739517, -0.00622825650498271, 0.014489078894257545, 0.03151603415608406, 0.1275991052389145, 0.2611517608165741, -0.09884368628263474, -0.027810100466012955, -0.056985173374414444, -0.11712746322154999, 0.15800084173679352, 0.0657910704612732, -0.03741103783249855, -0.04315749183297157, -0.073822520673275, 0.07532130181789398, -0.12265985459089279, 0.01607314683496952, -0.010315204039216042, -0.04645123332738876, -0.07374131679534912, -0.02436262182891369, 0.011468705721199512, 0.01070493832230568, -0.06283289939165115, 0.1227046400308609, -0.11542012542486191, -0.05939100310206413, -0.0061928522773087025, -0.07004483044147491, 0.10728523880243301, 0.10325633734464645, -0.1466551423072815, -0.1145380437374115, 0.15351158380508423, 0.12843655049800873, 0.005531831178814173, -0.1236054003238678, 0.21987201273441315, -0.024224260821938515, 0.018755991011857986, 0.11587552726268768, -0.0017845069523900747, 0.008623980917036533, 0.0714593157172203, -0.005578475538641214, 0.05708582326769829, 0.1370820701122284, -0.010255708359181881, 0.014253786765038967, 0.1784476935863495, -0.07164103537797928, 0.07458601146936417, -0.035264331847429276, 0.15699119865894318, 0.09174013882875443, 0.290461927652359, -0.0009253295720554888, 0.08826165646314621, -0.09969334304332733, 0.15908032655715942, 0.0414896160364151, -0.06116688624024391, 0.02913658320903778, -0.19774162769317627, 0.06480712443590164, -0.2227500081062317, 0.008475038222968578, 0.1262020766735077, 0.013653861358761787, 0.0648820772767067, -0.11973031610250473, -0.06538046151399612, 0.03889147937297821, -0.06766816973686218, 0.1591843068599701, -0.004006435628980398, -0.045630116015672684, -0.14380457997322083, 0.15978090465068817, -0.06971415132284164, 0.007646237965673208, -0.05413346365094185, -0.011067739687860012, 0.05567336082458496, -0.1384555995464325, -0.0715397372841835, 0.08556394279003143, 0.04286622256040573, -0.08139445632696152, -0.14558105170726776, -0.05252060294151306, 0.011907187290489674, 0.11733254790306091, 0.1335063874721527, -0.1017182320356369, 0.005599432159215212, -0.021003294736146927, -0.08047929406166077, 0.08961004763841629, 0.023505710065364838, 0.0021744987461715937, 0.19623394310474396, 0.29393470287323, 0.011726041324436665, 0.04886520653963089, -0.16913966834545135, -0.047138527035713196, 0.02945808693766594, 0.1687331199645996, -0.09798523783683777, 0.1227373331785202, -0.06947405636310577, 0.09671074897050858, 0.010791764594614506, 0.041884344071149826, -0.17724794149398804, 0.00637423200532794, -0.010544327087700367, 0.13331326842308044, -0.021907059475779533, -0.034357715398073196, 7.699245543335564e-7, -0.12457714974880219, 0.026909219101071358, 0.11073226481676102, -0.22643402218818665, 0.04646911844611168, 0.07077446579933167, -0.148222878575325, 0.08878301084041595, -0.06820570677518845, 0.03942122310400009, 0.05775429680943489, -0.044650595635175705, -0.09619741141796112, -0.1420917958021164, 0.15221057832241058, 0.004394798073917627, -0.0739653930068016, 0.03775066137313843, 0.04181527718901634, 0.06661462038755417, -0.10932772606611252, 0.0826905146241188, 0.15399934351444244, -0.13590136170387268, -0.05020003020763397, -0.015191665850579739, -0.0065682921558618546, 0.08507116883993149, 0.10170972347259521, -0.12419769167900085, -0.08640418201684952, 0.07536961883306503, -0.08829756081104279, 0.056413959711790085, -0.028396472334861755, -0.029779158532619476, -0.14340923726558685, -0.05616478621959686, 0.10466215759515762, 0.06967569142580032, 0.025319449603557587, 0.031422264873981476, -0.038784969598054886, -0.13580243289470673, 0.11996764689683914, -0.04648786410689354, 0.046845268458127975, -0.10880735516548157, -0.045360371470451355, 0.01234314776957035, 0.13694047927856445, 0.08552949875593185, 0.1283593475818634, 0.13928429782390594, -0.09719641506671906, -0.06731058657169342, 0.13027052581310272, 0.0074583678506314754, 0.08976723998785019, 0.0037223491817712784, -0.09173761308193207, -0.14548370242118835, -0.12129401415586472, -0.08207904547452927, 0.05727175623178482, -0.08438726514577866, 0.007136183325201273, 1.9148003719092563e-35, 0.022589974105358124, 0.00817801896482706, -0.002643448766320944, -0.2292764037847519, 0.026900572702288628, 0.09060461819171906, -0.09773820638656616, -0.14877434074878693, 0.09409642964601517, -0.06826921552419662, -0.06889620423316956 ]
https://github.com/huggingface/datasets/issues/6276
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error
Since you are using Windows, maybe moving the `map` call inside `if __name__ == "__main__"` can fix the issue: ```python if __name__ == "__main__": common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) ``` Otherwise, the only solution is to set `num_proc=1`.
### Describe the bug I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post https://huggingface.co/blog/fine-tune-whisper I tried google collab and it works but because I'm on the free version the training doesn't complete the error comes in jupyter notebook when i run this line `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` here is the error message ``` Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s] The above exception was the direct cause of the following exception: NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1 File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value NameError: name 'feature_extractor' is not defined ``` ### Steps to reproduce the bug 1. follow the steps in this blog post https://huggingface.co/blog/fine-tune-whisper 2. run this line of code `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` 3. I'm using jupyter notebook from anaconda ### Expected behavior No error message ### Environment info datasets version: 2.8.0 Python version: 3.11 Windows 10
38
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error ### Describe the bug I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post https://huggingface.co/blog/fine-tune-whisper I tried google collab and it works but because I'm on the free version the training doesn't complete the error comes in jupyter notebook when i run this line `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` here is the error message ``` Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s] The above exception was the direct cause of the following exception: NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1 File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value NameError: name 'feature_extractor' is not defined ``` ### Steps to reproduce the bug 1. follow the steps in this blog post https://huggingface.co/blog/fine-tune-whisper 2. run this line of code `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` 3. I'm using jupyter notebook from anaconda ### Expected behavior No error message ### Environment info datasets version: 2.8.0 Python version: 3.11 Windows 10 Since you are using Windows, maybe moving the `map` call inside `if __name__ == "__main__"` can fix the issue: ```python if __name__ == "__main__": common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) ``` Otherwise, the only solution is to set `num_proc=1`.
[ 0.09523754566907883, 0.01659438945353031, 0.017888270318508148, 0.014276492409408092, 0.2735872268676758, -0.01401198748499155, 0.11820992082357407, 0.04570578783750534, 0.05514794960618019, 0.057444166392087936, -0.1803496778011322, -0.012840925715863705, 0.05464494600892067, 0.17127904295921326, -0.02503468655049801, -0.15509238839149475, 0.02068079635500908, -0.12725019454956055, 0.0448068231344223, -0.009743981063365936, -0.10085160285234451, 0.06560972332954407, -0.056987836956977844, 0.06333602219820023, -0.03345679119229317, -0.32662680745124817, -0.11255965381860733, 0.05255737900733948, -0.0768861472606659, -0.007313491310924292, 0.07201910763978958, 0.01996087096631527, -0.082244873046875, 0.22588925063610077, 0.000005832827810081653, -0.010653550736606121, 0.16098804771900177, 0.0030936929397284985, 0.039498958736658096, -0.019901497289538383, 0.13652382791042328, 0.06946121156215668, -0.13987915217876434, 0.009591499343514442, -0.07452116906642914, 0.024054085835814476, -0.17111214995384216, 0.07872343808412552, 0.23443280160427094, 0.18826737999916077, 0.038286834955215454, -0.028592417016625404, 0.12026559561491013, -0.08646004647016525, 0.005961341317743063, -0.24798230826854706, -0.05611974373459816, -0.0893331840634346, -0.2152881771326065, -0.133069708943367, 0.01362075749784708, 0.03180385008454323, -0.03299387916922569, -0.01860904134809971, 0.045951951295137405, 0.14257293939590454, -0.14024128019809723, -0.23802655935287476, -0.021336078643798828, 0.18363946676254272, 0.04351428896188736, 0.1544659286737442, -0.17320579290390015, 0.02234925888478756, -0.03420386090874672, -0.20674289762973785, -0.01731932908296585, -0.07723192870616913, -0.05148172378540039, -0.06570956856012344, -0.0994459018111229, -0.057518940418958664, 0.014714527875185013, -0.0031631914898753166, 0.0760519951581955, -0.047352761030197144, -0.07610530406236649, 0.03280835598707199, 0.08964795619249344, -0.25488629937171936, 0.08808489888906479, 0.029951075091958046, -0.01472321804612875, -0.011107070371508598, -0.13965490460395813, -0.055207476019859314, -0.07044805586338043, -0.12234005331993103, -0.017032237723469734, -0.07007820904254913, 0.020847657695412636, -0.13937360048294067, 0.08663615584373474, 0.1469144970178604, -0.016484536230564117, 0.07283664494752884, 0.10052763670682907, -0.0250475462526083, 0.13590362668037415, 0.10847017168998718, 0.041228827089071274, 0.09238182753324509, -0.19902396202087402, -0.00870687048882246, -0.03964397311210632, -0.006856310181319714, 0.04156529903411865, 0.01721210777759552, -0.014142083935439587, 0.2381592094898224, 0.14213918149471283, 0.1384163796901703, -0.06747829914093018, 0.09678678959608078, 0.0009477669955231249, -0.10460274666547775, 0.07096892595291138, 0.11471306532621384, -0.1464231163263321, -0.03345854580402374, -0.04136902838945389, 0.1732441633939743, -0.02887607179582119, -0.01982605643570423, 0.11730001866817474, 0.12423104792833328, 0.060606468468904495, -0.10082811117172241, 0.026380399242043495, -0.00904732383787632, 0.02420135959982872, -0.18174424767494202, -0.25925856828689575, 0.009837287478148937, -0.03868452459573746, -0.09634130448102951, 0.18148058652877808, 0.039903149008750916, 0.0616689957678318, -0.13623107969760895, -0.14382143318653107, 0.12252177298069, -0.1088540181517601, 0.09792502224445343, 0.032412029802799225, 0.12617972493171692, -0.004331926815211773, -0.06161046773195267, -0.07667253166437149, -0.03622325509786606, 0.061300959438085556, 0.05394629389047623, -0.013082285411655903, -0.14364105463027954, 0.1074330061674118, 0.016602730378508568, 0.08907525986433029, -0.0187670961022377, -0.0408063642680645, -0.04988928511738777, 0.1008554995059967, 0.13845084607601166, 0.05885423719882965, 0.002379057230427861, -0.018384316936135292, 0.16905055940151215, -0.030400754883885384, -0.01834714412689209, -0.17085613310337067, -0.08952663838863373, -0.0444122850894928, -0.06419625878334045, 0.06823825091123581, -0.07176376134157181, 0.004841903690248728, -0.012241920456290245, 0.18998587131500244, 0.09216878563165665, -0.09743795543909073, -0.07767246663570404, 0.11782176792621613, -0.003992987331002951, -0.1359536498785019, -0.09121295809745789, -0.02665136568248272, -0.06603722274303436, -0.03693116828799248, -0.13704298436641693, 0.027360348030924797, -0.1259104311466217, -0.010964046232402325, -0.03440394252538681, 0.05282590538263321, 0.05727998539805412, -0.07408885657787323, -0.0139514384791255, -0.09235510230064392, -0.04086652770638466, -0.18836042284965515, -0.0963752493262291, -0.06795211136341095, 0.009846781380474567, 0.06913118064403534, -0.12765441834926605, 0.02901981770992279, -0.09593677520751953, 0.09221872687339783, -0.05170043557882309, -0.02125108800828457, -0.017530657351017, -0.02053878642618656, 0.09035893529653549, -0.024117378517985344, -0.02562781237065792, -0.047256700694561005, -0.07519689202308655, -0.11257092654705048, 0.024339774623513222, 0.14784912765026093, 0.12065806984901428, -0.038686785846948624, -0.13509127497673035, 0.06853451579809189, 0.11014360934495926, 0.04504071921110153, -0.16595131158828735, -0.05759236216545105, -0.20745864510536194, -0.08324994891881943, 0.1047084778547287, -0.10840488970279694, 0.07833649218082428, -0.10744544118642807, -0.030811669304966927, 0.07287493348121643, 0.06814883649349213, -0.03322150185704231, 0.04927560314536095, 0.033822569996118546, -0.022076867520809174, 0.18559302389621735, 0.08996333926916122, -0.13338600099086761, 0.04502773657441139, 0.059634532779455185, -0.05740489810705185, 0.011934679932892323, 0.05874926224350929, -0.17693021893501282, -0.27134618163108826, 0.23855195939540863, -0.020226139575242996, 0.12191344052553177, -0.09004967659711838, 0.1525929719209671, -0.0683746188879013, -0.06322792172431946, -0.14627237617969513, 0.029485994949936867, 0.059695325791835785, -0.06057405844330788, 0.0026532653719186783, 0.04718739539384842, -0.14039652049541473, 0.0193362794816494, 0.013032782822847366, 0.2056182473897934, 0.0070931510999798775, -0.029280465096235275, 0.02223462238907814, -0.13058139383792877, 0.0036424777936190367, 0.0743122324347496, 0.04171518236398697, 0.13553179800510406, 0.04395941272377968, 0.02649274282157421, -0.09532763808965683, -0.04947853833436966, 0.10975678265094757, -0.037960756570100784, 0.08599940687417984, 0.03046339377760887, -0.1669771373271942, -0.13637347519397736, 0.11348855495452881, 0.06261543184518814, 0.15005861222743988, 0.01563914492726326, 0.06629245728254318, -0.06685583293437958, -0.00492990342900157, -0.0008840984664857388, 0.04929810017347336, 0.004267336335033178, -0.14088159799575806, 0.15027852356433868, 0.28088805079460144, -0.05619152635335922, -0.01768597774207592, 0.051416922360658646, -0.08385541290044785, -0.07020871341228485, 0.23716458678245544, 0.08402299880981445, 0.06661848723888397, -0.04466700181365013, -0.011246451176702976, 0.08947623521089554, -0.016609253361821175, 0.06775147467851639, -0.024975625798106194, 0.0393415167927742, 0.08635477721691132, 0.04988770931959152, 0.026474764570593834, -0.22573819756507874, -0.12140239030122757, 0.006713094189763069, -0.29906946420669556, 0.00447978125885129, 0.19961851835250854, -0.2082921713590622, 0.03735673055052757, -0.0008390619186684489, 0.039064906537532806, -0.15486787259578705, -0.1495593786239624, 0.24645546078681946, 0.004297909792512655, -0.07391172647476196, -0.006754210218787193, -0.10641059279441833, 0.0622699037194252, -0.04604775831103325, 0.017289262264966965, 0.05986673757433891, -0.02488052099943161, 0.10809582471847534, 0.08965069055557251, 0.022145936265587807, -0.023810630664229393, -0.04221722483634949, -0.06643501669168472, -0.14262214303016663, -0.08703772723674774, -0.15099263191223145, 0.09888258576393127, -0.005995818413794041, 0.01904749684035778, 0.24197599291801453, 0.004795638378709555, 0.03986337408423424, 0.19415530562400818, -0.11451352387666702, 0.09964292496442795, 0.0646093413233757, -0.09540921449661255, -0.10852900892496109, -0.11080244928598404, 0.1351034939289093, 0.06256186962127686, -0.02355434186756611, 0.033113833516836166, 0.04605427011847496, -0.01477218046784401, -0.1429550051689148, -0.14548370242118835, 0.08384779840707779, 0.04426439851522446, 0.06776644289493561, -0.09522580355405807, -0.12927377223968506, 0.055493637919425964, 0.22290277481079102, 0.08638304471969604, 0.011624736711382866, 0.0494549497961998, -0.24578319489955902, 0.178957998752594, 0.0749230608344078, -0.09424666315317154, -0.07533641904592514, -0.2181379646062851, 0.05215015634894371, -0.15028776228427887, 0.21415384113788605, 0.11707470566034317, 0.007204465102404356, -0.02959495410323143, -0.03583981841802597, 0.2851254642009735, -0.10713602602481842, 0.0017513056518509984, -0.07694835215806961, 0.11115913093090057, 0.004005953669548035, 0.038376618176698685, 0.07965710014104843, -0.08241446316242218, 0.14536932110786438, 0.12849143147468567, 0.06551644951105118, 0.07993858307600021, 0.16249245405197144, 0.05741052329540253, 0.015185452066361904, -0.06714855879545212, -0.08843514323234558, -0.12444423139095306, -0.09512298554182053, -0.015729917213320732, -0.05343194678425789, 0.16081975400447845, 0.016226759180426598, 0.01728176884353161, 0.2903081774711609, -0.1798190325498581, 0.11582814157009125, 0.04360770806670189, 0.10350209474563599, -0.03416406363248825, 0.04246728867292404, 0.11331810802221298, 0.10103919357061386, -0.018066419288516045, 0.22541573643684387, -0.05861503258347511, -0.10162799060344696, 0.07654840499162674, -0.0695694163441658, 0.026551946997642517, 0.13258522748947144, 0.012556944042444229, 0.06425796449184418, -0.002517131855711341, 0.011438069865107536, 0.041318271309137344, -0.05680854246020317, 0.09603017568588257, 0.008761056698858738, -0.22746609151363373, -0.04784051328897476, -0.0595485158264637, 0.07639065384864807, 0.07709614932537079, 0.10924743860960007, -0.001620614668354392, -0.06773398071527481, 0.13904209434986115, 0.03096465952694416, -0.0378364734351635, -0.04366074502468109, -0.02476937137544155, -0.004080110229551792, -0.036870863288640976, 0.30369946360588074, -0.28889408707618713, 0.18710105121135712, 0.18414469063282013, -0.06583068519830704, 0.10387624055147171, 0.08511798828840256, 0.014537050388753414, 0.09619496017694473, -0.04962116852402687, 0.06682471185922623, -0.0316983163356781, -0.06806270778179169, -0.026947051286697388, 0.08701729774475098, 0.038063064217567444, 0.1293313354253769, -0.15496093034744263, -0.13712814450263977, 0.21369248628616333, 0.1162920594215393, -0.015390360727906227, 0.01789882220327854, 0.03532334789633751, 0.07257319241762161, -0.022464381530880928, -0.0281352661550045, -0.05055757611989975, 0.1434711366891861, 0.04544428363442421, 0.033981043845415115, 0.028667768463492393, 0.09622650593519211, 0.05130588263273239, 0.20024557411670685, -0.11347924172878265, 0.011119731701910496, 0.23873509466648102, 0.03826657682657242, -0.24132229387760162, 0.1564200520515442, 0.006076784338802099, -0.035588860511779785, -0.04854796454310417, 0.05041758716106415, 0.10645648837089539, -0.03609687462449074, -0.3233909010887146, -0.061742473393678665, -0.05846373736858368, 0.056325118988752365, 0.02646857127547264, -0.18841667473316193, 0.09445645660161972, 0.010224133729934692, 0.12247651070356369, -0.009480430744588375, 0.007140093483030796, -0.03984859585762024, 0.03303823247551918, -0.013250213116407394, 0.09289220720529556, 0.19214271008968353, 0.10562577098608017, -0.08910215646028519, 0.19566480815410614, 0.15648292005062103, 0.004380699712783098, -0.09933920204639435, 0.12594617903232574, 0.1154274046421051, 0.05646374076604843, -0.005951733328402042, 0.011264433152973652, 0.13864223659038544, -0.20049995183944702, 0.06119806692004204, 0.1846417933702469, 0.20043547451496124, 0.20876947045326233, -0.008636653423309326, -0.2170337438583374, -0.04091837257146835, -0.03566575422883034, -0.07534702122211456, 0.01174099463969469, 0.05893545225262642, -0.002292762277647853, 0.06305596977472305, -2.928844092093549e-32, -0.26690226793289185, -0.06969625502824783, -0.031783487647771835, 0.1718810349702835, -0.23130536079406738, 0.03340684995055199, -0.07804499566555023, 0.02210428938269615, -0.0018148913513869047, -0.10060007870197296, -0.11483326554298401, 0.04063005372881889, 0.04408493638038635, -0.030728807672858238, -0.11459528654813766, 0.0704898089170456, 0.04374020919203758, 0.07819847762584686, -0.04140758514404297, 0.05018184706568718, 0.0410614050924778, 0.13381674885749817, 0.011945377103984356, -0.08066754043102264, -0.24541079998016357, 0.09839659929275513, -0.23864708840847015, -0.024963198229670525, -0.09074277430772781, -0.09577865153551102, -0.14011095464229584, 0.09916650503873825, -0.07416965067386627, 0.032196544110774994, -0.023771388456225395, -0.0017035925993695855, -0.08642149716615677, -0.02506502903997898, -0.08072615414857864, 0.06997645646333694, 0.09748171269893646, 0.07457099109888077, 0.021790217608213425, -0.07342707365751266, -0.13244427740573883, 0.15533851087093353, 0.09811543673276901, -0.13054054975509644, -0.008706793189048767, -0.017440306022763252, -0.06305385380983353, 0.08668652921915054, -0.05851040408015251, 0.030127588659524918, 0.0037717665545642376, -0.22508160769939423, -0.07162081450223923, 0.023092497140169144, -0.0960303321480751, -0.0075277783907949924, 0.09307657182216644, 0.0010934267193078995, 0.005260535981506109, 0.05600162595510483, -0.024022694677114487, 0.000009571292139298748, 0.19661478698253632, 0.10755303502082825, 0.015181068331003189, -0.15148258209228516, 0.052809134125709534, -0.053931497037410736, 0.023241685703396797, -0.021999258548021317, -0.20280279219150543, -0.25574663281440735, -0.07409332692623138, -0.00017378773191012442, 0.007507276721298695, -0.062312494963407516, 0.02783902734518051, 0.12310448288917542, -0.0021269384305924177, -0.026246368885040283, -0.2081005871295929, -0.07790426164865494, -0.1399400681257248, 0.06730542331933975, -0.12689480185508728, 0.014133651740849018, 0.03027988411486149, 0.09011506289243698, -0.17186902463436127, -0.06700095534324646, 0.08352738618850708, -0.004498873371630907, 0.06931864470243454, 0.06388712674379349, -0.13002954423427582, -0.05243152379989624, -0.06272576004266739, -0.12176670879125595, 0.10433248430490494, 0.11275263130664825, 0.22595641016960144, -0.013543332926928997, 0.13041207194328308, -0.052469100803136826, -0.15330231189727783, -0.08376353979110718, 0.001038560178130865, -0.03128962591290474, 0.29268425703048706, 0.09734463691711426, -0.015950119122862816, -0.09929444640874863, 0.003842460922896862, 0.058101363480091095, 0.11206908524036407, 0.13165684044361115, -0.1591673046350479, -0.16644786298274994, -0.13328929245471954, -0.0921480730175972, -0.10564213246107101, 0.1016523614525795, -0.0997818186879158, 0.026789812371134758, -0.05754280462861061, -0.0020384967792779207, -0.06251639127731323, -0.05879038944840431, 7.389504617094644e-7, -0.27593761682510376, 0.2001568078994751, -0.012400315143167973, 0.0180814228951931, -0.1586751639842987, 0.06994923204183578, -0.023837197571992874, -0.05848100781440735, -0.05348643660545349, 0.18756531178951263, 0.02381528913974762, -0.09903233498334885, -0.006813327316194773, 0.0037407621275633574, 0.005915708839893341, -0.121828094124794, -0.24915552139282227, 0.06356231123209, -0.17509450018405914, -0.007437893655151129, -0.03146436810493469, 0.08804581314325333, 0.18415683507919312, -0.01875397562980652, 0.07413145154714584, 0.060147903859615326, -0.10523991286754608, -0.007989929057657719, 0.012266132980585098, 0.006397816352546215, -0.019477101042866707, 0.07489029318094254, 0.007830969989299774, 0.11319182068109512, -0.010049193166196346, -0.07733848690986633, -0.10608778148889542, -0.03311435133218765, 0.02203352004289627, 0.03621235862374306, 0.052771810442209244, 0.18436045944690704, 0.046444110572338104, -0.1486952304840088, 0.005768163595348597, 0.11425232887268066, -0.06487204134464264, -0.13812755048274994, -0.07227694988250732, 0.011139779351651669, 0.10664799809455872, -0.04908433184027672, 0.12263868749141693, 0.14791864156723022, -0.05222035199403763, 0.05756116658449173, -0.14208604395389557, -0.12978079915046692, 0.22138451039791107, -0.04352286085486412, -0.03786700591444969, -0.1287641078233719, 0.043624039739370346, -0.07796787470579147, 0.020723244175314903, -0.09808171540498734, 0.008645092137157917, -3.404717794139131e-35, -0.04211992397904396, -0.06597217917442322, -0.003808443434536457, -0.19327813386917114, 0.10011711716651917, 0.039329130202531815, 0.3007398545742035, -0.04168963432312012, 0.10052609443664551, -0.21683458983898163, -0.15740416944026947 ]
https://github.com/huggingface/datasets/issues/6276
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error
> Since you are using Windows, maybe moving the `map` call inside `if __name__ == "__main__"` can fix the issue: > > ```python > if __name__ == "__main__": > common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) > ``` > > Otherwise, the only solution is to set `num_proc=1`. Thank you very much for the response, i eventually tried setting `num_proc=1` and now the jupyter notebook kernel keers dying after running the command, what do you think the issue could be, could it be that my system is not capable of running the command "i'm using a Lenovo Thinkpad T440 with no GPU"
### Describe the bug I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post https://huggingface.co/blog/fine-tune-whisper I tried google collab and it works but because I'm on the free version the training doesn't complete the error comes in jupyter notebook when i run this line `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` here is the error message ``` Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s] The above exception was the direct cause of the following exception: NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1 File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value NameError: name 'feature_extractor' is not defined ``` ### Steps to reproduce the bug 1. follow the steps in this blog post https://huggingface.co/blog/fine-tune-whisper 2. run this line of code `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` 3. I'm using jupyter notebook from anaconda ### Expected behavior No error message ### Environment info datasets version: 2.8.0 Python version: 3.11 Windows 10
100
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error ### Describe the bug I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post https://huggingface.co/blog/fine-tune-whisper I tried google collab and it works but because I'm on the free version the training doesn't complete the error comes in jupyter notebook when i run this line `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` here is the error message ``` Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s] The above exception was the direct cause of the following exception: NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1 File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value NameError: name 'feature_extractor' is not defined ``` ### Steps to reproduce the bug 1. follow the steps in this blog post https://huggingface.co/blog/fine-tune-whisper 2. run this line of code `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` 3. I'm using jupyter notebook from anaconda ### Expected behavior No error message ### Environment info datasets version: 2.8.0 Python version: 3.11 Windows 10 > Since you are using Windows, maybe moving the `map` call inside `if __name__ == "__main__"` can fix the issue: > > ```python > if __name__ == "__main__": > common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) > ``` > > Otherwise, the only solution is to set `num_proc=1`. Thank you very much for the response, i eventually tried setting `num_proc=1` and now the jupyter notebook kernel keers dying after running the command, what do you think the issue could be, could it be that my system is not capable of running the command "i'm using a Lenovo Thinkpad T440 with no GPU"
[ 0.09523754566907883, 0.01659438945353031, 0.017888270318508148, 0.014276492409408092, 0.2735872268676758, -0.01401198748499155, 0.11820992082357407, 0.04570578783750534, 0.05514794960618019, 0.057444166392087936, -0.1803496778011322, -0.012840925715863705, 0.05464494600892067, 0.17127904295921326, -0.02503468655049801, -0.15509238839149475, 0.02068079635500908, -0.12725019454956055, 0.0448068231344223, -0.009743981063365936, -0.10085160285234451, 0.06560972332954407, -0.056987836956977844, 0.06333602219820023, -0.03345679119229317, -0.32662680745124817, -0.11255965381860733, 0.05255737900733948, -0.0768861472606659, -0.007313491310924292, 0.07201910763978958, 0.01996087096631527, -0.082244873046875, 0.22588925063610077, 0.000005832827810081653, -0.010653550736606121, 0.16098804771900177, 0.0030936929397284985, 0.039498958736658096, -0.019901497289538383, 0.13652382791042328, 0.06946121156215668, -0.13987915217876434, 0.009591499343514442, -0.07452116906642914, 0.024054085835814476, -0.17111214995384216, 0.07872343808412552, 0.23443280160427094, 0.18826737999916077, 0.038286834955215454, -0.028592417016625404, 0.12026559561491013, -0.08646004647016525, 0.005961341317743063, -0.24798230826854706, -0.05611974373459816, -0.0893331840634346, -0.2152881771326065, -0.133069708943367, 0.01362075749784708, 0.03180385008454323, -0.03299387916922569, -0.01860904134809971, 0.045951951295137405, 0.14257293939590454, -0.14024128019809723, -0.23802655935287476, -0.021336078643798828, 0.18363946676254272, 0.04351428896188736, 0.1544659286737442, -0.17320579290390015, 0.02234925888478756, -0.03420386090874672, -0.20674289762973785, -0.01731932908296585, -0.07723192870616913, -0.05148172378540039, -0.06570956856012344, -0.0994459018111229, -0.057518940418958664, 0.014714527875185013, -0.0031631914898753166, 0.0760519951581955, -0.047352761030197144, -0.07610530406236649, 0.03280835598707199, 0.08964795619249344, -0.25488629937171936, 0.08808489888906479, 0.029951075091958046, -0.01472321804612875, -0.011107070371508598, -0.13965490460395813, -0.055207476019859314, -0.07044805586338043, -0.12234005331993103, -0.017032237723469734, -0.07007820904254913, 0.020847657695412636, -0.13937360048294067, 0.08663615584373474, 0.1469144970178604, -0.016484536230564117, 0.07283664494752884, 0.10052763670682907, -0.0250475462526083, 0.13590362668037415, 0.10847017168998718, 0.041228827089071274, 0.09238182753324509, -0.19902396202087402, -0.00870687048882246, -0.03964397311210632, -0.006856310181319714, 0.04156529903411865, 0.01721210777759552, -0.014142083935439587, 0.2381592094898224, 0.14213918149471283, 0.1384163796901703, -0.06747829914093018, 0.09678678959608078, 0.0009477669955231249, -0.10460274666547775, 0.07096892595291138, 0.11471306532621384, -0.1464231163263321, -0.03345854580402374, -0.04136902838945389, 0.1732441633939743, -0.02887607179582119, -0.01982605643570423, 0.11730001866817474, 0.12423104792833328, 0.060606468468904495, -0.10082811117172241, 0.026380399242043495, -0.00904732383787632, 0.02420135959982872, -0.18174424767494202, -0.25925856828689575, 0.009837287478148937, -0.03868452459573746, -0.09634130448102951, 0.18148058652877808, 0.039903149008750916, 0.0616689957678318, -0.13623107969760895, -0.14382143318653107, 0.12252177298069, -0.1088540181517601, 0.09792502224445343, 0.032412029802799225, 0.12617972493171692, -0.004331926815211773, -0.06161046773195267, -0.07667253166437149, -0.03622325509786606, 0.061300959438085556, 0.05394629389047623, -0.013082285411655903, -0.14364105463027954, 0.1074330061674118, 0.016602730378508568, 0.08907525986433029, -0.0187670961022377, -0.0408063642680645, -0.04988928511738777, 0.1008554995059967, 0.13845084607601166, 0.05885423719882965, 0.002379057230427861, -0.018384316936135292, 0.16905055940151215, -0.030400754883885384, -0.01834714412689209, -0.17085613310337067, -0.08952663838863373, -0.0444122850894928, -0.06419625878334045, 0.06823825091123581, -0.07176376134157181, 0.004841903690248728, -0.012241920456290245, 0.18998587131500244, 0.09216878563165665, -0.09743795543909073, -0.07767246663570404, 0.11782176792621613, -0.003992987331002951, -0.1359536498785019, -0.09121295809745789, -0.02665136568248272, -0.06603722274303436, -0.03693116828799248, -0.13704298436641693, 0.027360348030924797, -0.1259104311466217, -0.010964046232402325, -0.03440394252538681, 0.05282590538263321, 0.05727998539805412, -0.07408885657787323, -0.0139514384791255, -0.09235510230064392, -0.04086652770638466, -0.18836042284965515, -0.0963752493262291, -0.06795211136341095, 0.009846781380474567, 0.06913118064403534, -0.12765441834926605, 0.02901981770992279, -0.09593677520751953, 0.09221872687339783, -0.05170043557882309, -0.02125108800828457, -0.017530657351017, -0.02053878642618656, 0.09035893529653549, -0.024117378517985344, -0.02562781237065792, -0.047256700694561005, -0.07519689202308655, -0.11257092654705048, 0.024339774623513222, 0.14784912765026093, 0.12065806984901428, -0.038686785846948624, -0.13509127497673035, 0.06853451579809189, 0.11014360934495926, 0.04504071921110153, -0.16595131158828735, -0.05759236216545105, -0.20745864510536194, -0.08324994891881943, 0.1047084778547287, -0.10840488970279694, 0.07833649218082428, -0.10744544118642807, -0.030811669304966927, 0.07287493348121643, 0.06814883649349213, -0.03322150185704231, 0.04927560314536095, 0.033822569996118546, -0.022076867520809174, 0.18559302389621735, 0.08996333926916122, -0.13338600099086761, 0.04502773657441139, 0.059634532779455185, -0.05740489810705185, 0.011934679932892323, 0.05874926224350929, -0.17693021893501282, -0.27134618163108826, 0.23855195939540863, -0.020226139575242996, 0.12191344052553177, -0.09004967659711838, 0.1525929719209671, -0.0683746188879013, -0.06322792172431946, -0.14627237617969513, 0.029485994949936867, 0.059695325791835785, -0.06057405844330788, 0.0026532653719186783, 0.04718739539384842, -0.14039652049541473, 0.0193362794816494, 0.013032782822847366, 0.2056182473897934, 0.0070931510999798775, -0.029280465096235275, 0.02223462238907814, -0.13058139383792877, 0.0036424777936190367, 0.0743122324347496, 0.04171518236398697, 0.13553179800510406, 0.04395941272377968, 0.02649274282157421, -0.09532763808965683, -0.04947853833436966, 0.10975678265094757, -0.037960756570100784, 0.08599940687417984, 0.03046339377760887, -0.1669771373271942, -0.13637347519397736, 0.11348855495452881, 0.06261543184518814, 0.15005861222743988, 0.01563914492726326, 0.06629245728254318, -0.06685583293437958, -0.00492990342900157, -0.0008840984664857388, 0.04929810017347336, 0.004267336335033178, -0.14088159799575806, 0.15027852356433868, 0.28088805079460144, -0.05619152635335922, -0.01768597774207592, 0.051416922360658646, -0.08385541290044785, -0.07020871341228485, 0.23716458678245544, 0.08402299880981445, 0.06661848723888397, -0.04466700181365013, -0.011246451176702976, 0.08947623521089554, -0.016609253361821175, 0.06775147467851639, -0.024975625798106194, 0.0393415167927742, 0.08635477721691132, 0.04988770931959152, 0.026474764570593834, -0.22573819756507874, -0.12140239030122757, 0.006713094189763069, -0.29906946420669556, 0.00447978125885129, 0.19961851835250854, -0.2082921713590622, 0.03735673055052757, -0.0008390619186684489, 0.039064906537532806, -0.15486787259578705, -0.1495593786239624, 0.24645546078681946, 0.004297909792512655, -0.07391172647476196, -0.006754210218787193, -0.10641059279441833, 0.0622699037194252, -0.04604775831103325, 0.017289262264966965, 0.05986673757433891, -0.02488052099943161, 0.10809582471847534, 0.08965069055557251, 0.022145936265587807, -0.023810630664229393, -0.04221722483634949, -0.06643501669168472, -0.14262214303016663, -0.08703772723674774, -0.15099263191223145, 0.09888258576393127, -0.005995818413794041, 0.01904749684035778, 0.24197599291801453, 0.004795638378709555, 0.03986337408423424, 0.19415530562400818, -0.11451352387666702, 0.09964292496442795, 0.0646093413233757, -0.09540921449661255, -0.10852900892496109, -0.11080244928598404, 0.1351034939289093, 0.06256186962127686, -0.02355434186756611, 0.033113833516836166, 0.04605427011847496, -0.01477218046784401, -0.1429550051689148, -0.14548370242118835, 0.08384779840707779, 0.04426439851522446, 0.06776644289493561, -0.09522580355405807, -0.12927377223968506, 0.055493637919425964, 0.22290277481079102, 0.08638304471969604, 0.011624736711382866, 0.0494549497961998, -0.24578319489955902, 0.178957998752594, 0.0749230608344078, -0.09424666315317154, -0.07533641904592514, -0.2181379646062851, 0.05215015634894371, -0.15028776228427887, 0.21415384113788605, 0.11707470566034317, 0.007204465102404356, -0.02959495410323143, -0.03583981841802597, 0.2851254642009735, -0.10713602602481842, 0.0017513056518509984, -0.07694835215806961, 0.11115913093090057, 0.004005953669548035, 0.038376618176698685, 0.07965710014104843, -0.08241446316242218, 0.14536932110786438, 0.12849143147468567, 0.06551644951105118, 0.07993858307600021, 0.16249245405197144, 0.05741052329540253, 0.015185452066361904, -0.06714855879545212, -0.08843514323234558, -0.12444423139095306, -0.09512298554182053, -0.015729917213320732, -0.05343194678425789, 0.16081975400447845, 0.016226759180426598, 0.01728176884353161, 0.2903081774711609, -0.1798190325498581, 0.11582814157009125, 0.04360770806670189, 0.10350209474563599, -0.03416406363248825, 0.04246728867292404, 0.11331810802221298, 0.10103919357061386, -0.018066419288516045, 0.22541573643684387, -0.05861503258347511, -0.10162799060344696, 0.07654840499162674, -0.0695694163441658, 0.026551946997642517, 0.13258522748947144, 0.012556944042444229, 0.06425796449184418, -0.002517131855711341, 0.011438069865107536, 0.041318271309137344, -0.05680854246020317, 0.09603017568588257, 0.008761056698858738, -0.22746609151363373, -0.04784051328897476, -0.0595485158264637, 0.07639065384864807, 0.07709614932537079, 0.10924743860960007, -0.001620614668354392, -0.06773398071527481, 0.13904209434986115, 0.03096465952694416, -0.0378364734351635, -0.04366074502468109, -0.02476937137544155, -0.004080110229551792, -0.036870863288640976, 0.30369946360588074, -0.28889408707618713, 0.18710105121135712, 0.18414469063282013, -0.06583068519830704, 0.10387624055147171, 0.08511798828840256, 0.014537050388753414, 0.09619496017694473, -0.04962116852402687, 0.06682471185922623, -0.0316983163356781, -0.06806270778179169, -0.026947051286697388, 0.08701729774475098, 0.038063064217567444, 0.1293313354253769, -0.15496093034744263, -0.13712814450263977, 0.21369248628616333, 0.1162920594215393, -0.015390360727906227, 0.01789882220327854, 0.03532334789633751, 0.07257319241762161, -0.022464381530880928, -0.0281352661550045, -0.05055757611989975, 0.1434711366891861, 0.04544428363442421, 0.033981043845415115, 0.028667768463492393, 0.09622650593519211, 0.05130588263273239, 0.20024557411670685, -0.11347924172878265, 0.011119731701910496, 0.23873509466648102, 0.03826657682657242, -0.24132229387760162, 0.1564200520515442, 0.006076784338802099, -0.035588860511779785, -0.04854796454310417, 0.05041758716106415, 0.10645648837089539, -0.03609687462449074, -0.3233909010887146, -0.061742473393678665, -0.05846373736858368, 0.056325118988752365, 0.02646857127547264, -0.18841667473316193, 0.09445645660161972, 0.010224133729934692, 0.12247651070356369, -0.009480430744588375, 0.007140093483030796, -0.03984859585762024, 0.03303823247551918, -0.013250213116407394, 0.09289220720529556, 0.19214271008968353, 0.10562577098608017, -0.08910215646028519, 0.19566480815410614, 0.15648292005062103, 0.004380699712783098, -0.09933920204639435, 0.12594617903232574, 0.1154274046421051, 0.05646374076604843, -0.005951733328402042, 0.011264433152973652, 0.13864223659038544, -0.20049995183944702, 0.06119806692004204, 0.1846417933702469, 0.20043547451496124, 0.20876947045326233, -0.008636653423309326, -0.2170337438583374, -0.04091837257146835, -0.03566575422883034, -0.07534702122211456, 0.01174099463969469, 0.05893545225262642, -0.002292762277647853, 0.06305596977472305, -2.928844092093549e-32, -0.26690226793289185, -0.06969625502824783, -0.031783487647771835, 0.1718810349702835, -0.23130536079406738, 0.03340684995055199, -0.07804499566555023, 0.02210428938269615, -0.0018148913513869047, -0.10060007870197296, -0.11483326554298401, 0.04063005372881889, 0.04408493638038635, -0.030728807672858238, -0.11459528654813766, 0.0704898089170456, 0.04374020919203758, 0.07819847762584686, -0.04140758514404297, 0.05018184706568718, 0.0410614050924778, 0.13381674885749817, 0.011945377103984356, -0.08066754043102264, -0.24541079998016357, 0.09839659929275513, -0.23864708840847015, -0.024963198229670525, -0.09074277430772781, -0.09577865153551102, -0.14011095464229584, 0.09916650503873825, -0.07416965067386627, 0.032196544110774994, -0.023771388456225395, -0.0017035925993695855, -0.08642149716615677, -0.02506502903997898, -0.08072615414857864, 0.06997645646333694, 0.09748171269893646, 0.07457099109888077, 0.021790217608213425, -0.07342707365751266, -0.13244427740573883, 0.15533851087093353, 0.09811543673276901, -0.13054054975509644, -0.008706793189048767, -0.017440306022763252, -0.06305385380983353, 0.08668652921915054, -0.05851040408015251, 0.030127588659524918, 0.0037717665545642376, -0.22508160769939423, -0.07162081450223923, 0.023092497140169144, -0.0960303321480751, -0.0075277783907949924, 0.09307657182216644, 0.0010934267193078995, 0.005260535981506109, 0.05600162595510483, -0.024022694677114487, 0.000009571292139298748, 0.19661478698253632, 0.10755303502082825, 0.015181068331003189, -0.15148258209228516, 0.052809134125709534, -0.053931497037410736, 0.023241685703396797, -0.021999258548021317, -0.20280279219150543, -0.25574663281440735, -0.07409332692623138, -0.00017378773191012442, 0.007507276721298695, -0.062312494963407516, 0.02783902734518051, 0.12310448288917542, -0.0021269384305924177, -0.026246368885040283, -0.2081005871295929, -0.07790426164865494, -0.1399400681257248, 0.06730542331933975, -0.12689480185508728, 0.014133651740849018, 0.03027988411486149, 0.09011506289243698, -0.17186902463436127, -0.06700095534324646, 0.08352738618850708, -0.004498873371630907, 0.06931864470243454, 0.06388712674379349, -0.13002954423427582, -0.05243152379989624, -0.06272576004266739, -0.12176670879125595, 0.10433248430490494, 0.11275263130664825, 0.22595641016960144, -0.013543332926928997, 0.13041207194328308, -0.052469100803136826, -0.15330231189727783, -0.08376353979110718, 0.001038560178130865, -0.03128962591290474, 0.29268425703048706, 0.09734463691711426, -0.015950119122862816, -0.09929444640874863, 0.003842460922896862, 0.058101363480091095, 0.11206908524036407, 0.13165684044361115, -0.1591673046350479, -0.16644786298274994, -0.13328929245471954, -0.0921480730175972, -0.10564213246107101, 0.1016523614525795, -0.0997818186879158, 0.026789812371134758, -0.05754280462861061, -0.0020384967792779207, -0.06251639127731323, -0.05879038944840431, 7.389504617094644e-7, -0.27593761682510376, 0.2001568078994751, -0.012400315143167973, 0.0180814228951931, -0.1586751639842987, 0.06994923204183578, -0.023837197571992874, -0.05848100781440735, -0.05348643660545349, 0.18756531178951263, 0.02381528913974762, -0.09903233498334885, -0.006813327316194773, 0.0037407621275633574, 0.005915708839893341, -0.121828094124794, -0.24915552139282227, 0.06356231123209, -0.17509450018405914, -0.007437893655151129, -0.03146436810493469, 0.08804581314325333, 0.18415683507919312, -0.01875397562980652, 0.07413145154714584, 0.060147903859615326, -0.10523991286754608, -0.007989929057657719, 0.012266132980585098, 0.006397816352546215, -0.019477101042866707, 0.07489029318094254, 0.007830969989299774, 0.11319182068109512, -0.010049193166196346, -0.07733848690986633, -0.10608778148889542, -0.03311435133218765, 0.02203352004289627, 0.03621235862374306, 0.052771810442209244, 0.18436045944690704, 0.046444110572338104, -0.1486952304840088, 0.005768163595348597, 0.11425232887268066, -0.06487204134464264, -0.13812755048274994, -0.07227694988250732, 0.011139779351651669, 0.10664799809455872, -0.04908433184027672, 0.12263868749141693, 0.14791864156723022, -0.05222035199403763, 0.05756116658449173, -0.14208604395389557, -0.12978079915046692, 0.22138451039791107, -0.04352286085486412, -0.03786700591444969, -0.1287641078233719, 0.043624039739370346, -0.07796787470579147, 0.020723244175314903, -0.09808171540498734, 0.008645092137157917, -3.404717794139131e-35, -0.04211992397904396, -0.06597217917442322, -0.003808443434536457, -0.19327813386917114, 0.10011711716651917, 0.039329130202531815, 0.3007398545742035, -0.04168963432312012, 0.10052609443664551, -0.21683458983898163, -0.15740416944026947 ]
https://github.com/huggingface/datasets/issues/6275
Would like to Contribute a dataset
Hi! The process of contributing a dataset is explained here: https://huggingface.co/docs/datasets/upload_dataset. Also, check https://huggingface.co/docs/datasets/image_dataset for a more detailed explanation of how to share an image dataset.
I have a dataset of 2500 images that can be used for color-blind machine-learning algorithms. Since , there was no dataset available online , I made this dataset myself and would like to contribute this now to community
26
Would like to Contribute a dataset I have a dataset of 2500 images that can be used for color-blind machine-learning algorithms. Since , there was no dataset available online , I made this dataset myself and would like to contribute this now to community Hi! The process of contributing a dataset is explained here: https://huggingface.co/docs/datasets/upload_dataset. Also, check https://huggingface.co/docs/datasets/image_dataset for a more detailed explanation of how to share an image dataset.
[ 0.016343215480446815, 0.00629084138199687, -0.04012153297662735, 0.008750014938414097, 0.10962290316820145, 0.030689213424921036, 0.2170308530330658, -0.11082601547241211, 0.12508907914161682, 0.05166525021195412, -0.016930781304836273, -0.08480113744735718, -0.07812215387821198, 0.13296499848365784, 0.076119065284729, -0.2713366448879242, -0.13890017569065094, -0.09505513310432434, -0.0708228275179863, -0.1512170135974884, -0.0013670872431248426, 0.02832525037229061, 0.11331149935722351, -0.059428852051496506, -0.01056218333542347, 0.02153787761926651, -0.09227032959461212, 0.11593348532915115, -0.07803378254175186, -0.0350128598511219, 0.02555837109684944, 0.04911623150110245, 0.09829629957675934, 0.14040078222751617, 0.0000053096764531801455, -0.0893002301454544, 0.006061829160898924, 0.06278178840875626, 0.0924108698964119, -0.06106634810566902, 0.12418169528245926, -0.03630460426211357, -0.06170181185007095, 0.038149986416101456, -0.03167763724923134, -0.07113944739103317, 0.22832025587558746, 0.11113449186086655, 0.24528658390045166, 0.18258674442768097, 0.0644032210111618, 0.15440605580806732, 0.054183732718229294, -0.0778985247015953, 0.026910757645964622, 0.18363545835018158, 0.0018303835531696677, 0.17518293857574463, -0.15937605500221252, -0.09818698465824127, 0.02432015910744667, -0.044363733381032944, 0.11238040030002594, -0.09624471515417099, 0.1196562722325325, 0.07432270795106888, -0.29435792565345764, -0.08104708045721054, 0.0033509796485304832, 0.11032036691904068, 0.11185616999864578, 0.012762515805661678, -0.032747890800237656, 0.09518887102603912, -0.12378139048814774, 0.05676696449518204, -0.18823149800300598, 0.1536436229944229, -0.03511831909418106, 0.047267936170101166, -0.18301339447498322, -0.024146882817149162, -0.07257423549890518, -0.12365338951349258, 0.14730066061019897, -0.00033019002876244485, -0.017907164990901947, -0.0005954671651124954, -0.2049470692873001, -0.051540691405534744, 0.018018046393990517, -0.0532987043261528, -0.03225494921207428, 0.00792964082211256, 0.052632372826337814, -0.00546628562733531, -0.13762740790843964, -0.033608365803956985, 0.06869426369667053, -0.0029205563478171825, 0.020696811378002167, -0.11732655018568039, -0.10902483761310577, 0.1440218836069107, 0.06239334121346474, -0.005246657878160477, 0.14361776411533356, -0.24061840772628784, 0.08385318517684937, 0.14814285933971405, 0.055289000272750854, 0.04364783316850662, 0.02970883622765541, 0.0155111039057374, -0.010086238384246826, 0.07856401056051254, -0.07154391705989838, 0.03734135627746582, 0.04881187900900841, -0.10112567245960236, 0.31428399682044983, 0.03243904560804367, -0.02971123531460762, 0.06522174924612045, -0.028308961540460587, -0.05656101554632187, 0.08317592740058899, 0.1086190938949585, 0.09064840525388718, -0.17480090260505676, -0.07841310650110245, -0.026720285415649414, 0.08943668007850647, -0.1406107395887375, 0.1286371350288391, -0.06419866532087326, 0.0011153696104884148, 0.04118863493204117, -0.05145465210080147, -0.06397590786218643, 0.12034468352794647, 0.010427254252135754, -0.15468493103981018, -0.07823917269706726, -0.0012905027251690626, -0.16100740432739258, 0.06830179691314697, 0.005752059165388346, -0.13105785846710205, 0.2062995880842209, 0.08799831569194794, 0.26381349563598633, -0.28114455938339233, 0.05045764520764351, 0.10662513226270676, -0.07892218977212906, 0.00070127536309883, 0.07400348782539368, -0.1840757429599762, -0.0009877659613266587, 0.07949108630418777, -0.09913229942321777, -0.018746912479400635, -0.09163923561573029, -0.034449223428964615, 0.1017225980758667, -0.051529351621866226, 0.1159258559346199, -0.026203591376543045, 0.07705938816070557, -0.0010299085406586528, 0.024878282099962234, 0.009368672035634518, -0.05159728601574898, 0.11172465234994888, 0.1749059408903122, 0.04946943745017052, -0.09975264966487885, -0.13714122772216797, -0.07606560736894608, 0.01858128234744072, -0.3182848393917084, -0.1240728348493576, 0.03881372883915901, 0.050253789871931076, -0.01639222912490368, -0.19514986872673035, 0.23711413145065308, -0.19703388214111328, 0.10172855854034424, -0.09403470158576965, 0.04412197694182396, 0.1326608806848526, 0.2881092131137848, -0.12240700423717499, 0.04851945862174034, 0.08529253304004669, -0.3213498592376709, -0.008789081126451492, -0.1769753396511078, -0.0004769294464495033, -0.05589142069220543, 0.11536925286054611, 0.011023296043276787, -0.11132895201444626, -0.04595375433564186, 0.021408777683973312, -0.0012742913095280528, 0.13880771398544312, -0.10230649262666702, -0.05298817530274391, 0.07252050936222076, -0.11490944772958755, -0.1880500316619873, -0.012202841229736805, 0.03132731094956398, -0.0012907844502478838, 0.01709984429180622, -0.028212876990437508, 0.1647697389125824, -0.0007294488605111837, -0.0189453586935997, -0.0034299183171242476, -0.044117625802755356, 0.11568533629179001, -0.027732182294130325, 0.05038613826036453, -0.03193407505750656, 0.23210637271404266, 0.02865227684378624, 0.05563215911388397, -0.024875560775399208, 0.05965956300497055, 0.1478632390499115, -0.14323537051677704, 0.07512080669403076, 0.20776034891605377, 0.1000722125172615, 0.09483838826417923, -0.2165214568376541, -0.08166748285293579, 0.0010611325269564986, -0.12998494505882263, 0.08145661652088165, -0.0010485317325219512, 0.09962927550077438, -0.21320486068725586, -0.02515174075961113, 0.013390769250690937, 0.15186917781829834, 0.2190963476896286, 0.054180122911930084, 0.03125271201133728, 0.05860468000173569, -0.05729655176401138, -0.08771876245737076, -0.07968515157699585, 0.035101111978292465, -0.19160054624080658, 0.05304297059774399, -0.0947880819439888, 0.03229394927620888, 0.009995750151574612, -0.06648828089237213, 0.09919515252113342, 0.0389474518597126, 0.19417865574359894, 0.009621991775929928, -0.07919345796108246, 0.033889397978782654, -0.08488073945045471, -0.0015746131539344788, -0.0035065189003944397, -0.08977304399013519, 0.020693069323897362, -0.16849707067012787, 0.07649919390678406, -0.06681905686855316, 0.0025269887410104275, 0.13425517082214355, -0.24773378670215607, 0.15905791521072388, 0.05664322152733803, -0.05570647493004799, 0.1339985877275467, 0.14460350573062897, 0.06418751925230026, -0.011769280768930912, -0.05942511186003685, 0.06168859824538231, -0.010210647247731686, 0.07571353763341904, 0.06175747513771057, -0.28461313247680664, -0.13061195611953735, 0.039083074778318405, -0.08611983805894852, 0.10098997503519058, 0.036196380853652954, 0.15069158375263214, -0.1442110687494278, 0.10635275393724442, 0.21995213627815247, 0.04793201759457588, 0.06468503922224045, 0.036093950271606445, 0.22510626912117004, 0.11048009991645813, -0.02435866929590702, 0.014457772485911846, -0.04509272426366806, -0.16481010615825653, -0.005791874136775732, 0.08845339715480804, 0.08990400284528732, -0.003526782151311636, -0.1718660593032837, -0.13739177584648132, 0.0398278534412384, 0.1144987940788269, -0.02010032720863819, -0.1315603256225586, 0.13006211817264557, 0.012396666221320629, 0.018898984417319298, 0.2658005952835083, -0.2355187088251114, -0.1800914853811264, 0.19396138191223145, -0.05133580043911934, -0.06994233280420303, -0.06148490309715271, 0.11795385181903839, -0.04586394876241684, 0.11735931783914566, -0.03228866681456566, 0.12233711034059525, -0.06691154092550278, 0.05702562630176544, -0.10452355444431305, -0.18637166917324066, 0.06489896774291992, 0.030910957604646683, -0.003076257649809122, 0.09144986420869827, -0.06645923852920532, 0.07221997529268265, -0.08096424490213394, -0.10637536644935608, 0.1437779814004898, 0.011406781151890755, 0.10399647057056427, 0.10652602463960648, 0.04333486407995224, -0.020396843552589417, -0.04118837043642998, -0.16589795053005219, 0.1667013168334961, -0.13302013278007507, 0.042811259627342224, -0.007541928440332413, 0.07992932945489883, 0.1677466481924057, 0.05336400493979454, -0.03849976137280464, 0.16678190231323242, 0.05448927730321884, 0.19823956489562988, -0.02224181778728962, -0.19994059205055237, 0.07345690578222275, -0.08671628683805466, 0.05415773764252663, 0.06593173742294312, -0.055748991668224335, -0.14630883932113647, 0.0369524285197258, -0.057991206645965576, -0.07966925203800201, 0.04821173474192619, 0.06477304548025131, -0.15524469316005707, 0.03897099569439888, 0.004203514661639929, -0.11218240112066269, -0.09733041375875473, -0.13198710978031158, -0.06635534018278122, -0.058779746294021606, 0.17433126270771027, -0.08853070437908173, -0.08350004255771637, -0.07705292105674744, -0.1494051069021225, -0.04731925576925278, -0.05935196951031685, -0.04764540493488312, 0.03640484809875488, 0.0358828604221344, 0.13083980977535248, -0.025175560265779495, -0.027921538800001144, -0.09614129364490509, 0.011787512339651585, -0.023967422544956207, -0.003928015474230051, 0.05076923221349716, 0.07320327311754227, 0.03299124911427498, -0.07040441781282425, 0.0060858228243887424, 0.0237538181245327, -0.07485941797494888, 0.04031552001833916, -0.06848233938217163, -0.14004656672477722, -0.13155707716941833, 0.061183661222457886, 0.20298950374126434, -0.1268465667963028, 0.022844837978482246, -0.05117121711373329, 0.14633525907993317, 0.1172441616654396, 0.09220252931118011, 0.03994949162006378, -0.12985453009605408, 0.10298609733581543, 0.10848790407180786, 0.02436939999461174, 0.087869793176651, 0.21284042298793793, -0.07575660198926926, 0.018215226009488106, -0.02144613303244114, -0.13345542550086975, 0.20712998509407043, -0.06968273967504501, -0.03353758528828621, -0.11853478848934174, -0.010802500881254673, -0.008001153357326984, 0.05509604886174202, 0.08985581248998642, 0.055076971650123596, -0.0070551298558712006, 0.06002088263630867, -0.019207937642931938, 0.1794029176235199, -0.029428530484437943, -0.08984602242708206, -0.17147763073444366, -0.09143272042274475, -0.10938430577516556, -0.06421151757240295, -0.06393655389547348, 0.01662546955049038, 0.012347431853413582, 0.1231452152132988, -0.04053119570016861, 0.05573837086558342, -0.044146277010440826, -0.31944918632507324, 0.03562931343913078, -0.2826332449913025, -0.020465651527047157, 0.2474684715270996, 0.05259949341416359, -0.0784190222620964, -0.23590242862701416, -0.10330086946487427, 0.06852308660745621, -0.03538284823298454, -0.06721960008144379, 0.1070019006729126, 0.10775760561227798, -0.1385449767112732, 0.02212510071694851, -0.04641113802790642, 0.0596611313521862, 0.1639663130044937, 0.25218474864959717, -0.026380153372883797, -0.04672611877322197, 0.008256967179477215, 0.20034025609493256, -0.11867713928222656, -0.007019769866019487, -0.29438507556915283, -0.012017717584967613, 0.08065178990364075, -0.04490639269351959, -0.051616668701171875, -0.134876549243927, -0.001303544151596725, -0.06477884948253632, -0.011203738860785961, 0.06752292811870575, 0.1505751758813858, -0.0023213790263980627, -0.050415344536304474, 0.017194731160998344, 0.07980293035507202, 0.0042313141748309135, -0.23016415536403656, -0.20311738550662994, -0.013180471956729889, 0.011262461543083191, -0.061612777411937714, 0.08137647807598114, 0.17036457359790802, 0.15102769434452057, -0.034886110574007034, -0.017828388139605522, 0.08923792093992233, -0.04676245152950287, -0.12711110711097717, -0.024899810552597046, -0.06570589542388916, -0.030933713540434837, 0.002925282111391425, -0.03792374208569527, 0.19208960235118866, 0.08105885982513428, -0.21091774106025696, 0.2831280529499054, 0.17577190697193146, 0.004901431035250425, 0.040070004761219025, 0.1572488695383072, 0.06602083891630173, -0.003062026109546423, 0.0596291646361351, 0.025106217712163925, 0.010196802206337452, 0.24291203916072845, 0.07298872619867325, -0.20581530034542084, 0.07899505645036697, -0.015478711575269699, 0.06137097254395485, -0.16961601376533508, -0.14319756627082825, 0.0712723433971405, 0.10877757519483566, 0.23360514640808105, -0.03165500611066818, -0.07308536022901535, -0.14940431714057922, -0.08962146937847137, 0.002442452358081937, 0.026433277875185013, -0.09891428798437119, -0.12090475857257843, -0.09586523473262787, -2.797215467297934e-32, 0.10618870705366135, -0.14410491287708282, -0.004835991188883781, 0.06077836453914642, -0.13021238148212433, 0.029967252165079117, 0.10445412993431091, -0.23890042304992676, -0.011680159717798233, -0.01129675842821598, -0.03663120046257973, -0.029612405225634575, 0.08326702564954758, 0.24494238197803497, -0.17193438112735748, 0.0038619653787463903, 0.022458214312791824, -0.021478945389389992, 0.049242883920669556, -0.023299504071474075, -0.08209532499313354, -0.13308018445968628, -0.092387355864048, -0.01978892832994461, -0.036525435745716095, 0.02473161555826664, -0.05592910200357437, 0.050952181220054626, 0.003599873511120677, 0.20124681293964386, -0.07720905542373657, 0.11078320443630219, -0.03599398210644722, 0.0805620327591896, 0.1144801452755928, -0.03877341002225876, -0.04402713105082512, 0.06901654601097107, -0.03564520180225372, 0.05358917638659477, -0.09811366349458694, -0.06471610069274902, 0.03257109969854355, -0.1845252513885498, 0.05308724567294121, -0.10570071637630463, 0.07923546433448792, 0.0001655362284509465, -0.048173464834690094, 0.042194608598947525, -0.04118430241942406, 0.0749795138835907, 0.054106805473566055, 0.04077582433819771, -0.02004118077456951, -0.01381246279925108, 0.02632978744804859, -0.025208860635757446, 0.032495271414518356, -0.02796567603945732, 0.09280233085155487, -0.07068149000406265, 0.028723547235131264, 0.10379637777805328, 0.2597551643848419, -0.04445364326238632, 0.006910338532179594, 0.02263300120830536, 0.03978258743882179, -0.0646090880036354, -0.16423609852790833, 0.1482892781496048, 0.05104050785303116, 0.19077159464359283, -0.1531403362751007, 0.07938119024038315, -0.08492214232683182, -0.06111367046833038, 0.062377434223890305, -0.03477368503808975, -0.14189819991588593, -0.12858523428440094, 0.1835438758134842, 0.07882556319236755, 0.09864669293165207, -0.13234125077724457, -0.11658299714326859, -0.05978205054998398, 0.1125919371843338, -0.0045656259171664715, -0.024542028084397316, 0.054509930312633514, -0.07367846369743347, -0.06324576586484909, -0.063538558781147, -0.16724616289138794, 0.02461211197078228, 0.15090370178222656, 0.11102911084890366, -0.10928428918123245, 0.0010092334123328328, 0.1012817770242691, 0.14787457883358002, 0.06880545616149902, 0.0536193810403347, -0.0443490594625473, 0.13415445387363434, 0.1991022378206253, -0.250583678483963, 0.08943115174770355, -0.027951762080192566, 0.16226017475128174, 0.022957250475883484, 0.046904269605875015, 0.08797860145568848, -0.08043423295021057, 0.019933423027396202, -0.013229640200734138, -0.027385443449020386, 0.02807598188519478, -0.20040559768676758, -0.19048385322093964, -0.2649472653865814, -0.021511441096663475, -0.08044219017028809, 0.05837106704711914, 0.027769220992922783, 0.0008279154426418245, -0.045939963310956955, -0.09506954252719879, -0.03830477222800255, -0.017157895490527153, 7.560517474303197e-7, -0.20303933322429657, 0.03732352703809738, -0.07226086407899857, 0.0867122933268547, 0.12724851071834564, -0.08354541659355164, -0.1769682615995407, 0.15999338030815125, -0.1051642969250679, 0.1533282846212387, 0.07703686505556107, -0.09645497053861618, 0.14346644282341003, -0.10112603008747101, 0.02707110531628132, -0.1811656802892685, -0.09492403268814087, 0.0007792816031724215, -0.08212625235319138, 0.017586087808012962, 0.07928317040205002, 0.150197371840477, 0.014309353195130825, 0.018152795732021332, 0.07994179427623749, -0.059433091431856155, 0.07257524877786636, -0.18728289008140564, 0.11783342063426971, -0.13378208875656128, 0.013570371083915234, 0.044989973306655884, 0.025898205116391182, 0.15628138184547424, 0.08215201646089554, -0.07402201741933823, -0.10148440301418304, 0.03442979231476784, -0.0854388177394867, -0.005537960212677717, 0.10544637590646744, 0.03321249410510063, -0.2170437127351761, -0.18172836303710938, 0.1951979547739029, -0.004748757462948561, -0.15659941732883453, -0.009599261917173862, -0.16929233074188232, -0.045960914343595505, 0.11989031732082367, -0.10172510892152786, 0.020901840180158615, 0.027822349220514297, 0.13984185457229614, -0.17146402597427368, -0.12620273232460022, -0.0397510752081871, 0.029768435284495354, -0.09930184483528137, -0.10457920283079147, -0.02007311023771763, 0.06887104362249374, 0.05106673017144203, 0.12195856124162674, 0.018287060782313347, -0.09955752640962601, 1.0917635667889794e-34, -0.05552981421351433, -0.04549391567707062, 0.14045698940753937, -0.05687056481838226, 0.08120450377464294, -0.08705497533082962, 0.012099876068532467, -0.08804968744516373, -0.008177214302122593, -0.15215006470680237, 0.05615600198507309 ]
https://github.com/huggingface/datasets/issues/6274
FileNotFoundError for dataset with multiple builder config
Please tell me if the above info is not enough for solving the problem. I will then make my dataset public temporarily so that you can really reproduce the bug.
### Describe the bug When there is only one config and only the dataset name is entered when using datasets.load_dataset(), it works fine. But if I create a second builder_config for my dataset and enter the config name when using datasets.load_dataset(), the following error will happen. FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow' The "XXX.incomplete folder" in the cache folder of my dataset will disappear before "generating test split", which does not happen when config name is not entered and the config name is "default" C:\Users\chenx\.cache\huggingface\datasets\my_dataset\0_shot_multiple_choice\1.0.0 The folder that is supposed to remain under the above directory will disappear, and the data generator will not have a place to generate data into. ### Steps to reproduce the bug test = load_dataset('my_dataset', '0_shot_multiple_choice') ### Expected behavior FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow' ### Environment info datasets 2.14.5 python 3.8.18
30
FileNotFoundError for dataset with multiple builder config ### Describe the bug When there is only one config and only the dataset name is entered when using datasets.load_dataset(), it works fine. But if I create a second builder_config for my dataset and enter the config name when using datasets.load_dataset(), the following error will happen. FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow' The "XXX.incomplete folder" in the cache folder of my dataset will disappear before "generating test split", which does not happen when config name is not entered and the config name is "default" C:\Users\chenx\.cache\huggingface\datasets\my_dataset\0_shot_multiple_choice\1.0.0 The folder that is supposed to remain under the above directory will disappear, and the data generator will not have a place to generate data into. ### Steps to reproduce the bug test = load_dataset('my_dataset', '0_shot_multiple_choice') ### Expected behavior FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow' ### Environment info datasets 2.14.5 python 3.8.18 Please tell me if the above info is not enough for solving the problem. I will then make my dataset public temporarily so that you can really reproduce the bug.
[ 0.049640778452157974, 0.11337407678365707, -0.1409832090139389, 0.014893134124577045, 0.15319706499576569, 0.11278347671031952, 0.23889175057411194, 0.062459323555231094, -0.0402422696352005, 0.043220143765211105, 0.004625521134585142, -0.11794952303171158, -0.129444882273674, -0.1230144128203392, 0.020382260903716087, 0.09280840307474136, -0.0704134926199913, 0.005598939955234528, -0.07957164198160172, 0.03281964361667633, -0.04586589336395264, 0.06254173070192337, 0.1413625031709671, -0.0016879738541319966, -0.14322952926158905, -0.05901490896940231, -0.09056118875741959, 0.2090781331062317, -0.031347572803497314, -0.19120267033576965, 0.1898794025182724, 0.0830773338675499, 0.0008233972475863993, 0.35335490107536316, 0.0000060001689234923106, 0.006300455424934626, 0.2865663170814514, 0.06002085655927658, -0.18690407276153564, -0.11942164599895477, 0.021537519991397858, 0.10522107779979706, 0.03439682722091675, 0.0049047512002289295, 0.07647008448839188, -0.1409532129764557, 0.02829204685986042, -0.032949745655059814, 0.02210739627480507, 0.11254121363162994, 0.10399159044027328, -0.06642751395702362, -0.0012638246407732368, -0.16977359354496002, 0.1669369488954544, 0.026980698108673096, 0.03650422766804695, 0.05829930678009987, -0.17779073119163513, -0.05682257562875748, 0.04282670095562935, 0.0014098226092755795, 0.04321432486176491, 0.10867597907781601, -0.061501238495111465, -0.06643983721733093, -0.17979134619235992, -0.07236004620790482, 0.023407870903611183, 0.2641007602214813, 0.0734967440366745, 0.06466888636350632, -0.1645106077194214, -0.08911512047052383, -0.05039056017994881, -0.08135106414556503, 0.07382705062627792, 0.09524918347597122, -0.1227816715836525, 0.001970900222659111, -0.0743989422917366, -0.08951989561319351, 0.02196325547993183, -0.027052603662014008, -0.22476646304130554, -0.011720621958374977, -0.17464019358158112, -0.02960728481411934, -0.0613374188542366, -0.0975160300731659, 0.16969846189022064, -0.019686389714479446, -0.13243351876735687, -0.2187058925628662, 0.06021767854690552, 0.07116200774908066, -0.03908800706267357, -0.07041794806718826, 0.00785577017813921, 0.04320257157087326, 0.005639895796775818, -0.21203669905662537, -0.04000166803598404, 0.0655955895781517, 0.07096673548221588, 0.09972551465034485, -0.042290717363357544, 0.013412159867584705, 0.005590816494077444, 0.02998538501560688, -0.06105121970176697, -0.031967077404260635, -0.14566002786159515, -0.1193573921918869, 0.026589136570692062, -0.045622024685144424, 0.07411044090986252, 0.09515378624200821, -0.07187052071094513, 0.02645844966173172, 0.06607136875391006, 0.08471588790416718, 0.02710721641778946, 0.17521488666534424, 0.15003947913646698, -0.036941785365343094, -0.000547676463611424, 0.14549699425697327, 0.11674562096595764, -0.01645946130156517, -0.033011481165885925, 0.047380365431308746, -0.022601595148444176, 0.006304607726633549, 0.1323302835226059, -0.0193063672631979, 0.11927144974470139, -0.282545804977417, 0.03788990154862404, -0.03878714516758919, 0.00806718971580267, -0.1438882201910019, -0.1854090541601181, -0.07223659008741379, 0.08045116811990738, 0.13275574147701263, 0.05361858755350113, 0.011885849758982658, -0.012840046547353268, 0.01643400639295578, -0.10896310210227966, 0.11814948171377182, -0.2550429105758667, 0.048555370420217514, 0.012003873474895954, 0.11707673221826553, -0.0675552487373352, 0.05398271605372429, -0.08851208537817001, -0.14913418889045715, 0.06409604847431183, 0.05814162269234657, -0.026385843753814697, -0.08536117523908615, 0.005507030989974737, 0.042111340910196304, 0.035128187388181686, -0.07380452752113342, -0.053275350481271744, 0.011894591152668, -0.06538670510053635, -0.11538925021886826, -0.17219288647174835, 0.10767616331577301, -0.32880374789237976, 0.16385790705680847, 0.09120673686265945, -0.11142627149820328, -0.06927898526191711, 0.0245001632720232, 0.018632709980010986, 0.03840909153223038, 0.06658881902694702, -0.11799168586730957, -0.003028811188414693, -0.03006078116595745, -0.13046255707740784, -0.0042544458992779255, 0.08920209109783173, -0.047656744718551636, -0.09455229341983795, 0.03101273439824581, -0.052251528948545456, -0.08190207183361053, 0.05061095952987671, -0.10080090165138245, 0.03558150306344032, -0.22624744474887848, 0.11927550286054611, -0.25456252694129944, 0.10093921422958374, 0.029559146612882614, -0.14642111957073212, 0.005579432472586632, -0.08423139154911041, -0.042316410690546036, -0.1886563003063202, 0.2637844979763031, -0.0030473428778350353, -0.26516813039779663, -0.16209901869297028, -0.0026321217883378267, 0.06280897557735443, -0.02282484993338585, -0.11963414400815964, -0.09484537690877914, 0.003503581276163459, 0.19071143865585327, -0.1036481112241745, 0.055438119918107986, -0.005464035086333752, 0.23139013350009918, 0.11760026216506958, 0.0028445557691156864, -0.05123220384120941, 0.05167008936405182, 0.04378601163625717, -0.09116758406162262, 0.12272778898477554, 0.026691732928156853, -0.23277637362480164, -0.019550181925296783, -0.01511447411030531, 0.05697815120220184, 0.05546669661998749, -0.09908803552389145, 0.06301423162221909, -0.3148505985736847, -0.038181405514478683, -0.008164706639945507, -0.14367936551570892, -0.055178605020046234, -0.09455756843090057, -0.03522341325879097, 0.014613309875130653, 0.08264540135860443, -0.15057207643985748, 0.014233945868909359, 0.024252165108919144, -0.03764097020030022, 0.1409163922071457, -0.06097210943698883, -0.13259188830852509, 0.15846380591392517, 0.06839879602193832, -0.01856861263513565, 0.10439690202474594, 0.0794534832239151, -0.04979022592306137, -0.05529067665338516, 0.25189146399497986, -0.02965664304792881, -0.1021139845252037, -0.0719664990901947, 0.030656931921839714, -0.059440094977617264, -0.011186500079929829, 0.1026945486664772, 0.12382669001817703, 0.13888464868068695, 0.04057254642248154, -0.08194456994533539, -0.17853547632694244, -0.0422545000910759, 0.09041809290647507, -0.07171689718961716, 0.12747135758399963, 0.14596323668956757, 0.08585028350353241, 0.023770282045006752, -0.18979275226593018, 0.0943751409649849, 0.19759754836559296, -0.08738451451063156, 0.12673914432525635, 0.07342423498630524, -0.0700751468539238, -0.009517405182123184, -0.09590232372283936, -0.062473513185977936, 0.02666960097849369, -0.09274208545684814, 0.0085922721773386, 0.008636243641376495, 0.00526523357257247, 0.047025542706251144, -0.006485980004072189, -0.08671831339597702, -0.033026278018951416, -0.1767059713602066, -0.04877743124961853, -0.05207665637135506, 0.01636648364365101, -0.06146623566746712, 0.05871037021279335, 0.03535919263958931, 0.10120555013418198, 0.1102549284696579, -0.09889836609363556, -0.19392544031143188, 0.0719822570681572, -0.06770336627960205, 0.13446013629436493, 0.23811884224414825, 0.014722488820552826, -0.07689899951219559, 0.008373919874429703, -0.17662815749645233, 0.08443243056535721, 0.05274911969900131, -0.05741275101900101, 0.07453855872154236, 0.05808881297707558, -0.0728049948811531, 0.004826634656637907, 0.031612083315849304, -0.1329163759946823, -0.1879115104675293, -0.05181830748915672, -0.08539309352636337, -0.0213591568171978, 0.08177623152732849, -0.00387487281113863, -0.17502404749393463, -0.001205156440846622, -0.00423273304477334, -0.06102864071726799, -0.012105676345527172, 0.2500327229499817, -0.13796702027320862, 0.02697218395769596, 0.043247297406196594, -0.07257775217294693, 0.07140050828456879, 0.030977798625826836, -0.055798426270484924, 0.06568112224340439, -0.03753648325800896, 0.07932651042938232, -0.139191135764122, 0.036375775933265686, 0.07138057053089142, 0.048427581787109375, -0.14379768073558807, -0.003433733247220516, 0.11170963197946548, -0.15990297496318817, -0.09992720931768417, 0.0675925686955452, -0.017251400277018547, 0.14826585352420807, -0.05209451913833618, 0.0647653266787529, 0.057618334889411926, -0.05841803923249245, 0.10225950181484222, 0.06805028766393661, 0.08300349861383438, -0.09206200391054153, -0.1054040715098381, 0.13818925619125366, 0.05020516365766525, 0.028361160308122635, -0.012550070881843567, 0.034671884030103683, 0.2042423039674759, -0.12372395396232605, -0.09884507209062576, 0.10217934846878052, -0.037340372800827026, -0.008324957452714443, -0.1602325588464737, -0.033231280744075775, 0.10806670039892197, 0.03044780343770981, -0.009767199866473675, -0.01220701914280653, 0.07763349264860153, 0.021801570430397987, 0.09677253663539886, 0.050511740148067474, 0.0788978636264801, 0.11221254616975784, -0.08712957054376602, 0.02692212350666523, -0.07869131118059158, 0.11489842087030411, 0.05713415890932083, 0.0501864068210125, -0.10434151440858841, 0.07466896623373032, 0.17192888259887695, 0.1411135196685791, 0.04224194958806038, 0.047312624752521515, 0.07209987193346024, -0.07440733164548874, -0.1409469097852707, 0.15648767352104187, 0.03355792164802551, 0.03584358096122742, -0.03241284564137459, 0.14823463559150696, -0.07535913586616516, 0.1399299055337906, 0.05469578504562378, 0.0657673254609108, -0.1362617164850235, -0.15119166672229767, -0.06171021610498428, -0.2808256447315216, -0.11396338045597076, 0.03068668767809868, 0.1695777326822281, -0.04274030402302742, -0.031054915860295296, -0.06640998274087906, -0.13520437479019165, 0.027069518342614174, -0.01643652841448784, 0.06774439662694931, -0.07324159890413284, 0.10477714985609055, 0.10953125357627869, 0.006856434512883425, 0.08695027232170105, 0.3009963631629944, -0.1531045287847519, -0.18758535385131836, 0.16220566630363464, -0.17251712083816528, 0.019174804911017418, 0.13148462772369385, -0.16314323246479034, -0.04303284361958504, -0.10545673966407776, -0.03892841935157776, 0.0786508172750473, 0.09740746021270752, 0.13334155082702637, -0.16357678174972534, -0.12017139792442322, -0.1051609069108963, -0.21546754240989685, -0.02894643321633339, 0.03281411528587341, 0.2065490484237671, -0.040049731731414795, -0.06869598478078842, -0.005863592494279146, -0.2015388458967209, -0.07214415818452835, -0.007886895909905434, 0.050674088299274445, 0.07559315860271454, 0.024584615603089333, 0.24242044985294342, 0.01869686134159565, 0.1059381514787674, 0.09392532706260681, -0.0005722623900510371, 0.1032102182507515, -0.0000698045696481131, 0.16483785212039948, 0.30651870369911194, 0.05322562903165817, 0.04652895778417587, -0.1796870231628418, 0.04485984519124031, -0.07644287496805191, 0.23071157932281494, -0.010225660167634487, 0.13189786672592163, -0.030070019885897636, -0.15339039266109467, 0.22949658334255219, 0.07940724492073059, -0.07184083759784698, -0.11566989868879318, -0.06275413930416107, 0.09284697473049164, -0.08773455768823624, 0.01711280830204487, -0.1904190480709076, 0.08440149575471878, 0.0728328749537468, -0.11676932126283646, 0.0729944109916687, 0.12400185316801071, 0.1392889767885208, -0.0008042437257245183, 0.035720936954021454, 0.0990055650472641, -0.008065198548138142, -0.02032429538667202, -0.2024221569299698, 0.060823630541563034, 0.14428411424160004, -0.02333509363234043, -0.07065548002719879, -0.006234032567590475, -0.07163633406162262, -0.010499132797122002, -0.0037720827385783195, 0.02326374687254429, 0.01743183843791485, -0.06689618527889252, 0.08470468968153, 0.021132992580533028, 0.10388660430908203, -0.04068516567349434, 0.004329397343099117, 0.004037759266793728, -0.04008902981877327, -0.1275322437286377, -0.05774558708071709, -0.11927749216556549, -0.01780131831765175, 0.008825624361634254, 0.011992029845714569, 0.0856163427233696, 0.28599631786346436, -0.026362493634223938, 0.028304997831583023, -0.06391766667366028, 0.03211617469787598, 0.06410399824380875, -0.023727301508188248, 0.1008630096912384, 0.07542063295841217, -0.167007714509964, -0.09672516584396362, 0.0017873803153634071, 0.10851936042308807, 0.04986118897795677, 0.1570122241973877, -0.13253872096538544, -0.054620981216430664, -0.08481867611408234, -0.16729064285755157, 0.09794694185256958, 0.02822626382112503, 0.08001485466957092, 0.03225839510560036, 0.0006444830214604735, -2.4661383650096e-32, -0.023531252518296242, -0.0024453706573694944, 0.04239249601960182, -0.07755016535520554, -0.06799089908599854, 0.12188991904258728, 0.008255896158516407, 0.0379183366894722, -0.06843317300081253, -0.23798564076423645, -0.1167001873254776, -0.11817440390586853, -0.05235022306442261, 0.02293698489665985, 0.04192851111292839, 0.04238135740160942, -0.14668522775173187, 0.06307002902030945, -0.0014715052675455809, 0.005835856311023235, 0.14782926440238953, 0.04244507849216461, 0.15046873688697815, 0.023238003253936768, -0.16285546123981476, -0.04045103117823601, -0.1511775255203247, -0.05897289887070656, 0.0463092103600502, -0.026505935937166214, 0.07163097709417343, 0.04602626711130142, -0.0015318061923608184, -0.001772055635228753, -0.035729289054870605, -0.06224965304136276, -0.09506113827228546, -0.19710727035999298, -0.14025036990642548, -0.04185033589601517, 0.061459723860025406, 0.10009170323610306, -0.013589762151241302, -0.2076069712638855, 0.18049277365207672, 0.017634881660342216, -0.05592114105820656, -0.0017409645952284336, 0.020169401541352272, -0.041663121432065964, -0.034238461405038834, 0.14164279401302338, 0.08943162113428116, 0.07597615569829941, 0.06445762515068054, 0.038761574774980545, 0.03551539406180382, 0.05348654463887215, -0.1677568107843399, 0.10178683698177338, 0.17052753269672394, -0.0664963573217392, 0.09405576437711716, 0.013379721902310848, 0.09450023621320724, 0.05757814645767212, 0.43155089020729065, 0.010022078640758991, 0.10008252412080765, -0.1664130985736847, 0.0887356773018837, 0.1110445186495781, -0.1432003676891327, 0.10462203621864319, -0.00301190628670156, -0.134298637509346, -0.20477885007858276, -0.015613486059010029, 0.09269782900810242, -0.13873882591724396, -0.05462249368429184, -0.10198622196912766, -0.014160651713609695, 0.054448921233415604, -0.1493961066007614, 0.05703166499733925, -0.08085176348686218, 0.054916974157094955, -0.12073300033807755, 0.07766138762235641, -0.025285735726356506, 0.1298273205757141, -0.0072730714455246925, -0.027965176850557327, -0.1030375137925148, 0.18205930292606354, 0.023761112242937088, 0.006043838337063789, -0.13376544415950775, 0.07541872560977936, -0.08068149536848068, -0.14298732578754425, 0.11645632982254028, 0.12269507348537445, 0.027381086722016335, -0.03698979318141937, 0.042061951011419296, -0.00645223306491971, -0.10834231972694397, -0.05215752497315407, 0.029630258679389954, -0.08699691295623779, 0.1096394956111908, 0.021724101155996323, 0.11426714062690735, 0.14179953932762146, -0.143450066447258, -0.11080926656723022, 0.20995253324508667, 0.056076694279909134, -0.17074550688266754, -0.01720334030687809, -0.21849936246871948, 0.05477406084537506, 0.04936777427792549, 0.037067268043756485, -0.09061591327190399, -0.09423814713954926, 0.1472095102071762, 0.08315904438495636, 0.028113629668951035, -0.15304389595985413, 7.689602625760017e-7, -0.08786877989768982, 0.13908860087394714, -0.03954349458217621, -0.04994336515665054, -0.142067551612854, -0.004884395748376846, -0.15942393243312836, -0.015307103283703327, -0.10509748756885529, 0.1491449773311615, 0.15565139055252075, -0.003534049028530717, -0.19863200187683105, -0.01945236138999462, 0.13581864535808563, 0.043996233493089676, 0.05179164558649063, 0.14601585268974304, -0.02634785883128643, 0.10992515832185745, 0.10882972180843353, 0.1663459837436676, 0.13448691368103027, -0.18089227378368378, -0.04599232226610184, 0.011741233989596367, -0.0499376580119133, -0.016361024230718613, 0.12298386543989182, 0.07583993673324585, -0.06647255271673203, -0.05229184776544571, 0.052786439657211304, 0.07293283939361572, 0.03851033374667168, -0.051571398973464966, -0.1065702736377716, -0.012476521544158459, 0.012030577287077904, -0.022503908723592758, 0.13893096148967743, 0.04304167628288269, -0.14590729773044586, 0.04065973311662674, 0.026076411828398705, -0.020340729504823685, -0.003931893035769463, -0.045344892889261246, -0.1044577956199646, 0.1208578497171402, 0.0863952487707138, 0.12983205914497375, 0.2162046730518341, 0.13482671976089478, -0.19036264717578888, -0.03255920112133026, 0.04905874654650688, 0.00833309255540371, 0.2169654816389084, -0.0029895079787820578, -0.10926354676485062, -0.03706050291657448, -0.10248687863349915, -0.08592399954795837, 0.14612290263175964, -0.14746885001659393, -0.05694865807890892, 1.4999537505232784e-34, 0.011675902642309666, 0.0021000143606215715, -0.012554357759654522, -0.15678799152374268, -0.06384442001581192, -0.010129998438060284, 0.12928760051727295, 0.050575271248817444, 0.0035700779408216476, -0.07539393752813339, 0.026135632768273354 ]
https://github.com/huggingface/datasets/issues/6273
Broken Link to PubMed Abstracts dataset .
@lhoestq @albertvillanova @lewtun I don't think we are allowed to host these data files on the Hub (due to DMCA), which means the only option is to use a different dataset in the course (and to re-record the video πŸ™‚), no?
### Describe the bug The link provided for the dataset is broken, data_files = [https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url) The ### Steps to reproduce the bug Steps to reproduce: 1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url) 2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link. ### Expected behavior The link should Redirect to the "PubMed Abstracts dataset" as expected . ### Environment info .
41
Broken Link to PubMed Abstracts dataset . ### Describe the bug The link provided for the dataset is broken, data_files = [https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url) The ### Steps to reproduce the bug Steps to reproduce: 1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url) 2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link. ### Expected behavior The link should Redirect to the "PubMed Abstracts dataset" as expected . ### Environment info . @lhoestq @albertvillanova @lewtun I don't think we are allowed to host these data files on the Hub (due to DMCA), which means the only option is to use a different dataset in the course (and to re-record the video πŸ™‚), no?
[ 0.18884272873401642, 0.17499004304409027, -0.021518025547266006, -0.023657958954572678, 0.14042437076568604, 0.12548667192459106, 0.07252739369869232, -0.03304063528776169, -0.008498876355588436, 0.1071895882487297, -0.018692346289753914, 0.0996725782752037, 0.034404318779706955, 0.11051946133375168, 0.14633683860301971, 0.0128150200471282, 0.009446194395422935, -0.009161352179944515, 0.06841442734003067, -0.022587398067116737, 0.008663296699523926, 0.12066228687763214, -0.014975378289818764, -0.055278994143009186, 0.09616465866565704, 0.1243392825126648, -0.158767968416214, -0.09985608607530594, 0.026755670085549355, -0.1940617561340332, 0.05694558098912239, 0.03489549085497856, -0.04505954682826996, 0.06551618129014969, 0.000005951440925855422, -0.10609368979930878, 0.017564257606863976, 0.10164189338684082, -0.003008044557645917, -0.036533817648887634, 0.05253148451447487, -0.003965361509472132, -0.12722116708755493, -0.08679447323083878, 0.019850552082061768, -0.1193908229470253, 0.012157700024545193, 0.12295219302177429, 0.0005120884161442518, 0.040090836584568024, 0.048654161393642426, 0.12479889392852783, 0.2057064324617386, -0.15671810507774353, -0.03947697579860687, 0.12072187662124634, 0.09799452126026154, 0.10779912024736404, -0.1010507196187973, 0.04695451259613037, -0.0016713301884010434, 0.0030203911010175943, 0.06682567298412323, 0.09147001057863235, -0.05279770866036415, 0.0026720399037003517, -0.11253316700458527, -0.12096113711595535, 0.003165490459650755, 0.20379289984703064, 0.12238757312297821, 0.015963057056069374, -0.02877083420753479, 0.09682779759168625, -0.0381106398999691, 0.004510583821684122, 0.03447504714131355, 0.12434850633144379, 0.06870570778846741, 0.07807449251413345, -0.04486178234219551, -0.05867782235145569, 0.06936022639274597, 0.13111405074596405, 0.10069381445646286, -0.10159403830766678, -0.19133970141410828, -0.12133873999118805, 0.005679681897163391, -0.07477620989084244, 0.13299870491027832, 0.05204368755221367, 0.060083840042352676, -0.0923047587275505, 0.17445026338100433, 0.01079359371215105, -0.06822679936885834, -0.09173974394798279, 0.18859797716140747, -0.09201391041278839, -0.06868545711040497, -0.06972743570804596, -0.05609125271439552, -0.17928484082221985, 0.11426158994436264, -0.14348949491977692, 0.016502439975738525, -0.0002319513587281108, 0.2667435109615326, 0.21371160447597504, 0.1913362294435501, -0.001635197433643043, 0.03238394856452942, -0.000738434144295752, 0.03960574045777321, 0.014475005678832531, -0.036668360233306885, -0.11819523572921753, 0.07456555962562561, 0.26337599754333496, 0.016632933169603348, 0.15614844858646393, -0.2761562466621399, 0.1313067525625229, -0.06748021394014359, 0.10445832461118698, 0.09209414571523666, -0.0009340678225271404, -0.0012131299590691924, -0.0513317734003067, 0.002669466193765402, -0.06691162288188934, -0.2363172173500061, 0.09139195084571838, 0.1968633532524109, 0.014505411498248577, -0.0004261527501512319, -0.09010204672813416, 0.1168028712272644, -0.11841435730457306, -0.06501356512308121, -0.0452854186296463, -0.08260486274957657, 0.005887210369110107, 0.23272864520549774, 0.03066125698387623, 0.05225472152233124, 0.026383496820926666, 0.06151663139462471, 0.02919626794755459, -0.3705540597438812, 0.17224633693695068, -0.1701056808233261, -0.1833641529083252, -0.08914967626333237, 0.010067353956401348, -0.010603585280478, -0.10453908890485764, -0.15447884798049927, -0.10145772993564606, -0.03475188836455345, 0.08388067036867142, 0.1068963035941124, -0.17055797576904297, 0.21389923989772797, -0.06157049536705017, 0.17491090297698975, 0.03527101129293442, -0.10713964700698853, 0.1334504932165146, 0.05422860383987427, 0.136411651968956, -0.11666841804981232, -0.0962241068482399, -0.1985846310853958, 0.13225725293159485, -0.01823798380792141, 0.03153768181800842, -0.1946304440498352, -0.09705300629138947, 0.05190787464380264, -0.1495964080095291, -0.24920102953910828, -0.12510442733764648, 0.04136255756020546, -0.012093611061573029, -0.08252158015966415, 0.058129142969846725, 0.10944647341966629, -0.011736185289919376, -0.06662612408399582, 0.04563266411423683, -0.12484820932149887, -0.07005475461483002, 0.1104535460472107, -0.10422145575284958, -0.0014277289155870676, 0.07233783602714539, 0.1049642413854599, 0.09704603254795074, 0.022850308567285538, 0.0029316816944628954, -0.0147977564483881, 0.02826821431517601, 0.11323443055152893, 0.051572270691394806, -0.12608851492404938, -0.06494107842445374, 0.0011615020921453834, 0.004925081040710211, -0.1916937232017517, -0.05050903186202049, -0.08875709027051926, 0.025717608630657196, -0.048550575971603394, -0.009198436513543129, 0.0017595170065760612, -0.08815687149763107, -0.1480286419391632, 0.22590333223342896, -0.054642483592033386, -0.05701941251754761, 0.03867650032043457, -0.02877579815685749, -0.12134254723787308, 0.08453013747930527, -0.1898113191127777, -0.040431514382362366, 0.10118623077869415, -0.03625360503792763, -0.07399303466081619, 0.024379238486289978, 0.2356692999601364, 0.15869636833667755, -0.0529329888522625, 0.19731396436691284, 0.011913775466382504, -0.17031127214431763, 0.22213782370090485, -0.2128610908985138, -0.0577876977622509, 0.14724819362163544, -0.07232435792684555, 0.08132048696279526, 0.21036432683467865, -0.04772672429680824, -0.15224914252758026, 0.0424429252743721, -0.0033116526901721954, 0.1755521595478058, 0.1589696705341339, 0.04058481752872467, -0.16495993733406067, -0.04183914139866829, 0.035954032093286514, 0.16490067541599274, -0.14644618332386017, -0.09760846197605133, -0.13187123835086823, 0.012194115668535233, 0.23108936846256256, -0.059862229973077774, 0.08096365630626678, -0.03220612183213234, -0.04143816977739334, -0.016350753605365753, -0.06714768707752228, 0.07340613007545471, -0.07303445786237717, 0.09478374570608139, 0.04558361694216728, 0.05633910745382309, -0.15171512961387634, -0.12128717452287674, -0.04351949691772461, 0.004925368819385767, -0.1701299399137497, 0.07329397648572922, 0.010792764835059643, -0.06766903400421143, -0.10676770657300949, 0.1398594230413437, -0.0964529886841774, -0.014787774533033371, 0.03955628350377083, 0.009740181267261505, -0.18063153326511383, -0.033010564744472504, -0.16746442019939423, 0.057329799979925156, 0.02584325708448887, -0.008055447600781918, -0.1318264901638031, 0.015252668410539627, -0.13420386612415314, -0.06914586573839188, -0.11779611557722092, 0.08305814117193222, -0.16646608710289001, 0.14718428254127502, 0.03093460202217102, 0.04946928098797798, -0.026340555399656296, -0.0459807850420475, -0.017908988520503044, 0.07701487839221954, 0.050672855228185654, 0.06667689234018326, -0.08432876318693161, -0.22180256247520447, -0.017754031345248222, 0.03279292955994606, 0.2206147164106369, 0.04405802860856056, -0.037184204906225204, -0.09982148557901382, -0.011838720180094242, -0.09421734511852264, 0.05853217840194702, -0.0014378103660419583, 0.1775999814271927, 0.07166732847690582, -0.1769929975271225, -0.004877668805420399, 0.024632900953292847, -0.0829324945807457, -0.1686127930879593, 0.05604802817106247, -0.09729475528001785, 0.005062464624643326, -0.012764967046678066, 0.039600223302841187, 0.043592166155576706, -0.18400417268276215, 0.04126562923192978, -0.17739541828632355, -0.01638633757829666, -0.1177048310637474, 0.2229348123073578, 0.018340636044740677, -0.1286555379629135, -0.022887608036398888, 0.029439283534884453, 0.009289462119340897, 0.017627259716391563, -0.10459838807582855, 0.017593445256352425, 0.02595861256122589, -0.0914362221956253, -0.1141442060470581, 0.08784227818250656, -0.054247401654720306, 0.03671034798026085, -0.14882856607437134, 0.09207155555486679, -0.012919189408421516, 0.004296475555747747, 0.06440987437963486, 0.06658400595188141, 0.10660829395055771, 0.03817707672715187, 0.21029077470302582, 0.11193245649337769, 0.0028657945804297924, -0.11695070564746857, 0.1044289693236351, 0.036162324249744415, 0.12235137820243835, 0.0441177599132061, -0.046327777206897736, -0.046185724437236786, -0.019874757155776024, 0.0595533549785614, 0.07157377153635025, 0.056404516100883484, -0.020501792430877686, -0.05530450493097305, -0.02660345658659935, -0.03148052096366882, -0.20483727753162384, -0.012044791132211685, -0.12095363438129425, 0.00136618094984442, 0.1090063750743866, 0.016687264665961266, 0.00023365496599581093, -0.04241582006216049, 0.08008190244436264, -0.08040262758731842, 0.07470443844795227, 0.02873286046087742, -0.059005290269851685, -0.17826084792613983, -0.06352643668651581, 0.053298477083444595, -0.12026055157184601, 0.2677442729473114, 0.059986330568790436, 0.07294738292694092, 0.08184514194726944, 0.05389555171132088, 0.12716907262802124, -0.13207188248634338, 0.14176806807518005, 0.032028380781412125, 0.30907583236694336, -0.011491985060274601, -0.023953933268785477, 0.042931828647851944, 0.0018292638706043363, 0.1390283703804016, -0.06260374933481216, -0.031179605051875114, 0.03896397724747658, 0.22000887989997864, -0.20846246182918549, 0.10740215331315994, 0.03451281040906906, 0.017124654725193977, -0.20373523235321045, -0.07615209370851517, -0.2091532051563263, 0.22657881677150726, -0.07161315530538559, 0.05866658687591553, -0.135255828499794, 0.06346847862005234, -0.1433785855770111, 0.0833808183670044, -0.24269461631774902, 0.13453559577465057, 0.04661354050040245, 0.011170141398906708, 0.0786336362361908, 0.10571043193340302, -0.03956121951341629, 0.1422824263572693, -0.09538572281599045, -0.1273648589849472, 0.06174945831298828, -0.1498204916715622, -0.03268571197986603, 0.10802905261516571, -0.19135892391204834, -0.18400703370571136, 0.06094064936041832, -0.020519765093922615, -0.07975415140390396, 0.07219196856021881, -0.018064072355628014, -0.04178387671709061, -0.2043389081954956, 0.05291954427957535, -0.007784863002598286, 0.057218488305807114, 0.014430752955377102, 0.2345595508813858, -0.0583525151014328, 0.0014521008124575019, -0.03251469135284424, -0.10703598707914352, -0.0590674951672554, -0.011080600321292877, -0.0810576006770134, 0.08478423953056335, 0.022029176354408264, 0.23455876111984253, -0.22829017043113708, 0.09756062924861908, 0.0521826446056366, -0.030904360115528107, -0.02351621352136135, -0.09471680223941803, 0.010595613159239292, 0.03779244422912598, 0.08116095513105392, 0.0399923101067543, 0.006836414337158203, 0.02899005264043808, -0.03659699484705925, 0.11109240353107452, 0.17182014882564545, -0.05900280177593231, -0.022042477503418922, -0.06900282204151154, 0.002382892882451415, 0.03311373293399811, -0.039846234023571014, -0.08817679435014725, -0.07490094751119614, 0.14878860116004944, 0.048122331500053406, 0.15176555514335632, 0.1833566427230835, 0.05949530377984047, -0.08266551792621613, -0.10129088163375854, -0.055888738483190536, 0.0977667048573494, -0.06163249909877777, 0.20344758033752441, -0.0391959547996521, 0.16235889494419098, -0.17256885766983032, -0.1540871113538742, -0.03266596049070358, 0.07940210402011871, -0.13183638453483582, 0.08041179180145264, -0.19428402185440063, -0.0014230124652385712, 0.12373831868171692, -0.09125572443008423, -0.07264504581689835, 0.026482565328478813, 0.004843762144446373, 0.01165161095559597, 0.0007522382074967027, 0.027993502095341682, 0.059844739735126495, -0.054036516696214676, -0.04568551853299141, 0.037588853389024734, 0.07846792042255402, 0.015757853165268898, 0.15316487848758698, 0.0032419669441878796, 0.03223533555865288, 0.22572079300880432, -0.012264770455658436, 0.03957086428999901, 0.16759365797042847, 0.18532662093639374, -0.16847480833530426, 0.035589415580034256, 0.08962953090667725, -0.00008901199180399999, -0.09591809660196304, 0.012527135200798512, -0.019909974187612534, 0.021410301327705383, -0.1962626427412033, -0.10659525543451309, 0.03362644091248512, 0.14137598872184753, 0.03038221225142479, -0.0921168401837349, 0.13035093247890472, -0.0007204925059340894, -0.12276586890220642, 0.1625727415084839, 0.15777228772640228, 0.012664934620261192, -0.07336907088756561, -0.20165689289569855, -2.3751336494840525e-32, 0.027513902634382248, 0.1301773190498352, -0.08463602513074875, -0.06905803084373474, -0.19588908553123474, 0.12126754969358444, 0.029338130727410316, -0.05303001403808594, -0.166512131690979, -0.02544776163995266, 0.07584767043590546, 0.07180984318256378, -0.03542393445968628, 0.07848595827817917, -0.000009542359293845948, -0.14531388878822327, -0.21325793862342834, -0.21331287920475006, -0.0644022598862648, -0.07356926798820496, 0.024743489921092987, -0.018548838794231415, 0.0322696678340435, -0.1225830614566803, -0.03752557188272476, 0.11990412324666977, -0.12854446470737457, 0.08387119323015213, 0.06515943259000778, 0.07842526584863663, -0.06639008224010468, 0.04239343851804733, -0.04819966107606888, -0.040809135884046555, -0.1520712524652481, -0.06466139853000641, -0.20054231584072113, 0.028886809945106506, -0.07118146866559982, 0.05484773963689804, -0.10399539768695831, 0.11806287616491318, 0.023229006677865982, -0.14845356345176697, 0.06765469908714294, -0.03870841860771179, -0.041925642639398575, 0.05814867466688156, -0.061310600489377975, -0.1300940215587616, 0.007931738160550594, 0.13434654474258423, -0.15168479084968567, 0.06665649265050888, 0.03716237097978592, -0.12569384276866913, 0.006427078042179346, 0.2003600299358368, 0.014173010364174843, -0.08126542717218399, 0.16503575444221497, -0.054429031908512115, 0.10951340943574905, -0.0143744433298707, 0.010486016049981117, 0.1607750803232193, 0.20092816650867462, 0.050092969089746475, -0.04269903525710106, -0.0021609258837997913, 0.01306682825088501, 0.0030739803332835436, 0.07917706668376923, -0.09616303443908691, -0.08326347917318344, 0.11974451690912247, -0.10734584927558899, 0.003016964066773653, -0.03117598593235016, 0.12930914759635925, 0.03779491409659386, 0.12009234726428986, 0.11387445032596588, 0.005765869747847319, -0.09352105855941772, -0.025650739669799805, -0.08767291158437729, 0.01249655894935131, -0.07579634338617325, -0.007193080615252256, 0.014179740101099014, 0.04569855332374573, -0.1857389360666275, -0.04182989150285721, -0.1925874501466751, 0.15043406188488007, -0.0511772520840168, 0.06645116955041885, 0.04970313236117363, -0.11001084744930267, -0.28247392177581787, 0.09710311889648438, 0.11223635077476501, 0.08915826678276062, 0.048279114067554474, -0.10585028678178787, 0.14557108283042908, 0.09447850286960602, -0.0822543352842331, -0.04526471346616745, -0.0509168840944767, 0.04885733127593994, 0.20159289240837097, -0.039871010929346085, 0.056487131863832474, 0.01794748194515705, -0.06455321609973907, -0.009847666136920452, 0.07344323396682739, 0.22130373120307922, -0.03136806562542915, 0.1406712830066681, -0.2782388925552368, -0.058070361614227295, 0.10440327227115631, 0.10404953360557556, -0.1127619668841362, -0.03808732330799103, 0.10525139421224594, -0.15720340609550476, 0.06089862436056137, -0.15409457683563232, 7.808267810105463e-7, -0.05493340641260147, 0.11263952404260635, 0.029712431132793427, -0.009420071728527546, 0.08028024435043335, -0.07754553109407425, -0.16435496509075165, 0.1759546548128128, 0.03606240451335907, 0.05329537391662598, -0.038358427584171295, 0.03967815637588501, 0.0991394892334938, -0.02870085835456848, 0.027675388380885124, -0.03884134069085121, -0.17025581002235413, 0.02161795273423195, -0.036815568804740906, -0.029075155034661293, -0.11524149775505066, 0.11748860776424408, -0.004530876409262419, 0.10136439651250839, 0.05472055450081825, -0.10605227947235107, -0.07681816071271896, -0.050594937056303024, 0.05083168298006058, -0.18722586333751678, -0.10025231540203094, 0.039253175258636475, 0.051346227526664734, -0.07564543187618256, 0.06524967402219772, -0.16494934260845184, -0.25673454999923706, -0.06851664185523987, 0.03650510683655739, 0.15876956284046173, 0.00500172283500433, -0.15859846770763397, 0.06535538285970688, 0.08115499466657639, 0.03538230061531067, -0.0356188528239727, -0.11616659164428711, 0.17081999778747559, -0.10199705511331558, 0.04405736178159714, 0.1357012242078781, 0.053456518799066544, -0.044237565249204636, 0.0789477676153183, -0.16438832879066467, -0.029759684577584267, 0.04076036065816879, -0.05873667821288109, 0.11043518036603928, -0.0755629688501358, 0.09804537892341614, -0.10440051555633545, 0.12302517890930176, -0.11511891335248947, -0.006291715428233147, -0.14517426490783691, -0.07925818860530853, 1.0996345575759404e-34, 0.07618363946676254, 0.013587524183094501, -0.014968202449381351, -0.13679872453212738, 0.08486846834421158, -0.13474217057228088, 0.15356780588626862, 0.04399770125746727, -0.06416219472885132, -0.13136760890483856, 0.03925706818699837 ]
https://github.com/huggingface/datasets/issues/6273
Broken Link to PubMed Abstracts dataset .
Keeping the video is maybe fine, we can add a note on youtube to suggest to load a dataset with a different name. Maybe C4 ? And update the code snippets on the website ?
### Describe the bug The link provided for the dataset is broken, data_files = [https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url) The ### Steps to reproduce the bug Steps to reproduce: 1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url) 2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link. ### Expected behavior The link should Redirect to the "PubMed Abstracts dataset" as expected . ### Environment info .
35
Broken Link to PubMed Abstracts dataset . ### Describe the bug The link provided for the dataset is broken, data_files = [https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url) The ### Steps to reproduce the bug Steps to reproduce: 1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url) 2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link. ### Expected behavior The link should Redirect to the "PubMed Abstracts dataset" as expected . ### Environment info . Keeping the video is maybe fine, we can add a note on youtube to suggest to load a dataset with a different name. Maybe C4 ? And update the code snippets on the website ?
[ 0.19639399647712708, 0.1881607621908188, -0.02008688822388649, -0.026863332837820053, 0.15986020863056183, 0.12936240434646606, 0.08565706014633179, -0.004778227303177118, -0.05633631721138954, 0.1039680764079094, 0.02030857466161251, 0.0756056159734726, 0.04936177656054497, 0.11519506573677063, 0.1615239530801773, -0.013030031695961952, -0.014240715652704239, -0.005963209085166454, 0.06792765855789185, 0.0018319254741072655, 0.011389683932065964, 0.08986449986696243, -0.025740189477801323, -0.040234293788671494, 0.1493251770734787, 0.12541568279266357, -0.1498064398765564, -0.11960788071155548, 0.06470820307731628, -0.21739231050014496, 0.055392708629369736, 0.03230435773730278, -0.0708942860364914, 0.11545670032501221, 0.000006126471362222219, -0.12999631464481354, 0.04902096092700958, 0.09971467405557632, -0.04715998098254204, -0.027983728796243668, 0.051118362694978714, -0.03923622891306877, -0.1177542433142662, -0.06732720136642456, 0.025071127340197563, -0.1730341613292694, 0.034807320684194565, 0.10438107699155807, -0.033271051943302155, 0.05095910653471947, 0.06818493455648422, 0.09757143259048462, 0.18519480526447296, -0.16183651983737946, 0.005591478198766708, 0.0735432580113411, 0.11609720438718796, 0.0627840906381607, -0.0951080322265625, 0.03725823387503624, -0.006258032750338316, -0.0058572725392878056, 0.06597963720560074, 0.07688171416521072, -0.08347005397081375, -0.030464179813861847, -0.1230931356549263, -0.1168055310845375, 0.012089095078408718, 0.19520312547683716, 0.16789783537387848, 0.01320383045822382, -0.023924587294459343, 0.12517008185386658, -0.0664241760969162, -0.016536705195903778, 0.049120377749204636, 0.14699193835258484, 0.040518440306186676, 0.036277756094932556, -0.06912263482809067, -0.013895250856876373, 0.08411330729722977, 0.15103814005851746, 0.0880594253540039, -0.10260365903377533, -0.2249099761247635, -0.10021965950727463, 0.04742453992366791, -0.07973421365022659, 0.11746666580438614, 0.0888863205909729, 0.03722201660275459, -0.07714106142520905, 0.15682657063007355, 0.025005804374814034, -0.07881941646337509, -0.07005660235881805, 0.144052192568779, -0.09944585710763931, -0.042096782475709915, -0.10116724669933319, -0.04295772314071655, -0.1965171992778778, 0.14104972779750824, -0.14370903372764587, 0.029272088780999184, -0.05446629971265793, 0.23345986008644104, 0.20356416702270508, 0.1688644140958786, 0.033917203545570374, 0.01278376393020153, -0.06303470581769943, 0.07209863513708115, 0.0015467730117961764, -0.05104061961174011, -0.07752853631973267, 0.05891692265868187, 0.24174509942531586, 0.013434777967631817, 0.11172275990247726, -0.24768254160881042, 0.12838232517242432, -0.05364708974957466, 0.10299473255872726, 0.12648123502731323, 0.0014536718372255564, 0.012104514054954052, -0.09292543679475784, -0.01005470473319292, -0.03913910314440727, -0.2188461273908615, 0.10127384215593338, 0.17209267616271973, -0.006152127403765917, 0.01118411123752594, -0.1049952432513237, 0.08149153739213943, -0.09206459671258926, -0.08411050587892532, -0.0600791871547699, -0.08157835155725479, -0.013762559741735458, 0.2297915816307068, 0.02343088760972023, 0.0717412605881691, 0.02574513666331768, 0.063009113073349, 0.008606676943600178, -0.333072304725647, 0.23967117071151733, -0.21717047691345215, -0.15956741571426392, -0.05590127035975456, 0.023498717695474625, 0.008925097994506359, -0.10395590215921402, -0.1484050452709198, -0.1247313842177391, -0.018571535125374794, 0.07534085214138031, 0.1399560421705246, -0.1765497475862503, 0.19820579886436462, -0.031160425394773483, 0.1350916624069214, 0.021269459277391434, -0.12541772425174713, 0.11541058868169785, 0.06759718805551529, 0.08066936582326889, -0.1177840381860733, -0.05853744596242905, -0.19234202802181244, 0.07934905588626862, -0.05422581732273102, 0.07849454879760742, -0.1975836604833603, -0.06865593045949936, 0.06788434088230133, -0.16130979359149933, -0.23153291642665863, -0.11582961678504944, 0.017120296135544777, -0.005846710875630379, -0.09494656324386597, 0.032329875975847244, 0.09010059386491776, -0.017860937863588333, -0.06080777570605278, 0.044437818229198456, -0.08727339655160904, -0.07156854122877121, 0.1365112066268921, -0.10186462849378586, 0.009062099270522594, 0.020585399121046066, 0.1162920668721199, 0.06391668319702148, -0.01897890493273735, 0.027354847639799118, -0.009928748942911625, 0.0026309953536838293, 0.07530083507299423, 0.07353638112545013, -0.16901685297489166, -0.04459771886467934, 0.04525420814752579, 0.00542271975427866, -0.13935571908950806, -0.0596868172287941, -0.08954252302646637, 0.042468421161174774, -0.046852074563503265, 0.0056418911553919315, -0.017523281276226044, -0.0584644079208374, -0.14606870710849762, 0.20822714269161224, -0.06545313447713852, -0.06194716691970825, 0.058949727565050125, -0.05188973993062973, -0.08735993504524231, 0.0987267941236496, -0.1694018840789795, -0.029182497411966324, 0.09380751848220825, -0.03376100957393646, -0.07212647795677185, 0.024325409904122353, 0.2388613224029541, 0.14920508861541748, -0.01889152079820633, 0.164712592959404, 0.03658610209822655, -0.1857791244983673, 0.20382530987262726, -0.20194083452224731, -0.08383821696043015, 0.16513147950172424, -0.1144208088517189, 0.036458197981119156, 0.24120737612247467, -0.05191075801849365, -0.12272818386554718, 0.042551543563604355, 0.022390779107809067, 0.18467164039611816, 0.15500879287719727, 0.014430379495024681, -0.1567990481853485, -0.0304486695677042, 0.030447611585259438, 0.07961089164018631, -0.08384683728218079, -0.12955163419246674, -0.15136560797691345, -0.007032537832856178, 0.2312782257795334, -0.06306524574756622, 0.05147630348801613, -0.02596176229417324, -0.048344891518354416, -0.003510236507281661, -0.05410454422235489, 0.05001291260123253, -0.057679031044244766, 0.13568520545959473, 0.024323957040905952, 0.021546024829149246, -0.12535956501960754, -0.11400693655014038, -0.025438660755753517, 0.04714568331837654, -0.146058589220047, 0.05939287692308426, 0.014407062903046608, -0.0739801898598671, -0.09406287223100662, 0.17385676503181458, -0.0841510072350502, -0.028412990272045135, 0.06387177854776382, 0.0024121408350765705, -0.2023167610168457, -0.05063151568174362, -0.22904829680919647, 0.07384385913610458, 0.008583828806877136, 0.005507847759872675, -0.14854107797145844, -0.017747316509485245, -0.1498851627111435, -0.04292822256684303, -0.13012096285820007, 0.06485352665185928, -0.16271185874938965, 0.10476145148277283, 0.016450000926852226, 0.07111860066652298, 0.030725667253136635, -0.04572464898228645, -0.015627453103661537, 0.007861845195293427, 0.06646368652582169, 0.07534339278936386, -0.13605362176895142, -0.21862363815307617, -0.04591535031795502, 0.038019001483917236, 0.19361156225204468, 0.05207924172282219, -0.03144792839884758, -0.06715127825737, -0.008142814040184021, -0.10761073976755142, 0.0313827246427536, 0.022359676659107208, 0.14046074450016022, 0.07819118350744247, -0.1806623935699463, 0.006180356256663799, 0.02167377807199955, -0.07701341062784195, -0.18451039493083954, 0.08052980154752731, -0.07207929342985153, 0.0352332703769207, -0.017553972080349922, 0.08848483860492706, 0.04987677186727524, -0.18194285035133362, 0.05964863672852516, -0.1739501953125, -0.020960703492164612, -0.08814900368452072, 0.20305192470550537, 0.02310881018638611, -0.11145931482315063, -0.030111044645309448, 0.04481080174446106, 0.02844356559216976, 0.040825437754392624, -0.11668441444635391, 0.055288203060626984, 0.005465890746563673, -0.09746987372636795, -0.09643203020095825, 0.09818841516971588, -0.009963157586753368, 0.019831068813800812, -0.15118427574634552, 0.0772651880979538, -0.03832989186048508, 0.034744564443826675, 0.042664363980293274, 0.08270667493343353, 0.09359835833311081, 0.08519721031188965, 0.16582940518856049, 0.13359160721302032, -0.012927505187690258, -0.1690213829278946, 0.09205789119005203, 0.018265794962644577, 0.1095924973487854, 0.0357486791908741, -0.0370369516313076, -0.0749971941113472, -0.03319356590509415, 0.0459790900349617, 0.09421773254871368, 0.042764659970998764, -0.06587149202823639, -0.06230977550148964, -0.02824036218225956, -0.04587128013372421, -0.16418898105621338, 0.002041271422058344, -0.09706640243530273, 0.027974022552371025, 0.1065756231546402, 0.020859329029917717, 0.057537030428647995, -0.0418156199157238, 0.0678035169839859, -0.09309542924165726, 0.09537682682275772, 0.017215924337506294, -0.0685926303267479, -0.1383381187915802, -0.05253327637910843, 0.05789642035961151, -0.1459938883781433, 0.2631956934928894, 0.08717221021652222, 0.00047484529204666615, 0.06892121583223343, 0.07883109897375107, 0.09265335649251938, -0.13700079917907715, 0.15489168465137482, 0.04231128469109535, 0.2803807854652405, 0.051345791667699814, -0.034348394721746445, 0.037601735442876816, -0.018547946587204933, 0.20855754613876343, -0.08893238753080368, -0.021653151139616966, 0.032097842544317245, 0.25501787662506104, -0.15559759736061096, 0.12090807408094406, 0.03237336501479149, -0.006976864766329527, -0.19060689210891724, -0.03966452181339264, -0.17061284184455872, 0.16556602716445923, -0.07369137555360794, 0.054416704922914505, -0.11126753687858582, 0.06306256353855133, -0.17313601076602936, 0.07753204554319382, -0.2267899066209793, 0.12883728742599487, 0.03777502849698067, 0.04324467107653618, 0.07418502867221832, 0.08970988541841507, -0.030676057562232018, 0.1372055560350418, -0.1136058121919632, -0.1292240172624588, 0.06939242035150528, -0.1539175808429718, -0.006577642634510994, 0.08815465867519379, -0.20658889412879944, -0.18977530300617218, 0.06179273501038551, 0.005075536668300629, -0.08461587131023407, 0.08382401615381241, 0.006569643504917622, -0.048335544764995575, -0.22071152925491333, 0.01082679070532322, 0.021127447485923767, 0.031080832704901695, 0.00646972144022584, 0.2367476522922516, -0.033063940703868866, 0.012252233922481537, -0.051214560866355896, -0.10494684427976608, -0.048207107931375504, 0.0006051260861568153, -0.09269116818904877, 0.11795836687088013, -0.005779472645372152, 0.16807590425014496, -0.1896752566099167, 0.10338608175516129, 0.020427139475941658, 0.022069502621889114, -0.013208410702645779, -0.07028651237487793, 0.03776027634739876, 0.0633867159485817, 0.02337682619690895, 0.055287186056375504, -0.01756659895181656, 0.005027433391660452, -0.0543895922601223, 0.07775980979204178, 0.21778304874897003, -0.06035579741001129, -0.03948487341403961, -0.04997676983475685, -0.008365933783352375, 0.03592027723789215, -0.03893326595425606, -0.08371346443891525, -0.04869462549686432, 0.1585180014371872, 0.08516719192266464, 0.18315474689006805, 0.13936953246593475, 0.06894000619649887, -0.0688730925321579, -0.1444285362958908, -0.02824229560792446, 0.04565032944083214, -0.0592457614839077, 0.2036551982164383, -0.017423376441001892, 0.18265128135681152, -0.142292782664299, -0.13135382533073425, -0.04782799631357193, 0.08322378247976303, -0.07989532500505447, 0.09427833557128906, -0.16962113976478577, 0.01023599412292242, 0.134932279586792, -0.07999435067176819, -0.08244352787733078, 0.06800326704978943, -0.03732958063483238, 0.04103242605924606, -0.0061816200613975525, 0.07488548755645752, 0.08094339817762375, -0.05800505727529526, -0.042454201728105545, 0.021962318569421768, 0.07579674571752548, -0.030157513916492462, 0.15379543602466583, -0.009318331256508827, 0.029956718906760216, 0.22856876254081726, 0.0025505172088742256, 0.04243381693959236, 0.15787222981452942, 0.20110438764095306, -0.14405979216098785, 0.015630098059773445, 0.07461845129728317, 0.00015737503417767584, -0.06117546558380127, -0.005862017627805471, -0.05476443096995354, 0.03516622632741928, -0.20680741965770721, -0.07823983579874039, 0.013344909064471722, 0.1372099369764328, 0.043696481734514236, -0.02919815666973591, 0.13534636795520782, -0.011107751168310642, -0.12233064323663712, 0.13942505419254303, 0.1123078316450119, 0.02058723196387291, -0.06853239983320236, -0.18638132512569427, -2.407833551335227e-32, -0.011850832030177116, 0.15217271447181702, -0.09543532133102417, -0.0037015073467046022, -0.20617830753326416, 0.14324221014976501, -0.009361195378005505, -0.02017790824174881, -0.16251488029956818, -0.03945630416274071, 0.12115564942359924, 0.07732684910297394, -0.036261606961488724, 0.06930694729089737, 0.01772700808942318, -0.14774321019649506, -0.19277715682983398, -0.20914418995380402, -0.04693235084414482, -0.09580276161432266, -0.006529560778290033, -0.03160974755883217, 0.04386584088206291, -0.14379653334617615, -0.008584764786064625, 0.1472654938697815, -0.1472516804933548, 0.058365412056446075, 0.1067105233669281, 0.1217043399810791, -0.0646287053823471, 0.05360418185591698, -0.05973760038614273, -0.020761968567967415, -0.13856114447116852, -0.04292858764529228, -0.19577649235725403, 0.016151659190654755, -0.09317018836736679, 0.03040318563580513, -0.12694774568080902, 0.11085804551839828, -0.0008588679484091699, -0.19071900844573975, 0.052884992212057114, 0.003479297272861004, -0.01881454698741436, 0.016509806737303734, -0.05202009528875351, -0.15616260468959808, -0.00007229467883007601, 0.12616631388664246, -0.13050197064876556, 0.042601536959409714, 0.046024154871702194, -0.12039701640605927, 0.004810837097465992, 0.172623872756958, 0.0014916588552296162, -0.05726834759116173, 0.13945621252059937, -0.014165379106998444, 0.09551911801099777, -0.006387766916304827, 0.02886715903878212, 0.1702520251274109, 0.17918117344379425, 0.03218602389097214, -0.05321934074163437, -0.036148663610219955, 0.008947763592004776, -0.007840712554752827, 0.09466046094894409, -0.10147284716367722, -0.08626730740070343, 0.09598235785961151, -0.0913730189204216, -0.0035362711641937494, 0.010028776712715626, 0.11374325305223465, 0.03257304057478905, 0.08781053870916367, 0.09431006759405136, 0.010246822610497475, -0.07984340935945511, 0.009286084212362766, -0.1030936986207962, 0.013765714131295681, -0.09405440837144852, 0.02470923215150833, 0.052461303770542145, 0.09609875828027725, -0.17004215717315674, -0.030581749975681305, -0.20658716559410095, 0.12160424143075943, -0.05383254960179329, 0.10186024755239487, 0.03797273337841034, -0.11080775409936905, -0.26601338386535645, 0.09378598630428314, 0.07862500846385956, 0.08017086982727051, 0.029616836458444595, -0.12659141421318054, 0.17467765510082245, 0.07919885963201523, -0.09065940231084824, -0.04131797328591347, -0.0541689395904541, 0.038278788328170776, 0.1758880913257599, -0.021298250183463097, 0.08502303063869476, -0.005599332973361015, -0.05549135431647301, -0.00643180450424552, 0.11481563746929169, 0.22099311649799347, -0.05449199676513672, 0.12641103565692902, -0.30987539887428284, -0.0712292268872261, 0.10124710202217102, 0.12563961744308472, -0.13761454820632935, -0.050982337445020676, 0.11203794181346893, -0.11380946636199951, 0.041745927184820175, -0.15003713965415955, 7.867308227105241e-7, -0.05278503894805908, 0.14848238229751587, -0.01679791510105133, 0.0033982659224420786, 0.04206402227282524, -0.1146036833524704, -0.15696793794631958, 0.12873336672782898, 0.01647285558283329, 0.08252574503421783, -0.06149625778198242, 0.03701414540410042, 0.11806689947843552, -0.04873371124267578, 0.05622880533337593, -0.03204778954386711, -0.1527732014656067, 0.014535599388182163, -0.017707372084259987, -0.0015709649305790663, -0.11151079833507538, 0.14788387715816498, 0.0019554859027266502, 0.09280763566493988, 0.0117297088727355, -0.09295602142810822, -0.05686022713780403, -0.10459472239017487, 0.06058504432439804, -0.16868902742862701, -0.1533631980419159, 0.07279951125383377, 0.003941413015127182, -0.05198698118329048, 0.07085046172142029, -0.21277247369289398, -0.2484789490699768, -0.06760694086551666, 0.05216475576162338, 0.1784714311361313, 0.03547852113842964, -0.12139493972063065, 0.06420068442821503, 0.08452977985143661, 0.047900039702653885, -0.02844064123928547, -0.11339524388313293, 0.12963233888149261, -0.1301538199186325, 0.07409541308879852, 0.12404894828796387, 0.0662725418806076, -0.024842040613293648, 0.08835185319185257, -0.162904292345047, -0.03373769298195839, 0.043021488934755325, -0.03879665955901146, 0.12116312980651855, -0.08467719703912735, 0.11646034568548203, -0.10726256668567657, 0.12747210264205933, -0.12069054692983627, 0.011185518465936184, -0.18296152353286743, -0.1032276302576065, 1.419809831381161e-34, 0.08823655545711517, 0.011358031071722507, -0.042564403265714645, -0.1946048140525818, 0.06276994198560715, -0.10415983200073242, 0.13605767488479614, 0.0651884377002716, -0.09899462014436722, -0.14255790412425995, 0.054427728056907654 ]
https://github.com/huggingface/datasets/issues/6272
Duplicate `data_files` when named `<split>/<split>.parquet`
I think it's best to drop duplicates with a `set` (as a temporary fix) and improve the patterns when/if https://github.com/fsspec/filesystem_spec/pull/1382 gets merged. @lhoestq Do you have some other ideas?
e.g. with `u23429/stock_1_minute_ticker` ```ipython In [1]: from datasets import * In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker") Downloading readme: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 627/627 [00:00<00:00, 246kB/s] In [3]: b.config.data_files Out[3]: {NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'], NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'], NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']} ``` This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko
29
Duplicate `data_files` when named `<split>/<split>.parquet` e.g. with `u23429/stock_1_minute_ticker` ```ipython In [1]: from datasets import * In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker") Downloading readme: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 627/627 [00:00<00:00, 246kB/s] In [3]: b.config.data_files Out[3]: {NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'], NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'], NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']} ``` This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko I think it's best to drop duplicates with a `set` (as a temporary fix) and improve the patterns when/if https://github.com/fsspec/filesystem_spec/pull/1382 gets merged. @lhoestq Do you have some other ideas?
[ 0.18385575711727142, -0.04695388302206993, -0.10813008248806, 0.1709885150194168, 0.08261077105998993, 0.11738274246454239, 0.1236359104514122, 0.06868387013673782, -0.1835310161113739, 0.07316076755523682, -0.006323616951704025, 0.006051028613001108, -0.07012715190649033, -0.004866116680204868, 0.08356845378875732, 0.013018960133194923, 0.005809127818793058, 0.12235993891954422, -0.009452525526285172, 0.02033481001853943, -0.12905161082744598, 0.04654514417052269, 0.20164018869400024, -0.06278379261493683, -0.08093675225973129, -0.027060432359576225, -0.06133465841412544, 0.16828520596027374, -0.05293973535299301, -0.17051443457603455, 0.0344298891723156, -0.0319996103644371, -0.04958973452448845, 0.1855328381061554, 0.000005707631316909101, 0.10734392702579498, 0.022253502160310745, -0.10201126337051392, -0.09412285685539246, -0.11800599098205566, -0.007160014472901821, 0.03221727907657623, 0.05543734133243561, -0.055150557309389114, 0.06506078690290451, -0.1370459944009781, -0.1716715395450592, 0.12694133818149567, 0.22200524806976318, 0.09677526354789734, -0.0029435409232974052, -0.0015682870289310813, 0.06639732420444489, -0.02018524706363678, 0.1654019057750702, -0.034672390669584274, -0.10050909966230392, 0.029449887573719025, -0.07723037898540497, 0.00881217047572136, -0.004038888495415449, 0.0873817428946495, 0.15683484077453613, 0.13491912186145782, -0.1850937008857727, 0.07841566205024719, -0.14433714747428894, -0.19722962379455566, 0.04016892984509468, 0.1931391805410385, -0.031225645914673805, -0.05279546603560448, 0.08599859476089478, -0.06404136121273041, 0.015562951564788818, -0.24403546750545502, -0.04043637588620186, 0.25011277198791504, -0.06369011104106903, 0.04449532926082611, -0.008207758888602257, 0.1470034420490265, 0.02433876320719719, -0.027920151129364967, -0.07911599427461624, 0.02713250368833542, -0.10744234174489975, 0.1805770993232727, 0.05880468338727951, -0.03189942240715027, 0.0719744861125946, -0.027510738000273705, -0.12854769825935364, -0.1422196924686432, -0.15108440816402435, 0.00984656997025013, -0.126891627907753, -0.19400863349437714, -0.13274329900741577, 0.027739636600017548, -0.11484654992818832, -0.11882061511278152, -0.07214105129241943, -0.08251114934682846, 0.013579120859503746, -0.12177394330501556, -0.1041112169623375, 0.06754159182310104, -0.022909803315997124, -0.06965126097202301, -0.05670570954680443, 0.039136018604040146, -0.023077717050909996, 0.13526496291160583, 0.06600341200828552, -0.15592078864574432, 0.10416349023580551, 0.15216007828712463, -0.0854891836643219, -0.016373762860894203, -0.05373692139983177, -0.027464069426059723, 0.01249341107904911, 0.06244383007287979, 0.20170937478542328, -0.10375504195690155, -0.058265216648578644, 0.028610054403543472, -0.0958198681473732, -0.16245590150356293, -0.0391869880259037, 0.12923145294189453, 0.07715494185686111, 0.10632815212011337, -0.0981115847826004, -0.15275360643863678, 0.08249369263648987, -0.0018659227062016726, -0.07534372061491013, -0.21937543153762817, 0.028879737481474876, -0.06265802681446075, -0.14877940714359283, -0.009306981228291988, -0.09609661996364594, 0.09352491796016693, 0.08092033118009567, -0.06010765954852104, -0.012461049482226372, -0.02119356393814087, -0.21190741658210754, 0.08679944276809692, -0.13209012150764465, 0.18049611151218414, 0.04685252532362938, 0.15369033813476562, -0.03831181675195694, -0.04374261200428009, -0.19301371276378632, -0.019301537424325943, -0.008527244441211224, 0.05559645965695381, 0.06571462750434875, -0.10066509246826172, -0.19637645781040192, -0.13961999118328094, 0.053321629762649536, -0.0501713789999485, -0.07680725306272507, -0.006305384915322065, 0.16916429996490479, 0.07036837190389633, -0.14541980624198914, 0.08760280907154083, -0.2367175966501236, 0.09072978049516678, 0.015211207792162895, 0.07521085441112518, -0.016737932339310646, 0.024157056584954262, 0.056461211293935776, 0.07239684462547302, 0.05578698217868805, -0.2022629678249359, 0.15358535945415497, -0.11993742734193802, -0.09870436042547226, -0.1828535795211792, -0.027851391583681107, -0.13164155185222626, -0.023012667894363403, 0.09599721431732178, -0.024468183517456055, -0.09076054394245148, -0.13423149287700653, -0.005370444618165493, -0.06479215621948242, 0.02395722083747387, 0.04541151225566864, -0.1831570863723755, 0.013000166043639183, -0.0811031311750412, -0.018515711650252342, 0.06816847622394562, -0.15022233128547668, 0.15667007863521576, -0.07134924829006195, 0.14747440814971924, 0.0020059063099324703, -0.09070158004760742, -0.08514288812875748, -0.01490236446261406, 0.006404743995517492, 0.1339983493089676, -0.2030664086341858, -0.03503463417291641, -0.13570423424243927, 0.04266466200351715, -0.15095263719558716, 0.04426485300064087, 0.015601875260472298, 0.17375800013542175, -0.06038513407111168, 0.06750860065221786, 0.00003852810914395377, 0.11716733127832413, 0.00016999637591652572, -0.02511298842728138, 0.05954701080918312, 0.04733852297067642, -0.11557678878307343, 0.11758825182914734, 0.15493671596050262, 0.0012797146337106824, 0.094110868871212, 0.18945994973182678, 0.022035416215658188, -0.1779138445854187, 0.10397306084632874, 0.03825489431619644, -0.21560455858707428, -0.10827847570180893, 0.05573827028274536, -0.04806896671652794, -0.1361771523952484, -0.01252775453031063, 0.09267190843820572, 0.060446687042713165, 0.10248952358961105, -0.15195244550704956, 0.09956342726945877, -0.054585907608270645, -0.11642099916934967, 0.09291016310453415, -0.06935278326272964, -0.0015422303695231676, 0.039685752242803574, 0.1571178436279297, -0.06067420914769173, 0.1474781632423401, 0.05043406039476395, -0.01911458559334278, -0.09123235940933228, 0.0018890727078542113, 0.1003388911485672, -0.1553586721420288, -0.0503840297460556, 0.2202392816543579, -0.03979944810271263, 0.03814836964011192, 0.2724844515323639, 0.00008475239883409813, -0.03212116286158562, -0.03551974520087242, -0.06802248954772949, -0.056946925818920135, -0.12422992289066315, 0.1724911481142044, -0.05258869007229805, -0.019902199506759644, -0.08708270639181137, 0.008225821889936924, 0.11315328627824783, -0.07437857985496521, 0.08577698469161987, 0.10750394314527512, 0.019802043214440346, 0.009255814366042614, -0.23279297351837158, 0.06885754317045212, 0.05629408359527588, -0.12733784317970276, 0.04414699971675873, 0.0577022060751915, 0.07035402953624725, 0.14780953526496887, 0.06047918274998665, -0.17104578018188477, 0.0067961690947413445, 0.00713998032733798, 0.020373953506350517, 0.0791793093085289, 0.033296503126621246, 0.06264449656009674, 0.0611262246966362, 0.11352015286684036, 0.06027756631374359, 0.08890336751937866, -0.009058874100446701, -0.19567221403121948, -0.050633735954761505, 0.11343391984701157, 0.14282962679862976, 0.13114714622497559, 0.17506371438503265, -0.08169234544038773, 0.012735589407384396, -0.34823864698410034, 0.019307345151901245, 0.03253258392214775, 0.03264744579792023, 0.018196899443864822, -0.17740513384342194, -0.054246000945568085, -0.06255064904689789, -0.11994819343090057, -0.0028200517408549786, 0.06034531444311142, 0.04128297418355942, 0.0593964084982872, 0.07866279035806656, -0.044882092624902725, -0.1807606816291809, -0.25092804431915283, -0.04345904290676117, -0.06097431108355522, -0.10554824024438858, 0.05746038630604744, 0.19443722069263458, 0.025768093764781952, 0.17753002047538757, 0.061416253447532654, -0.1500694304704666, -0.020058780908584595, -0.03586693853139877, -0.12846286594867706, -0.015765493735671043, 0.06272765249013901, 0.037798959761857986, -0.03288750350475311, 0.17067475616931915, -0.07072620093822479, 0.09270002692937851, -0.07812187075614929, -0.029081618413329124, 0.14664947986602783, -0.02698129415512085, 0.07689407467842102, 0.1675308793783188, -0.031076794490218163, 0.1456630527973175, -0.0026666924823075533, -0.0016517750918865204, 0.1886228322982788, 0.05948276072740555, 0.021547069773077965, -0.06524942815303802, 0.00447166059166193, 0.01518356055021286, -0.14583314955234528, -0.0688832551240921, 0.052645180374383926, -0.044372886419296265, 0.16310270130634308, -0.1389465630054474, 0.09047208726406097, 0.12038058787584305, -0.013255137950181961, 0.1774561107158661, -0.13477562367916107, -0.06504888832569122, 0.11437352001667023, -0.035331401973962784, 0.024087956175208092, -0.09141754359006882, 0.1776372343301773, 0.11861361563205719, 0.027653660625219345, -0.14096599817276, -0.042442962527275085, 0.0908217653632164, -0.07546204328536987, -0.0396060086786747, 0.10354742407798767, -0.290221244096756, 0.00008289548713946715, 0.0792766883969307, 0.1830657571554184, -0.010519253090023994, -0.0548294335603714, 0.08322547376155853, 0.18892881274223328, 0.12202154844999313, -0.028787365183234215, 0.03388958051800728, -0.034533824771642685, -0.013513152487576008, 0.023329606279730797, -0.03849327191710472, 0.03372694179415703, 0.23640237748622894, 0.0862879827618599, 0.042830538004636765, 0.05659492313861847, 0.1505666971206665, 0.08549493551254272, -0.017539383843541145, -0.19872403144836426, -0.08945293724536896, -0.08311144262552261, -0.17268797755241394, -0.09340602904558182, -0.012921118177473545, 0.11033228039741516, -0.06769617646932602, 0.02710038796067238, 0.03663908690214157, -0.11198665201663971, 0.16967986524105072, -0.015013438649475574, 0.1549040675163269, 0.05913735553622246, 0.16419708728790283, -0.034720517694950104, 0.049483779817819595, 0.013116729445755482, 0.35967347025871277, -0.29091939330101013, -0.11686471849679947, -0.0682196170091629, -0.13267166912555695, -0.07085306942462921, 0.07943648844957352, -0.15554296970367432, 0.18457981944084167, -0.0732312798500061, 0.00229545752517879, 0.03302081301808357, 0.08033376932144165, 0.09472644329071045, -0.22373288869857788, -0.19655372202396393, -0.15144214034080505, -0.1394280046224594, 0.13295964896678925, 0.026462791487574577, 0.2485509067773819, -0.23056566715240479, -0.08229191601276398, -0.0910930261015892, -0.18537038564682007, -0.02355407364666462, 0.012805362232029438, 0.2140195071697235, 0.07062514871358871, -0.04603130370378494, 0.14223597943782806, 0.02021965943276882, 0.014359619468450546, -0.030181806534528732, -0.17241837084293365, 0.06173328310251236, 0.13297441601753235, 0.07425862550735474, 0.22257846593856812, 0.1423356682062149, 0.01412105280905962, 0.008548946119844913, 0.09690108895301819, -0.04563024267554283, 0.24534174799919128, 0.10278596729040146, 0.08337057381868362, -0.0792500302195549, 0.048201240599155426, 0.0033702938817441463, -0.034521326422691345, 0.03392482176423073, -0.10314851999282837, 0.08540757745504379, -0.07459145039319992, 0.048998989164829254, 0.04322529584169388, 0.05046238377690315, 0.10220596939325333, -0.07578868418931961, -0.012120365165174007, -0.040136512368917465, -0.01003305520862341, 0.021797943860292435, -0.04191040247678757, -0.071599081158638, 0.02420838177204132, 0.07920992374420166, 0.06080440431833267, -0.18961967527866364, 0.036526158452034, -0.1727919727563858, 0.0903933048248291, -0.12708503007888794, -0.17584377527236938, -0.044059764593839645, 0.08951903134584427, -0.21391496062278748, 0.16023388504981995, 0.034990474581718445, -0.14637677371501923, 0.05124848708510399, 0.08217915892601013, 0.12938673794269562, -0.10370706766843796, -0.09070514142513275, 0.017352789640426636, -0.14271628856658936, 0.07994074374437332, -0.20129448175430298, -0.059401486068964005, -0.17612947523593903, -0.036206960678100586, 0.16717307269573212, -0.00948099885135889, 0.10310933738946915, 0.09084544330835342, -0.21330009400844574, -0.03185167536139488, 0.08657423406839371, 0.0356023795902729, -0.12081389129161835, 0.04656471312046051, 0.023156264796853065, -0.03654342144727707, -0.009595329873263836, -0.06907310336828232, 0.12186073511838913, -0.0016514313174411654, 0.005423231516033411, 0.024830037727952003, 0.10688164830207825, -0.09736688435077667, -0.12490413337945938, 0.12339301407337189, 0.20637786388397217, 0.09917628765106201, -0.12064150720834732, 0.16642159223556519, -2.3453870302525253e-32, 0.13324464857578278, -0.0073854499496519566, 0.03530268371105194, -0.011410162784159184, -0.16625311970710754, 0.169180229306221, -0.01089426688849926, 0.02550344169139862, 0.06134136766195297, -0.13298702239990234, 0.1175789013504982, -0.10406869649887085, 0.07438243180513382, -0.11620175093412399, 0.13265608251094818, -0.01454772986471653, -0.050357937812805176, 0.2021135538816452, -0.06688734889030457, 0.12918700277805328, 0.1484752744436264, 0.14130771160125732, 0.055159732699394226, 0.09520886093378067, -0.2603910267353058, -0.06478551775217056, -0.08007009327411652, -0.17782168090343475, 0.07110077887773514, 0.02384115941822529, 0.04293030500411987, -0.011661467142403126, 0.06407610327005386, -0.07871948182582855, -0.15821847319602966, 0.08761806041002274, -0.030272845178842545, -0.18293766677379608, -0.18511341512203217, -0.04451257735490799, -0.002061959356069565, 0.19886471331119537, 0.3373396694660187, -0.25894200801849365, -0.09179878979921341, 0.13653606176376343, -0.09941205382347107, 0.03604966402053833, -0.10223815590143204, 0.10695919394493103, 0.0014058127999305725, 0.004735141526907682, 0.1016232967376709, 0.10706523060798645, 0.05356539785861969, -0.05348055437207222, -0.05801572650671005, 0.12527471780776978, -0.15954531729221344, 0.24939145147800446, 0.06282959878444672, -0.06151525676250458, 0.029739998281002045, -0.12845395505428314, -0.000603477586992085, 0.059237439185380936, 0.2483569085597992, -0.02345840074121952, 0.27004575729370117, -0.0787329226732254, -0.016599144786596298, 0.19527819752693176, -0.15170599520206451, -0.15568916499614716, 0.023040322586894035, -0.19080570340156555, -0.07958833128213882, 0.13809260725975037, 0.05824121832847595, -0.11716392636299133, -0.10729186236858368, -0.07082220911979675, 0.05121101438999176, -0.009128126315772533, -0.10197477787733078, 0.20060865581035614, 0.08904748409986496, 0.06489985436201096, 0.010677052661776543, -0.06935179978609085, 0.0040866173803806305, 0.13962872326374054, -0.06722408533096313, -0.04707758501172066, -0.1610117107629776, 0.009153124876320362, -0.074805848300457, -0.08436426520347595, -0.1788649708032608, 0.027453400194644928, 0.25028735399246216, -0.04052488133311272, -0.0048554143868386745, -0.09190050512552261, 0.010188157670199871, -0.04032342880964279, 0.2231394648551941, 0.0059244283474981785, -0.1645941138267517, -0.047341495752334595, -0.0018742858665063977, -0.21970976889133453, 0.05110342800617218, 0.11347057670354843, 0.14302119612693787, -0.02819184772670269, -0.005264290142804384, -0.2517238259315491, 0.1415429711341858, -0.10883542150259018, -0.09608039259910583, 0.044638741761446, -0.23780591785907745, 0.057897355407476425, -0.11634336411952972, 0.1617984026670456, -0.1810152381658554, -0.015414074063301086, 0.11572176963090897, 0.04040778800845146, -0.00916612520813942, -0.0820082351565361, 7.368839192167798e-7, -0.11496460437774658, -0.03781089559197426, -0.1226867213845253, -0.25061216950416565, -0.09208749979734421, 0.04679339751601219, -0.21329422295093536, 0.05700104683637619, -0.1981053650379181, 0.07716833800077438, 0.08950432389974594, -0.04472940042614937, 0.022359929978847504, -0.11398616433143616, 0.08652153611183167, 0.025437090545892715, -0.14667730033397675, -0.030345633625984192, -0.10570146143436432, 0.09960229694843292, 0.057492535561323166, 0.1283443421125412, 0.05789026990532875, -0.11575362086296082, -0.004430453758686781, 0.011632061563432217, -0.12309035658836365, -0.009722772054374218, 0.07097528129816055, 0.04516316205263138, -0.0022654449567198753, -0.0932774767279625, 0.08510994911193848, -0.06615117937326431, 0.07883913069963455, -0.05826832354068756, -0.044472090899944305, -0.07298123091459274, 0.08683886379003525, 0.08297531306743622, 0.18528100848197937, -0.05810929462313652, -0.05187788978219032, -0.03469706326723099, -0.07793477177619934, 0.04864369332790375, -0.048635274171829224, 0.0244004987180233, 0.01151952426880598, 0.028354212641716003, 0.12124872207641602, 0.20499877631664276, 0.05366382375359535, 0.30239182710647583, -0.05711799114942551, -0.11593013256788254, 0.03553188964724541, -0.1232224553823471, 0.12947939336299896, -0.002984768943861127, -0.1537279486656189, -0.03734251484274864, 0.038053933531045914, -0.06890949606895447, 0.174125075340271, -0.09218081086874008, 0.07175680249929428, 1.5803389674315508e-34, -0.10615961998701096, 0.10988868772983551, 0.11952478438615799, -0.06726442277431488, -0.0015154849970713258, 0.08473052829504013, -0.01729799248278141, 0.10712529718875885, -0.12663070857524872, 0.009819615632295609, -0.016002990305423737 ]